@fishawack/lab-env 4.39.0-beta.7 → 4.39.0-beta.8
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/.prettierignore +8 -0
- package/CHANGELOG.md +22 -0
- package/README.md +46 -0
- package/_Test/provision.js +4 -4
- package/cli.js +0 -1
- package/commands/create/libs/vars.js +11 -7
- package/commands/lint.js +18 -3
- package/eslint.config.js +12 -0
- package/globals.js +35 -29
- package/package.json +1 -1
- package/stylelint.config.js +40 -0
- package/commands/pretty.js +0 -12
package/.prettierignore
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 4.39.0-beta.8 (2025-05-23)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* added fix flag to lint command ([fc4e016](https://bitbucket.org/fishawackdigital/lab-env/commits/fc4e0162e1247b68b4e5558f5bb41ef55a7f4f72))
|
|
8
|
+
* added stylelint ([3780f92](https://bitbucket.org/fishawackdigital/lab-env/commits/3780f92cc693f92283e8cc70a92cc164c70d661c))
|
|
9
|
+
* copy stylintconfig into project root ([10039a0](https://bitbucket.org/fishawackdigital/lab-env/commits/10039a028106b1212f752bee4c5bbce211b474ae))
|
|
10
|
+
* disable id pattern in stylelint ([edd1f87](https://bitbucket.org/fishawackdigital/lab-env/commits/edd1f876a7877e660991b2c175dc11d06f4187ec))
|
|
11
|
+
* force flag can now be used to bypass diagnose ([78cf860](https://bitbucket.org/fishawackdigital/lab-env/commits/78cf8602e40879344e30e2bc0d06b310aec2e099))
|
|
12
|
+
* major version bump of fw diagnose ([989a0d1](https://bitbucket.org/fishawackdigital/lab-env/commits/989a0d1a04f3e8b40bb82a4c5ddb25f59935445c))
|
|
13
|
+
|
|
14
|
+
#### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* added more paths to ignored paths for linters ([a6097ec](https://bitbucket.org/fishawackdigital/lab-env/commits/a6097ec4665f8b0c738d264eb19fa24a638fb6e5))
|
|
17
|
+
* dont error when no matching files on eslint ([069422c](https://bitbucket.org/fishawackdigital/lab-env/commits/069422c86e906cdfa9719919fc441155b9bf0edc))
|
|
18
|
+
* ignore handlebars helpers as theyll be gone soon and add some global ignores ([e42e05e](https://bitbucket.org/fishawackdigital/lab-env/commits/e42e05e669549ef3087480d8c33fb837c96cc3bc))
|
|
19
|
+
* ignore variable pattern in stylelint ([7809024](https://bitbucket.org/fishawackdigital/lab-env/commits/78090249755c6871ef6f54b77cd55dcea7ca7d38))
|
|
20
|
+
* run style lint first so other linters dont explode with prettier fixes ([e7e16fc](https://bitbucket.org/fishawackdigital/lab-env/commits/e7e16fc4a9b28fc6613f44fdf10b334d3c08b730))
|
|
21
|
+
* stylelint now uses global path ([90d280e](https://bitbucket.org/fishawackdigital/lab-env/commits/90d280e6cea3f621ad49aab6e4b482a4f9e4c053))
|
|
22
|
+
* update stylint paths as it ignores files not directories ([d3e125b](https://bitbucket.org/fishawackdigital/lab-env/commits/d3e125ba9d6ba158d5d210bafc4928bbc22ad448))
|
|
23
|
+
* when running tests via CI/CD diagnose command will be ignored ([b9b9757](https://bitbucket.org/fishawackdigital/lab-env/commits/b9b97579376c87e3fa8a84eed14f4105da397589))
|
|
24
|
+
|
|
3
25
|
### 4.39.0-beta.7 (2025-05-21)
|
|
4
26
|
|
|
5
27
|
#### Features
|
package/README.md
CHANGED
|
@@ -204,6 +204,52 @@ docker volume rm boilerplate_node_modules
|
|
|
204
204
|
|
|
205
205
|
## Migrating
|
|
206
206
|
|
|
207
|
+
### 5.0.0
|
|
208
|
+
|
|
209
|
+
Version 5 introduced linting and code styling to projects.
|
|
210
|
+
|
|
211
|
+
#### Re-diagnose
|
|
212
|
+
|
|
213
|
+
These linters are installed globally via the diagnose command which resulted in a major diagnose version being set forcing users to re-run the command.
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
fw diagnose
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
#### New ignore paths
|
|
220
|
+
|
|
221
|
+
Add the following files to your existing projects `.gitignore` file
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
.husky
|
|
225
|
+
.commitlintrc.json
|
|
226
|
+
.prettierrc.js
|
|
227
|
+
.prettierignore
|
|
228
|
+
.editorconfig
|
|
229
|
+
eslint.config.js
|
|
230
|
+
stylelint.config.js
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### Disabling commithooks
|
|
234
|
+
|
|
235
|
+
For existing projects where fixing all the linting errors is unreasonable, the developers will need to adjust and commit a couple of files to skip the mandatory git hooks that fire on git push commands.
|
|
236
|
+
|
|
237
|
+
1. Remove `.husky` from the `.gitignore`
|
|
238
|
+
|
|
239
|
+
2. Edit the `.husky/pre-push` file
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Runs js css php style linters
|
|
243
|
+
fw lint
|
|
244
|
+
|
|
245
|
+
# Only runs the code style linter
|
|
246
|
+
fw lint style
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
3. Ensure the `.husky` folder is commited into version control.
|
|
250
|
+
|
|
251
|
+
> Disabling linters should be a temporary solution. It's important that all projects aim to re-enable all linters at some point in the future as the CI/CD will eventually fail builds for not adhereing to linting rules.
|
|
252
|
+
|
|
207
253
|
### 2.0.0
|
|
208
254
|
|
|
209
255
|
Wordpress repo's are now structured slightly differently to better match laravel, drupal and craftcms setups. Follow these steps to upgrade a wordpress build and get lab-env working again.
|
package/_Test/provision.js
CHANGED
|
@@ -9,7 +9,7 @@ describe("provision", () => {
|
|
|
9
9
|
let config;
|
|
10
10
|
let repo = "lab-env-test-suite";
|
|
11
11
|
let account = "fishawack";
|
|
12
|
-
let branch = "
|
|
12
|
+
let branch = "development";
|
|
13
13
|
let name = aws.slug(repo, account, branch);
|
|
14
14
|
|
|
15
15
|
describe("static", () => {
|
|
@@ -44,7 +44,7 @@ describe("provision", () => {
|
|
|
44
44
|
name,
|
|
45
45
|
account,
|
|
46
46
|
repo,
|
|
47
|
-
|
|
47
|
+
branch,
|
|
48
48
|
config.cloudfront,
|
|
49
49
|
);
|
|
50
50
|
});
|
|
@@ -62,7 +62,7 @@ describe("provision", () => {
|
|
|
62
62
|
[],
|
|
63
63
|
[],
|
|
64
64
|
repo,
|
|
65
|
-
|
|
65
|
+
branch,
|
|
66
66
|
"wordpress",
|
|
67
67
|
);
|
|
68
68
|
});
|
|
@@ -74,7 +74,7 @@ describe("provision", () => {
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
after(async () => {
|
|
77
|
-
await aws.fullstackTerminate(repo, account, repo,
|
|
77
|
+
await aws.fullstackTerminate(repo, account, repo, branch);
|
|
78
78
|
|
|
79
79
|
execSync(`rm -rf .elasticbeanstalk`, {
|
|
80
80
|
encoding: "utf8",
|
package/cli.js
CHANGED
|
@@ -81,13 +81,17 @@ module.exports.globalModules = [
|
|
|
81
81
|
{ package: "prettier", version: "3" },
|
|
82
82
|
{ package: "@prettier/plugin-php", version: "0" },
|
|
83
83
|
// ESLINT
|
|
84
|
-
{ package: "@eslint/js", version: "9
|
|
85
|
-
{ package: "eslint-config-prettier", version: "10
|
|
86
|
-
{ package: "eslint-plugin-import", version: "2
|
|
87
|
-
{ package: "eslint-plugin-prettier", version: "5
|
|
88
|
-
{ package: "eslint-plugin-vue", version: "10
|
|
89
|
-
{ package: "eslint", version: "9
|
|
90
|
-
{ package: "globals", version: "16
|
|
84
|
+
{ package: "@eslint/js", version: "9" },
|
|
85
|
+
{ package: "eslint-config-prettier", version: "10" },
|
|
86
|
+
{ package: "eslint-plugin-import", version: "2" },
|
|
87
|
+
{ package: "eslint-plugin-prettier", version: "5" },
|
|
88
|
+
{ package: "eslint-plugin-vue", version: "10" },
|
|
89
|
+
{ package: "eslint", version: "9" },
|
|
90
|
+
{ package: "globals", version: "16" },
|
|
91
|
+
// STYLELINT
|
|
92
|
+
{ package: "stylelint", version: "16" },
|
|
93
|
+
{ package: "stylelint-config-standard-scss", version: "15" },
|
|
94
|
+
{ package: "stylelint-prettier", version: "5" },
|
|
91
95
|
];
|
|
92
96
|
|
|
93
97
|
// User presets
|
package/commands/lint.js
CHANGED
|
@@ -10,14 +10,29 @@ module.exports = [
|
|
|
10
10
|
describe: "linters to run",
|
|
11
11
|
default: "js css php style",
|
|
12
12
|
});
|
|
13
|
+
|
|
14
|
+
yargs.option("fix", {
|
|
15
|
+
describe: "Attempt to fix issues",
|
|
16
|
+
type: "boolean",
|
|
17
|
+
});
|
|
13
18
|
},
|
|
14
19
|
(argv) => {
|
|
20
|
+
if (argv.linters.includes("style")) {
|
|
21
|
+
execSync(`prettier ${argv.fix ? "--write" : "--check"} .`, _.opts);
|
|
22
|
+
}
|
|
23
|
+
|
|
15
24
|
if (argv.linters.includes("js")) {
|
|
16
|
-
execSync(
|
|
25
|
+
execSync(
|
|
26
|
+
`eslint '**/*.{js,vue}' --no-error-on-unmatched-pattern${argv.fix ? " --fix" : ""}`,
|
|
27
|
+
_.opts,
|
|
28
|
+
);
|
|
17
29
|
}
|
|
18
30
|
|
|
19
|
-
if (argv.linters.includes("
|
|
20
|
-
execSync(
|
|
31
|
+
if (argv.linters.includes("css")) {
|
|
32
|
+
execSync(
|
|
33
|
+
`stylelint '**/*.{scss,css}' --allow-empty-input${argv.fix ? " --fix" : ""}`,
|
|
34
|
+
_.opts,
|
|
35
|
+
);
|
|
21
36
|
}
|
|
22
37
|
},
|
|
23
38
|
];
|
package/eslint.config.js
CHANGED
|
@@ -27,6 +27,15 @@ module.exports = defineConfig([
|
|
|
27
27
|
"dist",
|
|
28
28
|
"ios",
|
|
29
29
|
"android",
|
|
30
|
+
"_Output",
|
|
31
|
+
"_Packages",
|
|
32
|
+
".cache",
|
|
33
|
+
".husky",
|
|
34
|
+
"**/generated/**/*",
|
|
35
|
+
"_Zips",
|
|
36
|
+
"_Pdfs",
|
|
37
|
+
"_Build/content",
|
|
38
|
+
"_Build/handlebars/helpers",
|
|
30
39
|
]),
|
|
31
40
|
{
|
|
32
41
|
plugins: {
|
|
@@ -41,6 +50,9 @@ module.exports = defineConfig([
|
|
|
41
50
|
...globals.node,
|
|
42
51
|
...globals.es2021,
|
|
43
52
|
...globals.mocha,
|
|
53
|
+
browser: "readonly",
|
|
54
|
+
fixture: "readonly",
|
|
55
|
+
expect: "readonly",
|
|
44
56
|
},
|
|
45
57
|
},
|
|
46
58
|
rules: {
|
package/globals.js
CHANGED
|
@@ -45,7 +45,7 @@ var exec;
|
|
|
45
45
|
var running;
|
|
46
46
|
var services;
|
|
47
47
|
var branch;
|
|
48
|
-
var diagnosis = "
|
|
48
|
+
var diagnosis = "4.0.0";
|
|
49
49
|
var opts = { encoding: "utf8", stdio: "inherit", shell: "/bin/bash" };
|
|
50
50
|
const users = {
|
|
51
51
|
core: "node",
|
|
@@ -126,8 +126,7 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
126
126
|
args[0] !== "new" &&
|
|
127
127
|
args[0] !== "key" &&
|
|
128
128
|
args[0] !== "dekey" &&
|
|
129
|
-
args[0] !== "lint"
|
|
130
|
-
args[0] !== "pretty"
|
|
129
|
+
args[0] !== "lint"
|
|
131
130
|
) {
|
|
132
131
|
if (!args.find((d) => d === "--force")) {
|
|
133
132
|
console.log(
|
|
@@ -176,8 +175,7 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
176
175
|
args[0] !== "new" &&
|
|
177
176
|
args[0] !== "key" &&
|
|
178
177
|
args[0] !== "dekey" &&
|
|
179
|
-
args[0] !== "lint"
|
|
180
|
-
args[0] !== "pretty"
|
|
178
|
+
args[0] !== "lint"
|
|
181
179
|
) {
|
|
182
180
|
if (!args.find((d) => d === "--force")) {
|
|
183
181
|
console.log(
|
|
@@ -238,8 +236,7 @@ if (process.env.FW_NEXT) {
|
|
|
238
236
|
args[0] !== "new" &&
|
|
239
237
|
args[0] !== "key" &&
|
|
240
238
|
args[0] !== "dekey" &&
|
|
241
|
-
args[0] !== "lint"
|
|
242
|
-
args[0] !== "pretty"
|
|
239
|
+
args[0] !== "lint"
|
|
243
240
|
) {
|
|
244
241
|
if (!args.find((d) => d === "--force")) {
|
|
245
242
|
console.log(
|
|
@@ -409,6 +406,13 @@ if (!existsSync(path.join(cwd, "eslint.config.js"))) {
|
|
|
409
406
|
);
|
|
410
407
|
}
|
|
411
408
|
|
|
409
|
+
if (!existsSync(path.join(cwd, "stylelint.config.js"))) {
|
|
410
|
+
copyFileSync(
|
|
411
|
+
path.join(__dirname, "stylelint.config.js"),
|
|
412
|
+
path.join(cwd, "stylelint.config.js"),
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
412
416
|
// If docker-compose.yml exists in project _Docker folder append to end
|
|
413
417
|
let localOverride = "";
|
|
414
418
|
if (existsSync(path.join(cwd, "_Docker/docker-compose.yml"))) {
|
|
@@ -448,6 +452,7 @@ try {
|
|
|
448
452
|
|
|
449
453
|
// Always allow commands that don't require a repository through
|
|
450
454
|
if (
|
|
455
|
+
!process.env.CI_BUILD_ID &&
|
|
451
456
|
args[0] !== "diag" &&
|
|
452
457
|
args[0] !== "diagnose" &&
|
|
453
458
|
args[0] !== "origin" &&
|
|
@@ -456,29 +461,30 @@ if (
|
|
|
456
461
|
args[0] !== "new" &&
|
|
457
462
|
args[0] !== "key" &&
|
|
458
463
|
args[0] !== "dekey" &&
|
|
459
|
-
args[0] !== "lint"
|
|
460
|
-
args[0] !== "pretty"
|
|
464
|
+
args[0] !== "lint"
|
|
461
465
|
) {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
466
|
+
if (!args.find((d) => d === "--force")) {
|
|
467
|
+
// Stop here if diagnosis either unset or outdated
|
|
468
|
+
if (
|
|
469
|
+
!config.diagnosis ||
|
|
470
|
+
semver.diff(config.diagnosis, diagnosis) === "major"
|
|
471
|
+
) {
|
|
472
|
+
console.log(
|
|
473
|
+
`${utilities.colorize(`@fishawack/lab-env`, "title")} diagnosis is ${utilities.colorize(`outdated`, "error")}.\n\nRun ${utilities.colorize(`fw diagnose`, "success")} to reconfigure or pass ${utilities.colorize(`--force`, "warning")} to continue..`,
|
|
474
|
+
);
|
|
475
|
+
process.exit(1);
|
|
476
|
+
// Warn if diagnosis only minor/patch outdated
|
|
477
|
+
} else if (semver.diff(config.diagnosis, diagnosis) !== null) {
|
|
478
|
+
console.log(
|
|
479
|
+
`${utilities.colorize(`@fishawack/lab-env`, "title")} diagnosis is ${utilities.colorize(`outdated`, "warning")}.\n\nRun ${utilities.colorize(`fw diagnose`, "success")} to reconfigure.`,
|
|
480
|
+
);
|
|
481
|
+
// Stop here if docker process not running
|
|
482
|
+
} else if (!services) {
|
|
483
|
+
console.log(
|
|
484
|
+
`${utilities.colorize(`Docker`, "info")} does not appear to be running...\n\nRun ${utilities.colorize(`fw --debug`, "success")} for more information or pass ${utilities.colorize(`--force`, "warning")} to continue.`,
|
|
485
|
+
);
|
|
486
|
+
process.exit(1);
|
|
487
|
+
}
|
|
482
488
|
}
|
|
483
489
|
}
|
|
484
490
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const globalPath = require("child_process")
|
|
2
|
+
.execSync("npm root -g")
|
|
3
|
+
.toString()
|
|
4
|
+
.trim();
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
extends: [
|
|
8
|
+
`${globalPath}/stylelint-config-standard-scss`,
|
|
9
|
+
`${globalPath}/stylelint-prettier/recommended`,
|
|
10
|
+
],
|
|
11
|
+
rules: {
|
|
12
|
+
"scss/dollar-variable-pattern": null,
|
|
13
|
+
"scss/at-mixin-pattern": null,
|
|
14
|
+
"selector-class-pattern": null,
|
|
15
|
+
"selector-id-pattern": null,
|
|
16
|
+
"custom-property-pattern": null,
|
|
17
|
+
},
|
|
18
|
+
ignoreFiles: [
|
|
19
|
+
"**/.git/**/*",
|
|
20
|
+
"**/.svn/**/*",
|
|
21
|
+
"**/.hg/**/*",
|
|
22
|
+
"**/node_modules/**/*",
|
|
23
|
+
"**/vendor/**/*",
|
|
24
|
+
"**/storage/**/*",
|
|
25
|
+
"bootstrap/**/*",
|
|
26
|
+
"coverage/**/*",
|
|
27
|
+
".tmp/**/*",
|
|
28
|
+
"dist/**/*",
|
|
29
|
+
"ios/**/*",
|
|
30
|
+
"android/**/*",
|
|
31
|
+
"_Output/**/*",
|
|
32
|
+
"_Packages/**/*",
|
|
33
|
+
".cache/**/*",
|
|
34
|
+
".husky/**/*",
|
|
35
|
+
".**/generated/**/*",
|
|
36
|
+
"_Zips/**/*",
|
|
37
|
+
"_Pdfs/**/*",
|
|
38
|
+
"_Build/content/**/*",
|
|
39
|
+
],
|
|
40
|
+
};
|
package/commands/pretty.js
DELETED