create-addfox-app 0.1.1-beta.11 → 0.1.1-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/cli.js +25 -26
- package/package.json +1 -1
- package/templates/template-preact-js/package.json +1 -2
- package/templates/template-preact-ts/package.json +1 -2
- package/templates/template-react-js/package.json +1 -2
- package/templates/template-react-ts/package.json +1 -2
- package/templates/template-solid-js/package.json +1 -2
- package/templates/template-solid-ts/package.json +1 -2
- package/templates/template-svelte-js/package.json +1 -2
- package/templates/template-svelte-ts/package.json +1 -2
- package/templates/template-vanilla-js/package.json +3 -5
- package/templates/template-vanilla-ts/package.json +1 -4
- package/templates/template-vue-js/addfox.config.js +2 -2
- package/templates/template-vue-js/package.json +1 -3
- package/templates/template-vue-ts/addfox.config.ts +2 -2
- package/templates/template-vue-ts/package.json +1 -4
package/dist/cli.js
CHANGED
|
@@ -19,14 +19,16 @@ function getBundledTemplatesDir() {
|
|
|
19
19
|
function hasLocalTemplate(templateName) {
|
|
20
20
|
return existsSync(join(getBundledTemplatesDir(), templateName));
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const SKIP_RELATIVE_SEGMENTS = new Set([
|
|
23
23
|
"node_modules",
|
|
24
24
|
".git",
|
|
25
25
|
".pnpm"
|
|
26
26
|
]);
|
|
27
|
-
function shouldCopyLocalTemplatePath(src) {
|
|
28
|
-
const
|
|
29
|
-
|
|
27
|
+
function shouldCopyLocalTemplatePath(src, templateRoot) {
|
|
28
|
+
const root = external_node_path_resolve(templateRoot);
|
|
29
|
+
const rel = relative(root, external_node_path_resolve(src));
|
|
30
|
+
if (rel.startsWith("..")) return true;
|
|
31
|
+
for (const part of rel.split(/[/\\]/))if (SKIP_RELATIVE_SEGMENTS.has(part)) return false;
|
|
30
32
|
return true;
|
|
31
33
|
}
|
|
32
34
|
async function copyBundledTemplate(templateName, destDir) {
|
|
@@ -35,9 +37,10 @@ async function copyBundledTemplate(templateName, destDir) {
|
|
|
35
37
|
await mkdir(destDir, {
|
|
36
38
|
recursive: true
|
|
37
39
|
});
|
|
38
|
-
|
|
40
|
+
const resolvedTemplate = external_node_path_resolve(templatePath);
|
|
41
|
+
await cp(resolvedTemplate, destDir, {
|
|
39
42
|
recursive: true,
|
|
40
|
-
filter: (src)=>shouldCopyLocalTemplatePath(src)
|
|
43
|
+
filter: (src)=>shouldCopyLocalTemplatePath(src, resolvedTemplate)
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
const FRAMES = [
|
|
@@ -493,16 +496,6 @@ function applyTestAndReportSetup(root, language, selection) {
|
|
|
493
496
|
}
|
|
494
497
|
}
|
|
495
498
|
const RESET = "\x1b[0m";
|
|
496
|
-
const ORANGE = [
|
|
497
|
-
255,
|
|
498
|
-
118,
|
|
499
|
-
38
|
|
500
|
-
];
|
|
501
|
-
const PINK = [
|
|
502
|
-
255,
|
|
503
|
-
92,
|
|
504
|
-
186
|
|
505
|
-
];
|
|
506
499
|
const LOGO_LINES = [
|
|
507
500
|
" █████╗ ██████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗",
|
|
508
501
|
"██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔═══██╗╚██╗██╔╝",
|
|
@@ -511,13 +504,15 @@ const LOGO_LINES = [
|
|
|
511
504
|
"██║ ██║██████╔╝██████╔╝██║ ╚██████╔╝██╔╝ ██╗",
|
|
512
505
|
"╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝"
|
|
513
506
|
];
|
|
514
|
-
|
|
515
|
-
|
|
507
|
+
const GRADIENT_START_256 = 208;
|
|
508
|
+
const GRADIENT_END_256 = 213;
|
|
509
|
+
function shouldEmitAnsiColor() {
|
|
510
|
+
return !process.env.NO_COLOR;
|
|
516
511
|
}
|
|
517
|
-
function
|
|
518
|
-
return `\x1b[38;
|
|
512
|
+
function ansi256Fg(code) {
|
|
513
|
+
return `\x1b[38;5;${code}m`;
|
|
519
514
|
}
|
|
520
|
-
function
|
|
515
|
+
function colorizeLineAnsi256(line) {
|
|
521
516
|
const len = line.length;
|
|
522
517
|
if (0 === len) return "";
|
|
523
518
|
let out = "";
|
|
@@ -528,16 +523,20 @@ function colorizeLine(line) {
|
|
|
528
523
|
continue;
|
|
529
524
|
}
|
|
530
525
|
const t = len <= 1 ? 0 : i / (len - 1);
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
const b = lerpChannel(ORANGE[2], PINK[2], t);
|
|
534
|
-
out += rgbFg(r, g, b) + ch;
|
|
526
|
+
const code = Math.round(GRADIENT_START_256 + t * (GRADIENT_END_256 - GRADIENT_START_256));
|
|
527
|
+
out += ansi256Fg(code) + ch;
|
|
535
528
|
}
|
|
536
529
|
return out + RESET;
|
|
537
530
|
}
|
|
531
|
+
function printPlainLogo() {
|
|
532
|
+
console.log("");
|
|
533
|
+
for (const line of LOGO_LINES)console.log(line);
|
|
534
|
+
console.log("");
|
|
535
|
+
}
|
|
538
536
|
function printAddfoxLogo() {
|
|
537
|
+
if (!shouldEmitAnsiColor()) return void printPlainLogo();
|
|
539
538
|
console.log("");
|
|
540
|
-
for (const line of LOGO_LINES)console.log(
|
|
539
|
+
for (const line of LOGO_LINES)console.log(colorizeLineAnsi256(line));
|
|
541
540
|
console.log("");
|
|
542
541
|
}
|
|
543
542
|
const SKIP_STYLE_ENTRIES = new Set([
|
package/package.json
CHANGED
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"preact": "^10.29.0"
|
|
15
13
|
},
|
|
16
14
|
"devDependencies": {
|
|
15
|
+
"addfox": "^0.1.1-beta.7",
|
|
17
16
|
"@rsbuild/plugin-preact": "^1.7.2"
|
|
18
17
|
}
|
|
19
18
|
}
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"preact": "^10.29.0"
|
|
15
13
|
},
|
|
16
14
|
"devDependencies": {
|
|
15
|
+
"addfox": "^0.1.1-beta.7",
|
|
17
16
|
"@rsbuild/plugin-preact": "^1.7.2",
|
|
18
17
|
"typescript": "^5.9.3",
|
|
19
18
|
"@types/chrome": "^0.1.38"
|
|
@@ -8,13 +8,12 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"react": "^19.2.4",
|
|
15
13
|
"react-dom": "^19.2.4"
|
|
16
14
|
},
|
|
17
15
|
"devDependencies": {
|
|
16
|
+
"addfox": "^0.1.1-beta.7",
|
|
18
17
|
"@rsbuild/plugin-react": "^1.4.6"
|
|
19
18
|
}
|
|
20
19
|
}
|
|
@@ -8,13 +8,12 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"react": "^19.2.4",
|
|
15
13
|
"react-dom": "^19.2.4"
|
|
16
14
|
},
|
|
17
15
|
"devDependencies": {
|
|
16
|
+
"addfox": "^0.1.1-beta.7",
|
|
18
17
|
"@rsbuild/plugin-react": "^1.4.6",
|
|
19
18
|
"typescript": "^5.9.3",
|
|
20
19
|
"@types/chrome": "^0.1.38",
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"solid-js": "^1.9.11"
|
|
15
13
|
},
|
|
16
14
|
"devDependencies": {
|
|
15
|
+
"addfox": "^0.1.1-beta.7",
|
|
17
16
|
"@rsbuild/plugin-babel": "^1.1.2",
|
|
18
17
|
"@rsbuild/plugin-solid": "^1.1.1"
|
|
19
18
|
}
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"solid-js": "^1.9.11"
|
|
15
13
|
},
|
|
16
14
|
"devDependencies": {
|
|
15
|
+
"addfox": "^0.1.1-beta.7",
|
|
17
16
|
"@rsbuild/plugin-babel": "^1.1.2",
|
|
18
17
|
"@rsbuild/plugin-solid": "^1.1.1",
|
|
19
18
|
"typescript": "^5.9.3",
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"svelte": "^5.54.1"
|
|
15
13
|
},
|
|
16
14
|
"devDependencies": {
|
|
15
|
+
"addfox": "^0.1.1-beta.7",
|
|
17
16
|
"@rsbuild/plugin-svelte": "^1.1.1"
|
|
18
17
|
}
|
|
19
18
|
}
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"svelte": "^5.54.1"
|
|
15
13
|
},
|
|
16
14
|
"devDependencies": {
|
|
15
|
+
"addfox": "^0.1.1-beta.7",
|
|
17
16
|
"@rsbuild/plugin-svelte": "^1.1.1",
|
|
18
17
|
"typescript": "^5.9.3",
|
|
19
18
|
"@types/chrome": "^0.1.38"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "addfox";
|
|
2
|
-
import
|
|
2
|
+
import { pluginVue } from "@rsbuild/plugin-vue";
|
|
3
3
|
|
|
4
4
|
const manifest = {
|
|
5
5
|
name: "My Extension",
|
|
@@ -23,5 +23,5 @@ const manifest = {
|
|
|
23
23
|
|
|
24
24
|
export default defineConfig({
|
|
25
25
|
manifest: { chromium: manifest, firefox: { ...manifest } },
|
|
26
|
-
plugins: [
|
|
26
|
+
plugins: [pluginVue()],
|
|
27
27
|
});
|
|
@@ -8,13 +8,11 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"vue": "^3.5.30"
|
|
15
13
|
},
|
|
16
14
|
"devDependencies": {
|
|
17
|
-
"
|
|
15
|
+
"addfox": "^0.1.1-beta.7",
|
|
18
16
|
"@rsbuild/plugin-vue": "^1.2.7"
|
|
19
17
|
}
|
|
20
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "addfox";
|
|
2
|
-
import
|
|
2
|
+
import { pluginVue } from "@rsbuild/plugin-vue";
|
|
3
3
|
|
|
4
4
|
const manifest = {
|
|
5
5
|
name: "My Extension",
|
|
@@ -23,5 +23,5 @@ const manifest = {
|
|
|
23
23
|
|
|
24
24
|
export default defineConfig({
|
|
25
25
|
manifest: { chromium: manifest, firefox: { ...manifest } },
|
|
26
|
-
plugins: [
|
|
26
|
+
plugins: [pluginVue()],
|
|
27
27
|
});
|
|
@@ -8,15 +8,12 @@
|
|
|
8
8
|
"build": "addfox build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"addfox": "^0.1.1-beta.7",
|
|
12
|
-
"@rsbuild/core": "^1.7.3",
|
|
13
11
|
"@addfox/utils": "^0.1.1-beta.5",
|
|
14
12
|
"vue": "^3.5.30"
|
|
15
13
|
},
|
|
16
14
|
"devDependencies": {
|
|
17
|
-
"
|
|
15
|
+
"addfox": "^0.1.1-beta.7",
|
|
18
16
|
"@rsbuild/plugin-vue": "^1.2.7",
|
|
19
|
-
"@rsbuild/plugin-vue-jsx": "^1.1.2",
|
|
20
17
|
"typescript": "^5.9.3",
|
|
21
18
|
"@types/chrome": "^0.1.38"
|
|
22
19
|
}
|