Skip to content

Commit

Permalink
Move static base recipe files to template dir (#833)
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttrinh authored Jan 12, 2024
1 parent bf19955 commit dd8744e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
17 changes: 3 additions & 14 deletions packages/create/src/recipes/_base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import * as p from "@clack/prompts";

import { updatePackage } from "write-package";

import * as utils from "../../utils.js";
import { getPackageManager, copyTemplateFiles } from "../../utils.js";
import type { Framework, BaseRecipe, BaseOptions } from "../types.js";

const logger = debug("@edgedb/create:recipe:base");

const recipe: BaseRecipe = {
async getOptions() {
const packageManager = utils.getPackageManager();
const packageManager = getPackageManager();
logger({ packageManager });

const opts = await p.group(
Expand Down Expand Up @@ -85,18 +85,7 @@ const recipe: BaseRecipe = {
const dirname = path.dirname(new URL(import.meta.url).pathname);

logger("Copying files");
await fs.copyFile(
path.resolve(dirname, "./_eslint.config.js"),
path.resolve(projectDir, "eslint.config.js")
);
await fs.copyFile(
path.resolve(dirname, "./_package.json"),
path.resolve(projectDir, "package.json")
);
await fs.copyFile(
path.resolve(dirname, "./_tsconfig.json"),
path.resolve(projectDir, "tsconfig.json")
);
await copyTemplateFiles(path.resolve(dirname, "./template"), projectDir);

logger("Writing package.json");
await updatePackage(projectDir, { name: projectName });
Expand Down
1 change: 1 addition & 0 deletions packages/create/src/recipes/_base/template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"edgedb": "1.x"
},
"devDependencies": {
"@edgedb/generate": "1.x",
"@edgedb/generate": "^0.4.1",
"@typescript-eslint/eslint-plugin": "6.x",
"@typescript-eslint/parser": "6.x",
"@eslint/eslintrc": "2.x",
Expand Down

0 comments on commit dd8744e

Please sign in to comment.