@forge/lint 5.19.2 → 5.20.0-next.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.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @forge/lint
2
2
 
3
+ ## 5.20.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6adb226: The Forge linter now reports an error (previously a warning) when the `@forge/sql` SDK is imported but no corresponding `sql` module is declared in the manifest. The autofix continues to add the missing `sql` module and now counts it as a fixed error.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [c3b96b3]
12
+ - Updated dependencies [814b8fe]
13
+ - Updated dependencies [561f8f4]
14
+ - Updated dependencies [bb903a8]
15
+ - Updated dependencies [c1acc55]
16
+ - Updated dependencies [5b67e61]
17
+ - Updated dependencies [55c1371]
18
+ - Updated dependencies [1a461c3]
19
+ - @forge/cli-shared@8.24.1-next.0
20
+ - @forge/manifest@12.9.1-next.0
21
+ - @forge/csp@5.8.2-next.0
22
+
3
23
  ## 5.19.2
4
24
 
5
25
  ### Patch Changes
@@ -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,WACpB,cAAc,EAAE,YACd,cAAc,EAAE,SACnB,YAAY,KAClB,QAAQ,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"}
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,WACpB,cAAc,EAAE,YACd,cAAc,EAAE,SACnB,YAAY,KAClB,QAAQ,YAAY,CAmCtB,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"}
@@ -21,28 +21,29 @@ const OBJECT_STORE_MODULE = 'objectStore';
21
21
  const fixMissingModules = async (errors, warnings, state) => {
22
22
  const currentModules = (await state.configFile.readConfig())?.modules ?? {};
23
23
  const modulesToAdd = {};
24
- if (warnings.length) {
25
- const missingSQLModule = warnings.find((warning) => warning.metadata?.missingStorageModule === SQL_MODULE);
26
- const missingOsModule = warnings.find((warning) => warning.metadata?.missingStorageModule === OBJECT_STORE_MODULE);
27
- if (missingSQLModule && !currentModules.sql) {
28
- modulesToAdd.sql = [
29
- {
30
- key: 'db',
31
- engine: SqlEngine.mysql
32
- }
33
- ];
34
- }
35
- if (missingOsModule && !currentModules.objectStore) {
36
- modulesToAdd.objectStore = [
37
- {
38
- key: 'os',
39
- storageClass: ObjectStoreClass.standard
40
- }
41
- ];
42
- }
24
+ const missingSQLModule = errors.find((error) => error.metadata?.missingStorageModule === SQL_MODULE);
25
+ const missingOsModule = warnings.find((warning) => warning.metadata?.missingStorageModule === OBJECT_STORE_MODULE);
26
+ if (missingSQLModule && !currentModules.sql) {
27
+ modulesToAdd.sql = [
28
+ {
29
+ key: 'db',
30
+ engine: SqlEngine.mysql
31
+ }
32
+ ];
33
+ state.errorsFixed += 1;
34
+ }
35
+ if (missingOsModule && !currentModules.objectStore) {
36
+ modulesToAdd.objectStore = [
37
+ {
38
+ key: 'os',
39
+ storageClass: ObjectStoreClass.standard
40
+ }
41
+ ];
42
+ state.warningsFixed += 1;
43
+ }
44
+ if (Object.keys(modulesToAdd).length) {
43
45
  const newModules = { ...currentModules, ...modulesToAdd };
44
46
  await state.configFile.writeToConfigFile('modules', newModules);
45
- state.warningsFixed += Object.keys(modulesToAdd).length;
46
47
  }
47
48
  return state;
48
49
  };
@@ -7,7 +7,7 @@ const text_1 = require("../../../text");
7
7
  const SQL_MODULE = 'sql';
8
8
  class SQLVerifier extends verifier_interface_1.BaseLintIssueVerifier {
9
9
  getLintClass() {
10
- return linter_interface_1.LintClass.Warning;
10
+ return linter_interface_1.LintClass.Error;
11
11
  }
12
12
  async process(apiCalls) {
13
13
  if (this.manifest.modules && SQL_MODULE in this.manifest.modules) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/lint",
3
- "version": "5.19.2",
3
+ "version": "5.20.0-next.0",
4
4
  "description": "Linting for forge apps",
5
5
  "main": "out/index.js",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@atlassian/xen-test-util": "^4.2.0",
14
- "@forge/api": "^7.2.2",
14
+ "@forge/api": "^8.0.0-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",
@@ -19,10 +19,10 @@
19
19
  "eslint-plugin-import": "^2.29.1"
20
20
  },
21
21
  "dependencies": {
22
- "@forge/cli-shared": "8.24.0",
23
- "@forge/csp": "5.8.1",
22
+ "@forge/cli-shared": "8.24.1-next.0",
23
+ "@forge/csp": "5.8.2-next.0",
24
24
  "@forge/egress": "2.3.2",
25
- "@forge/manifest": "12.9.0",
25
+ "@forge/manifest": "12.9.1-next.0",
26
26
  "@typescript-eslint/typescript-estree": "^5.62.0",
27
27
  "array.prototype.flatmap": "^1.3.3",
28
28
  "@atlassian/atlassian-openapi": "^1.0.6",