@metamask/snaps-utils 11.3.0 → 11.5.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 +29 -1
- package/dist/base64.cjs +3 -2
- package/dist/base64.cjs.map +1 -1
- package/dist/base64.d.cts.map +1 -1
- package/dist/base64.d.mts.map +1 -1
- package/dist/base64.mjs +3 -2
- package/dist/base64.mjs.map +1 -1
- package/dist/manifest/manifest.cjs +18 -11
- package/dist/manifest/manifest.cjs.map +1 -1
- package/dist/manifest/manifest.d.cts +10 -2
- package/dist/manifest/manifest.d.cts.map +1 -1
- package/dist/manifest/manifest.d.mts +10 -2
- package/dist/manifest/manifest.d.mts.map +1 -1
- package/dist/manifest/manifest.mjs +19 -12
- package/dist/manifest/manifest.mjs.map +1 -1
- package/dist/manifest/validation.cjs +8 -4
- package/dist/manifest/validation.cjs.map +1 -1
- package/dist/manifest/validation.d.cts +4 -0
- package/dist/manifest/validation.d.cts.map +1 -1
- package/dist/manifest/validation.d.mts +4 -0
- package/dist/manifest/validation.d.mts.map +1 -1
- package/dist/manifest/validation.mjs +7 -3
- package/dist/manifest/validation.mjs.map +1 -1
- package/dist/manifest/validator-types.cjs.map +1 -1
- package/dist/manifest/validator-types.d.cts +4 -2
- package/dist/manifest/validator-types.d.cts.map +1 -1
- package/dist/manifest/validator-types.d.mts +4 -2
- package/dist/manifest/validator-types.d.mts.map +1 -1
- package/dist/manifest/validator-types.mjs.map +1 -1
- package/dist/manifest/validator.cjs +26 -5
- package/dist/manifest/validator.cjs.map +1 -1
- package/dist/manifest/validator.d.cts +10 -1
- package/dist/manifest/validator.d.cts.map +1 -1
- package/dist/manifest/validator.d.mts +10 -1
- package/dist/manifest/validator.d.mts.map +1 -1
- package/dist/manifest/validator.mjs +24 -4
- package/dist/manifest/validator.mjs.map +1 -1
- package/dist/manifest/validators/checksum.cjs +1 -1
- package/dist/manifest/validators/checksum.cjs.map +1 -1
- package/dist/manifest/validators/checksum.d.cts.map +1 -1
- package/dist/manifest/validators/checksum.d.mts.map +1 -1
- package/dist/manifest/validators/checksum.mjs +1 -1
- package/dist/manifest/validators/checksum.mjs.map +1 -1
- package/dist/manifest/validators/expected-files.cjs +1 -1
- package/dist/manifest/validators/expected-files.cjs.map +1 -1
- package/dist/manifest/validators/expected-files.d.cts.map +1 -1
- package/dist/manifest/validators/expected-files.d.mts.map +1 -1
- package/dist/manifest/validators/expected-files.mjs +1 -1
- package/dist/manifest/validators/expected-files.mjs.map +1 -1
- package/dist/manifest/validators/icon-declared.cjs +1 -1
- package/dist/manifest/validators/icon-declared.cjs.map +1 -1
- package/dist/manifest/validators/icon-declared.d.cts.map +1 -1
- package/dist/manifest/validators/icon-declared.d.mts.map +1 -1
- package/dist/manifest/validators/icon-declared.mjs +1 -1
- package/dist/manifest/validators/icon-declared.mjs.map +1 -1
- package/dist/manifest/validators/icon-dimensions.cjs +1 -1
- package/dist/manifest/validators/icon-dimensions.cjs.map +1 -1
- package/dist/manifest/validators/icon-dimensions.d.cts.map +1 -1
- package/dist/manifest/validators/icon-dimensions.d.mts.map +1 -1
- package/dist/manifest/validators/icon-dimensions.mjs +1 -1
- package/dist/manifest/validators/icon-dimensions.mjs.map +1 -1
- package/dist/manifest/validators/icon-missing.cjs +1 -1
- package/dist/manifest/validators/icon-missing.cjs.map +1 -1
- package/dist/manifest/validators/icon-missing.mjs +1 -1
- package/dist/manifest/validators/icon-missing.mjs.map +1 -1
- package/dist/manifest/validators/is-localization-file.cjs +1 -1
- package/dist/manifest/validators/is-localization-file.cjs.map +1 -1
- package/dist/manifest/validators/is-localization-file.d.cts.map +1 -1
- package/dist/manifest/validators/is-localization-file.d.mts.map +1 -1
- package/dist/manifest/validators/is-localization-file.mjs +1 -1
- package/dist/manifest/validators/is-localization-file.mjs.map +1 -1
- package/dist/manifest/validators/is-package-json.cjs +1 -1
- package/dist/manifest/validators/is-package-json.cjs.map +1 -1
- package/dist/manifest/validators/is-package-json.d.cts.map +1 -1
- package/dist/manifest/validators/is-package-json.d.mts.map +1 -1
- package/dist/manifest/validators/is-package-json.mjs +1 -1
- package/dist/manifest/validators/is-package-json.mjs.map +1 -1
- package/dist/manifest/validators/is-snap-icon.cjs +1 -1
- package/dist/manifest/validators/is-snap-icon.cjs.map +1 -1
- package/dist/manifest/validators/is-snap-icon.mjs +1 -1
- package/dist/manifest/validators/is-snap-icon.mjs.map +1 -1
- package/dist/manifest/validators/is-snap-manifest.cjs +1 -1
- package/dist/manifest/validators/is-snap-manifest.cjs.map +1 -1
- package/dist/manifest/validators/is-snap-manifest.d.cts.map +1 -1
- package/dist/manifest/validators/is-snap-manifest.d.mts.map +1 -1
- package/dist/manifest/validators/is-snap-manifest.mjs +1 -1
- package/dist/manifest/validators/is-snap-manifest.mjs.map +1 -1
- package/dist/manifest/validators/manifest-localization.cjs +1 -1
- package/dist/manifest/validators/manifest-localization.cjs.map +1 -1
- package/dist/manifest/validators/manifest-localization.d.cts.map +1 -1
- package/dist/manifest/validators/manifest-localization.d.mts.map +1 -1
- package/dist/manifest/validators/manifest-localization.mjs +1 -1
- package/dist/manifest/validators/manifest-localization.mjs.map +1 -1
- package/dist/manifest/validators/package-json-recommended-fields.cjs +1 -1
- package/dist/manifest/validators/package-json-recommended-fields.cjs.map +1 -1
- package/dist/manifest/validators/package-json-recommended-fields.d.cts.map +1 -1
- package/dist/manifest/validators/package-json-recommended-fields.d.mts.map +1 -1
- package/dist/manifest/validators/package-json-recommended-fields.mjs +1 -1
- package/dist/manifest/validators/package-json-recommended-fields.mjs.map +1 -1
- package/dist/manifest/validators/package-name-match.cjs +1 -1
- package/dist/manifest/validators/package-name-match.cjs.map +1 -1
- package/dist/manifest/validators/package-name-match.d.cts.map +1 -1
- package/dist/manifest/validators/package-name-match.d.mts.map +1 -1
- package/dist/manifest/validators/package-name-match.mjs +1 -1
- package/dist/manifest/validators/package-name-match.mjs.map +1 -1
- package/dist/manifest/validators/platform-version.cjs +2 -2
- package/dist/manifest/validators/platform-version.cjs.map +1 -1
- package/dist/manifest/validators/platform-version.d.cts.map +1 -1
- package/dist/manifest/validators/platform-version.d.mts.map +1 -1
- package/dist/manifest/validators/platform-version.mjs +2 -2
- package/dist/manifest/validators/platform-version.mjs.map +1 -1
- package/dist/manifest/validators/production-platform-version.cjs +1 -1
- package/dist/manifest/validators/production-platform-version.cjs.map +1 -1
- package/dist/manifest/validators/production-platform-version.d.cts.map +1 -1
- package/dist/manifest/validators/production-platform-version.d.mts.map +1 -1
- package/dist/manifest/validators/production-platform-version.mjs +1 -1
- package/dist/manifest/validators/production-platform-version.mjs.map +1 -1
- package/dist/manifest/validators/repository-match.cjs +1 -1
- package/dist/manifest/validators/repository-match.cjs.map +1 -1
- package/dist/manifest/validators/repository-match.d.cts.map +1 -1
- package/dist/manifest/validators/repository-match.d.mts.map +1 -1
- package/dist/manifest/validators/repository-match.mjs +1 -1
- package/dist/manifest/validators/repository-match.mjs.map +1 -1
- package/dist/manifest/validators/unused-exports.cjs +2 -2
- package/dist/manifest/validators/unused-exports.cjs.map +1 -1
- package/dist/manifest/validators/unused-exports.d.cts.map +1 -1
- package/dist/manifest/validators/unused-exports.d.mts.map +1 -1
- package/dist/manifest/validators/unused-exports.mjs +2 -2
- package/dist/manifest/validators/unused-exports.mjs.map +1 -1
- package/dist/manifest/validators/version-match.cjs +1 -1
- package/dist/manifest/validators/version-match.cjs.map +1 -1
- package/dist/manifest/validators/version-match.d.cts.map +1 -1
- package/dist/manifest/validators/version-match.d.mts.map +1 -1
- package/dist/manifest/validators/version-match.mjs +1 -1
- package/dist/manifest/validators/version-match.mjs.map +1 -1
- package/dist/platform-version.cjs.map +1 -1
- package/dist/platform-version.d.cts +2 -1
- package/dist/platform-version.d.cts.map +1 -1
- package/dist/platform-version.d.mts +2 -1
- package/dist/platform-version.d.mts.map +1 -1
- package/dist/platform-version.mjs.map +1 -1
- package/dist/snaps.cjs.map +1 -1
- package/dist/snaps.d.cts +6 -2
- package/dist/snaps.d.cts.map +1 -1
- package/dist/snaps.d.mts +6 -2
- package/dist/snaps.d.mts.map +1 -1
- package/dist/snaps.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -13,7 +13,7 @@ exports.checksum = {
|
|
|
13
13
|
const gotChecksum = files.manifest.result.source.shasum;
|
|
14
14
|
const expectedChecksum = await (0, snaps_1.getSnapChecksum)(fetchedFiles);
|
|
15
15
|
if (gotChecksum !== expectedChecksum) {
|
|
16
|
-
context.report(`"${types_1.NpmSnapFileNames.Manifest}" "shasum" field does not match computed shasum. Got "${gotChecksum}", expected "${expectedChecksum}".`, async ({ manifest }) => {
|
|
16
|
+
context.report('checksum', `"${types_1.NpmSnapFileNames.Manifest}" "shasum" field does not match computed shasum. Got "${gotChecksum}", expected "${expectedChecksum}".`, async ({ manifest }) => {
|
|
17
17
|
manifest.source.shasum = expectedChecksum;
|
|
18
18
|
return { manifest };
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/checksum.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,2CAA+C;AAG/C;;GAEG;AACU,QAAA,QAAQ,GAAkB;IACrC,QAAQ,EAAE,OAAO;IACjB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO;QAChC,MAAM,YAAY,GAAqB,KAAK,CAAC;QAC7C,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QACxD,MAAM,gBAAgB,GAAG,MAAM,IAAA,uBAAe,EAAC,YAAY,CAAC,CAAC;QAC7D,IAAI,WAAW,KAAK,gBAAgB,EAAE,CAAC;YACrC,OAAO,CAAC,MAAM,CACZ,IAAI,wBAAgB,CAAC,QAAQ,yDAAyD,WAAW,gBAAgB,gBAAgB,IAAI,EACrI,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;gBACrB,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC;gBAC1C,OAAO,EAAE,QAAQ,EAAE,CAAC;YACtB,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getSnapChecksum } from '../../snaps';\nimport type { FetchedSnapFiles } from '../../types';\nimport { NpmSnapFileNames } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Check if the checksum in manifest matches computed value.\n */\nexport const checksum: ValidatorMeta = {\n severity: 'error',\n async semanticCheck(files, context) {\n const fetchedFiles: FetchedSnapFiles = files;\n const gotChecksum = files.manifest.result.source.shasum;\n const expectedChecksum = await getSnapChecksum(fetchedFiles);\n if (gotChecksum !== expectedChecksum) {\n context.report(\n `\"${NpmSnapFileNames.Manifest}\" \"shasum\" field does not match computed shasum. Got \"${gotChecksum}\", expected \"${expectedChecksum}\".`,\n async ({ manifest }) => {\n manifest.source.shasum = expectedChecksum;\n return { manifest };\n },\n );\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"checksum.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/checksum.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,2CAA+C;AAG/C;;GAEG;AACU,QAAA,QAAQ,GAAkB;IACrC,QAAQ,EAAE,OAAO;IACjB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO;QAChC,MAAM,YAAY,GAAqB,KAAK,CAAC;QAC7C,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QACxD,MAAM,gBAAgB,GAAG,MAAM,IAAA,uBAAe,EAAC,YAAY,CAAC,CAAC;QAC7D,IAAI,WAAW,KAAK,gBAAgB,EAAE,CAAC;YACrC,OAAO,CAAC,MAAM,CACZ,UAAU,EACV,IAAI,wBAAgB,CAAC,QAAQ,yDAAyD,WAAW,gBAAgB,gBAAgB,IAAI,EACrI,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;gBACrB,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC;gBAC1C,OAAO,EAAE,QAAQ,EAAE,CAAC;YACtB,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getSnapChecksum } from '../../snaps';\nimport type { FetchedSnapFiles } from '../../types';\nimport { NpmSnapFileNames } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Check if the checksum in manifest matches computed value.\n */\nexport const checksum: ValidatorMeta = {\n severity: 'error',\n async semanticCheck(files, context) {\n const fetchedFiles: FetchedSnapFiles = files;\n const gotChecksum = files.manifest.result.source.shasum;\n const expectedChecksum = await getSnapChecksum(fetchedFiles);\n if (gotChecksum !== expectedChecksum) {\n context.report(\n 'checksum',\n `\"${NpmSnapFileNames.Manifest}\" \"shasum\" field does not match computed shasum. Got \"${gotChecksum}\", expected \"${expectedChecksum}\".`,\n async ({ manifest }) => {\n manifest.source.shasum = expectedChecksum;\n return { manifest };\n },\n );\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/checksum.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"checksum.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/checksum.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,aAiBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/checksum.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"checksum.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/checksum.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,aAiBtB,CAAC"}
|
|
@@ -10,7 +10,7 @@ export const checksum = {
|
|
|
10
10
|
const gotChecksum = files.manifest.result.source.shasum;
|
|
11
11
|
const expectedChecksum = await getSnapChecksum(fetchedFiles);
|
|
12
12
|
if (gotChecksum !== expectedChecksum) {
|
|
13
|
-
context.report(`"${NpmSnapFileNames.Manifest}" "shasum" field does not match computed shasum. Got "${gotChecksum}", expected "${expectedChecksum}".`, async ({ manifest }) => {
|
|
13
|
+
context.report('checksum', `"${NpmSnapFileNames.Manifest}" "shasum" field does not match computed shasum. Got "${gotChecksum}", expected "${expectedChecksum}".`, async ({ manifest }) => {
|
|
14
14
|
manifest.source.shasum = expectedChecksum;
|
|
15
15
|
return { manifest };
|
|
16
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/checksum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,wBAAoB;AAE9C,OAAO,EAAE,gBAAgB,EAAE,wBAAoB;AAG/C;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,QAAQ,EAAE,OAAO;IACjB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO;QAChC,MAAM,YAAY,GAAqB,KAAK,CAAC;QAC7C,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QACxD,MAAM,gBAAgB,GAAG,MAAM,eAAe,CAAC,YAAY,CAAC,CAAC;QAC7D,IAAI,WAAW,KAAK,gBAAgB,EAAE,CAAC;YACrC,OAAO,CAAC,MAAM,CACZ,IAAI,gBAAgB,CAAC,QAAQ,yDAAyD,WAAW,gBAAgB,gBAAgB,IAAI,EACrI,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;gBACrB,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC;gBAC1C,OAAO,EAAE,QAAQ,EAAE,CAAC;YACtB,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getSnapChecksum } from '../../snaps';\nimport type { FetchedSnapFiles } from '../../types';\nimport { NpmSnapFileNames } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Check if the checksum in manifest matches computed value.\n */\nexport const checksum: ValidatorMeta = {\n severity: 'error',\n async semanticCheck(files, context) {\n const fetchedFiles: FetchedSnapFiles = files;\n const gotChecksum = files.manifest.result.source.shasum;\n const expectedChecksum = await getSnapChecksum(fetchedFiles);\n if (gotChecksum !== expectedChecksum) {\n context.report(\n `\"${NpmSnapFileNames.Manifest}\" \"shasum\" field does not match computed shasum. Got \"${gotChecksum}\", expected \"${expectedChecksum}\".`,\n async ({ manifest }) => {\n manifest.source.shasum = expectedChecksum;\n return { manifest };\n },\n );\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"checksum.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/checksum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,wBAAoB;AAE9C,OAAO,EAAE,gBAAgB,EAAE,wBAAoB;AAG/C;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAkB;IACrC,QAAQ,EAAE,OAAO;IACjB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO;QAChC,MAAM,YAAY,GAAqB,KAAK,CAAC;QAC7C,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QACxD,MAAM,gBAAgB,GAAG,MAAM,eAAe,CAAC,YAAY,CAAC,CAAC;QAC7D,IAAI,WAAW,KAAK,gBAAgB,EAAE,CAAC;YACrC,OAAO,CAAC,MAAM,CACZ,UAAU,EACV,IAAI,gBAAgB,CAAC,QAAQ,yDAAyD,WAAW,gBAAgB,gBAAgB,IAAI,EACrI,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;gBACrB,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC;gBAC1C,OAAO,EAAE,QAAQ,EAAE,CAAC;YACtB,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getSnapChecksum } from '../../snaps';\nimport type { FetchedSnapFiles } from '../../types';\nimport { NpmSnapFileNames } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Check if the checksum in manifest matches computed value.\n */\nexport const checksum: ValidatorMeta = {\n severity: 'error',\n async semanticCheck(files, context) {\n const fetchedFiles: FetchedSnapFiles = files;\n const gotChecksum = files.manifest.result.source.shasum;\n const expectedChecksum = await getSnapChecksum(fetchedFiles);\n if (gotChecksum !== expectedChecksum) {\n context.report(\n 'checksum',\n `\"${NpmSnapFileNames.Manifest}\" \"shasum\" field does not match computed shasum. Got \"${gotChecksum}\", expected \"${expectedChecksum}\".`,\n async ({ manifest }) => {\n manifest.source.shasum = expectedChecksum;\n return { manifest };\n },\n );\n }\n },\n};\n"]}
|
|
@@ -16,7 +16,7 @@ exports.expectedFiles = {
|
|
|
16
16
|
structureCheck(files, context) {
|
|
17
17
|
for (const expectedFile of EXPECTED_SNAP_FILES) {
|
|
18
18
|
if (!files[expectedFile]) {
|
|
19
|
-
context.report(`Missing file "${SnapFileNameFromKey[expectedFile]}".`);
|
|
19
|
+
context.report(`expected-files-${expectedFile}`, `Missing file "${SnapFileNameFromKey[expectedFile]}".`);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expected-files.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/expected-files.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAG/C,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY,CAAU,CAAC;AAE/E,MAAM,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,wBAAgB,CAAC,QAAQ;IACnC,WAAW,EAAE,wBAAgB,CAAC,WAAW;IACzC,UAAU,EAAE,oBAAoB;CACxB,CAAC;AAEX;;GAEG;AACU,QAAA,aAAa,GAAkB;IAC1C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,KAAK,MAAM,YAAY,IAAI,mBAAmB,EAAE,CAAC;YAC/C,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"expected-files.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/expected-files.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAG/C,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY,CAAU,CAAC;AAE/E,MAAM,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,wBAAgB,CAAC,QAAQ;IACnC,WAAW,EAAE,wBAAgB,CAAC,WAAW;IACzC,UAAU,EAAE,oBAAoB;CACxB,CAAC;AAEX;;GAEG;AACU,QAAA,aAAa,GAAkB;IAC1C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,KAAK,MAAM,YAAY,IAAI,mBAAmB,EAAE,CAAC;YAC/C,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,MAAM,CACZ,kBAAkB,YAAY,EAAE,EAChC,iBAAiB,mBAAmB,CAAC,YAAY,CAAC,IAAI,CACvD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { NpmSnapFileNames } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\nconst EXPECTED_SNAP_FILES = ['manifest', 'packageJson', 'sourceCode'] as const;\n\nconst SnapFileNameFromKey = {\n manifest: NpmSnapFileNames.Manifest,\n packageJson: NpmSnapFileNames.PackageJson,\n sourceCode: 'source code bundle',\n} as const;\n\n/**\n * Check if all the required files are included.\n */\nexport const expectedFiles: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n for (const expectedFile of EXPECTED_SNAP_FILES) {\n if (!files[expectedFile]) {\n context.report(\n `expected-files-${expectedFile}`,\n `Missing file \"${SnapFileNameFromKey[expectedFile]}\".`,\n );\n }\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expected-files.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/expected-files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAUxD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"expected-files.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/expected-files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAUxD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAY3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expected-files.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/expected-files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAUxD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"expected-files.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/expected-files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAUxD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAY3B,CAAC"}
|
|
@@ -13,7 +13,7 @@ export const expectedFiles = {
|
|
|
13
13
|
structureCheck(files, context) {
|
|
14
14
|
for (const expectedFile of EXPECTED_SNAP_FILES) {
|
|
15
15
|
if (!files[expectedFile]) {
|
|
16
|
-
context.report(`Missing file "${SnapFileNameFromKey[expectedFile]}".`);
|
|
16
|
+
context.report(`expected-files-${expectedFile}`, `Missing file "${SnapFileNameFromKey[expectedFile]}".`);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expected-files.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/expected-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,wBAAoB;AAG/C,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY,CAAU,CAAC;AAE/E,MAAM,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;IACnC,WAAW,EAAE,gBAAgB,CAAC,WAAW;IACzC,UAAU,EAAE,oBAAoB;CACxB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,KAAK,MAAM,YAAY,IAAI,mBAAmB,EAAE,CAAC;YAC/C,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"expected-files.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/expected-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,wBAAoB;AAG/C,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY,CAAU,CAAC;AAE/E,MAAM,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;IACnC,WAAW,EAAE,gBAAgB,CAAC,WAAW;IACzC,UAAU,EAAE,oBAAoB;CACxB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,KAAK,MAAM,YAAY,IAAI,mBAAmB,EAAE,CAAC;YAC/C,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,MAAM,CACZ,kBAAkB,YAAY,EAAE,EAChC,iBAAiB,mBAAmB,CAAC,YAAY,CAAC,IAAI,CACvD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { NpmSnapFileNames } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\nconst EXPECTED_SNAP_FILES = ['manifest', 'packageJson', 'sourceCode'] as const;\n\nconst SnapFileNameFromKey = {\n manifest: NpmSnapFileNames.Manifest,\n packageJson: NpmSnapFileNames.PackageJson,\n sourceCode: 'source code bundle',\n} as const;\n\n/**\n * Check if all the required files are included.\n */\nexport const expectedFiles: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n for (const expectedFile of EXPECTED_SNAP_FILES) {\n if (!files[expectedFile]) {\n context.report(\n `expected-files-${expectedFile}`,\n `Missing file \"${SnapFileNameFromKey[expectedFile]}\".`,\n );\n }\n }\n },\n};\n"]}
|
|
@@ -8,7 +8,7 @@ exports.iconDeclared = {
|
|
|
8
8
|
severity: 'warning',
|
|
9
9
|
semanticCheck(files, context) {
|
|
10
10
|
if (!files.manifest.result.source.location.npm.iconPath) {
|
|
11
|
-
context.report('No icon found in the Snap manifest. It is recommended to include an icon for the Snap. See https://docs.metamask.io/snaps/how-to/design-a-snap/#guidelines-at-a-glance for more information.');
|
|
11
|
+
context.report('icon-declared', 'No icon found in the Snap manifest. It is recommended to include an icon for the Snap. See https://docs.metamask.io/snaps/how-to/design-a-snap/#guidelines-at-a-glance for more information.');
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-declared.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-declared.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,YAAY,GAAkB;IACzC,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YACxD,OAAO,CAAC,MAAM,CACZ,8LAA8L,CAC/L,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\n/**\n * Suggest including an icon if not found in manifest.\n */\nexport const iconDeclared: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n if (!files.manifest.result.source.location.npm.iconPath) {\n context.report(\n 'No icon found in the Snap manifest. It is recommended to include an icon for the Snap. See https://docs.metamask.io/snaps/how-to/design-a-snap/#guidelines-at-a-glance for more information.',\n );\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"icon-declared.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-declared.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,YAAY,GAAkB;IACzC,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YACxD,OAAO,CAAC,MAAM,CACZ,eAAe,EACf,8LAA8L,CAC/L,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\n/**\n * Suggest including an icon if not found in manifest.\n */\nexport const iconDeclared: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n if (!files.manifest.result.source.location.npm.iconPath) {\n context.report(\n 'icon-declared',\n 'No icon found in the Snap manifest. It is recommended to include an icon for the Snap. See https://docs.metamask.io/snaps/how-to/design-a-snap/#guidelines-at-a-glance for more information.',\n );\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-declared.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/icon-declared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"icon-declared.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/icon-declared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,aAU1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-declared.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/icon-declared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"icon-declared.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/icon-declared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,aAU1B,CAAC"}
|
|
@@ -5,7 +5,7 @@ export const iconDeclared = {
|
|
|
5
5
|
severity: 'warning',
|
|
6
6
|
semanticCheck(files, context) {
|
|
7
7
|
if (!files.manifest.result.source.location.npm.iconPath) {
|
|
8
|
-
context.report('No icon found in the Snap manifest. It is recommended to include an icon for the Snap. See https://docs.metamask.io/snaps/how-to/design-a-snap/#guidelines-at-a-glance for more information.');
|
|
8
|
+
context.report('icon-declared', 'No icon found in the Snap manifest. It is recommended to include an icon for the Snap. See https://docs.metamask.io/snaps/how-to/design-a-snap/#guidelines-at-a-glance for more information.');
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-declared.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-declared.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YACxD,OAAO,CAAC,MAAM,CACZ,8LAA8L,CAC/L,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\n/**\n * Suggest including an icon if not found in manifest.\n */\nexport const iconDeclared: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n if (!files.manifest.result.source.location.npm.iconPath) {\n context.report(\n 'No icon found in the Snap manifest. It is recommended to include an icon for the Snap. See https://docs.metamask.io/snaps/how-to/design-a-snap/#guidelines-at-a-glance for more information.',\n );\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"icon-declared.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-declared.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YACxD,OAAO,CAAC,MAAM,CACZ,eAAe,EACf,8LAA8L,CAC/L,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\n/**\n * Suggest including an icon if not found in manifest.\n */\nexport const iconDeclared: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n if (!files.manifest.result.source.location.npm.iconPath) {\n context.report(\n 'icon-declared',\n 'No icon found in the Snap manifest. It is recommended to include an icon for the Snap. See https://docs.metamask.io/snaps/how-to/design-a-snap/#guidelines-at-a-glance for more information.',\n );\n }\n },\n};\n"]}
|
|
@@ -13,7 +13,7 @@ exports.iconDimensions = {
|
|
|
13
13
|
}
|
|
14
14
|
const dimensions = (0, icon_1.getSvgDimensions)(files.svgIcon.toString());
|
|
15
15
|
if (dimensions && dimensions?.height !== dimensions.width) {
|
|
16
|
-
context.report('The icon in the Snap manifest is not square. It is recommended to use a square icon for the Snap.');
|
|
16
|
+
context.report('icon-dimensions', 'The icon in the Snap manifest is not square. It is recommended to use a square icon for the Snap.');
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-dimensions.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-dimensions.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAG9C;;GAEG;AACU,QAAA,cAAc,GAAkB;IAC3C,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,MAAM,UAAU,GAAG,IAAA,uBAAgB,EAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9D,IAAI,UAAU,IAAI,UAAU,EAAE,MAAM,KAAK,UAAU,CAAC,KAAK,EAAE,CAAC;YAC1D,OAAO,CAAC,MAAM,CACZ,mGAAmG,CACpG,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getSvgDimensions } from '../../icon';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the icon is square.\n */\nexport const iconDimensions: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n if (!files.svgIcon) {\n return;\n }\n\n const dimensions = getSvgDimensions(files.svgIcon.toString());\n if (dimensions && dimensions?.height !== dimensions.width) {\n context.report(\n 'The icon in the Snap manifest is not square. It is recommended to use a square icon for the Snap.',\n );\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"icon-dimensions.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-dimensions.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAG9C;;GAEG;AACU,QAAA,cAAc,GAAkB;IAC3C,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,MAAM,UAAU,GAAG,IAAA,uBAAgB,EAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9D,IAAI,UAAU,IAAI,UAAU,EAAE,MAAM,KAAK,UAAU,CAAC,KAAK,EAAE,CAAC;YAC1D,OAAO,CAAC,MAAM,CACZ,iBAAiB,EACjB,mGAAmG,CACpG,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getSvgDimensions } from '../../icon';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the icon is square.\n */\nexport const iconDimensions: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n if (!files.svgIcon) {\n return;\n }\n\n const dimensions = getSvgDimensions(files.svgIcon.toString());\n if (dimensions && dimensions?.height !== dimensions.width) {\n context.report(\n 'icon-dimensions',\n 'The icon in the Snap manifest is not square. It is recommended to use a square icon for the Snap.',\n );\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-dimensions.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/icon-dimensions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"icon-dimensions.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/icon-dimensions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,aAe5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-dimensions.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/icon-dimensions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"icon-dimensions.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/icon-dimensions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,aAe5B,CAAC"}
|
|
@@ -10,7 +10,7 @@ export const iconDimensions = {
|
|
|
10
10
|
}
|
|
11
11
|
const dimensions = getSvgDimensions(files.svgIcon.toString());
|
|
12
12
|
if (dimensions && dimensions?.height !== dimensions.width) {
|
|
13
|
-
context.report('The icon in the Snap manifest is not square. It is recommended to use a square icon for the Snap.');
|
|
13
|
+
context.report('icon-dimensions', 'The icon in the Snap manifest is not square. It is recommended to use a square icon for the Snap.');
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-dimensions.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-dimensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,uBAAmB;AAG9C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkB;IAC3C,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,MAAM,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9D,IAAI,UAAU,IAAI,UAAU,EAAE,MAAM,KAAK,UAAU,CAAC,KAAK,EAAE,CAAC;YAC1D,OAAO,CAAC,MAAM,CACZ,mGAAmG,CACpG,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getSvgDimensions } from '../../icon';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the icon is square.\n */\nexport const iconDimensions: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n if (!files.svgIcon) {\n return;\n }\n\n const dimensions = getSvgDimensions(files.svgIcon.toString());\n if (dimensions && dimensions?.height !== dimensions.width) {\n context.report(\n 'The icon in the Snap manifest is not square. It is recommended to use a square icon for the Snap.',\n );\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"icon-dimensions.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-dimensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,uBAAmB;AAG9C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkB;IAC3C,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,MAAM,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9D,IAAI,UAAU,IAAI,UAAU,EAAE,MAAM,KAAK,UAAU,CAAC,KAAK,EAAE,CAAC;YAC1D,OAAO,CAAC,MAAM,CACZ,iBAAiB,EACjB,mGAAmG,CACpG,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getSvgDimensions } from '../../icon';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the icon is square.\n */\nexport const iconDimensions: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n if (!files.svgIcon) {\n return;\n }\n\n const dimensions = getSvgDimensions(files.svgIcon.toString());\n if (dimensions && dimensions?.height !== dimensions.width) {\n context.report(\n 'icon-dimensions',\n 'The icon in the Snap manifest is not square. It is recommended to use a square icon for the Snap.',\n );\n }\n },\n};\n"]}
|
|
@@ -9,7 +9,7 @@ exports.iconMissing = {
|
|
|
9
9
|
semanticCheck(files, context) {
|
|
10
10
|
const { iconPath } = files.manifest.result.source.location.npm;
|
|
11
11
|
if (iconPath && !files.svgIcon) {
|
|
12
|
-
context.report(`Could not find icon "${iconPath}".`);
|
|
12
|
+
context.report('icon-missing', `Could not find icon "${iconPath}".`);
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-missing.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-missing.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,WAAW,GAAkB;IACxC,QAAQ,EAAE,OAAO;IACjB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC/D,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,wBAAwB,QAAQ,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-missing.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-missing.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,WAAW,GAAkB;IACxC,QAAQ,EAAE,OAAO;IACjB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC/D,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,wBAAwB,QAAQ,IAAI,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\n/**\n * Check if declared icon exists on filesystem.\n */\nexport const iconMissing: ValidatorMeta = {\n severity: 'error',\n semanticCheck(files, context) {\n const { iconPath } = files.manifest.result.source.location.npm;\n if (iconPath && !files.svgIcon) {\n context.report('icon-missing', `Could not find icon \"${iconPath}\".`);\n }\n },\n};\n"]}
|
|
@@ -6,7 +6,7 @@ export const iconMissing = {
|
|
|
6
6
|
semanticCheck(files, context) {
|
|
7
7
|
const { iconPath } = files.manifest.result.source.location.npm;
|
|
8
8
|
if (iconPath && !files.svgIcon) {
|
|
9
|
-
context.report(`Could not find icon "${iconPath}".`);
|
|
9
|
+
context.report('icon-missing', `Could not find icon "${iconPath}".`);
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-missing.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-missing.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAkB;IACxC,QAAQ,EAAE,OAAO;IACjB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC/D,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,wBAAwB,QAAQ,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-missing.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/icon-missing.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAkB;IACxC,QAAQ,EAAE,OAAO;IACjB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC/D,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,wBAAwB,QAAQ,IAAI,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\n/**\n * Check if declared icon exists on filesystem.\n */\nexport const iconMissing: ValidatorMeta = {\n severity: 'error',\n semanticCheck(files, context) {\n const { iconPath } = files.manifest.result.source.location.npm;\n if (iconPath && !files.svgIcon) {\n context.report('icon-missing', `Could not find icon \"${iconPath}\".`);\n }\n },\n};\n"]}
|
|
@@ -14,7 +14,7 @@ exports.isLocalizationFile = {
|
|
|
14
14
|
const [error] = (0, superstruct_1.validate)(file.result, localization_1.LocalizationFileStruct);
|
|
15
15
|
if (error) {
|
|
16
16
|
for (const failure of error.failures()) {
|
|
17
|
-
context.report(`Failed to validate localization file "${file.path}": ${(0, structs_1.getStructFailureMessage)(localization_1.LocalizationFileStruct, failure, false)}`);
|
|
17
|
+
context.report(`is-localization-file-${file.path}-${failure.type}-${failure.path.join('-')}`, `Failed to validate localization file "${file.path}": ${(0, structs_1.getStructFailureMessage)(localization_1.LocalizationFileStruct, failure, false)}`);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-localization-file.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-localization-file.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEjD,yDAA4D;AAC5D,+CAAwD;AAGxD;;GAEG;AACU,QAAA,kBAAkB,GAAkB;IAC/C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC3C,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,sBAAQ,EAAC,IAAI,CAAC,MAAM,EAAE,qCAAsB,CAAC,CAAC;YAE9D,IAAI,KAAK,EAAE,CAAC;gBACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;oBACvC,OAAO,CAAC,MAAM,CACZ,yCACE,IAAI,CAAC,IACP,MAAM,IAAA,iCAAuB,EAC3B,qCAAsB,EACtB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { LocalizationFileStruct } from '../../localization';\nimport { getStructFailureMessage } from '../../structs';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of localization files.\n */\nexport const isLocalizationFile: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n for (const file of files.localizationFiles) {\n const [error] = validate(file.result, LocalizationFileStruct);\n\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `Failed to validate localization file \"${\n file.path\n }\": ${getStructFailureMessage(\n LocalizationFileStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"is-localization-file.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-localization-file.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEjD,yDAA4D;AAC5D,+CAAwD;AAGxD;;GAEG;AACU,QAAA,kBAAkB,GAAkB;IAC/C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC3C,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,sBAAQ,EAAC,IAAI,CAAC,MAAM,EAAE,qCAAsB,CAAC,CAAC;YAE9D,IAAI,KAAK,EAAE,CAAC;gBACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;oBACvC,OAAO,CAAC,MAAM,CACZ,wBAAwB,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAC7E,yCACE,IAAI,CAAC,IACP,MAAM,IAAA,iCAAuB,EAC3B,qCAAsB,EACtB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { LocalizationFileStruct } from '../../localization';\nimport { getStructFailureMessage } from '../../structs';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of localization files.\n */\nexport const isLocalizationFile: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n for (const file of files.localizationFiles) {\n const [error] = validate(file.result, LocalizationFileStruct);\n\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `is-localization-file-${file.path}-${failure.type}-${failure.path.join('-')}`,\n `Failed to validate localization file \"${\n file.path\n }\": ${getStructFailureMessage(\n LocalizationFileStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-localization-file.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/is-localization-file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"is-localization-file.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/is-localization-file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,aAsBhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-localization-file.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/is-localization-file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"is-localization-file.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/is-localization-file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,aAsBhC,CAAC"}
|
|
@@ -11,7 +11,7 @@ export const isLocalizationFile = {
|
|
|
11
11
|
const [error] = validate(file.result, LocalizationFileStruct);
|
|
12
12
|
if (error) {
|
|
13
13
|
for (const failure of error.failures()) {
|
|
14
|
-
context.report(`Failed to validate localization file "${file.path}": ${getStructFailureMessage(LocalizationFileStruct, failure, false)}`);
|
|
14
|
+
context.report(`is-localization-file-${file.path}-${failure.type}-${failure.path.join('-')}`, `Failed to validate localization file "${file.path}": ${getStructFailureMessage(LocalizationFileStruct, failure, false)}`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-localization-file.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-localization-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAEjD,OAAO,EAAE,sBAAsB,EAAE,+BAA2B;AAC5D,OAAO,EAAE,uBAAuB,EAAE,0BAAsB;AAGxD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAkB;IAC/C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC3C,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;YAE9D,IAAI,KAAK,EAAE,CAAC;gBACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;oBACvC,OAAO,CAAC,MAAM,CACZ,yCACE,IAAI,CAAC,IACP,MAAM,uBAAuB,CAC3B,sBAAsB,EACtB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { LocalizationFileStruct } from '../../localization';\nimport { getStructFailureMessage } from '../../structs';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of localization files.\n */\nexport const isLocalizationFile: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n for (const file of files.localizationFiles) {\n const [error] = validate(file.result, LocalizationFileStruct);\n\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `Failed to validate localization file \"${\n file.path\n }\": ${getStructFailureMessage(\n LocalizationFileStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"is-localization-file.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-localization-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAEjD,OAAO,EAAE,sBAAsB,EAAE,+BAA2B;AAC5D,OAAO,EAAE,uBAAuB,EAAE,0BAAsB;AAGxD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAkB;IAC/C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC3C,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;YAE9D,IAAI,KAAK,EAAE,CAAC;gBACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;oBACvC,OAAO,CAAC,MAAM,CACZ,wBAAwB,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAC7E,yCACE,IAAI,CAAC,IACP,MAAM,uBAAuB,CAC3B,sBAAsB,EACtB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { LocalizationFileStruct } from '../../localization';\nimport { getStructFailureMessage } from '../../structs';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of localization files.\n */\nexport const isLocalizationFile: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n for (const file of files.localizationFiles) {\n const [error] = validate(file.result, LocalizationFileStruct);\n\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `is-localization-file-${file.path}-${failure.type}-${failure.path.join('-')}`,\n `Failed to validate localization file \"${\n file.path\n }\": ${getStructFailureMessage(\n LocalizationFileStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n }\n },\n};\n"]}
|
|
@@ -16,7 +16,7 @@ exports.isPackageJson = {
|
|
|
16
16
|
const [error] = (0, superstruct_1.validate)(files.packageJson.result, types_1.NpmSnapPackageJsonStruct);
|
|
17
17
|
if (error) {
|
|
18
18
|
for (const failure of error.failures()) {
|
|
19
|
-
context.report(`"${types_1.NpmSnapFileNames.PackageJson}" is invalid: ${(0, structs_1.getStructFailureMessage)(types_1.NpmSnapPackageJsonStruct, failure, false)}`);
|
|
19
|
+
context.report(`is-package-json-${failure.type}-${failure.path.join('-')}`, `"${types_1.NpmSnapFileNames.PackageJson}" is invalid: ${(0, structs_1.getStructFailureMessage)(types_1.NpmSnapPackageJsonStruct, failure, false)}`);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-package-json.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-package-json.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEjD,+CAAwD;AACxD,2CAAyE;AAGzE;;GAEG;AACU,QAAA,aAAa,GAAkB;IAC1C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,sBAAQ,EACtB,KAAK,CAAC,WAAW,CAAC,MAAM,EACxB,gCAAwB,CACzB,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACvC,OAAO,CAAC,MAAM,CACZ,IACE,wBAAgB,CAAC,WACnB,iBAAiB,IAAA,iCAAuB,EACtC,gCAAwB,EACxB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { getStructFailureMessage } from '../../structs';\nimport { NpmSnapFileNames, NpmSnapPackageJsonStruct } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of package.json.\n */\nexport const isPackageJson: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.packageJson) {\n return;\n }\n const [error] = validate(\n files.packageJson.result,\n NpmSnapPackageJsonStruct,\n );\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `\"${\n NpmSnapFileNames.PackageJson\n }\" is invalid: ${getStructFailureMessage(\n NpmSnapPackageJsonStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"is-package-json.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-package-json.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEjD,+CAAwD;AACxD,2CAAyE;AAGzE;;GAEG;AACU,QAAA,aAAa,GAAkB;IAC1C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,sBAAQ,EACtB,KAAK,CAAC,WAAW,CAAC,MAAM,EACxB,gCAAwB,CACzB,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACvC,OAAO,CAAC,MAAM,CACZ,mBAAmB,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAC3D,IACE,wBAAgB,CAAC,WACnB,iBAAiB,IAAA,iCAAuB,EACtC,gCAAwB,EACxB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { getStructFailureMessage } from '../../structs';\nimport { NpmSnapFileNames, NpmSnapPackageJsonStruct } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of package.json.\n */\nexport const isPackageJson: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.packageJson) {\n return;\n }\n const [error] = validate(\n files.packageJson.result,\n NpmSnapPackageJsonStruct,\n );\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `is-package-json-${failure.type}-${failure.path.join('-')}`,\n `\"${\n NpmSnapFileNames.PackageJson\n }\" is invalid: ${getStructFailureMessage(\n NpmSnapPackageJsonStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-package-json.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/is-package-json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"is-package-json.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/is-package-json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAyB3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-package-json.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/is-package-json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"is-package-json.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/is-package-json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAyB3B,CAAC"}
|
|
@@ -13,7 +13,7 @@ export const isPackageJson = {
|
|
|
13
13
|
const [error] = validate(files.packageJson.result, NpmSnapPackageJsonStruct);
|
|
14
14
|
if (error) {
|
|
15
15
|
for (const failure of error.failures()) {
|
|
16
|
-
context.report(`"${NpmSnapFileNames.PackageJson}" is invalid: ${getStructFailureMessage(NpmSnapPackageJsonStruct, failure, false)}`);
|
|
16
|
+
context.report(`is-package-json-${failure.type}-${failure.path.join('-')}`, `"${NpmSnapFileNames.PackageJson}" is invalid: ${getStructFailureMessage(NpmSnapPackageJsonStruct, failure, false)}`);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-package-json.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-package-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAEjD,OAAO,EAAE,uBAAuB,EAAE,0BAAsB;AACxD,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,wBAAoB;AAGzE;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CACtB,KAAK,CAAC,WAAW,CAAC,MAAM,EACxB,wBAAwB,CACzB,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACvC,OAAO,CAAC,MAAM,CACZ,IACE,gBAAgB,CAAC,WACnB,iBAAiB,uBAAuB,CACtC,wBAAwB,EACxB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { getStructFailureMessage } from '../../structs';\nimport { NpmSnapFileNames, NpmSnapPackageJsonStruct } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of package.json.\n */\nexport const isPackageJson: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.packageJson) {\n return;\n }\n const [error] = validate(\n files.packageJson.result,\n NpmSnapPackageJsonStruct,\n );\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `\"${\n NpmSnapFileNames.PackageJson\n }\" is invalid: ${getStructFailureMessage(\n NpmSnapPackageJsonStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"is-package-json.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-package-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAEjD,OAAO,EAAE,uBAAuB,EAAE,0BAAsB;AACxD,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,wBAAoB;AAGzE;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CACtB,KAAK,CAAC,WAAW,CAAC,MAAM,EACxB,wBAAwB,CACzB,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACvC,OAAO,CAAC,MAAM,CACZ,mBAAmB,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAC3D,IACE,gBAAgB,CAAC,WACnB,iBAAiB,uBAAuB,CACtC,wBAAwB,EACxB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { getStructFailureMessage } from '../../structs';\nimport { NpmSnapFileNames, NpmSnapPackageJsonStruct } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of package.json.\n */\nexport const isPackageJson: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.packageJson) {\n return;\n }\n const [error] = validate(\n files.packageJson.result,\n NpmSnapPackageJsonStruct,\n );\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `is-package-json-${failure.type}-${failure.path.join('-')}`,\n `\"${\n NpmSnapFileNames.PackageJson\n }\" is invalid: ${getStructFailureMessage(\n NpmSnapPackageJsonStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-snap-icon.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-icon.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAEzC,yCAA8C;AAG9C;;GAEG;AACU,QAAA,UAAU,GAAkB;IACvC,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,IAAA,uBAAgB,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAA,cAAM,EAAC,KAAK,YAAY,KAAK,CAAC,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"is-snap-icon.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-icon.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAEzC,yCAA8C;AAG9C;;GAEG;AACU,QAAA,UAAU,GAAkB;IACvC,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,IAAA,uBAAgB,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAA,cAAM,EAAC,KAAK,YAAY,KAAK,CAAC,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { assert } from '@metamask/utils';\n\nimport { assertIsSnapIcon } from '../../icon';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of the snap icon.\n */\nexport const isSnapIcon: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.svgIcon) {\n return;\n }\n\n try {\n assertIsSnapIcon(files.svgIcon);\n } catch (error) {\n assert(error instanceof Error);\n context.report('is-snap-icon', error.message);\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-snap-icon.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,wBAAwB;AAEzC,OAAO,EAAE,gBAAgB,EAAE,uBAAmB;AAG9C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAkB;IACvC,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"is-snap-icon.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,wBAAwB;AAEzC,OAAO,EAAE,gBAAgB,EAAE,uBAAmB;AAG9C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAkB;IACvC,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { assert } from '@metamask/utils';\n\nimport { assertIsSnapIcon } from '../../icon';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of the snap icon.\n */\nexport const isSnapIcon: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.svgIcon) {\n return;\n }\n\n try {\n assertIsSnapIcon(files.svgIcon);\n } catch (error) {\n assert(error instanceof Error);\n context.report('is-snap-icon', error.message);\n }\n },\n};\n"]}
|
|
@@ -17,7 +17,7 @@ exports.isSnapManifest = {
|
|
|
17
17
|
const [error] = (0, superstruct_1.validate)(files.manifest.result, validation_1.SnapManifestStruct);
|
|
18
18
|
if (error) {
|
|
19
19
|
for (const failure of error.failures()) {
|
|
20
|
-
context.report(`"${types_1.NpmSnapFileNames.Manifest}" is invalid: ${(0, structs_1.getStructFailureMessage)(validation_1.SnapManifestStruct, failure, false)}`);
|
|
20
|
+
context.report(`is-snap-manifest-${failure.type}-${failure.path.join('-')}`, `"${types_1.NpmSnapFileNames.Manifest}" is invalid: ${(0, structs_1.getStructFailureMessage)(validation_1.SnapManifestStruct, failure, false)}`);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-snap-manifest.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-manifest.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEjD,+CAAwD;AACxD,2CAA+C;AAC/C,kDAAmD;AAGnD;;GAEG;AACU,QAAA,cAAc,GAAkB;IAC3C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,sBAAQ,EAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,+BAAkB,CAAC,CAAC;QACpE,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACvC,OAAO,CAAC,MAAM,CACZ,IAAI,wBAAgB,CAAC,QAAQ,iBAAiB,IAAA,iCAAuB,EACnE,+BAAkB,EAClB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { getStructFailureMessage } from '../../structs';\nimport { NpmSnapFileNames } from '../../types';\nimport { SnapManifestStruct } from '../validation';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of snap.manifest.json.\n */\nexport const isSnapManifest: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.manifest) {\n return;\n }\n const [error] = validate(files.manifest.result, SnapManifestStruct);\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `\"${NpmSnapFileNames.Manifest}\" is invalid: ${getStructFailureMessage(\n SnapManifestStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"is-snap-manifest.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-manifest.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEjD,+CAAwD;AACxD,2CAA+C;AAC/C,kDAAmD;AAGnD;;GAEG;AACU,QAAA,cAAc,GAAkB;IAC3C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,sBAAQ,EAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,+BAAkB,CAAC,CAAC;QACpE,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACvC,OAAO,CAAC,MAAM,CACZ,oBAAoB,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAC5D,IAAI,wBAAgB,CAAC,QAAQ,iBAAiB,IAAA,iCAAuB,EACnE,+BAAkB,EAClB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { getStructFailureMessage } from '../../structs';\nimport { NpmSnapFileNames } from '../../types';\nimport { SnapManifestStruct } from '../validation';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of snap.manifest.json.\n */\nexport const isSnapManifest: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.manifest) {\n return;\n }\n const [error] = validate(files.manifest.result, SnapManifestStruct);\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `is-snap-manifest-${failure.type}-${failure.path.join('-')}`,\n `\"${NpmSnapFileNames.Manifest}\" is invalid: ${getStructFailureMessage(\n SnapManifestStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-snap-manifest.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-manifest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"is-snap-manifest.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-manifest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,aAoB5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-snap-manifest.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-manifest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"is-snap-manifest.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-manifest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,aAoB5B,CAAC"}
|
|
@@ -14,7 +14,7 @@ export const isSnapManifest = {
|
|
|
14
14
|
const [error] = validate(files.manifest.result, SnapManifestStruct);
|
|
15
15
|
if (error) {
|
|
16
16
|
for (const failure of error.failures()) {
|
|
17
|
-
context.report(`"${NpmSnapFileNames.Manifest}" is invalid: ${getStructFailureMessage(SnapManifestStruct, failure, false)}`);
|
|
17
|
+
context.report(`is-snap-manifest-${failure.type}-${failure.path.join('-')}`, `"${NpmSnapFileNames.Manifest}" is invalid: ${getStructFailureMessage(SnapManifestStruct, failure, false)}`);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-snap-manifest.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAEjD,OAAO,EAAE,uBAAuB,EAAE,0BAAsB;AACxD,OAAO,EAAE,gBAAgB,EAAE,wBAAoB;AAC/C,OAAO,EAAE,kBAAkB,EAAE,0BAAsB;AAGnD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkB;IAC3C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QACpE,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACvC,OAAO,CAAC,MAAM,CACZ,IAAI,gBAAgB,CAAC,QAAQ,iBAAiB,uBAAuB,CACnE,kBAAkB,EAClB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { getStructFailureMessage } from '../../structs';\nimport { NpmSnapFileNames } from '../../types';\nimport { SnapManifestStruct } from '../validation';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of snap.manifest.json.\n */\nexport const isSnapManifest: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.manifest) {\n return;\n }\n const [error] = validate(files.manifest.result, SnapManifestStruct);\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `\"${NpmSnapFileNames.Manifest}\" is invalid: ${getStructFailureMessage(\n SnapManifestStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"is-snap-manifest.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/is-snap-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAEjD,OAAO,EAAE,uBAAuB,EAAE,0BAAsB;AACxD,OAAO,EAAE,gBAAgB,EAAE,wBAAoB;AAC/C,OAAO,EAAE,kBAAkB,EAAE,0BAAsB;AAGnD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkB;IAC3C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QACpE,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACvC,OAAO,CAAC,MAAM,CACZ,oBAAoB,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAC5D,IAAI,gBAAgB,CAAC,QAAQ,iBAAiB,uBAAuB,CACnE,kBAAkB,EAClB,OAAO,EACP,KAAK,CACN,EAAE,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { getStructFailureMessage } from '../../structs';\nimport { NpmSnapFileNames } from '../../types';\nimport { SnapManifestStruct } from '../validation';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of snap.manifest.json.\n */\nexport const isSnapManifest: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.manifest) {\n return;\n }\n const [error] = validate(files.manifest.result, SnapManifestStruct);\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `is-snap-manifest-${failure.type}-${failure.path.join('-')}`,\n `\"${NpmSnapFileNames.Manifest}\" is invalid: ${getStructFailureMessage(\n SnapManifestStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n },\n};\n"]}
|
|
@@ -22,7 +22,7 @@ exports.manifestLocalization = {
|
|
|
22
22
|
(0, localization_1.getLocalizedSnapManifest)(manifest, locale, localizations);
|
|
23
23
|
}
|
|
24
24
|
catch (error) {
|
|
25
|
-
context.report(`Failed to localize Snap manifest: ${(0, snaps_sdk_1.getErrorMessage)(error)}`);
|
|
25
|
+
context.report('manifest-localization', `Failed to localize Snap manifest: ${(0, snaps_sdk_1.getErrorMessage)(error)}`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-localization.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/manifest-localization.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AAGtD,yDAA8D;AAG9D;;GAEG;AACU,QAAA,oBAAoB,GAAkB;IACjD,QAAQ,EAAE,OAAO;IACjB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QACvC,MAAM,aAAa,GAAuB,KAAK,CAAC,iBAAiB,CAAC,GAAG,CACnE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CACtB,CAAC;QACF,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,wDAAwD;YAC9D,GAAG,aAAa;iBACb,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC;iBAC3B,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC;SACvC,CAAC;QAEF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,IAAA,uCAAwB,EAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,MAAM,CACZ,qCAAqC,IAAA,2BAAe,EAAC,KAAK,CAAC,EAAE,CAC9D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getErrorMessage } from '@metamask/snaps-sdk';\n\nimport type { LocalizationFile } from '../../localization';\nimport { getLocalizedSnapManifest } from '../../localization';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify whether the localization files localize the manifest correctly.\n */\nexport const manifestLocalization: ValidatorMeta = {\n severity: 'error',\n semanticCheck(files, context) {\n const manifest = files.manifest.result;\n const localizations: LocalizationFile[] = files.localizationFiles.map(\n (file) => file.result,\n );\n const locales = [\n 'en', // The manifest must be able to be localized in English.\n ...localizations\n .map(({ locale }) => locale)\n .filter((locale) => locale !== 'en'),\n ];\n\n for (const locale of locales) {\n try {\n getLocalizedSnapManifest(manifest, locale, localizations);\n } catch (error) {\n context.report(\n `Failed to localize Snap manifest: ${getErrorMessage(error)}`,\n );\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"manifest-localization.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/manifest-localization.ts"],"names":[],"mappings":";;;AAAA,mDAAsD;AAGtD,yDAA8D;AAG9D;;GAEG;AACU,QAAA,oBAAoB,GAAkB;IACjD,QAAQ,EAAE,OAAO;IACjB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QACvC,MAAM,aAAa,GAAuB,KAAK,CAAC,iBAAiB,CAAC,GAAG,CACnE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CACtB,CAAC;QACF,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,wDAAwD;YAC9D,GAAG,aAAa;iBACb,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC;iBAC3B,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC;SACvC,CAAC;QAEF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,IAAA,uCAAwB,EAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,MAAM,CACZ,uBAAuB,EACvB,qCAAqC,IAAA,2BAAe,EAAC,KAAK,CAAC,EAAE,CAC9D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getErrorMessage } from '@metamask/snaps-sdk';\n\nimport type { LocalizationFile } from '../../localization';\nimport { getLocalizedSnapManifest } from '../../localization';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify whether the localization files localize the manifest correctly.\n */\nexport const manifestLocalization: ValidatorMeta = {\n severity: 'error',\n semanticCheck(files, context) {\n const manifest = files.manifest.result;\n const localizations: LocalizationFile[] = files.localizationFiles.map(\n (file) => file.result,\n );\n const locales = [\n 'en', // The manifest must be able to be localized in English.\n ...localizations\n .map(({ locale }) => locale)\n .filter((locale) => locale !== 'en'),\n ];\n\n for (const locale of locales) {\n try {\n getLocalizedSnapManifest(manifest, locale, localizations);\n } catch (error) {\n context.report(\n 'manifest-localization',\n `Failed to localize Snap manifest: ${getErrorMessage(error)}`,\n );\n }\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-localization.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/manifest-localization.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest-localization.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/manifest-localization.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAyBlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-localization.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/manifest-localization.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest-localization.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/manifest-localization.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAExD;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAyBlC,CAAC"}
|
|
@@ -19,7 +19,7 @@ export const manifestLocalization = {
|
|
|
19
19
|
getLocalizedSnapManifest(manifest, locale, localizations);
|
|
20
20
|
}
|
|
21
21
|
catch (error) {
|
|
22
|
-
context.report(`Failed to localize Snap manifest: ${getErrorMessage(error)}`);
|
|
22
|
+
context.report('manifest-localization', `Failed to localize Snap manifest: ${getErrorMessage(error)}`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-localization.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/manifest-localization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,4BAA4B;AAGtD,OAAO,EAAE,wBAAwB,EAAE,+BAA2B;AAG9D;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAkB;IACjD,QAAQ,EAAE,OAAO;IACjB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QACvC,MAAM,aAAa,GAAuB,KAAK,CAAC,iBAAiB,CAAC,GAAG,CACnE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CACtB,CAAC;QACF,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,wDAAwD;YAC9D,GAAG,aAAa;iBACb,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC;iBAC3B,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC;SACvC,CAAC;QAEF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,MAAM,CACZ,qCAAqC,eAAe,CAAC,KAAK,CAAC,EAAE,CAC9D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getErrorMessage } from '@metamask/snaps-sdk';\n\nimport type { LocalizationFile } from '../../localization';\nimport { getLocalizedSnapManifest } from '../../localization';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify whether the localization files localize the manifest correctly.\n */\nexport const manifestLocalization: ValidatorMeta = {\n severity: 'error',\n semanticCheck(files, context) {\n const manifest = files.manifest.result;\n const localizations: LocalizationFile[] = files.localizationFiles.map(\n (file) => file.result,\n );\n const locales = [\n 'en', // The manifest must be able to be localized in English.\n ...localizations\n .map(({ locale }) => locale)\n .filter((locale) => locale !== 'en'),\n ];\n\n for (const locale of locales) {\n try {\n getLocalizedSnapManifest(manifest, locale, localizations);\n } catch (error) {\n context.report(\n `Failed to localize Snap manifest: ${getErrorMessage(error)}`,\n );\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"manifest-localization.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/manifest-localization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,4BAA4B;AAGtD,OAAO,EAAE,wBAAwB,EAAE,+BAA2B;AAG9D;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAkB;IACjD,QAAQ,EAAE,OAAO;IACjB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QACvC,MAAM,aAAa,GAAuB,KAAK,CAAC,iBAAiB,CAAC,GAAG,CACnE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CACtB,CAAC;QACF,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,wDAAwD;YAC9D,GAAG,aAAa;iBACb,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC;iBAC3B,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC;SACvC,CAAC;QAEF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,MAAM,CACZ,uBAAuB,EACvB,qCAAqC,eAAe,CAAC,KAAK,CAAC,EAAE,CAC9D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { getErrorMessage } from '@metamask/snaps-sdk';\n\nimport type { LocalizationFile } from '../../localization';\nimport { getLocalizedSnapManifest } from '../../localization';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify whether the localization files localize the manifest correctly.\n */\nexport const manifestLocalization: ValidatorMeta = {\n severity: 'error',\n semanticCheck(files, context) {\n const manifest = files.manifest.result;\n const localizations: LocalizationFile[] = files.localizationFiles.map(\n (file) => file.result,\n );\n const locales = [\n 'en', // The manifest must be able to be localized in English.\n ...localizations\n .map(({ locale }) => locale)\n .filter((locale) => locale !== 'en'),\n ];\n\n for (const locale of locales) {\n try {\n getLocalizedSnapManifest(manifest, locale, localizations);\n } catch (error) {\n context.report(\n 'manifest-localization',\n `Failed to localize Snap manifest: ${getErrorMessage(error)}`,\n );\n }\n }\n },\n};\n"]}
|
|
@@ -10,7 +10,7 @@ exports.packageJsonRecommendedFields = {
|
|
|
10
10
|
semanticCheck(files, context) {
|
|
11
11
|
for (const recommendedField of RECOMMENDED_FIELDS) {
|
|
12
12
|
if (!files.packageJson.result[recommendedField]) {
|
|
13
|
-
context.report(`Missing recommended package.json property: "${recommendedField}".`);
|
|
13
|
+
context.report(`package-json-recommended-fields-${recommendedField}`, `Missing recommended package.json property: "${recommendedField}".`);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json-recommended-fields.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/package-json-recommended-fields.ts"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG,CAAC,YAAY,CAAU,CAAC;AAEnD;;GAEG;AACU,QAAA,4BAA4B,GAAkB;IACzD,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,KAAK,MAAM,gBAAgB,IAAI,kBAAkB,EAAE,CAAC;YAClD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAChD,OAAO,CAAC,MAAM,CACZ,+CAA+C,gBAAgB,IAAI,CACpE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\nconst RECOMMENDED_FIELDS = ['repository'] as const;\n\n/**\n * Check if package.json contains recommended fields.\n */\nexport const packageJsonRecommendedFields: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n for (const recommendedField of RECOMMENDED_FIELDS) {\n if (!files.packageJson.result[recommendedField]) {\n context.report(\n `Missing recommended package.json property: \"${recommendedField}\".`,\n );\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"package-json-recommended-fields.cjs","sourceRoot":"","sources":["../../../src/manifest/validators/package-json-recommended-fields.ts"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG,CAAC,YAAY,CAAU,CAAC;AAEnD;;GAEG;AACU,QAAA,4BAA4B,GAAkB;IACzD,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,KAAK,MAAM,gBAAgB,IAAI,kBAAkB,EAAE,CAAC;YAClD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAChD,OAAO,CAAC,MAAM,CACZ,mCAAmC,gBAAgB,EAAE,EACrD,+CAA+C,gBAAgB,IAAI,CACpE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\nconst RECOMMENDED_FIELDS = ['repository'] as const;\n\n/**\n * Check if package.json contains recommended fields.\n */\nexport const packageJsonRecommendedFields: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n for (const recommendedField of RECOMMENDED_FIELDS) {\n if (!files.packageJson.result[recommendedField]) {\n context.report(\n `package-json-recommended-fields-${recommendedField}`,\n `Missing recommended package.json property: \"${recommendedField}\".`,\n );\n }\n }\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json-recommended-fields.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/package-json-recommended-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAIxD;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,
|
|
1
|
+
{"version":3,"file":"package-json-recommended-fields.d.cts","sourceRoot":"","sources":["../../../src/manifest/validators/package-json-recommended-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAIxD;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,aAY1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json-recommended-fields.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/package-json-recommended-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAIxD;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,
|
|
1
|
+
{"version":3,"file":"package-json-recommended-fields.d.mts","sourceRoot":"","sources":["../../../src/manifest/validators/package-json-recommended-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA2B;AAIxD;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,aAY1C,CAAC"}
|
|
@@ -7,7 +7,7 @@ export const packageJsonRecommendedFields = {
|
|
|
7
7
|
semanticCheck(files, context) {
|
|
8
8
|
for (const recommendedField of RECOMMENDED_FIELDS) {
|
|
9
9
|
if (!files.packageJson.result[recommendedField]) {
|
|
10
|
-
context.report(`Missing recommended package.json property: "${recommendedField}".`);
|
|
10
|
+
context.report(`package-json-recommended-fields-${recommendedField}`, `Missing recommended package.json property: "${recommendedField}".`);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json-recommended-fields.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/package-json-recommended-fields.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAG,CAAC,YAAY,CAAU,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAkB;IACzD,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,KAAK,MAAM,gBAAgB,IAAI,kBAAkB,EAAE,CAAC;YAClD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAChD,OAAO,CAAC,MAAM,CACZ,+CAA+C,gBAAgB,IAAI,CACpE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\nconst RECOMMENDED_FIELDS = ['repository'] as const;\n\n/**\n * Check if package.json contains recommended fields.\n */\nexport const packageJsonRecommendedFields: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n for (const recommendedField of RECOMMENDED_FIELDS) {\n if (!files.packageJson.result[recommendedField]) {\n context.report(\n `Missing recommended package.json property: \"${recommendedField}\".`,\n );\n }\n }\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"package-json-recommended-fields.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/package-json-recommended-fields.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAG,CAAC,YAAY,CAAU,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAkB;IACzD,QAAQ,EAAE,SAAS;IACnB,aAAa,CAAC,KAAK,EAAE,OAAO;QAC1B,KAAK,MAAM,gBAAgB,IAAI,kBAAkB,EAAE,CAAC;YAClD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAChD,OAAO,CAAC,MAAM,CACZ,mCAAmC,gBAAgB,EAAE,EACrD,+CAA+C,gBAAgB,IAAI,CACpE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { ValidatorMeta } from '../validator-types';\n\nconst RECOMMENDED_FIELDS = ['repository'] as const;\n\n/**\n * Check if package.json contains recommended fields.\n */\nexport const packageJsonRecommendedFields: ValidatorMeta = {\n severity: 'warning',\n semanticCheck(files, context) {\n for (const recommendedField of RECOMMENDED_FIELDS) {\n if (!files.packageJson.result[recommendedField]) {\n context.report(\n `package-json-recommended-fields-${recommendedField}`,\n `Missing recommended package.json property: \"${recommendedField}\".`,\n );\n }\n }\n },\n};\n"]}
|