@editframe/create 0.23.8-beta.0 → 0.25.0-beta.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/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ export { };
package/dist/index.js CHANGED
@@ -4,6 +4,8 @@ import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import chalk from "chalk";
6
6
  import prompts from "prompts";
7
+
8
+ //#region src/index.ts
7
9
  async function checkDirectoryExists(path$1) {
8
10
  try {
9
11
  await access(path$1);
@@ -54,4 +56,7 @@ async function main() {
54
56
  process.stderr.write("Happy hacking!\n");
55
57
  }
56
58
  main();
57
- export {};
59
+
60
+ //#endregion
61
+ export { };
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["path"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { access, cp, readdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport chalk from \"chalk\";\nimport prompts from \"prompts\";\n\nasync function checkDirectoryExists(path: string) {\n try {\n await access(path);\n return true;\n } catch (_error) {\n return false;\n }\n}\n\nasync function main() {\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n // List of available starter templates\n const templates = await readdir(path.join(__dirname, \"templates\"));\n\n // Prompt for the target directory name and template selection\n const answers = await prompts([\n {\n type: \"text\",\n name: \"directoryName\",\n message: \"Enter the name of the directory to generate into:\",\n initial: \"my-project\",\n },\n {\n type: \"select\",\n name: \"templateName\",\n message: \"Choose a starter template:\",\n choices: templates.map((template) => ({\n title: template,\n value: template,\n })),\n },\n ]);\n\n const targetDir = path.join(process.cwd(), answers.directoryName);\n const templateDir = path.join(__dirname, \"templates\", answers.templateName);\n\n const exists = await checkDirectoryExists(targetDir);\n\n if (exists) {\n process.stderr.write(\n chalk.yellow(`Directory ${targetDir} already exists.\\n`),\n );\n const { overwrite } = await prompts({\n type: \"confirm\",\n name: \"overwrite\",\n message: \"Directory already exists. Do you want to overwrite it?\",\n initial: false,\n });\n\n if (!overwrite) {\n process.stderr.write(chalk.red(\"Aborting...\\n\"));\n process.exit(1);\n }\n }\n\n process.stderr.write(`Creating project in directory: ${targetDir}\\n`);\n process.stderr.write(`Using template: ${answers.templateName}`);\n\n // Copy the selected template to the target directory\n await cp(templateDir, targetDir, { recursive: true });\n\n process.stderr.write(\"Project created successfully.\\n\");\n\n process.stderr.write(chalk.green(\"Next steps:\\n\"));\n\n process.stderr.write(`cd ${answers.directoryName}\\n`);\n process.stderr.write(\"npm install\\n\");\n process.stderr.write(\"npm start\\n\\n\");\n\n process.stderr.write(\"Happy hacking!\\n\");\n}\n\nmain();\n"],"mappings":";;;;;;;;AAQA,eAAe,qBAAqB,QAAc;AAChD,KAAI;AACF,QAAM,OAAOA,OAAK;AAClB,SAAO;UACA,QAAQ;AACf,SAAO;;;AAIX,eAAe,OAAO;CACpB,MAAM,YAAY,KAAK,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;CAM9D,MAAM,UAAU,MAAM,QAAQ,CAC5B;EACE,MAAM;EACN,MAAM;EACN,SAAS;EACT,SAAS;EACV,EACD;EACE,MAAM;EACN,MAAM;EACN,SAAS;EACT,UAdc,MAAM,QAAQ,KAAK,KAAK,WAAW,YAAY,CAAC,EAc3C,KAAK,cAAc;GACpC,OAAO;GACP,OAAO;GACR,EAAE;EACJ,CACF,CAAC;CAEF,MAAM,YAAY,KAAK,KAAK,QAAQ,KAAK,EAAE,QAAQ,cAAc;CACjE,MAAM,cAAc,KAAK,KAAK,WAAW,aAAa,QAAQ,aAAa;AAI3E,KAFe,MAAM,qBAAqB,UAAU,EAExC;AACV,UAAQ,OAAO,MACb,MAAM,OAAO,aAAa,UAAU,oBAAoB,CACzD;EACD,MAAM,EAAE,cAAc,MAAM,QAAQ;GAClC,MAAM;GACN,MAAM;GACN,SAAS;GACT,SAAS;GACV,CAAC;AAEF,MAAI,CAAC,WAAW;AACd,WAAQ,OAAO,MAAM,MAAM,IAAI,gBAAgB,CAAC;AAChD,WAAQ,KAAK,EAAE;;;AAInB,SAAQ,OAAO,MAAM,kCAAkC,UAAU,IAAI;AACrE,SAAQ,OAAO,MAAM,mBAAmB,QAAQ,eAAe;AAG/D,OAAM,GAAG,aAAa,WAAW,EAAE,WAAW,MAAM,CAAC;AAErD,SAAQ,OAAO,MAAM,kCAAkC;AAEvD,SAAQ,OAAO,MAAM,MAAM,MAAM,gBAAgB,CAAC;AAElD,SAAQ,OAAO,MAAM,MAAM,QAAQ,cAAc,IAAI;AACrD,SAAQ,OAAO,MAAM,gBAAgB;AACrC,SAAQ,OAAO,MAAM,gBAAgB;AAErC,SAAQ,OAAO,MAAM,mBAAmB;;AAG1C,MAAM"}
@@ -11,9 +11,9 @@
11
11
  "author": "",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "@editframe/cli": "0.23.8-beta.0",
15
- "@editframe/elements": "0.23.8-beta.0",
16
- "@editframe/vite-plugin": "0.23.8-beta.0",
14
+ "@editframe/cli": "0.25.0-beta.0",
15
+ "@editframe/elements": "0.25.0-beta.0",
16
+ "@editframe/vite-plugin": "0.25.0-beta.0",
17
17
  "tailwindcss": "^3.4.3",
18
18
  "vite": "^6.3.5",
19
19
  "vite-plugin-singlefile": "^2.0.1"
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { vitePluginEditframe } from "@editframe/vite-plugin";
3
- import { defineConfig } from "rolldown-vite";
3
+ import { defineConfig } from "vite";
4
4
  import { viteSingleFile } from "vite-plugin-singlefile";
5
5
 
6
6
  export default defineConfig({
@@ -11,9 +11,9 @@
11
11
  "author": "",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "@editframe/cli": "0.23.8-beta.0",
15
- "@editframe/react": "0.23.8-beta.0",
16
- "@editframe/vite-plugin": "0.23.8-beta.0",
14
+ "@editframe/cli": "0.25.0-beta.0",
15
+ "@editframe/react": "0.25.0-beta.0",
16
+ "@editframe/vite-plugin": "0.25.0-beta.0",
17
17
  "@vitejs/plugin-react": "^4.3.1",
18
18
  "tailwindcss": "^3.4.3",
19
19
  "vite": "^6.3.5",
@@ -1,7 +1,7 @@
1
1
  import path from "node:path";
2
2
  import { vitePluginEditframe } from "@editframe/vite-plugin";
3
3
  import react from "@vitejs/plugin-react";
4
- import { defineConfig } from "rolldown-vite";
4
+ import { defineConfig } from "vite";
5
5
  import { viteSingleFile } from "vite-plugin-singlefile";
6
6
 
7
7
  export default defineConfig({
@@ -11,9 +11,9 @@
11
11
  "author": "",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "@editframe/cli": "0.23.8-beta.0",
15
- "@editframe/elements": "0.23.8-beta.0",
16
- "@editframe/vite-plugin": "0.23.8-beta.0",
14
+ "@editframe/cli": "0.25.0-beta.0",
15
+ "@editframe/elements": "0.25.0-beta.0",
16
+ "@editframe/vite-plugin": "0.25.0-beta.0",
17
17
  "tailwindcss": "^3.4.3",
18
18
  "vite": "^6.3.5",
19
19
  "vite-plugin-singlefile": "^2.0.1"
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { vitePluginEditframe } from "@editframe/vite-plugin";
3
- import { defineConfig } from "rolldown-vite";
3
+ import { defineConfig } from "vite";
4
4
  import { viteSingleFile } from "vite-plugin-singlefile";
5
5
 
6
6
  export default defineConfig({
package/package.json CHANGED
@@ -1,30 +1,33 @@
1
1
  {
2
2
  "name": "@editframe/create",
3
- "version": "0.23.8-beta.0",
3
+ "version": "0.25.0-beta.0",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "create-editframe": "dist/index.js"
7
7
  },
8
8
  "type": "module",
9
- "main": "index.js",
9
+ "main": "./dist/index.js",
10
10
  "devDependencies": {
11
11
  "@types/dom-webcodecs": "^0.1.11",
12
12
  "@types/node": "^20.14.13",
13
13
  "@types/prompts": "^2.4.9",
14
- "typescript": "^5.5.4",
15
- "vite-plugin-dts": "^4.5.4",
16
- "vite-tsconfig-paths": "^4.3.2"
14
+ "typescript": "^5.5.4"
17
15
  },
18
16
  "scripts": {
19
17
  "typecheck": "tsc --noEmit --emitDeclarationOnly false",
20
- "build": "vite build",
21
- "build:watch": "vite build --watch"
18
+ "build": "tsdown",
19
+ "build:watch": "tsdown --watch"
22
20
  },
23
21
  "author": "",
24
22
  "license": "UNLICENSED",
25
23
  "dependencies": {
26
24
  "chalk": "^5.3.0",
27
- "debug": "^4.3.5",
28
25
  "prompts": "^2.4.2"
26
+ },
27
+ "module": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
29
+ "exports": {
30
+ ".": "./dist/index.js",
31
+ "./package.json": "./package.json"
29
32
  }
30
33
  }
@@ -0,0 +1,27 @@
1
+ import { exec } from "node:child_process";
2
+ import { promisify } from "node:util";
3
+
4
+ import { defineConfig } from "tsdown";
5
+
6
+ import { createTsdownConfig } from "../tsdown.config.base.ts";
7
+
8
+ const execPromise = promisify(exec);
9
+
10
+ export default defineConfig(
11
+ createTsdownConfig({
12
+ platform: "node",
13
+ copy: [
14
+ {
15
+ from: "src/templates",
16
+ to: "dist/templates",
17
+ },
18
+ ],
19
+ hooks: {
20
+ async onSuccess() {
21
+ await execPromise("chmod +x dist/index.js");
22
+ console.error("chmod +x dist/index.js");
23
+ console.error("Copied templates into dist");
24
+ },
25
+ },
26
+ }),
27
+ );