nurev 0.0.2 → 0.0.3

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/index.js +13 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { default as prompts } from "prompts";
4
4
  import { default as fs } from "fs-extra";
5
- import { resolve } from "path";
5
+ import { fileURLToPath } from "url";
6
6
  import kleur from "kleur";
7
7
 
8
8
  console.log(`${kleur.bgGreen().bold("[Nurev]")}`);
@@ -55,14 +55,19 @@ const questions = [
55
55
  return;
56
56
  }
57
57
 
58
- const templateBase = resolve(__dirname, "templates", "base");
59
- const templateBackend = resolve(__dirname, "templates", response.backend);
60
- const templatePackageManager = resolve(
61
- __dirname,
62
- "templates",
63
- `${response.backend}-${response.manager}`,
58
+ const templateBase = fileURLToPath(
59
+ new URL("./templates/base", import.meta.url),
64
60
  );
65
- const templateDest = resolve(process.cwd());
61
+ const templateBackend = fileURLToPath(
62
+ new URL(`./templates/${response.backend}`, import.meta.url),
63
+ );
64
+ const templatePackageManager = fileURLToPath(
65
+ new URL(
66
+ `./templates/${response.backend}-${response.manager}`,
67
+ import.meta.url,
68
+ ),
69
+ );
70
+ const templateDest = process.cwd();
66
71
 
67
72
  try {
68
73
  await fs.copy(templateBase, templateDest);
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "typescript": "^5"
11
11
  },
12
12
  "bin": "./index.js",
13
- "version": "0.0.2",
13
+ "version": "0.0.3",
14
14
  "type": "module",
15
15
  "dependencies": {
16
16
  "fs-extra": "^11.3.4",