Skip to content

Commit 6ecb478

Browse files
committed
Merge branch 'command-retry-loop' into 'master'
Automatically retry CLI commands after session unlocking See merge request MatrixAI/Engineering/Polykey/js-polykey!213
2 parents 475266f + 063a366 commit 6ecb478

323 files changed

Lines changed: 16236 additions & 15196 deletions

File tree

Some content is hidden

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

.eslintrc

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,36 @@
1414
"prettier",
1515
"prettier/@typescript-eslint"
1616
],
17+
"plugins": [
18+
"import"
19+
],
1720
"parserOptions": {
21+
"project": "tsconfig.json",
1822
"sourceType": "module",
1923
"ecmaVersion": 2020
2024
},
21-
"globals": {
22-
"fail": "readonly"
23-
},
2425
"rules": {
2526
"linebreak-style": ["error", "unix"],
2627
"no-empty": 1,
27-
"no-undef": 1,
28+
"no-undef": 0,
2829
"no-useless-catch": 1,
2930
"no-prototype-builtins": 1,
3031
"no-constant-condition": 0,
3132
"no-useless-escape" : 0,
3233
"no-console": "error",
3334
"eqeqeq": ["error", "smart"],
35+
"spaced-comment": [
36+
"warn",
37+
"always",
38+
{
39+
"line": {
40+
"exceptions": ["-"]
41+
},
42+
"block": {
43+
"exceptions": ["*"]
44+
}
45+
}
46+
],
3447
"capitalized-comments": [
3548
"warn",
3649
"always",
@@ -39,6 +52,34 @@
3952
"ignoreConsecutiveComments": true
4053
}
4154
],
55+
"import/order": [
56+
"error",
57+
{
58+
"groups": [
59+
"type",
60+
"builtin",
61+
"external",
62+
"internal",
63+
"index",
64+
"sibling",
65+
"parent",
66+
"object"
67+
],
68+
"pathGroups": [
69+
{
70+
"pattern": "@",
71+
"group": "internal"
72+
},
73+
{
74+
"pattern": "@/**",
75+
"group": "internal"
76+
}
77+
],
78+
"pathGroupsExcludedImportTypes": [
79+
"type"
80+
]
81+
}
82+
],
4283
"@typescript-eslint/no-namespace": 0,
4384
"@typescript-eslint/no-explicit-any": 0,
4485
"@typescript-eslint/explicit-module-boundary-types": 0,
@@ -56,6 +97,16 @@
5697
"@typescript-eslint/ban-ts-comment": 0,
5798
"@typescript-eslint/no-empty-function": 0,
5899
"@typescript-eslint/no-empty-interface": 0,
100+
"@typescript-eslint/consistent-type-imports": ["error"],
101+
"no-throw-literal": "off",
102+
"@typescript-eslint/no-throw-literal": ["error"],
103+
"@typescript-eslint/no-floating-promises": ["error", {
104+
"ignoreVoid": true,
105+
"ignoreIIFE": true
106+
}],
107+
"@typescript-eslint/no-misused-promises": ["error", {
108+
"checksVoidReturn": false
109+
}],
59110
"@typescript-eslint/naming-convention": [
60111
"error",
61112
{
@@ -66,7 +117,7 @@
66117
},
67118
{
68119
"selector": "variable",
69-
"format": ["camelCase", "UPPER_CASE"],
120+
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
70121
"leadingUnderscore": "allow",
71122
"trailingUnderscore": "allowSingleOrDouble"
72123
},

README.md

Lines changed: 14 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
# js-polykey
1+
# Polykey
22

33
[![pipeline status](https://gitlab.com/MatrixAI/open-source/js-polykey/badges/master/pipeline.svg)](https://gitlab.com/MatrixAI/open-source/js-polykey/commits/master)
44

55
This is the core library for running PolyKey. It provides a CLI `polykey` or `pk` for interacting with the PolyKey system.
66

7-
For reference and development guide, see the: [wiki](https://github.com/MatrixAI/js-polykey/wiki).
8-
9-
The master-project for Polykey is https://github.com/MatrixAI/Polykey.
7+
For tutorials, how-to guides, reference and theory, see the [wiki](https://github.com/MatrixAI/Polykey/wiki).
108

119
## Installation
1210

13-
Building the package:
11+
### NPM
1412

1513
```sh
16-
nix-build -E '(import ./pkgs.nix).callPackage ./default.nix {}'
14+
npm install --save polykey
1715
```
1816

17+
### Nix/NixOS
18+
1919
Building the releases:
2020

2121
```sh
2222
nix-build ./release.nix --attr application
2323
nix-build ./release.nix --attr docker
24+
nix-build ./release.nix --attr package.linux.x64.elf
25+
nix-build ./release.nix --attr package.windows.x64.exe
26+
nix-build ./release.nix --attr package.macos.x64.macho
2427
```
2528

2629
Install into Nix user profile:
@@ -29,6 +32,8 @@ Install into Nix user profile:
2932
nix-env -f ./release.nix --install --attr application
3033
```
3134

35+
### Docker
36+
3237
Install into Docker:
3338

3439
```sh
@@ -62,63 +67,23 @@ Once you update the `src/proto/schemas` files, run this to update the `src/proto
6267
npm run proto-generate
6368
```
6469

65-
### Calling Executables
70+
### Executing Commands
6671

67-
When calling executables in development, use this style:
72+
When calling commands in development, use this style:
6873

6974
```sh
7075
npm run polykey -- p1 p2 p3
7176
```
7277

7378
The `--` is necessary to make `npm` understand that the parameters are for your own executable, and not parameters to `npm`.
7479

75-
### Path Aliases
76-
77-
Due to https://github.com/microsoft/TypeScript/issues/10866, you cannot use path aliases without a bundler like Webpack to further transform the generated JavaScript code in order to resolve the path aliases. Because this is a simple library demonstration, there's no need to use a bundler. In fact, for such libraries, it is far more efficient to not bundle the code.
78-
79-
However we have left the path alias configuration in `tsconfig.json`, `jest.config.js` and in the tests we are making use of the `@` alias.
80-
81-
### Using the REPL
82-
83-
```
84-
$ npm run ts-node
85-
> import fs from 'fs';
86-
> fs
87-
> import { Library } from '@';
88-
> Library
89-
> import Library as Library2 from './src/lib/Library';
90-
```
91-
92-
You can also create test files in `./src`, and run them with `npm run ts-node ./src/test.ts`.
93-
94-
This allows you to test individual pieces of typescript code and it makes it easier when doing large scale rearchitecting of TypeScript code.
95-
96-
#### VSCode Path Aliases
97-
98-
VSCode cannot follow path aliases in our tests due to
99-
https://github.com/microsoft/vscode/issues/94474.
100-
101-
To resolve this, add `./tests/**/*` into the `tsconfig` `include` section:
102-
103-
```json
104-
"include": [
105-
"./src/**/*",
106-
"./tests/**/*'
107-
]
108-
```
109-
110-
This will however make `tsc` build the `tests` into the `dist` output.
111-
112-
**Therefore this fix should only be done in your own workspace, do not commit or push this change up.**
113-
114-
11580
### Docs Generation
11681

11782
```sh
11883
npm run docs
11984
```
12085

121-
See the docs at: https://matrixai.github.io/TypeScript-Demo-Lib/
86+
See the docs at: https://matrixai.github.io/Polykey/
12287

12388
### Publishing
12489

0 commit comments

Comments
 (0)