@langri-sha/projen-lint-synthesized 0.2.4 → 0.3.0
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.json +99 -1
- package/CHANGELOG.md +32 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +31 -14
- package/lib/index.js.map +1 -1
- package/license +4 -14
- package/package.json +14 -8
- package/src/index.ts +39 -17
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,105 @@
|
|
|
2
2
|
"name": "@langri-sha/projen-lint-synthesized",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Sat, 15 Jun 2024 09:06:45 GMT",
|
|
6
|
+
"version": "0.3.0",
|
|
7
|
+
"tag": "@langri-sha/projen-lint-synthesized_v0.3.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "filip.dupanovic@gmail.com",
|
|
12
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
13
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
14
|
+
"comment": "feat(projen): Reconfigure project expressions"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "filip.dupanovic@gmail.com",
|
|
18
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
19
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
20
|
+
"comment": "feat(lint-synthesized): Manage package with projen"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "filip.dupanovic@gmail.com",
|
|
24
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
25
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
26
|
+
"comment": "feat(project): Omit Node.js engine package defaults"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "filip.dupanovic@gmail.com",
|
|
30
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
31
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
32
|
+
"comment": "feat(lint-synthesized): Simplify finding projects"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "filip.dupanovic@gmail.com",
|
|
36
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
37
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
38
|
+
"comment": "feat(lint-synthesized): Run on all projects"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"patch": [
|
|
42
|
+
{
|
|
43
|
+
"author": "email not defined",
|
|
44
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
45
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
46
|
+
"comment": "chore(deps): chore(deps): update dependency projen to v0.82.4"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"author": "email not defined",
|
|
50
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
51
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
52
|
+
"comment": "chore(deps): fix(deps): update dependency debug to v4.3.5"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"author": "email not defined",
|
|
56
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
57
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
58
|
+
"comment": "chore(deps): chore(deps): update dependency prettier to v3.3.2"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"author": "email not defined",
|
|
62
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
63
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
64
|
+
"comment": "chore(deps): chore(deps): update dependency projen to v0.82.3"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"author": "email not defined",
|
|
68
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
69
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
70
|
+
"comment": "chore(deps): chore(deps): update dependency prettier to v3.3.0"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"author": "email not defined",
|
|
74
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
75
|
+
"commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
|
|
76
|
+
"comment": "chore(deps): chore(deps): update dependency prettier to v3.3.1"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"date": "Tue, 21 May 2024 05:22:50 GMT",
|
|
83
|
+
"version": "0.2.5",
|
|
84
|
+
"tag": "@langri-sha/projen-lint-synthesized_v0.2.5",
|
|
85
|
+
"comments": {
|
|
86
|
+
"patch": [
|
|
87
|
+
{
|
|
88
|
+
"author": "email not defined",
|
|
89
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
90
|
+
"commit": "f95709138a43b934997a15555d3e42655a02bee3",
|
|
91
|
+
"comment": "chore(deps): chore(deps): update dependency projen to v0.81.15"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"author": "email not defined",
|
|
95
|
+
"package": "@langri-sha/projen-lint-synthesized",
|
|
96
|
+
"commit": "f95709138a43b934997a15555d3e42655a02bee3",
|
|
97
|
+
"comment": "chore(deps): chore(deps): update dependency projen to v0.81.13"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"date": "Wed, 15 May 2024 06:47:18 GMT",
|
|
6
104
|
"version": "0.2.4",
|
|
7
105
|
"tag": "@langri-sha/projen-lint-synthesized_v0.2.4",
|
|
8
106
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
# Change Log - @langri-sha/projen-lint-synthesized
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Sat, 15 Jun 2024 09:06:45 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.3.0
|
|
8
|
+
|
|
9
|
+
Sat, 15 Jun 2024 09:06:45 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- feat(projen): Reconfigure project expressions (filip.dupanovic@gmail.com)
|
|
14
|
+
- feat(lint-synthesized): Manage package with projen (filip.dupanovic@gmail.com)
|
|
15
|
+
- feat(project): Omit Node.js engine package defaults (filip.dupanovic@gmail.com)
|
|
16
|
+
- feat(lint-synthesized): Simplify finding projects (filip.dupanovic@gmail.com)
|
|
17
|
+
- feat(lint-synthesized): Run on all projects (filip.dupanovic@gmail.com)
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- chore(deps): chore(deps): update dependency projen to v0.82.4 (email not defined)
|
|
22
|
+
- chore(deps): fix(deps): update dependency debug to v4.3.5 (email not defined)
|
|
23
|
+
- chore(deps): chore(deps): update dependency prettier to v3.3.2 (email not defined)
|
|
24
|
+
- chore(deps): chore(deps): update dependency projen to v0.82.3 (email not defined)
|
|
25
|
+
- chore(deps): chore(deps): update dependency prettier to v3.3.0 (email not defined)
|
|
26
|
+
- chore(deps): chore(deps): update dependency prettier to v3.3.1 (email not defined)
|
|
27
|
+
|
|
28
|
+
## 0.2.5
|
|
29
|
+
|
|
30
|
+
Tue, 21 May 2024 05:22:50 GMT
|
|
31
|
+
|
|
32
|
+
### Patches
|
|
33
|
+
|
|
34
|
+
- chore(deps): chore(deps): update dependency projen to v0.81.15 (email not defined)
|
|
35
|
+
- chore(deps): chore(deps): update dependency projen to v0.81.13 (email not defined)
|
|
36
|
+
|
|
7
37
|
## 0.2.4
|
|
8
38
|
|
|
9
|
-
Wed, 15 May 2024 06:
|
|
39
|
+
Wed, 15 May 2024 06:47:18 GMT
|
|
10
40
|
|
|
11
41
|
### Patches
|
|
12
42
|
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,QAAQ,CAAA;AAW3C,MAAM,WAAW,sBAAsB;IACrC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,CAAA;CAC1D;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,SAAS;;gBAI1C,KAAK,EAAE,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,EACjD,OAAO,CAAC,EAAE,sBAAsB;IASzB,cAAc,IAAI,IAAI;CA4DhC"}
|
package/lib/index.js
CHANGED
|
@@ -10,7 +10,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _LintSynthesized_instances, _LintSynthesized_options, _LintSynthesized_run;
|
|
13
|
-
import { Component } from 'projen';
|
|
13
|
+
import { Component, Project } from 'projen';
|
|
14
|
+
import * as path from 'node:path';
|
|
14
15
|
import createDebug from 'debug';
|
|
15
16
|
import * as fs from 'node:fs';
|
|
16
17
|
import { execaSync } from 'execa';
|
|
@@ -30,29 +31,22 @@ export class LintSynthesized extends Component {
|
|
|
30
31
|
postSynthesize() {
|
|
31
32
|
super.postSynthesize();
|
|
32
33
|
debug('Commencing lints on synthesized files');
|
|
33
|
-
const fileInfo =
|
|
34
|
-
.filter((file) => fs.existsSync(file.absolutePath))
|
|
35
|
-
.map((file) => [
|
|
36
|
-
file.path,
|
|
37
|
-
{
|
|
38
|
-
file,
|
|
39
|
-
absolutePath: file.absolutePath,
|
|
40
|
-
mode: fs.statSync(file.absolutePath).mode,
|
|
41
|
-
},
|
|
42
|
-
]));
|
|
34
|
+
const fileInfo = getAllFiles(this.project);
|
|
43
35
|
const paths = Object.keys(fileInfo);
|
|
44
36
|
debug(`Found ${paths.length} synthesized files`);
|
|
45
37
|
const tasks = Object.entries(__classPrivateFieldGet(this, _LintSynthesized_options, "f") || {})
|
|
46
38
|
.map(([pattern, command]) => ({
|
|
47
39
|
pattern,
|
|
48
40
|
command,
|
|
49
|
-
files: minimatch.match(paths, pattern, {
|
|
41
|
+
files: minimatch.match(paths, pattern, {
|
|
42
|
+
dot: true,
|
|
43
|
+
matchBase: !pattern.includes('/'),
|
|
44
|
+
}),
|
|
50
45
|
}))
|
|
51
46
|
.filter(({ files }) => files.length);
|
|
52
47
|
for (const { files } of tasks) {
|
|
53
48
|
for (const file of files) {
|
|
54
|
-
|
|
55
|
-
fs.chmodSync(absolutePath, 0o755);
|
|
49
|
+
fs.chmodSync(fileInfo[file].absolutePath, 0o755);
|
|
56
50
|
}
|
|
57
51
|
}
|
|
58
52
|
for (const { pattern, command, files } of tasks) {
|
|
@@ -83,4 +77,27 @@ _LintSynthesized_options = new WeakMap(), _LintSynthesized_instances = new WeakS
|
|
|
83
77
|
cwd: this.project.outdir,
|
|
84
78
|
});
|
|
85
79
|
};
|
|
80
|
+
const getAllFiles = (root) => {
|
|
81
|
+
const projects = getProjects(root);
|
|
82
|
+
const files = [];
|
|
83
|
+
for (const project of projects) {
|
|
84
|
+
const current = project.files
|
|
85
|
+
.filter((file) => fs.existsSync(file.absolutePath))
|
|
86
|
+
.map((file) => [
|
|
87
|
+
path.relative(root.outdir, file.absolutePath),
|
|
88
|
+
{
|
|
89
|
+
file,
|
|
90
|
+
absolutePath: file.absolutePath,
|
|
91
|
+
mode: fs.statSync(file.absolutePath).mode,
|
|
92
|
+
},
|
|
93
|
+
]);
|
|
94
|
+
files.push(...current);
|
|
95
|
+
}
|
|
96
|
+
return Object.fromEntries(files);
|
|
97
|
+
};
|
|
98
|
+
const getProjects = (root) => {
|
|
99
|
+
return root.node
|
|
100
|
+
.findAll(0)
|
|
101
|
+
.filter((node) => node instanceof Project);
|
|
102
|
+
};
|
|
86
103
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,WAAW,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,MAAM,KAAK,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAA;AAMpD;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAG5C,YACE,KAAiD,EACjD,OAAgC;QAEhC,KAAK,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAA;;QANlC,2CAAiC;QAQ/B,uBAAA,IAAI,4BAAY,OAAO,MAAA,CAAA;QAEvB,KAAK,CAAC,aAAa,CAAC,CAAA;IACtB,CAAC;IAEQ,cAAc;QACrB,KAAK,CAAC,cAAc,EAAE,CAAA;QAEtB,KAAK,CAAC,uCAAuC,CAAC,CAAA;QAE9C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC1C,MAAM,KAAK,GAAG,MAAM,CAAC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,OAAO,CAAC,CAAA;IACxB,CAAC;IAED,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AAClC,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,IAAa,EAAa,EAAE;IAC/C,OAAO,IAAI,CAAC,IAAI;SACb,OAAO,CAAC,CAAC,CAAC;SACV,MAAM,CAAC,CAAC,IAAI,EAAmB,EAAE,CAAC,IAAI,YAAY,OAAO,CAAC,CAAA;AAC/D,CAAC,CAAA"}
|
package/license
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
|
+
|
|
1
2
|
MIT License
|
|
2
3
|
|
|
3
4
|
Copyright (c) 2024 Filip Dupanović <filip.dupanovic@gmail.com> (https://langri-sha.com)
|
|
4
5
|
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
11
7
|
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
8
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
14
9
|
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langri-sha/projen-lint-synthesized",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Filip Dupanović",
|
|
7
|
+
"email": "filip.dupanovic@gmail.com",
|
|
8
|
+
"url": "https://langri-sha.com",
|
|
9
|
+
"organization": false
|
|
10
|
+
},
|
|
5
11
|
"type": "module",
|
|
6
12
|
"main": "lib/index.js",
|
|
7
13
|
"scripts": {
|
|
8
14
|
"prepublishOnly": "rm -rf lib; tsc --project tsconfig.build.json"
|
|
9
15
|
},
|
|
10
16
|
"dependencies": {
|
|
11
|
-
"debug": "4.3.
|
|
17
|
+
"debug": "4.3.5",
|
|
12
18
|
"execa": "8.0.1",
|
|
13
19
|
"minimatch": "9.0.4"
|
|
14
20
|
},
|
|
15
21
|
"devDependencies": {
|
|
16
|
-
"@langri-sha/jest-test": "0.
|
|
17
|
-
"@langri-sha/tsconfig": "0.
|
|
22
|
+
"@langri-sha/jest-test": "0.8.0",
|
|
23
|
+
"@langri-sha/tsconfig": "0.10.0",
|
|
18
24
|
"@types/debug": "4.1.12",
|
|
19
|
-
"prettier": "3.2
|
|
20
|
-
"projen": "0.
|
|
25
|
+
"prettier": "3.3.2",
|
|
26
|
+
"projen": "0.82.4"
|
|
21
27
|
},
|
|
22
28
|
"peerDependencies": {
|
|
23
|
-
"projen": "^0.
|
|
24
|
-
"typescript": "^5.0.0"
|
|
29
|
+
"projen": "^0.82.0"
|
|
25
30
|
},
|
|
26
31
|
"publishConfig": {
|
|
27
32
|
"access": "public"
|
|
28
33
|
},
|
|
34
|
+
"//": "~~ Generated by projen. To modify, edit .projenrc.mts and run \"npx projen\".",
|
|
29
35
|
"types": "lib/index.d.ts"
|
|
30
36
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Component } from 'projen'
|
|
1
|
+
import { Component, Project } from 'projen'
|
|
2
|
+
import * as path from 'node:path'
|
|
2
3
|
import createDebug from 'debug'
|
|
3
4
|
|
|
4
5
|
import * as fs from 'node:fs'
|
|
@@ -34,18 +35,7 @@ export class LintSynthesized extends Component {
|
|
|
34
35
|
|
|
35
36
|
debug('Commencing lints on synthesized files')
|
|
36
37
|
|
|
37
|
-
const fileInfo =
|
|
38
|
-
this.project.files
|
|
39
|
-
.filter((file) => fs.existsSync(file.absolutePath))
|
|
40
|
-
.map((file) => [
|
|
41
|
-
file.path,
|
|
42
|
-
{
|
|
43
|
-
file,
|
|
44
|
-
absolutePath: file.absolutePath,
|
|
45
|
-
mode: fs.statSync(file.absolutePath).mode,
|
|
46
|
-
},
|
|
47
|
-
]),
|
|
48
|
-
)
|
|
38
|
+
const fileInfo = getAllFiles(this.project)
|
|
49
39
|
const paths = Object.keys(fileInfo)
|
|
50
40
|
|
|
51
41
|
debug(`Found ${paths.length} synthesized files`)
|
|
@@ -54,15 +44,16 @@ export class LintSynthesized extends Component {
|
|
|
54
44
|
.map(([pattern, command]) => ({
|
|
55
45
|
pattern,
|
|
56
46
|
command,
|
|
57
|
-
files: minimatch.match(paths, pattern, {
|
|
47
|
+
files: minimatch.match(paths, pattern, {
|
|
48
|
+
dot: true,
|
|
49
|
+
matchBase: !pattern.includes('/'),
|
|
50
|
+
}),
|
|
58
51
|
}))
|
|
59
52
|
.filter(({ files }) => files.length)
|
|
60
53
|
|
|
61
54
|
for (const { files } of tasks) {
|
|
62
55
|
for (const file of files) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
fs.chmodSync(absolutePath, 0o755)
|
|
56
|
+
fs.chmodSync(fileInfo[file].absolutePath, 0o755)
|
|
66
57
|
}
|
|
67
58
|
}
|
|
68
59
|
|
|
@@ -100,3 +91,34 @@ export class LintSynthesized extends Component {
|
|
|
100
91
|
})
|
|
101
92
|
}
|
|
102
93
|
}
|
|
94
|
+
|
|
95
|
+
const getAllFiles = (root: Project) => {
|
|
96
|
+
const projects = getProjects(root)
|
|
97
|
+
const files = []
|
|
98
|
+
|
|
99
|
+
for (const project of projects) {
|
|
100
|
+
const current = project.files
|
|
101
|
+
.filter((file) => fs.existsSync(file.absolutePath))
|
|
102
|
+
.map(
|
|
103
|
+
(file) =>
|
|
104
|
+
[
|
|
105
|
+
path.relative(root.outdir, file.absolutePath),
|
|
106
|
+
{
|
|
107
|
+
file,
|
|
108
|
+
absolutePath: file.absolutePath,
|
|
109
|
+
mode: fs.statSync(file.absolutePath).mode,
|
|
110
|
+
},
|
|
111
|
+
] as const,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
files.push(...current)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return Object.fromEntries(files)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const getProjects = (root: Project): Project[] => {
|
|
121
|
+
return root.node
|
|
122
|
+
.findAll(0)
|
|
123
|
+
.filter((node): node is Project => node instanceof Project)
|
|
124
|
+
}
|