@xyo-network/sdk-js 3.14.2 → 3.14.4
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/knip.config.ts +2 -8
- package/package.json +6 -5
- package/scripts/imports.mjs +60 -0
package/knip.config.ts
CHANGED
|
@@ -7,18 +7,12 @@ const config: KnipConfig = {
|
|
|
7
7
|
entry: [
|
|
8
8
|
'src/index.ts*',
|
|
9
9
|
'src/index-*.ts*',
|
|
10
|
-
'*.ts',
|
|
11
|
-
'*.mjs',
|
|
12
|
-
'scripts/**/*.*',
|
|
13
|
-
'bin/*',
|
|
14
|
-
'src/**/*.stories.ts*',
|
|
15
|
-
'src/**/*.spec.ts',
|
|
16
10
|
],
|
|
17
|
-
project: ['src/**/*.ts*'
|
|
11
|
+
project: ['src/**/*.ts*'],
|
|
18
12
|
ignoreDependencies: ['@xylabs/ts-scripts-yarn3', 'tslib'],
|
|
19
13
|
workspaces: {
|
|
20
14
|
'.': {
|
|
21
|
-
entry
|
|
15
|
+
entry,
|
|
22
16
|
project,
|
|
23
17
|
ignoreDependencies: [
|
|
24
18
|
'@typescript-eslint/eslint-plugin',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/sdk-js",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.4",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"compile": "./scripts/clear-scrollback-buffer.sh && yarn xy compile",
|
|
40
40
|
"coverage": "vitest --coverage --watch false",
|
|
41
41
|
"cycle": "node ./scripts/run-cycle.mjs",
|
|
42
|
+
"depends": "node ./scripts/imports.mjs",
|
|
42
43
|
"deploy": "xy deploy",
|
|
43
44
|
"free-3033": "kill -9 $(lsof -t -i :3033)",
|
|
44
45
|
"free-8080": "kill -9 $(lsof -t -i :8080)",
|
|
@@ -52,9 +53,9 @@
|
|
|
52
53
|
"fake-indexeddb": "^4"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
|
-
"@xyo-network/manifest": "^3.14.
|
|
56
|
-
"@xyo-network/modules": "^3.14.
|
|
57
|
-
"@xyo-network/protocol": "^3.14.
|
|
56
|
+
"@xyo-network/manifest": "^3.14.4",
|
|
57
|
+
"@xyo-network/modules": "^3.14.4",
|
|
58
|
+
"@xyo-network/protocol": "^3.14.4"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@firebase/app": "^0.11.5",
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"@xylabs/ts-scripts-yarn3": "^6.3.5",
|
|
70
71
|
"@xylabs/tsconfig": "^6.3.5",
|
|
71
72
|
"@xylabs/vitest-extended": "^4.8.7",
|
|
72
|
-
"@xyo-network/sdk-utils": "^3.14.
|
|
73
|
+
"@xyo-network/sdk-utils": "^3.14.4",
|
|
73
74
|
"dependency-cruiser": "^16.10.1",
|
|
74
75
|
"dotenv": "^16.5.0",
|
|
75
76
|
"eslint": "^9.25.1",
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import ts from 'typescript'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import fs from 'node:fs'
|
|
6
|
+
|
|
7
|
+
function getDependenciesFromPackageJson(packageJsonPath) {
|
|
8
|
+
const packageJsonFullPath = path.resolve(packageJsonPath)
|
|
9
|
+
const rawContent = fs.readFileSync(packageJsonFullPath, 'utf8')
|
|
10
|
+
const packageJson = JSON.parse(rawContent)
|
|
11
|
+
|
|
12
|
+
const dependencies = packageJson.dependencies
|
|
13
|
+
? Object.keys(packageJson.dependencies)
|
|
14
|
+
: []
|
|
15
|
+
|
|
16
|
+
const devDependencies = packageJson.devDependencies
|
|
17
|
+
? Object.keys(packageJson.devDependencies)
|
|
18
|
+
: []
|
|
19
|
+
|
|
20
|
+
return { dependencies, devDependencies }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getImportsFromFile(filePath) {
|
|
24
|
+
const sourceCode = fs.readFileSync(filePath, 'utf8')
|
|
25
|
+
|
|
26
|
+
const sourceFile = ts.createSourceFile(
|
|
27
|
+
path.basename(filePath),
|
|
28
|
+
sourceCode,
|
|
29
|
+
ts.ScriptTarget.Latest,
|
|
30
|
+
true,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
const imports = []
|
|
34
|
+
|
|
35
|
+
function visit(node) {
|
|
36
|
+
if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
|
|
37
|
+
const moduleSpecifier = (node.moduleSpecifier)?.text
|
|
38
|
+
if (moduleSpecifier) {
|
|
39
|
+
imports.push(moduleSpecifier)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
ts.forEachChild(node, visit)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
visit(sourceFile)
|
|
46
|
+
|
|
47
|
+
return imports
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function run() {
|
|
51
|
+
const imports = getImportsFromFile('./src/index.ts')
|
|
52
|
+
const externalImports = imports.filter(imp => !imp.startsWith('.') && !imp.startsWith('#'))
|
|
53
|
+
console.log(externalImports)
|
|
54
|
+
|
|
55
|
+
const deps = getDependenciesFromPackageJson('./package.json')
|
|
56
|
+
console.log('Dependencies:', deps.dependencies)
|
|
57
|
+
console.log('DevDependencies:', deps.devDependencies)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
run()
|