@blinkk/create-root 1.0.0-alpha.0 → 1.0.0-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/create-root.js +13 -2
- package/package.json +5 -2
package/dist/create-root.js
CHANGED
|
@@ -7,6 +7,11 @@ import fs from "fs";
|
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
import { Command } from "commander";
|
|
9
9
|
import degit from "degit";
|
|
10
|
+
|
|
11
|
+
// src/root-version.ts
|
|
12
|
+
var ROOT_VERSION = "1.0.0-beta.0";
|
|
13
|
+
|
|
14
|
+
// src/create-root.ts
|
|
10
15
|
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
16
|
var require2 = createRequire(import.meta.url);
|
|
12
17
|
var packageJson = require2(path.join(__dirname, "../package.json"));
|
|
@@ -39,6 +44,7 @@ async function main() {
|
|
|
39
44
|
await emitter.clone(outputDir);
|
|
40
45
|
await updatePackageJson(path.join(outputDir, "package.json"));
|
|
41
46
|
console.log("done!");
|
|
47
|
+
console.log("next: run `yarn install`");
|
|
42
48
|
});
|
|
43
49
|
await program.parseAsync(process.argv);
|
|
44
50
|
}
|
|
@@ -46,8 +52,13 @@ async function updatePackageJson(packageJsonPath) {
|
|
|
46
52
|
const str = await fs.promises.readFile(packageJsonPath, "utf-8");
|
|
47
53
|
const packageJson2 = JSON.parse(str);
|
|
48
54
|
packageJson2.name = path.basename(path.dirname(packageJsonPath));
|
|
49
|
-
packageJson2.
|
|
50
|
-
|
|
55
|
+
packageJson2.version = "1.0.0";
|
|
56
|
+
packageJson2.dependencies["@blinkk/root"] = `^${ROOT_VERSION}`;
|
|
57
|
+
await fs.promises.writeFile(
|
|
58
|
+
packageJsonPath,
|
|
59
|
+
JSON.stringify(packageJson2, null, 2),
|
|
60
|
+
"utf-8"
|
|
61
|
+
);
|
|
51
62
|
}
|
|
52
63
|
function maybeRelativePath(filePath) {
|
|
53
64
|
const cwd = process.cwd();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blinkk/create-root",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "s@blinkk.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,9 +21,12 @@
|
|
|
21
21
|
"degit": "^2.8.4"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
+
"@types/degit": "^2.8.3",
|
|
25
|
+
"@types/node": "^18.13.0",
|
|
24
26
|
"tsup": "^6.6.3"
|
|
25
27
|
},
|
|
26
28
|
"scripts": {
|
|
27
|
-
"build": "tsup ./src/create-root.ts --format=esm"
|
|
29
|
+
"build": "pnpm update-root-version && tsup ./src/create-root.ts --format=esm",
|
|
30
|
+
"update-root-version": "node ./scripts/update-root-version.mjs"
|
|
28
31
|
}
|
|
29
32
|
}
|