wake-runner 1.0.1 → 1.0.2
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 +53 -0
- package/README.md +44 -2
- package/bin/wake-storefront.js +1 -1
- package/bin/wake-tailwind.js +1 -1
- package/bin/wake.js +122 -29
- package/package.json +2 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.0.2] - 2026-03-06
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `--help` / `-h` flag: prints all commands, flags, and usage examples to the terminal and exits.
|
|
15
|
+
- Generic flag passthrough: any flag not consumed by `wake-runner` itself is forwarded to the underlying CLI. In specific modes (`wake storefront`, `wake tailwind`) flags go to the respective tool. In `wake` (all) mode, extra flags are forwarded to `fbits.storefront` only to avoid passing incompatible flags to `tailwindcss`.
|
|
16
|
+
- `--no-minify` flag for `wake tailwind`, `wake-tailwind`, and `wake` commands. CSS output is minified by default; pass `--no-minify` to disable.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- In `wake` (all) mode, passthrough args were incorrectly forwarded to both `fbits.storefront` and `tailwindcss`. Extra flags are now sent only to `fbits.storefront`.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- All CLI output messages and error messages translated to English for consistency with documentation.
|
|
25
|
+
|
|
26
|
+
## [1.0.1] - 2026-03-05
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- `--no-minify` flag for `wake tailwind`, `wake-tailwind`, and `wake` commands. CSS output is minified by default; pass `--no-minify` to disable.
|
|
31
|
+
- Repository, homepage, and bugs URLs in `package.json` for correct linking on the npm package page.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Tailwind CSS version requirement documented as **3.4.18**, aligned with the [Wake template padrão](https://wakecommerce.readme.io/docs/template-padrao#tailwindcss).
|
|
36
|
+
- Both standalone CLI and npm installation options for Tailwind are now documented.
|
|
37
|
+
- `bin` paths in `package.json` normalized (removed leading `./`).
|
|
38
|
+
|
|
39
|
+
## [1.0.0] - 2026-03-05
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- Initial release of **wake-runner**.
|
|
44
|
+
- `wake` command: starts `fbits.storefront` (using token from `Configs/settings.json`) and all Tailwind CSS watchers in parallel.
|
|
45
|
+
- `wake storefront` / `wake-storefront`: starts only `fbits.storefront`.
|
|
46
|
+
- `wake tailwind` / `wake-tailwind`: starts one Tailwind `--watch` process per `input*.css` file found in `Assets/CSS/`, mapping `input` → `output` in the output filename.
|
|
47
|
+
- Auto-detection of Tailwind: uses local npm installation (`node_modules/.bin/tailwindcss`) when available, falls back to global `tailwindcss` in PATH.
|
|
48
|
+
- Fix for alternate entry points (`wake-storefront.js`, `wake-tailwind.js`) not executing the CLI when required from `wake.js`.
|
|
49
|
+
|
|
50
|
+
[Unreleased]: https://github.com/SimksS/wake-runner/compare/v1.0.2...HEAD
|
|
51
|
+
[1.0.2]: https://github.com/SimksS/wake-runner/compare/v1.0.1...v1.0.2
|
|
52
|
+
[1.0.1]: https://github.com/SimksS/wake-runner/compare/v1.0.0...v1.0.1
|
|
53
|
+
[1.0.0]: https://github.com/SimksS/wake-runner/releases/tag/v1.0.0
|
package/README.md
CHANGED
|
@@ -100,6 +100,8 @@ Go to your Wake project root and run one of the commands below.
|
|
|
100
100
|
|
|
101
101
|
If you are using a local npm Tailwind installation, run these commands from the same project root where `tailwindcss` was installed.
|
|
102
102
|
|
|
103
|
+
Run `wake --help` at any time to see all commands, flags, and examples directly in the terminal.
|
|
104
|
+
|
|
103
105
|
### Start everything
|
|
104
106
|
|
|
105
107
|
Starts `fbits.storefront` and all Tailwind watchers:
|
|
@@ -108,6 +110,13 @@ Starts `fbits.storefront` and all Tailwind watchers:
|
|
|
108
110
|
wake
|
|
109
111
|
```
|
|
110
112
|
|
|
113
|
+
Extra flags in `wake` (all) mode are forwarded to `fbits.storefront` only. Use `wake tailwind [flags]` to pass flags to `tailwindcss`:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
wake --port 3000 # passes --port 3000 to fbits.storefront only
|
|
117
|
+
wake --no-minify # disables Tailwind minification only
|
|
118
|
+
```
|
|
119
|
+
|
|
111
120
|
### Start only storefront
|
|
112
121
|
|
|
113
122
|
```bash
|
|
@@ -120,6 +129,14 @@ Or:
|
|
|
120
129
|
wake-storefront
|
|
121
130
|
```
|
|
122
131
|
|
|
132
|
+
Any extra flags are forwarded directly to `fbits.storefront`:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
wake storefront --port 3000
|
|
136
|
+
wake storefront --port 3000 --save
|
|
137
|
+
wake-storefront --port 3000
|
|
138
|
+
```
|
|
139
|
+
|
|
123
140
|
### Start only Tailwind watchers
|
|
124
141
|
|
|
125
142
|
Starts one watcher for each `input*.css` file found directly inside `Assets/CSS/`.
|
|
@@ -134,6 +151,27 @@ Or:
|
|
|
134
151
|
wake-tailwind
|
|
135
152
|
```
|
|
136
153
|
|
|
154
|
+
CSS is minified by default. To disable minification:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
wake tailwind --no-minify
|
|
158
|
+
wake-tailwind --no-minify
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Any other extra flags are forwarded directly to `tailwindcss`:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
wake tailwind --content "./src/**/*.html"
|
|
165
|
+
wake-tailwind --no-minify --content "./src/**/*.html"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Help
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
wake --help
|
|
172
|
+
wake -h
|
|
173
|
+
```
|
|
174
|
+
|
|
137
175
|
## CSS file mapping
|
|
138
176
|
|
|
139
177
|
Each input file is mapped to an output file by replacing the leading `input` prefix with `output`.
|
|
@@ -150,10 +188,11 @@ Examples:
|
|
|
150
188
|
|
|
151
189
|
- Reads `Configs/settings.json`
|
|
152
190
|
- Extracts `access_token`
|
|
191
|
+
- Forwards any extra flags to `fbits.storefront`
|
|
153
192
|
- Runs:
|
|
154
193
|
|
|
155
194
|
```bash
|
|
156
|
-
fbits.storefront --token <access_token>
|
|
195
|
+
fbits.storefront --token <access_token> [extra flags]
|
|
157
196
|
```
|
|
158
197
|
|
|
159
198
|
### `wake tailwind`
|
|
@@ -161,10 +200,12 @@ fbits.storefront --token <access_token>
|
|
|
161
200
|
- Reads files directly from `Assets/CSS/`
|
|
162
201
|
- Finds files that start with `input` and end with `.css`
|
|
163
202
|
- Starts one process per file
|
|
203
|
+
- Minification enabled by default; pass `--no-minify` to disable
|
|
204
|
+
- Forwards any extra flags (other than `--no-minify`) to `tailwindcss`
|
|
164
205
|
- Uses local npm Tailwind when available, otherwise uses the global `tailwindcss` command:
|
|
165
206
|
|
|
166
207
|
```bash
|
|
167
|
-
tailwindcss -i ./Assets/CSS/input.css -o ./Assets/CSS/output.css --watch
|
|
208
|
+
tailwindcss -i ./Assets/CSS/input.css -o ./Assets/CSS/output.css --watch --minify [extra flags]
|
|
168
209
|
```
|
|
169
210
|
|
|
170
211
|
## Errors
|
|
@@ -184,6 +225,7 @@ The CLI exits with code `1` when:
|
|
|
184
225
|
- The CLI uses only Node.js built-in modules
|
|
185
226
|
- Tailwind 3.4.18 can be installed via the standalone CLI (add to PATH) or via npm (global or local in the Wake project)
|
|
186
227
|
- On Windows, separate commands are exposed as `wake-storefront` and `wake-tailwind` instead of names containing `:`
|
|
228
|
+
- Any flag not recognized by `wake-runner` (`--help`, `--no-minify`) is forwarded to the underlying CLI
|
|
187
229
|
|
|
188
230
|
## License
|
|
189
231
|
|
package/bin/wake-storefront.js
CHANGED
package/bin/wake-tailwind.js
CHANGED
package/bin/wake.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
@@ -15,7 +15,7 @@ function parseJsonFile(filePath, fileLabel) {
|
|
|
15
15
|
try {
|
|
16
16
|
return JSON.parse(fs.readFileSync(filePath, 'utf8').replace(/^\uFEFF/, ''));
|
|
17
17
|
} catch (error) {
|
|
18
|
-
exitWithError(`
|
|
18
|
+
exitWithError(`Error: invalid ${fileLabel}.`);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -23,14 +23,14 @@ function getToken() {
|
|
|
23
23
|
const settingsPath = path.join(cwd, 'Configs', 'settings.json');
|
|
24
24
|
|
|
25
25
|
if (!fs.existsSync(settingsPath)) {
|
|
26
|
-
exitWithError('
|
|
26
|
+
exitWithError('Error: Configs/settings.json not found. Run this command from a Wake project root.');
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const settings = parseJsonFile(settingsPath, 'Configs/settings.json');
|
|
30
30
|
const token = settings.access_token;
|
|
31
31
|
|
|
32
32
|
if (!token) {
|
|
33
|
-
exitWithError('
|
|
33
|
+
exitWithError('Error: access_token not found in settings.json.');
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
return token;
|
|
@@ -40,7 +40,7 @@ function getInputFiles() {
|
|
|
40
40
|
const cssDir = path.join(cwd, 'Assets', 'CSS');
|
|
41
41
|
|
|
42
42
|
if (!fs.existsSync(cssDir)) {
|
|
43
|
-
exitWithError('
|
|
43
|
+
exitWithError('Error: Assets/CSS directory not found.');
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const inputFiles = fs.readdirSync(cssDir, { withFileTypes: true })
|
|
@@ -50,7 +50,7 @@ function getInputFiles() {
|
|
|
50
50
|
.map(entry => entry.name);
|
|
51
51
|
|
|
52
52
|
if (inputFiles.length === 0) {
|
|
53
|
-
exitWithError('
|
|
53
|
+
exitWithError('Error: no input*.css files found in Assets/CSS.');
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
return inputFiles;
|
|
@@ -79,39 +79,42 @@ function getTailwindCommand() {
|
|
|
79
79
|
return {
|
|
80
80
|
command: 'npm',
|
|
81
81
|
argsPrefix: ['exec', 'tailwindcss', '--'],
|
|
82
|
-
sourceLabel: 'npm
|
|
82
|
+
sourceLabel: 'local npm',
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
return {
|
|
87
87
|
command: 'tailwindcss',
|
|
88
88
|
argsPrefix: [],
|
|
89
|
-
sourceLabel: 'PATH
|
|
89
|
+
sourceLabel: 'global PATH',
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function runStorefront() {
|
|
93
|
+
function runStorefront(passthroughArgs) {
|
|
94
94
|
const token = getToken();
|
|
95
95
|
|
|
96
|
-
console.log(`Token
|
|
97
|
-
console.log('
|
|
96
|
+
console.log(`Token loaded: ${token.slice(0, 10)}...`);
|
|
97
|
+
console.log('Starting fbits.storefront...');
|
|
98
98
|
|
|
99
|
-
spawnCommand('fbits.storefront', ['--token', token]);
|
|
99
|
+
spawnCommand('fbits.storefront', ['--token', token, ...passthroughArgs]);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
function runTailwind() {
|
|
102
|
+
function runTailwind(minify, passthroughArgs) {
|
|
103
103
|
const inputFiles = getInputFiles();
|
|
104
104
|
const tailwind = getTailwindCommand();
|
|
105
105
|
|
|
106
|
-
console.log(`
|
|
107
|
-
console.log(`
|
|
106
|
+
console.log(`CSS files found: ${inputFiles.join(', ')}\n`);
|
|
107
|
+
console.log(`Minification: ${minify ? 'enabled' : 'disabled'}.`);
|
|
108
|
+
|
|
108
109
|
|
|
109
110
|
for (const inputFile of inputFiles) {
|
|
110
111
|
const outputFile = inputFile.replace(/^input/, 'output');
|
|
111
112
|
const inputPath = `./Assets/CSS/${inputFile}`;
|
|
112
113
|
const outputPath = `./Assets/CSS/${outputFile}`;
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
const minifyFlag = minify ? ['--minify'] : [];
|
|
116
|
+
|
|
117
|
+
console.log(`Starting Tailwind: ${inputFile} -> ${outputFile}`);
|
|
115
118
|
spawnCommand(tailwind.command, [
|
|
116
119
|
...tailwind.argsPrefix,
|
|
117
120
|
'-i',
|
|
@@ -119,30 +122,114 @@ function runTailwind() {
|
|
|
119
122
|
'-o',
|
|
120
123
|
outputPath,
|
|
121
124
|
'--watch',
|
|
125
|
+
...minifyFlag,
|
|
126
|
+
...passthroughArgs,
|
|
122
127
|
]);
|
|
123
128
|
}
|
|
124
129
|
}
|
|
125
130
|
|
|
131
|
+
function printHelp() {
|
|
132
|
+
console.log('wake-runner — starts the Wake development environment');
|
|
133
|
+
console.log('');
|
|
134
|
+
console.log('Usage:');
|
|
135
|
+
console.log(' wake Start fbits.storefront + all Tailwind watchers');
|
|
136
|
+
console.log(' wake storefront Start fbits.storefront only');
|
|
137
|
+
console.log(' wake tailwind Start Tailwind watchers only');
|
|
138
|
+
console.log(' wake-storefront Alias for "wake storefront"');
|
|
139
|
+
console.log(' wake-tailwind Alias for "wake tailwind"');
|
|
140
|
+
console.log('');
|
|
141
|
+
console.log('wake-runner flags:');
|
|
142
|
+
console.log(' --help, -h Show this help message');
|
|
143
|
+
console.log(' --no-minify Disable CSS minification (enabled by default)');
|
|
144
|
+
console.log('');
|
|
145
|
+
console.log('Passthrough — any other flag is forwarded directly to the underlying CLI:');
|
|
146
|
+
console.log(' wake storefront [flags] → fbits.storefront --token <token> [flags]');
|
|
147
|
+
console.log(' wake tailwind [flags] → tailwindcss -i ... -o ... --watch --minify [flags]');
|
|
148
|
+
console.log(' wake [flags] → fbits.storefront only (use "wake tailwind" for tailwindcss flags)');
|
|
149
|
+
console.log('');
|
|
150
|
+
console.log('Examples:');
|
|
151
|
+
console.log(' wake Start everything with default settings');
|
|
152
|
+
console.log(' wake --no-minify Start all, Tailwind without minification');
|
|
153
|
+
console.log(' wake --port 3000 Start all, storefront on port 3000');
|
|
154
|
+
console.log(' wake storefront --port 3000 Start storefront on port 3000');
|
|
155
|
+
console.log(' wake storefront --port 3000 --save Start storefront on port 3000 and save token');
|
|
156
|
+
console.log(' wake tailwind --no-minify Start Tailwind without minification');
|
|
157
|
+
console.log(' wake tailwind --content "./src/**/*.html" Start Tailwind with custom content path');
|
|
158
|
+
console.log('');
|
|
159
|
+
console.log('Repository: https://github.com/SimksS/wake-runner');
|
|
160
|
+
}
|
|
161
|
+
|
|
126
162
|
function printUsage() {
|
|
127
|
-
console.log('
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
163
|
+
console.log('Invalid usage. Run "wake --help" to see all available commands.');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function parseArgs() {
|
|
167
|
+
const WAKE_OWN_FLAGS = new Set(['no-minify', 'help']);
|
|
168
|
+
const SHORT_FLAG_MAP = { h: 'help' };
|
|
169
|
+
const args = process.argv.slice(2);
|
|
170
|
+
const positional = [];
|
|
171
|
+
const wakeFlags = {};
|
|
172
|
+
const passthroughArgs = [];
|
|
173
|
+
|
|
174
|
+
let i = 0;
|
|
175
|
+
while (i < args.length) {
|
|
176
|
+
const arg = args[i];
|
|
177
|
+
|
|
178
|
+
if (arg.startsWith('--')) {
|
|
179
|
+
const key = arg.slice(2);
|
|
180
|
+
if (WAKE_OWN_FLAGS.has(key)) {
|
|
181
|
+
wakeFlags[key] = true;
|
|
182
|
+
i++;
|
|
183
|
+
} else {
|
|
184
|
+
passthroughArgs.push(arg);
|
|
185
|
+
const nextArg = args[i + 1];
|
|
186
|
+
if (nextArg !== undefined && !nextArg.startsWith('-')) {
|
|
187
|
+
passthroughArgs.push(nextArg);
|
|
188
|
+
i += 2;
|
|
189
|
+
} else {
|
|
190
|
+
i++;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
} else if (arg.startsWith('-') && arg.length >= 2) {
|
|
194
|
+
const shortKey = arg.slice(1);
|
|
195
|
+
const mappedKey = SHORT_FLAG_MAP[shortKey];
|
|
196
|
+
if (mappedKey && WAKE_OWN_FLAGS.has(mappedKey)) {
|
|
197
|
+
wakeFlags[mappedKey] = true;
|
|
198
|
+
i++;
|
|
199
|
+
} else {
|
|
200
|
+
passthroughArgs.push(arg);
|
|
201
|
+
const nextArg = args[i + 1];
|
|
202
|
+
if (nextArg !== undefined && !nextArg.startsWith('-')) {
|
|
203
|
+
passthroughArgs.push(nextArg);
|
|
204
|
+
i += 2;
|
|
205
|
+
} else {
|
|
206
|
+
i++;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
} else {
|
|
210
|
+
positional.push(arg);
|
|
211
|
+
i++;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const mode = process.env.WAKE_MODE || positional[0] || 'all';
|
|
216
|
+
const minify = !wakeFlags['no-minify'];
|
|
217
|
+
const help = !!wakeFlags['help'];
|
|
218
|
+
|
|
219
|
+
return { mode, minify, passthroughArgs, help };
|
|
133
220
|
}
|
|
134
221
|
|
|
135
|
-
function runCli(mode) {
|
|
222
|
+
function runCli(mode, minify, passthroughArgs) {
|
|
136
223
|
switch (mode) {
|
|
137
224
|
case 'all':
|
|
138
|
-
runStorefront();
|
|
139
|
-
runTailwind();
|
|
225
|
+
runStorefront(passthroughArgs);
|
|
226
|
+
runTailwind(minify, []);
|
|
140
227
|
break;
|
|
141
228
|
case 'storefront':
|
|
142
|
-
runStorefront();
|
|
229
|
+
runStorefront(passthroughArgs);
|
|
143
230
|
break;
|
|
144
231
|
case 'tailwind':
|
|
145
|
-
runTailwind();
|
|
232
|
+
runTailwind(minify, passthroughArgs);
|
|
146
233
|
break;
|
|
147
234
|
default:
|
|
148
235
|
printUsage();
|
|
@@ -169,8 +256,14 @@ function isCliEntrypoint() {
|
|
|
169
256
|
}
|
|
170
257
|
|
|
171
258
|
if (isCliEntrypoint()) {
|
|
172
|
-
const mode
|
|
173
|
-
|
|
259
|
+
const { mode, minify, passthroughArgs, help } = parseArgs();
|
|
260
|
+
|
|
261
|
+
if (help) {
|
|
262
|
+
printHelp();
|
|
263
|
+
process.exit(0);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
runCli(mode, minify, passthroughArgs);
|
|
174
267
|
}
|
|
175
268
|
|
|
176
269
|
module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wake-runner",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "CLI to start Wake storefront projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
"wake-tailwind": "bin/wake-tailwind.js"
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT"
|
|
28
|
-
}
|
|
28
|
+
}
|