@astryxdesign/cli 0.4.2 → 0.4.3-canary.ac850d9
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 +23 -0
- package/README.md +44 -43
- package/api/template/cdn/cdn.d.mts +23 -0
- package/api/template/cdn/cdn.mjs +86 -0
- package/api/template/cdn/cdn.test.mjs +108 -0
- package/api/template/template.d.mts +2 -0
- package/api/template/template.doc.mjs +21 -3
- package/api/template/template.mjs +16 -2
- package/api/template/template.type.d.mts +19 -0
- package/api/template/template.type.mjs +12 -0
- package/api/theme/build/build.font-warning.test.mjs +23 -14
- package/api/theme/build/build.icons-specifier.test.mjs +149 -0
- package/api/theme/build/build.mjs +88 -16
- package/api/theme/build/build.test.mjs +185 -14
- package/api/theme/theme.type.d.mts +6 -0
- package/api/theme/theme.type.mjs +4 -1
- package/assets/cdn.template.html +124 -0
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +11 -5
- package/assets/docs/theme.doc.zh.mjs +1 -1
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorDeadlinePicker.doc.mjs +20 -0
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorDeadlinePicker.tsx +87 -0
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorShowcase.doc.mjs +15 -0
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorShowcase.tsx +199 -0
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorTreeSearch.doc.mjs +14 -0
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorTreeSearch.tsx +188 -0
- package/assets/templates/themes/neutral/neutralTheme.ts +6 -4
- package/assets/theme.template.ts +4 -3
- package/clients/cli/commands/build-theme.font-warning.test.mjs +9 -6
- package/clients/cli/commands/build-theme.icons-specifier.test.mjs +132 -7
- package/clients/cli/commands/template-cdn.behavior.test.mjs +113 -0
- package/clients/cli/commands/template.doc.mjs +12 -2
- package/clients/cli/commands/template.mjs +24 -3
- package/clients/cli/lib/manifest.mjs +2 -1
- package/foundation/fs/path-safety.mjs +2 -2
- package/foundation/fs/path-safety.test.mjs +7 -0
- package/foundation/response/response-types.doc.mjs +6 -0
- package/foundation/text/copyright-header.mjs +11 -4
- package/package.json +9 -9
|
@@ -91,6 +91,13 @@ describe('sanitizeName', () => {
|
|
|
91
91
|
expect(() => sanitizeName('.')).toThrow(PathSafetyError);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
+
it('rejects dotfile names (.env, .htaccess) that could create hidden files', () => {
|
|
95
|
+
expect(() => sanitizeName('.env')).toThrow(PathSafetyError);
|
|
96
|
+
expect(() => sanitizeName('.htaccess')).toThrow(PathSafetyError);
|
|
97
|
+
expect(() => sanitizeName('.bashrc')).toThrow(PathSafetyError);
|
|
98
|
+
expect(() => sanitizeName('.gitignore')).toThrow(PathSafetyError);
|
|
99
|
+
});
|
|
100
|
+
|
|
94
101
|
it('rejects NUL bytes', () => {
|
|
95
102
|
expect(() => sanitizeName('foo\0bar')).toThrow(PathSafetyError);
|
|
96
103
|
});
|
|
@@ -150,6 +150,12 @@ export const doc = {
|
|
|
150
150
|
'A scaffold receipt: template id, output directory, written file name, and file count.',
|
|
151
151
|
},
|
|
152
152
|
|
|
153
|
+
{
|
|
154
|
+
value: 'template.cdn',
|
|
155
|
+
description:
|
|
156
|
+
'A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not — `exists` when a file was already there, which is a success.',
|
|
157
|
+
},
|
|
158
|
+
|
|
153
159
|
// hook
|
|
154
160
|
{
|
|
155
161
|
value: 'hook.list',
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Every file in this repo carries the Meta copyright header, and several
|
|
8
8
|
* commands copy repo files out verbatim — `theme add` (bundled theme sources),
|
|
9
|
-
* `init --features theme` (the annotated theme template)
|
|
10
|
-
* source tree should not inherit our
|
|
11
|
-
* reject it.
|
|
9
|
+
* `init --features theme` (the annotated theme template), `template --cdn` (the
|
|
10
|
+
* CDN starter page). A consumer's own source tree should not inherit our
|
|
11
|
+
* boilerplate, and their lint may well reject it.
|
|
12
12
|
*
|
|
13
13
|
* SYNC: the same regex is applied by apps/docsite/src/lib/codeExamples.ts for
|
|
14
14
|
* rendered code samples. That copy lives in a different package (the docsite
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
const META_COPYRIGHT_HEADER_RE =
|
|
24
24
|
/^(\uFEFF?(?:#![^\r\n]*(?:\r?\n))?)\/\/ Copyright \(c\) Meta Platforms, Inc\. and affiliates\.\r?\n(?:\r?\n)*/;
|
|
25
25
|
|
|
26
|
+
/** The same header in HTML comment syntax, as scripts/add-copyright.sh writes
|
|
27
|
+
* it into the .html assets we scaffold. */
|
|
28
|
+
const META_COPYRIGHT_HEADER_HTML_RE =
|
|
29
|
+
/^(\uFEFF?)<!-- Copyright \(c\) Meta Platforms, Inc\. and affiliates\. -->\r?\n(?:\r?\n)*/;
|
|
30
|
+
|
|
26
31
|
/**
|
|
27
32
|
* Remove the leading Meta copyright header, preserving any BOM/shebang before
|
|
28
33
|
* it. Returns the source unchanged when the header is absent.
|
|
@@ -31,5 +36,7 @@ const META_COPYRIGHT_HEADER_RE =
|
|
|
31
36
|
* @returns {string}
|
|
32
37
|
*/
|
|
33
38
|
export function stripCopyrightHeader(source) {
|
|
34
|
-
return source
|
|
39
|
+
return source
|
|
40
|
+
.replace(META_COPYRIGHT_HEADER_RE, '$1')
|
|
41
|
+
.replace(META_COPYRIGHT_HEADER_HTML_RE, '$1');
|
|
35
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3-canary.ac850d9",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"zod": "^4.4.3"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@astryxdesign/charts": "
|
|
88
|
-
"@astryxdesign/core": "
|
|
89
|
-
"@astryxdesign/lab": "
|
|
90
|
-
"@astryxdesign/theme-neutral": "
|
|
87
|
+
"@astryxdesign/charts": "0.4.3-canary.ac850d9",
|
|
88
|
+
"@astryxdesign/core": "0.4.3-canary.ac850d9",
|
|
89
|
+
"@astryxdesign/lab": "0.4.3-canary.ac850d9",
|
|
90
|
+
"@astryxdesign/theme-neutral": "0.4.3-canary.ac850d9",
|
|
91
91
|
"gpt-tokenizer": "^3.4.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependenciesMeta": {
|
|
@@ -105,10 +105,10 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@astryxdesign/charts": "
|
|
109
|
-
"@astryxdesign/core": "
|
|
110
|
-
"@astryxdesign/lab": "
|
|
111
|
-
"@astryxdesign/theme-neutral": "
|
|
108
|
+
"@astryxdesign/charts": "0.4.3-canary.ac850d9",
|
|
109
|
+
"@astryxdesign/core": "0.4.3-canary.ac850d9",
|
|
110
|
+
"@astryxdesign/lab": "0.4.3-canary.ac850d9",
|
|
111
|
+
"@astryxdesign/theme-neutral": "0.4.3-canary.ac850d9",
|
|
112
112
|
"gpt-tokenizer": "^3.4.0"
|
|
113
113
|
},
|
|
114
114
|
"scripts": {
|