@xyo-network/sdk-js 3.12.4 → 3.13.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 CHANGED
@@ -33,13 +33,13 @@
33
33
  Using npm:
34
34
 
35
35
  ```sh
36
- npm i --save @xyo-network/sdk-xyo-client-js
36
+ npm i --save @xyo-network/sdk-js
37
37
  ```
38
38
 
39
39
  Using yarn:
40
40
 
41
41
  ```sh
42
- yarn add @xyo-network/sdk-xyo-client-js
42
+ yarn add @xyo-network/sdk-js
43
43
  ```
44
44
 
45
45
  ## Packages
@@ -82,8 +82,8 @@ yarn xy compile
82
82
  [main-build]: https://github.com/XYOracleNetwork/sdk-xyo-client-js/actions/workflows/build.yml/badge.svg
83
83
  [main-build-link]: https://github.com/XYOracleNetwork/sdk-xyo-client-js/actions/workflows/build.yml
84
84
 
85
- [npm-badge]: https://img.shields.io/npm/v/@xyo-network/sdk-xyo-client-js.svg
86
- [npm-link]: https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js
85
+ [npm-badge]: https://img.shields.io/npm/v/@xyo-network/sdk-js.svg
86
+ [npm-link]: https://www.npmjs.com/package/@xyo-network/sdk-js
87
87
 
88
88
  [codacy-badge]: https://app.codacy.com/project/badge/Grade/ba1f344ae34e4bfe999331cf4e27b9f5
89
89
  [codacy-link]: https://www.codacy.com/gh/XYOracleNetwork/sdk-xyo-client-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=XYOracleNetwork/sdk-xyo-client-js&utm_campaign=Badge_Grade
package/eslint.config.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  } from '@xylabs/eslint-config-flat'
9
9
 
10
10
  export default [
11
- { ignores: ['dist', '**/packages/*/dist', '.yarn', 'node_modules', '**/packages/*/node_modules', 'docs'] },
11
+ { ignores: ['dist', '**/packages/*/dist', '.yarn', 'node_modules', '**/packages/*/node_modules', 'docs', '.dependency-cruiser.mjs'] },
12
12
  unicornConfig,
13
13
  workspacesConfig,
14
14
  rulesConfig,
package/knip.config.ts CHANGED
@@ -1,22 +1,43 @@
1
1
  import type { KnipConfig } from 'knip'
2
2
 
3
+ const entry = ['src/index.ts*', 'src/index-*.ts*', '*.ts', '*.mjs', 'scripts/**/*.*', 'bin/*', 'src/**/*.stories.ts*', 'src/**/*.spec.ts']
4
+ const project = ['src/**/*.ts*', '*.ts*']
5
+
3
6
  const config: KnipConfig = {
4
- entry: ['src/index.ts', 'src/index-*.ts'],
5
- project: ['src/**/*.ts'],
6
- ignore: ['xy.config.ts'],
7
- ignoreDependencies: [
8
- '@xylabs/ts-scripts-yarn3',
7
+ entry: [
8
+ 'src/index.ts*',
9
+ 'src/index-*.ts*',
10
+ '*.ts',
11
+ '*.mjs',
12
+ 'scripts/**/*.*',
13
+ 'bin/*',
14
+ 'src/**/*.stories.ts*',
15
+ 'src/**/*.spec.ts',
9
16
  ],
17
+ project: ['src/**/*.ts*', '*.ts*'],
18
+ ignoreDependencies: ['@xylabs/ts-scripts-yarn3', 'tslib'],
10
19
  workspaces: {
11
20
  '.': {
21
+ entry: [...entry, 'src/**/*.ts', './storybook/**/*.ts', 'vite.config.ts'],
22
+ project,
12
23
  ignoreDependencies: [
13
- 'eslint',
14
24
  '@typescript-eslint/eslint-plugin',
15
- 'eslint-import-resolver-typescript',
16
- 'reflect-metadata',
17
25
  '@typescript-eslint/parser',
26
+ 'eslint',
27
+ 'eslint-import-resolver-typescript',
18
28
  ],
19
29
  },
30
+ 'packages/*': { entry, project },
31
+ 'packages/*/packages/*': { entry, project },
32
+ 'packages/*/packages/packages/*': { entry, project },
33
+ 'packages/*/packages/*/packages/*': { entry, project },
34
+ 'packages/*/packages/*/packages/*/packages/*': { entry, project },
35
+ },
36
+ typescript: {
37
+ config: [
38
+ 'tsconfig.json',
39
+ 'packages/**/*/tsconfig.json',
40
+ ],
20
41
  },
21
42
  }
22
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/sdk-js",
3
- "version": "3.12.4",
3
+ "version": "3.13.0",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -38,6 +38,7 @@
38
38
  "build-typedoc-site": "typedoc",
39
39
  "compile": "./scripts/clear-scrollback-buffer.sh && yarn xy compile",
40
40
  "coverage": "vitest --coverage --watch false",
41
+ "cycle": "node ./scripts/run-cycle.mjs",
41
42
  "deploy": "xy deploy",
42
43
  "free-3033": "kill -9 $(lsof -t -i :3033)",
43
44
  "free-8080": "kill -9 $(lsof -t -i :8080)",
@@ -54,39 +55,40 @@
54
55
  "quick-lru": "^4"
55
56
  },
56
57
  "dependencies": {
57
- "@xyo-network/core-payload-plugins": "^3.12.4",
58
- "@xyo-network/manifest": "^3.12.4",
59
- "@xyo-network/modules": "^3.12.4",
60
- "@xyo-network/protocol": "^3.12.4",
61
- "@xyo-network/sdk-utils": "^3.12.4",
62
- "@xyo-network/shared": "^3.12.4"
58
+ "@xyo-network/core-payload-plugins": "^3.13.0",
59
+ "@xyo-network/manifest": "^3.13.0",
60
+ "@xyo-network/modules": "^3.13.0",
61
+ "@xyo-network/protocol": "^3.13.0",
62
+ "@xyo-network/sdk-utils": "^3.13.0",
63
+ "@xyo-network/shared": "^3.13.0"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@firebase/app": "^0.11.4",
66
67
  "@firebase/app-compat": "^0.2.53",
67
68
  "@stylistic/eslint-plugin": "^4.2.0",
68
69
  "@types/supertest": "^6.0.3",
69
- "@typescript-eslint/eslint-plugin": "^8.29.1",
70
- "@typescript-eslint/parser": "^8.29.1",
71
- "@vitest/coverage-v8": "^3.1.1",
72
- "@xylabs/eslint-config-flat": "^6.2.1",
73
- "@xylabs/forget": "^4.8.4",
74
- "@xylabs/ts-scripts-yarn3": "^6.2.1",
75
- "@xylabs/tsconfig": "^6.2.1",
76
- "@xylabs/vitest-extended": "^4.8.4",
70
+ "@typescript-eslint/eslint-plugin": "^8.31.0",
71
+ "@typescript-eslint/parser": "^8.31.0",
72
+ "@vitest/coverage-v8": "^3.1.2",
73
+ "@xylabs/eslint-config-flat": "^6.3.4",
74
+ "@xylabs/forget": "^4.8.7",
75
+ "@xylabs/ts-scripts-yarn3": "^6.3.4",
76
+ "@xylabs/tsconfig": "^6.3.4",
77
+ "@xylabs/vitest-extended": "^4.8.7",
78
+ "dependency-cruiser": "^16.10.1",
77
79
  "dotenv": "^16.5.0",
78
- "eslint": "^9.24.0",
79
- "eslint-import-resolver-typescript": "^4.3.2",
80
- "jsdom": "^26.0.0",
81
- "knip": "^5.50.2",
80
+ "eslint": "^9.25.1",
81
+ "eslint-import-resolver-typescript": "^4.3.4",
82
+ "jsdom": "^26.1.0",
83
+ "knip": "^5.50.5",
82
84
  "reflect-metadata": "^0.2.2",
83
85
  "rimraf": "^6.0.1",
84
86
  "supertest": "^7.1.0",
85
87
  "tslib": "^2.8.1",
86
- "typedoc": "^0.28.2",
88
+ "typedoc": "^0.28.3",
87
89
  "typedoc-plugin-markdown": "^4.6.2",
88
90
  "typescript": "^5.8.3",
89
- "vitest": "^3.1.1"
91
+ "vitest": "^3.1.2"
90
92
  },
91
93
  "packageManager": "yarn@4.9.1",
92
94
  "volta": {
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { cruise } from 'dependency-cruiser'
4
+ import { spawnSync } from 'node:child_process'
5
+
6
+ export const yarnWorkspaces = () => {
7
+ const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })
8
+ if (result.error) {
9
+ throw result.error
10
+ }
11
+ return (
12
+ result.stdout
13
+ .toString()
14
+ // NOTE: This probably doesn't work on Windows
15
+ // TODO: Replace /r/n with /n first
16
+ .split('\n')
17
+ .slice(0, -1)
18
+ .map((item) => {
19
+ return JSON.parse(item)
20
+ })
21
+ )
22
+ }
23
+
24
+ export const cycleAll = async () => {
25
+ const pkgName = process.env.npm_package_name
26
+
27
+ const cruiseOptions = {
28
+ ruleSet: {
29
+ forbidden: [
30
+ {
31
+ name: 'no-circular',
32
+ severity: 'error',
33
+ comment: 'This dependency creates a circular reference',
34
+ from: {},
35
+ to: { circular: true },
36
+ },
37
+ ],
38
+ },
39
+ exclude: 'node_modules|packages/.*/packages',
40
+ validate: true,
41
+ doNotFollow: { path: 'node_modules|packages/.*/packages' },
42
+ tsPreCompilationDeps: false,
43
+ combinedDependencies: true,
44
+ outputType: 'err',
45
+ }
46
+
47
+ const packages = yarnWorkspaces()
48
+ const targets = packages.map(({ location }) => `${location}/src/**`)
49
+
50
+ console.log('Checking for circular dependencies in packages...')
51
+
52
+ const result = await cruise(targets, cruiseOptions)
53
+ if (result.output) {
54
+ console.log(result.output)
55
+ }
56
+
57
+ if (result.exitCode === 0) {
58
+ console.log(`${pkgName} ✅ No dependency violations`)
59
+ } else {
60
+ console.error(`${pkgName} ❌ Dependency violations found`)
61
+ }
62
+ return result.exitCode
63
+ }
64
+
65
+ cycleAll().then(() => {
66
+ console.log('Exiting with code 0')
67
+ process.exit(0)
68
+ }).catch((error) => {
69
+ console.error('Error while checking for circular dependencies:', error)
70
+ process.exit(1)
71
+ })
@@ -1,14 +0,0 @@
1
- const config = {
2
- entryPointStrategy: 'packages',
3
- entryPoints: ['.', 'packages/**'],
4
- out: 'docs',
5
- plugin: ['typedoc-plugin-markdown'],
6
- exclude: ['**/docs/**', '**/spec/**', '**/*.spec.*', '**/*.d.ts'],
7
- excludeExternals: true,
8
- excludePrivate: true,
9
- excludeProtected: true,
10
- includeVersion: true,
11
- packageOptions: { entryPoints: ['src/index*.ts*'] },
12
- }
13
-
14
- export default config