npm package diff
Package: @forge/lint
Versions: 5.2.4-next.0-experimental-10722bc - 5.3.3-next.13
Modified:package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.js
Index: package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.js
===================================================================
--- package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.js
+++ package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.js
@@ -10,17 +10,21 @@
getLintClass() {
return linter_interface_1.LintClass.Error;
}
async process(input) {
- return input.invokeRemoteCalls
- .filter((call) => this.isValidCall(call, input.imports))
+ const validCalls = input.invokeRemoteCalls.filter((call) => this.isValidCall(call, input.imports));
+ const missingRemotes = validCalls
.filter((call) => !this.isRemoteKeyValid(call))
- .map((call) => ({
+ .map((call) => ({ call, message: text_1.messages.verifiers.invokeRemoteKey }));
+ const missingComputeOperation = validCalls
+ .filter((call) => this.isRemoteKeyValid(call) && !this.hasComputeOperation(call))
+ .map((call) => ({ call, message: text_1.messages.verifiers.invokeRemoteCompute }));
+ return [...missingRemotes, ...missingComputeOperation].map(({ call, message }) => ({
class: this.getLintClass(),
column: call.column,
line: call.line,
- message: text_1.messages.verifiers.invokeRemoteKey.message(call.remoteKey),
- reference: text_1.messages.verifiers.invokeRemoteKey.reference
+ message: message.message(call.remoteKey),
+ reference: message.reference
}));
}
isValidCall(call, imports) {
if (call.type === invoke_remote_interface_1.InvokeRemoteTypes.DIRECT_CALL) {
@@ -28,13 +32,17 @@
}
return imports.some((imp) => (imp.type === typescript_estree_1.AST_NODE_TYPES.ImportDefaultSpecifier || imp.type === typescript_estree_1.AST_NODE_TYPES.ImportNamespaceSpecifier) &&
call.objectName === imp.alias);
}
+ getRemoteForCall(call) {
+ return this.manifest.remotes?.find((remote) => remote.key === call.remoteKey);
+ }
isRemoteKeyValid(call) {
- const remotes = this.manifest.remotes;
- if (!remotes) {
- return false;
- }
- return remotes.some((remote) => remote.key === call.remoteKey);
+ const remote = this.getRemoteForCall(call);
+ return typeof remote !== 'undefined';
}
+ hasComputeOperation(call) {
+ const remote = this.getRemoteForCall(call);
+ return remote?.operations?.includes('compute') ?? false;
+ }
}
exports.InvokeRemoteVerifier = InvokeRemoteVerifier;
Modified:package/out/lint/text/messages.js
Index: package/out/lint/text/messages.js
===================================================================
--- package/out/lint/text/messages.js
+++ package/out/lint/text/messages.js
@@ -23,8 +23,12 @@
invokeRemoteKey: {
message: (remoteKey) => `The remote key "${remoteKey}" does not exist in the "remotes" section of your app's manifest.yml file`,
reference: 'missing-remote-key'
},
+ invokeRemoteCompute: {
+ message: (remoteKey) => `The remote key "${remoteKey}" does not have a compute operation defined in the "remotes" section of your app's manifest.yml file`,
+ reference: 'missing-remote-compute'
+ },
handler: {
message: (method, key) => `Cannot find exported function "${method}", which is required by module "${key}" handler defined in your app's manifest.yml file`,
reference: 'valid-module-required'
},
Modified:package/package.json
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "@forge/lint",
- "version": "5.2.4-next.0-experimental-10722bc",
+ "version": "5.3.3-next.13",
"description": "Linting for forge apps",
"main": "out/index.js",
"license": "UNLICENSED",
"scripts": {
@@ -10,19 +10,19 @@
"clean": "rm -rf ./out && rm -f tsconfig.tsbuildinfo"
},
"devDependencies": {
"@atlassian/xen-test-util": "^4.2.0",
- "@forge/api": "^3.8.1-experimental-10722bc",
+ "@forge/api": "^3.9.2-next.2",
"@types/array.prototype.flatmap": "^1.2.6",
"@types/cross-spawn": "^6.0.6",
"@types/eslint": "8.56.2",
"@types/node-fetch": "^2.6.11",
"eslint-plugin-import": "^2.29.1"
},
"dependencies": {
- "@forge/cli-shared": "5.3.1-next.0-experimental-10722bc",
+ "@forge/cli-shared": "5.5.0-next.13",
"@forge/egress": "1.2.13",
- "@forge/manifest": "7.5.2-next.0-experimental-10722bc",
+ "@forge/manifest": "7.7.0-next.13",
"@typescript-eslint/typescript-estree": "^5.62.0",
"array.prototype.flatmap": "^1.3.2",
"atlassian-openapi": "^1.0.18",
"cross-spawn": "^7.0.3",
Modified:package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.d.ts.map
Index: package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.d.ts.map
===================================================================
--- package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.d.ts.map
+++ package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"invoke-remote-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/remote-linter/verifiers/invoke-remote-verifier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAIL,yBAAyB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,qBAAa,oBACX,SAAQ,qBACR,YAAW,iBAAiB,CAAC,yBAAyB,CAAC;IAEvD,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAgBjF,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,gBAAgB;CASzB"}
\ No newline at end of file
+{"version":3,"file":"invoke-remote-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/remote-linter/verifiers/invoke-remote-verifier.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAIL,yBAAyB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,qBAAa,oBACX,SAAQ,qBACR,YAAW,iBAAiB,CAAC,yBAAyB,CAAC;IAEvD,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAuBjF,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,mBAAmB;CAK5B"}
\ No newline at end of file
Modified:package/out/lint/text/messages.d.ts.map
Index: package/out/lint/text/messages.d.ts.map
===================================================================
--- package/out/lint/text/messages.d.ts.map
+++ package/out/lint/text/messages.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/lint/text/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;+BAGI,MAAM,UAAU,MAAM,SAAS,MAAM,KAAG,MAAM;;;;2BAKlD,MAAM;;;;2BAKN,MAAM;2BAER,MAAM;;;;2BAKJ,MAAM;;;;iCAKA,MAAM;;;;8BAKT,MAAM,OAAO,MAAM;;;;+BAKlB,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,SAAS,SAAS,MAAM;;;;6BAKjE,MAAM;;;;+BAIJ,MAAM,QAAQ,MAAM,SAAS,MAAM;;;;CAK3D,CAAC"}
\ No newline at end of file
+{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/lint/text/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;+BAGI,MAAM,UAAU,MAAM,SAAS,MAAM,KAAG,MAAM;;;;2BAKlD,MAAM;;;;2BAKN,MAAM;2BAER,MAAM;;;;2BAKJ,MAAM;;;;iCAKA,MAAM;;;;iCAKN,MAAM;;;;8BAKT,MAAM,OAAO,MAAM;;;;+BAKlB,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,SAAS,SAAS,MAAM;;;;6BAKjE,MAAM;;;;+BAIJ,MAAM,QAAQ,MAAM,SAAS,MAAM;;;;CAK3D,CAAC"}
\ No newline at end of file
Modified:package/CHANGELOG.md
too-big
Modified:package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.d.ts
Index: package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.d.ts
===================================================================
--- package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.d.ts
+++ package/out/lint/linters/remote-linter/verifiers/invoke-remote-verifier.d.ts
@@ -4,7 +4,9 @@
export declare class InvokeRemoteVerifier extends BaseLintIssueVerifier implements LintIssueVerifier<InvokeRemoteVerifierInput> {
protected getLintClass(): LintClass;
process(input: InvokeRemoteVerifierInput): Promise<LintResultRule[]>;
private isValidCall;
+ private getRemoteForCall;
private isRemoteKeyValid;
+ private hasComputeOperation;
}
//# sourceMappingURL=invoke-remote-verifier.d.ts.map
\ No newline at end of file
Modified:package/out/lint/text/messages.d.ts
Index: package/out/lint/text/messages.d.ts
===================================================================
--- package/out/lint/text/messages.d.ts
+++ package/out/lint/text/messages.d.ts
@@ -20,8 +20,12 @@
invokeRemoteKey: {
message: (remoteKey: string) => string;
reference: string;
};
+ invokeRemoteCompute: {
+ message: (remoteKey: string) => string;
+ reference: string;
+ };
handler: {
message: (method: string, key: string) => string;
reference: string;
};