Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy recipe templates during build #821

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/create/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env sh

set -e

rm -rf dist
yarn run -B tsc

# Copy each recipe's template directories to build directory recursively
for recipe in $(ls -d src/recipes/*/); do
# Check if recipe contains a template directory
if [ ! -d ${recipe}template ]; then
continue
fi
cp -rv ${recipe}template dist/recipes/$(basename ${recipe})
done
2 changes: 1 addition & 1 deletion packages/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"scripts": {
"create": "tsx src/cli.ts",
"build": "tsc",
"build": "build.sh",
"test": "tsc --noEmit"
}
}
2 changes: 1 addition & 1 deletion packages/create/src/recipes/nextjs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import debug from "debug";
import { updatePackage } from "write-package";

import { BaseOptions, Recipe } from "../types.js";

Check failure on line 6 in packages/create/src/recipes/nextjs/index.ts

View workflow job for this annotation

GitHub Actions / test (18, ubuntu-latest, stable)

All imports in the declaration are only used as types. Use `import type`

Check failure on line 6 in packages/create/src/recipes/nextjs/index.ts

View workflow job for this annotation

GitHub Actions / test (20, ubuntu-latest, stable)

All imports in the declaration are only used as types. Use `import type`

Check failure on line 6 in packages/create/src/recipes/nextjs/index.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 18, nightly)

All imports in the declaration are only used as types. Use `import type`

Check failure on line 6 in packages/create/src/recipes/nextjs/index.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 18, 3)

All imports in the declaration are only used as types. Use `import type`

Check failure on line 6 in packages/create/src/recipes/nextjs/index.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 18, 2)

All imports in the declaration are only used as types. Use `import type`

Check failure on line 6 in packages/create/src/recipes/nextjs/index.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 18, stable)

All imports in the declaration are only used as types. Use `import type`
import { copyTemplateFiles } from "../../utils.js";

const logger = debug("@edgedb/create:recipe:nextjs");
Expand Down Expand Up @@ -68,7 +68,7 @@
}

await copyTemplateFiles(
path.resolve(dirname, lang === "js" ? "./template-js" : "./template"),
path.resolve(dirname, lang === "js" ? "./template/js" : "./template/ts"),
projectDir,
{
tags,
Expand Down
11 changes: 3 additions & 8 deletions packages/create/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": [
"src/**/*"
],
"exclude": [
"src/recipes/nextjs/template/*",
"src/recipes/nextjs/template-js/*"
]
}
"include": ["src/**/*"],
"exclude": ["src/recipes/**/template/**/*"]
}
Loading