@platformos/platformos-graph 0.0.6 → 0.0.8
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 +18 -0
- package/dist/getWebComponentMap.js +1 -1
- package/dist/getWebComponentMap.js.map +1 -1
- package/dist/graph/augment.js +0 -3
- package/dist/graph/augment.js.map +1 -1
- package/dist/graph/build.d.ts +2 -2
- package/dist/graph/build.js +11 -8
- package/dist/graph/build.js.map +1 -1
- package/dist/graph/module.d.ts +6 -9
- package/dist/graph/module.js +53 -117
- package/dist/graph/module.js.map +1 -1
- package/dist/graph/serialize.d.ts +2 -2
- package/dist/graph/serialize.js +2 -2
- package/dist/graph/serialize.js.map +1 -1
- package/dist/graph/test-helpers.d.ts +0 -13
- package/dist/graph/test-helpers.js +0 -10
- package/dist/graph/test-helpers.js.map +1 -1
- package/dist/graph/traverse.d.ts +3 -3
- package/dist/graph/traverse.js +19 -349
- package/dist/graph/traverse.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/toSourceCode.d.ts +1 -4
- package/dist/toSourceCode.js +8 -52
- package/dist/toSourceCode.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +21 -78
- package/dist/types.js.map +1 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.js +0 -18
- package/dist/utils/index.js.map +1 -1
- package/fixtures/skeleton/{layout/theme.liquid → app/views/layouts/application.liquid} +3 -4
- package/fixtures/skeleton/app/views/pages/index.liquid +5 -0
- package/fixtures/skeleton/app/views/partials/header.liquid +3 -0
- package/package.json +7 -7
- package/src/getWebComponentMap.ts +1 -1
- package/src/graph/augment.ts +1 -13
- package/src/graph/build.spec.ts +31 -171
- package/src/graph/build.ts +18 -14
- package/src/graph/module.ts +59 -135
- package/src/graph/serialize.spec.ts +22 -29
- package/src/graph/serialize.ts +2 -2
- package/src/graph/test-helpers.ts +1 -18
- package/src/graph/traverse.ts +28 -501
- package/src/index.ts +3 -3
- package/src/toSourceCode.ts +14 -55
- package/src/types.ts +23 -100
- package/src/utils/index.ts +0 -24
- package/fixtures/skeleton/blocks/_private.liquid +0 -1
- package/fixtures/skeleton/blocks/_static.liquid +0 -10
- package/fixtures/skeleton/blocks/group.liquid +0 -27
- package/fixtures/skeleton/blocks/render-static.liquid +0 -22
- package/fixtures/skeleton/blocks/text.liquid +0 -14
- package/fixtures/skeleton/jsconfig.json +0 -9
- package/fixtures/skeleton/sections/custom-section.liquid +0 -6
- package/fixtures/skeleton/sections/header-group.json +0 -36
- package/fixtures/skeleton/sections/header.liquid +0 -1
- package/fixtures/skeleton/templates/index.json +0 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# shopify/theme-graph
|
|
2
2
|
|
|
3
|
+
## 0.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Beta release
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @platformos/liquid-html-parser@0.0.8
|
|
10
|
+
- @platformos/platformos-check-common@0.0.8
|
|
11
|
+
|
|
12
|
+
## 0.0.7
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Update dependencies
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @platformos/liquid-html-parser@0.0.7
|
|
19
|
+
- @platformos/platformos-check-common@0.0.7
|
|
20
|
+
|
|
3
21
|
## 0.0.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -28,7 +28,7 @@ async function getWebComponentMap(rootUri, { fs, getSourceCode }) {
|
|
|
28
28
|
}
|
|
29
29
|
async function findWebComponentReferences(uri, assetRoot, getSourceCode, result) {
|
|
30
30
|
const sourceCode = await getSourceCode(uri);
|
|
31
|
-
if (
|
|
31
|
+
if (!uri.endsWith('.js')) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
const ast = sourceCode.ast;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWebComponentMap.js","sourceRoot":"","sources":["../src/getWebComponentMap.ts"],"names":[],"mappings":";;AAsBA,gDAiBC;AAED,gEAuCC;AAhFD,iFAAmF;AACnF,2CAA+C;AAI/C;;;;;;GAMG;AACH,MAAM,IAAI,GACR,+UAA+U,CAAC;AAElV;;;;;;GAMG;AACI,KAAK,UAAU,kBAAkB,CACtC,OAAe,EACf,EAAE,EAAE,EAAE,aAAa,EAA8C;IAEjE,MAAM,gBAAgB,GAAoB,IAAI,GAAG,EAAE,CAAC;IACpD,MAAM,SAAS,GAAG,8BAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,MAAM,IAAA,gDAAsB,EAAC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CACzE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CACzB,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAClB,0BAA0B,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAC5E,CACF,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAEM,KAAK,UAAU,0BAA0B,CAC9C,GAAW,EACX,SAAiB,EACjB,aAA4C,EAC5C,MAAuB;IAEvB,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,
|
|
1
|
+
{"version":3,"file":"getWebComponentMap.js","sourceRoot":"","sources":["../src/getWebComponentMap.ts"],"names":[],"mappings":";;AAsBA,gDAiBC;AAED,gEAuCC;AAhFD,iFAAmF;AACnF,2CAA+C;AAI/C;;;;;;GAMG;AACH,MAAM,IAAI,GACR,+UAA+U,CAAC;AAElV;;;;;;GAMG;AACI,KA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SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;oBACpC,IAAI,CAAC,UAAU;wBAAE,OAAO;oBACxB,IAAI,UAAU,CAAC,IAAI,KAAK,gBAAgB;wBAAE,OAAO;oBACjD,MAAM,MAAM,GAAI,UAA6B,CAAC,MAAM,CAAC;oBACrD,IAAI,MAAM,CAAC,IAAI,KAAK,kBAAkB;wBAAE,OAAO;oBAC/C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;oBACjC,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY;wBAAE,OAAO;oBAC3C,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ;wBAAE,OAAO;oBAEvC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE;wBACrB,SAAS,EAAE,8BAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;wBACxC,KAAK,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC;qBAClC,CAAC,CAAC;gBACL,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
package/dist/graph/augment.js
CHANGED
|
@@ -7,8 +7,6 @@ const utils_1 = require("../utils");
|
|
|
7
7
|
function augmentDependencies(rootUri, ideps) {
|
|
8
8
|
return {
|
|
9
9
|
fs: ideps.fs,
|
|
10
|
-
getBlockSchema: (0, platformos_check_common_1.memoize)(ideps.getBlockSchema, utils_1.identity),
|
|
11
|
-
getSectionSchema: (0, platformos_check_common_1.memoize)(ideps.getSectionSchema, utils_1.identity),
|
|
12
10
|
// parse at most once
|
|
13
11
|
getSourceCode: (0, platformos_check_common_1.memoize)(ideps.getSourceCode ??
|
|
14
12
|
async function defaultGetSourceCode(uri) {
|
|
@@ -16,7 +14,6 @@ function augmentDependencies(rootUri, ideps) {
|
|
|
16
14
|
return (0, toSourceCode_1.toSourceCode)(uri, contents);
|
|
17
15
|
}, utils_1.identity),
|
|
18
16
|
getWebComponentDefinitionReference: ideps.getWebComponentDefinitionReference,
|
|
19
|
-
getThemeBlockNames: (0, platformos_check_common_1.memo)(() => (0, platformos_check_common_1.recursiveReadDirectory)(ideps.fs, platformos_check_common_1.path.join(rootUri, 'blocks'), ([uri]) => uri.endsWith('.liquid')).then((uris) => uris.map((uri) => platformos_check_common_1.path.basename(uri, '.liquid')))),
|
|
20
17
|
};
|
|
21
18
|
}
|
|
22
19
|
//# sourceMappingURL=augment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"augment.js","sourceRoot":"","sources":["../../src/graph/augment.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"augment.js","sourceRoot":"","sources":["../../src/graph/augment.ts"],"names":[],"mappings":";;AAKA,kDAgBC;AArBD,iFAAoE;AACpE,kDAA+C;AAE/C,oCAAoC;AAEpC,SAAgB,mBAAmB,CAAC,OAAe,EAAE,KAAoB;IACvE,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QAEZ,qBAAqB;QACrB,aAAa,EAAE,IAAA,iCAAO,EACpB,KAAK,CAAC,aAAa;YACjB,KAAK,UAAU,oBAAoB,CAAC,GAAG;gBACrC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAC9C,OAAO,IAAA,2BAAY,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YACrC,CAAC,EACH,gBAAQ,CACT;QAED,kCAAkC,EAAE,KAAK,CAAC,kCAAkC;KAC7E,CAAC;AACJ,CAAC"}
|
package/dist/graph/build.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { UriString } from '@platformos/platformos-check-common';
|
|
2
|
-
import { IDependencies,
|
|
3
|
-
export declare function
|
|
2
|
+
import { IDependencies, AppGraph } from '../types';
|
|
3
|
+
export declare function buildAppGraph(rootUri: UriString, ideps: IDependencies, entryPoints?: UriString[]): Promise<AppGraph>;
|
package/dist/graph/build.js
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildAppGraph = buildAppGraph;
|
|
4
4
|
const platformos_check_common_1 = require("@platformos/platformos-check-common");
|
|
5
5
|
const augment_1 = require("./augment");
|
|
6
6
|
const module_1 = require("./module");
|
|
7
7
|
const traverse_1 = require("./traverse");
|
|
8
|
-
async function
|
|
8
|
+
async function buildAppGraph(rootUri, ideps, entryPoints) {
|
|
9
9
|
const deps = (0, augment_1.augmentDependencies)(rootUri, ideps);
|
|
10
10
|
entryPoints =
|
|
11
11
|
entryPoints ??
|
|
12
12
|
(await (0, platformos_check_common_1.recursiveReadDirectory)(deps.fs, rootUri, ([uri]) => {
|
|
13
|
-
//
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
// Layouts are entry points — they wrap all page content.
|
|
14
|
+
const isLayoutFile = (uri.startsWith(platformos_check_common_1.path.join(rootUri, 'app/views/layouts')) ||
|
|
15
|
+
uri.startsWith(platformos_check_common_1.path.join(rootUri, 'views/layouts'))) &&
|
|
16
|
+
uri.endsWith('.liquid');
|
|
17
|
+
// Pages are also entry points — they are directly requested.
|
|
18
|
+
const isPageFile = (uri.startsWith(platformos_check_common_1.path.join(rootUri, 'app/views/pages')) ||
|
|
19
|
+
uri.startsWith(platformos_check_common_1.path.join(rootUri, 'views/pages'))) &&
|
|
20
|
+
uri.endsWith('.liquid');
|
|
21
|
+
return isLayoutFile || isPageFile;
|
|
19
22
|
}));
|
|
20
23
|
const graph = {
|
|
21
24
|
entryPoints: [],
|
package/dist/graph/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/graph/build.ts"],"names":[],"mappings":";;AAUA,
|
|
1
|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AAE,GAAG,CAAC,CAAC;SACnC,MAAM,CAAC,CAAC,CAAC,EAAkB,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IAElD,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,yBAAc,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAExF,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/graph/module.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { UriString } from '@platformos/platformos-check-common';
|
|
2
|
-
import {
|
|
3
|
-
export declare function getModule(
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function getAssetModule(themeGraph: ThemeGraph, asset: string): JavaScriptModule | CssModule | SvgModule | ImageModule | undefined;
|
|
9
|
-
export declare function getPartialModule(themeGraph: ThemeGraph, partial: string): LiquidModule;
|
|
10
|
-
export declare function getLayoutModule(themeGraph: ThemeGraph, layoutName?: string | false | undefined): LiquidModule | undefined;
|
|
2
|
+
import { AssetModule, AppGraph, AppModule, LiquidModule } from '../types';
|
|
3
|
+
export declare function getModule(appGraph: AppGraph, uri: UriString): AppModule | undefined;
|
|
4
|
+
export declare function getAssetModule(appGraph: AppGraph, asset: string): AssetModule | undefined;
|
|
5
|
+
export declare function getPartialModule(appGraph: AppGraph, partial: string): LiquidModule;
|
|
6
|
+
export declare function getLayoutModule(appGraph: AppGraph, layoutUri: string | false | undefined): LiquidModule | undefined;
|
|
7
|
+
export declare function getPageModule(appGraph: AppGraph, pageUri: string): LiquidModule;
|
package/dist/graph/module.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getModule = getModule;
|
|
4
|
-
exports.getTemplateModule = getTemplateModule;
|
|
5
|
-
exports.getThemeBlockModule = getThemeBlockModule;
|
|
6
|
-
exports.getSectionModule = getSectionModule;
|
|
7
|
-
exports.getSectionGroupModule = getSectionGroupModule;
|
|
8
4
|
exports.getAssetModule = getAssetModule;
|
|
9
5
|
exports.getPartialModule = getPartialModule;
|
|
10
6
|
exports.getLayoutModule = getLayoutModule;
|
|
7
|
+
exports.getPageModule = getPageModule;
|
|
11
8
|
const platformos_check_common_1 = require("@platformos/platformos-check-common");
|
|
12
9
|
const types_1 = require("../types");
|
|
13
10
|
const utils_1 = require("../utils");
|
|
@@ -19,131 +16,64 @@ const utils_1 = require("../utils");
|
|
|
19
16
|
* graphs' modules record), we want to avoid creating two different module objects
|
|
20
17
|
* that represent the same file.
|
|
21
18
|
*
|
|
22
|
-
* We're using a WeakMap<
|
|
19
|
+
* We're using a WeakMap<AppGraph> to cache modules so that if the app graph
|
|
23
20
|
* gets garbage collected, the module cache will also be garbage collected.
|
|
24
21
|
*
|
|
25
22
|
* This allows us to have a module cache without changing the API of the
|
|
26
|
-
*
|
|
23
|
+
* AppGraph (no need for a `visited` property on modules, etc.)
|
|
27
24
|
*/
|
|
28
25
|
const ModuleCache = new WeakMap();
|
|
29
|
-
function getModule(
|
|
30
|
-
const cache = getCache(
|
|
26
|
+
function getModule(appGraph, uri) {
|
|
27
|
+
const cache = getCache(appGraph);
|
|
31
28
|
if (cache.has(uri)) {
|
|
32
29
|
return cache.get(uri);
|
|
33
30
|
}
|
|
34
|
-
const relativePath = platformos_check_common_1.path.relative(uri,
|
|
31
|
+
const relativePath = platformos_check_common_1.path.relative(uri, appGraph.rootUri);
|
|
35
32
|
switch (true) {
|
|
36
|
-
case relativePath.startsWith('assets'): {
|
|
37
|
-
return getAssetModule(
|
|
33
|
+
case relativePath.startsWith('assets') || relativePath.startsWith('modules'): {
|
|
34
|
+
return getAssetModule(appGraph, platformos_check_common_1.path.basename(uri));
|
|
38
35
|
}
|
|
39
|
-
case relativePath.
|
|
40
|
-
return
|
|
36
|
+
case relativePath.includes('views/layouts'): {
|
|
37
|
+
return getLayoutModule(appGraph, uri);
|
|
41
38
|
}
|
|
42
|
-
case relativePath.
|
|
43
|
-
return
|
|
39
|
+
case relativePath.includes('views/pages'): {
|
|
40
|
+
return getPageModule(appGraph, uri);
|
|
44
41
|
}
|
|
45
|
-
case relativePath.
|
|
46
|
-
|
|
47
|
-
return getSectionGroupModule(themeGraph, platformos_check_common_1.path.basename(uri, '.json'));
|
|
48
|
-
}
|
|
49
|
-
return getSectionModule(themeGraph, platformos_check_common_1.path.basename(uri, '.liquid'));
|
|
50
|
-
}
|
|
51
|
-
case relativePath.includes('/views/partials') || relativePath.includes('/lib/'): {
|
|
52
|
-
return getPartialModule(themeGraph, platformos_check_common_1.path.basename(uri, '.liquid'));
|
|
42
|
+
case relativePath.includes('views/partials') || relativePath.includes('/lib/'): {
|
|
43
|
+
return getPartialModule(appGraph, platformos_check_common_1.path.basename(uri, '.liquid'));
|
|
53
44
|
}
|
|
54
45
|
case relativePath.startsWith('snippets'): {
|
|
55
|
-
return getPartialModule(
|
|
56
|
-
}
|
|
57
|
-
case relativePath.startsWith('templates'): {
|
|
58
|
-
return getTemplateModule(themeGraph, uri);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function getTemplateModule(themeGraph, uri) {
|
|
63
|
-
const extension = (0, utils_1.extname)(uri);
|
|
64
|
-
switch (extension) {
|
|
65
|
-
case 'json': {
|
|
66
|
-
return module(themeGraph, {
|
|
67
|
-
type: "JSON" /* ModuleType.Json */,
|
|
68
|
-
kind: "template" /* JsonModuleKind.Template */,
|
|
69
|
-
dependencies: [],
|
|
70
|
-
references: [],
|
|
71
|
-
uri: uri,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
case 'liquid': {
|
|
75
|
-
return module(themeGraph, {
|
|
76
|
-
type: "Liquid" /* ModuleType.Liquid */,
|
|
77
|
-
kind: "template" /* LiquidModuleKind.Template */,
|
|
78
|
-
dependencies: [],
|
|
79
|
-
references: [],
|
|
80
|
-
uri: uri,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
default: {
|
|
84
|
-
throw new Error(`Unknown template type for ${uri}`);
|
|
46
|
+
return getPartialModule(appGraph, platformos_check_common_1.path.basename(uri, '.liquid'));
|
|
85
47
|
}
|
|
86
48
|
}
|
|
87
49
|
}
|
|
88
|
-
function
|
|
89
|
-
const uri = platformos_check_common_1.path.join(themeGraph.rootUri, 'blocks', `${blockType}.liquid`);
|
|
90
|
-
return module(themeGraph, {
|
|
91
|
-
type: "Liquid" /* ModuleType.Liquid */,
|
|
92
|
-
kind: "block" /* LiquidModuleKind.Block */,
|
|
93
|
-
dependencies: [],
|
|
94
|
-
references: [],
|
|
95
|
-
uri,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
function getSectionModule(themeGraph, sectionType) {
|
|
99
|
-
const uri = platformos_check_common_1.path.join(themeGraph.rootUri, 'sections', `${sectionType}.liquid`);
|
|
100
|
-
return module(themeGraph, {
|
|
101
|
-
type: "Liquid" /* ModuleType.Liquid */,
|
|
102
|
-
kind: "section" /* LiquidModuleKind.Section */,
|
|
103
|
-
dependencies: [],
|
|
104
|
-
references: [],
|
|
105
|
-
uri,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
function getSectionGroupModule(themeGraph, sectionGroupType) {
|
|
109
|
-
const uri = platformos_check_common_1.path.join(themeGraph.rootUri, 'sections', `${sectionGroupType}.json`);
|
|
110
|
-
return module(themeGraph, {
|
|
111
|
-
type: "JSON" /* ModuleType.Json */,
|
|
112
|
-
kind: "section-group" /* JsonModuleKind.SectionGroup */,
|
|
113
|
-
dependencies: [],
|
|
114
|
-
references: [],
|
|
115
|
-
uri,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
function getAssetModule(themeGraph, asset) {
|
|
50
|
+
function getAssetModule(appGraph, asset) {
|
|
119
51
|
const extension = (0, utils_1.extname)(asset);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
if (!type) {
|
|
52
|
+
const SUPPORTED_ASSET_EXTENSIONS = [
|
|
53
|
+
...types_1.SUPPORTED_ASSET_IMAGE_EXTENSIONS,
|
|
54
|
+
'js',
|
|
55
|
+
'css',
|
|
56
|
+
'svg',
|
|
57
|
+
'pdf',
|
|
58
|
+
'woff',
|
|
59
|
+
'woff2',
|
|
60
|
+
'ttf',
|
|
61
|
+
'eot',
|
|
62
|
+
];
|
|
63
|
+
if (!SUPPORTED_ASSET_EXTENSIONS.includes(extension)) {
|
|
134
64
|
return undefined;
|
|
135
65
|
}
|
|
136
|
-
return module(
|
|
137
|
-
type
|
|
66
|
+
return module(appGraph, {
|
|
67
|
+
type: "Asset" /* ModuleType.Asset */,
|
|
138
68
|
kind: 'unused',
|
|
139
69
|
dependencies: [],
|
|
140
70
|
references: [],
|
|
141
|
-
uri: platformos_check_common_1.path.join(
|
|
71
|
+
uri: platformos_check_common_1.path.join(appGraph.rootUri, 'assets', asset),
|
|
142
72
|
});
|
|
143
73
|
}
|
|
144
|
-
function getPartialModule(
|
|
145
|
-
const uri = platformos_check_common_1.path.join(
|
|
146
|
-
return module(
|
|
74
|
+
function getPartialModule(appGraph, partial) {
|
|
75
|
+
const uri = platformos_check_common_1.path.join(appGraph.rootUri, 'app/views/partials', `${partial}.liquid`);
|
|
76
|
+
return module(appGraph, {
|
|
147
77
|
type: "Liquid" /* ModuleType.Liquid */,
|
|
148
78
|
kind: "partial" /* LiquidModuleKind.Partial */,
|
|
149
79
|
uri: uri,
|
|
@@ -151,28 +81,34 @@ function getPartialModule(themeGraph, partial) {
|
|
|
151
81
|
references: [],
|
|
152
82
|
});
|
|
153
83
|
}
|
|
154
|
-
function getLayoutModule(
|
|
155
|
-
if (
|
|
84
|
+
function getLayoutModule(appGraph, layoutUri) {
|
|
85
|
+
if (!layoutUri)
|
|
156
86
|
return undefined;
|
|
157
|
-
|
|
158
|
-
layoutName = 'theme';
|
|
159
|
-
const uri = platformos_check_common_1.path.join(themeGraph.rootUri, 'layout', `${layoutName}.liquid`);
|
|
160
|
-
return module(themeGraph, {
|
|
87
|
+
return module(appGraph, {
|
|
161
88
|
type: "Liquid" /* ModuleType.Liquid */,
|
|
162
89
|
kind: "layout" /* LiquidModuleKind.Layout */,
|
|
163
|
-
uri:
|
|
90
|
+
uri: layoutUri,
|
|
91
|
+
dependencies: [],
|
|
92
|
+
references: [],
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function getPageModule(appGraph, pageUri) {
|
|
96
|
+
return module(appGraph, {
|
|
97
|
+
type: "Liquid" /* ModuleType.Liquid */,
|
|
98
|
+
kind: "page" /* LiquidModuleKind.Page */,
|
|
99
|
+
uri: pageUri,
|
|
164
100
|
dependencies: [],
|
|
165
101
|
references: [],
|
|
166
102
|
});
|
|
167
103
|
}
|
|
168
|
-
function getCache(
|
|
169
|
-
if (!ModuleCache.has(
|
|
170
|
-
ModuleCache.set(
|
|
104
|
+
function getCache(appGraph) {
|
|
105
|
+
if (!ModuleCache.has(appGraph)) {
|
|
106
|
+
ModuleCache.set(appGraph, new Map());
|
|
171
107
|
}
|
|
172
|
-
return ModuleCache.get(
|
|
108
|
+
return ModuleCache.get(appGraph);
|
|
173
109
|
}
|
|
174
|
-
function module(
|
|
175
|
-
const cache = getCache(
|
|
110
|
+
function module(appGraph, mod) {
|
|
111
|
+
const cache = getCache(appGraph);
|
|
176
112
|
if (!cache.has(mod.uri)) {
|
|
177
113
|
cache.set(mod.uri, mod);
|
|
178
114
|
}
|
package/dist/graph/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/graph/module.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3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B,eAAe,CAC7B,QAAkB,EAClB,SAAqC;IAErC,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IACjC,OAAO,MAAM,CAAC,QAAQ,EAAE;QACtB,IAAI,kCAAmB;QACvB,IAAI,wCAAyB;QAC7B,GAAG,EAAE,SAAS;QACd,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,EAAE;KACf,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,aAAa,CAAC,QAAkB,EAAE,OAAe;IAC/D,OAAO,MAAM,CAAC,QAAQ,EAAE;QACtB,IAAI,kCAAmB;QACvB,IAAI,oCAAuB;QAC3B,GAAG,EAAE,OAAO;QACZ,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,EAAE;KACf,CAAC,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,QAAkB;IAClC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/B,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;AACpC,CAAC;AAED,SAAS,MAAM,CAAsB,QAAkB,EAAE,GAAM;IAC7D,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAO,CAAC;AAClC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SerializableGraph,
|
|
2
|
-
export declare function
|
|
1
|
+
import { SerializableGraph, AppGraph } from '../types';
|
|
2
|
+
export declare function serializeAppGraph(graph: AppGraph): SerializableGraph;
|
package/dist/graph/serialize.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
3
|
+
exports.serializeAppGraph = serializeAppGraph;
|
|
4
|
+
function serializeAppGraph(graph) {
|
|
5
5
|
const nodes = Object.values(graph.modules).map((module) => ({
|
|
6
6
|
uri: module.uri,
|
|
7
7
|
type: module.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../src/graph/serialize.ts"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../src/graph/serialize.ts"],"names":[],"mappings":";;AAEA,8CAiBC;AAjBD,SAAgB,iBAAiB,CAAC,KAAe;IAC/C,MAAM,KAAK,GAAuB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9E,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzD,CAAC,CAAC,CAAC;IAEJ,MAAM,KAAK,GAAuB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CACpE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAChC,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SectionSchema, ThemeBlockSchema } from '@platformos/platformos-check-common';
|
|
2
1
|
import { AbstractFileSystem } from '@platformos/platformos-common';
|
|
3
2
|
export declare function makeGetSourceCode(fs: AbstractFileSystem): {
|
|
4
3
|
(x: string): Promise<import("..").FileSourceCode>;
|
|
@@ -10,18 +9,6 @@ export declare const fixturesRoot: string;
|
|
|
10
9
|
export declare const skeleton: string;
|
|
11
10
|
export declare function getDependencies(rootUri: string, fs?: AbstractFileSystem): Promise<{
|
|
12
11
|
fs: AbstractFileSystem;
|
|
13
|
-
getSectionSchema: {
|
|
14
|
-
(x: string): Promise<SectionSchema>;
|
|
15
|
-
force(x: string): Promise<SectionSchema>;
|
|
16
|
-
invalidate(x: string): void;
|
|
17
|
-
clearCache(): void;
|
|
18
|
-
};
|
|
19
|
-
getBlockSchema: {
|
|
20
|
-
(x: string): Promise<ThemeBlockSchema>;
|
|
21
|
-
force(x: string): Promise<ThemeBlockSchema>;
|
|
22
|
-
invalidate(x: string): void;
|
|
23
|
-
clearCache(): void;
|
|
24
|
-
};
|
|
25
12
|
getSourceCode: {
|
|
26
13
|
(x: string): Promise<import("..").FileSourceCode>;
|
|
27
14
|
force(x: string): Promise<import("..").FileSourceCode>;
|
|
@@ -23,16 +23,6 @@ async function getDependencies(rootUri, fs = platformos_check_node_1.NodeFileSys
|
|
|
23
23
|
const getSourceCode = makeGetSourceCode(fs);
|
|
24
24
|
const deps = {
|
|
25
25
|
fs,
|
|
26
|
-
getSectionSchema: (0, platformos_check_common_1.memoize)(async (name) => {
|
|
27
|
-
const uri = platformos_check_common_1.path.join(exports.skeleton, 'sections', `${name}.liquid`);
|
|
28
|
-
const sourceCode = (await getSourceCode(uri));
|
|
29
|
-
return (await (0, platformos_check_common_1.toSchema)('theme', uri, sourceCode, async () => true));
|
|
30
|
-
}, utils_1.identity),
|
|
31
|
-
getBlockSchema: (0, platformos_check_common_1.memoize)(async (name) => {
|
|
32
|
-
const uri = platformos_check_common_1.path.join(exports.skeleton, 'blocks', `${name}.liquid`);
|
|
33
|
-
const sourceCode = (await getSourceCode(uri));
|
|
34
|
-
return (await (0, platformos_check_common_1.toSchema)('theme', uri, sourceCode, async () => true));
|
|
35
|
-
}, utils_1.identity),
|
|
36
26
|
getSourceCode,
|
|
37
27
|
getWebComponentDefinitionReference: (customElementName) => webComponentDefs.get(customElementName),
|
|
38
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../../src/graph/test-helpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../../src/graph/test-helpers.ts"],"names":[],"mappings":";;;AASA,8CAKC;AAKD,0CAYC;AAGD,4BAKC;AAvCD,iFAAiF;AAEjF,6EAAmE;AACnE,mCAA4B;AAC5B,2CAAiC;AACjC,8DAA2D;AAC3D,kDAA+C;AAC/C,oCAAoC;AAEpC,SAAgB,iBAAiB,CAAC,EAAsB;IACtD,OAAO,IAAA,iCAAO,EAAC,KAAK,UAAU,aAAa,CAAC,GAAW;QACrD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACtC,OAAO,IAAA,2BAAY,EAAC,gBAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC,EAAE,gBAAQ,CAAC,CAAC;AACf,CAAC;AAEY,QAAA,YAAY,GAAG,8BAAS,CAAC,IAAI,CAAC,gBAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACnF,QAAA,QAAQ,GAAG,8BAAS,CAAC,IAAI,CAAC,oBAAY,EAAE,UAAU,CAAC,CAAC;AAE1D,KAAK,UAAU,eAAe,CAAC,OAAe,EAAE,KAAyB,sCAAc;IAC5F,MAAM,aAAa,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG;QACX,EAAE;QACF,aAAa;QACb,kCAAkC,EAAE,CAAC,iBAAyB,EAAE,EAAE,CAChE,gBAAgB,CAAC,GAAG,CAAC,iBAAiB,CAAC;KAC1C,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAM,IAAA,uCAAkB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAEjE,OAAO,IAAI,CAAC;AACd,CAAC;AAED,sCAAsC;AACtC,SAAgB,QAAQ,CAAC,GAAQ,EAAE,MAAW,EAAE,QAAa;IAC3D,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,WAAE,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,kBAAkB,CAAC;QAC9C,OAAO,QAAQ,CAAC,QAAQ,EAAE,GAAG,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/graph/traverse.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AugmentedDependencies,
|
|
2
|
-
export declare function traverseModule(module:
|
|
1
|
+
import { AugmentedDependencies, AppGraph, AppModule, Range, Reference, Void } from '../types';
|
|
2
|
+
export declare function traverseModule(module: AppModule, appGraph: AppGraph, deps: AugmentedDependencies): Promise<Void>;
|
|
3
3
|
/**
|
|
4
4
|
* The bind method is the method that links two modules together.
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@ export declare function traverseModule(module: ThemeModule, themeGraph: ThemeGra
|
|
|
7
7
|
*
|
|
8
8
|
* This function mutates the source and target modules.
|
|
9
9
|
*/
|
|
10
|
-
export declare function bind(source:
|
|
10
|
+
export declare function bind(source: AppModule, target: AppModule, { sourceRange, targetRange, type, }?: {
|
|
11
11
|
sourceRange?: Range;
|
|
12
12
|
targetRange?: Range;
|
|
13
13
|
type?: Reference['type'];
|