mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
fixed generate from template watch mode
This commit is contained in:
parent
afe9c52a87
commit
c10b1978b3
@ -41,7 +41,7 @@
|
||||
"verify-data-integrity": "pnpm pre && pnpm -C apps/backend run verify-data-integrity",
|
||||
"generate-docs": "pnpm pre && turbo run generate-docs",
|
||||
"generate-keys": "pnpm pre && turbo run generate-keys",
|
||||
"generate-from-template:watch": "chokidar --silent -c 'tsx ./scripts/generate-from-template.ts' './packages/template' --ignore '**/node_modules/**' --ignore '**/dist/**' --ignore '**/.turbo/**' --throttle 1000"
|
||||
"generate-from-template:watch": "chokidar --silent -c 'npx --package=ts-node ts-node ./scripts/generate-from-template.ts' './packages/template' --ignore '**/node_modules/**' --ignore '**/dist/**' --ignore '**/.turbo/**' --throttle 1000"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.27.9",
|
||||
|
||||
@ -21,20 +21,8 @@
|
||||
"typecheck": "tsc --noEmit",
|
||||
"clean": "rimraf dist && rimraf node_modules",
|
||||
"lint": "eslint --ext .tsx,.ts .",
|
||||
"build": "rimraf dist && pnpm run css && tsup-node",
|
||||
"dev": "rimraf dist && concurrently -n \"build,codegen\" -k \"tsup-node --watch\" \"pnpm run codegen:watch\"",
|
||||
"codegen": "pnpm run css && pnpm run quetzal",
|
||||
"codegen:watch": "concurrently -n \"css,quetzal\" -k \"pnpm run css:watch\" \"pnpm run quetzal:watch\"",
|
||||
"css": "pnpm run css-tw && pnpm run css-sc",
|
||||
"css:watch": "concurrently -n \"tw,sc\" -k \"pnpm run css-tw:watch\" \"pnpm run css-sc:watch\"",
|
||||
"css-tw:watch": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css --watch",
|
||||
"css-tw": "tailwindcss -i ./src/global.css -o ./src/generated/tailwind.css",
|
||||
"css-sc": "tsx ./scripts/process-css.ts ./src/generated/tailwind.css ./src/generated/global-css.ts",
|
||||
"css-sc:watch": "chokidar --silent './src/generated/tailwind.css' -c 'pnpm run css-sc'",
|
||||
"override-env-local-for-quetzal": "echo \"\\n$STACK_ENV_LOCAL_PACKAGE_BUILD_OVERRIDE_FOR_QUETZAL\\n\" >> .env.local",
|
||||
"quetzal": "rimraf quetzal-translations && pnpm run override-env-local-for-quetzal && quetzal-process-translations && tsx ./scripts/merge-quetzal-translations.ts",
|
||||
"quetzal:ignore-errors": "pnpm run quetzal || echo Quetzal failed, probably because the API key is missing. We will just ignore it",
|
||||
"quetzal:watch": "chokidar --silent \"src/**/*\" -i \"src/generated/quetzal-translations.ts\" -c 'pnpm run quetzal:ignore-errors'"
|
||||
"build": "rimraf dist && tsup-node",
|
||||
"dev": "rimraf dist && tsup-node --watch"
|
||||
},
|
||||
"files": [
|
||||
"README.md",
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
"//": "ELSE_IF_PLATFORM next",
|
||||
"name": "@stackframe/stack",
|
||||
"//": "END_PLATFORM",
|
||||
|
||||
"//": "NEXT_LINE_PLATFORM template",
|
||||
"private": true,
|
||||
"version": "2.7.13",
|
||||
@ -28,10 +29,17 @@
|
||||
"typecheck": "tsc --noEmit",
|
||||
"clean": "rimraf dist && rimraf node_modules",
|
||||
"lint": "eslint --ext .tsx,.ts .",
|
||||
"//": "IF_PLATFORM react-like",
|
||||
|
||||
"//": "IF_PLATFORM template",
|
||||
"build": "rimraf dist && pnpm run css && tsup-node",
|
||||
"dev": "rimraf dist && concurrently -n \"build,codegen\" -k \"tsup-node --watch\" \"pnpm run codegen:watch\"",
|
||||
"codegen": "pnpm run css && pnpm run quetzal",
|
||||
"dev": "rimraf dist && concurrently -n \"build,codegen\" -k \"tsup-node --watch\" \"pnpm run codegen:watch\""
|
||||
,"//": "ELSE_PLATFORM"
|
||||
"build": "rimraf dist && tsup-node",
|
||||
"dev": "rimraf dist && tsup-node --watch"
|
||||
,"//": "END_PLATFORM"
|
||||
|
||||
"//": "IF_PLATFORM template",
|
||||
,"codegen": "pnpm run css && pnpm run quetzal",
|
||||
"codegen:watch": "concurrently -n \"css,quetzal\" -k \"pnpm run css:watch\" \"pnpm run quetzal:watch\"",
|
||||
"css": "pnpm run css-tw && pnpm run css-sc",
|
||||
"css:watch": "concurrently -n \"tw,sc\" -k \"pnpm run css-tw:watch\" \"pnpm run css-sc:watch\"",
|
||||
@ -43,9 +51,6 @@
|
||||
"quetzal": "rimraf quetzal-translations && pnpm run override-env-local-for-quetzal && quetzal-process-translations && tsx ./scripts/merge-quetzal-translations.ts",
|
||||
"quetzal:ignore-errors": "pnpm run quetzal || echo Quetzal failed, probably because the API key is missing. We will just ignore it",
|
||||
"quetzal:watch": "chokidar --silent \"src/**/*\" -i \"src/generated/quetzal-translations.ts\" -c 'pnpm run quetzal:ignore-errors'"
|
||||
,"//": "ELSE_IF_PLATFORM js",
|
||||
"build": "rimraf dist && tsup-node",
|
||||
"dev": "rimraf dist && tsup-node --watch"
|
||||
,"//": "END_PLATFORM"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
{
|
||||
"//": "THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY",
|
||||
"name": "@stackframe/template",
|
||||
"private": true,
|
||||
"version": "2.7.13",
|
||||
@ -100,4 +101,4 @@
|
||||
"tailwindcss": "^3.4.4",
|
||||
"tsup": "^8.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1571,7 +1571,6 @@ class _StackClientAppImpl<HasTokenStore extends boolean, ProjectId extends strin
|
||||
if (typeof window === "undefined") {
|
||||
throw new Error("callOAuthCallback can currently only be called in a browser environment");
|
||||
}
|
||||
|
||||
this._ensurePersistentTokenStore();
|
||||
let result;
|
||||
try {
|
||||
|
||||
@ -443,7 +443,12 @@ function processMacros(content: string, envs: string[]): string {
|
||||
// Copy package-template.json to package.json and apply macros
|
||||
const packageTemplateContent = fs.readFileSync(path.join(srcDir, 'package-template.json'), 'utf-8');
|
||||
const processedPackageJson = processMacros(packageTemplateContent, allEnvs);
|
||||
fs.writeFileSync(path.join(srcDir, 'package.json'), processedPackageJson);
|
||||
const packageJson = JSON.parse(processedPackageJson);
|
||||
const packageJsonWithComment = {
|
||||
"//": COMMENT_LINE,
|
||||
...packageJson
|
||||
};
|
||||
fs.writeFileSync(path.join(srcDir, 'package.json'), JSON.stringify(packageJsonWithComment, null, 2));
|
||||
|
||||
|
||||
generateFromTemplate({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user