@ethersphere/bee-js 2.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/src/bee-debug.d.ts +5 -1
- package/dist/src/bee.d.ts +23 -46
- package/dist/src/modules/chunk.d.ts +2 -10
- package/dist/src/modules/debug/status.d.ts +10 -4
- package/dist/src/types/debug.d.ts +19 -0
- package/dist/src/types/index.d.ts +31 -2
- package/dist/src/utils/bytes.d.ts +1 -1
- package/dist/src/utils/error.d.ts +21 -2
- package/dist/src/utils/expose.d.ts +1 -0
- package/dist/src/utils/http.d.ts +7 -9
- package/dist/src/utils/stamps.d.ts +12 -0
- package/dist/src/utils/type.d.ts +6 -0
- package/package.json +28 -27
- package/.babelrc.js +0 -33
- package/.depcheckrc.json +0 -27
- package/.editorconfig +0 -6
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -109
- package/.gitattributes +0 -1
- package/.github/config.yaml +0 -23
- package/.github/workflows/check.yaml +0 -57
- package/.github/workflows/publish_npmjs.yaml +0 -20
- package/.github/workflows/release_github.yaml +0 -20
- package/.github/workflows/tests.yaml +0 -128
- package/.huskyrc +0 -5
- package/.prettierrc +0 -13
- package/.vscode/launch.json +0 -49
- package/.vscode/settings.json +0 -39
- package/CHANGELOG.md +0 -520
- package/CODEOWNERS +0 -1
- package/CODE_OF_CONDUCT.md +0 -76
- package/commitlint.config.js +0 -3
- package/dist/src/modules/stamps.d.ts +0 -4
- package/jest-puppeteer.config.js +0 -5
- package/jest.config.ts +0 -85
- package/src/bee-debug.ts +0 -601
- package/src/bee.ts +0 -1087
- package/src/chunk/bmt.ts +0 -55
- package/src/chunk/cac.ts +0 -79
- package/src/chunk/serialize.ts +0 -16
- package/src/chunk/signer.ts +0 -141
- package/src/chunk/soc.ts +0 -190
- package/src/chunk/span.ts +0 -33
- package/src/feed/index.ts +0 -217
- package/src/feed/json.ts +0 -33
- package/src/feed/topic.ts +0 -23
- package/src/feed/type.ts +0 -12
- package/src/index.ts +0 -24
- package/src/modules/bytes.ts +0 -70
- package/src/modules/bzz.ts +0 -179
- package/src/modules/chunk.ts +0 -69
- package/src/modules/debug/balance.ts +0 -63
- package/src/modules/debug/chequebook.ts +0 -175
- package/src/modules/debug/chunk.ts +0 -39
- package/src/modules/debug/connectivity.ts +0 -61
- package/src/modules/debug/settlements.ts +0 -33
- package/src/modules/debug/stamps.ts +0 -96
- package/src/modules/debug/states.ts +0 -35
- package/src/modules/debug/status.ts +0 -34
- package/src/modules/debug/tag.ts +0 -19
- package/src/modules/debug/transactions.ts +0 -79
- package/src/modules/feed.ts +0 -105
- package/src/modules/pinning.ts +0 -74
- package/src/modules/pss.ts +0 -49
- package/src/modules/soc.ts +0 -40
- package/src/modules/stamps.ts +0 -59
- package/src/modules/status.ts +0 -13
- package/src/modules/stewardship.ts +0 -32
- package/src/modules/tag.ts +0 -83
- package/src/types/debug.ts +0 -204
- package/src/types/index.ts +0 -561
- package/src/types/ky-universal/common.d.ts +0 -17
- package/src/types/ky-universal/hooks.d.ts +0 -103
- package/src/types/ky-universal/index.d.ts +0 -125
- package/src/types/ky-universal/options.d.ts +0 -235
- package/src/types/ky-universal/response.d.ts +0 -38
- package/src/types/ky-universal/retry.d.ts +0 -39
- package/src/types/tar-js.d.ts +0 -1
- package/src/types/webpack-bundle-analyzer/index.d.ts +0 -13
- package/src/utils/bytes.ts +0 -144
- package/src/utils/collection.ts +0 -151
- package/src/utils/data.browser.ts +0 -68
- package/src/utils/data.ts +0 -48
- package/src/utils/error.ts +0 -23
- package/src/utils/eth.ts +0 -229
- package/src/utils/expose.ts +0 -48
- package/src/utils/file.ts +0 -40
- package/src/utils/hash.ts +0 -16
- package/src/utils/headers.ts +0 -63
- package/src/utils/hex.ts +0 -186
- package/src/utils/http.ts +0 -141
- package/src/utils/merge.ts +0 -34
- package/src/utils/pss.ts +0 -16
- package/src/utils/stream.ts +0 -146
- package/src/utils/tar.ts +0 -30
- package/src/utils/type.ts +0 -394
- package/src/utils/uint64.ts +0 -31
- package/src/utils/url.ts +0 -52
- package/test/bee.sh +0 -187
- package/test/data/1.txt +0 -1
- package/test/data/2.txt +0 -0
- package/test/data/empty +0 -0
- package/test/data/sub/3.txt +0 -1
- package/test/data/sub//303/251 +0 -0
- package/test/data/sub//360/237/230/216 +0 -0
- package/test/integration/bee-class.browser.spec.ts +0 -272
- package/test/integration/bee-class.spec.ts +0 -648
- package/test/integration/bee-debug-class.spec.ts +0 -114
- package/test/integration/chunk/bmt.spec.ts +0 -33
- package/test/integration/chunk/cac.spec.ts +0 -27
- package/test/integration/chunk/soc.spec.ts +0 -38
- package/test/integration/feed/index.spec.ts +0 -84
- package/test/integration/modules/bytes.spec.ts +0 -23
- package/test/integration/modules/bzz.spec.ts +0 -265
- package/test/integration/modules/chunk.spec.ts +0 -29
- package/test/integration/modules/debug/balance.spec.ts +0 -70
- package/test/integration/modules/debug/chequebook.spec.ts +0 -64
- package/test/integration/modules/debug/connectivity.spec.ts +0 -69
- package/test/integration/modules/debug/settlements.spec.ts +0 -34
- package/test/integration/modules/debug/states.spec.ts +0 -34
- package/test/integration/modules/debug/status.spec.ts +0 -65
- package/test/integration/modules/debug/tag.spec.ts +0 -27
- package/test/integration/modules/debug/transactions.spec.ts +0 -10
- package/test/integration/modules/feed.spec.ts +0 -61
- package/test/integration/modules/pinning.spec.ts +0 -155
- package/test/integration/modules/pss.spec.ts +0 -105
- package/test/integration/modules/status.spec.ts +0 -10
- package/test/integration/modules/stewardship.spec.ts +0 -32
- package/test/integration/modules/tag.spec.ts +0 -51
- package/test/test-type-sequencer.js +0 -36
- package/test/testpage/testpage.html +0 -20
- package/test/tests-setup.ts +0 -94
- package/test/unit/assertions.ts +0 -460
- package/test/unit/bee-class.spec.ts +0 -976
- package/test/unit/bee-debug-class.spec.ts +0 -435
- package/test/unit/chunk/bmt.spec.ts +0 -16
- package/test/unit/chunk/cac.spec.ts +0 -29
- package/test/unit/chunk/serialize.spec.ts +0 -24
- package/test/unit/chunk/signer.spec.ts +0 -140
- package/test/unit/chunk/soc.spec.ts +0 -25
- package/test/unit/chunk/span.spec.ts +0 -38
- package/test/unit/feed/json.spec.ts +0 -73
- package/test/unit/nock.ts +0 -151
- package/test/unit/utils/bytes.spec.ts +0 -32
- package/test/unit/utils/collection.spec.ts +0 -22
- package/test/unit/utils/eth.spec.ts +0 -224
- package/test/unit/utils/hex.spec.ts +0 -115
- package/test/unit/utils/stream.spec.ts +0 -30
- package/test/unit/utils/type.spec.ts +0 -32
- package/test/unit/utils/uint64.spec.ts +0 -102
- package/test/utils.ts +0 -426
- package/tsconfig.json +0 -18
- package/tsconfig.test.json +0 -11
- package/typedoc.json +0 -7
- package/webpack.config.ts +0 -141
package/.eslintrc.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended'],
|
|
3
|
-
parserOptions: {
|
|
4
|
-
sourceType: 'module',
|
|
5
|
-
ecmaVersion: 2018,
|
|
6
|
-
project: './tsconfig.test.json',
|
|
7
|
-
},
|
|
8
|
-
env: {
|
|
9
|
-
jest: true,
|
|
10
|
-
},
|
|
11
|
-
globals: {
|
|
12
|
-
browser: true,
|
|
13
|
-
page: true,
|
|
14
|
-
},
|
|
15
|
-
plugins: ['jest', 'unused-imports'],
|
|
16
|
-
rules: {
|
|
17
|
-
'array-bracket-newline': ['error', 'consistent'],
|
|
18
|
-
strict: ['error', 'safe'],
|
|
19
|
-
'block-scoped-var': 'error',
|
|
20
|
-
complexity: 'warn',
|
|
21
|
-
'default-case': 'error',
|
|
22
|
-
'dot-notation': 'warn',
|
|
23
|
-
eqeqeq: 'error',
|
|
24
|
-
'guard-for-in': 'warn',
|
|
25
|
-
'linebreak-style': ['warn', 'unix'],
|
|
26
|
-
'no-alert': 'error',
|
|
27
|
-
'no-case-declarations': 'error',
|
|
28
|
-
'no-console': 'error',
|
|
29
|
-
'no-constant-condition': 'error',
|
|
30
|
-
'no-continue': 'warn',
|
|
31
|
-
'no-div-regex': 'error',
|
|
32
|
-
'no-empty': 'warn',
|
|
33
|
-
'no-empty-pattern': 'error',
|
|
34
|
-
'no-implicit-coercion': 'error',
|
|
35
|
-
'prefer-arrow-callback': 'warn',
|
|
36
|
-
'no-labels': 'error',
|
|
37
|
-
'no-loop-func': 'error',
|
|
38
|
-
'no-nested-ternary': 'warn',
|
|
39
|
-
'no-script-url': 'error',
|
|
40
|
-
'no-warning-comments': 'warn',
|
|
41
|
-
'quote-props': ['error', 'as-needed'],
|
|
42
|
-
'require-yield': 'error',
|
|
43
|
-
'max-nested-callbacks': ['error', 4],
|
|
44
|
-
'max-depth': ['error', 4],
|
|
45
|
-
'space-before-function-paren': [
|
|
46
|
-
'error',
|
|
47
|
-
{
|
|
48
|
-
anonymous: 'never',
|
|
49
|
-
named: 'never',
|
|
50
|
-
asyncArrow: 'always',
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
'padding-line-between-statements': [
|
|
54
|
-
'error',
|
|
55
|
-
{ blankLine: 'always', prev: '*', next: 'if' },
|
|
56
|
-
{ blankLine: 'always', prev: '*', next: 'function' },
|
|
57
|
-
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
58
|
-
],
|
|
59
|
-
'no-useless-constructor': 'off',
|
|
60
|
-
'no-dupe-class-members': 'off',
|
|
61
|
-
'no-unused-expressions': 'off',
|
|
62
|
-
curly: ['error', 'multi-line'],
|
|
63
|
-
'object-curly-spacing': ['error', 'always'],
|
|
64
|
-
'comma-dangle': ['error', 'always-multiline'],
|
|
65
|
-
'@typescript-eslint/no-useless-constructor': 'error',
|
|
66
|
-
'@typescript-eslint/no-unused-expressions': 'error',
|
|
67
|
-
'@typescript-eslint/member-delimiter-style': [
|
|
68
|
-
'error',
|
|
69
|
-
{
|
|
70
|
-
multiline: {
|
|
71
|
-
delimiter: 'none',
|
|
72
|
-
requireLast: true,
|
|
73
|
-
},
|
|
74
|
-
singleline: {
|
|
75
|
-
delimiter: 'semi',
|
|
76
|
-
requireLast: false,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
'@typescript-eslint/ban-ts-comment': [
|
|
81
|
-
'error',
|
|
82
|
-
{
|
|
83
|
-
'ts-expect-error': 'allow-with-description',
|
|
84
|
-
'ts-ignore': 'allow-with-description',
|
|
85
|
-
'ts-nocheck': 'allow-with-description',
|
|
86
|
-
'ts-check': 'allow-with-description',
|
|
87
|
-
minimumDescriptionLength: 6,
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
'require-await': 'off',
|
|
91
|
-
'@typescript-eslint/promise-function-async': 'error',
|
|
92
|
-
'@typescript-eslint/require-await': 'off',
|
|
93
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
94
|
-
'@typescript-eslint/no-unused-vars': 'off',
|
|
95
|
-
'unused-imports/no-unused-imports': 'error',
|
|
96
|
-
'unused-imports/no-unused-vars': [
|
|
97
|
-
'warn',
|
|
98
|
-
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
|
|
99
|
-
],
|
|
100
|
-
},
|
|
101
|
-
overrides: [
|
|
102
|
-
{
|
|
103
|
-
files: ['*.spec.ts'],
|
|
104
|
-
rules: {
|
|
105
|
-
'max-nested-callbacks': ['error', 10], // allow describe/it nesting
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
}
|
package/.gitattributes
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
* text=auto
|
package/.github/config.yaml
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
labels:
|
|
2
|
-
issue: type:issue
|
|
3
|
-
pull-request: type:pull-request
|
|
4
|
-
release:
|
|
5
|
-
trigger:
|
|
6
|
-
labels:
|
|
7
|
-
- 'autorelease: pending'
|
|
8
|
-
checklist: |
|
|
9
|
-
## 🚀 Release checklist
|
|
10
|
-
|
|
11
|
-
### Before release
|
|
12
|
-
|
|
13
|
-
- [ ] Ensure the release works with the intended `bee` version
|
|
14
|
-
- [ ] Verify all the example code works with the release code
|
|
15
|
-
- [ ] Verify all user documentation is up to date
|
|
16
|
-
- [ ] Have two approval for this PR
|
|
17
|
-
- [ ] Write small summary for the release and verify changelog
|
|
18
|
-
- [ ] Verify that changes to release PR comment is synchronized to `CHANGELOG` with manual commit
|
|
19
|
-
|
|
20
|
-
### After release
|
|
21
|
-
|
|
22
|
-
- [ ] Update API docs
|
|
23
|
-
- [ ] Update example's `bee-js` version
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
name: Check
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- 'master'
|
|
7
|
-
pull_request:
|
|
8
|
-
branches:
|
|
9
|
-
- '**'
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
check:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
|
|
15
|
-
strategy:
|
|
16
|
-
matrix:
|
|
17
|
-
node-version: [14.x]
|
|
18
|
-
|
|
19
|
-
steps:
|
|
20
|
-
- uses: actions/checkout@v2
|
|
21
|
-
with:
|
|
22
|
-
fetch-depth: 0
|
|
23
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
24
|
-
uses: actions/setup-node@v1
|
|
25
|
-
with:
|
|
26
|
-
node-version: ${{ matrix.node-version }}
|
|
27
|
-
|
|
28
|
-
## Try getting the node modules from cache, if failed npm ci
|
|
29
|
-
- uses: actions/cache@v2
|
|
30
|
-
id: cache-npm
|
|
31
|
-
with:
|
|
32
|
-
path: node_modules
|
|
33
|
-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
34
|
-
restore-keys: |
|
|
35
|
-
${{ runner.OS }}-node-${{ env.cache-name }}-
|
|
36
|
-
${{ runner.OS }}-node-
|
|
37
|
-
${{ runner.OS }}-
|
|
38
|
-
- name: Install npm deps
|
|
39
|
-
if: steps.cache-npm.outputs.cache-hit != 'true'
|
|
40
|
-
run: npm ci
|
|
41
|
-
|
|
42
|
-
- name: Commit linting
|
|
43
|
-
uses: wagoid/commitlint-github-action@v2
|
|
44
|
-
|
|
45
|
-
- name: Code linting
|
|
46
|
-
run: npm run lint:check
|
|
47
|
-
env:
|
|
48
|
-
CI: true
|
|
49
|
-
|
|
50
|
-
- name: Dependency check
|
|
51
|
-
run: npm run depcheck
|
|
52
|
-
|
|
53
|
-
- name: Check typings
|
|
54
|
-
run: npm run check:types
|
|
55
|
-
|
|
56
|
-
- name: Build docs
|
|
57
|
-
run: npm run docs
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# After new release is published on github, publish it to npmjs
|
|
2
|
-
name: Publish on npmjs
|
|
3
|
-
|
|
4
|
-
on:
|
|
5
|
-
release:
|
|
6
|
-
types: [published]
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
publish:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v2
|
|
13
|
-
- uses: actions/setup-node@v1
|
|
14
|
-
with:
|
|
15
|
-
node-version: 14
|
|
16
|
-
registry-url: 'https://registry.npmjs.org'
|
|
17
|
-
- run: npm ci
|
|
18
|
-
- run: npm publish --access public
|
|
19
|
-
env:
|
|
20
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# On each new commit to master, create/update a PR with release
|
|
2
|
-
# automatically bumps version and creates changelog as per conventional commits
|
|
3
|
-
name: Release Github
|
|
4
|
-
|
|
5
|
-
on:
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
release-please:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: GoogleCloudPlatform/release-please-action@v2
|
|
15
|
-
id: release
|
|
16
|
-
with:
|
|
17
|
-
token: ${{ secrets.REPO_GHA_PAT }}
|
|
18
|
-
release-type: node
|
|
19
|
-
package-name: bee-js
|
|
20
|
-
bump-minor-pre-major: true
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
name: Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- 'master'
|
|
7
|
-
pull_request:
|
|
8
|
-
branches:
|
|
9
|
-
- '**'
|
|
10
|
-
|
|
11
|
-
env:
|
|
12
|
-
BEE_VERSION: '1.2.0-29eb9414-stateful'
|
|
13
|
-
BLOCKCHAIN_VERSION: '1.2.0-for-1.2.0-29eb9414-stateful'
|
|
14
|
-
BEE_ENV_PREFIX: 'swarm-test'
|
|
15
|
-
BEE_IMAGE_PREFIX: 'docker.pkg.github.com/ethersphere/bee-factory'
|
|
16
|
-
COMMIT_VERSION_TAG: 'false'
|
|
17
|
-
WORKERS: 4
|
|
18
|
-
BEE_API_URL: 'http://localhost:1633'
|
|
19
|
-
BEE_PEER_API_URL: 'http://localhost:11633'
|
|
20
|
-
BEE_DEBUG_API_URL: 'http://localhost:1635'
|
|
21
|
-
BEE_PEER_DEBUG_API_URL: 'http://localhost:11635'
|
|
22
|
-
BEE_TEST_CHEQUEBOOK: true
|
|
23
|
-
|
|
24
|
-
jobs:
|
|
25
|
-
nodejs:
|
|
26
|
-
runs-on: ubuntu-latest
|
|
27
|
-
|
|
28
|
-
strategy:
|
|
29
|
-
matrix:
|
|
30
|
-
node-version: [12.x, 14.x, 16.x]
|
|
31
|
-
|
|
32
|
-
steps:
|
|
33
|
-
- name: Checkout
|
|
34
|
-
uses: actions/checkout@v2
|
|
35
|
-
with:
|
|
36
|
-
fetch-depth: 1
|
|
37
|
-
|
|
38
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
39
|
-
uses: actions/setup-node@v1
|
|
40
|
-
with:
|
|
41
|
-
node-version: ${{ matrix.node-version }}
|
|
42
|
-
|
|
43
|
-
- name: Auth to Github Package Docker Registry
|
|
44
|
-
run: |
|
|
45
|
-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
|
|
46
|
-
|
|
47
|
-
# Setup Bee environment
|
|
48
|
-
- name: Start Bee Factory environment
|
|
49
|
-
run: |
|
|
50
|
-
git clone --depth=1 https://github.com/ethersphere/bee-factory.git
|
|
51
|
-
chmod +x -R ./bee-factory/scripts
|
|
52
|
-
./bee-factory/scripts/environment.sh start --detach --workers=$WORKERS
|
|
53
|
-
|
|
54
|
-
## Try getting the node modules from cache, if failed npm ci
|
|
55
|
-
- uses: actions/cache@v2
|
|
56
|
-
id: cache-npm
|
|
57
|
-
with:
|
|
58
|
-
path: node_modules
|
|
59
|
-
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
|
|
60
|
-
restore-keys: |
|
|
61
|
-
${{ runner.OS }}-node-${{ matrix.node }}-${{ env.cache-name }}-
|
|
62
|
-
${{ runner.OS }}-node-${{ matrix.node }}-
|
|
63
|
-
|
|
64
|
-
- name: Install npm deps
|
|
65
|
-
if: steps.cache-npm.outputs.cache-hit != 'true'
|
|
66
|
-
run: npm ci
|
|
67
|
-
|
|
68
|
-
- name: Run unit and integration tests for node
|
|
69
|
-
run: npm run test:node -- --detectOpenHandles
|
|
70
|
-
|
|
71
|
-
- name: Debug workflow if failed
|
|
72
|
-
if: failure()
|
|
73
|
-
run: |
|
|
74
|
-
KEYS=$(curl -sSf -X POST https://relay.tunshell.com/api/sessions)
|
|
75
|
-
curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**Bee JS**\nDebug -> \`sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} relay.tunshell.com\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.WEBHOOK_KEY }}
|
|
76
|
-
echo "Connect to github actions node using"
|
|
77
|
-
echo "sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} relay.tunshell.com"
|
|
78
|
-
curl -sSf https://lets.tunshell.com/init.sh | sh /dev/stdin T $(echo $KEYS | jq -r .peer1_key) ${{ secrets.TUNSHELL_SECRET }} relay.tunshell.com
|
|
79
|
-
|
|
80
|
-
browser:
|
|
81
|
-
runs-on: ubuntu-latest
|
|
82
|
-
|
|
83
|
-
strategy:
|
|
84
|
-
matrix:
|
|
85
|
-
node-version: [14.x]
|
|
86
|
-
|
|
87
|
-
steps:
|
|
88
|
-
- name: Checkout
|
|
89
|
-
uses: actions/checkout@v2
|
|
90
|
-
with:
|
|
91
|
-
fetch-depth: 1
|
|
92
|
-
|
|
93
|
-
- name: Auth to Github Package Docker Registry
|
|
94
|
-
run: |
|
|
95
|
-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
|
|
96
|
-
|
|
97
|
-
# Setup Bee environment
|
|
98
|
-
- name: Start Bee Factory environment
|
|
99
|
-
run: |
|
|
100
|
-
git clone --depth=1 https://github.com/ethersphere/bee-factory.git
|
|
101
|
-
chmod +x -R ./bee-factory/scripts
|
|
102
|
-
./bee-factory/scripts/environment.sh start --detach --workers=$WORKERS
|
|
103
|
-
|
|
104
|
-
## Try getting the node modules from cache, if failed npm ci
|
|
105
|
-
- uses: actions/cache@v2
|
|
106
|
-
id: cache-npm
|
|
107
|
-
with:
|
|
108
|
-
path: node_modules
|
|
109
|
-
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
|
|
110
|
-
restore-keys: |
|
|
111
|
-
${{ runner.OS }}-node-${{ matrix.node }}-${{ env.cache-name }}-
|
|
112
|
-
${{ runner.OS }}-node-${{ matrix.node }}-
|
|
113
|
-
|
|
114
|
-
- name: Install npm deps
|
|
115
|
-
if: steps.cache-npm.outputs.cache-hit != 'true'
|
|
116
|
-
run: npm ci
|
|
117
|
-
|
|
118
|
-
- name: Run browser tests
|
|
119
|
-
run: npm run test:browser
|
|
120
|
-
|
|
121
|
-
- name: Debug workflow if failed
|
|
122
|
-
if: failure()
|
|
123
|
-
run: |
|
|
124
|
-
KEYS=$(curl -sSf -X POST https://relay.tunshell.com/api/sessions)
|
|
125
|
-
curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**Bee JS**\nDebug -> \`sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} relay.tunshell.com\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.WEBHOOK_KEY }}
|
|
126
|
-
echo "Connect to github actions node using"
|
|
127
|
-
echo "sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} relay.tunshell.com"
|
|
128
|
-
curl -sSf https://lets.tunshell.com/init.sh | sh /dev/stdin T $(echo $KEYS | jq -r .peer1_key) ${{ secrets.TUNSHELL_SECRET }} relay.tunshell.com
|
package/.huskyrc
DELETED
package/.prettierrc
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"printWidth": 120,
|
|
3
|
-
"tabWidth": 2,
|
|
4
|
-
"useTabs": false,
|
|
5
|
-
"bracketSpacing": true,
|
|
6
|
-
"semi": false,
|
|
7
|
-
"singleQuote": true,
|
|
8
|
-
"quoteProps": "as-needed",
|
|
9
|
-
"trailingComma": "all",
|
|
10
|
-
"endOfLine": "lf",
|
|
11
|
-
"arrowParens": "avoid",
|
|
12
|
-
"proseWrap": "always"
|
|
13
|
-
}
|
package/.vscode/launch.json
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"name": "Run Jest tests",
|
|
6
|
-
"command": "npm run test",
|
|
7
|
-
"type": "node-terminal",
|
|
8
|
-
"request": "launch",
|
|
9
|
-
"env": {
|
|
10
|
-
"NODE_ENV": "development",
|
|
11
|
-
"BEE_API_URL": "http://localhost:1633",
|
|
12
|
-
"BEE_DEBUG_API_URL": "http://localhost:1635",
|
|
13
|
-
"BEE_PEER_API_URL": "http://localhost:11633",
|
|
14
|
-
"BEE_PEER_DEBUG_API_URL": "http://localhost:11635",
|
|
15
|
-
"BEE_TEST_CHEQUEBOOK": "true"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
"name": "Run One Specific Node Jest test",
|
|
21
|
-
"command": "npm run test:node -- --testPathPattern ${file}",
|
|
22
|
-
"type": "node-terminal",
|
|
23
|
-
"request": "launch",
|
|
24
|
-
"env": {
|
|
25
|
-
"NODE_ENV": "development",
|
|
26
|
-
"BEE_API_URL": "http://localhost:1633",
|
|
27
|
-
"BEE_DEBUG_API_URL": "http://localhost:1635",
|
|
28
|
-
"BEE_PEER_API_URL": "http://localhost:11633",
|
|
29
|
-
"BEE_PEER_DEBUG_API_URL": "http://localhost:11635",
|
|
30
|
-
"BEE_TEST_CHEQUEBOOK": "true"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
"name": "Run One Specific Browser Jest test",
|
|
36
|
-
"command": "npm run test:browser -- --testPathPattern ${file}",
|
|
37
|
-
"type": "node-terminal",
|
|
38
|
-
"request": "launch",
|
|
39
|
-
"env": {
|
|
40
|
-
"NODE_ENV": "development",
|
|
41
|
-
"BEE_API_URL": "http://localhost:1633",
|
|
42
|
-
"BEE_DEBUG_API_URL": "http://localhost:1635",
|
|
43
|
-
"BEE_PEER_API_URL": "http://localhost:11633",
|
|
44
|
-
"BEE_PEER_DEBUG_API_URL": "http://localhost:11635",
|
|
45
|
-
"BEE_TEST_CHEQUEBOOK": "true"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
package/.vscode/settings.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"editor.codeActionsOnSave": {
|
|
3
|
-
// For ESLint
|
|
4
|
-
"source.fixAll.eslint": true,
|
|
5
|
-
// For TSLint
|
|
6
|
-
"source.fixAll.tslint": true,
|
|
7
|
-
// For Stylelint
|
|
8
|
-
"source.fixAll.stylelint": true
|
|
9
|
-
},
|
|
10
|
-
"eslint.validate": ["javascript", "typescript"],
|
|
11
|
-
"editor.formatOnSave": true,
|
|
12
|
-
"[javascript]": {
|
|
13
|
-
"editor.formatOnSave": false
|
|
14
|
-
},
|
|
15
|
-
"[typescript]": {
|
|
16
|
-
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
|
17
|
-
"editor.codeActionsOnSave": {
|
|
18
|
-
"source.fixAll.eslint": true
|
|
19
|
-
},
|
|
20
|
-
"editor.formatOnSave": true
|
|
21
|
-
},
|
|
22
|
-
"[json]": {
|
|
23
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
24
|
-
"editor.codeActionsOnSave": {
|
|
25
|
-
"source.fixAll.eslint": true
|
|
26
|
-
},
|
|
27
|
-
"editor.formatOnSave": true
|
|
28
|
-
},
|
|
29
|
-
"[markdown]": {
|
|
30
|
-
"editor.formatOnSave": false
|
|
31
|
-
},
|
|
32
|
-
"search.exclude": {
|
|
33
|
-
"**/node_modules": true,
|
|
34
|
-
"**/dist": true,
|
|
35
|
-
"**/coverage": true
|
|
36
|
-
},
|
|
37
|
-
"typescript.referencesCodeLens.enabled": true,
|
|
38
|
-
"jest.runAllTestsFirst": false
|
|
39
|
-
}
|