@aliens-syndicate/cli 0.1.5 → 0.1.7
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/README.es-ES.md +2 -2
- package/README.md +2 -2
- package/README.pt-BR.md +2 -2
- package/README.zh-CN.md +2 -2
- package/package.json +2 -2
- package/tools/build.mjs +11 -10
- package/tools/cli-shared.mjs +1 -1
- package/tools/cli.mjs +1 -1
- package/tools/create.mjs +7 -7
- package/tools/starter/ai/rules/architecture.rule +1 -1
- package/tools/style-docs.mjs +7 -7
package/README.es-ES.md
CHANGED
|
@@ -23,7 +23,7 @@ aliens run
|
|
|
23
23
|
|
|
24
24
|
| Comando | Qué hace |
|
|
25
25
|
| --- | --- |
|
|
26
|
-
| `aliens new <nombre>` (`n`) | Crea un proyecto y pregunta qué extensiones instalar. `--yes`, `--no-
|
|
26
|
+
| `aliens new <nombre>` (`n`) | Crea un proyecto y pregunta qué extensiones instalar. `--yes`, `--no-utilities`, `--no-icons`, `--no-elements` y `--skip-install` saltan las preguntas. |
|
|
27
27
|
| `aliens run` | Hace el build, sirve en http://localhost:5151 y rehace el build y recarga el navegador con cada archivo guardado. `--port <número>` o `serve: port:` en `.config` cambia el puerto. `aliens watch` es un atajo. |
|
|
28
28
|
| `aliens build` | Ejecuta el `tools/build.mjs` del proyecto y genera `dist/` y `ai/.map`. |
|
|
29
29
|
| `aliens generate <tipo> <nombre>` (`g`) | Crea archivos Space. `aliens g element molecules/card` escribe `.markup`, `.logic`, `.style` y `.test`; sin el nivel, la CLI pregunta. Los archivos existentes se conservan y solo se crean los que faltan. Tipos: element (`e`), page (`p`), service (`s`), directive (`d`), interface (`i`), model (`m`), validator (`v`), route (`r`), api, animation, enum, error, guard, interceptor, mock, pipe, storage, agent, rule, skill. `--dry-run` no escribe nada. |
|
|
@@ -127,7 +127,7 @@ Style Counter
|
|
|
127
127
|
bg-(--primary) text-(--primary-ink)
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
Dentro de un selector, una línea escrita como `propiedad: valor` es una declaración CSS. Por defecto, `.style` acepta solo CSS normal. Las utilidades son opcionales y viven en su propio paquete: instala `@aliens-syndicate/
|
|
130
|
+
Dentro de un selector, una línea escrita como `propiedad: valor` es una declaración CSS. Por defecto, `.style` acepta solo CSS normal. Las utilidades son opcionales y viven en su propio paquete: instala `@aliens-syndicate/utilities` y decláralo en `.config` bajo `utilities:` con `from: @aliens-syndicate/utilities`. Sin él, una línea de utilidades detiene el build y explica cómo añadir el paquete. Con él, cualquier otra línea enumera utilidades con los nombres popularizados por frameworks de CSS existentes: `flex`, `gap-4`, `rounded-lg`, `text-sm`. Variantes como `md:`, `max-lg:`, `hover:` y `dark:` escriben la regla `@media` o el selector, y utilidades como `backdrop-blur-md` y `bg-clip-text` añaden las declaraciones `-webkit-`. Los corchetes aceptan cualquier valor, como en `w-[1240px]`, y los paréntesis leen una propiedad personalizada, como en `text-(--muted)`. Cada `--color-<nombre>` de los estilos globales se convierte en un color, como en `bg-brand`. Una utilidad desconocida detiene el build con el archivo y la línea. La página **Styles** del sitio de documentación (`#style-docs`) enumera cada clase con su CSS; `node tools/style-docs.mjs` la vuelve a generar a partir del catálogo del paquete.
|
|
131
131
|
|
|
132
132
|
Los iconos son opcionales y viven en su propio paquete. Instala `@aliens-syndicate/icons` y declaralo en `.config` en `icons:` con `from: @aliens-syndicate/icons` y un `style:` predeterminado. Los iconos pertenecen al markup, sin span y sin clase: `icon add-01 size-4 blue-500 red-500` nombra el icono y después, en cualquier orden, uno de los diez estilos, un tamaño, hasta dos colores (el segundo pinta el tono claro de bulk, duotone y twotone) y un estado como `disabled` o `hidden`; `id`, `variant` y `label` son sus únicos atributos. El build dibuja cada icono inline, y un proyecto sin el paquete se genera igual. La página **Icons** (`#icon-docs`) lista los 6070 iconos por categoría y copia la etiqueta de cualquiera; `node tools/icon-docs.mjs` la regenera a partir del paquete.
|
|
133
133
|
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ aliens run
|
|
|
23
23
|
|
|
24
24
|
| Command | What it does |
|
|
25
25
|
| --- | --- |
|
|
26
|
-
| `aliens new <name>` (`n`) | Creates a project and asks which extensions to install. `--yes`, `--no-
|
|
26
|
+
| `aliens new <name>` (`n`) | Creates a project and asks which extensions to install. `--yes`, `--no-utilities`, `--no-icons`, `--no-elements` and `--skip-install` skip the questions. |
|
|
27
27
|
| `aliens run` | Builds, serves on http://localhost:5151 and rebuilds and reloads the browser on every save. `--port <number>` or `serve: port:` in `.config` changes the port. `aliens watch` is an alias. |
|
|
28
28
|
| `aliens build` | Runs the `tools/build.mjs` of the project and generates `dist/` and `ai/.map`. |
|
|
29
29
|
| `aliens generate <kind> <name>` (`g`) | Creates Space files. `aliens g element molecules/card` writes `.markup`, `.logic`, `.style` and `.test`; without the level the CLI asks. Existing files are kept and only the missing ones are added. Kinds: element (`e`), page (`p`), service (`s`), directive (`d`), interface (`i`), model (`m`), validator (`v`), route (`r`), api, animation, enum, error, guard, interceptor, mock, pipe, storage, agent, rule, skill. `--dry-run` writes nothing. |
|
|
@@ -127,7 +127,7 @@ Style Counter
|
|
|
127
127
|
bg-(--primary) text-(--primary-ink)
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
Inside a selector, a line written as `property: value` is a CSS declaration. By default `.style` reads plain CSS only. Utilities are optional and live in their own package: install `@aliens-syndicate/
|
|
130
|
+
Inside a selector, a line written as `property: value` is a CSS declaration. By default `.style` reads plain CSS only. Utilities are optional and live in their own package: install `@aliens-syndicate/utilities` and declare it in `.config` under `utilities:` with `from: @aliens-syndicate/utilities`. Without it, a utility line stops the build and says how to add the package. With it, any other line lists utilities with the names popularized by existing CSS frameworks: `flex`, `gap-4`, `rounded-lg`, `text-sm`. Variants such as `md:`, `max-lg:`, `hover:` and `dark:` write the `@media` rule or the selector, and utilities such as `backdrop-blur-md` and `bg-clip-text` add the `-webkit-` declarations. Brackets take any value, as in `w-[1240px]`, and parentheses read a custom property, as in `text-(--muted)`. Each `--color-<name>` in the global styles becomes a color, as in `bg-brand`. An unknown utility stops the build with the file and the line. The **Styles** page of the documentation site (`#style-docs`) lists every class with its CSS; `node tools/style-docs.mjs` regenerates it from the package's catalog.
|
|
131
131
|
|
|
132
132
|
Icons are optional and live in their own package. Install `@aliens-syndicate/icons` and declare it in `.config` under `icons:` with `from: @aliens-syndicate/icons` and a default `style:`. Icons belong to the markup, with no span and no class: `icon add-01 size-4 blue-500 red-500` names the icon and then, in any order, one of the ten styles, a size, up to two colors (the second paints the light tone of bulk, duotone and twotone) and a state such as `disabled` or `hidden`; `id`, `variant` and `label` are its only attributes. The build draws each icon inline, and a project without the package builds the same way. The **Icons** page (`#icon-docs`) lists all 6,070 icons by category and copies the tag of any of them; `node tools/icon-docs.mjs` regenerates it from the package.
|
|
133
133
|
|
package/README.pt-BR.md
CHANGED
|
@@ -23,7 +23,7 @@ aliens run
|
|
|
23
23
|
|
|
24
24
|
| Comando | O que faz |
|
|
25
25
|
| --- | --- |
|
|
26
|
-
| `aliens new <nome>` (`n`) | Cria um projeto e pergunta quais extensões instalar. `--yes`, `--no-
|
|
26
|
+
| `aliens new <nome>` (`n`) | Cria um projeto e pergunta quais extensões instalar. `--yes`, `--no-utilities`, `--no-icons`, `--no-elements` e `--skip-install` pulam as perguntas. |
|
|
27
27
|
| `aliens run` | Faz o build, serve em http://localhost:5151 e refaz o build e recarrega o navegador a cada arquivo salvo. `--port <número>` ou `serve: port:` no `.config` troca a porta. `aliens watch` é um atalho. |
|
|
28
28
|
| `aliens build` | Executa o `tools/build.mjs` do projeto e gera `dist/` e `ai/.map`. |
|
|
29
29
|
| `aliens generate <tipo> <nome>` (`g`) | Cria arquivos Space. `aliens g element molecules/card` escreve `.markup`, `.logic`, `.style` e `.test`; sem o nível, a CLI pergunta. Arquivos que já existem são mantidos e só os que faltam são criados. Tipos: element (`e`), page (`p`), service (`s`), directive (`d`), interface (`i`), model (`m`), validator (`v`), route (`r`), api, animation, enum, error, guard, interceptor, mock, pipe, storage, agent, rule, skill. `--dry-run` não grava nada. |
|
|
@@ -127,7 +127,7 @@ Style Counter
|
|
|
127
127
|
bg-(--primary) text-(--primary-ink)
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
Dentro de um seletor, uma linha escrita como `propriedade: valor` é uma declaração CSS. Por padrão, `.style` aceita apenas CSS normal. Os utilitários são opcionais e ficam num pacote próprio: instale `@aliens-syndicate/
|
|
130
|
+
Dentro de um seletor, uma linha escrita como `propriedade: valor` é uma declaração CSS. Por padrão, `.style` aceita apenas CSS normal. Os utilitários são opcionais e ficam num pacote próprio: instale `@aliens-syndicate/utilities` e declare-o no `.config` em `utilities:` com `from: @aliens-syndicate/utilities`. Sem ele, uma linha de utilitários interrompe o build e diz como adicionar o pacote. Com ele, qualquer outra linha lista utilitários com os nomes popularizados por frameworks de CSS existentes: `flex`, `gap-4`, `rounded-lg`, `text-sm`. Variantes como `md:`, `max-lg:`, `hover:` e `dark:` escrevem a regra `@media` ou o seletor, e utilitários como `backdrop-blur-md` e `bg-clip-text` acrescentam as declarações `-webkit-`. Colchetes aceitam qualquer valor, como em `w-[1240px]`, e parênteses leem uma propriedade customizada, como em `text-(--muted)`. Cada `--color-<nome>` dos estilos globais vira uma cor, como em `bg-brand`. Um utilitário desconhecido interrompe o build com o arquivo e a linha. A página **Styles** do site de documentação (`#style-docs`) lista cada classe com o seu CSS; `node tools/style-docs.mjs` a gera de novo a partir do catálogo do pacote.
|
|
131
131
|
|
|
132
132
|
Os ícones são opcionais e ficam em um pacote próprio. Instale `@aliens-syndicate/icons` e declare no `.config` em `icons:` com `from: @aliens-syndicate/icons` e um `style:` padrão. Os ícones pertencem ao markup, sem span e sem classe: `icon add-01 size-4 blue-500 red-500` dá o nome do ícone e depois, em qualquer ordem, um dos dez estilos, um tamanho, até duas cores (a segunda pinta o tom claro do bulk, duotone e twotone) e um estado como `disabled` ou `hidden`; `id`, `variant` e `label` são seus únicos atributos. O build desenha cada ícone inline, e um projeto sem o pacote é gerado do mesmo jeito. A página **Icons** (`#icon-docs`) lista os 6.070 ícones por categoria e copia a tag de qualquer um; `node tools/icon-docs.mjs` a regenera a partir do pacote.
|
|
133
133
|
|
package/README.zh-CN.md
CHANGED
|
@@ -23,7 +23,7 @@ aliens run
|
|
|
23
23
|
|
|
24
24
|
| 命令 | 作用 |
|
|
25
25
|
| --- | --- |
|
|
26
|
-
| `aliens new <名称>`(`n`) | 创建项目,并询问要安装哪些扩展。`--yes`、`--no-
|
|
26
|
+
| `aliens new <名称>`(`n`) | 创建项目,并询问要安装哪些扩展。`--yes`、`--no-utilities`、`--no-icons`、`--no-elements` 和 `--skip-install` 可跳过提问。 |
|
|
27
27
|
| `aliens run` | 构建并在 http://localhost:5151 上提供服务,每次保存都会重新构建并刷新浏览器。`--port <端口>` 或 `.config` 中的 `serve: port:` 可更改端口。`aliens watch` 是别名。 |
|
|
28
28
|
| `aliens build` | 运行项目的 `tools/build.mjs`,生成 `dist/` 和 `ai/.map`。 |
|
|
29
29
|
| `aliens generate <类型> <名称>`(`g`) | 创建 Space 文件。`aliens g element molecules/card` 会写入 `.markup`、`.logic`、`.style` 和 `.test`;不写层级时 CLI 会询问。已存在的文件会保留,只补上缺少的。类型:element(`e`)、page(`p`)、service(`s`)、directive(`d`)、interface(`i`)、model(`m`)、validator(`v`)、route(`r`)、api、animation、enum、error、guard、interceptor、mock、pipe、storage、agent、rule、skill。`--dry-run` 不写入任何文件。 |
|
|
@@ -127,7 +127,7 @@ Style Counter
|
|
|
127
127
|
bg-(--primary) text-(--primary-ink)
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
在选择器内部,写成 `属性: 值` 的行是 CSS 声明。默认情况下 `.style` 只接受普通 CSS。工具类是可选的,位于独立的包中:安装 `@aliens-syndicate/
|
|
130
|
+
在选择器内部,写成 `属性: 值` 的行是 CSS 声明。默认情况下 `.style` 只接受普通 CSS。工具类是可选的,位于独立的包中:安装 `@aliens-syndicate/utilities`,并在 `.config` 的 `utilities:` 下声明 `from: @aliens-syndicate/utilities`。没有该包时,工具类行会让构建停止并提示如何添加它。有了该包,其他行列出现有 CSS 框架普及的工具类名称:`flex`、`gap-4`、`rounded-lg`、`text-sm`。`md:`、`max-lg:`、`hover:` 和 `dark:` 等变体会写出 `@media` 规则或选择器,`backdrop-blur-md` 和 `bg-clip-text` 等工具类会补上 `-webkit-` 声明。方括号接受任意值,例如 `w-[1240px]`;圆括号读取自定义属性,例如 `text-(--muted)`。全局样式中的每个 `--color-<名称>` 都会成为颜色,例如 `bg-brand`。未知的工具类会让构建停止,并给出文件和行号。文档站点的 **Styles** 页面(`#style-docs`)列出了每个类及其 CSS;`node tools/style-docs.mjs` 会根据该包的目录重新生成该页面。
|
|
131
131
|
|
|
132
132
|
图标是可选的,位于独立的包中。安装 `@aliens-syndicate/icons`,在 `.config` 的 `icons:` 下写 `from: @aliens-syndicate/icons` 和默认的 `style:`。图标属于 markup,不需要 span,也不需要 class:`icon add-01 size-4 blue-500 red-500` 先写图标名称,再按任意顺序写十种样式之一、尺寸、最多两种颜色(第二种用于 bulk、duotone 和 twotone 的浅色部分),以及 `disabled` 或 `hidden` 等状态;`id`、`variant` 和 `label` 是它仅有的属性。构建会把每个图标内联绘制,没有该包的项目照常构建。**Icons**页面(`#icon-docs`)按分类列出全部 6,070 个图标,并可复制任意图标的标签;`node tools/icon-docs.mjs` 会根据该包重新生成它。
|
|
133
133
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliens-syndicate/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "CLI for Aliens, the AI-era front-end framework written in Space.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Aliens Syndicate",
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@aliens-syndicate/elements": "file:../aliens-syndicate-elements",
|
|
35
35
|
"@aliens-syndicate/icons": "^0.1.0",
|
|
36
|
-
"@aliens-syndicate/
|
|
36
|
+
"@aliens-syndicate/utilities": "^0.1.0"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/tools/build.mjs
CHANGED
|
@@ -115,11 +115,12 @@ const settings = name => Object.fromEntries(config.find(node => node.value === n
|
|
|
115
115
|
const { entry, assets: assetDirectory, shared: configuredShared, styles, agent: map, environment } = settings('files');
|
|
116
116
|
const { default: defaultLocale, detection, directory: languageDirectory } = settings('language');
|
|
117
117
|
const { from: iconPackage, style: configuredIconStyle } = settings('icons');
|
|
118
|
-
|
|
118
|
+
if (config.some(node => node.value === 'style:')) throw new Error('.config: style: is now utilities:. Write utilities:\n from: @aliens-syndicate/utilities');
|
|
119
|
+
const { from: stylePackage } = settings('utilities');
|
|
119
120
|
const { from: elementPackage } = settings('elements');
|
|
120
121
|
// Extensions are separate packages that the project installs and declares in .config under <section>: from:, or a
|
|
121
122
|
// local folder written as ./path. Icons (usually @aliens-syndicate/icons) let markup draw the icon tag inline (see
|
|
122
|
-
// renderIcon);
|
|
123
|
+
// renderIcon); utilities (usually @aliens-syndicate/utilities) lets .style list utilities besides plain CSS declarations;
|
|
123
124
|
// elements (usually @aliens-syndicate/elements) adds ready-made Elements that any markup can render.
|
|
124
125
|
async function loadExtension(section, name) {
|
|
125
126
|
let entry;
|
|
@@ -131,14 +132,14 @@ async function loadExtension(section, name) {
|
|
|
131
132
|
return import(pathToFileURL(entry).href);
|
|
132
133
|
}
|
|
133
134
|
const iconModule = iconPackage ? await loadExtension('icons', iconPackage) : null;
|
|
134
|
-
const styleModule = stylePackage ? await loadExtension('
|
|
135
|
-
if (styleModule && typeof styleModule.resolveUtility !== 'function') throw new Error(`.config:
|
|
135
|
+
const styleModule = stylePackage ? await loadExtension('utilities', stylePackage) : null;
|
|
136
|
+
if (styleModule && typeof styleModule.resolveUtility !== 'function') throw new Error(`.config: utilities: from: ${stylePackage} is not an Aliens utilities package.`);
|
|
136
137
|
const elementModule = elementPackage ? await loadExtension('elements', elementPackage) : null;
|
|
137
138
|
if (elementModule && typeof elementModule.elementsDirectory !== 'string') throw new Error(`.config: elements: from: ${elementPackage} is not an Aliens elements package.`);
|
|
138
|
-
const noStyle = (where, what) => new Error(`${where}: ${what} need the
|
|
139
|
-
'npm install @aliens-syndicate/
|
|
140
|
-
// Without the
|
|
141
|
-
const resolveUtility = (token, options) => styleModule ? styleModule.resolveUtility(token, options) : { error: 'no
|
|
139
|
+
const noStyle = (where, what) => new Error(`${where}: ${what} need the utilities package. Write CSS as "property: value", or run ` +
|
|
140
|
+
'npm install @aliens-syndicate/utilities and declare it in .config:\nutilities:\n from: @aliens-syndicate/utilities');
|
|
141
|
+
// Without the utilities package, .style reads plain CSS declarations only.
|
|
142
|
+
const resolveUtility = (token, options) => styleModule ? styleModule.resolveUtility(token, options) : { error: 'no utilities package' };
|
|
142
143
|
const iconRenderer = iconModule?.createIconRenderer();
|
|
143
144
|
const iconCatalog = iconModule ? await iconModule.readCatalog() : null;
|
|
144
145
|
const iconStyle = iconRenderer ? configuredIconStyle ?? 'stroke-rounded' : null;
|
|
@@ -627,8 +628,8 @@ function render(file, rootProps = {}, ancestry = [], parentScope = null) {
|
|
|
627
628
|
return renderNode(nodes[0], true);
|
|
628
629
|
}
|
|
629
630
|
|
|
630
|
-
// Inside a selector, "property: value" is a CSS declaration. With the
|
|
631
|
-
// from: @aliens-syndicate/
|
|
631
|
+
// Inside a selector, "property: value" is a CSS declaration. With the utilities package declared in .config (utilities:
|
|
632
|
+
// from: @aliens-syndicate/utilities), any other line lists utilities with the Tailwind CSS names: "flex items-center gap-4 max-md:flex-col hover:bg-surface". State variants such as
|
|
632
633
|
// hover: and dark: rewrite the selector; responsive variants such as md: and max-lg: become @media rules, written
|
|
633
634
|
// after the rest of the file from the widest max-* to the narrowest and then from the narrowest min-width up.
|
|
634
635
|
const declarationLine = /^-{0,2}[A-Za-z][\w-]*:\s+\S/;
|
package/tools/cli-shared.mjs
CHANGED
|
@@ -24,7 +24,7 @@ export const projectToolDirectories = ['vscode-space'];
|
|
|
24
24
|
|
|
25
25
|
// The optional extensions a project can declare in .config under <section>: from:.
|
|
26
26
|
export const extensions = [
|
|
27
|
-
{ section: '
|
|
27
|
+
{ section: 'utilities', name: '@aliens-syndicate/utilities' },
|
|
28
28
|
{ section: 'icons', name: '@aliens-syndicate/icons', extra: ' style: stroke-rounded\n' },
|
|
29
29
|
{ section: 'elements', name: '@aliens-syndicate/elements' }
|
|
30
30
|
];
|
package/tools/cli.mjs
CHANGED
|
@@ -11,7 +11,7 @@ const commands = [
|
|
|
11
11
|
about: { en: 'Creates an Aliens project, asking which extensions to install.', pt: 'Cria um projeto Aliens e pergunta quais extensões instalar.',
|
|
12
12
|
es: 'Crea un proyecto Aliens y pregunta qué extensiones instalar.', zh: '创建 Aliens 项目,并询问要安装哪些扩展。' },
|
|
13
13
|
options: [['-y, --yes', { en: 'Accepts every default without asking', pt: 'Aceita todos os padrões sem perguntar', es: 'Acepta todos los valores por defecto sin preguntar', zh: '不询问,全部使用默认值' }],
|
|
14
|
-
['--no-
|
|
14
|
+
['--no-utilities, --no-icons, --no-elements', { en: 'Leaves that extension out', pt: 'Deixa essa extensão de fora', es: 'Deja fuera esa extensión', zh: '不包含该扩展' }],
|
|
15
15
|
['--skip-install', { en: 'Creates the files without running npm install', pt: 'Cria os arquivos sem rodar o npm install', es: 'Crea los archivos sin ejecutar npm install', zh: '只创建文件,不运行 npm install' }]] },
|
|
16
16
|
{ name: 'run', aliases: ['watch'], usage: 'aliens run [--port <number>]', load: async () => (await import('./serve.mjs')).serve,
|
|
17
17
|
about: { en: `Builds, serves on http://localhost:${defaultPort} and rebuilds and reloads the browser on every save.`,
|
package/tools/create.mjs
CHANGED
|
@@ -11,25 +11,25 @@ import {
|
|
|
11
11
|
const text = {
|
|
12
12
|
en: { usage: 'Usage: aliens new <project-name>', name: 'What is your project named?', fallbackName: 'my-aliens-app',
|
|
13
13
|
badName: 'Use lowercase words separated by hyphens for the project name, like my-app.', exists: 'The folder {path} already exists.',
|
|
14
|
-
|
|
14
|
+
utilities: 'Use utility classes in .style ({package})?', icons: 'Use the icon library ({package})?', elements: 'Use ready-made Elements ({package})?',
|
|
15
15
|
creating: 'Creating the Aliens project in {path}', created: 'Aliens project created in {path}', installing: 'Installing the packages with npm…',
|
|
16
16
|
unpublished: '{package} is not on npm yet, so the project starts without it.', installFailed: 'npm install failed. Enter the folder and run npm install.',
|
|
17
17
|
skipped: 'Packages not installed (--skip-install). Enter the folder and run npm install.', next: 'Next steps:' },
|
|
18
18
|
pt: { usage: 'Uso: aliens new <nome-do-projeto>', name: 'Qual é o nome do projeto?', fallbackName: 'meu-app-aliens',
|
|
19
19
|
badName: 'Use palavras minúsculas separadas por hífen no nome do projeto, como meu-app.', exists: 'A pasta {path} já existe.',
|
|
20
|
-
|
|
20
|
+
utilities: 'Usar classes utilitárias no .style ({package})?', icons: 'Usar a biblioteca de ícones ({package})?', elements: 'Usar Elements prontos ({package})?',
|
|
21
21
|
creating: 'Criando o projeto Aliens em {path}', created: 'Projeto Aliens criado em {path}', installing: 'Instalando os pacotes com o npm…',
|
|
22
22
|
unpublished: '{package} ainda não está no npm, então o projeto começa sem ele.', installFailed: 'O npm install falhou. Entre na pasta e rode npm install.',
|
|
23
23
|
skipped: 'Pacotes não instalados (--skip-install). Entre na pasta e rode npm install.', next: 'Próximos passos:' },
|
|
24
24
|
es: { usage: 'Uso: aliens new <nombre-del-proyecto>', name: '¿Cómo se llama tu proyecto?', fallbackName: 'mi-app-aliens',
|
|
25
25
|
badName: 'Usa palabras en minúsculas separadas por guiones en el nombre del proyecto, como mi-app.', exists: 'La carpeta {path} ya existe.',
|
|
26
|
-
|
|
26
|
+
utilities: '¿Usar clases utilitarias en .style ({package})?', icons: '¿Usar la biblioteca de íconos ({package})?', elements: '¿Usar Elements listos ({package})?',
|
|
27
27
|
creating: 'Creando el proyecto Aliens en {path}', created: 'Proyecto Aliens creado en {path}', installing: 'Instalando los paquetes con npm…',
|
|
28
28
|
unpublished: '{package} todavía no está en npm, así que el proyecto empieza sin él.', installFailed: 'npm install falló. Entra en la carpeta y ejecuta npm install.',
|
|
29
29
|
skipped: 'Paquetes no instalados (--skip-install). Entra en la carpeta y ejecuta npm install.', next: 'Próximos pasos:' },
|
|
30
30
|
zh: { usage: '用法:aliens new <项目名称>', name: '项目叫什么名字?', fallbackName: 'my-aliens-app',
|
|
31
31
|
badName: '项目名称请使用以连字符分隔的小写单词,例如 my-app。', exists: '文件夹 {path} 已存在。',
|
|
32
|
-
|
|
32
|
+
utilities: '在 .style 中使用工具类({package})?', icons: '使用图标库({package})?', elements: '使用现成的 Elements({package})?',
|
|
33
33
|
creating: '正在 {path} 中创建 Aliens 项目', created: 'Aliens 项目已创建于 {path}', installing: '正在用 npm 安装依赖包…',
|
|
34
34
|
unpublished: '{package} 尚未发布到 npm,项目将先不包含它。', installFailed: 'npm install 失败。请进入文件夹运行 npm install。',
|
|
35
35
|
skipped: '未安装依赖包(--skip-install)。请进入文件夹运行 npm install。', next: '下一步:' }
|
|
@@ -78,11 +78,11 @@ The configuration lives in \`.config\` and the build generates the \`ai/.map\` i
|
|
|
78
78
|
The Home includes the style library, with tokens in \`project/styles/settings/\`, components in \`project/styles/components/\` and themes in \`project/styles/settings/theme.style\`.
|
|
79
79
|
Add a \`:root[data-theme="name"]\` block to that file and run the build to make the theme available in the picker.
|
|
80
80
|
|
|
81
|
-
\`.style\` reads plain CSS (\`property: value\`). To write utility classes like \`flex gap-4 md:flex-row\`, run \`npm install @aliens-syndicate/
|
|
81
|
+
\`.style\` reads plain CSS (\`property: value\`). To write utility classes like \`flex gap-4 md:flex-row\`, run \`npm install @aliens-syndicate/utilities\` and add to \`.config\`:
|
|
82
82
|
|
|
83
83
|
\`\`\`
|
|
84
|
-
|
|
85
|
-
from: @aliens-syndicate/
|
|
84
|
+
utilities:
|
|
85
|
+
from: @aliens-syndicate/utilities
|
|
86
86
|
\`\`\`
|
|
87
87
|
|
|
88
88
|
To use buttons, badges, alerts, cards and fields written in Space, run \`npm install @aliens-syndicate/elements\` and add to \`.config\`:
|
|
@@ -8,5 +8,5 @@ Rule Architecture
|
|
|
8
8
|
# Compose atoms into molecules, organisms, and templates. A reusable Element does not depend on a page.
|
|
9
9
|
# Keep the .markup, .logic, .style, and .test files of an Element together in its folder.
|
|
10
10
|
# Use .style for element stylesheets and the global layers declared in project/styles/main.style.
|
|
11
|
-
# In .style, write plain CSS as property: value. Utility class names, like flex gap-4 md:flex-row, need npm install @aliens-syndicate/
|
|
11
|
+
# In .style, write plain CSS as property: value. Utility class names, like flex gap-4 md:flex-row, need npm install @aliens-syndicate/utilities and utilities: from: @aliens-syndicate/utilities in .config.
|
|
12
12
|
# Ready-made Elements, like ui-button and ui-card, need npm install @aliens-syndicate/elements and elements: from: @aliens-syndicate/elements in .config; ai/.map then lists them.
|
package/tools/style-docs.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Generates the Style page (project/app/pages/style-docs) from the utility catalog of the
|
|
2
|
-
// declares under
|
|
1
|
+
// Generates the Style page (project/app/pages/style-docs) from the utility catalog of the utilities package that .config
|
|
2
|
+
// declares under utilities: from: (usually @aliens-syndicate/utilities), so every class the page lists is a class the build
|
|
3
3
|
// accepts. Run it after updating the package: node tools/style-docs.mjs
|
|
4
4
|
import { readFile, readdir, writeFile, mkdir } from 'node:fs/promises';
|
|
5
5
|
import { createRequire } from 'node:module';
|
|
@@ -8,8 +8,8 @@ import { pathToFileURL } from 'node:url';
|
|
|
8
8
|
|
|
9
9
|
const workspace = resolve(import.meta.dirname, '..');
|
|
10
10
|
const config = await readFile(join(workspace, '.config'), 'utf8');
|
|
11
|
-
const from = /^
|
|
12
|
-
if (!from) throw new Error('style-docs: declare the
|
|
11
|
+
const from = /^utilities:\r?\n(?: {3}.*\r?\n)*? {3}from: (.+)$/m.exec(config)?.[1].trim();
|
|
12
|
+
if (!from) throw new Error('style-docs: declare the utilities package in .config under utilities: from:.');
|
|
13
13
|
const entry = /^\.{1,2}\//.test(from) ? join(workspace, from, 'index.mjs') : createRequire(join(workspace, 'package.json')).resolve(from);
|
|
14
14
|
const {
|
|
15
15
|
breakpoints, describeVariant, groups, paletteNames, registeredDefaults, resolveUtility, shadeSteps, variantCatalog
|
|
@@ -159,8 +159,8 @@ add(4, 'h2={@styleDocs.installTitle}');
|
|
|
159
159
|
add(4, 'p={@styleDocs.installDetail} variant="style-docs-lead"');
|
|
160
160
|
add(4, 'ol variant="style-docs-steps"');
|
|
161
161
|
for (const [key, title, code] of [
|
|
162
|
-
['installStep', 'terminal', ['npm install @aliens-syndicate/
|
|
163
|
-
['configStep', '.config', ['
|
|
162
|
+
['installStep', 'terminal', ['npm install @aliens-syndicate/utilities']],
|
|
163
|
+
['configStep', '.config', ['utilities:', ' from: @aliens-syndicate/utilities']],
|
|
164
164
|
['useStep', 'counter.style', ['Style Counter', ' counter', ' flex items-center gap-3 md:gap-4', ' transition: color .15s',
|
|
165
165
|
' counter-button', ' px-4 py-2 rounded-lg hover:bg-(--surface)']]]) {
|
|
166
166
|
add(5, 'li');
|
|
@@ -266,7 +266,7 @@ add(4, `ui-link href="#kit-overview" variant="ui-link_secondary" label={@styleDo
|
|
|
266
266
|
await mkdir(page, { recursive: true });
|
|
267
267
|
await writeFile(join(page, 'style-docs.markup'), lines.join('\n') + '\n');
|
|
268
268
|
await writeFile(join(page, 'style-docs.logic'), `Logic StyleDocs
|
|
269
|
-
# Generated by tools/style-docs.mjs from the utility catalog of @aliens-syndicate/
|
|
269
|
+
# Generated by tools/style-docs.mjs from the utility catalog of @aliens-syndicate/utilities. Update the package, not this file.
|
|
270
270
|
${lists.join('\n')}
|
|
271
271
|
`);
|
|
272
272
|
const total = sections.reduce((sum, group) => sum + group.sections.reduce((count, section) => count + section.rows.length, 0), 0);
|