@toolforge-js/sdk 0.2.0 → 0.3.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/package.json +4 -16
- package/package.json.bak +48 -0
- package/scripts/internal-deps.ts +4 -0
- package/scripts/postpublish.ts +18 -0
- package/scripts/prepublish.ts +38 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolforge-js/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./components": {
|
|
@@ -12,15 +12,7 @@
|
|
|
12
12
|
"import": "./dist/config/index.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "tsdown",
|
|
17
|
-
"lint": "eslint --fix --cache .",
|
|
18
|
-
"format": "prettier --write --cache --ignore-path .gitignore --ignore-path ../../.gitignore .",
|
|
19
|
-
"typecheck": "tsc",
|
|
20
|
-
"typecheck:watch": "tsc --watch"
|
|
21
|
-
},
|
|
22
15
|
"dependencies": {
|
|
23
|
-
"@toolforge-js/core": "workspace:*",
|
|
24
16
|
"chokidar": "4.0.3",
|
|
25
17
|
"es-toolkit": "1.39.10",
|
|
26
18
|
"nanoid": "5.1.5",
|
|
@@ -31,16 +23,12 @@
|
|
|
31
23
|
"zod": "4.1.12"
|
|
32
24
|
},
|
|
33
25
|
"devDependencies": {
|
|
34
|
-
"@toolforge-js/config": "workspace:*",
|
|
35
26
|
"@types/bun": "1.3.1",
|
|
36
27
|
"@types/node": "24.0.7",
|
|
37
|
-
"commander": "14.0.
|
|
38
|
-
"eslint": "9.24.0",
|
|
39
|
-
"prettier": "3.5.3",
|
|
40
|
-
"tsdown": "0.15.9",
|
|
28
|
+
"commander": "14.0.2",
|
|
41
29
|
"typescript": "5.9.2"
|
|
42
30
|
},
|
|
43
31
|
"bin": {
|
|
44
|
-
"
|
|
32
|
+
"toolforge-js": "index.js"
|
|
45
33
|
}
|
|
46
|
-
}
|
|
34
|
+
}
|
package/package.json.bak
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@toolforge-js/sdk",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./components": {
|
|
7
|
+
"types": "./dist/components/index.d.ts",
|
|
8
|
+
"import": "./dist/components/index.js"
|
|
9
|
+
},
|
|
10
|
+
"./config": {
|
|
11
|
+
"types": "./dist/config/index.d.ts",
|
|
12
|
+
"import": "./dist/config/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsdown",
|
|
17
|
+
"lint": "eslint --fix --cache .",
|
|
18
|
+
"format": "prettier --write --cache --ignore-path .gitignore --ignore-path ../../.gitignore .",
|
|
19
|
+
"typecheck": "tsc",
|
|
20
|
+
"typecheck:watch": "tsc --watch",
|
|
21
|
+
"publish": "bun run scripts/prepublish.ts && npm publish --access public && bun run scripts/postpublish.ts",
|
|
22
|
+
"publish:dry-run": "bun run scripts/prepublish.ts && npm publish --access public --dry-run && bun run scripts/postpublish.ts"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@toolforge-js/core": "workspace:*",
|
|
26
|
+
"chokidar": "4.0.3",
|
|
27
|
+
"es-toolkit": "1.39.10",
|
|
28
|
+
"nanoid": "5.1.5",
|
|
29
|
+
"picocolors": "1.1.1",
|
|
30
|
+
"pino": "9.11.0",
|
|
31
|
+
"pino-pretty": "13.1.1",
|
|
32
|
+
"ts-pattern": "5.8.0",
|
|
33
|
+
"zod": "4.1.12"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@toolforge-js/config": "workspace:*",
|
|
37
|
+
"@types/bun": "1.3.1",
|
|
38
|
+
"@types/node": "24.0.7",
|
|
39
|
+
"commander": "14.0.2",
|
|
40
|
+
"eslint": "9.24.0",
|
|
41
|
+
"prettier": "3.5.3",
|
|
42
|
+
"tsdown": "0.15.9",
|
|
43
|
+
"typescript": "5.9.2"
|
|
44
|
+
},
|
|
45
|
+
"bin": {
|
|
46
|
+
"toolforge-js": "index.js"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
|
|
3
|
+
import * as fs from 'node:fs/promises'
|
|
4
|
+
import * as path from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
8
|
+
|
|
9
|
+
async function postpublish() {
|
|
10
|
+
console.log('running postpublish script...')
|
|
11
|
+
|
|
12
|
+
await fs.rename(
|
|
13
|
+
path.resolve(__dirname, '..', 'package.json.bak'),
|
|
14
|
+
path.resolve(__dirname, '..', 'package.json'),
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
postpublish()
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
|
|
3
|
+
import * as fs from 'node:fs/promises'
|
|
4
|
+
import * as path from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
import { INTERNAL_DEPS } from './internal-deps'
|
|
8
|
+
|
|
9
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
10
|
+
|
|
11
|
+
async function prepublish() {
|
|
12
|
+
console.log('running prepublish script...')
|
|
13
|
+
const packageJSONPath = path.resolve(__dirname, '..', 'package.json')
|
|
14
|
+
const packageJSONContent = JSON.parse(
|
|
15
|
+
await fs.readFile(packageJSONPath, 'utf-8'),
|
|
16
|
+
)
|
|
17
|
+
await fs.writeFile(
|
|
18
|
+
path.resolve(__dirname, '..', 'package.json.bak'),
|
|
19
|
+
JSON.stringify(packageJSONContent, null, 2),
|
|
20
|
+
'utf-8',
|
|
21
|
+
)
|
|
22
|
+
for (const [key, value] of Object.entries(INTERNAL_DEPS)) {
|
|
23
|
+
if (packageJSONContent[key]) {
|
|
24
|
+
for (const dep of value) {
|
|
25
|
+
console.log(`removing dependency ${dep} from ${key}`)
|
|
26
|
+
delete packageJSONContent[key][dep]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
delete packageJSONContent['scripts']
|
|
31
|
+
await fs.writeFile(
|
|
32
|
+
packageJSONPath,
|
|
33
|
+
JSON.stringify(packageJSONContent, null, 2),
|
|
34
|
+
'utf-8',
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
prepublish()
|