@forge/lint 6.0.3-next.12-experimental-4b981ef → 6.0.3-next.13
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 +5 -24
- package/out/lint/linters/handler-linter/handler-linter.d.ts +2 -1
- package/out/lint/linters/handler-linter/handler-linter.d.ts.map +1 -1
- package/out/lint/linters/handler-linter/handler-linter.js +9 -3
- package/out/lint/linters/permission-linter/permission-linter.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/permission-linter.js +2 -1
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
# @forge/lint
|
|
2
2
|
|
|
3
|
-
## 6.0.3-next.
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- efa5897: Move from node-fetch to native fetch
|
|
3
|
+
## 6.0.3-next.13
|
|
8
4
|
|
|
9
5
|
### Patch Changes
|
|
10
6
|
|
|
11
|
-
-
|
|
12
|
-
- Updated dependencies [
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- Updated dependencies [18b920d]
|
|
16
|
-
- Updated dependencies [d706cd8]
|
|
17
|
-
- Updated dependencies [0949833]
|
|
18
|
-
- Updated dependencies [a36d70b]
|
|
19
|
-
- Updated dependencies [d1610cc]
|
|
20
|
-
- Updated dependencies [e7bfe5e]
|
|
21
|
-
- Updated dependencies [bc2d278]
|
|
22
|
-
- Updated dependencies [498fda5]
|
|
23
|
-
- Updated dependencies [ca4fa27]
|
|
24
|
-
- Updated dependencies [89ccb1e]
|
|
25
|
-
- Updated dependencies [39f1f15]
|
|
26
|
-
- Updated dependencies [c3a0f20]
|
|
27
|
-
- @forge/cli-shared@9.3.0-next.11-experimental-4b981ef
|
|
28
|
-
- @forge/manifest@13.3.0-next.7-experimental-4b981ef
|
|
29
|
-
- @forge/csp@6.2.0-experimental-4b981ef
|
|
7
|
+
- 4b90a07: Lint target directory when using the manual packaging
|
|
8
|
+
- Updated dependencies [4b90a07]
|
|
9
|
+
- @forge/manifest@13.3.0-next.8
|
|
10
|
+
- @forge/cli-shared@9.3.0-next.12
|
|
30
11
|
|
|
31
12
|
## 6.0.3-next.12
|
|
32
13
|
|
|
@@ -10,7 +10,8 @@ export declare class HandlerLinter extends BaseLinter<ExportedMethod, HandlerLin
|
|
|
10
10
|
private manifest;
|
|
11
11
|
constructor(environment: string, manifest: Manifest, logger: LintLogger);
|
|
12
12
|
bootstrap(): Promise<void>;
|
|
13
|
-
private
|
|
13
|
+
private escapeRegExp;
|
|
14
|
+
private isHandlerFile;
|
|
14
15
|
private getFunctionHandlers;
|
|
15
16
|
protected setupMatchesMap(filepath: string): void;
|
|
16
17
|
protected filterLintInput(inputs: LintInput[]): LintInput[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/handler-linter/handler-linter.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"handler-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/handler-linter/handler-linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAW,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGrF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE/D,UAAU,0BAA0B;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;IAC7B,gBAAgB,EAAE,aAAa,CAAC;CACjC;AAED,qBAAa,aAAc,SAAQ,UAAU,CAAC,cAAc,EAAE,0BAA0B,EAAE,aAAa,CAAC;IAGpG,OAAO,CAAC,QAAQ;gBADhB,WAAW,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAC1B,MAAM,EAAE,UAAU;IAKP,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IASvC,OAAO,CAAC,YAAY,CAA2E;IAE/F,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,mBAAmB;IAc3B,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAYjD,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE;IAK3D,SAAS,CAAC,oBAAoB,CAAC,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAKvF"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HandlerLinter = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
6
|
+
const manifest_1 = require("@forge/manifest");
|
|
6
7
|
const base_linter_1 = tslib_1.__importDefault(require("../../base-linter"));
|
|
7
8
|
const handlers_verifier_1 = require("./verifiers/handlers-verifier");
|
|
8
9
|
const visitors_1 = require("./visitors");
|
|
@@ -19,7 +20,12 @@ class HandlerLinter extends base_linter_1.default {
|
|
|
19
20
|
functionHandlers: new handlers_verifier_1.HandlersVerifier(humanReadableEnvironment, this.manifest)
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
24
|
+
isHandlerFile(handler, filepath) {
|
|
25
|
+
const handlersDirectory = (0, manifest_1.getHandlersDirectory)(this.manifest);
|
|
26
|
+
const handlerFileRegex = new RegExp(`^${this.escapeRegExp(handlersDirectory)}(\/|\\\\)${this.escapeRegExp(handler.file)}\.[tj](s|sx)$`);
|
|
27
|
+
return handlerFileRegex.test(filepath);
|
|
28
|
+
}
|
|
23
29
|
getFunctionHandlers(manifest) {
|
|
24
30
|
return manifest.modules?.function
|
|
25
31
|
?.filter((funcs) => funcs.handler && funcs.handler.split('.').length === 2)
|
|
@@ -35,7 +41,7 @@ class HandlerLinter extends base_linter_1.default {
|
|
|
35
41
|
}
|
|
36
42
|
setupMatchesMap(filepath) {
|
|
37
43
|
const handlers = this.getFunctionHandlers(this.manifest);
|
|
38
|
-
const filteredHandlers = handlers?.filter((handler) => this.
|
|
44
|
+
const filteredHandlers = handlers?.filter((handler) => this.isHandlerFile(handler, filepath));
|
|
39
45
|
this.matches.set(filepath, {
|
|
40
46
|
functionHandlers: {
|
|
41
47
|
expectedMethods: filteredHandlers || [],
|
|
@@ -45,7 +51,7 @@ class HandlerLinter extends base_linter_1.default {
|
|
|
45
51
|
}
|
|
46
52
|
filterLintInput(inputs) {
|
|
47
53
|
const handlers = this.getFunctionHandlers(this.manifest);
|
|
48
|
-
return inputs.filter((input) => handlers?.find((handler) => this.
|
|
54
|
+
return inputs.filter((input) => handlers?.find((handler) => this.isHandlerFile(handler, input.filepath)));
|
|
49
55
|
}
|
|
50
56
|
addLintCriteriaMatch(exportedMethod, filepath) {
|
|
51
57
|
const criteriaMatches = this.matches.get(filepath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/permission-linter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,IAAI,QAAQ,EAAe,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"permission-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/permission-linter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,IAAI,QAAQ,EAAe,MAAM,iBAAiB,CAAC;AAE/E,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EACL,OAAO,EAEP,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB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oBAAoB,SAAsC;IACjE,MAAM,CAAC,uBAAuB,SAAyC;IACvE,MAAM,CAAC,mBAAmB,SAAqC;IAE/D,OAAO,CAAC,IAAI,CAAC,CAA0B;IACvC,OAAO,CAAC,UAAU,CAAC,CAA0B;IAC7C,OAAO,CAAC,SAAS,CAAC,CAA0B;IAC5C,OAAO,CAAC,KAAK,CAAC,CAAa;gBAGzB,WAAW,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAC1B,MAAM,EAAE,UAAU;IAKP,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IA6FvC,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAejD,SAAS,CAAC,QAAQ,IACd,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC,GACtG,SAAS;IAIb,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAyB3D,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAWtE,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKrE,OAAO,CAAC,YAAY;CAarB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PermissionLinter = exports.fixMissingPermissions = exports.deprecatedEgressPermissions = exports.findMissingPermissions = exports.NON_FWD_SLASH_REGEX = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
6
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
7
|
const base_linter_1 = tslib_1.__importDefault(require("../../base-linter"));
|
|
7
8
|
const api_call_interface_1 = require("./api-call-interface");
|
|
8
9
|
const verifiers_1 = require("./verifiers");
|
|
@@ -247,7 +248,7 @@ class PermissionLinter extends base_linter_1.default {
|
|
|
247
248
|
async getProductPaths(cacheKey, url) {
|
|
248
249
|
const cached = this.cache?.get(cacheKey);
|
|
249
250
|
if (!cached) {
|
|
250
|
-
const response = await
|
|
251
|
+
const response = await (0, node_fetch_1.default)(url);
|
|
251
252
|
const jsonBody = await response.json();
|
|
252
253
|
void this.cache?.set(cacheKey, jsonBody, 12 * ONE_HOUR_MS);
|
|
253
254
|
return jsonBody;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/lint",
|
|
3
|
-
"version": "6.0.3-next.
|
|
3
|
+
"version": "6.0.3-next.13",
|
|
4
4
|
"description": "Linting for forge apps",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -11,21 +11,23 @@
|
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@atlassian/xen-test-util": "^4.2.0",
|
|
14
|
-
"@forge/api": "^8.0.3-next.0
|
|
14
|
+
"@forge/api": "^8.0.3-next.0",
|
|
15
15
|
"@types/array.prototype.flatmap": "^1.2.6",
|
|
16
16
|
"@types/cross-spawn": "^6.0.6",
|
|
17
17
|
"@types/eslint": "8.56.12",
|
|
18
|
+
"@types/node-fetch": "^2.6.12",
|
|
18
19
|
"eslint-plugin-import": "^2.29.1"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@forge/cli-shared": "9.3.0-next.
|
|
22
|
-
"@forge/csp": "6.2.0
|
|
22
|
+
"@forge/cli-shared": "9.3.0-next.12",
|
|
23
|
+
"@forge/csp": "6.2.0",
|
|
23
24
|
"@forge/egress": "3.0.0",
|
|
24
|
-
"@forge/manifest": "13.3.0-next.
|
|
25
|
+
"@forge/manifest": "13.3.0-next.8",
|
|
25
26
|
"@typescript-eslint/typescript-estree": "^5.62.0",
|
|
26
27
|
"array.prototype.flatmap": "^1.3.3",
|
|
27
28
|
"@atlassian/atlassian-openapi": "^1.0.6",
|
|
28
29
|
"cross-spawn": "^7.0.6",
|
|
30
|
+
"node-fetch": "2.7.0",
|
|
29
31
|
"typescript": "5.9.2"
|
|
30
32
|
},
|
|
31
33
|
"publishConfig": {
|