@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/webpack.config.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import Path from 'path'
|
|
3
|
-
import { DefinePlugin, Configuration, WebpackPluginInstance, NormalModuleReplacementPlugin } from 'webpack'
|
|
4
|
-
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
|
|
5
|
-
import TerserPlugin from 'terser-webpack-plugin'
|
|
6
|
-
import PackageJson from './package.json'
|
|
7
|
-
import { getBrowserPathMapping } from './jest.config'
|
|
8
|
-
|
|
9
|
-
interface WebpackEnvParams {
|
|
10
|
-
target: 'web' | 'node'
|
|
11
|
-
debug: boolean
|
|
12
|
-
mode: 'production' | 'development'
|
|
13
|
-
fileName: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const base = async (env?: Partial<WebpackEnvParams>): Promise<Configuration> => {
|
|
17
|
-
const isProduction = env?.mode === 'production'
|
|
18
|
-
const isBrowser = env?.target === 'web'
|
|
19
|
-
const filename =
|
|
20
|
-
env?.fileName ||
|
|
21
|
-
['index', isBrowser ? '.browser' : null, isProduction ? '.min' : null, '.js'].filter(Boolean).join('')
|
|
22
|
-
const entry = Path.resolve(__dirname, 'src')
|
|
23
|
-
const path = Path.resolve(__dirname, 'dist')
|
|
24
|
-
const target = env?.target || 'web' // 'node' or 'web'
|
|
25
|
-
const plugins: WebpackPluginInstance[] = [
|
|
26
|
-
new DefinePlugin({
|
|
27
|
-
'process.env.ENV': env?.mode || 'development',
|
|
28
|
-
'process.env.IS_WEBPACK_BUILD': 'true',
|
|
29
|
-
}),
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
if (target === 'web') {
|
|
33
|
-
const browserPathMapping = await getBrowserPathMapping()
|
|
34
|
-
// eslint-disable-next-line guard-for-in
|
|
35
|
-
for (const nodeReference in browserPathMapping) {
|
|
36
|
-
plugins.push(
|
|
37
|
-
new NormalModuleReplacementPlugin(new RegExp(`\\${nodeReference}`), browserPathMapping[nodeReference]),
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
// change node modules to browser modules according to packageJson.browser mapping
|
|
41
|
-
// eslint-disable-next-line guard-for-in
|
|
42
|
-
const browserModuleMapping = PackageJson.browser as { [key: string]: string }
|
|
43
|
-
// eslint-disable-next-line guard-for-in
|
|
44
|
-
for (const nodeReference in browserModuleMapping) {
|
|
45
|
-
const browserReference: string = browserModuleMapping[nodeReference]
|
|
46
|
-
plugins.push(new NormalModuleReplacementPlugin(new RegExp(`^${nodeReference}$`), browserReference))
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
bail: Boolean(isProduction),
|
|
52
|
-
mode: env?.mode || 'development',
|
|
53
|
-
devtool: isProduction ? 'source-map' : 'cheap-module-source-map',
|
|
54
|
-
entry,
|
|
55
|
-
output: {
|
|
56
|
-
path,
|
|
57
|
-
filename,
|
|
58
|
-
sourceMapFilename: filename + '.map',
|
|
59
|
-
library: 'BeeJs',
|
|
60
|
-
libraryTarget: 'umd',
|
|
61
|
-
globalObject: 'this',
|
|
62
|
-
},
|
|
63
|
-
module: {
|
|
64
|
-
rules: [
|
|
65
|
-
{
|
|
66
|
-
test: /\.(ts|js)$/,
|
|
67
|
-
// include: entry,
|
|
68
|
-
use: {
|
|
69
|
-
loader: 'babel-loader',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
resolve: {
|
|
75
|
-
extensions: ['.ts', '.js'],
|
|
76
|
-
fallback: {
|
|
77
|
-
path: false,
|
|
78
|
-
fs: false,
|
|
79
|
-
stream: false,
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
optimization: {
|
|
83
|
-
minimize: isProduction,
|
|
84
|
-
minimizer: [
|
|
85
|
-
// This is only used in production mode
|
|
86
|
-
new TerserPlugin({
|
|
87
|
-
terserOptions: {
|
|
88
|
-
parse: {
|
|
89
|
-
// we want terser to parse ecma 8 code. However, we don't want it
|
|
90
|
-
// to apply any minfication steps that turns valid ecma 5 code
|
|
91
|
-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
|
|
92
|
-
// sections only apply transformations that are ecma 5 safe
|
|
93
|
-
// https://github.com/facebook/create-react-app/pull/4234
|
|
94
|
-
ecma: 2018,
|
|
95
|
-
},
|
|
96
|
-
compress: {
|
|
97
|
-
ecma: 5,
|
|
98
|
-
},
|
|
99
|
-
mangle: {
|
|
100
|
-
safari10: true,
|
|
101
|
-
},
|
|
102
|
-
output: {
|
|
103
|
-
ecma: 5,
|
|
104
|
-
comments: false,
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
// Use multi-process parallel running to improve the build speed
|
|
108
|
-
// Default number of concurrent runs: os.cpus().length - 1
|
|
109
|
-
parallel: true,
|
|
110
|
-
}),
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
plugins,
|
|
114
|
-
target,
|
|
115
|
-
node: {
|
|
116
|
-
global: true,
|
|
117
|
-
__filename: 'mock',
|
|
118
|
-
__dirname: 'mock',
|
|
119
|
-
},
|
|
120
|
-
performance: {
|
|
121
|
-
hints: false,
|
|
122
|
-
},
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export default async (env?: Partial<WebpackEnvParams>): Promise<Configuration> => {
|
|
127
|
-
// eslint-disable-next-line no-console
|
|
128
|
-
console.log('env', env)
|
|
129
|
-
|
|
130
|
-
if (env?.debug) {
|
|
131
|
-
const config = {
|
|
132
|
-
...(await base(env)),
|
|
133
|
-
plugins: [new BundleAnalyzerPlugin()],
|
|
134
|
-
profile: true,
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return config
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return base(env)
|
|
141
|
-
}
|