create-webpack-starter 0.2.2 → 0.2.4

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/CHANGELOG.md CHANGED
@@ -1,9 +1,43 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.4] - 2026-02-07
4
+
5
+ ### Added
6
+ - End-to-end (E2E) test suite for CLI behavior
7
+ - Tests for:
8
+ - basic project creation
9
+ - template selection
10
+ - `--dry-run` mode
11
+ - invalid template handling
12
+ - Temporary directory management with automatic cleanup
13
+ - Internal testing documentation (`docs/testing.md`)
14
+
15
+ ### Changed
16
+ - Improved CLI test reliability by aligning tests with real user usage patterns
17
+
18
+ ### Notes
19
+ - No changes to CLI runtime behavior
20
+ - This release focuses on test stability and maintainability
21
+
22
+
23
+ ## [0.2.3] - 2026-02-06
24
+
25
+ ### Added
26
+ - Explicit mono-repo metadata for npm publishing (`repository.directory`, `homepage`, `bugs`)
27
+
28
+ ### Changed
29
+ - Updated documentation links to use absolute GitHub URLs for mono-repo compatibility
30
+ - Improved README navigation reliability on npm registry
31
+
32
+ ### Notes
33
+ - This release stabilizes documentation visibility for mono-repo setups
34
+ - No functional changes to CLI behavior
35
+
36
+
3
37
  ## [0.2.2] - 2026-02-06
4
38
 
5
39
  ### Fixed
6
- - **Documentation links** in `README.md` now resolve correctly on npm and GitHub; relative paths updated.
40
+ - **Documentation links** in `README.md` now resolve correctly on npm and GitHub; paths updated.
7
41
 
8
42
  ### Notes
9
43
  - Republished package as **0.2.2**.
package/README.md CHANGED
@@ -46,6 +46,7 @@ Detailed documentation is available in the `/docs` directory:
46
46
  - [Templates](https://github.com/Razerspine/webpack-starter-monorepo/blob/main/packages/create-webpack-starter/docs/templates.md)
47
47
  - [webpack-core](https://github.com/Razerspine/webpack-starter-monorepo/blob/main/packages/create-webpack-starter/docs/webpack-core.md)
48
48
  - [FAQ](https://github.com/Razerspine/webpack-starter-monorepo/blob/main/packages/create-webpack-starter/docs/faq.md)
49
+ - [Testing](https://github.com/Razerspine/webpack-starter-monorepo/blob/main/packages/create-webpack-starter/docs/testing.md)
49
50
 
50
51
  The documentation explains:
51
52
  - how the CLI works internally
@@ -0,0 +1,74 @@
1
+ # Testing
2
+
3
+ This project uses **end-to-end (E2E) tests** to verify real CLI behavior.
4
+
5
+ The goal of these tests is to simulate how a real user interacts with
6
+ `create-webpack-starter` via `npx`, including file system side effects.
7
+
8
+ ---
9
+
10
+ ## Test structure
11
+
12
+ ```md
13
+ e2e/
14
+ ├── basic.test.js # Basic project creation
15
+ ├── template.test.js # Explicit template selection
16
+ ├── dry-run.test.js # --dry-run behavior
17
+ ├── invalid-template.test.js # Invalid template handling
18
+ ├── constants/
19
+ │ └── temp-prefix.js # Prefix for temp directories
20
+ ├── helpers/
21
+ │ ├── run-cli.js # Spawns CLI process
22
+ │ ├── temp-dir.js # Creates isolated temp directory
23
+ │ └── cleanup.js # Cleans up old temp directories
24
+ └── package.json
25
+ ```
26
+
27
+
28
+ ---
29
+
30
+ ## Key principles
31
+
32
+ - Tests invoke the CLI **exactly as a user would**
33
+ (no direct imports of internal modules).
34
+ - CLI arguments always represent **project names**, not absolute paths.
35
+ - The working directory (`cwd`) controls where the project is created.
36
+ - Each test runs in an isolated temporary directory.
37
+ - All temporary directories share a common prefix.
38
+
39
+ ---
40
+
41
+ ## Temporary directories
42
+
43
+ All test-created directories use the prefix: `create-webpack-starter`
44
+ A cleanup script removes stale directories from `/tmp` before and after tests.
45
+
46
+ ---
47
+
48
+ ## Running tests
49
+
50
+ ```bash
51
+ npm run test:e2e
52
+ ```
53
+
54
+ #### This command:
55
+ * Cleans up old temp directories
56
+ * Runs all E2E tests sequentially
57
+ * Cleans up again after completion
58
+
59
+ #### You can also run cleanup manually:
60
+
61
+ ```bash
62
+ npm run test:cleanup
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Why E2E only?
68
+
69
+ Since this is a CLI tool, behavior matters more than internal structure.
70
+ E2E tests ensure that:
71
+ * prompts work
72
+ * files are created correctly
73
+ * flags behave as expected
74
+ * real-world usage remains stable over time
package/package.json CHANGED
@@ -1,10 +1,20 @@
1
1
  {
2
2
  "name": "create-webpack-starter",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Create a webpack starter with Pug, SCSS, TS and more",
5
5
  "bin": {
6
6
  "create-webpack-starter": "bin/index.js"
7
7
  },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/Razerspine/webpack-starter-monorepo.git",
11
+ "directory": "packages/create-webpack-starter"
12
+ },
13
+ "homepage": "https://github.com/Razerspine/webpack-starter-monorepo/tree/main/packages/create-webpack-starter#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/Razerspine/webpack-starter-monorepo/issues"
16
+ },
17
+
8
18
  "files": [
9
19
  "bin",
10
20
  "dist",
@@ -15,6 +25,8 @@
15
25
  ],
16
26
  "scripts": {
17
27
  "build": "tsc",
28
+ "test:cleanup": "node e2e/helpers/cleanup.js",
29
+ "test:e2e": "npm run test:cleanup && (node e2e/basic.test.js && node e2e/template.test.js && node e2e/dry-run.test.js && node e2e/invalid-template.test.js); npm run test:cleanup",
18
30
  "dev": "ts-node src/index.ts",
19
31
  "prepublishOnly": "npm run build"
20
32
  },