@fishawack/lab-env 4.45.0-beta.4 → 4.45.0-beta.5
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 +7 -0
- package/cli.js +3 -3
- package/commands/deploy.js +2 -1
- package/commands/production.js +10 -5
- package/commands/run.js +26 -6
- package/globals.js +20 -25
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 4.45.0-beta.5 (2025-09-04)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* addded more python compatible commands ([b4940ea](https://bitbucket.org/fishawackdigital/lab-env/commits/b4940eaa29c58138f6ff952773da0925e64fcab7))
|
|
8
|
+
* better errors when mismatching versions found ([d3c0c75](https://bitbucket.org/fishawackdigital/lab-env/commits/d3c0c753d919f383d0262c4d3221d179b19f9fa3))
|
|
9
|
+
|
|
3
10
|
### 4.45.0-beta.4 (2025-09-03)
|
|
4
11
|
|
|
5
12
|
#### Features
|
package/cli.js
CHANGED
|
@@ -40,6 +40,8 @@ const args = hideBin(process.argv);
|
|
|
40
40
|
"start",
|
|
41
41
|
"setup",
|
|
42
42
|
"test",
|
|
43
|
+
"production",
|
|
44
|
+
"run",
|
|
43
45
|
"connect",
|
|
44
46
|
"execute",
|
|
45
47
|
"nuke",
|
|
@@ -50,10 +52,8 @@ const args = hideBin(process.argv);
|
|
|
50
52
|
// Web development commands (for frameworks that build frontend assets)
|
|
51
53
|
webDev: [
|
|
52
54
|
"watch",
|
|
53
|
-
"run",
|
|
54
55
|
"check",
|
|
55
56
|
"npm",
|
|
56
|
-
"production",
|
|
57
57
|
"reinstall",
|
|
58
58
|
"install",
|
|
59
59
|
"uninstall",
|
|
@@ -86,7 +86,7 @@ const args = hideBin(process.argv);
|
|
|
86
86
|
|
|
87
87
|
// Config-based command additions
|
|
88
88
|
const configCommands = {
|
|
89
|
-
content: _.config.preset !== "external",
|
|
89
|
+
content: _.config.preset !== "external" && _.platform !== "python",
|
|
90
90
|
deploy: _.config.preset === "permanent",
|
|
91
91
|
origin: _.config.preset === "permanent",
|
|
92
92
|
};
|
package/commands/deploy.js
CHANGED
package/commands/production.js
CHANGED
|
@@ -4,9 +4,14 @@ module.exports = [
|
|
|
4
4
|
["production", "prod"],
|
|
5
5
|
"builds for production",
|
|
6
6
|
() => {},
|
|
7
|
-
() =>
|
|
8
|
-
_.
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
() => {
|
|
8
|
+
if (_.platform === "python") {
|
|
9
|
+
console.log("No production command currently available for Python");
|
|
10
|
+
} else {
|
|
11
|
+
_.command(
|
|
12
|
+
"core",
|
|
13
|
+
`${process.env.VERSION === "0" ? "xvfb-run " : ""}npm run production`,
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
},
|
|
12
17
|
];
|
package/commands/run.js
CHANGED
|
@@ -2,7 +2,7 @@ const _ = require("../globals.js");
|
|
|
2
2
|
|
|
3
3
|
module.exports = [
|
|
4
4
|
"run [command] [flags...]",
|
|
5
|
-
"run an npm script",
|
|
5
|
+
_.platform === "python" ? "run a uv script" : "run an npm script",
|
|
6
6
|
(yargs) => {
|
|
7
7
|
yargs.positional("command", {
|
|
8
8
|
describe: "command to run",
|
|
@@ -22,9 +22,29 @@ module.exports = [
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
(argv) =>
|
|
26
|
-
_.
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
(argv) => {
|
|
26
|
+
if (_.platform === "python") {
|
|
27
|
+
if (argv.command === "mail" || argv.command === "package") {
|
|
28
|
+
console.log(
|
|
29
|
+
`${argv.command} is a built-in command and will be ignored`,
|
|
30
|
+
);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const command = argv.command.endsWith(".py")
|
|
35
|
+
? argv.command
|
|
36
|
+
: `${argv.command}.py`;
|
|
37
|
+
|
|
38
|
+
_.command(
|
|
39
|
+
"python",
|
|
40
|
+
`uv run ${command} -- -- ${argv.flags.join(" ")}`,
|
|
41
|
+
true,
|
|
42
|
+
);
|
|
43
|
+
} else {
|
|
44
|
+
_.command(
|
|
45
|
+
"core",
|
|
46
|
+
`${argv.d ? "xvfb-run " : ""}npm run ${argv.command} -- -- ${argv.flags.join(" ")}`,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
30
50
|
];
|
package/globals.js
CHANGED
|
@@ -17,6 +17,8 @@ const utilities = require("./commands/create/libs/utilities");
|
|
|
17
17
|
const os = require("os");
|
|
18
18
|
const { hideBin } = require("yargs/helpers");
|
|
19
19
|
const args = hideBin(process.argv);
|
|
20
|
+
const forced = args.find((d) => d === "--force");
|
|
21
|
+
const { version: labenvVersion } = require("./package.json");
|
|
20
22
|
|
|
21
23
|
process.env.DIRNAME = __dirname;
|
|
22
24
|
process.env.USER_UID = execSync("id -u", {
|
|
@@ -197,7 +199,7 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
197
199
|
composer.require["laravel/framework"],
|
|
198
200
|
)?.version;
|
|
199
201
|
|
|
200
|
-
if (process.env.FW_NEXT) {
|
|
202
|
+
if (process.env.FW_NEXT || forced) {
|
|
201
203
|
process.env.VERSION_LARAVEL = versions[versions.length - 1];
|
|
202
204
|
} else if (semver.satisfies(version, "<=8")) {
|
|
203
205
|
process.env.VERSION_LARAVEL = "8";
|
|
@@ -218,12 +220,7 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
218
220
|
args[0] !== "lint" &&
|
|
219
221
|
args[0] !== "workspace"
|
|
220
222
|
) {
|
|
221
|
-
|
|
222
|
-
console.log(
|
|
223
|
-
`${utilities.colorize(`laravel`, "title")} and ${utilities.colorize(`@fishawack/lab-env`, "title")} have mismatching versions.\n\nRun ${utilities.colorize(`npm i -g @fishawack/lab-env@latest`, "success")} or pass ${utilities.colorize(`--force`, "warning")} to continue.`,
|
|
224
|
-
);
|
|
225
|
-
process.exit(1);
|
|
226
|
-
}
|
|
223
|
+
unknownLabEnvConfig(platform, version);
|
|
227
224
|
}
|
|
228
225
|
|
|
229
226
|
// Default to latest image when outside of known core versions
|
|
@@ -249,7 +246,7 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
249
246
|
composer?.require["johnpbloch/wordpress"],
|
|
250
247
|
)?.version;
|
|
251
248
|
|
|
252
|
-
if (process.env.FW_NEXT) {
|
|
249
|
+
if (process.env.FW_NEXT || forced) {
|
|
253
250
|
process.env.VERSION_WORDPRESS = versions[versions.length - 1];
|
|
254
251
|
} else if (!version) {
|
|
255
252
|
process.env.VERSION_WORDPRESS = "0";
|
|
@@ -268,12 +265,7 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
268
265
|
args[0] !== "lint" &&
|
|
269
266
|
args[0] !== "workspace"
|
|
270
267
|
) {
|
|
271
|
-
|
|
272
|
-
console.log(
|
|
273
|
-
`${utilities.colorize(`wordpress`, "title")} and ${utilities.colorize(`@fishawack/lab-env`, "title")} have mismatching versions.\n\nRun ${utilities.colorize(`npm i -g @fishawack/lab-env@latest`, "success")} or pass ${utilities.colorize(`--force`, "warning")} to continue.`,
|
|
274
|
-
);
|
|
275
|
-
process.exit(1);
|
|
276
|
-
}
|
|
268
|
+
unknownLabEnvConfig(platform, version);
|
|
277
269
|
}
|
|
278
270
|
|
|
279
271
|
// Default to latest image when outside of known core versions
|
|
@@ -321,7 +313,7 @@ const getCoreVersion = () => {
|
|
|
321
313
|
|
|
322
314
|
const version = getCoreVersion();
|
|
323
315
|
|
|
324
|
-
if (process.env.FW_NEXT) {
|
|
316
|
+
if (process.env.FW_NEXT || forced) {
|
|
325
317
|
process.env.VERSION = versions[versions.length - 1];
|
|
326
318
|
} else if (semver.satisfies(semver.coerce(version), "<=7.24.0")) {
|
|
327
319
|
process.env.VERSION = "0";
|
|
@@ -343,15 +335,10 @@ if (process.env.FW_NEXT) {
|
|
|
343
335
|
args[0] !== "lint" &&
|
|
344
336
|
args[0] !== "workspace"
|
|
345
337
|
) {
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
) {
|
|
351
|
-
console.log(
|
|
352
|
-
`${utilities.colorize(`@fishawack/core`, "title")} and ${utilities.colorize(`@fishawack/lab-env`, "title")} have mismatching versions.\n\nRun ${utilities.colorize(`npm i -g @fishawack/lab-env@latest`, "success")} or pass ${utilities.colorize(`--force`, "warning")} to continue.`,
|
|
353
|
-
);
|
|
354
|
-
process.exit(1);
|
|
338
|
+
if (version) {
|
|
339
|
+
unknownLabEnvConfig("core", version);
|
|
340
|
+
} else if (platform !== "php" && platform !== "python") {
|
|
341
|
+
unknownLabEnvConfig();
|
|
355
342
|
}
|
|
356
343
|
}
|
|
357
344
|
|
|
@@ -573,6 +560,14 @@ if (!existsSync(path.join(cwd, "stylelint.config.js"))) {
|
|
|
573
560
|
);
|
|
574
561
|
}
|
|
575
562
|
|
|
563
|
+
function unknownLabEnvConfig(platform, version) {
|
|
564
|
+
console.log(
|
|
565
|
+
`${utilities.colorize(`lab-env@${labenvVersion}`, "success")} doesn't recognize the current ${platform ? `${utilities.colorize(`${platform}@${version}`, "warning")} version` : `project platform`}.\n\nRun ${utilities.colorize(`npm i -g @fishawack/lab-env@latest`, "success")} to update to the latest build or pass ${utilities.colorize(`--force`, "warning")} to continue.`,
|
|
566
|
+
);
|
|
567
|
+
|
|
568
|
+
process.exit(1);
|
|
569
|
+
}
|
|
570
|
+
|
|
576
571
|
function copyAIInstructionsFile(source, projectDir = cwd) {
|
|
577
572
|
// Create directory if it doesn't exist
|
|
578
573
|
const destDir = path.join(projectDir, ".github/instructions");
|
|
@@ -673,7 +668,7 @@ if (
|
|
|
673
668
|
args[0] !== "lint" &&
|
|
674
669
|
args[0] !== "workspace"
|
|
675
670
|
) {
|
|
676
|
-
if (!
|
|
671
|
+
if (!forced) {
|
|
677
672
|
// Stop here if diagnosis either unset or outdated
|
|
678
673
|
if (
|
|
679
674
|
!config.diagnosis ||
|