@knapsack/renderer-vue 4.69.8--canary.4746.02d415c.0 → 4.69.8--canary.4762.be86288.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/infer-spec.test.js +2 -2
- package/dist/infer-spec.test.js.map +1 -1
- package/dist/renderer-vue.d.ts +16 -11
- package/dist/renderer-vue.d.ts.map +1 -1
- package/dist/renderer-vue.js +244 -240
- package/dist/renderer-vue.js.map +1 -1
- package/package.json +10 -11
package/dist/infer-spec.test.js
CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ava_1 = __importDefault(require("ava"));
|
7
7
|
const path_1 = require("path");
|
8
|
-
const
|
8
|
+
const app_1 = require("@knapsack/app");
|
9
9
|
const infer_spec_1 = require("./infer-spec");
|
10
10
|
(0, ava_1.default)('inferSpec card.vue', async (t) => {
|
11
11
|
const cardPath = (0, path_1.join)(__dirname, '../test-fixtures/card.vue');
|
@@ -65,7 +65,7 @@ const infer_spec_1 = require("./infer-spec");
|
|
65
65
|
t.fail();
|
66
66
|
return;
|
67
67
|
}
|
68
|
-
const { ok, message } =
|
68
|
+
const { ok, message } = app_1.KnapsackRendererBase.validateSpec(spec);
|
69
69
|
if (!ok) {
|
70
70
|
console.log(message);
|
71
71
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"infer-spec.test.js","sourceRoot":"","sources":["../src/infer-spec.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AACvB,+BAA4B;AAC5B,
|
1
|
+
{"version":3,"file":"infer-spec.test.js","sourceRoot":"","sources":["../src/infer-spec.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AACvB,+BAA4B;AAC5B,uCAAqD;AAErD,6CAAoD;AAEpD,IAAA,aAAI,EAAC,oBAAoB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACrC,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,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IAAI,CAAC,CAAC;IAEhE,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAED,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACxB,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAClC,CAAC,CAAC,CAAC"}
|
package/dist/renderer-vue.d.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
|
1
|
+
import { KnapsackRendererWebpackBase } from '@knapsack/renderer-webpack-base';
|
2
|
+
import type { KnapsackRenderParams, KnapsackTemplateRenderer, KnapsackTemplateRendererResults, KnapsackTemplateRendererBase } from '@knapsack/app/types';
|
3
|
+
import { KsJsImport } from '@knapsack/types';
|
4
|
+
export declare class KnapsackVueRenderer extends KnapsackRendererWebpackBase implements KnapsackTemplateRenderer {
|
4
5
|
skipWebpackAlter: boolean;
|
5
6
|
constructor({ webpackConfig, skipWebpackAlter, }?: {
|
6
|
-
webpackConfig?: ConstructorParameters<typeof
|
7
|
+
webpackConfig?: ConstructorParameters<typeof KnapsackRendererWebpackBase>[0]['webpackConfig'];
|
7
8
|
/**
|
8
9
|
* Setting to `true` prevents the Webpack config being altered in any way.
|
9
10
|
* You are fully responsible for setting up `vue-loader` how you'd like.
|
@@ -11,12 +12,16 @@ export declare class KnapsackVueRenderer extends RendererWebpackBase implements
|
|
11
12
|
*/
|
12
13
|
skipWebpackAlter?: boolean;
|
13
14
|
});
|
14
|
-
createWebpackConfig:
|
15
|
-
changeCase:
|
16
|
-
render:
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
createWebpackConfig(): ReturnType<KnapsackRendererWebpackBase['createWebpackConfig']>;
|
16
|
+
changeCase(str: string): string;
|
17
|
+
render(opt: KnapsackRenderParams): Promise<KnapsackTemplateRendererResults>;
|
18
|
+
getUsage(opt: KnapsackRenderParams): Promise<string>;
|
19
|
+
getUsageAndImports(opt: KnapsackRenderParams): Promise<{
|
20
|
+
usage: string;
|
21
|
+
imports: KsJsImport[];
|
22
|
+
}>;
|
23
|
+
getTemplateSuggestions(): ReturnType<KnapsackTemplateRendererBase['getTemplateSuggestions']>;
|
24
|
+
getMeta: KnapsackTemplateRenderer['getMeta'];
|
25
|
+
inferSpec: KnapsackTemplateRendererBase['inferSpec'];
|
21
26
|
}
|
22
27
|
//# sourceMappingURL=renderer-vue.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderer-vue.d.ts","sourceRoot":"","sources":["../src/renderer-vue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"renderer-vue.d.ts","sourceRoot":"","sources":["../src/renderer-vue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EAKX,MAAM,iBAAiB,CAAC;AAuBzB,qBAAa,mBACX,SAAQ,2BACR,YAAW,wBAAwB;IAEnC,gBAAgB,EAAE,OAAO,CAAC;gBACd,EACV,aAAa,EACb,gBAAwB,GACzB,GAAE;QACD,aAAa,CAAC,EAAE,qBAAqB,CACnC,OAAO,2BAA2B,CACnC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;QACtB;;;;WAIG;QACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;KACvB;IAYN,mBAAmB,IAAI,UAAU,CAC/B,2BAA2B,CAAC,qBAAqB,CAAC,CACnD;IAsCD,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IASzB,MAAM,CACV,GAAG,EAAE,oBAAoB,GACxB,OAAO,CAAC,+BAA+B,CAAC;IAuErC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKpD,kBAAkB,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAC3D,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,UAAU,EAAE,CAAC;KACvB,CAAC;IAoJI,sBAAsB,IAAI,UAAU,CACxC,4BAA4B,CAAC,wBAAwB,CAAC,CACvD;IAsCD,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAwBzC;IAEH,SAAS,EAAE,4BAA4B,CAAC,WAAW,CAAC,CASlD;CACH"}
|
package/dist/renderer-vue.js
CHANGED
@@ -3,12 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KnapsackVueRenderer = void 0;
|
4
4
|
const renderer_webpack_base_1 = require("@knapsack/renderer-webpack-base");
|
5
5
|
const app_1 = require("@knapsack/app");
|
6
|
-
const renderers_1 = require("@knapsack/app/renderers");
|
7
6
|
const types_1 = require("@knapsack/types");
|
8
7
|
const vue_loader_1 = require("vue-loader");
|
9
8
|
const utils_1 = require("@knapsack/utils");
|
10
9
|
const file_utils_1 = require("@knapsack/file-utils");
|
11
|
-
const babel_config_starter_1 = require("@knapsack/babel-config-starter");
|
12
10
|
const path_1 = require("path");
|
13
11
|
const utils_2 = require("./utils");
|
14
12
|
const infer_spec_1 = require("./infer-spec");
|
@@ -16,7 +14,9 @@ const { pkg } = (0, file_utils_1.findUpPkgJson)(__dirname);
|
|
16
14
|
const gitRoot = (0, file_utils_1.findGitRoot)();
|
17
15
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
18
16
|
app_1.log.setupUpdateNotifier({ ...pkg, name: pkg.name, version: pkg.version });
|
19
|
-
|
17
|
+
// static methods only
|
18
|
+
const { createSlotOptionsHtmlTags } = app_1.KnapsackRendererBase;
|
19
|
+
class KnapsackVueRenderer extends renderer_webpack_base_1.KnapsackRendererWebpackBase {
|
20
20
|
constructor({ webpackConfig, skipWebpackAlter = false, } = {}) {
|
21
21
|
super({
|
22
22
|
id: types_1.rendererIds.vue,
|
@@ -25,243 +25,6 @@ class KnapsackVueRenderer extends renderer_webpack_base_1.RendererWebpackBase {
|
|
25
25
|
webpackConfig,
|
26
26
|
extraScripts: [(0, path_1.join)(__dirname, './renderer-vue-client')],
|
27
27
|
});
|
28
|
-
this.createWebpackConfig = () => {
|
29
|
-
const config = super.createWebpackConfig();
|
30
|
-
if (this.skipWebpackAlter)
|
31
|
-
return config;
|
32
|
-
// https://vue-loader.vuejs.org/options.html
|
33
|
-
const compilerOptions = {
|
34
|
-
compilerOptions: {
|
35
|
-
compatConfig: {
|
36
|
-
MODE: 2,
|
37
|
-
},
|
38
|
-
},
|
39
|
-
};
|
40
|
-
// Parses vue files and hands script to js/ts loaders, style to css/etc loaders
|
41
|
-
config.module.rules.push({
|
42
|
-
test: /\.vue$/,
|
43
|
-
loader: require.resolve('vue-loader'),
|
44
|
-
options: compilerOptions,
|
45
|
-
});
|
46
|
-
// vue-style-loader provided by VueLoaderPlugin
|
47
|
-
// If site needs LESS/Sass, override at knapsack.config.js within project
|
48
|
-
config.module.rules.push({
|
49
|
-
test: /\.css$/,
|
50
|
-
use: [require.resolve('vue-style-loader'), require.resolve('css-loader')],
|
51
|
-
});
|
52
|
-
config.module.rules.push({
|
53
|
-
test: [/\.js$/, /\.jsx$/, /\.ts$/, /\.tsx$/],
|
54
|
-
exclude: /node_modules/,
|
55
|
-
loader: require.resolve('babel-loader'),
|
56
|
-
options: babel_config_starter_1.basicWebpackBabelConfig,
|
57
|
-
});
|
58
|
-
config.plugins.push(new vue_loader_1.VueLoaderPlugin());
|
59
|
-
return config;
|
60
|
-
};
|
61
|
-
this.changeCase = (str) => {
|
62
|
-
const templateName = (0, utils_1.paramCase)(str);
|
63
|
-
if (templateName.split('-').length === 1) {
|
64
|
-
// vue templates (and web components) MUST contain at least one dash
|
65
|
-
return `vue-${templateName}`;
|
66
|
-
}
|
67
|
-
return templateName;
|
68
|
-
};
|
69
|
-
this.render = async (opt) => {
|
70
|
-
const { usage, imports: nonUniqueImports } = await this.getUsageAndImports(opt);
|
71
|
-
const { imports, declaredVars, nameCollisions, isDeclaredVarsUnique } = this.makeKsJsImportsUnique({
|
72
|
-
imports: nonUniqueImports,
|
73
|
-
});
|
74
|
-
if (!isDeclaredVarsUnique) {
|
75
|
-
throw new Error(`imports are not unique: ${nameCollisions.join(', ')}`);
|
76
|
-
}
|
77
|
-
let usageDocs = usage;
|
78
|
-
const code = `
|
79
|
-
${this.createHtmlTagsForAssetPaths({
|
80
|
-
assets: this.getWebpackAssetPaths(),
|
81
|
-
// If we don't have `<script async>` tags and we put this below the `div#render-root` then renderering happens but the iFrame is too narrow. Not sure why using a `setTimeout` around `new Vue()` or putting this below `div#render-root` doesn't work, but this does
|
82
|
-
scriptTagsAreAsync: true,
|
83
|
-
})}
|
84
|
-
<div id="render-root" class="knapsack-pattern-direct-parent" data-dev-note="Knapsack Vue Template Wrapper" style="display: none;">${usage}</div>
|
85
|
-
`;
|
86
|
-
if ((opt === null || opt === void 0 ? void 0 : opt.demo) && opt.demo.type === 'data') {
|
87
|
-
usageDocs = await (0, file_utils_1.formatCode)({
|
88
|
-
path: 'x.vue',
|
89
|
-
contents: `
|
90
|
-
<template>
|
91
|
-
${usage}
|
92
|
-
</template>
|
93
|
-
|
94
|
-
<script>
|
95
|
-
export default {
|
96
|
-
components: {
|
97
|
-
${imports
|
98
|
-
.map(({ importInfo }) => `'${importInfo.name}': () => import('${importInfo.path}'),`)
|
99
|
-
.join('\n')}
|
100
|
-
}
|
101
|
-
}
|
102
|
-
</script>
|
103
|
-
`,
|
104
|
-
});
|
105
|
-
}
|
106
|
-
if ((opt === null || opt === void 0 ? void 0 : opt.demo) && opt.demo.type === 'template') {
|
107
|
-
const pathInfo = opt.patternManifest.getTemplatePath({
|
108
|
-
patternId: opt.pattern.id,
|
109
|
-
templateId: opt.template.id,
|
110
|
-
demoId: opt.demo.id,
|
111
|
-
});
|
112
|
-
const demoContents = await (0, file_utils_1.readFile)(pathInfo.absolutePath);
|
113
|
-
usageDocs = await (0, file_utils_1.formatCode)({
|
114
|
-
path: 'x.vue',
|
115
|
-
contents: demoContents,
|
116
|
-
});
|
117
|
-
}
|
118
|
-
// log.inspect({ demoType: opt.demo.type, code, imports });
|
119
|
-
return {
|
120
|
-
ok: true,
|
121
|
-
templateLanguage: 'html',
|
122
|
-
usage: usageDocs,
|
123
|
-
html: await (0, file_utils_1.formatCode)({
|
124
|
-
contents: code,
|
125
|
-
path: 'x.html',
|
126
|
-
}),
|
127
|
-
};
|
128
|
-
};
|
129
|
-
this.getUsageAndImports = async (opt) => {
|
130
|
-
const { pattern, template, demo,
|
131
|
-
/**
|
132
|
-
* The Patterns class
|
133
|
-
*/
|
134
|
-
patternManifest, } = opt;
|
135
|
-
switch (demo === null || demo === void 0 ? void 0 : demo.type) {
|
136
|
-
case 'template': {
|
137
|
-
const pathInfo = opt.patternManifest.getTemplatePath({
|
138
|
-
patternId: pattern.id,
|
139
|
-
templateId: template.id,
|
140
|
-
demoId: demo.id,
|
141
|
-
});
|
142
|
-
const importInfo = this.getJsImport({
|
143
|
-
patternId: pattern.id,
|
144
|
-
templateId: template.id,
|
145
|
-
demoId: demo.id,
|
146
|
-
});
|
147
|
-
const templateName = importInfo.importInfo.name;
|
148
|
-
return {
|
149
|
-
usage: `<${templateName} />`,
|
150
|
-
imports: [importInfo],
|
151
|
-
};
|
152
|
-
}
|
153
|
-
case 'data':
|
154
|
-
default: {
|
155
|
-
const { slotsOptionsComputed, props = {}, slots = {}, } = demo.data || {};
|
156
|
-
const importInfo = this.getJsImport({
|
157
|
-
patternId: pattern.id,
|
158
|
-
templateId: template.id,
|
159
|
-
});
|
160
|
-
if (!importInfo) {
|
161
|
-
throw new Error(`Could not find import for pattern-template: ${pattern.id}-${template.id}`);
|
162
|
-
}
|
163
|
-
const { type, name: templateName } = importInfo.importInfo;
|
164
|
-
const importInfos = [importInfo];
|
165
|
-
const children = [];
|
166
|
-
await Promise.all(Object.keys(slots).map(async (slotName) => {
|
167
|
-
const slottedTemplates = slots[slotName];
|
168
|
-
await Promise.all(slottedTemplates.map(async (slottedTemplate) => {
|
169
|
-
if (slottedTemplate.type === 'text') {
|
170
|
-
return slottedTemplate.text;
|
171
|
-
}
|
172
|
-
if (slottedTemplate.type === 'template-reference') {
|
173
|
-
throw new Error(`Cannot handle slotted template references in ${JSON.stringify({
|
174
|
-
patternId: pattern.id,
|
175
|
-
templateId: template.id,
|
176
|
-
demoId: demo.id,
|
177
|
-
slottedTemplate,
|
178
|
-
})}`);
|
179
|
-
}
|
180
|
-
if (!slottedTemplate.patternId ||
|
181
|
-
!slottedTemplate.templateId ||
|
182
|
-
!slottedTemplate.demoId) {
|
183
|
-
return '';
|
184
|
-
}
|
185
|
-
const thisPattern = patternManifest.getPattern(slottedTemplate.patternId);
|
186
|
-
const thisTemplate = thisPattern.templates.find((t) => t.id === slottedTemplate.templateId);
|
187
|
-
if (!thisTemplate) {
|
188
|
-
throw new Error(`Cannot find template id "${slottedTemplate.templateId}" in "${slottedTemplate.patternId}"`);
|
189
|
-
}
|
190
|
-
const { usage, imports } = await this.getUsageAndImports({
|
191
|
-
pattern: thisPattern,
|
192
|
-
template: thisTemplate,
|
193
|
-
patternManifest,
|
194
|
-
demo: slottedTemplate.demo ||
|
195
|
-
this.patterns.demosById[slottedTemplate.demoId],
|
196
|
-
});
|
197
|
-
imports.forEach((i) => importInfos.push(i));
|
198
|
-
return usage;
|
199
|
-
})).then((usages) => {
|
200
|
-
const slotOptionsComputed = slotsOptionsComputed === null || slotsOptionsComputed === void 0 ? void 0 : slotsOptionsComputed[slotName];
|
201
|
-
const { openTag, closeTag } = (0, renderers_1.createSlotOptionsHtmlTags)({
|
202
|
-
slotOptionsComputed,
|
203
|
-
classAttributeName: 'class',
|
204
|
-
stylesValueType: 'string',
|
205
|
-
});
|
206
|
-
if (slotName === 'default') {
|
207
|
-
children.push(openTag, usages.join('\n'), closeTag);
|
208
|
-
}
|
209
|
-
else {
|
210
|
-
children.push(`<template v-slot:${slotName}>`, openTag, usages.join('\n'), closeTag, '</template>');
|
211
|
-
}
|
212
|
-
});
|
213
|
-
}));
|
214
|
-
const pathInfo = opt.patternManifest.getTemplatePath({
|
215
|
-
patternId: pattern.id,
|
216
|
-
templateId: template.id,
|
217
|
-
});
|
218
|
-
const usage = await (0, utils_2.getUsage)({
|
219
|
-
templateName,
|
220
|
-
props,
|
221
|
-
children: children.filter(Boolean).join('\n'),
|
222
|
-
});
|
223
|
-
return {
|
224
|
-
usage,
|
225
|
-
imports: importInfos,
|
226
|
-
};
|
227
|
-
}
|
228
|
-
}
|
229
|
-
};
|
230
|
-
this.getTemplateSuggestions = async () => {
|
231
|
-
const { unusedPaths } = await this.getUnusedTemplatePaths({
|
232
|
-
globPaths: [(0, path_1.join)(gitRoot, '**/*.vue')],
|
233
|
-
});
|
234
|
-
const suggestions = await Promise.all(unusedPaths.map(async (path) => {
|
235
|
-
const pkgInfo = await (0, file_utils_1.findUpPkgJsonAsync)(path);
|
236
|
-
if (!pkgInfo.exists) {
|
237
|
-
return {
|
238
|
-
path,
|
239
|
-
};
|
240
|
-
}
|
241
|
-
const { name } = pkgInfo.pkg;
|
242
|
-
const subPath = (0, path_1.relative)(pkgInfo.pkgDir, path);
|
243
|
-
const pkgSubPath = (0, path_1.join)(name, subPath);
|
244
|
-
try {
|
245
|
-
// try out the resolved path
|
246
|
-
// if the "exports" field is used in the package.json, and we have problems with it, then this will throw and we'll just use the original absolute path
|
247
|
-
const resolvedPath = require.resolve(pkgSubPath);
|
248
|
-
if (resolvedPath === path) {
|
249
|
-
return {
|
250
|
-
path: pkgSubPath,
|
251
|
-
};
|
252
|
-
}
|
253
|
-
return {
|
254
|
-
path,
|
255
|
-
};
|
256
|
-
}
|
257
|
-
catch (e) {
|
258
|
-
return {
|
259
|
-
path,
|
260
|
-
};
|
261
|
-
}
|
262
|
-
}));
|
263
|
-
return { suggestions };
|
264
|
-
};
|
265
28
|
this.getMeta = () => ({
|
266
29
|
id: this.id,
|
267
30
|
title: 'Vue',
|
@@ -294,6 +57,247 @@ export default {
|
|
294
57
|
this.language = 'vue';
|
295
58
|
this.skipWebpackAlter = skipWebpackAlter;
|
296
59
|
}
|
60
|
+
createWebpackConfig() {
|
61
|
+
const config = super.createWebpackConfig();
|
62
|
+
if (this.skipWebpackAlter)
|
63
|
+
return config;
|
64
|
+
// https://vue-loader.vuejs.org/options.html
|
65
|
+
const compilerOptions = {
|
66
|
+
compilerOptions: {
|
67
|
+
compatConfig: {
|
68
|
+
MODE: 2,
|
69
|
+
},
|
70
|
+
},
|
71
|
+
};
|
72
|
+
// Parses vue files and hands script to js/ts loaders, style to css/etc loaders
|
73
|
+
config.module.rules.push({
|
74
|
+
test: /\.vue$/,
|
75
|
+
loader: require.resolve('vue-loader'),
|
76
|
+
options: compilerOptions,
|
77
|
+
});
|
78
|
+
// vue-style-loader provided by VueLoaderPlugin
|
79
|
+
// If site needs LESS/Sass, override at knapsack.config.js within project
|
80
|
+
config.module.rules.push({
|
81
|
+
test: /\.css$/,
|
82
|
+
use: [require.resolve('vue-style-loader'), require.resolve('css-loader')],
|
83
|
+
});
|
84
|
+
config.module.rules.push({
|
85
|
+
test: [/\.js$/, /\.jsx$/, /\.ts$/, /\.tsx$/],
|
86
|
+
exclude: /node_modules/,
|
87
|
+
loader: require.resolve('babel-loader'),
|
88
|
+
options: this.basicWebpackBabelConfig,
|
89
|
+
});
|
90
|
+
config.plugins.push(new vue_loader_1.VueLoaderPlugin());
|
91
|
+
return config;
|
92
|
+
}
|
93
|
+
changeCase(str) {
|
94
|
+
const templateName = (0, utils_1.paramCase)(str);
|
95
|
+
if (templateName.split('-').length === 1) {
|
96
|
+
// vue templates (and web components) MUST contain at least one dash
|
97
|
+
return `vue-${templateName}`;
|
98
|
+
}
|
99
|
+
return templateName;
|
100
|
+
}
|
101
|
+
async render(opt) {
|
102
|
+
const { usage, imports: nonUniqueImports } = await this.getUsageAndImports(opt);
|
103
|
+
const { imports, declaredVars, nameCollisions, isDeclaredVarsUnique } = this.makeKsJsImportsUnique({
|
104
|
+
imports: nonUniqueImports,
|
105
|
+
});
|
106
|
+
if (!isDeclaredVarsUnique) {
|
107
|
+
throw new Error(`imports are not unique: ${nameCollisions.join(', ')}`);
|
108
|
+
}
|
109
|
+
let usageDocs = usage;
|
110
|
+
const code = `
|
111
|
+
${this.createHtmlTagsForAssetPaths({
|
112
|
+
assets: this.getWebpackAssetPaths(),
|
113
|
+
// If we don't have `<script async>` tags and we put this below the `div#render-root` then renderering happens but the iFrame is too narrow. Not sure why using a `setTimeout` around `new Vue()` or putting this below `div#render-root` doesn't work, but this does
|
114
|
+
scriptTagsAreAsync: true,
|
115
|
+
})}
|
116
|
+
<div id="render-root" class="knapsack-pattern-direct-parent" data-dev-note="Knapsack Vue Template Wrapper" style="display: none;">${usage}</div>
|
117
|
+
`;
|
118
|
+
if ((opt === null || opt === void 0 ? void 0 : opt.demo) && KnapsackVueRenderer.isDataDemo(opt.demo)) {
|
119
|
+
usageDocs = await (0, file_utils_1.formatCode)({
|
120
|
+
path: 'x.vue',
|
121
|
+
contents: `
|
122
|
+
<template>
|
123
|
+
${usage}
|
124
|
+
</template>
|
125
|
+
|
126
|
+
<script>
|
127
|
+
export default {
|
128
|
+
components: {
|
129
|
+
${imports
|
130
|
+
.map(({ importInfo }) => `'${importInfo.name}': () => import('${importInfo.path}'),`)
|
131
|
+
.join('\n')}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
</script>
|
135
|
+
`,
|
136
|
+
});
|
137
|
+
}
|
138
|
+
if ((opt === null || opt === void 0 ? void 0 : opt.demo) && KnapsackVueRenderer.isTemplateDemo(opt.demo)) {
|
139
|
+
const pathInfo = opt.patternManifest.getTemplatePath({
|
140
|
+
patternId: opt.pattern.id,
|
141
|
+
templateId: opt.template.id,
|
142
|
+
demoId: opt.demo.id,
|
143
|
+
});
|
144
|
+
const demoContents = await (0, file_utils_1.readFile)(pathInfo.absolutePath);
|
145
|
+
usageDocs = await (0, file_utils_1.formatCode)({
|
146
|
+
path: 'x.vue',
|
147
|
+
contents: demoContents,
|
148
|
+
});
|
149
|
+
}
|
150
|
+
// log.inspect({ demoType: opt.demo.type, code, imports });
|
151
|
+
return {
|
152
|
+
ok: true,
|
153
|
+
templateLanguage: 'html',
|
154
|
+
usage: usageDocs,
|
155
|
+
html: await (0, file_utils_1.formatCode)({
|
156
|
+
contents: code,
|
157
|
+
path: 'x.html',
|
158
|
+
}),
|
159
|
+
};
|
160
|
+
}
|
161
|
+
async getUsage(opt) {
|
162
|
+
const { usage } = await this.getUsageAndImports(opt);
|
163
|
+
return usage;
|
164
|
+
}
|
165
|
+
async getUsageAndImports(opt) {
|
166
|
+
const { pattern, template, demo,
|
167
|
+
/**
|
168
|
+
* The Patterns class
|
169
|
+
*/
|
170
|
+
patternManifest, } = opt;
|
171
|
+
switch (demo === null || demo === void 0 ? void 0 : demo.type) {
|
172
|
+
case 'template': {
|
173
|
+
const pathInfo = opt.patternManifest.getTemplatePath({
|
174
|
+
patternId: pattern.id,
|
175
|
+
templateId: template.id,
|
176
|
+
demoId: demo.id,
|
177
|
+
});
|
178
|
+
const importInfo = this.getJsImport({
|
179
|
+
patternId: pattern.id,
|
180
|
+
templateId: template.id,
|
181
|
+
demoId: demo.id,
|
182
|
+
});
|
183
|
+
const templateName = importInfo.importInfo.name;
|
184
|
+
return {
|
185
|
+
usage: `<${templateName} />`,
|
186
|
+
imports: [importInfo],
|
187
|
+
};
|
188
|
+
}
|
189
|
+
case 'data':
|
190
|
+
default: {
|
191
|
+
const { slotsOptionsComputed, props = {}, slots = {}, } = demo.data || {};
|
192
|
+
const importInfo = this.getJsImport({
|
193
|
+
patternId: pattern.id,
|
194
|
+
templateId: template.id,
|
195
|
+
});
|
196
|
+
if (!importInfo) {
|
197
|
+
throw new Error(`Could not find import for pattern-template: ${pattern.id}-${template.id}`);
|
198
|
+
}
|
199
|
+
const { type, name: templateName } = importInfo.importInfo;
|
200
|
+
const importInfos = [importInfo];
|
201
|
+
const children = [];
|
202
|
+
await Promise.all(Object.keys(slots).map(async (slotName) => {
|
203
|
+
const slottedTemplates = slots[slotName];
|
204
|
+
await Promise.all(slottedTemplates.map(async (slottedTemplate) => {
|
205
|
+
if (app_1.KnapsackRendererBase.isSlottedText(slottedTemplate)) {
|
206
|
+
return slottedTemplate.text;
|
207
|
+
}
|
208
|
+
if (app_1.KnapsackRendererBase.isSlottedTemplateReference(slottedTemplate)) {
|
209
|
+
throw new Error(`Cannot handle slotted template references in ${JSON.stringify({
|
210
|
+
patternId: pattern.id,
|
211
|
+
templateId: template.id,
|
212
|
+
demoId: demo.id,
|
213
|
+
slottedTemplate,
|
214
|
+
})}`);
|
215
|
+
}
|
216
|
+
if (!slottedTemplate.patternId ||
|
217
|
+
!slottedTemplate.templateId ||
|
218
|
+
!slottedTemplate.demoId) {
|
219
|
+
return '';
|
220
|
+
}
|
221
|
+
const thisPattern = patternManifest.getPattern(slottedTemplate.patternId);
|
222
|
+
const thisTemplate = thisPattern.templates.find((t) => t.id === slottedTemplate.templateId);
|
223
|
+
if (!thisTemplate) {
|
224
|
+
throw new Error(`Cannot find template id "${slottedTemplate.templateId}" in "${slottedTemplate.patternId}"`);
|
225
|
+
}
|
226
|
+
const { usage, imports } = await this.getUsageAndImports({
|
227
|
+
pattern: thisPattern,
|
228
|
+
template: thisTemplate,
|
229
|
+
patternManifest,
|
230
|
+
demo: slottedTemplate.demo ||
|
231
|
+
this.patterns.demosById[slottedTemplate.demoId],
|
232
|
+
});
|
233
|
+
imports.forEach((i) => importInfos.push(i));
|
234
|
+
return usage;
|
235
|
+
})).then((usages) => {
|
236
|
+
const slotOptionsComputed = slotsOptionsComputed === null || slotsOptionsComputed === void 0 ? void 0 : slotsOptionsComputed[slotName];
|
237
|
+
const { openTag, closeTag } = createSlotOptionsHtmlTags({
|
238
|
+
slotOptionsComputed,
|
239
|
+
classAttributeName: 'class',
|
240
|
+
stylesValueType: 'string',
|
241
|
+
});
|
242
|
+
if (slotName === 'default') {
|
243
|
+
children.push(openTag, usages.join('\n'), closeTag);
|
244
|
+
}
|
245
|
+
else {
|
246
|
+
children.push(`<template v-slot:${slotName}>`, openTag, usages.join('\n'), closeTag, '</template>');
|
247
|
+
}
|
248
|
+
});
|
249
|
+
}));
|
250
|
+
const pathInfo = opt.patternManifest.getTemplatePath({
|
251
|
+
patternId: pattern.id,
|
252
|
+
templateId: template.id,
|
253
|
+
});
|
254
|
+
const usage = await (0, utils_2.getUsage)({
|
255
|
+
templateName,
|
256
|
+
props,
|
257
|
+
children: children.filter(Boolean).join('\n'),
|
258
|
+
});
|
259
|
+
return {
|
260
|
+
usage,
|
261
|
+
imports: importInfos,
|
262
|
+
};
|
263
|
+
}
|
264
|
+
}
|
265
|
+
}
|
266
|
+
async getTemplateSuggestions() {
|
267
|
+
const { unusedPaths } = await this.getUnusedTemplatePaths({
|
268
|
+
globPaths: [(0, path_1.join)(gitRoot, '**/*.vue')],
|
269
|
+
});
|
270
|
+
const suggestions = await Promise.all(unusedPaths.map(async (path) => {
|
271
|
+
const pkgInfo = await (0, file_utils_1.findUpPkgJsonAsync)(path);
|
272
|
+
if (!pkgInfo.exists) {
|
273
|
+
return {
|
274
|
+
path,
|
275
|
+
};
|
276
|
+
}
|
277
|
+
const { name } = pkgInfo.pkg;
|
278
|
+
const subPath = (0, path_1.relative)(pkgInfo.pkgDir, path);
|
279
|
+
const pkgSubPath = (0, path_1.join)(name, subPath);
|
280
|
+
try {
|
281
|
+
// try out the resolved path
|
282
|
+
// if the "exports" field is used in the package.json, and we have problems with it, then this will throw and we'll just use the original absolute path
|
283
|
+
const resolvedPath = require.resolve(pkgSubPath);
|
284
|
+
if (resolvedPath === path) {
|
285
|
+
return {
|
286
|
+
path: pkgSubPath,
|
287
|
+
};
|
288
|
+
}
|
289
|
+
return {
|
290
|
+
path,
|
291
|
+
};
|
292
|
+
}
|
293
|
+
catch (e) {
|
294
|
+
return {
|
295
|
+
path,
|
296
|
+
};
|
297
|
+
}
|
298
|
+
}));
|
299
|
+
return { suggestions };
|
300
|
+
}
|
297
301
|
}
|
298
302
|
exports.KnapsackVueRenderer = KnapsackVueRenderer;
|
299
303
|
//# sourceMappingURL=renderer-vue.js.map
|
package/dist/renderer-vue.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderer-vue.js","sourceRoot":"","sources":["../src/renderer-vue.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"renderer-vue.js","sourceRoot":"","sources":["../src/renderer-vue.ts"],"names":[],"mappings":";;;AAAA,2EAA8E;AAC9E,uCAA0D;AAO1D,2CAMyB;AACzB,2CAA+D;AAC/D,2CAA4C;AAC5C,qDAM8B;AAC9B,+BAAsC;AACtC,mCAAmC;AACnC,6CAAoD;AAEpD,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,0BAAa,EAAC,SAAS,CAAC,CAAC;AACzC,MAAM,OAAO,GAAG,IAAA,wBAAW,GAAE,CAAC;AAE9B,oEAAoE;AACpE,SAAG,CAAC,mBAAmB,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAK,EAAE,OAAO,EAAE,GAAG,CAAC,OAAQ,EAAE,CAAC,CAAC;AAE5E,sBAAsB;AACtB,MAAM,EAAE,yBAAyB,EAAE,GAAG,0BAAoB,CAAC;AAE3D,MAAa,mBACX,SAAQ,mDAA2B;IAInC,YAAY,EACV,aAAa,EACb,gBAAgB,GAAG,KAAK,MAWtB,EAAE;QACJ,KAAK,CAAC;YACJ,EAAE,EAAE,mBAAW,CAAC,GAAG;YACnB,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,MAAM;YACjB,aAAa;YACb,YAAY,EAAE,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;SACzD,CAAC,CAAC;QAmUL,YAAO,GAAwC,GAAG,EAAE,CAAC,CAAC;YACpD,EAAE,EAAE,I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,GAAG,CAAC,KAAK,EAAE,IAAI,EAA+B,EAAE;YAC1D,MAAM,OAAO,GAAG,MAAM,IAAA,+BAAkB,EAAC,IAAI,CAAC,CAAC;YAC/C,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBACpB,OAAO;oBACL,IAAI;iBACL,CAAC;YACJ,CAAC;YACD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;YAC7B,MAAM,OAAO,GAAG,IAAA,eAAQ,EAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC/C,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACvC,IAAI,CAAC;gBACH,4BAA4B;gBAC5B,uJAAuJ;gBACvJ,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBACjD,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;oBAC1B,OAAO;wBACL,IAAI,EAAE,UAAU;qBACjB,CAAC;gBACJ,CAAC;gBACD,OAAO;oBACL,IAAI;iBACL,CAAC;YACJ,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO;oBACL,IAAI;iBACL,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CACH,CAAC;QAEF,OAAO,EAAE,WAAW,EAAE,CAAC;IACzB,CAAC;CAsCF;AAhYD,kDAgYC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@knapsack/renderer-vue",
|
3
3
|
"description": "Render Vue",
|
4
|
-
"version": "4.69.8--canary.
|
4
|
+
"version": "4.69.8--canary.4762.be86288.0",
|
5
5
|
"main": "dist/renderer-vue.js",
|
6
6
|
"types": "dist/renderer-vue.d.ts",
|
7
7
|
"exports": {
|
@@ -24,12 +24,11 @@
|
|
24
24
|
},
|
25
25
|
"author": "Knapsack (https://www.knapsack.cloud)",
|
26
26
|
"dependencies": {
|
27
|
-
"@knapsack/app": "4.69.8--canary.
|
28
|
-
"@knapsack/
|
29
|
-
"@knapsack/
|
30
|
-
"@knapsack/
|
31
|
-
"@knapsack/
|
32
|
-
"@knapsack/utils": "4.69.8--canary.4746.02d415c.0",
|
27
|
+
"@knapsack/app": "4.69.8--canary.4762.be86288.0",
|
28
|
+
"@knapsack/file-utils": "4.69.8--canary.4762.be86288.0",
|
29
|
+
"@knapsack/renderer-webpack-base": "4.69.8--canary.4762.be86288.0",
|
30
|
+
"@knapsack/types": "4.69.8--canary.4762.be86288.0",
|
31
|
+
"@knapsack/utils": "4.69.8--canary.4762.be86288.0",
|
33
32
|
"@vue/compiler-sfc": "^3.5.4",
|
34
33
|
"babel-loader": "^9.1.3",
|
35
34
|
"css-loader": "^6.11.0",
|
@@ -42,9 +41,9 @@
|
|
42
41
|
"vue-style-loader": "^4.1.3"
|
43
42
|
},
|
44
43
|
"devDependencies": {
|
45
|
-
"@knapsack/eslint-config-starter": "4.69.8--canary.
|
46
|
-
"@knapsack/test-ava": "4.69.8--canary.
|
47
|
-
"@knapsack/typescript-config-starter": "4.69.8--canary.
|
44
|
+
"@knapsack/eslint-config-starter": "4.69.8--canary.4762.be86288.0",
|
45
|
+
"@knapsack/test-ava": "4.69.8--canary.4762.be86288.0",
|
46
|
+
"@knapsack/typescript-config-starter": "4.69.8--canary.4762.be86288.0",
|
48
47
|
"@types/fs-extra": "^11.0.4",
|
49
48
|
"@types/lodash": "^4.17.5",
|
50
49
|
"ava": "^6.1.3",
|
@@ -59,5 +58,5 @@
|
|
59
58
|
"directory": "apps/client/renderers/renderer-vue",
|
60
59
|
"type": "git"
|
61
60
|
},
|
62
|
-
"gitHead": "
|
61
|
+
"gitHead": "be86288982cbdd5c8556af1a07a87a59948c512f"
|
63
62
|
}
|