create-addfox-app 0.1.1-beta.11 → 0.1.1-beta.12

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.
Files changed (2) hide show
  1. package/dist/cli.js +9 -6
  2. package/package.json +1 -1
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 SKIP_TEMPLATE_PATH_PARTS = new Set([
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 normalized = src.split(/[/\\]/);
29
- for (const part of normalized)if (SKIP_TEMPLATE_PATH_PARTS.has(part)) return false;
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
- await cp(templatePath, destDir, {
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 = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-addfox-app",
3
- "version": "0.1.1-beta.11",
3
+ "version": "0.1.1-beta.12",
4
4
  "description": "Interactive scaffolder for addfox extension projects",
5
5
  "license": "MIT",
6
6
  "type": "module",