@astryxdesign/cli 0.6.5-vanilla-poc.6e25cfc → 0.6.6
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 +84 -0
- package/README.md +1 -34
- package/api/build/_adapter.d.mts +14 -0
- package/api/build/_adapter.mjs +58 -1
- package/api/build/build.test.mjs +74 -1
- package/api/build/kit/kit.mjs +39 -7
- package/api/build/kit/rank.d.mts +8 -0
- package/api/build/kit/rank.mjs +14 -0
- package/api/build/kit/weights.d.mts +82 -0
- package/api/build/kit/weights.json +1 -0
- package/api/build/kit/weights.mjs +305 -0
- package/api/build/kit/weights.test.mjs +190 -0
- package/api/component/_adapter.d.mts +1 -51
- package/api/component/_adapter.mjs +3 -110
- package/api/component/component.d.mts +1 -9
- package/api/component/component.doc.mjs +7 -52
- package/api/component/component.mjs +3 -276
- package/api/component/component.type.d.mts +1 -28
- package/api/component/component.type.mjs +1 -20
- package/api/docs/docs.d.mts +6 -0
- package/api/docs/docs.depth.test.mjs +132 -0
- package/api/docs/docs.doc.mjs +31 -2
- package/api/docs/docs.mjs +44 -1
- package/api/docs/docs.type.d.mts +38 -1
- package/api/docs/docs.type.mjs +18 -1
- package/api/docs/node/node.d.mts +28 -3
- package/api/docs/node/node.mjs +146 -23
- package/api/hook/list/list.d.mts +1 -1
- package/api/index.d.mts +0 -8
- package/api/index.mjs +0 -8
- package/api/integration/add-theme.mjs +93 -3
- package/api/integration/add-theme.test.mjs +100 -0
- package/api/integration/integrationAddTheme.doc.mjs +1 -1
- package/api/search/search.d.mts +8 -1
- package/api/search/search.doc.mjs +3 -3
- package/api/search/search.mjs +58 -73
- package/api/search/search.test.mjs +122 -21
- package/api/search/search.type.d.mts +0 -10
- package/api/search/search.type.mjs +0 -1
- package/api/template/cdn/cdn.test.mjs +2 -50
- package/api/template/template.d.mts +0 -6
- package/api/template/template.doc.mjs +4 -56
- package/api/template/template.mjs +0 -82
- package/api/template/template.type.d.mts +0 -12
- package/api/template/template.type.mjs +0 -7
- package/assets/cdn.template.html +5 -19
- package/assets/docs/tokens.doc.mjs +3 -3
- package/assets/docs/tree/add-a-theme.doc.mjs +4 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +4 -4
- package/clients/cli/commands/component/index.mjs +9 -66
- package/clients/cli/commands/component.doc.mjs +4 -26
- package/clients/cli/commands/docs.depth.test.mjs +219 -0
- package/clients/cli/commands/docs.doc.mjs +15 -2
- package/clients/cli/commands/docs.mjs +222 -5
- package/clients/cli/commands/integration-add.doc.mjs +1 -1
- package/clients/cli/commands/search.doc.mjs +2 -3
- package/clients/cli/commands/search.mjs +11 -8
- package/clients/cli/commands/search.test.mjs +35 -40
- package/clients/cli/commands/template.doc.mjs +3 -31
- package/clients/cli/commands/template.mjs +2 -37
- package/foundation/discovery/theme-discovery.d.mts +6 -0
- package/foundation/discovery/theme-discovery.mjs +9 -0
- package/foundation/response/response-types.doc.mjs +0 -38
- package/package.json +5 -9
- package/api/_vanilla-assets.d.mts +0 -10
- package/api/_vanilla-assets.mjs +0 -59
- package/api/component/html/html.d.mts +0 -12
- package/api/component/html/html.doc.d.mts +0 -5
- package/api/component/html/html.doc.mjs +0 -66
- package/api/component/html/html.mjs +0 -25
- package/api/component/html/html.test.mjs +0 -61
- package/api/component/html/html.type.d.mts +0 -23
- package/api/component/html/html.type.mjs +0 -27
- package/api/component/web-components/web-components.d.mts +0 -12
- package/api/component/web-components/web-components.doc.d.mts +0 -5
- package/api/component/web-components/web-components.doc.mjs +0 -70
- package/api/component/web-components/web-components.mjs +0 -32
- package/api/component/web-components/web-components.test.mjs +0 -50
- package/api/component/web-components/web-components.type.d.mts +0 -23
- package/api/component/web-components/web-components.type.mjs +0 -27
- package/api/template/_adapter.d.mts +0 -38
- package/api/template/_adapter.mjs +0 -90
- package/api/template/html/html.d.mts +0 -17
- package/api/template/html/html.doc.d.mts +0 -5
- package/api/template/html/html.doc.mjs +0 -72
- package/api/template/html/html.mjs +0 -61
- package/api/template/html/html.test.mjs +0 -71
- package/api/template/html/html.type.d.mts +0 -26
- package/api/template/html/html.type.mjs +0 -28
- package/api/template/web-components/web-components.d.mts +0 -13
- package/api/template/web-components/web-components.doc.d.mts +0 -5
- package/api/template/web-components/web-components.doc.mjs +0 -69
- package/api/template/web-components/web-components.mjs +0 -51
- package/api/template/web-components/web-components.test.mjs +0 -73
- package/api/template/web-components/web-components.type.d.mts +0 -26
- package/api/template/web-components/web-components.type.mjs +0 -28
- package/assets/generated/core-component-docs.json +0 -1
- package/assets/vanilla/elements-markup/Avatar.html +0 -27
- package/assets/vanilla/elements-markup/Badge.html +0 -16
- package/assets/vanilla/elements-markup/Banner.html +0 -32
- package/assets/vanilla/elements-markup/Breadcrumbs.html +0 -23
- package/assets/vanilla/elements-markup/Button.html +0 -37
- package/assets/vanilla/elements-markup/Card.html +0 -24
- package/assets/vanilla/elements-markup/CheckboxInput.html +0 -28
- package/assets/vanilla/elements-markup/Collapsible.html +0 -26
- package/assets/vanilla/elements-markup/DateInput.html +0 -28
- package/assets/vanilla/elements-markup/Dialog.html +0 -33
- package/assets/vanilla/elements-markup/Divider.html +0 -20
- package/assets/vanilla/elements-markup/DropdownMenu.html +0 -26
- package/assets/vanilla/elements-markup/EmptyState.html +0 -27
- package/assets/vanilla/elements-markup/Heading.html +0 -18
- package/assets/vanilla/elements-markup/HoverCard.html +0 -39
- package/assets/vanilla/elements-markup/Layout.html +0 -28
- package/assets/vanilla/elements-markup/Lightbox.html +0 -33
- package/assets/vanilla/elements-markup/Link.html +0 -23
- package/assets/vanilla/elements-markup/NumberInput.html +0 -34
- package/assets/vanilla/elements-markup/ProgressBar.html +0 -47
- package/assets/vanilla/elements-markup/RadioList.html +0 -28
- package/assets/vanilla/elements-markup/Selector.html +0 -34
- package/assets/vanilla/elements-markup/SideNav.html +0 -32
- package/assets/vanilla/elements-markup/Skeleton.html +0 -18
- package/assets/vanilla/elements-markup/Slider.html +0 -31
- package/assets/vanilla/elements-markup/Stack.html +0 -33
- package/assets/vanilla/elements-markup/StatusDot.html +0 -19
- package/assets/vanilla/elements-markup/Switch.html +0 -28
- package/assets/vanilla/elements-markup/Tab.html +0 -18
- package/assets/vanilla/elements-markup/TabList.html +0 -31
- package/assets/vanilla/elements-markup/Table.html +0 -31
- package/assets/vanilla/elements-markup/Text.html +0 -24
- package/assets/vanilla/elements-markup/TextArea.html +0 -32
- package/assets/vanilla/elements-markup/TextInput.html +0 -92
- package/assets/vanilla/elements-markup/Theme.html +0 -16
- package/assets/vanilla/elements-markup/TimeInput.html +0 -29
- package/assets/vanilla/elements-markup/Toast.html +0 -22
- package/assets/vanilla/elements-markup/Tooltip.html +0 -30
- package/assets/vanilla/elements-markup/TopNav.html +0 -85
- package/assets/vanilla/elements-markup/Typeahead.html +0 -31
- package/assets/vanilla/elements-templates/dashboard.html +0 -167
- package/assets/vanilla/elements-templates/detail-page.html +0 -145
- package/assets/vanilla/elements-templates/form-two-column.html +0 -135
- package/assets/vanilla/elements-templates/kanban-board.html +0 -141
- package/assets/vanilla/elements-templates/login.html +0 -100
- package/assets/vanilla/elements-templates/product-detail.html +0 -128
- package/assets/vanilla/elements-templates/settings.html +0 -130
- package/assets/vanilla/elements-templates/shell-side-nav.html +0 -160
- package/assets/vanilla/elements-templates/table-filter.html +0 -154
- package/assets/vanilla/markup/Avatar.html +0 -24
- package/assets/vanilla/markup/Badge.html +0 -12
- package/assets/vanilla/markup/Banner.html +0 -49
- package/assets/vanilla/markup/Breadcrumbs.html +0 -38
- package/assets/vanilla/markup/Button.html +0 -37
- package/assets/vanilla/markup/Card.html +0 -16
- package/assets/vanilla/markup/CheckboxInput.html +0 -45
- package/assets/vanilla/markup/Collapsible.html +0 -9
- package/assets/vanilla/markup/DateInput.html +0 -42
- package/assets/vanilla/markup/Dialog.html +0 -45
- package/assets/vanilla/markup/Divider.html +0 -9
- package/assets/vanilla/markup/DropdownMenu.html +0 -30
- package/assets/vanilla/markup/EmptyState.html +0 -41
- package/assets/vanilla/markup/Heading.html +0 -9
- package/assets/vanilla/markup/HoverCard.html +0 -85
- package/assets/vanilla/markup/Layout.html +0 -35
- package/assets/vanilla/markup/Lightbox.html +0 -107
- package/assets/vanilla/markup/Link.html +0 -6
- package/assets/vanilla/markup/NumberInput.html +0 -55
- package/assets/vanilla/markup/ProgressBar.html +0 -101
- package/assets/vanilla/markup/RadioList.html +0 -90
- package/assets/vanilla/markup/Selector.html +0 -92
- package/assets/vanilla/markup/SideNav.html +0 -82
- package/assets/vanilla/markup/Skeleton.html +0 -26
- package/assets/vanilla/markup/Slider.html +0 -65
- package/assets/vanilla/markup/Stack.html +0 -13
- package/assets/vanilla/markup/StatusDot.html +0 -22
- package/assets/vanilla/markup/Switch.html +0 -47
- package/assets/vanilla/markup/TabList.html +0 -56
- package/assets/vanilla/markup/Table.html +0 -75
- package/assets/vanilla/markup/Text.html +0 -9
- package/assets/vanilla/markup/TextArea.html +0 -37
- package/assets/vanilla/markup/TextInput.html +0 -80
- package/assets/vanilla/markup/Theme.html +0 -48
- package/assets/vanilla/markup/TimeInput.html +0 -43
- package/assets/vanilla/markup/Toast.html +0 -42
- package/assets/vanilla/markup/Tooltip.html +0 -18
- package/assets/vanilla/markup/TopNav.html +0 -81
- package/assets/vanilla/markup/Typeahead.html +0 -60
- package/assets/vanilla/templates/dashboard.html +0 -462
- package/assets/vanilla/templates/detail-page.html +0 -536
- package/assets/vanilla/templates/form-two-column.html +0 -438
- package/assets/vanilla/templates/kanban-board.html +0 -443
- package/assets/vanilla/templates/login.html +0 -199
- package/assets/vanilla/templates/product-detail.html +0 -335
- package/assets/vanilla/templates/settings.html +0 -374
- package/assets/vanilla/templates/shell-side-nav.html +0 -440
- package/assets/vanilla/templates/table-filter.html +0 -514
- package/clients/cli/commands/vanilla-html.test.mjs +0 -245
- package/foundation/discovery/bundled-component-docs.d.mts +0 -39
- package/foundation/discovery/bundled-component-docs.mjs +0 -92
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {object} ComponentHtmlListEntry
|
|
5
|
-
* @property {string} name
|
|
6
|
-
* @property {string} file
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {object} ComponentHtmlListResponse
|
|
11
|
-
* @property {'component.html.list'} type
|
|
12
|
-
* @property {ComponentHtmlListEntry[]} data
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @typedef {object} ComponentHtmlResponse
|
|
17
|
-
* @property {'component.html'} type
|
|
18
|
-
* @property {{component: string, file: string, source: string}} data
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @typedef {object} ComponentHtmlOptions
|
|
23
|
-
* @property {string} [cwd]
|
|
24
|
-
* @property {boolean} [list]
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
-
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @param {string|undefined} name
|
|
6
|
-
* @param {{cwd?: string, list?: boolean}} [options]
|
|
7
|
-
* @returns {import('./web-components.type.mjs').ComponentWebComponentsResponse | import('./web-components.type.mjs').ComponentWebComponentsListResponse}
|
|
8
|
-
*/
|
|
9
|
-
export function componentWebComponents(name: string | undefined, options?: {
|
|
10
|
-
cwd?: string;
|
|
11
|
-
list?: boolean;
|
|
12
|
-
}): import("./web-components.type.mjs").ComponentWebComponentsResponse | import("./web-components.type.mjs").ComponentWebComponentsListResponse;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
-
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
-
|
|
4
|
-
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
5
|
-
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'function',
|
|
6
|
-
kind: 'api',
|
|
7
|
-
name: 'componentWebComponents',
|
|
8
|
-
namespace: 'cli/api',
|
|
9
|
-
displayName: 'componentWebComponents()',
|
|
10
|
-
summary: 'List or read vanilla web-component markup.',
|
|
11
|
-
description:
|
|
12
|
-
'Reads packages/vanilla/elements-markup in a source checkout and falls back to the bundled CLI copy after installation. List mode returns the available .html files; named mode returns one file verbatim.',
|
|
13
|
-
importPath: '@astryxdesign/cli/api',
|
|
14
|
-
signature:
|
|
15
|
-
'componentWebComponents(name?: string, options?: ComponentWebComponentsOptions): ComponentWebComponentsListResponse | ComponentWebComponentsResponse',
|
|
16
|
-
keywords: ['component', 'web components', 'vanilla', 'markup'],
|
|
17
|
-
params: [
|
|
18
|
-
{
|
|
19
|
-
name: 'name',
|
|
20
|
-
type: 'string',
|
|
21
|
-
description: 'Exact vanilla component name.',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'options.cwd',
|
|
25
|
-
type: 'string',
|
|
26
|
-
description:
|
|
27
|
-
'Directory to search upward for packages/vanilla before using the bundled CLI copy.',
|
|
28
|
-
default: 'process.cwd()',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'options.list',
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
description: 'List available markup files instead of reading one.',
|
|
34
|
-
default: 'false',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
returns: [
|
|
38
|
-
{
|
|
39
|
-
type: 'component.web-components.list',
|
|
40
|
-
description: 'Sorted web-component markup files as {name, file}.',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
type: 'component.web-components',
|
|
44
|
-
description:
|
|
45
|
-
'One web-component markup file as {component, file, source}.',
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
throws: [
|
|
49
|
-
{
|
|
50
|
-
code: 'ERR_FILE_NOT_FOUND',
|
|
51
|
-
when: 'neither checkout nor bundled vanilla assets are available',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
code: 'ERR_INVALID_ARGUMENT',
|
|
55
|
-
when: 'name is not a safe component identifier',
|
|
56
|
-
},
|
|
57
|
-
{code: 'ERR_UNKNOWN_COMPONENT', when: 'no matching markup file exists'},
|
|
58
|
-
],
|
|
59
|
-
examples: [
|
|
60
|
-
{
|
|
61
|
-
label: 'Read Button markup',
|
|
62
|
-
code: "componentWebComponents('Button', {cwd})",
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label: 'List markup files',
|
|
66
|
-
code: 'componentWebComponents(undefined, {cwd, list: true})',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
related: ['component', 'componentHtml', 'templateWebComponents'],
|
|
70
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file Vanilla web-component projection for the component command.
|
|
5
|
-
* @position api/component/web-components — routed by component.mjs for the web-components framework
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
listVanillaComponentMarkup,
|
|
10
|
-
readVanillaComponentMarkup,
|
|
11
|
-
} from '../_adapter.mjs';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @param {string|undefined} name
|
|
15
|
-
* @param {{cwd?: string, list?: boolean}} [options]
|
|
16
|
-
* @returns {import('./web-components.type.mjs').ComponentWebComponentsResponse | import('./web-components.type.mjs').ComponentWebComponentsListResponse}
|
|
17
|
-
*/
|
|
18
|
-
export function componentWebComponents(name, options = {}) {
|
|
19
|
-
const {cwd = process.cwd(), list = false} = options;
|
|
20
|
-
if (list) {
|
|
21
|
-
return {
|
|
22
|
-
type: 'component.web-components.list',
|
|
23
|
-
data: listVanillaComponentMarkup(cwd, 'web-components'),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const data = readVanillaComponentMarkup(
|
|
27
|
-
/** @type {string} */ (name),
|
|
28
|
-
cwd,
|
|
29
|
-
'web-components',
|
|
30
|
-
);
|
|
31
|
-
return {type: 'component.web-components', data};
|
|
32
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
import {describe, expect, it} from 'vitest';
|
|
4
|
-
import * as fs from 'node:fs';
|
|
5
|
-
import * as os from 'node:os';
|
|
6
|
-
import * as path from 'node:path';
|
|
7
|
-
import {componentWebComponents} from './web-components.mjs';
|
|
8
|
-
|
|
9
|
-
const FIXTURE = path.resolve(
|
|
10
|
-
import.meta.dirname,
|
|
11
|
-
'../../../test/fixtures/vanilla-project',
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
describe('componentWebComponents()', () => {
|
|
15
|
-
it('lists sorted web-component markup files', () => {
|
|
16
|
-
expect(
|
|
17
|
-
componentWebComponents(undefined, {cwd: FIXTURE, list: true}),
|
|
18
|
-
).toEqual({
|
|
19
|
-
type: 'component.web-components.list',
|
|
20
|
-
data: [{name: 'Button', file: 'Button.html'}],
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('falls back to bundled web-component markup outside a checkout', () => {
|
|
25
|
-
const outsideCheckout = fs.mkdtempSync(
|
|
26
|
-
path.join(os.tmpdir(), 'astryx-cli-installed-web-components-'),
|
|
27
|
-
);
|
|
28
|
-
try {
|
|
29
|
-
const result = componentWebComponents('Button', {cwd: outsideCheckout});
|
|
30
|
-
expect(result.type).toBe('component.web-components');
|
|
31
|
-
expect(result.data.source).toContain('<!-- attributes:');
|
|
32
|
-
expect(result.data.source).toContain('<ax-button');
|
|
33
|
-
} finally {
|
|
34
|
-
fs.rmSync(outsideCheckout, {recursive: true, force: true});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('returns generated docs and ax-* markup verbatim', () => {
|
|
39
|
-
const result = componentWebComponents('Button', {cwd: FIXTURE});
|
|
40
|
-
expect(result.type).toBe('component.web-components');
|
|
41
|
-
expect(result.data.source).toContain('<!-- attributes:');
|
|
42
|
-
expect(result.data.source).toContain('<ax-button');
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('rejects traversal-shaped names', () => {
|
|
46
|
-
expect(() => componentWebComponents('../Button', {cwd: FIXTURE})).toThrow(
|
|
47
|
-
/Invalid vanilla component name/,
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
-
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
-
|
|
4
|
-
export type ComponentWebComponentsListEntry = {
|
|
5
|
-
name: string;
|
|
6
|
-
file: string;
|
|
7
|
-
};
|
|
8
|
-
export type ComponentWebComponentsListResponse = {
|
|
9
|
-
type: "component.web-components.list";
|
|
10
|
-
data: ComponentWebComponentsListEntry[];
|
|
11
|
-
};
|
|
12
|
-
export type ComponentWebComponentsResponse = {
|
|
13
|
-
type: "component.web-components";
|
|
14
|
-
data: {
|
|
15
|
-
component: string;
|
|
16
|
-
file: string;
|
|
17
|
-
source: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export type ComponentWebComponentsOptions = {
|
|
21
|
-
cwd?: string | undefined;
|
|
22
|
-
list?: boolean | undefined;
|
|
23
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {object} ComponentWebComponentsListEntry
|
|
5
|
-
* @property {string} name
|
|
6
|
-
* @property {string} file
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {object} ComponentWebComponentsListResponse
|
|
11
|
-
* @property {'component.web-components.list'} type
|
|
12
|
-
* @property {ComponentWebComponentsListEntry[]} data
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @typedef {object} ComponentWebComponentsResponse
|
|
17
|
-
* @property {'component.web-components'} type
|
|
18
|
-
* @property {{component: string, file: string, source: string}} data
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @typedef {object} ComponentWebComponentsOptions
|
|
23
|
-
* @property {string} [cwd]
|
|
24
|
-
* @property {boolean} [list]
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
-
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @param {string} cwd
|
|
6
|
-
* @param {'html'|'web-components'} framework
|
|
7
|
-
* @returns {{id: string, file: string}[]}
|
|
8
|
-
*/
|
|
9
|
-
export function listVanillaTemplateMarkup(cwd: string, framework: "html" | "web-components"): {
|
|
10
|
-
id: string;
|
|
11
|
-
file: string;
|
|
12
|
-
}[];
|
|
13
|
-
/** @param {string} cwd @returns {{id: string, file: string}[]} */
|
|
14
|
-
export function listVanillaTemplateHtml(cwd: string): {
|
|
15
|
-
id: string;
|
|
16
|
-
file: string;
|
|
17
|
-
}[];
|
|
18
|
-
/**
|
|
19
|
-
* @param {string} id
|
|
20
|
-
* @param {string} cwd
|
|
21
|
-
* @param {'html'|'web-components'} framework
|
|
22
|
-
* @returns {{template: string, file: string, source: string}}
|
|
23
|
-
*/
|
|
24
|
-
export function readVanillaTemplateMarkup(id: string, cwd: string, framework: "html" | "web-components"): {
|
|
25
|
-
template: string;
|
|
26
|
-
file: string;
|
|
27
|
-
source: string;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* @param {string} id
|
|
31
|
-
* @param {string} cwd
|
|
32
|
-
* @returns {{template: string, file: string, source: string}}
|
|
33
|
-
*/
|
|
34
|
-
export function readVanillaTemplateHtml(id: string, cwd: string): {
|
|
35
|
-
template: string;
|
|
36
|
-
file: string;
|
|
37
|
-
source: string;
|
|
38
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file Filesystem adapter for vanilla HTML and web-component templates.
|
|
5
|
-
*
|
|
6
|
-
* Environment access stays here so each template projection remains a pure
|
|
7
|
-
* projection over one adapter result. Checkout assets are preferred; installed
|
|
8
|
-
* packages fall back to the generated copy bundled under assets/vanilla.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import * as fs from 'node:fs';
|
|
12
|
-
import * as path from 'node:path';
|
|
13
|
-
import {AstryxError} from '../error.mjs';
|
|
14
|
-
import {requireVanillaAssetsDir} from '../_vanilla-assets.mjs';
|
|
15
|
-
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @param {string} cwd
|
|
19
|
-
* @param {'html'|'web-components'} framework
|
|
20
|
-
* @returns {{id: string, file: string}[]}
|
|
21
|
-
*/
|
|
22
|
-
export function listVanillaTemplateMarkup(cwd, framework) {
|
|
23
|
-
const assetDir =
|
|
24
|
-
framework === 'web-components' ? 'elements-templates' : 'templates';
|
|
25
|
-
const templatesDir = path.join(requireVanillaAssetsDir(cwd), assetDir);
|
|
26
|
-
if (!fs.existsSync(templatesDir)) return [];
|
|
27
|
-
return fs
|
|
28
|
-
.readdirSync(templatesDir, {withFileTypes: true})
|
|
29
|
-
.filter(entry => entry.isFile() && entry.name.endsWith('.html'))
|
|
30
|
-
.map(entry => ({
|
|
31
|
-
id: entry.name.slice(0, -'.html'.length),
|
|
32
|
-
file: entry.name,
|
|
33
|
-
}))
|
|
34
|
-
.sort((a, b) => a.id.localeCompare(b.id));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** @param {string} cwd @returns {{id: string, file: string}[]} */
|
|
38
|
-
export function listVanillaTemplateHtml(cwd) {
|
|
39
|
-
return listVanillaTemplateMarkup(cwd, 'html');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @param {string} id
|
|
44
|
-
* @param {string} cwd
|
|
45
|
-
* @param {'html'|'web-components'} framework
|
|
46
|
-
* @returns {{template: string, file: string, source: string}}
|
|
47
|
-
*/
|
|
48
|
-
export function readVanillaTemplateMarkup(id, cwd, framework) {
|
|
49
|
-
const entries = listVanillaTemplateMarkup(cwd, framework);
|
|
50
|
-
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(id)) {
|
|
51
|
-
throw new AstryxError(
|
|
52
|
-
`Invalid vanilla template id "${id}"`,
|
|
53
|
-
undefined,
|
|
54
|
-
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
const match = entries.find(entry => entry.id === id);
|
|
58
|
-
const label = framework === 'web-components' ? 'web-component' : 'HTML';
|
|
59
|
-
if (!match) {
|
|
60
|
-
throw new AstryxError(
|
|
61
|
-
`Unknown vanilla ${label} template "${id}"`,
|
|
62
|
-
entries.map(entry => ({
|
|
63
|
-
name: entry.id,
|
|
64
|
-
reason: `vanilla ${label} template`,
|
|
65
|
-
})),
|
|
66
|
-
ERROR_CODES.ERR_UNKNOWN_TEMPLATE,
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
const assetDir =
|
|
70
|
-
framework === 'web-components' ? 'elements-templates' : 'templates';
|
|
71
|
-
const filePath = path.join(
|
|
72
|
-
requireVanillaAssetsDir(cwd),
|
|
73
|
-
assetDir,
|
|
74
|
-
match.file,
|
|
75
|
-
);
|
|
76
|
-
return {
|
|
77
|
-
template: id,
|
|
78
|
-
file: match.file,
|
|
79
|
-
source: fs.readFileSync(filePath, 'utf8'),
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @param {string} id
|
|
85
|
-
* @param {string} cwd
|
|
86
|
-
* @returns {{template: string, file: string, source: string}}
|
|
87
|
-
*/
|
|
88
|
-
export function readVanillaTemplateHtml(id, cwd) {
|
|
89
|
-
return readVanillaTemplateMarkup(id, cwd, 'html');
|
|
90
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
-
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
-
|
|
4
|
-
/** @param {string} ref @returns {string} */
|
|
5
|
-
export function astryxVanillaCdnBase(ref: string): string;
|
|
6
|
-
/**
|
|
7
|
-
* @param {string|undefined} name
|
|
8
|
-
* @param {{cwd?: string, list?: boolean, cdnRef?: string}} [options]
|
|
9
|
-
* @returns {import('./html.type.mjs').TemplateHtmlResponse | import('./html.type.mjs').TemplateHtmlListResponse}
|
|
10
|
-
*/
|
|
11
|
-
export function templateHtml(name: string | undefined, options?: {
|
|
12
|
-
cwd?: string;
|
|
13
|
-
list?: boolean;
|
|
14
|
-
cdnRef?: string;
|
|
15
|
-
}): import("./html.type.mjs").TemplateHtmlResponse | import("./html.type.mjs").TemplateHtmlListResponse;
|
|
16
|
-
export const ASTRYX_VANILLA_CDN_REF: "3eb9597f53f557d20b34b3072d450d2bbdbfa1ac";
|
|
17
|
-
export const ASTRYX_VANILLA_CDN_PLACEHOLDER: "__ASTRYX_VANILLA_CDN__";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
-
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
-
|
|
4
|
-
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
5
|
-
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'function',
|
|
6
|
-
kind: 'api',
|
|
7
|
-
name: 'templateHtml',
|
|
8
|
-
namespace: 'cli/api',
|
|
9
|
-
displayName: 'templateHtml()',
|
|
10
|
-
summary: 'List or render vanilla standalone HTML templates.',
|
|
11
|
-
description:
|
|
12
|
-
'Reads packages/vanilla/templates in a source checkout and falls back to the bundled CLI copy after installation. Named mode replaces __ASTRYX_VANILLA_CDN__ with a commit-pinned jsDelivr base URL.',
|
|
13
|
-
importPath: '@astryxdesign/cli/api',
|
|
14
|
-
signature:
|
|
15
|
-
'templateHtml(name?: string, options?: TemplateHtmlOptions): TemplateHtmlListResponse | TemplateHtmlResponse',
|
|
16
|
-
keywords: ['template', 'html', 'vanilla', 'jsdelivr', 'cdn'],
|
|
17
|
-
params: [
|
|
18
|
-
{name: 'name', type: 'string', description: 'Exact vanilla template id.'},
|
|
19
|
-
{
|
|
20
|
-
name: 'options.cwd',
|
|
21
|
-
type: 'string',
|
|
22
|
-
description:
|
|
23
|
-
'Directory to search upward for packages/vanilla before using the bundled CLI copy.',
|
|
24
|
-
default: 'process.cwd()',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'options.list',
|
|
28
|
-
type: 'boolean',
|
|
29
|
-
description: 'List available HTML template files instead of reading one.',
|
|
30
|
-
default: 'false',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'options.cdnRef',
|
|
34
|
-
type: 'string',
|
|
35
|
-
description: 'Git ref inserted into the jsDelivr base URL.',
|
|
36
|
-
default: 'ASTRYX_VANILLA_CDN_REF',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
returns: [
|
|
40
|
-
{
|
|
41
|
-
type: 'template.html.list',
|
|
42
|
-
description: 'Sorted vanilla HTML templates as {id, file}.',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
type: 'template.html',
|
|
46
|
-
description:
|
|
47
|
-
'One substituted page as {template, file, cdnRef, cdnBase, source}.',
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
throws: [
|
|
51
|
-
{
|
|
52
|
-
code: 'ERR_FILE_NOT_FOUND',
|
|
53
|
-
when: 'neither checkout nor bundled vanilla assets are available',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
code: 'ERR_INVALID_ARGUMENT',
|
|
57
|
-
when: 'the template id or CDN ref is unsafe',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
code: 'ERR_UNKNOWN_TEMPLATE',
|
|
61
|
-
when: 'no matching HTML template file exists',
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
examples: [
|
|
65
|
-
{label: 'Render dashboard', code: "templateHtml('dashboard', {cwd})"},
|
|
66
|
-
{
|
|
67
|
-
label: 'Use another commit',
|
|
68
|
-
code: "templateHtml('dashboard', {cwd, cdnRef: sha})",
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
related: ['template', 'componentHtml'],
|
|
72
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file Vanilla standalone HTML projection for the template command.
|
|
5
|
-
* @position api/template/html — routed by template.mjs for framework=html or the --html alias
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import {AstryxError} from '../../error.mjs';
|
|
9
|
-
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
10
|
-
import {
|
|
11
|
-
listVanillaTemplateHtml,
|
|
12
|
-
readVanillaTemplateHtml,
|
|
13
|
-
} from '../_adapter.mjs';
|
|
14
|
-
|
|
15
|
-
export const ASTRYX_VANILLA_CDN_REF =
|
|
16
|
-
'3eb9597f53f557d20b34b3072d450d2bbdbfa1ac';
|
|
17
|
-
export const ASTRYX_VANILLA_CDN_PLACEHOLDER = '__ASTRYX_VANILLA_CDN__';
|
|
18
|
-
|
|
19
|
-
/** @param {string} ref @returns {string} */
|
|
20
|
-
export function astryxVanillaCdnBase(ref) {
|
|
21
|
-
if (
|
|
22
|
-
!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(ref) ||
|
|
23
|
-
ref.includes('..') ||
|
|
24
|
-
ref.includes('//')
|
|
25
|
-
) {
|
|
26
|
-
throw new AstryxError(
|
|
27
|
-
`Invalid vanilla CDN ref "${ref}"`,
|
|
28
|
-
undefined,
|
|
29
|
-
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
return `https://cdn.jsdelivr.net/gh/facebook/astryx@${ref}/packages/vanilla/dist`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @param {string|undefined} name
|
|
37
|
-
* @param {{cwd?: string, list?: boolean, cdnRef?: string}} [options]
|
|
38
|
-
* @returns {import('./html.type.mjs').TemplateHtmlResponse | import('./html.type.mjs').TemplateHtmlListResponse}
|
|
39
|
-
*/
|
|
40
|
-
export function templateHtml(name, options = {}) {
|
|
41
|
-
const {
|
|
42
|
-
cwd = process.cwd(),
|
|
43
|
-
list = false,
|
|
44
|
-
cdnRef = ASTRYX_VANILLA_CDN_REF,
|
|
45
|
-
} = options;
|
|
46
|
-
if (list) {
|
|
47
|
-
return {type: 'template.html.list', data: listVanillaTemplateHtml(cwd)};
|
|
48
|
-
}
|
|
49
|
-
const raw = readVanillaTemplateHtml(/** @type {string} */ (name), cwd);
|
|
50
|
-
const cdnBase = astryxVanillaCdnBase(cdnRef);
|
|
51
|
-
return {
|
|
52
|
-
type: 'template.html',
|
|
53
|
-
data: {
|
|
54
|
-
template: raw.template,
|
|
55
|
-
file: raw.file,
|
|
56
|
-
cdnRef,
|
|
57
|
-
cdnBase,
|
|
58
|
-
source: raw.source.replaceAll(ASTRYX_VANILLA_CDN_PLACEHOLDER, cdnBase),
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
import {describe, expect, it} from 'vitest';
|
|
4
|
-
import * as fs from 'node:fs';
|
|
5
|
-
import * as os from 'node:os';
|
|
6
|
-
import * as path from 'node:path';
|
|
7
|
-
import {
|
|
8
|
-
ASTRYX_VANILLA_CDN_PLACEHOLDER,
|
|
9
|
-
ASTRYX_VANILLA_CDN_REF,
|
|
10
|
-
templateHtml,
|
|
11
|
-
} from './html.mjs';
|
|
12
|
-
|
|
13
|
-
const FIXTURE = path.resolve(
|
|
14
|
-
import.meta.dirname,
|
|
15
|
-
'../../../test/fixtures/vanilla-project',
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
describe('templateHtml()', () => {
|
|
19
|
-
it('lists sorted vanilla HTML templates', () => {
|
|
20
|
-
expect(templateHtml(undefined, {cwd: FIXTURE, list: true})).toEqual({
|
|
21
|
-
type: 'template.html.list',
|
|
22
|
-
data: [{id: 'dashboard', file: 'dashboard.html'}],
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('falls back to the bundled templates outside a checkout', () => {
|
|
27
|
-
const outsideCheckout = fs.mkdtempSync(
|
|
28
|
-
path.join(os.tmpdir(), 'astryx-cli-installed-'),
|
|
29
|
-
);
|
|
30
|
-
try {
|
|
31
|
-
const result = templateHtml('dashboard', {cwd: outsideCheckout});
|
|
32
|
-
expect(result.type).toBe('template.html');
|
|
33
|
-
expect(result.data.source).toContain('<!doctype html>');
|
|
34
|
-
} finally {
|
|
35
|
-
fs.rmSync(outsideCheckout, {recursive: true, force: true});
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('substitutes every placeholder with the pinned default CDN base', () => {
|
|
40
|
-
const result = templateHtml('dashboard', {cwd: FIXTURE});
|
|
41
|
-
expect(result.type).toBe('template.html');
|
|
42
|
-
expect(result.data.cdnRef).toBe(ASTRYX_VANILLA_CDN_REF);
|
|
43
|
-
expect(result.data.source).not.toContain(ASTRYX_VANILLA_CDN_PLACEHOLDER);
|
|
44
|
-
expect(
|
|
45
|
-
result.data.source.match(new RegExp(result.data.cdnBase, 'g')),
|
|
46
|
-
).toHaveLength(2);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('supports an explicit CDN ref', () => {
|
|
50
|
-
const result = templateHtml('dashboard', {cwd: FIXTURE, cdnRef: 'abc1234'});
|
|
51
|
-
expect(result.data.cdnBase).toContain('@abc1234/packages/vanilla/dist');
|
|
52
|
-
expect(result.data.source).toContain(result.data.cdnBase);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('rejects unsafe CDN refs', () => {
|
|
56
|
-
expect(() =>
|
|
57
|
-
templateHtml('dashboard', {cwd: FIXTURE, cdnRef: '../main'}),
|
|
58
|
-
).toThrow(/Invalid vanilla CDN ref/);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('reports a missing page as an unknown template', () => {
|
|
62
|
-
const error = (() => {
|
|
63
|
-
try {
|
|
64
|
-
templateHtml('missing', {cwd: FIXTURE});
|
|
65
|
-
} catch (caught) {
|
|
66
|
-
return caught;
|
|
67
|
-
}
|
|
68
|
-
})();
|
|
69
|
-
expect(error.code).toBe('ERR_UNKNOWN_TEMPLATE');
|
|
70
|
-
});
|
|
71
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
-
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
-
|
|
4
|
-
export type TemplateHtmlListEntry = {
|
|
5
|
-
id: string;
|
|
6
|
-
file: string;
|
|
7
|
-
};
|
|
8
|
-
export type TemplateHtmlListResponse = {
|
|
9
|
-
type: "template.html.list";
|
|
10
|
-
data: TemplateHtmlListEntry[];
|
|
11
|
-
};
|
|
12
|
-
export type TemplateHtmlResponse = {
|
|
13
|
-
type: "template.html";
|
|
14
|
-
data: {
|
|
15
|
-
template: string;
|
|
16
|
-
file: string;
|
|
17
|
-
cdnRef: string;
|
|
18
|
-
cdnBase: string;
|
|
19
|
-
source: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export type TemplateHtmlOptions = {
|
|
23
|
-
cwd?: string | undefined;
|
|
24
|
-
list?: boolean | undefined;
|
|
25
|
-
cdnRef?: string | undefined;
|
|
26
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {object} TemplateHtmlListEntry
|
|
5
|
-
* @property {string} id
|
|
6
|
-
* @property {string} file
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {object} TemplateHtmlListResponse
|
|
11
|
-
* @property {'template.html.list'} type
|
|
12
|
-
* @property {TemplateHtmlListEntry[]} data
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @typedef {object} TemplateHtmlResponse
|
|
17
|
-
* @property {'template.html'} type
|
|
18
|
-
* @property {{template: string, file: string, cdnRef: string, cdnBase: string, source: string}} data
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @typedef {object} TemplateHtmlOptions
|
|
23
|
-
* @property {string} [cwd]
|
|
24
|
-
* @property {boolean} [list]
|
|
25
|
-
* @property {string} [cdnRef]
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
export {};
|