@editframe/create 0.6.0-beta.11 → 0.6.0-beta.13
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.cjs +27 -8
- package/dist/index.js +28 -9
- package/dist/{project-template → templates/simple-demo}/package.json +3 -3
- package/package.json +4 -2
- /package/dist/{project-template → templates/simple-demo}/index.html +0 -0
- /package/dist/{project-template → templates/simple-demo}/src/assets/.gitkeep +0 -0
- /package/dist/{project-template → templates/simple-demo}/src/assets/bars-n-tone.mp4 +0 -0
- /package/dist/{project-template → templates/simple-demo}/src/assets/editframe.png +0 -0
- /package/dist/{project-template → templates/simple-demo}/src/index.js +0 -0
- /package/dist/{project-template → templates/simple-demo}/src/styles.css +0 -0
- /package/dist/{project-template → templates/simple-demo}/tailwind.config.js +0 -0
package/dist/index.cjs
CHANGED
|
@@ -2,15 +2,34 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const promises = require("node:fs/promises");
|
|
4
4
|
const path = require("node:path");
|
|
5
|
+
const node_url = require("node:url");
|
|
6
|
+
const prompts = require("prompts");
|
|
5
7
|
var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
|
|
6
8
|
async function main() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const __dirname = path.dirname(node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index.cjs", document.baseURI).href));
|
|
10
|
+
const templates = await promises.readdir(path.join(__dirname, "templates"));
|
|
11
|
+
const answers = await prompts([
|
|
12
|
+
{
|
|
13
|
+
type: "text",
|
|
14
|
+
name: "directoryName",
|
|
15
|
+
message: "Enter the name of the directory to generate into:",
|
|
16
|
+
initial: "my-project"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: "select",
|
|
20
|
+
name: "templateName",
|
|
21
|
+
message: "Choose a starter template:",
|
|
22
|
+
choices: templates.map((template) => ({
|
|
23
|
+
title: template,
|
|
24
|
+
value: template
|
|
25
|
+
}))
|
|
26
|
+
}
|
|
27
|
+
]);
|
|
28
|
+
const targetDir = path.join(process.cwd(), answers.directoryName);
|
|
29
|
+
const templateDir = path.join(__dirname, "templates", answers.templateName);
|
|
30
|
+
console.log(`Creating project in directory: ${targetDir}`);
|
|
31
|
+
console.log(`Using template: ${answers.templateName}`);
|
|
32
|
+
await promises.cp(templateDir, targetDir, { recursive: true });
|
|
33
|
+
console.log("Project created successfully.");
|
|
15
34
|
}
|
|
16
35
|
main();
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { cp } from "node:fs/promises";
|
|
2
|
+
import { readdir, cp } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import prompts from "prompts";
|
|
4
6
|
async function main() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const templates = await readdir(path.join(__dirname, "templates"));
|
|
9
|
+
const answers = await prompts([
|
|
10
|
+
{
|
|
11
|
+
type: "text",
|
|
12
|
+
name: "directoryName",
|
|
13
|
+
message: "Enter the name of the directory to generate into:",
|
|
14
|
+
initial: "my-project"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: "select",
|
|
18
|
+
name: "templateName",
|
|
19
|
+
message: "Choose a starter template:",
|
|
20
|
+
choices: templates.map((template) => ({
|
|
21
|
+
title: template,
|
|
22
|
+
value: template
|
|
23
|
+
}))
|
|
24
|
+
}
|
|
25
|
+
]);
|
|
26
|
+
const targetDir = path.join(process.cwd(), answers.directoryName);
|
|
27
|
+
const templateDir = path.join(__dirname, "templates", answers.templateName);
|
|
28
|
+
console.log(`Creating project in directory: ${targetDir}`);
|
|
29
|
+
console.log(`Using template: ${answers.templateName}`);
|
|
30
|
+
await cp(templateDir, targetDir, { recursive: true });
|
|
31
|
+
console.log("Project created successfully.");
|
|
13
32
|
}
|
|
14
33
|
main();
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@editframe/cli": "0.6.0-beta.
|
|
15
|
-
"@editframe/elements": "0.6.0-beta.
|
|
16
|
-
"@editframe/vite-plugin": "0.6.0-beta.
|
|
14
|
+
"@editframe/cli": "0.6.0-beta.13",
|
|
15
|
+
"@editframe/elements": "0.6.0-beta.13",
|
|
16
|
+
"@editframe/vite-plugin": "0.6.0-beta.13",
|
|
17
17
|
"tailwindcss": "^3.4.3",
|
|
18
18
|
"vite": "^5.2.11",
|
|
19
19
|
"vite-plugin-singlefile": "^2.0.1"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/create",
|
|
3
|
-
"version": "0.6.0-beta.
|
|
3
|
+
"version": "0.6.0-beta.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-editframe": "dist/index.js"
|
|
@@ -20,5 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "UNLICENSED",
|
|
23
|
-
"dependencies": {
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"prompts": "^2.4.2"
|
|
25
|
+
}
|
|
24
26
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|