@platformos/platformos-check-common 0.0.7 → 0.0.9
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 +16 -0
- package/README.md +4 -4
- package/dist/AugmentedPlatformOSDocset.d.ts +11 -0
- package/dist/AugmentedPlatformOSDocset.js +81 -0
- package/dist/AugmentedPlatformOSDocset.js.map +1 -0
- package/dist/JSONValidator.js +1 -1
- package/dist/JSONValidator.js.map +1 -1
- package/dist/checks/deprecated-filter/index.js +4 -41
- package/dist/checks/deprecated-filter/index.js.map +1 -1
- package/dist/checks/deprecated-tag/index.js +21 -22
- package/dist/checks/deprecated-tag/index.js.map +1 -1
- package/dist/checks/duplicate-function-arguments/index.js +1 -1
- package/dist/checks/duplicate-function-arguments/index.js.map +1 -1
- package/dist/checks/duplicate-render-partial-arguments/index.js +1 -1
- package/dist/checks/duplicate-render-partial-arguments/index.js.map +1 -1
- package/dist/checks/graphql/index.js +1 -1
- package/dist/checks/graphql/index.js.map +1 -1
- package/dist/checks/graphql-variables/index.js +4 -0
- package/dist/checks/graphql-variables/index.js.map +1 -1
- package/dist/checks/img-width-and-height/index.js +1 -1
- package/dist/checks/img-width-and-height/index.js.map +1 -1
- package/dist/checks/index.d.ts +3 -3
- package/dist/checks/index.js +4 -79
- package/dist/checks/index.js.map +1 -1
- package/dist/checks/json-syntax-error/index.js +1 -1
- package/dist/checks/json-syntax-error/index.js.map +1 -1
- package/dist/checks/liquid-html-syntax-error/checks/InvalidLoopArguments.js +1 -1
- package/dist/checks/liquid-html-syntax-error/checks/InvalidLoopArguments.js.map +1 -1
- package/dist/checks/liquid-html-syntax-error/checks/InvalidTagSyntax.d.ts +19 -0
- package/dist/checks/liquid-html-syntax-error/checks/InvalidTagSyntax.js +79 -0
- package/dist/checks/liquid-html-syntax-error/checks/InvalidTagSyntax.js.map +1 -0
- package/dist/checks/liquid-html-syntax-error/checks/UnknownTag.d.ts +3 -0
- package/dist/checks/liquid-html-syntax-error/checks/UnknownTag.js +32 -0
- package/dist/checks/liquid-html-syntax-error/checks/UnknownTag.js.map +1 -0
- package/dist/checks/liquid-html-syntax-error/index.js +23 -5
- package/dist/checks/liquid-html-syntax-error/index.js.map +1 -1
- package/dist/checks/matching-translations/index.d.ts +2 -2
- package/dist/checks/matching-translations/index.js +114 -90
- package/dist/checks/matching-translations/index.js.map +1 -1
- package/dist/checks/metadata-params/index.js +6 -3
- package/dist/checks/metadata-params/index.js.map +1 -1
- package/dist/checks/missing-asset/index.js +1 -1
- package/dist/checks/missing-asset/index.js.map +1 -1
- package/dist/checks/missing-partial/index.d.ts +6 -0
- package/dist/checks/missing-partial/index.js +70 -0
- package/dist/checks/missing-partial/index.js.map +1 -0
- package/dist/checks/orphaned-partial/index.js +4 -4
- package/dist/checks/orphaned-partial/index.js.map +1 -1
- package/dist/checks/parser-blocking-script/index.js +10 -36
- package/dist/checks/parser-blocking-script/index.js.map +1 -1
- package/dist/checks/parser-blocking-script/suggestions.d.ts +1 -2
- package/dist/checks/parser-blocking-script/suggestions.js +1 -11
- package/dist/checks/parser-blocking-script/suggestions.js.map +1 -1
- package/dist/checks/reserved-doc-param-names/index.js +6 -5
- package/dist/checks/reserved-doc-param-names/index.js.map +1 -1
- package/dist/checks/translation-key-exists/index.js +1 -1
- package/dist/checks/translation-key-exists/index.js.map +1 -1
- package/dist/checks/unclosed-html-element/index.js +5 -1
- package/dist/checks/unclosed-html-element/index.js.map +1 -1
- package/dist/checks/undefined-object/index.js +13 -31
- package/dist/checks/undefined-object/index.js.map +1 -1
- package/dist/checks/unique-doc-param-names/index.js +1 -1
- package/dist/checks/unique-doc-param-names/index.js.map +1 -1
- package/dist/checks/unknown-filter/index.js +3 -3
- package/dist/checks/unknown-filter/index.js.map +1 -1
- package/dist/checks/unknown-property/index.js +1 -1
- package/dist/checks/unknown-property/index.js.map +1 -1
- package/dist/checks/unrecognized-render-partial-arguments/index.js +2 -2
- package/dist/checks/unrecognized-render-partial-arguments/index.js.map +1 -1
- package/dist/checks/unused-assign/index.js +1 -1
- package/dist/checks/unused-assign/index.js.map +1 -1
- package/dist/checks/unused-doc-param/index.js +1 -1
- package/dist/checks/unused-doc-param/index.js.map +1 -1
- package/dist/checks/utils.js +1 -1
- package/dist/checks/utils.js.map +1 -1
- package/dist/checks/valid-content-for-arguments/index.js +1 -1
- package/dist/checks/valid-content-for-arguments/index.js.map +1 -1
- package/dist/checks/valid-doc-param-types/index.js +4 -4
- package/dist/checks/valid-doc-param-types/index.js.map +1 -1
- package/dist/checks/valid-html-translation/index.d.ts +2 -2
- package/dist/checks/valid-html-translation/index.js +4 -4
- package/dist/checks/valid-html-translation/index.js.map +1 -1
- package/dist/checks/valid-json/index.js +1 -1
- package/dist/checks/valid-json/index.js.map +1 -1
- package/dist/checks/valid-render-partial-argument-types/index.js +2 -2
- package/dist/checks/valid-render-partial-argument-types/index.js.map +1 -1
- package/dist/checks/variable-name/index.js +1 -1
- package/dist/checks/variable-name/index.js.map +1 -1
- package/dist/context-utils.d.ts +18 -7
- package/dist/context-utils.js +68 -109
- package/dist/context-utils.js.map +1 -1
- package/dist/disabled-checks/index.js +4 -2
- package/dist/disabled-checks/index.js.map +1 -1
- package/dist/doc-generator/DocBlockGenerator.d.ts +16 -0
- package/dist/doc-generator/DocBlockGenerator.js +464 -0
- package/dist/doc-generator/DocBlockGenerator.js.map +1 -0
- package/dist/doc-generator/index.d.ts +1 -0
- package/dist/doc-generator/index.js +6 -0
- package/dist/doc-generator/index.js.map +1 -0
- package/dist/find-root.d.ts +7 -10
- package/dist/find-root.js +10 -17
- package/dist/find-root.js.map +1 -1
- package/dist/fixes/autofix.d.ts +4 -4
- package/dist/fixes/autofix.js +2 -2
- package/dist/fixes/autofix.js.map +1 -1
- package/dist/fixes/correctors/index.js +4 -0
- package/dist/fixes/correctors/index.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +50 -17
- package/dist/index.js.map +1 -1
- package/dist/jsonc/parse.d.ts +1 -1
- package/dist/jsonc/parse.js +1 -1
- package/dist/liquid-doc/arguments.d.ts +7 -8
- package/dist/liquid-doc/arguments.js +28 -29
- package/dist/liquid-doc/arguments.js.map +1 -1
- package/dist/liquid-doc/liquidDoc.d.ts +1 -1
- package/dist/liquid-doc/liquidDoc.js.map +1 -1
- package/dist/liquid-doc/utils.d.ts +3 -3
- package/dist/liquid-doc/utils.js +14 -3
- package/dist/liquid-doc/utils.js.map +1 -1
- package/dist/path.d.ts +1 -0
- package/dist/path.js +16 -1
- package/dist/path.js.map +1 -1
- package/{src/test/MockTheme.ts → dist/test/MockApp.d.ts} +2 -3
- package/dist/test/MockApp.js +16 -0
- package/dist/test/MockApp.js.map +1 -0
- package/dist/test/MockFileSystem.d.ts +3 -3
- package/dist/test/MockFileSystem.js +6 -6
- package/dist/test/MockFileSystem.js.map +1 -1
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/test-helper.d.ts +10 -9
- package/dist/test/test-helper.js +15 -106
- package/dist/test/test-helper.js.map +1 -1
- package/dist/to-schema.d.ts +1 -1
- package/dist/to-source-code.d.ts +3 -2
- package/dist/to-source-code.js +20 -0
- package/dist/to-source-code.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/platformos-liquid-docs.d.ts +128 -0
- package/dist/types/platformos-liquid-docs.js +3 -0
- package/dist/types/platformos-liquid-docs.js.map +1 -0
- package/dist/types/schemas/index.d.ts +0 -2
- package/dist/types/schemas/index.js.map +1 -1
- package/dist/types.d.ts +26 -67
- package/dist/types.js +3 -5
- package/dist/types.js.map +1 -1
- package/dist/utils/block.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/yaml/parse.d.ts +5 -0
- package/dist/yaml/parse.js +94 -0
- package/dist/yaml/parse.js.map +1 -0
- package/package.json +4 -3
- package/src/{AugmentedThemeDocset.spec.ts → AugmentedPlatformOSDocset.spec.ts} +47 -34
- package/src/AugmentedPlatformOSDocset.ts +89 -0
- package/src/JSONValidator.ts +1 -1
- package/src/checks/deprecated-filter/index.spec.ts +76 -248
- package/src/checks/deprecated-filter/index.ts +5 -53
- package/src/checks/deprecated-tag/index.spec.ts +85 -34
- package/src/checks/deprecated-tag/index.ts +27 -22
- package/src/checks/duplicate-function-arguments/index.ts +1 -1
- package/src/checks/duplicate-render-partial-arguments/index.spec.ts +12 -12
- package/src/checks/duplicate-render-partial-arguments/index.ts +1 -1
- package/src/checks/graphql/index.ts +1 -1
- package/src/checks/graphql-variables/index.spec.ts +95 -0
- package/src/checks/graphql-variables/index.ts +4 -0
- package/src/checks/img-width-and-height/index.ts +2 -2
- package/src/checks/index.ts +11 -80
- package/src/checks/invalid-hash-assign-target/index.spec.ts +27 -27
- package/src/checks/json-syntax-error/index.ts +2 -2
- package/src/checks/liquid-html-syntax-error/checks/InvalidBooleanExpression.spec.ts +0 -11
- package/src/checks/liquid-html-syntax-error/checks/InvalidLoopArguments.spec.ts +1 -2
- package/src/checks/liquid-html-syntax-error/checks/InvalidLoopArguments.ts +2 -2
- package/src/checks/liquid-html-syntax-error/checks/InvalidTagSyntax.spec.ts +259 -0
- package/src/checks/liquid-html-syntax-error/checks/InvalidTagSyntax.ts +89 -0
- package/src/checks/liquid-html-syntax-error/checks/UnknownTag.spec.ts +293 -0
- package/src/checks/liquid-html-syntax-error/checks/UnknownTag.ts +43 -0
- package/src/checks/liquid-html-syntax-error/index.spec.ts +1 -6
- package/src/checks/liquid-html-syntax-error/index.ts +26 -5
- package/src/checks/matching-translations/index.spec.ts +187 -354
- package/src/checks/matching-translations/index.ts +117 -107
- package/src/checks/metadata-params/index.ts +6 -8
- package/src/checks/missing-asset/index.ts +1 -1
- package/src/checks/{missing-template → missing-partial}/index.spec.ts +6 -6
- package/src/checks/{missing-template → missing-partial}/index.ts +12 -26
- package/src/checks/orphaned-partial/index.ts +3 -3
- package/src/checks/parser-blocking-script/index.spec.ts +0 -118
- package/src/checks/parser-blocking-script/index.ts +3 -33
- package/src/checks/parser-blocking-script/suggestions.ts +1 -28
- package/src/checks/translation-key-exists/index.ts +1 -1
- package/src/checks/unclosed-html-element/index.ts +5 -1
- package/src/checks/undefined-object/index.spec.ts +32 -111
- package/src/checks/undefined-object/index.ts +15 -34
- package/src/checks/unique-doc-param-names/index.ts +1 -1
- package/src/checks/unknown-filter/index.spec.ts +2 -2
- package/src/checks/unknown-filter/index.ts +3 -3
- package/src/checks/unknown-property/index.ts +1 -1
- package/src/checks/unrecognized-render-partial-arguments/index.spec.ts +5 -5
- package/src/checks/unrecognized-render-partial-arguments/index.ts +2 -5
- package/src/checks/unused-assign/index.spec.ts +0 -30
- package/src/checks/unused-assign/index.ts +2 -2
- package/src/checks/unused-doc-param/index.ts +1 -1
- package/src/checks/utils.ts +1 -1
- package/src/checks/valid-doc-param-types/index.ts +4 -4
- package/src/checks/valid-html-translation/index.spec.ts +42 -32
- package/src/checks/valid-html-translation/index.ts +7 -7
- package/src/checks/valid-json/index.ts +2 -2
- package/src/checks/valid-render-partial-argument-types/index.spec.ts +13 -13
- package/src/checks/valid-render-partial-argument-types/index.ts +2 -5
- package/src/checks/variable-name/index.ts +1 -1
- package/src/context-utils.spec.ts +49 -77
- package/src/context-utils.ts +81 -129
- package/src/disabled-checks/index.spec.ts +26 -26
- package/src/disabled-checks/index.ts +2 -2
- package/src/disabled-checks/test-checks.ts +4 -4
- package/src/find-root.ts +12 -22
- package/src/fixes/autofix.spec.ts +2 -2
- package/src/fixes/autofix.ts +4 -4
- package/src/fixes/correctors/index.ts +4 -0
- package/src/ignore.spec.ts +4 -5
- package/src/index.ts +51 -21
- package/src/jsonc/parse.ts +1 -1
- package/src/liquid-doc/arguments.spec.ts +19 -45
- package/src/liquid-doc/arguments.ts +35 -42
- package/src/liquid-doc/liquidDoc.spec.ts +1 -1
- package/src/liquid-doc/liquidDoc.ts +1 -2
- package/src/liquid-doc/utils.ts +17 -8
- package/src/path.ts +16 -0
- package/src/test/MockApp.ts +17 -0
- package/src/test/MockFileSystem.spec.ts +10 -11
- package/src/test/MockFileSystem.ts +6 -6
- package/src/test/contain-offense.spec.ts +11 -3
- package/src/test/index.ts +1 -1
- package/src/test/test-helper.ts +43 -145
- package/src/to-source-code.ts +20 -1
- package/src/types/{theme-liquid-docs.ts → platformos-liquid-docs.ts} +8 -13
- package/src/types.ts +29 -92
- package/src/utils/index.ts +0 -1
- package/src/visitor.spec.ts +2 -2
- package/src/yaml/parse.ts +111 -0
- package/src/AugmentedThemeDocset.ts +0 -137
- package/src/checks/app-block-missing-schema/index.spec.ts +0 -121
- package/src/checks/app-block-missing-schema/index.ts +0 -46
- package/src/checks/app-block-valid-tags/index.spec.ts +0 -96
- package/src/checks/app-block-valid-tags/index.ts +0 -54
- package/src/checks/asset-preload/index.spec.ts +0 -78
- package/src/checks/asset-preload/index.ts +0 -65
- package/src/checks/asset-size-app-block-css/index.spec.ts +0 -88
- package/src/checks/asset-size-app-block-css/index.ts +0 -78
- package/src/checks/asset-size-app-block-javascript/index.spec.ts +0 -66
- package/src/checks/asset-size-app-block-javascript/index.ts +0 -78
- package/src/checks/asset-size-css/index.spec.ts +0 -166
- package/src/checks/asset-size-css/index.ts +0 -160
- package/src/checks/asset-size-javascript/index.spec.ts +0 -184
- package/src/checks/asset-size-javascript/index.ts +0 -144
- package/src/checks/block-id-usage/index.spec.ts +0 -76
- package/src/checks/block-id-usage/index.ts +0 -72
- package/src/checks/cdn-preconnect/index.spec.ts +0 -40
- package/src/checks/cdn-preconnect/index.ts +0 -43
- package/src/checks/content-for-header-modification/index.spec.ts +0 -65
- package/src/checks/content-for-header-modification/index.ts +0 -72
- package/src/checks/deprecate-bgsizes/index.spec.ts +0 -41
- package/src/checks/deprecate-bgsizes/index.ts +0 -49
- package/src/checks/deprecate-lazysizes/index.spec.ts +0 -26
- package/src/checks/deprecate-lazysizes/index.ts +0 -58
- package/src/checks/deprecated-filter/fixes.ts +0 -264
- package/src/checks/deprecated-fonts-on-sections-and-blocks/deprecated-fonts-data.ts +0 -1343
- package/src/checks/deprecated-fonts-on-sections-and-blocks/index.spec.ts +0 -613
- package/src/checks/deprecated-fonts-on-sections-and-blocks/index.ts +0 -284
- package/src/checks/deprecated-fonts-on-settings-schema/index.spec.ts +0 -102
- package/src/checks/deprecated-fonts-on-settings-schema/index.ts +0 -66
- package/src/checks/duplicate-content-for-arguments/index.spec.ts +0 -98
- package/src/checks/duplicate-content-for-arguments/index.ts +0 -43
- package/src/checks/empty-block-content/index.spec.ts +0 -117
- package/src/checks/empty-block-content/index.ts +0 -60
- package/src/checks/hardcoded-routes/index.spec.ts +0 -58
- package/src/checks/hardcoded-routes/index.ts +0 -100
- package/src/checks/json-missing-block/index.spec.ts +0 -435
- package/src/checks/json-missing-block/index.ts +0 -56
- package/src/checks/json-missing-block/missing-block-utils.ts +0 -147
- package/src/checks/liquid-free-settings/index.spec.ts +0 -180
- package/src/checks/liquid-free-settings/index.ts +0 -79
- package/src/checks/missing-content-for-arguments/index.spec.ts +0 -144
- package/src/checks/missing-content-for-arguments/index.ts +0 -46
- package/src/checks/pagination-size/index.spec.ts +0 -158
- package/src/checks/pagination-size/index.ts +0 -104
- package/src/checks/remote-asset/index.spec.ts +0 -280
- package/src/checks/remote-asset/index.ts +0 -238
- package/src/checks/reserved-doc-param-names/index.spec.ts +0 -62
- package/src/checks/reserved-doc-param-names/index.ts +0 -57
- package/src/checks/schema-presets-block-order/index.spec.ts +0 -344
- package/src/checks/schema-presets-block-order/index.ts +0 -154
- package/src/checks/schema-presets-static-blocks/index.spec.ts +0 -145
- package/src/checks/schema-presets-static-blocks/index.ts +0 -126
- package/src/checks/static-stylesheet-and-javascript-tags/index.spec.ts +0 -257
- package/src/checks/static-stylesheet-and-javascript-tags/index.ts +0 -48
- package/src/checks/unique-settings-id/index.spec.ts +0 -24
- package/src/checks/unique-settings-id/index.ts +0 -84
- package/src/checks/unique-settings-id/test-data.ts +0 -1191
- package/src/checks/unique-static-block-id/index.spec.ts +0 -55
- package/src/checks/unique-static-block-id/index.ts +0 -60
- package/src/checks/unrecognized-content-for-arguments/index.spec.ts +0 -145
- package/src/checks/unrecognized-content-for-arguments/index.ts +0 -55
- package/src/checks/valid-block-target/index.spec.ts +0 -1396
- package/src/checks/valid-block-target/index.ts +0 -142
- package/src/checks/valid-content-for-argument-types/index.spec.ts +0 -382
- package/src/checks/valid-content-for-argument-types/index.ts +0 -42
- package/src/checks/valid-content-for-arguments/index.spec.ts +0 -107
- package/src/checks/valid-content-for-arguments/index.ts +0 -98
- package/src/checks/valid-local-blocks/index.spec.ts +0 -286
- package/src/checks/valid-local-blocks/index.ts +0 -100
- package/src/checks/valid-local-blocks/valid-block-utils.ts +0 -97
- package/src/checks/valid-schema/index.spec.ts +0 -174
- package/src/checks/valid-schema/index.ts +0 -41
- package/src/checks/valid-schema-name/index.spec.ts +0 -112
- package/src/checks/valid-schema-name/index.ts +0 -75
- package/src/checks/valid-settings-key/index.spec.ts +0 -321
- package/src/checks/valid-settings-key/index.ts +0 -144
- package/src/checks/valid-static-block-type/index.spec.ts +0 -38
- package/src/checks/valid-static-block-type/index.ts +0 -58
- package/src/checks/valid-visible-if/index.spec.ts +0 -619
- package/src/checks/valid-visible-if/index.ts +0 -184
- package/src/checks/valid-visible-if/visible-if-utils.ts +0 -158
- package/src/tags/content-for.ts +0 -25
- package/src/to-schema.ts +0 -231
- package/src/types/schemas/index.ts +0 -5
- package/src/types/schemas/preset.ts +0 -52
- package/src/types/schemas/section.ts +0 -86
- package/src/types/schemas/setting.ts +0 -320
- package/src/types/schemas/template.ts +0 -34
- package/src/types/schemas/theme-block.ts +0 -34
- package/src/types/theme-schemas.ts +0 -80
- package/src/utils/block.ts +0 -300
- package/src/utils/markup.ts +0 -10
|
@@ -7,20 +7,21 @@ describe('MockFileSystem', () => {
|
|
|
7
7
|
|
|
8
8
|
beforeEach(() => {
|
|
9
9
|
fs = new MockFileSystem({
|
|
10
|
-
'layout
|
|
11
|
-
'
|
|
10
|
+
'app/views/layouts/layout.liquid': 'layout.liquid content',
|
|
11
|
+
'app/views/layouts/password.liquid': 'password.liquid content',
|
|
12
12
|
'app/views/partials/product-card.liquid': 'product-card.liquid content',
|
|
13
13
|
'app/views/partials/product-variant.liquid': 'product-variant.liquid content',
|
|
14
|
-
'sections/section.liquid': 'section.liquid content',
|
|
15
14
|
'assets/js/foo.js': 'foo.js content',
|
|
16
15
|
'assets/js/bar.js': 'bar.js content',
|
|
17
|
-
'assets/
|
|
16
|
+
'assets/app.js': 'app.js content',
|
|
18
17
|
});
|
|
19
18
|
});
|
|
20
19
|
|
|
21
20
|
describe('readFile', () => {
|
|
22
21
|
it('returns the content of existing files', async () => {
|
|
23
|
-
expect(await fs.readFile('file:/layout
|
|
22
|
+
expect(await fs.readFile('file:/app/views/layouts/layout.liquid')).toBe(
|
|
23
|
+
'layout.liquid content',
|
|
24
|
+
);
|
|
24
25
|
expect(await fs.readFile('file:/assets/js/foo.js')).toBe('foo.js content');
|
|
25
26
|
});
|
|
26
27
|
|
|
@@ -31,10 +32,10 @@ describe('MockFileSystem', () => {
|
|
|
31
32
|
|
|
32
33
|
describe('readDirectory', () => {
|
|
33
34
|
it('returns the list of files in a leaf', async () => {
|
|
34
|
-
const result = await fs.readDirectory('file:/
|
|
35
|
+
const result = await fs.readDirectory('file:/app/views/layouts');
|
|
35
36
|
expect(result).to.eql([
|
|
36
|
-
['file:/layout
|
|
37
|
-
['file:/
|
|
37
|
+
['file:/app/views/layouts/layout.liquid', FileType.File],
|
|
38
|
+
['file:/app/views/layouts/password.liquid', FileType.File],
|
|
38
39
|
]);
|
|
39
40
|
});
|
|
40
41
|
|
|
@@ -42,16 +43,14 @@ describe('MockFileSystem', () => {
|
|
|
42
43
|
const result = await fs.readDirectory('file:/assets');
|
|
43
44
|
expect(result).to.eql([
|
|
44
45
|
['file:/assets/js', FileType.Directory],
|
|
45
|
-
['file:/assets/
|
|
46
|
+
['file:/assets/app.js', FileType.File],
|
|
46
47
|
]);
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
it('returns the list of files and directories at the root', async () => {
|
|
50
51
|
const result = await fs.readDirectory('file:/');
|
|
51
52
|
expect(result).to.eql([
|
|
52
|
-
['file:/layout', FileType.Directory],
|
|
53
53
|
['file:/app', FileType.Directory],
|
|
54
|
-
['file:/sections', FileType.Directory],
|
|
55
54
|
['file:/assets', FileType.Directory],
|
|
56
55
|
]);
|
|
57
56
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractFileSystem, FileStat, FileTuple, FileType } from '@platformos/platformos-common';
|
|
2
2
|
import { deepGet } from '../utils';
|
|
3
3
|
import { normalize, relative } from '../path';
|
|
4
|
-
import {
|
|
4
|
+
import { MockApp } from './MockApp';
|
|
5
5
|
import * as path from '../path';
|
|
6
6
|
|
|
7
7
|
interface FileTree {
|
|
@@ -12,7 +12,7 @@ export class MockFileSystem implements AbstractFileSystem {
|
|
|
12
12
|
private rootUri: string;
|
|
13
13
|
|
|
14
14
|
constructor(
|
|
15
|
-
private
|
|
15
|
+
private mockApp: MockApp,
|
|
16
16
|
rootUri = 'file:///',
|
|
17
17
|
) {
|
|
18
18
|
this.rootUri = normalize(rootUri);
|
|
@@ -20,10 +20,10 @@ export class MockFileSystem implements AbstractFileSystem {
|
|
|
20
20
|
|
|
21
21
|
async readFile(uri: string): Promise<string> {
|
|
22
22
|
const relativePath = this.rootRelative(uri);
|
|
23
|
-
if (this.
|
|
23
|
+
if (this.mockApp[relativePath] === undefined) {
|
|
24
24
|
throw new Error('File not found');
|
|
25
25
|
} else {
|
|
26
|
-
return this.
|
|
26
|
+
return this.mockApp[relativePath];
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -50,7 +50,7 @@ export class MockFileSystem implements AbstractFileSystem {
|
|
|
50
50
|
|
|
51
51
|
async stat(uri: string): Promise<FileStat> {
|
|
52
52
|
const relativePath = this.rootRelative(uri);
|
|
53
|
-
const source = this.
|
|
53
|
+
const source = this.mockApp[relativePath];
|
|
54
54
|
if (source) {
|
|
55
55
|
return {
|
|
56
56
|
type: FileType.File,
|
|
@@ -71,7 +71,7 @@ export class MockFileSystem implements AbstractFileSystem {
|
|
|
71
71
|
|
|
72
72
|
private get fileTree(): FileTree {
|
|
73
73
|
const result: FileTree = {};
|
|
74
|
-
for (const [relativePath, source] of Object.entries(this.
|
|
74
|
+
for (const [relativePath, source] of Object.entries(this.mockApp)) {
|
|
75
75
|
const segments = relativePath.split('/');
|
|
76
76
|
let current = result;
|
|
77
77
|
for (let i = 0; i < segments.length - 1; i++) {
|
|
@@ -7,7 +7,10 @@ const rootUri = 'file:///';
|
|
|
7
7
|
describe('Module: containOffense', () => {
|
|
8
8
|
const offenses: Offense[] = [
|
|
9
9
|
buildOffense(`The translation for 'hello.world' is missing`, 'locales/en.json'),
|
|
10
|
-
buildOffense(
|
|
10
|
+
buildOffense(
|
|
11
|
+
`'app/views/partials/missing.liquid' does not exist`,
|
|
12
|
+
'app/views/layouts/layout.liquid',
|
|
13
|
+
),
|
|
11
14
|
];
|
|
12
15
|
|
|
13
16
|
describe('with string assertions', () => {
|
|
@@ -29,12 +32,17 @@ describe('Module: containOffense', () => {
|
|
|
29
32
|
|
|
30
33
|
it(`should not contain the Offense when their messages match but absolute paths don't match`, () => {
|
|
31
34
|
expect(offenses).to.not.containOffense(
|
|
32
|
-
buildOffense(
|
|
35
|
+
buildOffense(
|
|
36
|
+
`The translation for 'hello.world' is missing`,
|
|
37
|
+
'app/views/layouts/password.liquid',
|
|
38
|
+
),
|
|
33
39
|
);
|
|
34
40
|
});
|
|
35
41
|
|
|
36
42
|
it(`should not contain the Offense when their absolute paths match but messages don't match`, () => {
|
|
37
|
-
expect(offenses).to.not.containOffense(
|
|
43
|
+
expect(offenses).to.not.containOffense(
|
|
44
|
+
buildOffense('!!!', 'app/views/layouts/layout.liquid'),
|
|
45
|
+
);
|
|
38
46
|
});
|
|
39
47
|
|
|
40
48
|
it(`should not contain the Offense when their absolute paths and messages don't match`, () => {
|
package/src/test/index.ts
CHANGED
package/src/test/test-helper.ts
CHANGED
|
@@ -10,44 +10,39 @@ import {
|
|
|
10
10
|
Dependencies,
|
|
11
11
|
extractDocDefinition,
|
|
12
12
|
FixApplicator,
|
|
13
|
-
isBlock,
|
|
14
|
-
isSection,
|
|
15
13
|
JSONCorrector,
|
|
16
14
|
JSONSourceCode,
|
|
17
15
|
LiquidSourceCode,
|
|
18
16
|
Offense,
|
|
19
17
|
recommended,
|
|
20
|
-
SectionSchema,
|
|
21
18
|
SourceCodeType,
|
|
22
19
|
StringCorrector,
|
|
23
|
-
|
|
24
|
-
ThemeBlockSchema,
|
|
25
|
-
toSchema,
|
|
20
|
+
App,
|
|
26
21
|
toSourceCode,
|
|
22
|
+
YAMLSourceCode,
|
|
27
23
|
} from '../index';
|
|
28
24
|
import * as path from '../path';
|
|
29
25
|
import { MockFileSystem } from './MockFileSystem';
|
|
30
|
-
import {
|
|
26
|
+
import { MockApp } from './MockApp';
|
|
31
27
|
|
|
32
28
|
export { JSONCorrector, StringCorrector };
|
|
33
29
|
|
|
34
30
|
const rootUri = path.normalize('file:/');
|
|
35
31
|
|
|
36
|
-
export function
|
|
37
|
-
return Object.entries(
|
|
32
|
+
export function getApp(appDesc: MockApp): App {
|
|
33
|
+
return Object.entries(appDesc)
|
|
38
34
|
.map(([relativePath, source]) => toSourceCode(toUri(relativePath), source))
|
|
39
|
-
.filter((x): x is LiquidSourceCode | JSONSourceCode => x !== undefined);
|
|
35
|
+
.filter((x): x is LiquidSourceCode | JSONSourceCode | YAMLSourceCode => x !== undefined);
|
|
40
36
|
}
|
|
41
37
|
|
|
42
38
|
export async function check(
|
|
43
|
-
|
|
39
|
+
appDesc: MockApp,
|
|
44
40
|
checks: CheckDefinition[] = recommended,
|
|
45
41
|
mockDependencies: Partial<Dependencies> = {},
|
|
46
42
|
checkSettings: ChecksSettings = {},
|
|
47
43
|
): Promise<Offense[]> {
|
|
48
|
-
const
|
|
44
|
+
const app = getApp(appDesc);
|
|
49
45
|
const config: Config = {
|
|
50
|
-
context: 'theme',
|
|
51
46
|
settings: { ...checkSettings },
|
|
52
47
|
checks,
|
|
53
48
|
rootUri,
|
|
@@ -56,95 +51,27 @@ export async function check(
|
|
|
56
51
|
},
|
|
57
52
|
};
|
|
58
53
|
|
|
59
|
-
const sections = new Map(
|
|
60
|
-
theme
|
|
61
|
-
.filter((source) => isSection(source.uri))
|
|
62
|
-
.map((source) => [path.basename(source.uri, '.liquid'), source]),
|
|
63
|
-
);
|
|
64
|
-
const blocks = new Map(
|
|
65
|
-
theme
|
|
66
|
-
.filter((source) => isBlock(source.uri))
|
|
67
|
-
.map((source) => [path.basename(source.uri, '.liquid'), source]),
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Schemas are assumed to be valid in tests, hijack
|
|
72
|
-
* getBlockSchema/getSectionSchema with overrides when you want to test
|
|
73
|
-
* something otherwise
|
|
74
|
-
*/
|
|
75
|
-
const isValidSchema = async () => true;
|
|
76
|
-
|
|
77
54
|
const defaultMockDependencies: Dependencies = {
|
|
78
|
-
fs: new MockFileSystem({ '.
|
|
79
|
-
async getBlockSchema(name) {
|
|
80
|
-
const block = blocks.get(name);
|
|
81
|
-
if (!block) return undefined;
|
|
82
|
-
return toSchema(config.context, block.uri, block, isValidSchema) as Promise<
|
|
83
|
-
ThemeBlockSchema | undefined
|
|
84
|
-
>;
|
|
85
|
-
},
|
|
86
|
-
async getSectionSchema(name) {
|
|
87
|
-
const section = sections.get(name);
|
|
88
|
-
if (!section) return undefined;
|
|
89
|
-
return toSchema(config.context, section.uri, section, isValidSchema) as Promise<
|
|
90
|
-
SectionSchema | undefined
|
|
91
|
-
>;
|
|
92
|
-
},
|
|
55
|
+
fs: new MockFileSystem({ '.platformos-check.yml': '', ...appDesc }),
|
|
93
56
|
async getDocDefinition(relativePath) {
|
|
94
|
-
const file =
|
|
57
|
+
const file = app.find((file) => file.uri.endsWith(relativePath));
|
|
95
58
|
if (!file || !isLiquidHtmlNode(file.ast)) {
|
|
96
59
|
return undefined;
|
|
97
60
|
}
|
|
98
61
|
return extractDocDefinition(file.uri, file.ast);
|
|
99
62
|
},
|
|
100
|
-
|
|
63
|
+
platformosDocset: {
|
|
101
64
|
async graphQL() {
|
|
102
65
|
return null;
|
|
103
66
|
},
|
|
104
67
|
async filters() {
|
|
105
68
|
return [
|
|
106
69
|
{ name: 'item_count_for_variant' },
|
|
107
|
-
{ name: 'link_to_type' },
|
|
108
|
-
{ name: 'link_to_vendor' },
|
|
109
70
|
{ name: 'append' },
|
|
110
71
|
{ name: 'upcase' },
|
|
111
72
|
{ name: 'downcase' },
|
|
112
|
-
{ name: '
|
|
113
|
-
{
|
|
114
|
-
name: 'hex_to_rgba',
|
|
115
|
-
deprecated: true,
|
|
116
|
-
deprecation_reason: '`hex_to_rgba` has been replaced by [`color_to_rgb`](/do...',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'currency_selector',
|
|
120
|
-
deprecated: true,
|
|
121
|
-
deprecation_reason: 'Deprecated without a direct replacement because the [cur...',
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
name: 'article_img_url',
|
|
125
|
-
deprecated: true,
|
|
126
|
-
deprecation_reason: '`article_img_url` has been replaced by [`image_url`](/d...',
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
name: 'collection_img_url',
|
|
130
|
-
deprecated: true,
|
|
131
|
-
deprecation_reason: '`collection_img_url` has been replaced by [`image_url`](...',
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: 'img_tag',
|
|
135
|
-
deprecated: true,
|
|
136
|
-
deprecation_reason: '`img_tag` has been replaced by [`image_tag`](/docs/api/...',
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: 'img_url',
|
|
140
|
-
deprecated: true,
|
|
141
|
-
deprecation_reason: '`img_url` has been replaced by [`image_url`](/docs/api/...',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
name: 'product_img_url',
|
|
145
|
-
deprecated: true,
|
|
146
|
-
deprecation_reason: '`product_img_url` has been replaced by [`image_url`](/d...',
|
|
147
|
-
},
|
|
73
|
+
{ name: 'parameterize' },
|
|
74
|
+
{ name: 'slugify' },
|
|
148
75
|
];
|
|
149
76
|
},
|
|
150
77
|
async objects() {
|
|
@@ -169,17 +96,9 @@ export async function check(
|
|
|
169
96
|
},
|
|
170
97
|
},
|
|
171
98
|
{
|
|
172
|
-
name: '
|
|
173
|
-
access: {
|
|
174
|
-
global: false,
|
|
175
|
-
parents: [],
|
|
176
|
-
template: [],
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
name: 'block',
|
|
99
|
+
name: 'context',
|
|
181
100
|
access: {
|
|
182
|
-
global:
|
|
101
|
+
global: true,
|
|
183
102
|
parents: [],
|
|
184
103
|
template: [],
|
|
185
104
|
},
|
|
@@ -192,30 +111,6 @@ export async function check(
|
|
|
192
111
|
template: [],
|
|
193
112
|
},
|
|
194
113
|
},
|
|
195
|
-
{
|
|
196
|
-
name: 'predictive_search',
|
|
197
|
-
access: {
|
|
198
|
-
global: false,
|
|
199
|
-
parents: [],
|
|
200
|
-
template: [],
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
name: 'recommendations',
|
|
205
|
-
access: {
|
|
206
|
-
global: false,
|
|
207
|
-
parents: [],
|
|
208
|
-
template: [],
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
name: 'comment',
|
|
213
|
-
access: {
|
|
214
|
-
global: false,
|
|
215
|
-
parents: [],
|
|
216
|
-
template: [],
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
114
|
];
|
|
220
115
|
},
|
|
221
116
|
async liquidDrops() {
|
|
@@ -224,13 +119,10 @@ export async function check(
|
|
|
224
119
|
async tags() {
|
|
225
120
|
return [];
|
|
226
121
|
},
|
|
227
|
-
async systemTranslations() {
|
|
228
|
-
return { 'shopify.sentence.words_connector': ', ' };
|
|
229
|
-
},
|
|
230
122
|
},
|
|
231
123
|
};
|
|
232
124
|
|
|
233
|
-
return coreCheck(
|
|
125
|
+
return coreCheck(app, config, { ...defaultMockDependencies, ...mockDependencies });
|
|
234
126
|
}
|
|
235
127
|
|
|
236
128
|
export async function runLiquidCheck(
|
|
@@ -238,10 +130,10 @@ export async function runLiquidCheck(
|
|
|
238
130
|
sourceCode: string,
|
|
239
131
|
fileName: string = 'file.liquid',
|
|
240
132
|
mockDependencies: Partial<Dependencies> = {},
|
|
241
|
-
|
|
133
|
+
existingAppFiles?: MockApp,
|
|
242
134
|
): Promise<Offense[]> {
|
|
243
135
|
const offenses = await check(
|
|
244
|
-
{ ...
|
|
136
|
+
{ ...existingAppFiles, [fileName]: sourceCode },
|
|
245
137
|
[checkDef],
|
|
246
138
|
mockDependencies,
|
|
247
139
|
);
|
|
@@ -258,40 +150,47 @@ export async function runJSONCheck(
|
|
|
258
150
|
return offenses.filter((offense) => offense.uri === path.join(rootUri, fileName));
|
|
259
151
|
}
|
|
260
152
|
|
|
261
|
-
export async function
|
|
262
|
-
|
|
263
|
-
|
|
153
|
+
export async function runYAMLCheck(
|
|
154
|
+
checkDef: CheckDefinition<SourceCodeType.YAML>,
|
|
155
|
+
sourceCode: string,
|
|
156
|
+
fileName: string = 'file.yml',
|
|
157
|
+
mockDependencies: Partial<Dependencies> = {},
|
|
158
|
+
): Promise<Offense[]> {
|
|
159
|
+
const offenses = await check({ [fileName]: sourceCode }, [checkDef], mockDependencies);
|
|
160
|
+
return offenses.filter((offense) => offense.uri === path.join(rootUri, fileName));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export async function autofix(appDesc: MockApp, offenses: Offense[]) {
|
|
164
|
+
const app = getApp(appDesc);
|
|
165
|
+
const fixed = { ...appDesc };
|
|
264
166
|
|
|
265
167
|
const stringApplicator: FixApplicator = async (sourceCode, fixes) => {
|
|
266
168
|
fixed[asRelative(sourceCode.uri)] = applyFixToString(sourceCode.source, fixes);
|
|
267
169
|
};
|
|
268
170
|
|
|
269
|
-
await coreAutofix(
|
|
171
|
+
await coreAutofix(app, offenses, stringApplicator);
|
|
270
172
|
|
|
271
173
|
return fixed;
|
|
272
174
|
}
|
|
273
175
|
|
|
274
|
-
export function applyFix(
|
|
275
|
-
themeDescOrSource: MockTheme | string,
|
|
276
|
-
offense: Offense,
|
|
277
|
-
): string | undefined {
|
|
176
|
+
export function applyFix(appDescOrSource: MockApp | string, offense: Offense): string | undefined {
|
|
278
177
|
const source =
|
|
279
|
-
typeof
|
|
280
|
-
?
|
|
281
|
-
:
|
|
178
|
+
typeof appDescOrSource === 'string'
|
|
179
|
+
? appDescOrSource
|
|
180
|
+
: appDescOrSource[asRelative(offense.uri)];
|
|
282
181
|
const corrector = createCorrector(offense.type, source);
|
|
283
182
|
offense.fix?.(corrector as any);
|
|
284
183
|
return applyFixToString(source, corrector.fix);
|
|
285
184
|
}
|
|
286
185
|
|
|
287
186
|
export function applySuggestions(
|
|
288
|
-
|
|
187
|
+
appDescOrSource: MockApp | string,
|
|
289
188
|
offense: Offense,
|
|
290
189
|
): undefined | string[] {
|
|
291
190
|
const source =
|
|
292
|
-
typeof
|
|
293
|
-
?
|
|
294
|
-
:
|
|
191
|
+
typeof appDescOrSource === 'string'
|
|
192
|
+
? appDescOrSource
|
|
193
|
+
: appDescOrSource[asRelative(offense.uri)];
|
|
295
194
|
return offense.suggest?.map((suggestion) => {
|
|
296
195
|
const corrector = createCorrector(offense.type, source);
|
|
297
196
|
suggestion.fix(corrector as any);
|
|
@@ -299,12 +198,11 @@ export function applySuggestions(
|
|
|
299
198
|
});
|
|
300
199
|
}
|
|
301
200
|
|
|
302
|
-
export function highlightedOffenses(
|
|
303
|
-
const
|
|
304
|
-
typeof themeOrSource === 'string' ? { 'file.liquid': themeOrSource } : themeOrSource;
|
|
201
|
+
export function highlightedOffenses(appOrSource: MockApp | string, offenses: Offense[]) {
|
|
202
|
+
const app = typeof appOrSource === 'string' ? { 'file.liquid': appOrSource } : appOrSource;
|
|
305
203
|
return offenses.map((offense) => {
|
|
306
204
|
const relativePath = path.relative(offense.uri, rootUri);
|
|
307
|
-
const source =
|
|
205
|
+
const source = app[relativePath];
|
|
308
206
|
const {
|
|
309
207
|
start: { index: startIndex },
|
|
310
208
|
end: { index: endIndex },
|
package/src/to-source-code.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { toLiquidHtmlAST } from '@platformos/liquid-html-parser';
|
|
2
2
|
|
|
3
3
|
import { toJSONNode } from './jsonc/parse';
|
|
4
|
+
import { toYAMLNode } from './yaml/parse';
|
|
4
5
|
import * as path from './path';
|
|
5
6
|
import {
|
|
6
7
|
GraphQLDocumentNode,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
JSONSourceCode,
|
|
10
11
|
LiquidSourceCode,
|
|
11
12
|
SourceCodeType,
|
|
13
|
+
YAMLSourceCode,
|
|
12
14
|
} from './types';
|
|
13
15
|
import { asError } from './utils/error';
|
|
14
16
|
|
|
@@ -28,6 +30,14 @@ export function toJSONAST(source: string): JSONNode | Error {
|
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
export function toYAMLAST(source: string): JSONNode | Error {
|
|
34
|
+
try {
|
|
35
|
+
return toYAMLNode(source);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return asError(error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
export function toGraphQLAST(source: string): GraphQLDocumentNode | Error {
|
|
32
42
|
try {
|
|
33
43
|
return {
|
|
@@ -43,9 +53,10 @@ export function toSourceCode(
|
|
|
43
53
|
uri: string,
|
|
44
54
|
source: string,
|
|
45
55
|
version?: number,
|
|
46
|
-
): LiquidSourceCode | JSONSourceCode | GraphQLSourceCode {
|
|
56
|
+
): LiquidSourceCode | JSONSourceCode | GraphQLSourceCode | YAMLSourceCode {
|
|
47
57
|
const isLiquid = uri.endsWith('.liquid');
|
|
48
58
|
const isGraphQL = uri.endsWith('.graphql');
|
|
59
|
+
const isYAML = uri.endsWith('.yml') || uri.endsWith('.yaml');
|
|
49
60
|
|
|
50
61
|
if (isLiquid) {
|
|
51
62
|
return {
|
|
@@ -63,6 +74,14 @@ export function toSourceCode(
|
|
|
63
74
|
ast: toGraphQLAST(source),
|
|
64
75
|
version,
|
|
65
76
|
};
|
|
77
|
+
} else if (isYAML) {
|
|
78
|
+
return {
|
|
79
|
+
uri: path.normalize(uri),
|
|
80
|
+
source,
|
|
81
|
+
type: SourceCodeType.YAML,
|
|
82
|
+
ast: toYAMLAST(source),
|
|
83
|
+
version,
|
|
84
|
+
};
|
|
66
85
|
} else {
|
|
67
86
|
return {
|
|
68
87
|
uri: path.normalize(uri),
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import { Mode, Translations } from '..';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* platformOS Liquid docset.
|
|
5
3
|
*/
|
|
6
|
-
export interface
|
|
4
|
+
export interface PlatformOSDocset {
|
|
7
5
|
/** Whether it was augmented prior to being passed. */
|
|
8
6
|
isAugmented?: boolean;
|
|
9
7
|
|
|
10
|
-
/** Returns Liquid filters available
|
|
8
|
+
/** Returns Liquid filters available in platformOS. */
|
|
11
9
|
filters(): Promise<FilterEntry[]>;
|
|
12
10
|
|
|
13
|
-
/** Returns objects (or Liquid variables) available
|
|
11
|
+
/** Returns objects (or Liquid variables) available in platformOS. */
|
|
14
12
|
objects(): Promise<ObjectEntry[]>;
|
|
15
13
|
|
|
16
|
-
/** Returns objects (excluding global variables, hidden objects, and deprecated objects) available
|
|
14
|
+
/** Returns objects (excluding global variables, hidden objects, and deprecated objects) available in platformOS. */
|
|
17
15
|
liquidDrops(): Promise<ObjectEntry[]>;
|
|
18
16
|
|
|
19
|
-
/** Returns Liquid tags available
|
|
17
|
+
/** Returns Liquid tags available in platformOS. */
|
|
20
18
|
tags(): Promise<TagEntry[]>;
|
|
21
19
|
|
|
22
20
|
/** Returns graphql root query */
|
|
23
21
|
graphQL(): Promise<string | null>;
|
|
24
|
-
|
|
25
|
-
/** Returns system translations available on themes. */
|
|
26
|
-
systemTranslations(): Promise<Translations>;
|
|
27
22
|
}
|
|
28
23
|
|
|
29
24
|
/** A URI that will uniquely describe the schema */
|
|
@@ -45,10 +40,10 @@ export interface SchemaDefinition {
|
|
|
45
40
|
fileMatch?: string[];
|
|
46
41
|
}
|
|
47
42
|
|
|
48
|
-
/** Source of JSON schemas for
|
|
43
|
+
/** Source of JSON schemas for the app. */
|
|
49
44
|
export interface JsonValidationSet {
|
|
50
45
|
/** All relevant SchemaDefinitions. */
|
|
51
|
-
schemas: (
|
|
46
|
+
schemas: () => Promise<SchemaDefinition[]>;
|
|
52
47
|
}
|
|
53
48
|
|
|
54
49
|
export interface DocsetEntry {
|