v0.3.1: ship compiled dist/ so npm git installs work without TS stripping
Consumers installing via 'git+http://.../webapp-scaffold.git#<tag>' hit Node's ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING because .ts files under node_modules can't be loaded by vite.config.ts loaders / node's default loader. Add tsconfig.json + 'prepare: tsc' (runs on git install). Emit .js + .d.ts into dist/. package.json exports point at dist/; .ts remains in src/ for direct-source consumers (e.g. monorepo setups). 'dist/' is gitignored — it's a build artifact, populated at install time. Version bump to 0.3.1 since this is a patch on the already-released 0.3.0 ABI (no API changes, just packaging). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ed9863c037
commit
b2b598c6c8
4 changed files with 1860 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
|
dist/
|
||||||
*.tgz
|
*.tgz
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
||||||
1810
package-lock.json
generated
Normal file
1810
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
36
package.json
36
package.json
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@uschuster/webapp-scaffold",
|
"name": "@uschuster/webapp-scaffold",
|
||||||
"version": "0.3.0",
|
"version": "0.3.1",
|
||||||
"description": "Shared build scripts + Vite config factories for webapp-template-derived projects.",
|
"description": "Shared build scripts + Vite config factories for webapp-template-derived projects.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|
@ -8,15 +8,37 @@
|
||||||
"webapp-scaffold-postprocess-openapi": "bin/postprocess-openapi.py",
|
"webapp-scaffold-postprocess-openapi": "bin/postprocess-openapi.py",
|
||||||
"webapp-scaffold-inject-hashes": "bin/inject-hashed-filenames.py"
|
"webapp-scaffold-inject-hashes": "bin/inject-hashed-filenames.py"
|
||||||
},
|
},
|
||||||
"main": "src/vite-config.ts",
|
"main": "dist/vite-config.js",
|
||||||
|
"module": "dist/vite-config.js",
|
||||||
|
"types": "dist/vite-config.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/vite-config.ts",
|
".": {
|
||||||
"./core-fetch": "./src/core-fetch.ts",
|
"types": "./dist/vite-config.d.ts",
|
||||||
"./i18n": "./src/i18n.ts",
|
"import": "./dist/vite-config.js"
|
||||||
"./i18n-react": "./src/i18n-react.ts",
|
},
|
||||||
|
"./core-fetch": {
|
||||||
|
"types": "./dist/core-fetch.d.ts",
|
||||||
|
"import": "./dist/core-fetch.js"
|
||||||
|
},
|
||||||
|
"./i18n": {
|
||||||
|
"types": "./dist/i18n.d.ts",
|
||||||
|
"import": "./dist/i18n.js"
|
||||||
|
},
|
||||||
|
"./i18n-react": {
|
||||||
|
"types": "./dist/i18n-react.d.ts",
|
||||||
|
"import": "./dist/i18n-react.js"
|
||||||
|
},
|
||||||
"./orval-template": "./templates/orval.config.template.ts"
|
"./orval-template": "./templates/orval.config.template.ts"
|
||||||
},
|
},
|
||||||
"files": ["bin/", "src/", "templates/", "README.md", "LICENSE"],
|
"files": ["bin/", "dist/", "src/", "templates/", "README.md", "LICENSE"],
|
||||||
|
"scripts": {
|
||||||
|
"prepare": "tsc || true"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"typescript": "^5.0.0",
|
||||||
|
"@types/node": "^22.0.0",
|
||||||
|
"@types/react": "^19.0.0"
|
||||||
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vite": "^6.0.0",
|
"vite": "^6.0.0",
|
||||||
"@vitejs/plugin-react": "^4.0.0",
|
"@vitejs/plugin-react": "^4.0.0",
|
||||||
|
|
|
||||||
16
tsconfig.json
Normal file
16
tsconfig.json
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2020",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"declaration": true,
|
||||||
|
"outDir": "dist",
|
||||||
|
"rootDir": "src",
|
||||||
|
"lib": ["ES2020", "DOM"],
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"esModuleInterop": true
|
||||||
|
},
|
||||||
|
"include": ["src/**/*"]
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue