@teleporthq/teleport-project-generator-html 0.19.3 → 0.19.11
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/__tests__/end2end/index.ts +19 -6
- package/__tests__/index.ts +144 -0
- package/dist/cjs/index.js +7 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{utils.d.ts → plugin-clone-globals.d.ts} +2 -2
- package/dist/cjs/{utils.js → plugin-clone-globals.js} +37 -20
- package/dist/cjs/plugin-clone-globals.js.map +1 -0
- package/dist/cjs/plugin-image-resolution.d.ts +11 -0
- package/dist/cjs/plugin-image-resolution.js +152 -0
- package/dist/cjs/plugin-image-resolution.js.map +1 -0
- package/dist/cjs/project-template.js +1 -1
- package/dist/cjs/project-template.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/index.js +7 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{utils.d.ts → plugin-clone-globals.d.ts} +2 -2
- package/dist/esm/{utils.js → plugin-clone-globals.js} +36 -19
- package/dist/esm/plugin-clone-globals.js.map +1 -0
- package/dist/esm/plugin-image-resolution.d.ts +11 -0
- package/dist/esm/plugin-image-resolution.js +146 -0
- package/dist/esm/plugin-image-resolution.js.map +1 -0
- package/dist/esm/project-template.js +1 -1
- package/dist/esm/project-template.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/src/index.ts +7 -5
- package/src/path-browserisify.d.ts +4 -0
- package/src/plugin-clone-globals.ts +78 -0
- package/src/plugin-image-resolution.ts +120 -0
- package/src/project-template.ts +1 -4
- package/dist/cjs/utils.js.map +0 -1
- package/dist/esm/utils.js.map +0 -1
- package/src/utils.ts +0 -54
|
@@ -9,17 +9,23 @@ describe('Html Project Generator', () => {
|
|
|
9
9
|
|
|
10
10
|
it('runs without crasing', async () => {
|
|
11
11
|
const { name, files, subFolders } = await generator.generateProject(uidlSample, HTMLTemplate)
|
|
12
|
-
const
|
|
13
|
-
const aboutPage = pages.files.find(
|
|
12
|
+
const aboutPage = subFolders[0]?.files.find(
|
|
14
13
|
(page) => page.name === 'about' && page.fileType === FileType.HTML
|
|
15
14
|
)
|
|
15
|
+
const homePage = subFolders[0]?.files.find(
|
|
16
|
+
(page) => page.name === 'landing-page' && page.fileType === FileType.HTML
|
|
17
|
+
)
|
|
18
|
+
const homeCSS = subFolders[0]?.files.find(
|
|
19
|
+
(page) => page.name === 'landing-page' && page.fileType === FileType.CSS
|
|
20
|
+
)
|
|
16
21
|
|
|
17
22
|
expect(name).toBe('teleport-project-html')
|
|
18
23
|
expect(files.length).toBe(1)
|
|
19
|
-
expect(
|
|
20
|
-
expect(subFolders.length).toBe(1)
|
|
24
|
+
expect(subFolders.length).toBe(2)
|
|
21
25
|
expect(aboutPage.content).toContain('head')
|
|
22
26
|
expect(aboutPage.content).toContain('html')
|
|
27
|
+
expect(homePage.content).toContain('public/playground_assets/kitten.png')
|
|
28
|
+
expect(homeCSS.content).toContain('public/playground_assets/kitten.png')
|
|
23
29
|
})
|
|
24
30
|
|
|
25
31
|
it('run withut crashing and appends entry things into single index.html', async () => {
|
|
@@ -28,16 +34,23 @@ describe('Html Project Generator', () => {
|
|
|
28
34
|
uidlSample,
|
|
29
35
|
HTMLTemplate
|
|
30
36
|
)
|
|
31
|
-
const
|
|
32
|
-
const aboutPage = pages.files.find(
|
|
37
|
+
const aboutPage = subFolders[0]?.files.find(
|
|
33
38
|
(page) => page.name === 'about' && page.fileType === FileType.HTML
|
|
34
39
|
)
|
|
40
|
+
const homePage = subFolders[0]?.files.find(
|
|
41
|
+
(page) => page.name === 'landing-page' && page.fileType === FileType.HTML
|
|
42
|
+
)
|
|
43
|
+
const homeCSS = subFolders[0]?.files.find(
|
|
44
|
+
(page) => page.name === 'landing-page' && page.fileType === FileType.CSS
|
|
45
|
+
)
|
|
35
46
|
|
|
36
47
|
expect(name).toBe('teleport-project-html')
|
|
37
48
|
expect(files.length).toBe(1)
|
|
38
49
|
expect(subFolders.length).toBe(2)
|
|
39
50
|
expect(aboutPage.content).not.toContain('head')
|
|
40
51
|
expect(aboutPage.content).not.toContain('html')
|
|
52
|
+
expect(homePage.content).toContain('public/playground_assets/kitten.png')
|
|
53
|
+
expect(homeCSS.content).toContain('public/playground_assets/kitten.png')
|
|
41
54
|
})
|
|
42
55
|
|
|
43
56
|
it('throws error when invalid UIDL sample is used', async () => {
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InMemoryFileRecord,
|
|
3
|
+
ProjectPluginStructure,
|
|
4
|
+
ProjectStrategy,
|
|
5
|
+
ProjectUIDL,
|
|
6
|
+
UIDLElementNode,
|
|
7
|
+
UIDLElementNodeInlineReferencedStyle,
|
|
8
|
+
} from '@teleporthq/teleport-types'
|
|
9
|
+
import { element, elementNode, staticNode } from '@teleporthq/teleport-uidl-builders'
|
|
10
|
+
import { UIDLUtils } from '@teleporthq/teleport-shared'
|
|
11
|
+
import ProjectTemplate from '../src/project-template'
|
|
12
|
+
import { pluginImageResolver } from '../src/plugin-image-resolution'
|
|
13
|
+
|
|
14
|
+
describe('Image Resolution project-plugin', () => {
|
|
15
|
+
const files = new Map<string, InMemoryFileRecord>()
|
|
16
|
+
it('resolves all local assets to be refered from public folder', async () => {
|
|
17
|
+
const projectUIDL: ProjectUIDL = {
|
|
18
|
+
name: 'teleport-html',
|
|
19
|
+
globals: {
|
|
20
|
+
settings: {
|
|
21
|
+
title: 'teleport-html',
|
|
22
|
+
language: 'en',
|
|
23
|
+
},
|
|
24
|
+
assets: [],
|
|
25
|
+
meta: [],
|
|
26
|
+
},
|
|
27
|
+
root: {
|
|
28
|
+
name: 'root',
|
|
29
|
+
styleSetDefinitions: {
|
|
30
|
+
bgImage: {
|
|
31
|
+
type: 'reusable-project-style-map',
|
|
32
|
+
content: {
|
|
33
|
+
backgroundImage: staticNode('url("/playground_assets/kitten.png")'),
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
node: {
|
|
38
|
+
type: 'element',
|
|
39
|
+
content: element('div', {}, [
|
|
40
|
+
elementNode('image', { src: staticNode('/playground_assets/kitten.png') }),
|
|
41
|
+
elementNode('div', {}, [], null, {
|
|
42
|
+
backgroundImage: staticNode('url("/playground_assets/kitten.png")'),
|
|
43
|
+
}),
|
|
44
|
+
{
|
|
45
|
+
type: 'element',
|
|
46
|
+
content: {
|
|
47
|
+
semanticType: 'Home',
|
|
48
|
+
...element('component', { image: staticNode('/playground_assets/kitten.png') }),
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
]),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
components: {
|
|
55
|
+
Home: {
|
|
56
|
+
name: 'Home',
|
|
57
|
+
styleSetDefinitions: {
|
|
58
|
+
bgImageC: {
|
|
59
|
+
type: 'reusable-project-style-map',
|
|
60
|
+
content: {
|
|
61
|
+
backgroundImage: staticNode('url("/playground_assets/kitten.png")'),
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
propDefinitions: {
|
|
66
|
+
image: {
|
|
67
|
+
type: 'string',
|
|
68
|
+
defaultValue: '/playground_assets/kitten.png',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
node: elementNode('div', {}, [], { type: 'local' }, {}, null, {
|
|
72
|
+
primaryButton: {
|
|
73
|
+
type: 'style-map',
|
|
74
|
+
content: {
|
|
75
|
+
mapType: 'inlined',
|
|
76
|
+
conditions: [{ maxWidth: 991, conditionType: 'screen-size' }],
|
|
77
|
+
styles: {
|
|
78
|
+
backgroundImage: staticNode('url("/playground_assets/kitten.png")'),
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const structrue: ProjectPluginStructure = {
|
|
88
|
+
uidl: projectUIDL,
|
|
89
|
+
files,
|
|
90
|
+
dependencies: {},
|
|
91
|
+
template: ProjectTemplate,
|
|
92
|
+
strategy: {
|
|
93
|
+
id: 'teleport-project-html',
|
|
94
|
+
pages: {
|
|
95
|
+
path: ['src', 'pages'],
|
|
96
|
+
},
|
|
97
|
+
components: {
|
|
98
|
+
path: ['src', 'components'],
|
|
99
|
+
},
|
|
100
|
+
static: {
|
|
101
|
+
path: ['public'],
|
|
102
|
+
},
|
|
103
|
+
} as ProjectStrategy,
|
|
104
|
+
devDependencies: {},
|
|
105
|
+
rootFolder: UIDLUtils.cloneObject(ProjectTemplate),
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const result = await pluginImageResolver.runBefore(structrue)
|
|
109
|
+
const { uidl } = result
|
|
110
|
+
const rootNode = uidl.root.node.content
|
|
111
|
+
|
|
112
|
+
/* Using assets on dom nodes like image tags */
|
|
113
|
+
expect((rootNode.children[0] as UIDLElementNode).content.attrs?.src?.content).toBe(
|
|
114
|
+
'../../public/playground_assets/kitten.png'
|
|
115
|
+
)
|
|
116
|
+
/* Using assets in style sheets */
|
|
117
|
+
expect((rootNode.children[1] as UIDLElementNode).content.style?.backgroundImage?.content).toBe(
|
|
118
|
+
'url("../../public/playground_assets/kitten.png")'
|
|
119
|
+
)
|
|
120
|
+
/* Using attrs while passing as a prop for a component call */
|
|
121
|
+
expect((rootNode.children[2] as UIDLElementNode).content.attrs.image?.content).toBe(
|
|
122
|
+
'../../public/playground_assets/kitten.png'
|
|
123
|
+
)
|
|
124
|
+
/* Using assets as defaultProp for component definition */
|
|
125
|
+
expect(uidl.components.Home.propDefinitions.image.defaultValue).toBe(
|
|
126
|
+
'../../public/playground_assets/kitten.png'
|
|
127
|
+
)
|
|
128
|
+
/* Using assets in global styleSetDefinitions */
|
|
129
|
+
expect(uidl.root.styleSetDefinitions.bgImage.content.backgroundImage.content).toBe(
|
|
130
|
+
'url("../../public/playground_assets/kitten.png")'
|
|
131
|
+
)
|
|
132
|
+
/* Using assets for component scoped styles */
|
|
133
|
+
expect(uidl.components.Home.styleSetDefinitions.bgImageC.content.backgroundImage.content).toBe(
|
|
134
|
+
'url("../../public/playground_assets/kitten.png")'
|
|
135
|
+
)
|
|
136
|
+
/* Using assets for media queries */
|
|
137
|
+
expect(
|
|
138
|
+
(
|
|
139
|
+
uidl.components.Home.node.content.referencedStyles
|
|
140
|
+
.primaryButton as UIDLElementNodeInlineReferencedStyle
|
|
141
|
+
).content?.styles.backgroundImage.content
|
|
142
|
+
).toBe('url("../../public/playground_assets/kitten.png")')
|
|
143
|
+
})
|
|
144
|
+
})
|
package/dist/cjs/index.js
CHANGED
|
@@ -11,18 +11,19 @@ var teleport_plugin_css_1 = require("@teleporthq/teleport-plugin-css");
|
|
|
11
11
|
var teleport_postprocessor_prettier_html_1 = __importDefault(require("@teleporthq/teleport-postprocessor-prettier-html"));
|
|
12
12
|
var project_template_1 = __importDefault(require("./project-template"));
|
|
13
13
|
exports.HTMLTemplate = project_template_1.default;
|
|
14
|
-
var
|
|
14
|
+
var plugin_clone_globals_1 = require("./plugin-clone-globals");
|
|
15
|
+
var plugin_image_resolution_1 = require("./plugin-image-resolution");
|
|
15
16
|
var createHTMLProjectGenerator = function (config) {
|
|
16
17
|
var individualEntyFile = (config || { individualEntyFile: true }).individualEntyFile;
|
|
17
18
|
var generator = teleport_project_generator_1.createProjectGenerator({
|
|
18
19
|
id: 'teleport-project-html',
|
|
19
20
|
components: {
|
|
20
21
|
generator: teleport_component_generator_html_1.createHTMLComponentGenerator,
|
|
21
|
-
path: ['
|
|
22
|
+
path: ['components'],
|
|
22
23
|
},
|
|
23
24
|
pages: {
|
|
24
25
|
generator: teleport_component_generator_html_1.createHTMLComponentGenerator,
|
|
25
|
-
path: ['
|
|
26
|
+
path: [''],
|
|
26
27
|
},
|
|
27
28
|
static: {
|
|
28
29
|
prefix: '',
|
|
@@ -32,7 +33,7 @@ var createHTMLProjectGenerator = function (config) {
|
|
|
32
33
|
generator: teleport_component_generator_1.createComponentGenerator,
|
|
33
34
|
plugins: [teleport_plugin_css_1.createStyleSheetPlugin()],
|
|
34
35
|
fileName: 'style',
|
|
35
|
-
path: ['
|
|
36
|
+
path: [''],
|
|
36
37
|
importFile: true,
|
|
37
38
|
},
|
|
38
39
|
entry: {
|
|
@@ -41,8 +42,9 @@ var createHTMLProjectGenerator = function (config) {
|
|
|
41
42
|
path: [''],
|
|
42
43
|
},
|
|
43
44
|
});
|
|
45
|
+
generator.addPlugin(plugin_image_resolution_1.pluginImageResolver);
|
|
44
46
|
if (individualEntyFile) {
|
|
45
|
-
generator.addPlugin(
|
|
47
|
+
generator.addPlugin(plugin_clone_globals_1.pluginCloneGlobals);
|
|
46
48
|
}
|
|
47
49
|
return generator;
|
|
48
50
|
};
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,qFAA+E;AAC/E,mGAA4F;AAC5F,yFAAmF;AACnF,uEAAwE;AACxE,0HAA2E;AAC3E,wEAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,qFAA+E;AAC/E,mGAA4F;AAC5F,yFAAmF;AACnF,uEAAwE;AACxE,0HAA2E;AAC3E,wEAA6C;AA2CR,uBA3C9B,0BAAY,CA2C8B;AA1CjD,+DAA2D;AAC3D,qEAA+D;AAE/D,IAAM,0BAA0B,GAAG,UAAC,MAAwC;IAClE,IAAA,kBAAkB,GAAK,CAAA,MAAM,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAA,mBAA3C,CAA2C;IAErE,IAAM,SAAS,GAAG,mDAAsB,CAAC;QACvC,EAAE,EAAE,uBAAuB;QAC3B,UAAU,EAAE;YACV,SAAS,EAAE,gEAA4B;YACvC,IAAI,EAAE,CAAC,YAAY,CAAC;SACrB;QACD,KAAK,EAAE;YACL,SAAS,EAAE,gEAA4B;YACvC,IAAI,EAAE,CAAC,EAAE,CAAC;SACX;QACD,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,CAAC,QAAQ,CAAC;SACjB;QACD,iBAAiB,EAAE;YACjB,SAAS,EAAE,uDAAwB;YACnC,OAAO,EAAE,CAAC,4CAAsB,EAAE,CAAC;YACnC,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,CAAC,EAAE,CAAC;YACV,UAAU,EAAE,IAAI;SACjB;QACD,KAAK,EAAE;YACL,cAAc,EAAE,CAAC,8CAAY,CAAC;YAC9B,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,CAAC,EAAE,CAAC;SACX;KACF,CAAC,CAAA;IAEF,SAAS,CAAC,SAAS,CAAC,6CAAmB,CAAC,CAAA;IACxC,IAAI,kBAAkB,EAAE;QACtB,SAAS,CAAC,SAAS,CAAC,yCAAkB,CAAC,CAAA;KACxC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAEQ,gEAA0B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ProjectPlugin, ProjectPluginStructure } from '@teleporthq/teleport-types';
|
|
2
|
-
declare class
|
|
2
|
+
declare class ProjectPluginCloneGlobals implements ProjectPlugin {
|
|
3
3
|
runBefore(structure: ProjectPluginStructure): Promise<ProjectPluginStructure>;
|
|
4
4
|
runAfter(structure: ProjectPluginStructure): Promise<ProjectPluginStructure>;
|
|
5
5
|
}
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const pluginCloneGlobals: Readonly<ProjectPluginCloneGlobals>;
|
|
7
7
|
export {};
|
|
@@ -39,47 +39,64 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.
|
|
42
|
+
exports.pluginCloneGlobals = void 0;
|
|
43
43
|
var teleport_types_1 = require("@teleporthq/teleport-types");
|
|
44
44
|
var node_html_parser_1 = require("node-html-parser");
|
|
45
45
|
var teleport_postprocessor_prettier_html_1 = __importDefault(require("@teleporthq/teleport-postprocessor-prettier-html"));
|
|
46
|
-
var
|
|
47
|
-
function
|
|
46
|
+
var ProjectPluginCloneGlobals = /** @class */ (function () {
|
|
47
|
+
function ProjectPluginCloneGlobals() {
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
ProjectPluginCloneGlobals.prototype.runBefore = function (structure) {
|
|
50
50
|
return __awaiter(this, void 0, void 0, function () {
|
|
51
51
|
return __generator(this, function (_a) {
|
|
52
52
|
return [2 /*return*/, structure];
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
ProjectPluginCloneGlobals.prototype.runAfter = function (structure) {
|
|
57
57
|
var _a;
|
|
58
58
|
return __awaiter(this, void 0, void 0, function () {
|
|
59
|
-
var files, uidl, entryFile,
|
|
59
|
+
var files, uidl, entryFile, parsedEntryFile, body, head, scriptTags;
|
|
60
60
|
return __generator(this, function (_b) {
|
|
61
61
|
files = structure.files, uidl = structure.uidl;
|
|
62
62
|
entryFile = files.get('entry');
|
|
63
63
|
if (!entryFile) {
|
|
64
64
|
return [2 /*return*/, structure];
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
body =
|
|
66
|
+
parsedEntryFile = node_html_parser_1.parse(entryFile.files[0].content);
|
|
67
|
+
body = parsedEntryFile.querySelector('body');
|
|
68
|
+
head = parsedEntryFile.querySelector('head');
|
|
69
|
+
scriptTags = body.querySelectorAll('script');
|
|
68
70
|
body.childNodes = [];
|
|
69
71
|
if (Object.values(((_a = uidl.root) === null || _a === void 0 ? void 0 : _a.styleSetDefinitions) || {}).length > 0) {
|
|
70
|
-
head =
|
|
71
|
-
head.appendChild(new node_html_parser_1.HTMLElement('link', {}, 'rel="stylesheet" href="../style.css"', result));
|
|
72
|
+
head.appendChild(new node_html_parser_1.HTMLElement('link', {}, 'rel="stylesheet" href="./style.css"', parsedEntryFile));
|
|
72
73
|
}
|
|
73
74
|
files.forEach(function (fileId, key) {
|
|
74
75
|
var path = fileId.path;
|
|
75
|
-
if (path
|
|
76
|
+
if (path[0] === '') {
|
|
76
77
|
var newFiles = fileId.files.map(function (file) {
|
|
77
|
-
var _a;
|
|
78
|
-
if (file.fileType === teleport_types_1.FileType.HTML) {
|
|
79
|
-
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
var _a, _b;
|
|
79
|
+
if (file.fileType === teleport_types_1.FileType.HTML && file.name !== entryFile.files[0].name) {
|
|
80
|
+
var parsedIndividualFile = node_html_parser_1.parse(file.content);
|
|
81
|
+
var metaTags = parsedIndividualFile.getElementsByTagName('meta');
|
|
82
|
+
var titleTags = parsedIndividualFile.getElementsByTagName('title');
|
|
83
|
+
metaTags.forEach(function (metaTag) {
|
|
84
|
+
head.childNodes.unshift(metaTag);
|
|
85
|
+
metaTag.remove();
|
|
86
|
+
});
|
|
87
|
+
titleTags.forEach(function (titleTag) {
|
|
88
|
+
var inheritedHeadTags = head.getElementsByTagName('title');
|
|
89
|
+
if (inheritedHeadTags.length > 0) {
|
|
90
|
+
head.removeChild(head.getElementsByTagName('title')[0]);
|
|
91
|
+
}
|
|
92
|
+
head.childNodes.unshift(titleTag);
|
|
93
|
+
titleTag.remove();
|
|
94
|
+
});
|
|
95
|
+
body.appendChild(parsedIndividualFile);
|
|
96
|
+
(_a = body.childNodes).push.apply(_a, scriptTags);
|
|
97
|
+
var prettyFile = teleport_postprocessor_prettier_html_1.default((_b = {},
|
|
98
|
+
_b[teleport_types_1.FileType.HTML] = parsedEntryFile.toString(),
|
|
99
|
+
_b));
|
|
83
100
|
return { name: file.name, content: prettyFile[teleport_types_1.FileType.HTML], fileType: teleport_types_1.FileType.HTML };
|
|
84
101
|
}
|
|
85
102
|
return file;
|
|
@@ -92,7 +109,7 @@ var ProjectPluginHTMLGeneratprs = /** @class */ (function () {
|
|
|
92
109
|
});
|
|
93
110
|
});
|
|
94
111
|
};
|
|
95
|
-
return
|
|
112
|
+
return ProjectPluginCloneGlobals;
|
|
96
113
|
}());
|
|
97
|
-
exports.
|
|
98
|
-
//# sourceMappingURL=
|
|
114
|
+
exports.pluginCloneGlobals = Object.freeze(new ProjectPluginCloneGlobals());
|
|
115
|
+
//# sourceMappingURL=plugin-clone-globals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-clone-globals.js","sourceRoot":"","sources":["../../src/plugin-clone-globals.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAKmC;AACnC,qDAAqD;AACrD,0HAA2E;AAE3E;IAAA;IAkEA,CAAC;IAjEO,6CAAS,GAAf,UAAgB,SAAiC;;;gBAC/C,sBAAO,SAAS,EAAA;;;KACjB;IAEK,4CAAQ,GAAd,UAAe,SAAiC;;;;;gBACtC,KAAK,GAAW,SAAS,MAApB,EAAE,IAAI,GAAK,SAAS,KAAd,CAAc;gBAC3B,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;gBACpC,IAAI,CAAC,SAAS,EAAE;oBACd,sBAAO,SAAS,EAAA;iBACjB;gBAEK,eAAe,GAAG,wBAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;gBACnD,IAAI,GAAG,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;gBAC5C,IAAI,GAAG,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;gBAE5C,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAA;gBAElD,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;gBAEpB,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,mBAAmB,KAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;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AC,MAAM,EAAE,CAAA;gCACnB,CAAC,CAAC,CAAA;gCAEF,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAA;gCACtC,CAAA,KAAA,IAAI,CAAC,UAAU,CAAA,CAAC,IAAI,WAAI,UAAU,EAAC;gCAEnC,IAAM,UAAU,GAAG,8CAAY;oCAC7B,GAAC,yBAAQ,CAAC,IAAI,IAAG,eAAe,CAAC,QAAQ,EAAE;wCAC3C,CAAA;gCAEF,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,yBAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,yBAAQ,CAAC,IAAI,EAAE,CAAA;6BACxF;4BACD,OAAO,IAAI,CAAA;wBACb,CAAC,CAAC,CAAA;wBACF,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,IAAI,MAAA,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;qBAC1C;gBACH,CAAC,CAAC,CAAA;gBAEF,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;gBACrB,sBAAO,SAAS,EAAA;;;KACjB;IACH,gCAAC;AAAD,CAAC,AAlED,IAkEC;AAEY,QAAA,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,yBAAyB,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProjectPlugin, ProjectPluginStructure } from '@teleporthq/teleport-types';
|
|
2
|
+
declare class ProjectPluginImageResolver implements ProjectPlugin {
|
|
3
|
+
private relativePath;
|
|
4
|
+
runBefore(structure: ProjectPluginStructure): Promise<ProjectPluginStructure>;
|
|
5
|
+
runAfter(structure: ProjectPluginStructure): Promise<ProjectPluginStructure>;
|
|
6
|
+
private resolvePropsAndStates;
|
|
7
|
+
private resolveFromStyles;
|
|
8
|
+
private imageResolver;
|
|
9
|
+
}
|
|
10
|
+
export declare const pluginImageResolver: ProjectPluginImageResolver;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.pluginImageResolver = void 0;
|
|
54
|
+
var teleport_shared_1 = require("@teleporthq/teleport-shared");
|
|
55
|
+
var path_browserify_1 = __importDefault(require("path-browserify"));
|
|
56
|
+
var parse = path_browserify_1.default.parse, join = path_browserify_1.default.join, relative = path_browserify_1.default.relative, isAbsolute = path_browserify_1.default.isAbsolute;
|
|
57
|
+
var ProjectPluginImageResolver = /** @class */ (function () {
|
|
58
|
+
function ProjectPluginImageResolver() {
|
|
59
|
+
var _this = this;
|
|
60
|
+
this.resolvePropsAndStates = function (defs) {
|
|
61
|
+
Object.keys(defs || {}).forEach(function (propKey) {
|
|
62
|
+
var propValue = defs[propKey];
|
|
63
|
+
if (propValue.type === 'string' &&
|
|
64
|
+
typeof (propValue === null || propValue === void 0 ? void 0 : propValue.defaultValue) === 'string' &&
|
|
65
|
+
parse(propValue === null || propValue === void 0 ? void 0 : propValue.defaultValue).dir.startsWith('/')) {
|
|
66
|
+
defs[propKey] = __assign(__assign({}, defs[propKey]), { defaultValue: join(_this.relativePath, propValue.defaultValue) });
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
this.resolveFromStyles = function (style) {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
if (((_a = style === null || style === void 0 ? void 0 : style.backgroundImage) === null || _a === void 0 ? void 0 : _a.type) === 'static' &&
|
|
73
|
+
typeof ((_b = style === null || style === void 0 ? void 0 : style.backgroundImage) === null || _b === void 0 ? void 0 : _b.content) === 'string') {
|
|
74
|
+
var bgImage = style.backgroundImage.content;
|
|
75
|
+
if (bgImage.includes('http')) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
var regex = /(?:\(['"]?)(.*?)(?:['"]?\))/;
|
|
79
|
+
var matches = regex.exec(bgImage);
|
|
80
|
+
if (matches && (matches === null || matches === void 0 ? void 0 : matches.length) > 0 && isAbsolute(matches[1])) {
|
|
81
|
+
style.backgroundImage.content = "url(\"" + join(_this.relativePath, matches[1]) + "\")";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
this.imageResolver = function (element) {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
_this.resolveFromStyles((element === null || element === void 0 ? void 0 : element.style) || {});
|
|
88
|
+
Object.values((element === null || element === void 0 ? void 0 : element.referencedStyles) || {}).forEach(function (styleRef) {
|
|
89
|
+
if (styleRef.content.mapType === 'inlined') {
|
|
90
|
+
_this.resolveFromStyles(styleRef.content.styles);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
if ((element === null || element === void 0 ? void 0 : element.elementType) === 'image' &&
|
|
94
|
+
((_b = (_a = element.attrs) === null || _a === void 0 ? void 0 : _a.src) === null || _b === void 0 ? void 0 : _b.type) === 'static' &&
|
|
95
|
+
typeof element.attrs.src.content === 'string' &&
|
|
96
|
+
isAbsolute(element.attrs.src.content) &&
|
|
97
|
+
!element.attrs.src.content.startsWith('http')) {
|
|
98
|
+
element.attrs.src.content = join(_this.relativePath, element.attrs.src.content);
|
|
99
|
+
}
|
|
100
|
+
if (element.elementType === 'component') {
|
|
101
|
+
Object.keys((element === null || element === void 0 ? void 0 : element.attrs) || {}).forEach(function (attrKey) {
|
|
102
|
+
var attrValue = element === null || element === void 0 ? void 0 : element.attrs[attrKey];
|
|
103
|
+
if (attrValue.type === 'static' &&
|
|
104
|
+
typeof attrValue.content === 'string' &&
|
|
105
|
+
!attrValue.content.startsWith('http')) {
|
|
106
|
+
var resolvedPath = parse(attrValue.content);
|
|
107
|
+
if (resolvedPath.dir.startsWith('/')) {
|
|
108
|
+
element.attrs[attrKey].content = join(_this.relativePath, attrValue.content);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
ProjectPluginImageResolver.prototype.runBefore = function (structure) {
|
|
116
|
+
var _a;
|
|
117
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
+
var uidl, strategy, assetsPath, pagesPath;
|
|
119
|
+
var _this = this;
|
|
120
|
+
return __generator(this, function (_b) {
|
|
121
|
+
uidl = structure.uidl, strategy = structure.strategy;
|
|
122
|
+
assetsPath = join(strategy.id, strategy.static.path.join('/'));
|
|
123
|
+
pagesPath = join(strategy.id, strategy.pages.path.join('/'));
|
|
124
|
+
this.relativePath = relative(pagesPath, assetsPath);
|
|
125
|
+
teleport_shared_1.UIDLUtils.traverseElements(uidl.root.node, this.imageResolver);
|
|
126
|
+
Object.values(((_a = uidl === null || uidl === void 0 ? void 0 : uidl.root) === null || _a === void 0 ? void 0 : _a.styleSetDefinitions) || {}).forEach(function (styleSet) {
|
|
127
|
+
_this.resolveFromStyles(styleSet.content);
|
|
128
|
+
});
|
|
129
|
+
this.relativePath = relative(join(strategy.id, strategy.components.path.join('/')), assetsPath);
|
|
130
|
+
Object.values(uidl.components || {}).forEach(function (component) {
|
|
131
|
+
teleport_shared_1.UIDLUtils.traverseElements(component.node, _this.imageResolver);
|
|
132
|
+
Object.values((component === null || component === void 0 ? void 0 : component.styleSetDefinitions) || {}).forEach(function (styleSet) {
|
|
133
|
+
_this.resolveFromStyles(styleSet.content);
|
|
134
|
+
});
|
|
135
|
+
_this.resolvePropsAndStates(component.stateDefinitions);
|
|
136
|
+
_this.resolvePropsAndStates(component.propDefinitions);
|
|
137
|
+
});
|
|
138
|
+
return [2 /*return*/, structure];
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
ProjectPluginImageResolver.prototype.runAfter = function (structure) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
144
|
+
return __generator(this, function (_a) {
|
|
145
|
+
return [2 /*return*/, structure];
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
return ProjectPluginImageResolver;
|
|
150
|
+
}());
|
|
151
|
+
exports.pluginImageResolver = new ProjectPluginImageResolver();
|
|
152
|
+
//# sourceMappingURL=plugin-image-resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-image-resolution.js","sourceRoot":"","sources":["../../src/plugin-image-resolution.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,oEAA0C;AASlC,IAAA,KAAK,GAAiC,yBAAY,MAA7C,EAAE,IAAI,GAA2B,yBAAY,KAAvC,EAAE,QAAQ,GAAiB,yBAAY,SAA7B,EAAE,UAAU,GAAK,yBAAY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|
@@ -5,7 +5,7 @@ exports.default = {
|
|
|
5
5
|
files: [
|
|
6
6
|
{
|
|
7
7
|
name: 'package',
|
|
8
|
-
content: "\n {\n \"name\": \"teleport-project-html\",\n \"version\": \"1.0.0\",\n \"private\": true,\n \"dependencies\": {\n \"parcel-bundler\": \"^1.6.1\"\n },\n \"scripts\": {
|
|
8
|
+
content: "\n {\n \"name\": \"teleport-project-html\",\n \"version\": \"1.0.0\",\n \"private\": true,\n \"dependencies\": {\n \"parcel-bundler\": \"^1.6.1\"\n },\n \"scripts\": {}\n }",
|
|
9
9
|
fileType: 'json',
|
|
10
10
|
},
|
|
11
11
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-template.js","sourceRoot":"","sources":["../../src/project-template.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE;QACL;YACE,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"project-template.js","sourceRoot":"","sources":["../../src/project-template.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE;QACL;YACE,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,yMASX;YACE,QAAQ,EAAE,MAAM;SACjB;KACF;IACD,UAAU,EAAE,EAAE;CACf,CAAA"}
|