create-webpack-starter 0.2.3 → 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 +20 -0
- package/README.md +1 -0
- package/docs/testing.md +74 -0
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
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
|
+
|
|
3
23
|
## [0.2.3] - 2026-02-06
|
|
4
24
|
|
|
5
25
|
### Added
|
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
|
package/docs/testing.md
ADDED
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-webpack-starter",
|
|
3
|
-
"version": "0.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"
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
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",
|
|
28
30
|
"dev": "ts-node src/index.ts",
|
|
29
31
|
"prepublishOnly": "npm run build"
|
|
30
32
|
},
|