@aliens-syndicate/cli 0.1.9 → 0.1.11
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 +9 -11
- package/README.md +9 -11
- package/README.pt-BR.md +9 -11
- package/README.zh-CN.md +10 -12
- package/package.json +3 -2
- package/tools/build.mjs +15 -7
- package/tools/cli-shared.mjs +11 -2
- package/tools/cli.mjs +1 -0
- package/tools/create.mjs +14 -4
- package/tools/doctor.mjs +10 -5
- package/tools/playground/client.mjs +500 -0
- package/tools/playground/examples/computed/app.markup +3 -0
- package/tools/playground/examples/computed/cart.logic +22 -0
- package/tools/playground/examples/computed/cart.markup +10 -0
- package/tools/playground/examples/computed/cart.style +13 -0
- package/tools/playground/examples/counter/app.markup +3 -0
- package/tools/playground/examples/counter/counter.logic +19 -0
- package/tools/playground/examples/counter/counter.markup +7 -0
- package/tools/playground/examples/counter/counter.style +11 -0
- package/tools/playground/examples/effect-cleanup/app.markup +3 -0
- package/tools/playground/examples/effect-cleanup/stopwatch.logic +28 -0
- package/tools/playground/examples/effect-cleanup/stopwatch.markup +6 -0
- package/tools/playground/examples/effect-cleanup/stopwatch.style +11 -0
- package/tools/playground/examples/element-properties/app.markup +5 -0
- package/tools/playground/examples/element-properties/app.style +3 -0
- package/tools/playground/examples/element-properties/greeting.markup +4 -0
- package/tools/playground/examples/element-properties/greeting.style +7 -0
- package/tools/playground/examples/fix-the-error/app.markup +3 -0
- package/tools/playground/examples/fix-the-error/light.logic +10 -0
- package/tools/playground/examples/fix-the-error/light.markup +6 -0
- package/tools/playground/examples/fix-the-error/light.style +7 -0
- package/tools/playground/examples/hello-world/app.markup +4 -0
- package/tools/playground/examples/hello-world/app.style +7 -0
- package/tools/playground/examples/icons/app.markup +7 -0
- package/tools/playground/examples/icons/app.style +5 -0
- package/tools/playground/examples/list-for/app.markup +3 -0
- package/tools/playground/examples/list-for/planets.logic +15 -0
- package/tools/playground/examples/list-for/planets.markup +6 -0
- package/tools/playground/examples/list-for/planets.style +7 -0
- package/tools/playground/examples/ready-elements/app.markup +3 -0
- package/tools/playground/examples/ready-elements/app.style +3 -0
- package/tools/playground/examples/ready-elements/mission.logic +9 -0
- package/tools/playground/examples/ready-elements/mission.markup +7 -0
- package/tools/playground/examples/ready-elements/mission.style +5 -0
- package/tools/playground/examples/streams/app.markup +3 -0
- package/tools/playground/examples/streams/planet-search.logic +24 -0
- package/tools/playground/examples/streams/planet-search.markup +9 -0
- package/tools/playground/examples/streams/planet-search.style +9 -0
- package/tools/playground/examples/styles-modifiers/app.markup +5 -0
- package/tools/playground/examples/styles-modifiers/app.style +10 -0
- package/tools/playground/examples/watch/app.markup +3 -0
- package/tools/playground/examples/watch/volume.logic +20 -0
- package/tools/playground/examples/watch/volume.markup +9 -0
- package/tools/playground/examples/watch/volume.style +11 -0
- package/tools/playground.mjs +222 -0
- package/tools/project-layout.mjs +1 -1
- package/tools/runtime.mjs +16 -6
- package/tools/serve.mjs +15 -2
- package/tools/starter/app/pages/home/home.markup +19 -0
- package/tools/starter/app/pages/home/home.style +51 -0
- package/tools/starter/language/.en-US +10 -73
- package/tools/starter/language/.es-ES +10 -73
- package/tools/starter/language/.pt-BR +10 -73
- package/tools/starter/language/.zh-CN +10 -73
- package/tools/starter/styles/generic/ui-base.style +4 -5
- package/tools/test.mjs +20 -0
- package/tools/update.mjs +3 -3
- package/tools/utilities-docs.mjs +0 -5
- package/tools/watch.mjs +3 -2
- package/tools/starter/app/elements/atoms/kit-nav-link/kit-nav-link.markup +0 -2
- package/tools/starter/app/elements/molecules/kit-button-demo/kit-button-demo.logic +0 -14
- package/tools/starter/app/elements/molecules/kit-button-demo/kit-button-demo.markup +0 -8
- package/tools/starter/app/elements/molecules/kit-card-link/kit-card-link.markup +0 -4
- package/tools/starter/app/elements/organisms/kit-navigation/kit-navigation.markup +0 -19
- package/tools/starter/app/pages/kit-border/kit-border.markup +0 -38
- package/tools/starter/app/pages/kit-color/kit-color.markup +0 -58
- package/tools/starter/app/pages/kit-components/kit-components.markup +0 -95
- package/tools/starter/app/pages/kit-overview/kit-overview.markup +0 -25
- package/tools/starter/app/pages/kit-radius/kit-radius.markup +0 -34
- package/tools/starter/app/pages/kit-space/kit-space.markup +0 -61
- package/tools/starter/app/pages/kit-type/kit-type.markup +0 -48
- package/tools/starter/app/pages/style-guide/style-guide.markup +0 -10
- package/tools/starter/app/pages/style-guide/style-guide.style +0 -252
package/README.es-ES.md
CHANGED
|
@@ -39,7 +39,7 @@ El comentario al inicio de `.config` lista los mismos comandos, y la página **I
|
|
|
39
39
|
```text
|
|
40
40
|
dependencies:
|
|
41
41
|
framework:
|
|
42
|
-
@aliens-syndicate/framework: 0.
|
|
42
|
+
@aliens-syndicate/framework: 0.1.11
|
|
43
43
|
icons:
|
|
44
44
|
@aliens-syndicate/icons/stroke-rounded: 0.1.0
|
|
45
45
|
elements:
|
|
@@ -62,14 +62,14 @@ Cada ejemplo tiene una descripción seguida de una línea que contiene solo `#`.
|
|
|
62
62
|
|
|
63
63
|
En `project/app/routes/`, los ejemplos comentados muestran rutas fijas e hijas, parámetros, filtros, redirecciones, guards, estado y fallback. La ejecución de rutas y de archivos `.test` forma parte del trabajo pendiente en el runtime.
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## Tokens y temas
|
|
66
66
|
|
|
67
|
-
Cada proyecto nuevo
|
|
67
|
+
Cada proyecto nuevo empieza con una Home de bienvenida en `project/app/pages/home/`, en portugués, inglés, español y chino, y con los tokens de diseño y los temas de abajo.
|
|
68
68
|
|
|
69
69
|
- `project/styles/settings/` reúne los tokens de color, espaciado, radio, borde, tipografía y elevación.
|
|
70
70
|
- `project/styles/components/` ofrece tipografía H1–H6, párrafo, texto auxiliar, leyenda, enlace, lista, cita y código; botones, campos, tarjetas, etiquetas, avisos, bordes, espaciado, tabla, progreso y panel desplegable.
|
|
71
|
-
- `project/styles/settings/theme.style` centraliza los valores semánticos de los temas `light` y `dark
|
|
72
|
-
- `project/app/pages/
|
|
71
|
+
- `project/styles/settings/theme.style` centraliza los valores semánticos de los temas `light` y `dark`. Los componentes usan esos valores mediante variables CSS.
|
|
72
|
+
- `project/app/pages/home/` es la primera página. Los Elements reutilizables viven en los niveles de Atomic Design.
|
|
73
73
|
|
|
74
74
|
Para crear otro tema, añade un bloque al final de `theme.style`, con un nombre en minúsculas, números y guiones, que empiece por una letra. Los valores que no redefinas heredan la base clara de `:root`. Para un tema oscuro completo, copia el bloque `dark`, cámbiale el nombre y personaliza sus tokens.
|
|
75
75
|
|
|
@@ -84,7 +84,7 @@ Para crear otro tema, añade un bloque al final de `theme.style`, con un nombre
|
|
|
84
84
|
--color-on-accent: #0c4a6e
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
Ejecuta el build después de editar. El motor reconoce los bloques del archivo y
|
|
87
|
+
Ejecuta el build después de editar. El motor reconoce los bloques del archivo y lista el nuevo tema junto a `light` y `dark`, para que `data-theme` en la página pueda usarlo. La base del generador está en `tools/starter/`; las personalizaciones de un proyecto no se copian a los siguientes.
|
|
88
88
|
|
|
89
89
|
## Atomic Design
|
|
90
90
|
|
|
@@ -285,8 +285,8 @@ Para probar por HTTP, ejecuta `python3 -m http.server 4173 --bind 127.0.0.1 --di
|
|
|
285
285
|
|
|
286
286
|
## Qué incluye
|
|
287
287
|
|
|
288
|
-
- Home en formato de landing page, con menú en el encabezado (
|
|
289
|
-
- Playground
|
|
288
|
+
- Home en formato de landing page, con los números de lo que existe hoy (tipos de archivo, Elements, iconos, utilidades, operadores de stream, idiomas), menú en el encabezado (Agent, Elements, Utilities, Reactive, Icons, Space, Playground, Buscar), una caja para copiar el comando de instalación y secciones sobre IA, Elements sin archivos obligatorios, lo mejor de cada framework y el lenguaje Space. La página Space lista los 25 tipos con búsqueda. La búsqueda se abre con ⌘K o Ctrl+K. Las páginas Para agentes de IA (`#ai-guide`) y Roadmap (`#roadmap`) están en el pie, y cada bloque de código tiene botón de copiar. `.logic` tiene introducción, tutorial y enlaces al Playground.
|
|
289
|
+
- Playground (`#playground`) que compila Space en el navegador con el propio build: doce ejemplos en cinco categorías con filtro, el resultado mientras escribes, errores de build con archivo y línea y la consola de la página. `#playground-<ejemplo>` abre un ejemplo, como `#playground-counter`.
|
|
290
290
|
- Traducciones en inglés, portugués de Brasil, español y chino simplificado. La primera visita usa la preferencia del navegador, con inglés como idioma predeterminado cuando ninguna preferencia coincide. La elección manual se guarda cuando el navegador ofrece almacenamiento.
|
|
291
291
|
|
|
292
292
|
## Lo que reveló el prototipo
|
|
@@ -295,14 +295,12 @@ Para probar por HTTP, ejecuta `python3 -m http.server 4173 --bind 127.0.0.1 --di
|
|
|
295
295
|
- El markup llama a las acciones con `action` y el `.logic` vincula los signals a las etiquetas por `id`, en el bloque `bind:`. Estas convenciones, la sintaxis de propiedades de Elements y el formato de las traducciones necesitan validación antes de formar parte de la gramática definitiva.
|
|
296
296
|
- El compilador de vista previa cubre los signals primitivos, `computed`, `effect`, `watch` y las acciones sin parámetros que usa la documentación. Elimina las anotaciones TypeScript, sin comprobación semántica de tipos. El ciclo de vida, las dependencias reales entre módulos, los servicios y la ejecución de archivos `.test` quedan pendientes. La navegación de la página usa fragmentos de URL. El archivo `app.route` registra la ruta inicial y aún necesita un enrutador para ejecutarla.
|
|
297
297
|
- El índice sigue el catálogo de 25 tipos. `.style` y `.mock` son las extensiones definidas para hojas de estilo y datos simulados, respectivamente.
|
|
298
|
-
-
|
|
298
|
+
- El Playground ejecuta una copia de `tools/build.mjs` en el navegador, sobre un sistema de archivos en memoria. Allí nada elimina TypeScript, así que `compileLogic` genera JavaScript puro y un body tipado es un error de sintaxis.
|
|
299
299
|
|
|
300
300
|
## Validación
|
|
301
301
|
|
|
302
302
|
El build pasó y el JavaScript generado se verificó con `node --check`. En el navegador se comprobaron la Home, el menú en pantallas pequeñas, los enlaces del tema, las pestañas de código, los clics y el teclado en el contador. La Home final se abrió en Chrome en portugués detectado desde el navegador. En el runtime compilado se verificaron siete escenarios de preferencia de idioma, los cuatro selectores manuales y la igualdad entre el código mostrado y los tres archivos de origen.
|
|
303
303
|
|
|
304
|
-
La biblioteca de estilos se validó en un proyecto nuevo y en otro creado por el generador de ese proyecto. Se comprobaron los enlaces, los IDs únicos, la indentación Space, los cuatro idiomas, H1–H6 a 390 px y la sincronización de los selectores de tema. Se añadió un tema extra solo en el proyecto temporal para verificar su detección por el build y su aplicación en el navegador.
|
|
305
|
-
|
|
306
304
|
## Licencia
|
|
307
305
|
|
|
308
306
|
Aliens Framework se distribuye bajo la [licencia MIT](LICENSE).
|
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ The comment at the top of `.config` lists the same commands, and the **Installat
|
|
|
39
39
|
```text
|
|
40
40
|
dependencies:
|
|
41
41
|
framework:
|
|
42
|
-
@aliens-syndicate/framework: 0.
|
|
42
|
+
@aliens-syndicate/framework: 0.1.11
|
|
43
43
|
icons:
|
|
44
44
|
@aliens-syndicate/icons/stroke-rounded: 0.1.0
|
|
45
45
|
elements:
|
|
@@ -62,14 +62,14 @@ Each example has a description followed by a line that contains only `#`. To try
|
|
|
62
62
|
|
|
63
63
|
In `project/app/routes/`, the commented examples show fixed and child routes, parameters, filters, redirects, guards, state and fallback. Running routes and `.test` files is part of the pending runtime work.
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## Tokens and themes
|
|
66
66
|
|
|
67
|
-
Every new project
|
|
67
|
+
Every new project starts with a welcome Home in `project/app/pages/home/`, in Portuguese, English, Spanish and Chinese, and with the design tokens and themes below.
|
|
68
68
|
|
|
69
69
|
- `project/styles/settings/` holds the color, spacing, radius, border, typography and elevation tokens.
|
|
70
70
|
- `project/styles/components/` provides H1–H6 typography, paragraph, helper text, caption, link, list, quote and code; buttons, fields, cards, badges, alerts, borders, spacing, table, progress and expandable panel.
|
|
71
|
-
- `project/styles/settings/theme.style` centralizes the semantic values of the
|
|
72
|
-
- `project/app/pages/
|
|
71
|
+
- `project/styles/settings/theme.style` centralizes the semantic values of the `light` and `dark` themes. Components use these values through CSS variables.
|
|
72
|
+
- `project/app/pages/home/` is the first page. Reusable Elements live in the Atomic Design levels.
|
|
73
73
|
|
|
74
74
|
To create another theme, add a block at the end of `theme.style`, with a name made of lowercase letters, numbers and hyphens, starting with a letter. Values you don't redefine inherit the light base from `:root`. For a complete dark theme, copy the `dark` block, rename it and customize its tokens.
|
|
75
75
|
|
|
@@ -84,7 +84,7 @@ To create another theme, add a block at the end of `theme.style`, with a name ma
|
|
|
84
84
|
--color-on-accent: #0c4a6e
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
Run the build after editing. The engine recognizes the blocks in the file and
|
|
87
|
+
Run the build after editing. The engine recognizes the blocks in the file and lists the new theme with `light` and `dark`, so `data-theme` on the page can use it. The generator base lives in `tools/starter/`; customizations to one project are not copied to the next ones.
|
|
88
88
|
|
|
89
89
|
## Atomic Design
|
|
90
90
|
|
|
@@ -285,8 +285,8 @@ To test over HTTP, run `python3 -m http.server 4173 --bind 127.0.0.1 --directory
|
|
|
285
285
|
|
|
286
286
|
## What's included
|
|
287
287
|
|
|
288
|
-
- Home as a landing page, with a header menu (
|
|
289
|
-
- Playground
|
|
288
|
+
- Home as a landing page, with the numbers of what ships today (file types, Elements, icons, utilities, stream operators, languages), a header menu (Agent, Elements, Utilities, Reactive, Icons, Space, Playground, Search), a box to copy the install command and sections about AI, Elements without required files, the best of every framework and the Space language. The Space page lists the 25 types with search. Search opens with ⌘K or Ctrl+K. The For AI agents (`#ai-guide`) and Roadmap (`#roadmap`) pages are linked in the footer, and every code block has a copy button. `.logic` has an introduction, a tutorial and links to the Playground.
|
|
289
|
+
- Playground (`#playground`) that compiles Space in the browser with the build itself: twelve examples in five categories with a filter, the result as you type, build errors with file and line, and the page console. `#playground-<example>` opens an example, like `#playground-counter`.
|
|
290
290
|
- Translations in English, Brazilian Portuguese, Spanish and Simplified Chinese. The first visit uses the browser preference, with English as the default when no preference matches. A manual choice is saved when the browser provides storage.
|
|
291
291
|
|
|
292
292
|
## What the prototype revealed
|
|
@@ -295,14 +295,12 @@ To test over HTTP, run `python3 -m http.server 4173 --bind 127.0.0.1 --directory
|
|
|
295
295
|
- Markup calls actions with `action` and `.logic` binds signals to tags by `id`, in the `bind:` block. These conventions, the Element property syntax and the translation format need validation before they become part of the final grammar.
|
|
296
296
|
- The preview compiler covers primitive signals, `computed`, `effect`, `watch` and the parameterless actions used by the documentation. It strips TypeScript annotations without semantic type checking. Lifecycle, real dependencies between modules, services and running `.test` files are pending. Page navigation uses URL fragments. The `app.route` file registers the initial route and still needs a router to run it.
|
|
297
297
|
- The index follows the catalog of 25 types. `.style` and `.mock` are the extensions defined for stylesheets and mock data, respectively.
|
|
298
|
-
- The
|
|
298
|
+
- The Playground runs a copy of `tools/build.mjs` in the browser over an in-memory file system. Nothing strips TypeScript there, so `compileLogic` writes plain JavaScript and a typed body is a syntax error.
|
|
299
299
|
|
|
300
300
|
## Validation
|
|
301
301
|
|
|
302
302
|
The build passed and the generated JavaScript was checked with `node --check`. In the browser, the Home, the menu on small screens, the topic links, the code tabs, and clicks and keyboard on the counter were checked. The final Home opened in Chrome in Portuguese detected from the browser. In the compiled runtime, seven language-preference scenarios, the four manual pickers and the match between the displayed code and the three source files were verified.
|
|
303
303
|
|
|
304
|
-
The style library was validated in a new project and in another one created by that project's generator. Links, unique IDs, Space indentation, four languages, H1–H6 at 390 px and theme-picker sync were checked. An extra theme was added only to the temporary project to verify its discovery by the build and its application in the browser.
|
|
305
|
-
|
|
306
304
|
## License
|
|
307
305
|
|
|
308
306
|
Aliens Framework is distributed under the [MIT license](LICENSE).
|
package/README.pt-BR.md
CHANGED
|
@@ -39,7 +39,7 @@ O `.config` lista o framework e cada pacote com a sua versão, agrupados como no
|
|
|
39
39
|
```text
|
|
40
40
|
dependencies:
|
|
41
41
|
framework:
|
|
42
|
-
@aliens-syndicate/framework: 0.
|
|
42
|
+
@aliens-syndicate/framework: 0.1.11
|
|
43
43
|
icons:
|
|
44
44
|
@aliens-syndicate/icons/stroke-rounded: 0.1.0
|
|
45
45
|
elements:
|
|
@@ -62,14 +62,14 @@ Cada exemplo tem uma descrição seguida de uma linha que contém apenas `#`. Pa
|
|
|
62
62
|
|
|
63
63
|
Em `project/app/routes/`, os exemplos comentados mostram rotas fixas e filhas, parâmetros, filtros, redirecionamento, guard, estado e fallback. A execução de rotas e de arquivos `.test` faz parte do trabalho pendente no runtime.
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## Tokens e temas
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
Todo projeto novo começa com uma Home de boas-vindas em `project/app/pages/home/`, em português, inglês, espanhol e chinês, e com os tokens de design e os temas abaixo.
|
|
68
68
|
|
|
69
69
|
- `project/styles/settings/` reúne os tokens de cor, espaço, raio, borda, tipografia e elevação.
|
|
70
70
|
- `project/styles/components/` fornece tipografia H1–H6, parágrafo, texto auxiliar, legenda, link, lista, citação e código; botões, campos, cartões, etiquetas, avisos, bordas, espaçamento, tabela, progresso e painel expansível.
|
|
71
|
-
- `project/styles/settings/theme.style` centraliza os valores semânticos dos temas `light` e `dark
|
|
72
|
-
- `project/app/pages/
|
|
71
|
+
- `project/styles/settings/theme.style` centraliza os valores semânticos dos temas `light` e `dark`. Os componentes usam esses valores por meio de variáveis CSS.
|
|
72
|
+
- `project/app/pages/home/` é a primeira página. Os Elements reutilizáveis ficam nos níveis do Atomic Design.
|
|
73
73
|
|
|
74
74
|
Para criar outro tema, acrescente um bloco ao final de `theme.style`, com um nome em letras minúsculas, números e hífens, começando por letra. Os valores não redefinidos herdam a base clara de `:root`. Para um tema escuro completo, copie o bloco `dark`, troque o nome e personalize seus tokens.
|
|
75
75
|
|
|
@@ -84,7 +84,7 @@ Para criar outro tema, acrescente um bloco ao final de `theme.style`, com um nom
|
|
|
84
84
|
--color-on-accent: #0c4a6e
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
Execute o build após editar. O motor reconhece os blocos do arquivo e
|
|
87
|
+
Execute o build após editar. O motor reconhece os blocos do arquivo e lista o novo tema junto com `light` e `dark`, para que o `data-theme` da página possa usá-lo. A base do gerador fica em `tools/starter/`; as personalizações de um projeto não são copiadas para os próximos.
|
|
88
88
|
|
|
89
89
|
## Atomic Design
|
|
90
90
|
|
|
@@ -285,8 +285,8 @@ Para testar via HTTP, execute `python3 -m http.server 4173 --bind 127.0.0.1 --di
|
|
|
285
285
|
|
|
286
286
|
## O que entrou
|
|
287
287
|
|
|
288
|
-
- Home no formato de landing page, com menu no header (
|
|
289
|
-
- Playground
|
|
288
|
+
- Home no formato de landing page, com os números do que existe hoje (tipos de arquivo, Elements, ícones, utilitários, operadores de stream, idiomas), menu no header (Agent, Elements, Utilities, Reactive, Icons, Space, Playground, Buscar), uma caixa para copiar o comando de instalação e seções sobre IA, Elements sem arquivos obrigatórios, o melhor de cada framework e a linguagem Space. A página Space lista os 25 tipos com busca. A busca abre com ⌘K ou Ctrl+K. As páginas Para agentes de IA (`#ai-guide`) e Roadmap (`#roadmap`) ficam no rodapé, e todo bloco de código tem botão de copiar. O `.logic` tem introdução, tutorial e links para o Playground.
|
|
289
|
+
- Playground (`#playground`) que compila Space no navegador com o próprio build: doze exemplos em cinco categorias com filtro, o resultado enquanto você digita, erros de build com arquivo e linha e o console da página. `#playground-<exemplo>` abre um exemplo, como `#playground-counter`.
|
|
290
290
|
- Traduções em inglês, português do Brasil, espanhol e chinês simplificado. A primeira visita usa a preferência do navegador, com inglês como idioma padrão quando nenhuma preferência é compatível. A escolha manual é guardada quando o navegador disponibiliza armazenamento.
|
|
291
291
|
|
|
292
292
|
## O que o protótipo revelou
|
|
@@ -295,14 +295,12 @@ Para testar via HTTP, execute `python3 -m http.server 4173 --bind 127.0.0.1 --di
|
|
|
295
295
|
- O markup chama as ações com `action` e o `.logic` liga os signals às tags por `id`, no bloco `bind:`. Essas convenções, a sintaxe das propriedades de Elements e o formato das traduções precisam de validação antes de virarem parte da gramática definitiva.
|
|
296
296
|
- O compilador de prévia cobre os sinais primitivos, `computed`, `effect`, `watch` e as ações sem parâmetros usadas pela documentação. Ele remove anotações TypeScript, sem fazer checagem semântica de tipos. Ciclo de vida, dependências reais entre módulos, serviços e execução de arquivos `.test` ficam pendentes. A navegação da página usa fragmentos de URL. O arquivo `app.route` registra a rota inicial e ainda precisa de um roteador para executá-la.
|
|
297
297
|
- O índice segue o catálogo de 25 tipos. `.style` e `.mock` são as extensões definidas para folhas de estilo e dados simulados, respectivamente.
|
|
298
|
-
-
|
|
298
|
+
- O Playground roda uma cópia do `tools/build.mjs` no navegador, sobre um sistema de arquivos em memória. Lá nada remove TypeScript, então o `compileLogic` gera JavaScript puro e um body tipado vira erro de sintaxe.
|
|
299
299
|
|
|
300
300
|
## Validação
|
|
301
301
|
|
|
302
302
|
O build passou e o JavaScript gerado foi verificado com `node --check`. No navegador, foram conferidos a Home, o menu em tela pequena, os links do tópico, as abas de código, os cliques e o teclado no contador. A Home final abriu no Chrome em português detectado pelo navegador. No runtime compilado foram verificados sete cenários de preferência de idioma, os quatro seletores manuais e a igualdade entre o código exibido e os três arquivos de origem.
|
|
303
303
|
|
|
304
|
-
A biblioteca de estilos foi validada em um projeto novo e em outro criado pelo gerador desse projeto. Foram conferidos os links, IDs únicos, indentação Space, quatro idiomas, H1–H6 em 390 px e sincronização dos seletores de tema. Um tema adicional foi incluído somente no projeto temporário para verificar sua descoberta pelo build e aplicação no navegador.
|
|
305
|
-
|
|
306
304
|
## Licença
|
|
307
305
|
|
|
308
306
|
O Aliens Framework é distribuído sob a [licença MIT](LICENSE).
|
package/README.zh-CN.md
CHANGED
|
@@ -39,7 +39,7 @@ aliens run
|
|
|
39
39
|
```text
|
|
40
40
|
dependencies:
|
|
41
41
|
framework:
|
|
42
|
-
@aliens-syndicate/framework: 0.
|
|
42
|
+
@aliens-syndicate/framework: 0.1.11
|
|
43
43
|
icons:
|
|
44
44
|
@aliens-syndicate/icons/stroke-rounded: 0.1.0
|
|
45
45
|
elements:
|
|
@@ -62,14 +62,14 @@ devDependencies:
|
|
|
62
62
|
|
|
63
63
|
在 `project/app/routes/` 中,注释示例展示了固定路由和子路由、参数、过滤器、重定向、guard、状态和回退。路由和 `.test` 文件的执行属于 runtime 的待办工作。
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## 设计令牌与主题
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
每个新项目都从 `project/app/pages/home/` 中的欢迎首页开始,提供葡萄牙语、英语、西班牙语和中文,并带有下面的设计令牌和主题。
|
|
68
68
|
|
|
69
69
|
- `project/styles/settings/` 汇集颜色、间距、圆角、边框、字体和阴影 token。
|
|
70
70
|
- `project/styles/components/` 提供 H1–H6 字体、段落、辅助文本、说明文字、链接、列表、引用和代码;按钮、输入框、卡片、标签、提示、边框、间距、表格、进度条和可展开面板。
|
|
71
|
-
- `project/styles/settings/theme.style`
|
|
72
|
-
- `project/app/pages/
|
|
71
|
+
- `project/styles/settings/theme.style` 集中定义 `light` 和 `dark` 主题的语义值。组件通过 CSS 变量使用这些值。
|
|
72
|
+
- `project/app/pages/home/` 是第一个页面。可复用的 Element 位于原子设计的各个层级中。
|
|
73
73
|
|
|
74
74
|
要创建新主题,请在 `theme.style` 末尾添加一个代码块,名称由小写字母、数字和连字符组成,并以字母开头。未重新定义的值会继承 `:root` 的浅色基础。要创建完整的深色主题,请复制 `dark` 代码块,修改名称并自定义其 token。
|
|
75
75
|
|
|
@@ -84,7 +84,7 @@ devDependencies:
|
|
|
84
84
|
--color-on-accent: #0c4a6e
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
编辑后运行构建。引擎会识别文件中的代码块,并把新主题与 `light`、`dark` 一起列出,页面上的 `data-theme` 即可使用它。生成器的基础文件位于 `tools/starter/`;对某个项目的定制不会复制到之后的项目中。
|
|
88
88
|
|
|
89
89
|
## Atomic Design
|
|
90
90
|
|
|
@@ -136,7 +136,7 @@ Markup Counter
|
|
|
136
136
|
|
|
137
137
|
#### Style
|
|
138
138
|
|
|
139
|
-
书写名称时不要加 `#` 或 `.`。构建会为 `id` 生成 `[id="name"]`,为 `variant` 生成 `.name`,两者在层叠中权重相同。要在同一标签上组合两个名称,请使用 `:is()`,例如 `space-card:is(space-border_strong)`。既不是 `id`、`variant`,也不是 HTML 标签的名称会报错。`project/styles/`
|
|
139
|
+
书写名称时不要加 `#` 或 `.`。构建会为 `id` 生成 `[id="name"]`,为 `variant` 生成 `.name`,两者在层叠中权重相同。要在同一标签上组合两个名称,请使用 `:is()`,例如 `space-card:is(space-border_strong)`。既不是 `id`、`variant`,也不是 HTML 标签的名称会报错。`project/styles/` 中的全局样式声明全局 variant,始终带有 `space-` 前缀,例如 `space-button_primary`。
|
|
140
140
|
|
|
141
141
|
```text
|
|
142
142
|
Style Counter
|
|
@@ -285,8 +285,8 @@ open -a "Google Chrome" dist/index.html
|
|
|
285
285
|
|
|
286
286
|
## 包含的内容
|
|
287
287
|
|
|
288
|
-
-
|
|
289
|
-
-
|
|
288
|
+
- 落地页形式的首页,展示当前已有内容的数量(文件类型、Element、图标、工具类、stream 操作符、语言),顶部菜单(Agent、Elements、Utilities、Reactive、Icons、Space、Playground、搜索),一个复制安装命令的输入框,以及关于 AI、无必需文件的 Element、各框架之长和 Space 语言的板块。Space 页面列出 25 种类型并支持搜索。搜索可用 ⌘K 或 Ctrl+K 打开。面向 AI 智能体(`#ai-guide`)和路线图(`#roadmap`)页面链接在页脚,每个代码块都有复制按钮。`.logic` 包含介绍、教程以及指向 Playground 的链接。
|
|
289
|
+
- Playground(`#playground`)用构建器本身在浏览器中编译 Space:五个分类共十二个可筛选的示例、边输入边更新的结果、带文件和行号的构建错误,以及页面控制台。`#playground-<示例>` 会打开对应示例,例如 `#playground-counter`。
|
|
290
290
|
- 提供英语、巴西葡萄牙语、西班牙语和简体中文翻译。首次访问时使用浏览器偏好;没有匹配的偏好时默认使用英语。在浏览器提供存储时,会保存手动选择的语言。
|
|
291
291
|
|
|
292
292
|
## 原型的发现
|
|
@@ -295,14 +295,12 @@ open -a "Google Chrome" dist/index.html
|
|
|
295
295
|
- markup 通过 `action` 调用 action,`.logic` 在 `bind:` 块中通过 `id` 将 signal 绑定到标签。这些约定、Element 属性语法和翻译格式在成为最终语法的一部分之前还需要验证。
|
|
296
296
|
- 预览编译器覆盖文档中使用的基本 signal、`computed`、`effect`、`watch` 和无参数 action。它会去掉 TypeScript 注解,但不做语义类型检查。生命周期、模块之间的真实依赖、服务以及 `.test` 文件的执行仍待完成。页面导航使用 URL 片段。`app.route` 文件登记了初始路由,但仍需要路由器来执行它。
|
|
297
297
|
- 索引遵循 25 种类型的目录。`.style` 和 `.mock` 分别是为样式表和模拟数据定义的扩展名。
|
|
298
|
-
-
|
|
298
|
+
- Playground 在浏览器中基于内存文件系统运行 `tools/build.mjs` 的副本。那里不会去除 TypeScript,因此 `compileLogic` 生成纯 JavaScript,带类型的 body 会成为语法错误。
|
|
299
299
|
|
|
300
300
|
## 验证
|
|
301
301
|
|
|
302
302
|
构建已通过,生成的 JavaScript 已通过 `node --check` 检查。在浏览器中检查了首页、小屏幕上的菜单、主题链接、代码标签页,以及计数器上的点击和键盘操作。最终的首页在 Chrome 中以浏览器检测到的葡萄牙语打开。在编译后的 runtime 中验证了七种语言偏好场景、四个手动选择器,以及显示的代码与三个源文件是否一致。
|
|
303
303
|
|
|
304
|
-
样式库在一个新项目以及由该项目的生成器创建的另一个项目中完成了验证。检查了链接、唯一 ID、Space 缩进、四种语言、390 px 下的 H1–H6,以及主题选择器的同步。仅在临时项目中添加了一个额外主题,用于验证构建能否识别它并在浏览器中应用。
|
|
305
|
-
|
|
306
304
|
## 许可证
|
|
307
305
|
|
|
308
306
|
Aliens Framework 采用 [MIT 许可证](LICENSE)发布。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliens-syndicate/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "CLI for Aliens, the AI-era front-end framework written in Space.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Aliens Syndicate",
|
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@aliens-syndicate/icons": "0.1.0",
|
|
35
34
|
"@aliens-syndicate/elements": "0.1.0",
|
|
35
|
+
"@aliens-syndicate/icons": "0.1.0",
|
|
36
36
|
"@aliens-syndicate/reactive": "0.1.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
+
"@aliens-syndicate/test": "0.1.1",
|
|
39
40
|
"@aliens-syndicate/utilities": "0.1.0"
|
|
40
41
|
}
|
|
41
42
|
}
|
package/tools/build.mjs
CHANGED
|
@@ -116,14 +116,14 @@ const settings = name => Object.fromEntries(config.find(node => node.value === n
|
|
|
116
116
|
const { entry, assets: assetDirectory, shared: configuredShared, styles, agent: map, environment } = settings('files');
|
|
117
117
|
const { default: defaultLocale, detection, directory: languageDirectory } = settings('language');
|
|
118
118
|
// The framework and the extensions are listed as in package.json: dependencies: for what the app uses (framework,
|
|
119
|
-
// icons, elements, reactive) and devDependencies: for what only the build
|
|
119
|
+
// icons, elements, reactive) and devDependencies: for what only the build and the tools use (utilities, test). Each section holds one
|
|
120
120
|
// line, "<package>[/<variant>]: <version>", read by parseDependency in project-layout.mjs. The icon style is the
|
|
121
121
|
// variant of the icons package, as in @aliens-syndicate/icons/stroke-rounded: 0.1.0.
|
|
122
122
|
const extensionNames = dependencySections.filter(name => name !== 'framework');
|
|
123
123
|
const legacyExtension = config.find(node => [...extensionNames, 'style'].includes(node.value.replace(/:$/, '')));
|
|
124
124
|
if (legacyExtension) {
|
|
125
125
|
const name = legacyExtension.value === 'style:' ? 'utilities' : legacyExtension.value.slice(0, -1);
|
|
126
|
-
const group =
|
|
126
|
+
const group = ['utilities', 'test'].includes(name) ? 'devDependencies' : 'dependencies';
|
|
127
127
|
throw new Error(`${legacyExtension.location}: extensions now live under dependencies: or devDependencies:, each with its version. Write ${group}:\n ${name}:\n @aliens-syndicate/${name}${name === 'icons' ? '/stroke-rounded' : ''}: <version>\n(aliens update rewrites .config for you.)`);
|
|
128
128
|
}
|
|
129
129
|
const extensionSettings = {};
|
|
@@ -192,6 +192,11 @@ const styleModule = stylePackage ? await loadExtension('utilities', stylePackage
|
|
|
192
192
|
if (styleModule && typeof styleModule.resolveUtility !== 'function') throw new Error(`${extensionSettings.utilities.location}: ${stylePackage} is not an Aliens utilities package.`);
|
|
193
193
|
const elementModule = elementPackage ? await loadExtension('elements', elementPackage) : null;
|
|
194
194
|
if (elementModule && typeof elementModule.elementsDirectory !== 'string') throw new Error(`${extensionSettings.elements.location}: ${elementPackage} is not an Aliens elements package.`);
|
|
195
|
+
// test (@aliens-syndicate/test) does not change the build and does not run here: tools/test.mjs runs it on every save
|
|
196
|
+
// of aliens run. Loading it only checks the installed version against .config.
|
|
197
|
+
const testPackage = extensionSettings.test?.name;
|
|
198
|
+
const testModule = testPackage ? await loadExtension('test', testPackage) : null;
|
|
199
|
+
if (testModule && typeof testModule.analyze !== 'function') throw new Error(`${extensionSettings.test.location}: ${testPackage} is not an Aliens test package.`);
|
|
195
200
|
const reactiveModule = reactivePackage ? await loadExtension('reactive', reactivePackage) : null;
|
|
196
201
|
if (reactiveModule && typeof reactiveModule.createReactive !== 'function') throw new Error(`${extensionSettings.reactive.location}: ${reactivePackage} is not an Aliens reactive package.`);
|
|
197
202
|
const noStyle = (where, what) => new Error(`${where}: ${what} need the utilities package. Write CSS as "property: value", or run ` +
|
|
@@ -799,7 +804,7 @@ function compileLogic(file) {
|
|
|
799
804
|
const field = /^signal ([A-Za-z]\w*): (string|number|boolean) = (.+)$/.exec(member.value);
|
|
800
805
|
if (field && !member.children.length) {
|
|
801
806
|
signals.set(field[1], field[2]);
|
|
802
|
-
members.push(`${field[1]}
|
|
807
|
+
members.push(`${field[1]} = ${field[3]};`);
|
|
803
808
|
continue;
|
|
804
809
|
}
|
|
805
810
|
const derived = /^computed ([A-Za-z]\w*): (string|number|boolean) = (.+)$/.exec(member.value);
|
|
@@ -875,7 +880,7 @@ function compileLogic(file) {
|
|
|
875
880
|
const { code, location } = block(body);
|
|
876
881
|
bodies.push({ code, location });
|
|
877
882
|
actionNames.push(actionName);
|
|
878
|
-
members.push(`${actionName}()
|
|
883
|
+
members.push(`${actionName}() {\n${code}\n}`);
|
|
879
884
|
}
|
|
880
885
|
}
|
|
881
886
|
const memberNames = [...signals.keys(), ...computed.keys(), ...streams.keys(), ...actionNames];
|
|
@@ -908,20 +913,21 @@ function compileLogic(file) {
|
|
|
908
913
|
}
|
|
909
914
|
}
|
|
910
915
|
}
|
|
911
|
-
const typeOf = field => signals.get(field) ?? (computed.get(field) ?? streams.get(field)).type;
|
|
912
916
|
// A stream expression reads the creators of the package, like from and fromEvent, as plain names.
|
|
913
917
|
const streamTools = '{ Stream, from, of, interval, timer, fromEvent, combineLatest, merge, concat, zip }';
|
|
914
918
|
const fn = (parameters, code) => `function (${parameters}) {\n${code}\n}`;
|
|
915
919
|
const optional = cleanup => cleanup ? fn('', cleanup.code) : 'null';
|
|
916
920
|
// create returns the class instance plus the functions the runtime turns into computed values, effects and watches.
|
|
921
|
+
// The generated code carries no types of its own, so only TypeScript written in a body needs stripping; the
|
|
922
|
+
// Playground compiles in the browser, where nothing strips, and there a typed body is a syntax error.
|
|
917
923
|
const create = stripTypeScriptTypes(`(function (element) {
|
|
918
924
|
class ${name} {\n${members.join('\n')}\n}
|
|
919
925
|
return {
|
|
920
926
|
state: new ${name}(),
|
|
921
|
-
computed: [${[...computed].map(([field, {
|
|
927
|
+
computed: [${[...computed].map(([field, { expression }]) => `[${JSON.stringify(field)}, function () { return (${expression}); }]`).join(', ')}],
|
|
922
928
|
streams: [${[...streams].map(([field, { expression }]) => `[${JSON.stringify(field)}, function (${streamTools}) {\nreturn (${expression});\n}]`).join(', ')}],
|
|
923
929
|
effects: [${[...effects].map(([label, { body, cleanup }]) => `[${JSON.stringify(label)}, ${fn('', body.code)}, ${optional(cleanup)}]`).join(', ')}],
|
|
924
|
-
watches: [${[...watches].map(([target, { body, cleanup }]) => `[${JSON.stringify(target)}, ${fn(
|
|
930
|
+
watches: [${[...watches].map(([target, { body, cleanup }]) => `[${JSON.stringify(target)}, ${fn('previous', body.code)}, ${optional(cleanup)}]`).join(', ')}]
|
|
925
931
|
};
|
|
926
932
|
})`).trim();
|
|
927
933
|
const compiledBinds = binds.map(({ id, kind, expression }) =>
|
|
@@ -1124,4 +1130,6 @@ ${[...directives].map(([file, found]) => `${indentation}${file}:\n${found.map(([
|
|
|
1124
1130
|
validation:
|
|
1125
1131
|
web_preview: passed
|
|
1126
1132
|
`);
|
|
1133
|
+
// A page with a Playground gets the browser copy of this build in dist/playground/ (see playground.mjs).
|
|
1134
|
+
if (html.includes(' data-playground')) await (await import('./playground.mjs')).emitPlayground({ workspace, output }); // playground:node-only
|
|
1127
1135
|
console.log(`Aliens Web preview generated in ${output}`);
|
package/tools/cli-shared.mjs
CHANGED
|
@@ -21,16 +21,17 @@ export const minimumNode = '22.13.0';
|
|
|
21
21
|
export const defaultPort = 5151;
|
|
22
22
|
|
|
23
23
|
// Every project carries a copy of these tools, so it builds with the tools of the CLI version that created it.
|
|
24
|
-
export const projectToolFiles = ['build.mjs', 'watch.mjs', 'runtime.mjs', 'project-layout.mjs'];
|
|
24
|
+
export const projectToolFiles = ['build.mjs', 'watch.mjs', 'test.mjs', 'runtime.mjs', 'project-layout.mjs'];
|
|
25
25
|
export const projectToolDirectories = ['vscode-space'];
|
|
26
26
|
|
|
27
27
|
// The optional extensions a project can declare in .config under <group>: <section>:, as one line with the package
|
|
28
28
|
// and its version, like @aliens-syndicate/elements: 0.1.0 (the icons line adds the style: …/icons/stroke-rounded).
|
|
29
29
|
// The group follows package.json: dependencies for the packages the app uses, devDependencies for the build only.
|
|
30
30
|
// aliens new offers each one with "yes" as the answer by default, except those marked off: reactive adds stream
|
|
31
|
-
// operators, while the Reactive Core (signal, computed, effect, watch, batch and cleanup) comes with every project.
|
|
31
|
+
// operators and test adds automatic testing (aliens-test writes .test), while the Reactive Core (signal, computed, effect, watch, batch and cleanup) comes with every project.
|
|
32
32
|
export const extensions = [
|
|
33
33
|
{ section: 'utilities', group: 'devDependencies', name: '@aliens-syndicate/utilities' },
|
|
34
|
+
{ section: 'test', group: 'devDependencies', name: '@aliens-syndicate/test', off: true },
|
|
34
35
|
{ section: 'icons', group: 'dependencies', name: '@aliens-syndicate/icons', variant: 'stroke-rounded' },
|
|
35
36
|
{ section: 'elements', group: 'dependencies', name: '@aliens-syndicate/elements' },
|
|
36
37
|
{ section: 'reactive', group: 'dependencies', name: '@aliens-syndicate/reactive', off: true }
|
|
@@ -240,6 +241,14 @@ export function runBuild(root, { onError, quiet = false, silentErrors = false }
|
|
|
240
241
|
});
|
|
241
242
|
}
|
|
242
243
|
|
|
244
|
+
// Runs the project's tests (tools/test.mjs, a no-op without @aliens-syndicate/test in .config); it prints one summary line.
|
|
245
|
+
export function runTests(root) {
|
|
246
|
+
return new Promise(resolvePromise => {
|
|
247
|
+
const child = spawn(process.execPath, ['--disable-warning=ExperimentalWarning', join(root, 'tools', 'test.mjs')], { cwd: root, stdio: 'inherit' });
|
|
248
|
+
child.on('exit', resolvePromise);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
243
252
|
// The version of a package installed for the project: node_modules/<name>/package.json, from the project up.
|
|
244
253
|
// A local extension written as ./path reports "local".
|
|
245
254
|
export function installedVersion(root, name) {
|
package/tools/cli.mjs
CHANGED
|
@@ -12,6 +12,7 @@ const commands = [
|
|
|
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
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
|
+
['--test', { en: 'Adds the automatic tests of @aliens-syndicate/test', pt: 'Adiciona os testes automáticos do @aliens-syndicate/test', es: 'Añade las pruebas automáticas de @aliens-syndicate/test', zh: '添加 @aliens-syndicate/test 的自动测试' }],
|
|
15
16
|
['--reactive', { en: 'Adds the stream operators of @aliens-syndicate/reactive', pt: 'Adiciona os operadores de stream do @aliens-syndicate/reactive', es: 'Añade los operadores de stream de @aliens-syndicate/reactive', zh: '添加 @aliens-syndicate/reactive 的 stream 操作符' }],
|
|
16
17
|
['--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' }]] },
|
|
17
18
|
{ name: 'run', aliases: ['watch'], usage: 'aliens run [--port <number>]', load: async () => (await import('./serve.mjs')).serve,
|
package/tools/create.mjs
CHANGED
|
@@ -12,6 +12,7 @@ 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
|
+
test: 'Add automatic testing that writes .test ({package})?',
|
|
15
16
|
reactive: 'Add stream operators like debounce and switchMap ({package})? signal, computed and effect already come with Aliens.',
|
|
16
17
|
creating: 'Creating the Aliens project in {path}', created: 'Aliens project created in {path}', installing: 'Installing the packages with npm…',
|
|
17
18
|
unpublished: '{package} is not on npm yet, so the project starts without it.', offline: 'npm did not answer for {package}, so the project starts without it.', installFailed: 'npm install failed. Enter the folder and run npm install.',
|
|
@@ -19,6 +20,7 @@ const text = {
|
|
|
19
20
|
pt: { usage: 'Uso: aliens new <nome-do-projeto>', name: 'Qual é o nome do projeto?', fallbackName: 'meu-app-aliens',
|
|
20
21
|
badName: 'Use palavras minúsculas separadas por hífen no nome do projeto, como meu-app.', exists: 'A pasta {path} já existe.',
|
|
21
22
|
utilities: 'Usar classes utilitárias no .style ({package})?', icons: 'Usar a biblioteca de ícones ({package})?', elements: 'Usar Elements prontos ({package})?',
|
|
23
|
+
test: 'Adicionar testes automáticos que geram o .test ({package})?',
|
|
22
24
|
reactive: 'Adicionar operadores de stream como debounce e switchMap ({package})? signal, computed e effect já vêm com o Aliens.',
|
|
23
25
|
creating: 'Criando o projeto Aliens em {path}', created: 'Projeto Aliens criado em {path}', installing: 'Instalando os pacotes com o npm…',
|
|
24
26
|
unpublished: '{package} ainda não está no npm, então o projeto começa sem ele.', offline: 'O npm não respondeu sobre {package}, então o projeto começa sem ele.', installFailed: 'O npm install falhou. Entre na pasta e rode npm install.',
|
|
@@ -26,6 +28,7 @@ const text = {
|
|
|
26
28
|
es: { usage: 'Uso: aliens new <nombre-del-proyecto>', name: '¿Cómo se llama tu proyecto?', fallbackName: 'mi-app-aliens',
|
|
27
29
|
badName: 'Usa palabras en minúsculas separadas por guiones en el nombre del proyecto, como mi-app.', exists: 'La carpeta {path} ya existe.',
|
|
28
30
|
utilities: '¿Usar clases utilitarias en .style ({package})?', icons: '¿Usar la biblioteca de íconos ({package})?', elements: '¿Usar Elements listos ({package})?',
|
|
31
|
+
test: '¿Añadir pruebas automáticas que generan .test ({package})?',
|
|
29
32
|
reactive: '¿Añadir operadores de stream como debounce y switchMap ({package})? signal, computed y effect ya vienen con Aliens.',
|
|
30
33
|
creating: 'Creando el proyecto Aliens en {path}', created: 'Proyecto Aliens creado en {path}', installing: 'Instalando los paquetes con npm…',
|
|
31
34
|
unpublished: '{package} todavía no está en npm, así que el proyecto empieza sin él.', offline: 'npm no respondió sobre {package}, así que el proyecto empieza sin él.', installFailed: 'npm install falló. Entra en la carpeta y ejecuta npm install.',
|
|
@@ -33,6 +36,7 @@ const text = {
|
|
|
33
36
|
zh: { usage: '用法:aliens new <项目名称>', name: '项目叫什么名字?', fallbackName: 'my-aliens-app',
|
|
34
37
|
badName: '项目名称请使用以连字符分隔的小写单词,例如 my-app。', exists: '文件夹 {path} 已存在。',
|
|
35
38
|
utilities: '在 .style 中使用工具类({package})?', icons: '使用图标库({package})?', elements: '使用现成的 Elements({package})?',
|
|
39
|
+
test: '添加会生成 .test 的自动测试({package})?',
|
|
36
40
|
reactive: '添加 debounce、switchMap 等 stream 操作符({package})?signal、computed 和 effect 已内置于 Aliens。',
|
|
37
41
|
creating: '正在 {path} 中创建 Aliens 项目', created: 'Aliens 项目已创建于 {path}', installing: '正在用 npm 安装依赖包…',
|
|
38
42
|
unpublished: '{package} 尚未发布到 npm,项目将先不包含它。', offline: 'npm 没有返回 {package} 的信息,项目将先不包含它。', installFailed: 'npm install 失败。请进入文件夹运行 npm install。',
|
|
@@ -79,8 +83,8 @@ An [Aliens](https://github.com/AliensSyndicate/aliens-syndicate-framework) proje
|
|
|
79
83
|
## Project
|
|
80
84
|
|
|
81
85
|
The configuration lives in \`.config\` and the build generates the \`ai/.map\` index.
|
|
82
|
-
The Home
|
|
83
|
-
Add a \`:root[data-theme="name"]\` block to that file
|
|
86
|
+
The Home is \`project/app/pages/home/\`. The design tokens live in \`project/styles/settings/\`, the shared components in \`project/styles/components/\` and the themes in \`project/styles/settings/theme.style\`.
|
|
87
|
+
Add a \`:root[data-theme="name"]\` block to that file to create another theme; the build lists it with the light and dark ones.
|
|
84
88
|
|
|
85
89
|
\`.config\` lists the framework and every package with its version, under \`dependencies:\` and \`devDependencies:\` as in \`package.json\`. The build stops when a version differs from the installed one, and \`aliens update\` updates both.
|
|
86
90
|
|
|
@@ -100,6 +104,14 @@ dependencies:
|
|
|
100
104
|
@aliens-syndicate/elements: 0.1.0
|
|
101
105
|
\`\`\`
|
|
102
106
|
|
|
107
|
+
For automatic tests, run \`npm install -D @aliens-syndicate/test\` and add to \`.config\`; \`npx aliens-test\` then writes \`.test\`:
|
|
108
|
+
|
|
109
|
+
\`\`\`
|
|
110
|
+
devDependencies:
|
|
111
|
+
test:
|
|
112
|
+
@aliens-syndicate/test: 0.1.0
|
|
113
|
+
\`\`\`
|
|
114
|
+
|
|
103
115
|
\`signal\`, \`computed\`, \`effect\`, \`watch\`, \`batch\` and \`cleanup:\` come with Aliens. For stream operators like \`debounce\`, \`switchMap\` and \`combineLatest\`, run \`npm install @aliens-syndicate/reactive\` and add to \`.config\`:
|
|
104
116
|
|
|
105
117
|
\`\`\`
|
|
@@ -156,7 +168,6 @@ async function copyStarter(destination, name) {
|
|
|
156
168
|
await createProjectDirectories(destination);
|
|
157
169
|
// The agent, rule, and skill an AI needs to start working come ready in ai/.
|
|
158
170
|
await cp(join(starter, 'ai'), join(destination, 'ai'), { recursive: true });
|
|
159
|
-
await mkdir(join(project, 'app', 'pages', 'home'));
|
|
160
171
|
await mkdir(tools);
|
|
161
172
|
await mkdir(join(destination, '.vscode'));
|
|
162
173
|
const manifest = JSON.parse(await readFile(join(editorExtension, 'package.json'), 'utf8'));
|
|
@@ -177,7 +188,6 @@ async function copyStarter(destination, name) {
|
|
|
177
188
|
'project/app/app.logic': 'Logic App\n',
|
|
178
189
|
'project/app/app.markup': 'Markup App\n home\n',
|
|
179
190
|
'project/app/app.route': 'Route App\n routes:\n home:\n path: /\n element: home\n',
|
|
180
|
-
'project/app/pages/home/home.markup': 'Markup Home\n style-guide\n',
|
|
181
191
|
'project/styles/main.style': 'Style Main\n default:\n' + styleLayers.map(layer => ' ' + layer + '\n').join('')
|
|
182
192
|
};
|
|
183
193
|
const results = await Promise.allSettled([
|
package/tools/doctor.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { join } from 'node:path';
|
|
|
5
5
|
import { toolsDifferences } from './update.mjs';
|
|
6
6
|
import {
|
|
7
7
|
bold, captureCommand, installedVersion, cliPackage, cliRoot, cliVersion, compareVersions, cyan, defaultPort, dim, findProject, green,
|
|
8
|
-
configExtensions, latestVersion, minimumNode, parseFlags, pick, readConfig, red, runBuild, yellow
|
|
8
|
+
configExtensions, configFramework, latestVersion, minimumNode, parseFlags, pick, readConfig, red, runBuild, yellow
|
|
9
9
|
} from './cli-shared.mjs';
|
|
10
10
|
|
|
11
11
|
const text = {
|
|
@@ -16,7 +16,7 @@ const text = {
|
|
|
16
16
|
noProjectFix: 'Create one with aliens new <name>, or open a project folder', project: 'Project {name} in {path}',
|
|
17
17
|
config: '.config is valid', configBad: '.config: {problem}', entryMissing: 'files: entry: {file} does not exist', tools: 'tools/ matches the CLI {version}',
|
|
18
18
|
toolsOld: 'tools/ differs from the CLI {version} in {files}', toolsFix: 'aliens update', toolsSelf: 'tools/ is the CLI itself (framework repository)',
|
|
19
|
-
extension: '{name} {version}', extensionMissing: '{name} is declared in .config ({section}:) but is not installed', extensionFix: 'npm install {name}', extensionVersion: '{name}: .config declares {declared}, but {version} is installed', extensionLegacy: '{name}: .config still uses from:, without the version', updateFix: 'aliens update',
|
|
19
|
+
extension: '{name} {version}', extensionMissing: '{name} is declared in .config ({section}:) but is not installed', extensionFix: 'npm install {name}', extensionVersion: '{name}: .config declares {declared}, but {version} is installed', extensionLegacy: '{name}: .config still uses from:, without the version', updateFix: 'aliens update', framework: 'framework {version} in .config', frameworkOld: '.config lists framework {declared}, but the CLI is {version}',
|
|
20
20
|
port: 'Port {port} is free for aliens run', portUsed: 'Port {port} is in use', portDenied: 'Port {port} needs administrator rights on this system',
|
|
21
21
|
portFix: 'aliens run --port <number>, or set serve: port: in .config', build: 'aliens build passes', buildBad: 'aliens build fails: {error}',
|
|
22
22
|
buildFix: 'Fix the file and line in the message, then run aliens build', fine: 'No issues found.', issues: '{count} issue(s) found.', warnings: '{count} warning(s).' },
|
|
@@ -27,7 +27,7 @@ const text = {
|
|
|
27
27
|
noProjectFix: 'Crie um com aliens new <nome> ou abra a pasta de um projeto', project: 'Projeto {name} em {path}',
|
|
28
28
|
config: '.config válido', configBad: '.config: {problem}', entryMissing: 'files: entry: {file} não existe', tools: 'tools/ igual ao da CLI {version}',
|
|
29
29
|
toolsOld: 'tools/ diferente da CLI {version} em {files}', toolsFix: 'aliens update', toolsSelf: 'tools/ é a própria CLI (repositório do framework)',
|
|
30
|
-
extension: '{name} {version}', extensionMissing: '{name} está declarado no .config ({section}:) mas não está instalado', extensionFix: 'npm install {name}', extensionVersion: '{name}: o .config declara {declared}, mas a {version} está instalada', extensionLegacy: '{name}: o .config ainda usa from:, sem a versão', updateFix: 'aliens update',
|
|
30
|
+
extension: '{name} {version}', extensionMissing: '{name} está declarado no .config ({section}:) mas não está instalado', extensionFix: 'npm install {name}', extensionVersion: '{name}: o .config declara {declared}, mas a {version} está instalada', extensionLegacy: '{name}: o .config ainda usa from:, sem a versão', updateFix: 'aliens update', framework: 'framework {version} no .config', frameworkOld: 'O .config lista o framework {declared}, mas a CLI é a {version}',
|
|
31
31
|
port: 'Porta {port} livre para o aliens run', portUsed: 'A porta {port} está em uso', portDenied: 'A porta {port} exige permissão de administrador neste sistema',
|
|
32
32
|
portFix: 'aliens run --port <número> ou defina serve: port: no .config', build: 'aliens build passa', buildBad: 'aliens build falha: {error}',
|
|
33
33
|
buildFix: 'Corrija o arquivo e a linha da mensagem e rode aliens build', fine: 'Nenhum problema encontrado.', issues: '{count} problema(s) encontrado(s).', warnings: '{count} aviso(s).' },
|
|
@@ -38,7 +38,7 @@ const text = {
|
|
|
38
38
|
noProjectFix: 'Crea uno con aliens new <nombre> o abre la carpeta de un proyecto', project: 'Proyecto {name} en {path}',
|
|
39
39
|
config: '.config es válido', configBad: '.config: {problem}', entryMissing: 'files: entry: {file} no existe', tools: 'tools/ coincide con la CLI {version}',
|
|
40
40
|
toolsOld: 'tools/ difiere de la CLI {version} en {files}', toolsFix: 'aliens update', toolsSelf: 'tools/ es la propia CLI (repositorio del framework)',
|
|
41
|
-
extension: '{name} {version}', extensionMissing: '{name} está declarado en .config ({section}:) pero no está instalado', extensionFix: 'npm install {name}', extensionVersion: '{name}: .config declara {declared}, pero está instalada la {version}', extensionLegacy: '{name}: .config todavía usa from:, sin la versión', updateFix: 'aliens update',
|
|
41
|
+
extension: '{name} {version}', extensionMissing: '{name} está declarado en .config ({section}:) pero no está instalado', extensionFix: 'npm install {name}', extensionVersion: '{name}: .config declara {declared}, pero está instalada la {version}', extensionLegacy: '{name}: .config todavía usa from:, sin la versión', updateFix: 'aliens update', framework: 'framework {version} en .config', frameworkOld: '.config indica framework {declared}, pero la CLI es la {version}',
|
|
42
42
|
port: 'Puerto {port} libre para aliens run', portUsed: 'El puerto {port} está en uso', portDenied: 'El puerto {port} requiere permisos de administrador en este sistema',
|
|
43
43
|
portFix: 'aliens run --port <número> o define serve: port: en .config', build: 'aliens build pasa', buildBad: 'aliens build falla: {error}',
|
|
44
44
|
buildFix: 'Corrige el archivo y la línea del mensaje y ejecuta aliens build', fine: 'No se encontraron problemas.', issues: '{count} problema(s) encontrado(s).', warnings: '{count} aviso(s).' },
|
|
@@ -49,7 +49,7 @@ const text = {
|
|
|
49
49
|
noProjectFix: '用 aliens new <名称> 创建一个,或打开项目文件夹', project: '项目 {name},位于 {path}',
|
|
50
50
|
config: '.config 有效', configBad: '.config:{problem}', entryMissing: 'files: entry: {file} 不存在', tools: 'tools/ 与 CLI {version} 一致',
|
|
51
51
|
toolsOld: 'tools/ 与 CLI {version} 不同:{files}', toolsFix: 'aliens update', toolsSelf: 'tools/ 就是 CLI 本身(框架仓库)',
|
|
52
|
-
extension: '{name} {version}', extensionMissing: '{name} 已在 .config({section}:)中声明,但尚未安装', extensionFix: 'npm install {name}', extensionVersion: '{name}:.config 声明的是 {declared},但安装的是 {version}', extensionLegacy: '{name}:.config 仍在使用 from:,没有写版本', updateFix: 'aliens update',
|
|
52
|
+
extension: '{name} {version}', extensionMissing: '{name} 已在 .config({section}:)中声明,但尚未安装', extensionFix: 'npm install {name}', extensionVersion: '{name}:.config 声明的是 {declared},但安装的是 {version}', extensionLegacy: '{name}:.config 仍在使用 from:,没有写版本', updateFix: 'aliens update', framework: '.config 中的 framework {version}', frameworkOld: '.config 中的 framework 是 {declared},但 CLI 是 {version}',
|
|
53
53
|
port: '端口 {port} 可供 aliens run 使用', portUsed: '端口 {port} 已被占用', portDenied: '在此系统上,端口 {port} 需要管理员权限',
|
|
54
54
|
portFix: 'aliens run --port <端口>,或在 .config 中设置 serve: port:', build: 'aliens build 通过', buildBad: 'aliens build 失败:{error}',
|
|
55
55
|
buildFix: '按消息中的文件和行号修复后,运行 aliens build', fine: '未发现问题。', issues: '发现 {count} 个问题。', warnings: '{count} 个警告。' }
|
|
@@ -114,6 +114,11 @@ export async function doctor(args) {
|
|
|
114
114
|
else report('warn', t('toolsOld', { version: cliVersion, files: changed.slice(0, 3).join(', ') + (changed.length > 3 ? '…' : '') }), t('toolsFix'));
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
// framework: follows the CLI whose tools/ the project carries; aliens update writes it.
|
|
118
|
+
const framework = configFramework(config);
|
|
119
|
+
if (framework?.version === cliVersion) report('ok', t('framework', { version: framework.version }));
|
|
120
|
+
else if (framework) report('warn', t('frameworkOld', { declared: framework.version, version: cliVersion }), t('updateFix'));
|
|
121
|
+
|
|
117
122
|
// Each package of .config must be installed in the version .config declares; the build stops otherwise.
|
|
118
123
|
for (const { name: section, group, from, version: declared, legacy } of configExtensions(config)) {
|
|
119
124
|
const version = installedVersion(root, from);
|