@fishawack/lab-env 4.45.0-beta.3 → 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 +17 -0
- package/cli.js +5 -5
- package/commands/create/services/aws/index.js +3 -0
- package/commands/deploy.js +2 -1
- package/commands/production.js +10 -5
- package/commands/run.js +26 -6
- package/commands/setup.js +1 -4
- package/commands/start.js +1 -1
- package/commands/test.js +13 -9
- package/commands/{pip.js → uv.js} +3 -3
- package/globals.js +21 -26
- package/package.json +1 -1
- package/python/0/docker-compose.yml +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
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
|
+
|
|
10
|
+
### 4.45.0-beta.4 (2025-09-03)
|
|
11
|
+
|
|
12
|
+
#### Features
|
|
13
|
+
|
|
14
|
+
* added new clients ([872332e](https://bitbucket.org/fishawackdigital/lab-env/commits/872332e5303b22a6f44102c724b824422418710b))
|
|
15
|
+
|
|
16
|
+
#### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* python now uses uv and implements test command ([b81b8d7](https://bitbucket.org/fishawackdigital/lab-env/commits/b81b8d7c47a6e2fe7437ed930f18e3f54e800fc7))
|
|
19
|
+
|
|
3
20
|
### 4.45.0-beta.3 (2025-09-02)
|
|
4
21
|
|
|
5
22
|
#### Features
|
package/cli.js
CHANGED
|
@@ -39,6 +39,9 @@ const args = hideBin(process.argv);
|
|
|
39
39
|
base: [
|
|
40
40
|
"start",
|
|
41
41
|
"setup",
|
|
42
|
+
"test",
|
|
43
|
+
"production",
|
|
44
|
+
"run",
|
|
42
45
|
"connect",
|
|
43
46
|
"execute",
|
|
44
47
|
"nuke",
|
|
@@ -49,11 +52,8 @@ const args = hideBin(process.argv);
|
|
|
49
52
|
// Web development commands (for frameworks that build frontend assets)
|
|
50
53
|
webDev: [
|
|
51
54
|
"watch",
|
|
52
|
-
"run",
|
|
53
55
|
"check",
|
|
54
56
|
"npm",
|
|
55
|
-
"production",
|
|
56
|
-
"test",
|
|
57
57
|
"reinstall",
|
|
58
58
|
"install",
|
|
59
59
|
"uninstall",
|
|
@@ -69,7 +69,7 @@ const args = hideBin(process.argv);
|
|
|
69
69
|
wordpress: ["wp", "composer", "php"],
|
|
70
70
|
adonis: ["ace", "node"],
|
|
71
71
|
php: ["composer", "php"],
|
|
72
|
-
python: ["python", "
|
|
72
|
+
python: ["python", "uv"],
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
// Define which platforms get which command groups
|
|
@@ -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/commands/setup.js
CHANGED
|
@@ -21,10 +21,7 @@ module.exports = [
|
|
|
21
21
|
),
|
|
22
22
|
);
|
|
23
23
|
} else if (_.platform === "python") {
|
|
24
|
-
_.command(
|
|
25
|
-
"python",
|
|
26
|
-
`python -m venv .venv && pip install -r src/requirements.txt`,
|
|
27
|
-
);
|
|
24
|
+
_.command("python", `uv sync --locked || uv sync`);
|
|
28
25
|
} else {
|
|
29
26
|
_.command("core", `npm run setup`);
|
|
30
27
|
}
|
package/commands/start.js
CHANGED
package/commands/test.js
CHANGED
|
@@ -6,17 +6,21 @@ module.exports = [
|
|
|
6
6
|
() => {},
|
|
7
7
|
() => {
|
|
8
8
|
_.up(() => {
|
|
9
|
-
_.
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
if (_.platform === "python") {
|
|
10
|
+
_.command("python", `uv run pytest`);
|
|
11
|
+
} else {
|
|
12
|
+
_.command(
|
|
13
|
+
"core",
|
|
14
|
+
`${process.env.VERSION === "0" ? "xvfb-run " : ""}npm run test`,
|
|
15
|
+
);
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
if (_.platform === "laravel") {
|
|
18
|
+
_.command("php", `php artisan test`);
|
|
19
|
+
}
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
if (_.platform === "adonis") {
|
|
22
|
+
_.command("node", `node ace test`);
|
|
23
|
+
}
|
|
20
24
|
}
|
|
21
25
|
});
|
|
22
26
|
},
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const _ = require("../globals.js");
|
|
2
2
|
|
|
3
3
|
module.exports = [
|
|
4
|
-
"
|
|
5
|
-
"run
|
|
4
|
+
"uv [command...]",
|
|
5
|
+
"run uv command",
|
|
6
6
|
(yargs) => {
|
|
7
7
|
yargs.positional("command", {
|
|
8
8
|
describe: "command to run",
|
|
9
9
|
default: "",
|
|
10
10
|
});
|
|
11
11
|
},
|
|
12
|
-
(argv) => _.command("python", `
|
|
12
|
+
(argv) => _.command("python", `uv ${argv.command.join(" ")}`),
|
|
13
13
|
];
|
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", {
|
|
@@ -183,7 +185,7 @@ try {
|
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
try {
|
|
186
|
-
python = existsSync(path.join(cwd, "
|
|
188
|
+
python = existsSync(path.join(cwd, "pyproject.toml"));
|
|
187
189
|
} catch {
|
|
188
190
|
/* empty */
|
|
189
191
|
}
|
|
@@ -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 ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
services:
|
|
2
2
|
python:
|
|
3
|
-
image:
|
|
3
|
+
image: ghcr.io/astral-sh/uv:python3.13-bookworm
|
|
4
4
|
working_dir: /workspace
|
|
5
5
|
command: sleep infinity
|
|
6
6
|
tty: true
|
|
@@ -8,7 +8,8 @@ services:
|
|
|
8
8
|
user: "${USER_UID}:${USER_GID}"
|
|
9
9
|
environment:
|
|
10
10
|
- PATH=/workspace/.venv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
11
|
-
-
|
|
11
|
+
- UV_NO_CACHE=1
|
|
12
|
+
- UV_LINK_MODE=copy
|
|
12
13
|
- PYTHONDONTWRITEBYTECODE="1"
|
|
13
14
|
- PYTHONUNBUFFERED="1"
|
|
14
15
|
- REPO=${REPO:-}
|