@knapsack/renderer-web-components 4.69.0--canary.4433.d5d9fce.1 → 4.69.0--canary.4627.19723b8.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ # v4.68.11 (Tue Aug 27 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Fix merge conflict with navs ([@rockymountainhigh1943](https://github.com/rockymountainhigh1943))
6
+ - Merge branch 'latest' into feature/ksp-5388-ability-to-set-the-header-page-background-color-globally ([@GormanDesign](https://github.com/GormanDesign))
7
+ - Merge branch 'feature/ksp-5388-ability-to-set-the-header-page-background-color-globally' of github.com:knapsack-labs/app-monorepo into feature/ksp-5388-ability-to-set-the-header-page-background-color-globally ([@GormanDesign](https://github.com/GormanDesign))
8
+ - Merge branch 'latest' into feature/ksp-5337-add-slot-item-ux-refactor ([@GormanDesign](https://github.com/GormanDesign))
9
+ - Merge remote-tracking branch 'origin/latest' into feature/ksp-5337-add-slot-item-ux-refactor ([@EvanLovely](https://github.com/EvanLovely))
10
+ - Merge branch 'latest' into feature/ksp-5337-add-slot-item-ux-refactor ([@illepic](https://github.com/illepic))
11
+
12
+ #### Authors: 4
13
+
14
+ - Christopher Bloom ([@illepic](https://github.com/illepic))
15
+ - Evan Lovely ([@EvanLovely](https://github.com/EvanLovely))
16
+ - Jake Love ([@rockymountainhigh1943](https://github.com/rockymountainhigh1943))
17
+ - Matt Gorman ([@GormanDesign](https://github.com/GormanDesign))
18
+
19
+ ---
20
+
1
21
  # v4.68.9 (Wed Aug 21 2024)
2
22
 
3
23
  #### 🐛 Bug Fix
@@ -0,0 +1,7 @@
1
+ import { KsTemplateSpec } from '@knapsack/types';
2
+ import { CustomElementManifest } from './utils';
3
+ export declare function inferSpec({ customElementManifestSchema, tagName, }: {
4
+ tagName: string;
5
+ customElementManifestSchema: CustomElementManifest;
6
+ }): KsTemplateSpec | false;
7
+ //# sourceMappingURL=infer-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infer-spec.d.ts","sourceRoot":"","sources":["../src/infer-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,SAAS,CAAC,EACxB,2BAA2B,EAC3B,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B,EAAE,qBAAqB,CAAC;CACpD,GAAG,cAAc,GAAG,KAAK,CAoGzB"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inferSpec = inferSpec;
4
+ const utils_1 = require("@knapsack/utils");
5
+ function inferSpec({ customElementManifestSchema, tagName, }) {
6
+ var _a, _b, _c;
7
+ if (!customElementManifestSchema)
8
+ return false;
9
+ const tag = customElementManifestSchema.tags.find(({ name }) => name === tagName);
10
+ if (!tag || !((_a = tag.attributes) === null || _a === void 0 ? void 0 : _a.length))
11
+ return false;
12
+ const props = {
13
+ type: 'object',
14
+ required: [],
15
+ properties: {},
16
+ };
17
+ const attrDocs = {
18
+ id: 'attributes',
19
+ title: 'Attributes',
20
+ description: 'Attributes for the custom element',
21
+ tableRows: [],
22
+ };
23
+ const eventDocs = {
24
+ id: 'events',
25
+ title: 'Events',
26
+ description: 'Events for the custom element',
27
+ tableRows: ((_b = tag.events) === null || _b === void 0 ? void 0 : _b.map(({ name }) => ({
28
+ Name: name,
29
+ }))) || [],
30
+ };
31
+ (_c = tag.attributes) === null || _c === void 0 ? void 0 : _c.forEach(({ name, type, description, default: defaultValue }) => {
32
+ if (!type)
33
+ return;
34
+ attrDocs.tableRows.push({
35
+ Name: name,
36
+ Type: type,
37
+ Description: description,
38
+ Default: defaultValue,
39
+ });
40
+ switch (type) {
41
+ case 'string': {
42
+ props.properties[name] = {
43
+ type: 'string',
44
+ description,
45
+ default: defaultValue,
46
+ };
47
+ break;
48
+ }
49
+ case 'number': {
50
+ props.properties[name] = {
51
+ type: 'number',
52
+ description,
53
+ default: typeof defaultValue === 'number' ? defaultValue : undefined,
54
+ };
55
+ break;
56
+ }
57
+ case 'boolean': {
58
+ props.properties[name] = {
59
+ type: 'boolean',
60
+ description,
61
+ default: typeof defaultValue === 'boolean' ? defaultValue : undefined,
62
+ };
63
+ break;
64
+ }
65
+ default: {
66
+ if (type.includes('|')) {
67
+ // enums / unions (multi-choice strings)
68
+ // comes in like this: `{ name: '"option1" | "option2" | "option3"' }`
69
+ const options = type
70
+ .split('|')
71
+ .map((enumItem) => (0, utils_1.removeWrappingDoubleQuotes)(enumItem.trim()))
72
+ .filter(Boolean);
73
+ if (options === null || options === void 0 ? void 0 : options.length) {
74
+ props.properties[name] = {
75
+ type: 'string',
76
+ // ensuring list is unique
77
+ enum: [...new Set(options)],
78
+ };
79
+ }
80
+ }
81
+ }
82
+ }
83
+ });
84
+ const extraDocs = [];
85
+ if (attrDocs.tableRows.length) {
86
+ extraDocs.push(attrDocs);
87
+ }
88
+ if (eventDocs.tableRows.length) {
89
+ extraDocs.push(eventDocs);
90
+ }
91
+ return {
92
+ isInferred: true,
93
+ props,
94
+ slots: {},
95
+ extraDocs,
96
+ hidePropsTable: true,
97
+ };
98
+ }
99
+ //# sourceMappingURL=infer-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infer-spec.js","sourceRoot":"","sources":["../src/infer-spec.ts"],"names":[],"mappings":";;AAIA,8BA0GC;AA7GD,2CAA6D;AAG7D,SAAgB,SAAS,CAAC,EACxB,2BAA2B,EAC3B,OAAO,GAIR;;IACC,IAAI,CAAC,2BAA2B;QAAE,OAAO,KAAK,CAAC;IAC/C,MAAM,GAAG,GAAG,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAC/C,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAC/B,CAAC;IACF,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA,MAAA,GAAG,C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;QAC/B,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO;QACL,UAAU,EAAE,IAAI;QAChB,KAAK;QACL,KAAK,EAAE,EAAE;QACT,SAAS;QACT,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC"}
@@ -1,9 +1,20 @@
1
1
  import { KnapsackRendererBase } from '@knapsack/app';
2
2
  import type { KnapsackRenderParams, KnapsackTemplateRenderer, KnapsackTemplateRendererResults, KnapsackTemplateRendererBase } from '@knapsack/app/types';
3
3
  export declare class KnapsackWebComponentRenderer extends KnapsackRendererBase implements KnapsackTemplateRenderer {
4
- constructor();
4
+ #private;
5
+ constructor({ customElementManifestSchemaPath, }: {
6
+ /**
7
+ * Path to a custom-elements.json file.
8
+ * https://github.com/webcomponents/custom-elements-manifest
9
+ * https://github.com/runem/web-component-analyzer
10
+ */
11
+ customElementManifestSchemaPath?: string;
12
+ });
5
13
  render(opt: KnapsackRenderParams): Promise<KnapsackTemplateRendererResults>;
6
14
  getUsage(opt: KnapsackRenderParams): Promise<string>;
15
+ inferSpec({ template, }: Parameters<KnapsackTemplateRendererBase['inferSpec']>[0]): Promise<false | import("@knapsack/types").KsTemplateSpec>;
16
+ getTemplateSuggestions({ newPath, }: Parameters<KnapsackTemplateRendererBase['getTemplateSuggestions']>[0]): ReturnType<KnapsackTemplateRendererBase['getTemplateSuggestions']>;
17
+ watch(): Promise<void>;
7
18
  getMeta: KnapsackTemplateRenderer['getMeta'];
8
19
  getTemplateMeta: KnapsackTemplateRendererBase['getTemplateMeta'];
9
20
  alterTemplateMetaFiles: KnapsackTemplateRendererBase['alterTemplateMetaFiles'];
@@ -1 +1 @@
1
- {"version":3,"file":"renderer-web-components.d.ts","sourceRoot":"","sources":["../src/renderer-web-components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAO,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,+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AAE,wBAAwB,CAAC,SAAS,CAAC,CA2BzC;IAEH,eAAe,EAAE,4BAA4B,CAAC,iBAAiB,CAAC,CAyE9D;IAEF,sBAAsB,EAAE,4BAA4B,CAAC,wBAAwB,CAAC,CAuB1E;CACL"}
@@ -1,6 +1,22 @@
1
1
  "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ var _KnapsackWebComponentRenderer_instances, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, _KnapsackWebComponentRenderer_customElementManifestSchema, _KnapsackWebComponentRenderer_setCustomElementManifestSchema;
2
17
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.KnapsackWebComponentRenderer = void 0;
19
+ const chokidar_1 = __importDefault(require("chokidar"));
4
20
  const app_1 = require("@knapsack/app");
5
21
  const fs_extra_1 = require("fs-extra");
6
22
  const types_1 = require("@knapsack/types");
@@ -8,17 +24,21 @@ const path_1 = require("path");
8
24
  const file_utils_1 = require("@knapsack/file-utils");
9
25
  const cheerio_1 = require("cheerio");
10
26
  const utils_1 = require("./utils");
27
+ const infer_spec_1 = require("./infer-spec");
11
28
  const pkg = JSON.parse((0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../package.json'), 'utf-8'));
12
29
  app_1.log.setupUpdateNotifier(pkg);
13
30
  // static methods only
14
31
  const { createSlotOptionsHtmlTags } = app_1.KnapsackRendererBase;
15
32
  class KnapsackWebComponentRenderer extends app_1.KnapsackRendererBase {
16
- constructor() {
33
+ constructor({ customElementManifestSchemaPath, }) {
17
34
  super({
18
35
  id: types_1.rendererIds['web-components'],
19
36
  language: 'html',
20
37
  extension: '.html',
21
38
  });
39
+ _KnapsackWebComponentRenderer_instances.add(this);
40
+ _KnapsackWebComponentRenderer_customElementManifestSchemaPath.set(this, void 0);
41
+ _KnapsackWebComponentRenderer_customElementManifestSchema.set(this, void 0);
22
42
  this.getMeta = () => ({
23
43
  id: this.id,
24
44
  title: 'Web Components',
@@ -30,8 +50,8 @@ class KnapsackWebComponentRenderer extends app_1.KnapsackRendererBase {
30
50
  hasSlotsSupport: true,
31
51
  hasSlotOptionsSupport: true,
32
52
  version: pkg.version,
33
- hasInferSpecSupport: false,
34
- hasTemplateSuggestionsSupport: false,
53
+ hasInferSpecSupport: !!__classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, "f"),
54
+ hasTemplateSuggestionsSupport: !!__classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, "f"),
35
55
  prototypingTemplate: {
36
56
  path: '',
37
57
  alias: 'div',
@@ -137,6 +157,22 @@ class KnapsackWebComponentRenderer extends app_1.KnapsackRendererBase {
137
157
  });
138
158
  return newFiles;
139
159
  };
160
+ if (customElementManifestSchemaPath) {
161
+ try {
162
+ const { absolutePath, exists } = (0, file_utils_1.resolvePathSync)({
163
+ path: customElementManifestSchemaPath,
164
+ resolveFromDir: this.userConfigDir,
165
+ });
166
+ if (!exists) {
167
+ throw new Error(`Cannot find custom element manifest schema at ${customElementManifestSchemaPath}`);
168
+ }
169
+ __classPrivateFieldSet(this, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, absolutePath, "f");
170
+ __classPrivateFieldGet(this, _KnapsackWebComponentRenderer_instances, "m", _KnapsackWebComponentRenderer_setCustomElementManifestSchema).call(this);
171
+ }
172
+ catch (error) {
173
+ throw new Error(`Cannot read custom element manifest schema from ${customElementManifestSchemaPath}`);
174
+ }
175
+ }
140
176
  }
141
177
  async render(opt) {
142
178
  const usage = await this.getUsage(opt);
@@ -262,6 +298,46 @@ class KnapsackWebComponentRenderer extends app_1.KnapsackRendererBase {
262
298
  throw new Error(`Must pass in a demo.type`);
263
299
  }
264
300
  }
301
+ async inferSpec({ template, }) {
302
+ if (!__classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, "f"))
303
+ return false;
304
+ return (0, infer_spec_1.inferSpec)({
305
+ customElementManifestSchema: __classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchema, "f"),
306
+ tagName: template.alias,
307
+ });
308
+ }
309
+ async getTemplateSuggestions({ newPath, }) {
310
+ var _a;
311
+ if (!__classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, "f"))
312
+ return { suggestions: [] };
313
+ const tagNames = ((_a = __classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchema, "f").tags) === null || _a === void 0 ? void 0 : _a.map(({ name }) => name)) || [];
314
+ const usedNames = this.getMyTemplates().allTemplates.map(({ alias }) => alias);
315
+ const unusedNames = tagNames.filter((name) => !usedNames.includes(name));
316
+ return {
317
+ suggestions: unusedNames.map((name) => ({ alias: name, path: '' })),
318
+ };
319
+ }
320
+ async watch() {
321
+ super.watch({ templatePaths: [] });
322
+ if (!__classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, "f"))
323
+ return;
324
+ const watcher = chokidar_1.default.watch(__classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, "f"), {
325
+ ignoreInitial: true,
326
+ });
327
+ watcher.on('change', () => {
328
+ __classPrivateFieldGet(this, _KnapsackWebComponentRenderer_instances, "m", _KnapsackWebComponentRenderer_setCustomElementManifestSchema).call(this);
329
+ app_1.knapsackEvents.emitAppClientDataChanged();
330
+ this.onChange();
331
+ });
332
+ app_1.knapsackEvents.onShutdown(() => watcher.close());
333
+ }
265
334
  }
266
335
  exports.KnapsackWebComponentRenderer = KnapsackWebComponentRenderer;
336
+ _KnapsackWebComponentRenderer_customElementManifestSchemaPath = new WeakMap(), _KnapsackWebComponentRenderer_customElementManifestSchema = new WeakMap(), _KnapsackWebComponentRenderer_instances = new WeakSet(), _KnapsackWebComponentRenderer_setCustomElementManifestSchema = function _KnapsackWebComponentRenderer_setCustomElementManifestSchema() {
337
+ if (!__classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, "f"))
338
+ return;
339
+ const customElementManifestSchema = (0, file_utils_1.readJSONSync)(__classPrivateFieldGet(this, _KnapsackWebComponentRenderer_customElementManifestSchemaPath, "f"));
340
+ const data = utils_1.CustomElementsSchema.parse(customElementManifestSchema);
341
+ __classPrivateFieldSet(this, _KnapsackWebComponentRenderer_customElementManifestSchema, data, "f");
342
+ };
267
343
  //# sourceMappingURL=renderer-web-components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderer-web-components.js","sourceRoot":"","sources":["../src/renderer-web-components.ts"],"names":[],"mappings":";;;AAAA,uCAA0D;AAO1D,uCAAkD;AAClD,2CAKyB;AAKzB,+BAA4B;AAC5B,qDAAkD;AAClD,qCAA8C;AAC9C,mCAAmC;AAEnC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,IAAA,uBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAC1D,CAAC;AACF,SAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAE7B,sBAAsB;AACtB,MAAM,EAAE,yBAAyB,EAAE,GAAG,0BAAo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c,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;CAkIF;AA/YD,oEA+YC;;IAnWG,IAAI,CAAC,uBAAA,IAAI,qEAAiC;QAAE,OAAO;IACnD,MAAM,2BAA2B,GAAG,IAAA,yBAAY,EAC9C,uBAAA,IAAI,qEAAiC,CACtC,CAAC;IACF,MAAM,IAAI,GAAG,4BAAoB,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACrE,uBAAA,IAAI,6DAAgC,IAAI,MAAA,CAAC;AAC3C,CAAC"}
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,160 @@
1
+ import { z } from 'zod';
2
+ declare const CustomElementsSchema: z.ZodObject<{
3
+ version: z.ZodString;
4
+ tags: z.ZodArray<z.ZodObject<{
5
+ name: z.ZodString;
6
+ path: z.ZodString;
7
+ attributes: z.ZodArray<z.ZodObject<{
8
+ name: z.ZodString;
9
+ type: z.ZodString;
10
+ default: z.ZodString;
11
+ description: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ name?: string;
14
+ type?: string;
15
+ default?: string;
16
+ description?: string;
17
+ }, {
18
+ name?: string;
19
+ type?: string;
20
+ default?: string;
21
+ description?: string;
22
+ }>, "many">;
23
+ properties: z.ZodArray<z.ZodObject<{
24
+ name: z.ZodString;
25
+ type: z.ZodString;
26
+ default: z.ZodString;
27
+ attribute: z.ZodOptional<z.ZodString>;
28
+ description: z.ZodOptional<z.ZodString>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ name?: string;
31
+ type?: string;
32
+ default?: string;
33
+ description?: string;
34
+ attribute?: string;
35
+ }, {
36
+ name?: string;
37
+ type?: string;
38
+ default?: string;
39
+ description?: string;
40
+ attribute?: string;
41
+ }>, "many">;
42
+ events: z.ZodArray<z.ZodObject<{
43
+ name: z.ZodString;
44
+ }, "strip", z.ZodTypeAny, {
45
+ name?: string;
46
+ }, {
47
+ name?: string;
48
+ }>, "many">;
49
+ }, "strip", z.ZodTypeAny, {
50
+ name?: string;
51
+ path?: string;
52
+ attributes?: {
53
+ name?: string;
54
+ type?: string;
55
+ default?: string;
56
+ description?: string;
57
+ }[];
58
+ properties?: {
59
+ name?: string;
60
+ type?: string;
61
+ default?: string;
62
+ description?: string;
63
+ attribute?: string;
64
+ }[];
65
+ events?: {
66
+ name?: string;
67
+ }[];
68
+ }, {
69
+ name?: string;
70
+ path?: string;
71
+ attributes?: {
72
+ name?: string;
73
+ type?: string;
74
+ default?: string;
75
+ description?: string;
76
+ }[];
77
+ properties?: {
78
+ name?: string;
79
+ type?: string;
80
+ default?: string;
81
+ description?: string;
82
+ attribute?: string;
83
+ }[];
84
+ events?: {
85
+ name?: string;
86
+ }[];
87
+ }>, "many">;
88
+ }, "strip", z.ZodTypeAny, {
89
+ version?: string;
90
+ tags?: {
91
+ name?: string;
92
+ path?: string;
93
+ attributes?: {
94
+ name?: string;
95
+ type?: string;
96
+ default?: string;
97
+ description?: string;
98
+ }[];
99
+ properties?: {
100
+ name?: string;
101
+ type?: string;
102
+ default?: string;
103
+ description?: string;
104
+ attribute?: string;
105
+ }[];
106
+ events?: {
107
+ name?: string;
108
+ }[];
109
+ }[];
110
+ }, {
111
+ version?: string;
112
+ tags?: {
113
+ name?: string;
114
+ path?: string;
115
+ attributes?: {
116
+ name?: string;
117
+ type?: string;
118
+ default?: string;
119
+ description?: string;
120
+ }[];
121
+ properties?: {
122
+ name?: string;
123
+ type?: string;
124
+ default?: string;
125
+ description?: string;
126
+ attribute?: string;
127
+ }[];
128
+ events?: {
129
+ name?: string;
130
+ }[];
131
+ }[];
132
+ }>;
133
+ declare const validateCustomElements: (data: unknown) => {
134
+ version?: string;
135
+ tags?: {
136
+ name?: string;
137
+ path?: string;
138
+ attributes?: {
139
+ name?: string;
140
+ type?: string;
141
+ default?: string;
142
+ description?: string;
143
+ }[];
144
+ properties?: {
145
+ name?: string;
146
+ type?: string;
147
+ default?: string;
148
+ description?: string;
149
+ attribute?: string;
150
+ }[];
151
+ events?: {
152
+ name?: string;
153
+ }[];
154
+ }[];
155
+ };
156
+ export { CustomElementsSchema, validateCustomElements };
157
+ export type CustomElementManifest = z.infer<typeof CustomElementsSchema>;
1
158
  export declare function getUsage(data: {
2
159
  templateName: string;
3
160
  props?: Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAqCA,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6BxB,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,SAAU,OAAO;;;;;;;;;;;;;;;;;;;;;;CACX,CAAC;AAEnC,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAC;AACxD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAmCzE,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB"}
package/dist/utils.js CHANGED
@@ -1,9 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateCustomElements = exports.CustomElementsSchema = void 0;
3
4
  exports.getUsage = getUsage;
4
5
  const ejs_1 = require("ejs");
5
6
  const path_1 = require("path");
6
7
  const fs_1 = require("fs");
8
+ const zod_1 = require("zod");
9
+ const AttributeSchema = zod_1.z.object({
10
+ name: zod_1.z.string(),
11
+ type: zod_1.z.string(),
12
+ default: zod_1.z.string(),
13
+ description: zod_1.z.string().optional(),
14
+ });
15
+ const PropertySchema = zod_1.z.object({
16
+ name: zod_1.z.string(),
17
+ type: zod_1.z.string(),
18
+ default: zod_1.z.string(),
19
+ attribute: zod_1.z.string().optional(),
20
+ description: zod_1.z.string().optional(),
21
+ });
22
+ const EventSchema = zod_1.z.object({
23
+ name: zod_1.z.string(),
24
+ });
25
+ const TagSchema = zod_1.z.object({
26
+ name: zod_1.z.string(),
27
+ path: zod_1.z.string(),
28
+ attributes: zod_1.z.array(AttributeSchema),
29
+ properties: zod_1.z.array(PropertySchema),
30
+ events: zod_1.z.array(EventSchema),
31
+ });
32
+ const CustomElementsSchema = zod_1.z.object({
33
+ version: zod_1.z.string(),
34
+ tags: zod_1.z.array(TagSchema),
35
+ });
36
+ exports.CustomElementsSchema = CustomElementsSchema;
37
+ // You can use this to validate your JSON
38
+ const validateCustomElements = (data) => CustomElementsSchema.parse(data);
39
+ exports.validateCustomElements = validateCustomElements;
7
40
  const renderUsageTemplate = (0, ejs_1.compile)((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../template.web-components.ejs'), 'utf8'), {
8
41
  filename: 'template.web-components.ejs',
9
42
  async: true,
package/dist/utils.js.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AACvB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@knapsack/renderer-web-components",
3
3
  "description": "Render Web Components",
4
- "version": "4.69.0--canary.4433.d5d9fce.1",
4
+ "version": "4.69.0--canary.4627.19723b8.0",
5
5
  "main": "dist/renderer-web-components.js",
6
6
  "types": "dist/renderer-web-components.d.ts",
7
7
  "sideEffects": false,
@@ -15,17 +15,20 @@
15
15
  },
16
16
  "author": "Knapsack (https://www.knapsack.cloud)",
17
17
  "dependencies": {
18
- "@knapsack/app": "4.69.0--canary.4433.d5d9fce.1",
19
- "@knapsack/file-utils": "4.69.0--canary.4433.d5d9fce.1",
20
- "@knapsack/types": "4.69.0--canary.4433.d5d9fce.1",
18
+ "@knapsack/app": "4.69.0--canary.4627.19723b8.0",
19
+ "@knapsack/file-utils": "4.69.0--canary.4627.19723b8.0",
20
+ "@knapsack/types": "4.69.0--canary.4627.19723b8.0",
21
+ "@knapsack/utils": "4.69.0--canary.4627.19723b8.0",
21
22
  "cheerio": "^1.0.0",
23
+ "chokidar": "^3.6.0",
22
24
  "ejs": "^3.1.10",
23
- "fs-extra": "^11.2.0"
25
+ "fs-extra": "^11.2.0",
26
+ "zod": "^3.23.8"
24
27
  },
25
28
  "devDependencies": {
26
- "@knapsack/eslint-config-starter": "4.69.0--canary.4433.d5d9fce.1",
27
- "@knapsack/test-ava": "4.69.0--canary.4433.d5d9fce.1",
28
- "@knapsack/typescript-config-starter": "4.69.0--canary.4433.d5d9fce.1",
29
+ "@knapsack/eslint-config-starter": "4.69.0--canary.4627.19723b8.0",
30
+ "@knapsack/test-ava": "4.69.0--canary.4627.19723b8.0",
31
+ "@knapsack/typescript-config-starter": "4.69.0--canary.4627.19723b8.0",
29
32
  "@types/fs-extra": "^11.0.4",
30
33
  "@types/node": "^20.16.1",
31
34
  "ava": "^6.1.3",
@@ -41,5 +44,5 @@
41
44
  "directory": "apps/client/renderers/renderer-web-components",
42
45
  "type": "git"
43
46
  },
44
- "gitHead": "d5d9fce4a34f8134a19533f1b7c568c9519aaac0"
47
+ "gitHead": "19723b823c446aa7c35c2e936fe1d1ea999ea5bc"
45
48
  }