@editframe/create 0.16.8-beta.0 → 0.18.3-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.js +49 -57
- package/dist/templates/card-poetry/package.json +4 -4
- package/dist/templates/card-poetry/vite.config.ts +3 -3
- package/dist/templates/react-demo/package.json +4 -4
- package/dist/templates/react-demo/vite.config.ts +4 -4
- package/dist/templates/simple-demo/package.json +4 -4
- package/dist/templates/simple-demo/vite.config.ts +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,66 +1,58 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { access, cp, readdir } from "node:fs/promises";
|
|
3
3
|
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
|
-
async function checkDirectoryExists(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
async function checkDirectoryExists(path$1) {
|
|
8
|
+
try {
|
|
9
|
+
await access(path$1);
|
|
10
|
+
return true;
|
|
11
|
+
} catch (_error) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
14
|
}
|
|
15
15
|
async function main() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
await cp(templateDir, targetDir, { recursive: true });
|
|
58
|
-
process.stderr.write("Project created successfully.\n");
|
|
59
|
-
process.stderr.write(chalk.green("Next steps:\n"));
|
|
60
|
-
process.stderr.write(`cd ${answers.directoryName}
|
|
61
|
-
`);
|
|
62
|
-
process.stderr.write("npm install\n");
|
|
63
|
-
process.stderr.write("npm start\n\n");
|
|
64
|
-
process.stderr.write("Happy hacking!\n");
|
|
16
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const templates = await readdir(path.join(__dirname, "templates"));
|
|
18
|
+
const answers = await prompts([{
|
|
19
|
+
type: "text",
|
|
20
|
+
name: "directoryName",
|
|
21
|
+
message: "Enter the name of the directory to generate into:",
|
|
22
|
+
initial: "my-project"
|
|
23
|
+
}, {
|
|
24
|
+
type: "select",
|
|
25
|
+
name: "templateName",
|
|
26
|
+
message: "Choose a starter template:",
|
|
27
|
+
choices: templates.map((template) => ({
|
|
28
|
+
title: template,
|
|
29
|
+
value: template
|
|
30
|
+
}))
|
|
31
|
+
}]);
|
|
32
|
+
const targetDir = path.join(process.cwd(), answers.directoryName);
|
|
33
|
+
const templateDir = path.join(__dirname, "templates", answers.templateName);
|
|
34
|
+
const exists = await checkDirectoryExists(targetDir);
|
|
35
|
+
if (exists) {
|
|
36
|
+
process.stderr.write(chalk.yellow(`Directory ${targetDir} already exists.\n`));
|
|
37
|
+
const { overwrite } = await prompts({
|
|
38
|
+
type: "confirm",
|
|
39
|
+
name: "overwrite",
|
|
40
|
+
message: "Directory already exists. Do you want to overwrite it?",
|
|
41
|
+
initial: false
|
|
42
|
+
});
|
|
43
|
+
if (!overwrite) {
|
|
44
|
+
process.stderr.write(chalk.red("Aborting...\n"));
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
process.stderr.write(`Creating project in directory: ${targetDir}\n`);
|
|
49
|
+
process.stderr.write(`Using template: ${answers.templateName}`);
|
|
50
|
+
await cp(templateDir, targetDir, { recursive: true });
|
|
51
|
+
process.stderr.write("Project created successfully.\n");
|
|
52
|
+
process.stderr.write(chalk.green("Next steps:\n"));
|
|
53
|
+
process.stderr.write(`cd ${answers.directoryName}\n`);
|
|
54
|
+
process.stderr.write("npm install\n");
|
|
55
|
+
process.stderr.write("npm start\n\n");
|
|
56
|
+
process.stderr.write("Happy hacking!\n");
|
|
65
57
|
}
|
|
66
58
|
main();
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@editframe/cli": "0.
|
|
15
|
-
"@editframe/elements": "0.
|
|
16
|
-
"@editframe/vite-plugin": "0.
|
|
14
|
+
"@editframe/cli": "0.18.3-beta.0",
|
|
15
|
+
"@editframe/elements": "0.18.3-beta.0",
|
|
16
|
+
"@editframe/vite-plugin": "0.18.3-beta.0",
|
|
17
17
|
"tailwindcss": "^3.4.3",
|
|
18
18
|
"vite": "^6.3.5",
|
|
19
19
|
"vite-plugin-singlefile": "^2.0.1"
|
|
20
20
|
}
|
|
21
|
-
}
|
|
21
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import { viteSingleFile } from "vite-plugin-singlefile";
|
|
3
|
-
import { vitePluginEditframe } from "@editframe/vite-plugin";
|
|
4
1
|
import path from "node:path";
|
|
2
|
+
import { vitePluginEditframe } from "@editframe/vite-plugin";
|
|
3
|
+
import { defineConfig } from "rolldown-vite";
|
|
4
|
+
import { viteSingleFile } from "vite-plugin-singlefile";
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
7
|
plugins: [
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@editframe/cli": "0.
|
|
15
|
-
"@editframe/react": "0.
|
|
16
|
-
"@editframe/vite-plugin": "0.
|
|
14
|
+
"@editframe/cli": "0.18.3-beta.0",
|
|
15
|
+
"@editframe/react": "0.18.3-beta.0",
|
|
16
|
+
"@editframe/vite-plugin": "0.18.3-beta.0",
|
|
17
17
|
"@vitejs/plugin-react": "^4.3.1",
|
|
18
18
|
"tailwindcss": "^3.4.3",
|
|
19
19
|
"vite": "^6.3.5",
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
"@types/react": "^18.3.0",
|
|
26
26
|
"@types/react-dom": "^18.3.0"
|
|
27
27
|
}
|
|
28
|
-
}
|
|
28
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import { viteSingleFile } from "vite-plugin-singlefile";
|
|
3
|
-
import react from "@vitejs/plugin-react";
|
|
4
|
-
import { vitePluginEditframe } from "@editframe/vite-plugin";
|
|
5
1
|
import path from "node:path";
|
|
2
|
+
import { vitePluginEditframe } from "@editframe/vite-plugin";
|
|
3
|
+
import react from "@vitejs/plugin-react";
|
|
4
|
+
import { defineConfig } from "rolldown-vite";
|
|
5
|
+
import { viteSingleFile } from "vite-plugin-singlefile";
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
plugins: [
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@editframe/cli": "0.
|
|
15
|
-
"@editframe/elements": "0.
|
|
16
|
-
"@editframe/vite-plugin": "0.
|
|
14
|
+
"@editframe/cli": "0.18.3-beta.0",
|
|
15
|
+
"@editframe/elements": "0.18.3-beta.0",
|
|
16
|
+
"@editframe/vite-plugin": "0.18.3-beta.0",
|
|
17
17
|
"tailwindcss": "^3.4.3",
|
|
18
18
|
"vite": "^6.3.5",
|
|
19
19
|
"vite-plugin-singlefile": "^2.0.1"
|
|
20
20
|
}
|
|
21
|
-
}
|
|
21
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import { viteSingleFile } from "vite-plugin-singlefile";
|
|
3
|
-
import { vitePluginEditframe } from "@editframe/vite-plugin";
|
|
4
1
|
import path from "node:path";
|
|
2
|
+
import { vitePluginEditframe } from "@editframe/vite-plugin";
|
|
3
|
+
import { defineConfig } from "rolldown-vite";
|
|
4
|
+
import { viteSingleFile } from "vite-plugin-singlefile";
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
7
|
plugins: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/create",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.3-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-editframe": "dist/index.js"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@types/node": "^20.14.13",
|
|
13
13
|
"@types/prompts": "^2.4.9",
|
|
14
14
|
"typescript": "^5.5.4",
|
|
15
|
-
"vite-plugin-dts": "^4.
|
|
15
|
+
"vite-plugin-dts": "^4.5.4",
|
|
16
16
|
"vite-tsconfig-paths": "^4.3.2"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|