Skip to content

Commit 15c755f

Browse files
authored
Merge pull request #2 from MatrixAI/feature-CLI_migration
CLI extracted from Polykey and migrated to Polykey-CLI
2 parents cf2b9fb + 75717b2 commit 15c755f

File tree

178 files changed

+32678
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+32678
-0
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
indent_style = space
6+
indent_size = 2
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true

.env.example

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Unused atm (jest sets this to `test`)
2+
NODE_ENV=development
3+
4+
# Debug node modules - https://nodejs.org/api/cli.html#node_debugmodule
5+
# NODE_DEBUG=
6+
7+
# Debug node native modules - https://nodejs.org/api/cli.html#node_debug_nativemodule
8+
# NODE_DEBUG_NATIVE=
9+
10+
# Path to PK executable to override tests/bin target
11+
# PK_TEST_COMMAND=
12+
13+
# If set, indicates that `PK_TEST_COMMAND` is targetting docker
14+
# PK_TEST_COMMAND_DOCKER=
15+
# Accessing AWS for testnet.polykey.io and mainnet.polykey.io deployment
16+
AWS_DEFAULT_REGION='ap-southeast-2'
17+
AWS_ACCESS_KEY_ID=
18+
AWS_SECRET_ACCESS_KEY=
19+
20+
# Path to container registry authentication file used by `skopeo`
21+
# The file has the same contents as `DOCKER_AUTH_CONFIG`
22+
# Use this command to acquire the auth file at `./tmp/auth.json`:
23+
# ```
24+
# printf 'PASSWORD' | skopeo login \
25+
# --username 'USERNAME' \
26+
# --password-stdin \
27+
# $CI_REGISTRY_IMAGE \
28+
# --authfile=./tmp/auth.json
29+
# ```
30+
# REGISTRY_AUTH_FILE=
31+
32+
# Authenticate to GitHub with `gh`
33+
# GITHUB_TOKEN=
34+
35+
# To allow testing different executables in the bin tests
36+
# Both PK_TEST_COMMAND and PK_TEST_PLATFORM must be set at the same time
37+
# PK_TEST_COMMAND= #Specify the shell command we want to test against
38+
# PK_TEST_PLATFORM=docker #Overrides the auto set `testPlatform` variable used for enabling platform specific tests
39+
# PK_TEST_TMPDIR= #Sets the `global.tmpDir` variable to allow overriding the temp directory used for tests
40+

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/proto/*

.eslintrc

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es2021": true,
6+
"node": true,
7+
"jest": true
8+
},
9+
"parser": "@typescript-eslint/parser",
10+
"extends": [
11+
"eslint:recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"plugin:prettier/recommended"
14+
],
15+
"plugins": [
16+
"import"
17+
],
18+
"parserOptions": {
19+
"project": "tsconfig.json",
20+
"sourceType": "module"
21+
},
22+
"rules": {
23+
"linebreak-style": ["error", "unix"],
24+
"no-empty": 1,
25+
"no-useless-catch": 1,
26+
"no-prototype-builtins": 1,
27+
"no-constant-condition": 0,
28+
"no-useless-escape": 0,
29+
"no-console": "error",
30+
"no-restricted-globals": [
31+
"error",
32+
{
33+
"name": "global",
34+
"message": "Use `globalThis` instead"
35+
},
36+
{
37+
"name": "window",
38+
"message": "Use `globalThis` instead"
39+
}
40+
],
41+
"require-yield": 0,
42+
"eqeqeq": ["error", "smart"],
43+
"spaced-comment": [
44+
"warn",
45+
"always",
46+
{
47+
"line": {
48+
"exceptions": ["-"]
49+
},
50+
"block": {
51+
"exceptions": ["*"]
52+
},
53+
"markers": ["/"]
54+
}
55+
],
56+
"capitalized-comments": [
57+
"warn",
58+
"always",
59+
{
60+
"ignoreInlineComments": true,
61+
"ignoreConsecutiveComments": true
62+
}
63+
],
64+
"curly": [
65+
"error",
66+
"multi-line",
67+
"consistent"
68+
],
69+
"import/order": [
70+
"error",
71+
{
72+
"groups": [
73+
"type",
74+
"builtin",
75+
"external",
76+
"internal",
77+
"index",
78+
"sibling",
79+
"parent",
80+
"object"
81+
],
82+
"pathGroups": [
83+
{
84+
"pattern": "@",
85+
"group": "internal"
86+
},
87+
{
88+
"pattern": "@/**",
89+
"group": "internal"
90+
}
91+
],
92+
"pathGroupsExcludedImportTypes": [
93+
"type"
94+
],
95+
"newlines-between": "never"
96+
}
97+
],
98+
"@typescript-eslint/no-namespace": 0,
99+
"@typescript-eslint/no-explicit-any": 0,
100+
"@typescript-eslint/explicit-module-boundary-types": 0,
101+
"@typescript-eslint/no-unused-vars": [
102+
"warn",
103+
{
104+
"varsIgnorePattern": "^_",
105+
"argsIgnorePattern": "^_"
106+
}
107+
],
108+
"@typescript-eslint/no-inferrable-types": 0,
109+
"@typescript-eslint/no-non-null-assertion": 0,
110+
"@typescript-eslint/no-this-alias": 0,
111+
"@typescript-eslint/no-var-requires": 0,
112+
"@typescript-eslint/no-empty-function": 0,
113+
"@typescript-eslint/no-empty-interface": 0,
114+
"@typescript-eslint/consistent-type-imports": ["error"],
115+
"@typescript-eslint/consistent-type-exports": ["error"],
116+
"no-throw-literal": "off",
117+
"@typescript-eslint/no-throw-literal": "off",
118+
"@typescript-eslint/no-floating-promises": ["error", {
119+
"ignoreVoid": true,
120+
"ignoreIIFE": true
121+
}],
122+
"@typescript-eslint/no-misused-promises": ["error", {
123+
"checksVoidReturn": false
124+
}],
125+
"@typescript-eslint/await-thenable": ["error"],
126+
"@typescript-eslint/naming-convention": [
127+
"error",
128+
{
129+
"selector": "default",
130+
"format": ["camelCase"],
131+
"leadingUnderscore": "allow",
132+
"trailingUnderscore": "allowSingleOrDouble"
133+
},
134+
{
135+
"selector": "function",
136+
"format": ["camelCase", "PascalCase"],
137+
"leadingUnderscore": "allow",
138+
"trailingUnderscore": "allowSingleOrDouble"
139+
},
140+
{
141+
"selector": "variable",
142+
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
143+
"leadingUnderscore": "allow",
144+
"trailingUnderscore": "allowSingleOrDouble"
145+
},
146+
{
147+
"selector": "parameter",
148+
"format": ["camelCase"],
149+
"leadingUnderscore": "allow",
150+
"trailingUnderscore": "allowSingleOrDouble"
151+
},
152+
{
153+
"selector": "typeLike",
154+
"format": ["PascalCase"],
155+
"trailingUnderscore": "allowSingleOrDouble"
156+
},
157+
{
158+
"selector": "enumMember",
159+
"format": ["PascalCase", "UPPER_CASE"]
160+
},
161+
{
162+
"selector": "objectLiteralProperty",
163+
"format": null
164+
},
165+
{
166+
"selector": "typeProperty",
167+
"format": null
168+
}
169+
],
170+
"@typescript-eslint/ban-ts-comment": [
171+
"error",
172+
{
173+
"ts-ignore": "allow-with-description"
174+
}
175+
]
176+
}
177+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This workflow was added by CodeSee. Learn more at https://codesee.io/
2+
# This is v2.0 of this workflow file
3+
on:
4+
push:
5+
branches:
6+
- staging
7+
pull_request_target:
8+
types: [opened, synchronize, reopened]
9+
10+
name: CodeSee
11+
12+
permissions: read-all
13+
14+
jobs:
15+
codesee:
16+
runs-on: ubuntu-latest
17+
continue-on-error: true
18+
name: Analyze the repo with CodeSee
19+
steps:
20+
- uses: Codesee-io/codesee-action@v2
21+
with:
22+
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
23+
codesee-url: https://app.codesee.io

.gitignore

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/tmp
2+
/dist
3+
.env*
4+
!.env.example
5+
# nix
6+
/result*
7+
/builds
8+
# node-gyp
9+
/build
10+
# prebuildify
11+
/prebuilds
12+
13+
# Logs
14+
logs
15+
*.log
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
lerna-debug.log*
20+
21+
# Diagnostic reports (https://nodejs.org/api/report.html)
22+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
23+
24+
# Runtime data
25+
pids
26+
*.pid
27+
*.seed
28+
*.pid.lock
29+
30+
# Directory for instrumented libs generated by jscoverage/JSCover
31+
lib-cov
32+
33+
# Coverage directory used by tools like istanbul
34+
coverage
35+
*.lcov
36+
37+
# nyc test coverage
38+
.nyc_output
39+
40+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
41+
.grunt
42+
43+
# Bower dependency directory (https://bower.io/)
44+
bower_components
45+
46+
# node-waf configuration
47+
.lock-wscript
48+
49+
# Compiled binary addons (https://nodejs.org/api/addons.html)
50+
build/Release
51+
52+
# Dependency directories
53+
node_modules/
54+
jspm_packages/
55+
56+
# Snowpack dependency directory (https://snowpack.dev/)
57+
web_modules/
58+
59+
# TypeScript cache
60+
*.tsbuildinfo
61+
62+
# Optional npm cache directory
63+
.npm
64+
65+
# Optional eslint cache
66+
.eslintcache
67+
68+
# Microbundle cache
69+
.rpt2_cache/
70+
.rts2_cache_cjs/
71+
.rts2_cache_es/
72+
.rts2_cache_umd/
73+
74+
# Optional REPL history
75+
.node_repl_history
76+
77+
# Output of 'npm pack'
78+
*.tgz
79+
80+
# Yarn Integrity file
81+
.yarn-integrity
82+
83+
# dotenv environment variables file
84+
.env
85+
.env.test
86+
87+
# parcel-bundler cache (https://parceljs.org/)
88+
.cache
89+
.parcel-cache
90+
91+
# Next.js build output
92+
.next
93+
out
94+
95+
# Nuxt.js build / generate output
96+
.nuxt
97+
dist
98+
99+
# Gatsby files
100+
.cache/
101+
# Comment in the public line in if your project uses Gatsby and not Next.js
102+
# https://nextjs.org/blog/next-9-1#public-directory-support
103+
# public
104+
105+
# vuepress build output
106+
.vuepress/dist
107+
108+
# Serverless directories
109+
.serverless/
110+
111+
# FuseBox cache
112+
.fusebox/
113+
114+
# DynamoDB Local files
115+
.dynamodb/
116+
117+
# TernJS port file
118+
.tern-port
119+
120+
# Stores VSCode versions used for testing VSCode extensions
121+
.vscode-test
122+
123+
# yarn v2
124+
.yarn/cache
125+
.yarn/unplugged
126+
.yarn/build-state.yml
127+
.yarn/install-state.gz
128+
.pnp.*
129+
130+
# editor
131+
.vscode/
132+
.idea/

0 commit comments

Comments
 (0)