@xyo-network/sdk-js 3.14.13 → 3.14.14

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.
Files changed (2) hide show
  1. package/package.json +11 -11
  2. package/scripts/deplint.mjs +0 -116
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/sdk-js",
3
- "version": "3.14.13",
3
+ "version": "3.14.14",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -39,7 +39,6 @@
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
- "deplint": "node ./scripts/deplint.mjs",
43
42
  "deploy": "xy deploy",
44
43
  "free-3033": "kill -9 $(lsof -t -i :3033)",
45
44
  "free-8080": "kill -9 $(lsof -t -i :8080)",
@@ -54,24 +53,25 @@
54
53
  "unrs-resolver": "1.7.0"
55
54
  },
56
55
  "dependencies": {
57
- "@xyo-network/manifest": "^3.14.13",
58
- "@xyo-network/modules": "^3.14.13",
59
- "@xyo-network/protocol": "^3.14.13"
56
+ "@xyo-network/manifest": "^3.14.14",
57
+ "@xyo-network/modules": "^3.14.14",
58
+ "@xyo-network/protocol": "^3.14.14"
60
59
  },
61
60
  "devDependencies": {
62
61
  "@firebase/app": "^0.11.5",
63
62
  "@firebase/app-compat": "^0.2.54",
64
63
  "@stylistic/eslint-plugin": "^4.2.0",
65
64
  "@types/supertest": "^6.0.3",
66
- "@typescript-eslint/eslint-plugin": "^8.31.0",
67
- "@typescript-eslint/parser": "^8.31.0",
65
+ "@typescript-eslint/eslint-plugin": "^8.31.1",
66
+ "@typescript-eslint/parser": "^8.31.1",
68
67
  "@vitest/coverage-v8": "^3.1.2",
69
- "@xylabs/eslint-config-flat": "^6.3.5",
68
+ "@xylabs/eslint-config-flat": "^6.4.0",
70
69
  "@xylabs/forget": "^4.8.7",
71
- "@xylabs/ts-scripts-yarn3": "^6.3.5",
72
- "@xylabs/tsconfig": "^6.3.5",
70
+ "@xylabs/ts-scripts-yarn3": "^6.4.0",
71
+ "@xylabs/tsconfig": "^6.4.0",
72
+ "@xylabs/tsconfig-dom": "^6.4.0",
73
73
  "@xylabs/vitest-extended": "^4.8.7",
74
- "@xyo-network/sdk-utils": "^3.14.13",
74
+ "@xyo-network/sdk-utils": "^3.14.14",
75
75
  "chalk": "^5.4.1",
76
76
  "dependency-cruiser": "^16.10.1",
77
77
  "dotenv": "^16.5.0",
@@ -1,116 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import ts from 'typescript'
4
- import path from 'node:path'
5
- import fs from 'node:fs'
6
- import { globSync } from 'glob'
7
- import { yarnWorkspaces } from '@xylabs/ts-scripts-yarn3'
8
- import chalk from 'chalk'
9
-
10
- function getDependenciesFromPackageJson(packageJsonPath) {
11
- const packageJsonFullPath = path.resolve(packageJsonPath)
12
- const rawContent = fs.readFileSync(packageJsonFullPath, 'utf8')
13
- const packageJson = JSON.parse(rawContent)
14
-
15
- const dependencies = packageJson.dependencies
16
- ? Object.keys(packageJson.dependencies)
17
- : []
18
-
19
- const devDependencies = packageJson.devDependencies
20
- ? Object.keys(packageJson.devDependencies)
21
- : []
22
-
23
- return { dependencies, devDependencies }
24
- }
25
-
26
- function getBasePackageName(importName) {
27
- if (importName.startsWith('@')) {
28
- const parts = importName.split('/')
29
- return parts.length >= 2 ? `${parts[0]}/${parts[1]}` : importName
30
- }
31
- return importName.split('/')[0]
32
- }
33
-
34
- function getImportsFromFile(filePath, importPaths) {
35
- const sourceCode = fs.readFileSync(filePath, 'utf8')
36
-
37
- const sourceFile = ts.createSourceFile(
38
- path.basename(filePath),
39
- sourceCode,
40
- ts.ScriptTarget.Latest,
41
- true,
42
- )
43
-
44
- const imports = []
45
-
46
- function visit(node) {
47
- if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
48
- const moduleSpecifier = (node.moduleSpecifier)?.text
49
- if (moduleSpecifier) {
50
- imports.push(moduleSpecifier)
51
- }
52
- }
53
- ts.forEachChild(node, visit)
54
- }
55
-
56
- visit(sourceFile)
57
-
58
- const cleanedImports = imports.filter(imp => !imp.startsWith('.') && !imp.startsWith('#') && !imp.startsWith('node:')).map(getBasePackageName)
59
-
60
- for (const imp of cleanedImports) {
61
- importPaths[imp] = importPaths[imp] || []
62
- importPaths[imp].push(filePath)
63
- }
64
-
65
- return cleanedImports
66
- }
67
-
68
- function findFilesByGlob(cwd, pattern) {
69
- return globSync(pattern, { cwd, absolute: true })
70
- }
71
-
72
- function run({
73
- name, location, devDeps = false,
74
- }) {
75
- const allFiles = findFilesByGlob(location, './src/**/*.{ts,tsx}')
76
- const prodFiles = allFiles.filter(file => !file.endsWith('.spec.ts') && !file.endsWith('.stories.tsx') && !file.includes('/spec/'))
77
- const devFiles = allFiles.filter(file => file.endsWith('.spec.ts') || file.endsWith('.stories.tsx') || file.includes('/spec/'))
78
- // console.log('Production files:', prodFiles)
79
- // console.log('Development files:', devFiles)
80
- const prodImportPaths = {}
81
- const prodImports = prodFiles.flatMap(path => getImportsFromFile(path, prodImportPaths))
82
- const devImportPaths = {}
83
- const devImports = devFiles.flatMap(path => getImportsFromFile(path, devImportPaths))
84
- const externalProdImports = prodImports.filter(imp => !imp.startsWith('.') && !imp.startsWith('#') && !imp.startsWith('node:'))
85
- const externalDevImports = devImports.filter(imp => !imp.startsWith('.') && !imp.startsWith('#') && !imp.startsWith('node:'))
86
-
87
- // console.log('externalProdImports:', externalProdImports)
88
- // console.log('externalDevImports:', externalDevImports)
89
-
90
- const deps = getDependenciesFromPackageJson(`${location}/package.json`)
91
- // console.log('Project.Dependencies:', deps.dependencies)
92
- // console.log('Project.DevDependencies:', deps.devDependencies)
93
-
94
- for (const imp of externalProdImports) {
95
- if (!deps.dependencies.includes(imp)) {
96
- console.log(`[${chalk.blue(name)}] Missing dependency in package.json: ${chalk.red(imp)}`)
97
- console.log(` ${prodImportPaths[imp].join('\n')}`)
98
- console.log('')
99
- }
100
- }
101
-
102
- if (devDeps) {
103
- for (const imp of externalDevImports) {
104
- if (!deps.devDependencies.includes(imp)) {
105
- console.log(`[${chalk.blue(name)}] Missing devDependency in package.json: ${chalk.red(imp)}`)
106
- console.log(` Found in: ${devImportPaths[imp].join(', ')}`)
107
- }
108
- }
109
- }
110
- }
111
-
112
- const workspaces = yarnWorkspaces()
113
-
114
- for (const workspace of workspaces) {
115
- run(workspace)
116
- }