@forge/lint 6.2.3-next.9 → 6.3.0-next.22
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 +98 -0
- package/out/lint/lint.d.ts +2 -1
- package/out/lint/lint.d.ts.map +1 -1
- package/out/lint/lint.js +2 -0
- package/out/lint/linters/storage-module-linter/storage-module-linter.d.ts.map +1 -1
- package/out/lint/linters/storage-module-linter/storage-module-linter.js +2 -2
- package/out/lint/linters/storage-module-linter/verifiers/os-verifier.js +1 -1
- package/out/lint/linters/teamwork-graph-linter/detect-teamwork-graph-usage.d.ts +3 -0
- package/out/lint/linters/teamwork-graph-linter/detect-teamwork-graph-usage.d.ts.map +1 -0
- package/out/lint/linters/teamwork-graph-linter/detect-teamwork-graph-usage.js +27 -0
- package/out/lint/linters/teamwork-graph-linter/teamwork-graph-linter.d.ts +11 -0
- package/out/lint/linters/teamwork-graph-linter/teamwork-graph-linter.d.ts.map +1 -0
- package/out/lint/linters/teamwork-graph-linter/teamwork-graph-linter.js +41 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,103 @@
|
|
|
1
1
|
# @forge/lint
|
|
2
2
|
|
|
3
|
+
## 6.3.0-next.22
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e7dc317: Warn when Teamwork Graph API usage is detected without graph scopes in the manifest, with guidance to review scope documentation. The warning does not block builds or automatically add scopes.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [e7dc317]
|
|
12
|
+
- @forge/cli-shared@9.7.0-next.21
|
|
13
|
+
- @forge/manifest@13.6.0-next.3
|
|
14
|
+
|
|
15
|
+
## 6.2.3-next.21
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [fb0dbe8]
|
|
20
|
+
- @forge/cli-shared@9.7.0-next.20
|
|
21
|
+
|
|
22
|
+
## 6.2.3-next.20
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [608da16]
|
|
27
|
+
- @forge/cli-shared@9.7.0-next.19
|
|
28
|
+
|
|
29
|
+
## 6.2.3-next.19
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [c0b2b2a]
|
|
34
|
+
- Updated dependencies [cf81630]
|
|
35
|
+
- @forge/cli-shared@9.7.0-next.18
|
|
36
|
+
|
|
37
|
+
## 6.2.3-next.18
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [797ac88]
|
|
42
|
+
- @forge/cli-shared@9.7.0-next.17
|
|
43
|
+
|
|
44
|
+
## 6.2.3-next.17
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- Updated dependencies [78af9a2]
|
|
49
|
+
- @forge/cli-shared@9.7.0-next.16
|
|
50
|
+
|
|
51
|
+
## 6.2.3-next.16
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies [2d36913]
|
|
56
|
+
- @forge/manifest@13.6.0-next.2
|
|
57
|
+
- @forge/cli-shared@9.7.0-next.15
|
|
58
|
+
|
|
59
|
+
## 6.2.3-next.15
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- Updated dependencies [4740d03]
|
|
64
|
+
- @forge/cli-shared@9.7.0-next.14
|
|
65
|
+
|
|
66
|
+
## 6.2.3-next.14
|
|
67
|
+
|
|
68
|
+
### Patch Changes
|
|
69
|
+
|
|
70
|
+
- Updated dependencies [ce74751]
|
|
71
|
+
- @forge/manifest@13.5.1-next.1
|
|
72
|
+
- @forge/cli-shared@9.7.0-next.13
|
|
73
|
+
|
|
74
|
+
## 6.2.3-next.13
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- 3012e11: Importing from `@forge/object-store` without declaring `modules.objectStore` in the manifest is now a lint error that blocks verified deployments. The existing lint fixer still adds the missing module automatically.
|
|
79
|
+
|
|
80
|
+
## 6.2.3-next.12
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- Updated dependencies [a384019]
|
|
85
|
+
- @forge/cli-shared@9.7.0-next.12
|
|
86
|
+
|
|
87
|
+
## 6.2.3-next.11
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- Updated dependencies [b090628]
|
|
92
|
+
- @forge/cli-shared@9.7.0-next.11
|
|
93
|
+
|
|
94
|
+
## 6.2.3-next.10
|
|
95
|
+
|
|
96
|
+
### Patch Changes
|
|
97
|
+
|
|
98
|
+
- Updated dependencies [385ac1a]
|
|
99
|
+
- @forge/cli-shared@9.7.0-next.10
|
|
100
|
+
|
|
3
101
|
## 6.2.3-next.9
|
|
4
102
|
|
|
5
103
|
### Patch Changes
|
package/out/lint/lint.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { LlmModuleLinter } from './linters/llm-module-linter/llm-module-linter';
|
|
|
18
18
|
import { DeprecatedApiModuleLinter } from './linters/deprecated-api-module-linter/deprecated-api-module-linter';
|
|
19
19
|
import { AppManagedPermissionsSdkLinter } from './linters/app-managed-permissions-sdk-linter/app-managed-permissions-sdk-linter';
|
|
20
20
|
import { FunctionTimeoutLinter } from './linters/function-timeout-linter/function-timeout-linter';
|
|
21
|
+
import { TeamworkGraphLinter } from './linters/teamwork-graph-linter/teamwork-graph-linter';
|
|
21
22
|
export interface ProblemCount {
|
|
22
23
|
errors: number;
|
|
23
24
|
warnings: number;
|
|
@@ -26,7 +27,7 @@ export interface ProblemCount {
|
|
|
26
27
|
export declare const reportLintResults: (logger: LintLogger, lintResults: LintResult[], showSummary?: boolean) => void;
|
|
27
28
|
export declare const problemCount: (lintResults: LintResult[]) => ProblemCount;
|
|
28
29
|
export declare const parseSourceFile: (filepath: string, parser: typeof tsParser, readFilePromise?: typeof fs.readFile.__promisify__) => Promise<LintInput>;
|
|
29
|
-
export declare const getClientSideLintersOnly: (manifest: Manifest, environment: string, logger: LintLogger, statsigService: StatsigService) => Promise<(FunctionTimeoutLinter | PermissionLinter | HandlerLinter | FullManifestLinter | AgentProductContextPermissionsManifestLinter | PermissionsManifestLinter | DeprecatedCspPermissionsManifestLinter | DynamicPropertiesPermissionsLinter | InvokeEndpointLinter | StorageModulesLinter | FrameComponentLinter | DeprecatedEgressPermissionsManifestLinter | LlmModuleLinter | DeprecatedApiModuleLinter | AppManagedPermissionsSdkLinter)[]>;
|
|
30
|
+
export declare const getClientSideLintersOnly: (manifest: Manifest, environment: string, logger: LintLogger, statsigService: StatsigService) => Promise<(FunctionTimeoutLinter | PermissionLinter | HandlerLinter | FullManifestLinter | AgentProductContextPermissionsManifestLinter | PermissionsManifestLinter | DeprecatedCspPermissionsManifestLinter | DynamicPropertiesPermissionsLinter | InvokeEndpointLinter | StorageModulesLinter | FrameComponentLinter | DeprecatedEgressPermissionsManifestLinter | LlmModuleLinter | DeprecatedApiModuleLinter | AppManagedPermissionsSdkLinter | TeamworkGraphLinter)[]>;
|
|
30
31
|
export interface LintConfig {
|
|
31
32
|
parseFunction?: (filepath: string, parser: typeof tsParser, readFilePromise?: typeof fs.readFile.__promisify__) => Promise<LintInput>;
|
|
32
33
|
approveRules?: string[];
|
package/out/lint/lint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/lint/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,cAAc,EACd,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;AAIpB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC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AAO,QAAQ,EACvB,kBAAiB,OAAO,EAAE,CAAC,QAAQ,CAAC,aAAsC,KACzE,OAAO,CAAC,SAAS,CAOnB,CAAC;AA8BF,eAAO,MAAM,wBAAwB,GACnC,UAAU,QAAQ,EAClB,aAAa,MAAM,EACnB,QAAQ,UAAU,EAClB,gBAAgB,cAAc,8cAkB/B,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,aAAa,CAAC,EAAE,CACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,QAAQ,EACvB,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,aAAa,KAC/C,OAAO,CAAC,SAAS,CAAC,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EACF;QACE,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC;QAC7B,aAAa,EAAE,aAAa,CAAC;KAC9B,GACD;QACE,IAAI,EAAE,aAAa,CAAC;KACrB,CAAC;IACN,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,eAAO,MAAM,IAAI,GACf,aAAa,MAAM,EAAE,EACrB,UAAU,QAAQ,EAClB,aAAa,MAAM,EACnB,QAAQ,UAAU,EAClB,gBAAgB,cAAc,EAC9B,QAAQ,UAAU,KACjB,OAAO,CAAC,UAAU,EAAE,CAsEtB,CAAC;AAwBF,eAAO,MAAM,QAAQ,GACnB,QAAQ,UAAU,EAClB,gBAAgB,cAAc,EAC9B,SAAQ,eAAiE,KACxE,OAAO,CAAC,UAAU,EAAE,CAGtB,CAAC"}
|
package/out/lint/lint.js
CHANGED
|
@@ -24,6 +24,7 @@ const deprecated_api_module_linter_1 = require("./linters/deprecated-api-module-
|
|
|
24
24
|
const app_managed_permissions_sdk_linter_1 = require("./linters/app-managed-permissions-sdk-linter/app-managed-permissions-sdk-linter");
|
|
25
25
|
const function_timeout_linter_1 = require("./linters/function-timeout-linter/function-timeout-linter");
|
|
26
26
|
const server_side_linter_1 = require("./linters/server-side-linter/server-side-linter");
|
|
27
|
+
const teamwork_graph_linter_1 = require("./linters/teamwork-graph-linter/teamwork-graph-linter");
|
|
27
28
|
const reportLintResults = (logger, lintResults, showSummary = true) => {
|
|
28
29
|
let numErrors = 0, numWarnings = 0, numApprovals = 0;
|
|
29
30
|
let noProblemsFound = true;
|
|
@@ -113,6 +114,7 @@ const getClientSideLintersOnly = async (manifest, environment, logger, statsigSe
|
|
|
113
114
|
new deprecated_api_module_linter_1.DeprecatedApiModuleLinter(environment, manifest, logger),
|
|
114
115
|
new deprecated_egress_permissions_manifest_linter_1.DeprecatedEgressPermissionsManifestLinter(logger, statsigService),
|
|
115
116
|
new app_managed_permissions_sdk_linter_1.AppManagedPermissionsSdkLinter(manifest, logger),
|
|
117
|
+
new teamwork_graph_linter_1.TeamworkGraphLinter(manifest, logger),
|
|
116
118
|
new function_timeout_linter_1.FunctionTimeoutLinter(manifest, logger)
|
|
117
119
|
];
|
|
118
120
|
exports.getClientSideLintersOnly = getClientSideLintersOnly;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-module-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/storage-module-linter/storage-module-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAW,MAAM,iBAAiB,CAAC;AACtE,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAM7E,UAAU,gCAAgC;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,CAAC;IACzB,GAAG,EAAE,cAAc,EAAE,CAAC;IACtB,EAAE,EAAE,cAAc,EAAE,CAAC;CACtB;AAaD,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,cAAc,EAAE,EACxB,UAAU,cAAc,EAAE,EAC1B,OAAO,YAAY,KAClB,OAAO,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"storage-module-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/storage-module-linter/storage-module-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAW,MAAM,iBAAiB,CAAC;AACtE,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAM7E,UAAU,gCAAgC;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,CAAC;IACzB,GAAG,EAAE,cAAc,EAAE,CAAC;IACtB,EAAE,EAAE,cAAc,EAAE,CAAC;CACtB;AAaD,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,cAAc,EAAE,EACxB,UAAU,cAAc,EAAE,EAC1B,OAAO,YAAY,KAClB,OAAO,CAAC,YAAY,CAkCtB,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,UAAU,CAAC,OAAO,EAAE,gCAAgC,EAAE,OAAO,EAAE,CAAC;IAGtG,OAAO,CAAC,QAAQ;gBADhB,WAAW,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAC1B,MAAM,EAAE,UAAU;IAKP,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IASvC,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAOjD,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;CAWzE"}
|
|
@@ -22,7 +22,7 @@ const fixMissingModules = async (errors, warnings, state) => {
|
|
|
22
22
|
const currentModules = (await state.configFile.readConfig())?.modules ?? {};
|
|
23
23
|
const modulesToAdd = {};
|
|
24
24
|
const missingSQLModule = errors.find((error) => error.metadata?.missingStorageModule === SQL_MODULE);
|
|
25
|
-
const missingOsModule =
|
|
25
|
+
const missingOsModule = errors.find((error) => error.metadata?.missingStorageModule === OBJECT_STORE_MODULE);
|
|
26
26
|
if (missingSQLModule && !currentModules.sql) {
|
|
27
27
|
modulesToAdd.sql = [
|
|
28
28
|
{
|
|
@@ -39,7 +39,7 @@ const fixMissingModules = async (errors, warnings, state) => {
|
|
|
39
39
|
storageClass: ObjectStoreClass.standard
|
|
40
40
|
}
|
|
41
41
|
];
|
|
42
|
-
state.
|
|
42
|
+
state.errorsFixed += 1;
|
|
43
43
|
}
|
|
44
44
|
if (Object.keys(modulesToAdd).length) {
|
|
45
45
|
const newModules = { ...currentModules, ...modulesToAdd };
|
|
@@ -7,7 +7,7 @@ const text_1 = require("../../../text");
|
|
|
7
7
|
const OS_MODULE = 'objectStore';
|
|
8
8
|
class OsVerifier extends verifier_interface_1.BaseLintIssueVerifier {
|
|
9
9
|
getLintClass() {
|
|
10
|
-
return linter_interface_1.LintClass.
|
|
10
|
+
return linter_interface_1.LintClass.Error;
|
|
11
11
|
}
|
|
12
12
|
async process(apiCalls) {
|
|
13
13
|
if (this.manifest.modules && OS_MODULE in this.manifest.modules) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-teamwork-graph-usage.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/teamwork-graph-linter/detect-teamwork-graph-usage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,eAAO,MAAM,uBAAuB,GAAI,KAAK,cAAc,GAAG,IAAI,KAAG,OAwBpE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.doesAstUseTeamworkGraph = void 0;
|
|
4
|
+
const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
|
|
5
|
+
const doesAstUseTeamworkGraph = (ast) => {
|
|
6
|
+
let found = false;
|
|
7
|
+
ast?.traverse({
|
|
8
|
+
enter: (node) => {
|
|
9
|
+
if (found || node.type !== typescript_estree_1.AST_NODE_TYPES.CallExpression)
|
|
10
|
+
return;
|
|
11
|
+
const callee = node.callee;
|
|
12
|
+
if (callee.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
13
|
+
found = callee.name === 'requestTeamworkGraph';
|
|
14
|
+
}
|
|
15
|
+
else if (callee.type === typescript_estree_1.AST_NODE_TYPES.MemberExpression) {
|
|
16
|
+
if (callee.computed) {
|
|
17
|
+
found = callee.property.type === typescript_estree_1.AST_NODE_TYPES.Literal && callee.property.value === 'requestTeamworkGraph';
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
found = callee.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier && callee.property.name === 'requestTeamworkGraph';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return found;
|
|
26
|
+
};
|
|
27
|
+
exports.doesAstUseTeamworkGraph = doesAstUseTeamworkGraph;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ManifestSchema as Manifest } from '@forge/manifest';
|
|
2
|
+
import { AbstractLinter } from '../../abstract-linter';
|
|
3
|
+
import { LintInput, LintLogger, LintResult } from '../../linter-interface';
|
|
4
|
+
export declare class TeamworkGraphLinter extends AbstractLinter {
|
|
5
|
+
private readonly manifest;
|
|
6
|
+
constructor(manifest: Manifest, logger: LintLogger);
|
|
7
|
+
bootstrap(): Promise<void>;
|
|
8
|
+
private hasDeclaredTeamworkGraphScope;
|
|
9
|
+
batchExecuteImpl(inputs?: LintInput[]): Promise<LintResult[]>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=teamwork-graph-linter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teamwork-graph-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/teamwork-graph-linter/teamwork-graph-linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAyC,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGpG,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAa,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEtF,qBAAa,mBAAoB,SAAQ,cAAc;IAEnD,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,QAAQ,EACnC,MAAM,EAAE,UAAU;IAKd,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC,OAAO,CAAC,6BAA6B;IAS/B,gBAAgB,CAAC,MAAM,GAAE,SAAS,EAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAoBxE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TeamworkGraphLinter = void 0;
|
|
4
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
const manifest_1 = require("@forge/manifest");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
const detect_teamwork_graph_usage_1 = require("./detect-teamwork-graph-usage");
|
|
8
|
+
const abstract_linter_1 = require("../../abstract-linter");
|
|
9
|
+
const linter_interface_1 = require("../../linter-interface");
|
|
10
|
+
class TeamworkGraphLinter extends abstract_linter_1.AbstractLinter {
|
|
11
|
+
manifest;
|
|
12
|
+
constructor(manifest, logger) {
|
|
13
|
+
super(logger);
|
|
14
|
+
this.manifest = manifest;
|
|
15
|
+
}
|
|
16
|
+
async bootstrap() {
|
|
17
|
+
}
|
|
18
|
+
hasDeclaredTeamworkGraphScope() {
|
|
19
|
+
const declaredScopes = (0, utils_1.getAllScopeKeys)(this.manifest.permissions?.scopes ?? []);
|
|
20
|
+
const teamworkGraphScopes = (0, manifest_1.getTeamworkGraphScopes)();
|
|
21
|
+
return declaredScopes.some((scope) => teamworkGraphScopes.has(scope));
|
|
22
|
+
}
|
|
23
|
+
async batchExecuteImpl(inputs = []) {
|
|
24
|
+
if (this.hasDeclaredTeamworkGraphScope()) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
const usesTeamworkGraph = inputs.some(({ ast }) => (0, detect_teamwork_graph_usage_1.doesAstUseTeamworkGraph)(ast));
|
|
28
|
+
if (!usesTeamworkGraph)
|
|
29
|
+
return [];
|
|
30
|
+
const result = new linter_interface_1.LintResult(manifest_1.MANIFEST_FILE);
|
|
31
|
+
result.add({
|
|
32
|
+
class: linter_interface_1.LintClass.Warning,
|
|
33
|
+
message: cli_shared_1.Text.lint.teamworkGraphScopes,
|
|
34
|
+
reference: 'teamwork-graph-scopes',
|
|
35
|
+
line: 0,
|
|
36
|
+
column: 0
|
|
37
|
+
});
|
|
38
|
+
return [result];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.TeamworkGraphLinter = TeamworkGraphLinter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/lint",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0-next.22",
|
|
4
4
|
"description": "Linting for forge apps",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@atlassian/xen-test-util": "^4.2.0",
|
|
14
|
-
"@forge/api": "^8.
|
|
14
|
+
"@forge/api": "^8.2.0-next.2",
|
|
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
18
|
"eslint-plugin-import": "^2.29.1"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@forge/cli-shared": "9.7.0-next.
|
|
21
|
+
"@forge/cli-shared": "9.7.0-next.21",
|
|
22
22
|
"@forge/csp": "6.3.1",
|
|
23
23
|
"@forge/egress": "3.0.0",
|
|
24
|
-
"@forge/manifest": "13.
|
|
24
|
+
"@forge/manifest": "13.6.0-next.3",
|
|
25
25
|
"@typescript-eslint/typescript-estree": "^5.62.0",
|
|
26
26
|
"archiver": "^8.0.0",
|
|
27
27
|
"array.prototype.flatmap": "^1.3.3",
|