@toolforge-js/sdk 0.1.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/eslint.config.js +1 -0
- package/index.js +2 -0
- package/package.json +46 -0
- package/prettier.config.js +1 -0
- package/tsconfig.json +3 -0
- package/tsdown.config.ts +51 -0
package/eslint.config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@toolforge-js/config/eslint.config.js'
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@toolforge-js/sdk",
|
|
3
|
+
"version": "0.1.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
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@toolforge-js/core": "workspace:*",
|
|
24
|
+
"chokidar": "4.0.3",
|
|
25
|
+
"es-toolkit": "1.39.10",
|
|
26
|
+
"nanoid": "5.1.5",
|
|
27
|
+
"picocolors": "1.1.1",
|
|
28
|
+
"pino": "9.11.0",
|
|
29
|
+
"pino-pretty": "13.1.1",
|
|
30
|
+
"ts-pattern": "5.8.0",
|
|
31
|
+
"zod": "4.1.12"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@toolforge-js/config": "workspace:*",
|
|
35
|
+
"@types/bun": "1.2.8",
|
|
36
|
+
"@types/node": "24.0.7",
|
|
37
|
+
"commander": "14.0.1",
|
|
38
|
+
"eslint": "9.24.0",
|
|
39
|
+
"prettier": "3.5.3",
|
|
40
|
+
"tsdown": "0.15.9",
|
|
41
|
+
"typescript": "5.9.2"
|
|
42
|
+
},
|
|
43
|
+
"bin": {
|
|
44
|
+
"tool-forge-sdk": "index.js"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@toolforge-js/config/prettier.config.js'
|
package/tsconfig.json
ADDED
package/tsdown.config.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as fs from 'node:fs/promises'
|
|
2
|
+
import * as path from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
|
|
5
|
+
import { defineConfig } from 'tsdown'
|
|
6
|
+
import * as z from 'zod'
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
entry: ['src/components/index.ts', 'src/config/index.ts', 'src/cli/index.ts'],
|
|
10
|
+
format: ['esm'],
|
|
11
|
+
sourcemap: false,
|
|
12
|
+
clean: true,
|
|
13
|
+
dts: {
|
|
14
|
+
resolve: ['@toolforge-js/core/schema', '@toolforge-js/core/utils'],
|
|
15
|
+
},
|
|
16
|
+
noExternal: ['@toolforge-js/core/schema', '@toolforge-js/core/utils'],
|
|
17
|
+
onSuccess: async () => {
|
|
18
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
19
|
+
const packageJsonPath = path.resolve(__dirname, '../core', 'package.json')
|
|
20
|
+
const packageJsonContent = z
|
|
21
|
+
.object({
|
|
22
|
+
exports: z.record(
|
|
23
|
+
z.string(),
|
|
24
|
+
z.object({ types: z.string(), default: z.string() }),
|
|
25
|
+
),
|
|
26
|
+
})
|
|
27
|
+
.loose()
|
|
28
|
+
.parse(JSON.parse(await fs.readFile(packageJsonPath, 'utf-8')))
|
|
29
|
+
for (const [key, value] of Object.entries(packageJsonContent.exports)) {
|
|
30
|
+
const updatedValue = {
|
|
31
|
+
...value,
|
|
32
|
+
types: changeDtsToTypePath(value.types),
|
|
33
|
+
default: changeEsmToDefaultPath(value.default),
|
|
34
|
+
}
|
|
35
|
+
packageJsonContent.exports[key] = updatedValue
|
|
36
|
+
}
|
|
37
|
+
await fs.writeFile(
|
|
38
|
+
packageJsonPath,
|
|
39
|
+
JSON.stringify(packageJsonContent, null, 2),
|
|
40
|
+
'utf-8',
|
|
41
|
+
)
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
function changeDtsToTypePath(typePath: string) {
|
|
46
|
+
return typePath.replace('dist', 'src').replace(/\.d\.ts$/, '.ts')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function changeEsmToDefaultPath(defaultPath: string) {
|
|
50
|
+
return defaultPath.replace('dist', 'src').replace(/\.js$/, '.ts')
|
|
51
|
+
}
|