create-codebase-snapshot 4.4.0 → 4.5.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/README.md +5 -5
- package/index.mjs +4 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# create-codebase-snapshot
|
|
2
2
|
|
|
3
|
-
Sets up [
|
|
3
|
+
Sets up [`codebase-snapshot`](https://www.npmjs.com/package/codebase-snapshot)
|
|
4
4
|
in the current repository.
|
|
5
5
|
|
|
6
6
|
```bash
|
|
@@ -29,10 +29,10 @@ npm create codebase-snapshot -- --preset react-vite --yes
|
|
|
29
29
|
| :--- | :--- |
|
|
30
30
|
| `snapshot.config.ts` / `snapshot.config.mjs` | Every setting at its default. `.ts` needs an ES-module `package.json` and Node ≥ 22.6; `.mjs` is used otherwise, because a `.ts` config is loaded with the enclosing package's module type. |
|
|
31
31
|
| `package.json` → `scripts.snapshot`, `scripts.snapshot:validate` | Skipped when there is no `package.json` to hold them. |
|
|
32
|
-
| `package.json` → `devDependencies` |
|
|
32
|
+
| `package.json` → `devDependencies` | `codebase-snapshot` at the version this scaffolder shipped with. A range you already declared is never overwritten. |
|
|
33
33
|
| `.gitignore` | `snapshot/`, `snapshot.tmp/`. |
|
|
34
34
|
|
|
35
|
-
The generated scripts run `npx
|
|
35
|
+
The generated scripts run `npx codebase-snapshot …`, and `npx` uses the
|
|
36
36
|
local `devDependencies` copy when there is one — so the version is pinned by your
|
|
37
37
|
lockfile instead of drifting to `@latest`. Until you run `npm install`, `npx` would
|
|
38
38
|
fall back to downloading the newest release, which is why the printed next step is
|
|
@@ -40,7 +40,7 @@ fall back to downloading the newest release, which is why the printed next step
|
|
|
40
40
|
while scaffolding.
|
|
41
41
|
|
|
42
42
|
Without a `package.json` the scripts cannot be added, and the printed next step is
|
|
43
|
-
`npx
|
|
43
|
+
`npx codebase-snapshot generate` instead.
|
|
44
44
|
|
|
45
45
|
This package is a shim: the wizard itself lives in the main package, so
|
|
46
|
-
`npx
|
|
46
|
+
`npx codebase-snapshot init` does exactly the same thing.
|
package/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
-
import { PromptCancelled, runInit } from "
|
|
4
|
+
import { PromptCancelled, runInit } from "codebase-snapshot";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* `npm create codebase-snapshot`
|
|
8
8
|
*
|
|
9
9
|
* A thin shim over the same wizard the main package exposes, so there is exactly
|
|
10
10
|
* one prompt implementation to keep working. Everything it does is available as
|
|
11
|
-
* `npx
|
|
11
|
+
* `npx codebase-snapshot init`; this entry point only exists because
|
|
12
12
|
* `npm create <x>` is the convention developers reach for first.
|
|
13
13
|
*
|
|
14
14
|
* The shim used to carry its own `devDependencies` writer, because `init` wrote the
|
|
@@ -17,7 +17,7 @@ import { PromptCancelled, runInit } from "@ankurhalder/codebase-snapshot";
|
|
|
17
17
|
* second source of truth, and the two drift.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
const PACKAGE_NAME = "
|
|
20
|
+
const PACKAGE_NAME = "codebase-snapshot";
|
|
21
21
|
|
|
22
22
|
/** True when the package's own binary is already installed in the project. */
|
|
23
23
|
function hasLocalBinary() {
|
|
@@ -64,7 +64,7 @@ if (argv.includes("--help") || argv.includes("-h")) {
|
|
|
64
64
|
[
|
|
65
65
|
"create-codebase-snapshot",
|
|
66
66
|
"",
|
|
67
|
-
" Sets up
|
|
67
|
+
" Sets up codebase-snapshot in the current directory.",
|
|
68
68
|
"",
|
|
69
69
|
" Usage:",
|
|
70
70
|
" npm create codebase-snapshot",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-codebase-snapshot",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "Set up
|
|
3
|
+
"version": "4.5.0",
|
|
4
|
+
"description": "Set up codebase-snapshot in a repository",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ankur Halder <ankur.halder12345@gmail.com>",
|
|
7
7
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"
|
|
25
|
+
"codebase-snapshot": "^4.5.0"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=18.0.0"
|