@oktis-works/cms 0.8.11 → 0.8.13
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/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +39 -36
- package/dist/commands.js.map +1 -1
- package/dist/extension-scaffold.d.ts +5 -2
- package/dist/extension-scaffold.d.ts.map +1 -1
- package/dist/extension-scaffold.js +30 -8
- package/dist/extension-scaffold.js.map +1 -1
- package/dist/parser.js +1 -1
- package/dist/parser.js.map +1 -1
- package/dist/scaffold-docs.d.ts.map +1 -1
- package/dist/scaffold-docs.js +112 -51
- package/dist/scaffold-docs.js.map +1 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +12 -1
- package/dist/scaffold.js.map +1 -1
- package/dist/theme-assets.d.ts +12 -0
- package/dist/theme-assets.d.ts.map +1 -0
- package/dist/theme-assets.js +199 -0
- package/dist/theme-assets.js.map +1 -0
- package/dist/wizard.js +1 -1
- package/dist/wizard.js.map +1 -1
- package/migrations/V010__core__harden_themes_lifecycle.sql +36 -0
- package/package.json +4 -4
package/dist/scaffold-docs.js
CHANGED
|
@@ -216,8 +216,8 @@ pm2 logs okcms-api # log por processo
|
|
|
216
216
|
pm2 unmonitor okcms-api && pm2 delete okcms-api # remover
|
|
217
217
|
\`\`\`
|
|
218
218
|
|
|
219
|
-
- O worker
|
|
220
|
-
\`WORKER_COUNT\` e \`WORKER_CONCURRENCY
|
|
219
|
+
- O worker lê \`WORKER_MODE\` (docker · pm2 · k8s, default \`docker\`), loga
|
|
220
|
+
\`WORKER_COUNT\` e usa \`WORKER_CONCURRENCY\` (default 5) na concorrência das filas.
|
|
221
221
|
- Como cada app é um executável independente, o \`okcms start\` não é
|
|
222
222
|
necessário em produção — o pm2 supervisoria cada um diretamente.
|
|
223
223
|
|
|
@@ -292,20 +292,19 @@ os 6 passos acima na mão. Prefira o comando da CLI.
|
|
|
292
292
|
| \`okcms db:backup\` · \`db:restore -f <arquivo>\` | Backup/restore do Postgres |
|
|
293
293
|
| \`okcms plugin:create -n <nome>\` | Scaffold de plugin — guia em [PLUGIN.md](./PLUGIN.md) |
|
|
294
294
|
| \`okcms plugin:install -n <caminho>\` | Instala plugin de um caminho local + registra |
|
|
295
|
-
| \`okcms plugin:list\` · \`plugin:search\` · \`plugin:manage\` | Lista, busca (npm) e
|
|
295
|
+
| \`okcms plugin:list\` · \`plugin:search\` · \`plugin:manage\` | Lista, busca (npm) e gerencia plugins (info · habilitar/desabilitar no estado local) |
|
|
296
296
|
| \`okcms theme:create -n <nome> --style css\\|scss\\|tailwind\` | Scaffold de tema — guia em [THEME.md](./THEME.md) |
|
|
297
297
|
| \`okcms theme:install\` · \`theme:list\` · \`theme:search\` · \`theme:manage\` | Gestão de temas (\`--set-active\` define o ativo) |
|
|
298
298
|
| \`okcms theme:build -n <nome>\` | Compila SCSS/Tailwind → \`dist/theme.css\` isolado |
|
|
299
299
|
| \`okcms update\` | Assistente de atualização: y/n por etapa — pacotes → migrations (sincroniza \`./migrations\`) → healthcheck → deploy |
|
|
300
300
|
| \`okcms update -i\` | Alias legado; a atualização completa já instala os pacotes |
|
|
301
301
|
| \`okcms update --mode download\` | Baixa/aplica os pacotes \`@oktis-works/*\` + sincroniza \`./migrations\`, sem iniciar Docker |
|
|
302
|
-
| \`okcms update --mode deploy\` | Deploy
|
|
303
|
-
| \`okcms redeploy\` | Depois de instalar plugin/tema: SQL do plugin → \`migrations/\`, \`dist/theme.css\` do tema e deploy
|
|
302
|
+
| \`okcms update --mode deploy\` | Deploy do destino salvo: build → migrations → healthcheck → swap → worker (\`--target\` escolhe blue-green, simple ou pm2) |
|
|
303
|
+
| \`okcms redeploy\` | Depois de instalar plugin/tema: SQL do plugin → \`migrations/\`, \`dist/theme.css\` do tema e refaz o deploy (\`--dry-run\` só mostra o plano, \`--target\` escolhe o destino) |
|
|
304
304
|
| \`okcms seed\` | Semeia dados iniciais (roles + settings) — idempotente |
|
|
305
305
|
| \`okcms user:create\` | Cria usuário e atribui um papel dentro do tenant |
|
|
306
306
|
| \`okcms system:status\` | Status do sistema (ambiente + saúde do banco) |
|
|
307
307
|
| \`okcms media:migrate\` | Migra arquivos de mídia entre drivers (\`local\` ↔ \`s3\`/\`r2\`/\`minio\`) |
|
|
308
|
-
| \`okcms prerender\` | Gera HTML estático das páginas publicadas (best-effort) |
|
|
309
308
|
| \`okcms build\` | Build dos apps em monorepo (\`--apps api,admin,web\`) |
|
|
310
309
|
|
|
311
310
|
## Banco de dados
|
|
@@ -322,7 +321,7 @@ os 6 passos acima na mão. Prefira o comando da CLI.
|
|
|
322
321
|
\`\`\`bash
|
|
323
322
|
okcms update # assistente: y/n em pacotes → migrations → deploy
|
|
324
323
|
okcms update --mode download # só baixa/aplica os pacotes
|
|
325
|
-
okcms update --mode deploy # deploy
|
|
324
|
+
okcms update --mode deploy # deploy completo do destino salvo
|
|
326
325
|
okcms update --mode deploy --yes # sem prompts (CI/CD)
|
|
327
326
|
\`\`\`
|
|
328
327
|
|
|
@@ -349,7 +348,7 @@ okcms redeploy
|
|
|
349
348
|
\`\`\`
|
|
350
349
|
|
|
351
350
|
Ele copia \`plugins/<n>/migrations/*.sql\` para \`migrations/\` (idempotente),
|
|
352
|
-
compila o estilo de cada tema com entrada e refaz o deploy
|
|
351
|
+
compila o estilo de cada tema com entrada e refaz o deploy — sem
|
|
353
352
|
\`bun add\`. Use \`--dry-run\` para ver o plano, \`--plugin <nome>\` /
|
|
354
353
|
\`--theme <nome>\` para restringir o preparo, \`--skip-migrations\` e
|
|
355
354
|
\`--skip-theme-build\` para pular etapas.
|
|
@@ -523,8 +522,8 @@ pm2 logs okcms-api # log per process
|
|
|
523
522
|
pm2 unmonitor okcms-api && pm2 delete okcms-api # remove
|
|
524
523
|
\`\`\`
|
|
525
524
|
|
|
526
|
-
- The worker
|
|
527
|
-
\`WORKER_COUNT\` and \`WORKER_CONCURRENCY
|
|
525
|
+
- The worker reads \`WORKER_MODE\` (docker · pm2 · k8s, default \`docker\`), logs
|
|
526
|
+
\`WORKER_COUNT\` and uses \`WORKER_CONCURRENCY\` (default 5) for queue concurrency.
|
|
528
527
|
- Since each app is an independent executable, \`okcms start\` is not
|
|
529
528
|
needed in production — pm2 supervises each one directly.
|
|
530
529
|
|
|
@@ -599,7 +598,7 @@ the 6 steps above to do by hand. Prefer the CLI command.
|
|
|
599
598
|
| \`okcms db:backup\` · \`db:restore -f <file>\` | Postgres backup/restore |
|
|
600
599
|
| \`okcms plugin:create -n <name>\` | Plugin scaffold — guide in [PLUGIN.md](./PLUGIN.md) |
|
|
601
600
|
| \`okcms plugin:install -n <path>\` | Installs a plugin from a local path + registers it |
|
|
602
|
-
| \`okcms plugin:list\` · \`plugin:search\` · \`plugin:manage\` | Lists, searches (npm) and
|
|
601
|
+
| \`okcms plugin:list\` · \`plugin:search\` · \`plugin:manage\` | Lists, searches (npm) and manages plugins (info · enable/disable in local state) |
|
|
603
602
|
| \`okcms theme:create -n <name> --style css\\|scss\\|tailwind\` | Theme scaffold — guide in [THEME.md](./THEME.md) |
|
|
604
603
|
| \`okcms theme:install\` · \`theme:list\` · \`theme:search\` · \`theme:manage\` | Theme management (\`--set-active\` sets the active one) |
|
|
605
604
|
| \`okcms theme:build -n <name>\` | Compiles SCSS/Tailwind → isolated \`dist/theme.css\` |
|
|
@@ -613,7 +612,6 @@ the 6 steps above to do by hand. Prefer the CLI command.
|
|
|
613
612
|
| \`okcms user:create\` | Creates a user and assigns a role inside the tenant |
|
|
614
613
|
| \`okcms system:status\` | System status (environment + database health) |
|
|
615
614
|
| \`okcms media:migrate\` | Migrates media files between drivers (\`local\` ↔ \`s3\`/\`r2\`/\`minio\`) |
|
|
616
|
-
| \`okcms prerender\` | Generates static HTML for published pages (best-effort) |
|
|
617
615
|
| \`okcms build\` | Builds the monorepo apps (\`--apps api,admin,web\`) |
|
|
618
616
|
|
|
619
617
|
## Database
|
|
@@ -630,7 +628,7 @@ the 6 steps above to do by hand. Prefer the CLI command.
|
|
|
630
628
|
\`\`\`bash
|
|
631
629
|
okcms update # wizard: y/n on packages → migrations → deploy
|
|
632
630
|
okcms update --mode download # only downloads/applies the packages
|
|
633
|
-
okcms update --mode deploy # full
|
|
631
|
+
okcms update --mode deploy # full deploy of the saved target
|
|
634
632
|
okcms update --mode deploy --yes # no prompts (CI/CD)
|
|
635
633
|
\`\`\`
|
|
636
634
|
|
|
@@ -656,8 +654,8 @@ okcms redeploy
|
|
|
656
654
|
\`\`\`
|
|
657
655
|
|
|
658
656
|
It copies \`plugins/<n>/migrations/*.sql\` into \`migrations/\` (idempotent),
|
|
659
|
-
compiles the style of every theme with an entry and redoes the
|
|
660
|
-
|
|
657
|
+
compiles the style of every theme with an entry and redoes the deploy of
|
|
658
|
+
the chosen target — without \`bun add\`. Use \`--dry-run\` to see the plan,
|
|
661
659
|
\`--plugin <name>\` / \`--theme <name>\` to narrow the preparation, and
|
|
662
660
|
\`--skip-migrations\` / \`--skip-theme-build\` to skip steps.
|
|
663
661
|
|
|
@@ -725,7 +723,13 @@ plugins/meu-plugin/
|
|
|
725
723
|
'use strict';
|
|
726
724
|
|
|
727
725
|
module.exports.register = function register(registry) {
|
|
728
|
-
|
|
726
|
+
// Filtro real: roda em toda listagem de conteúdo (ex.: GET /api/v1/content)
|
|
727
|
+
registry.addFilter('content:query', (items) => items);
|
|
728
|
+
|
|
729
|
+
// Action real: disparada após publicar um conteúdo do tipo "post"
|
|
730
|
+
registry.addAction('after_publish_content_post', (content) => {
|
|
731
|
+
console.log('[meu-plugin] publicado:', content.slug);
|
|
732
|
+
});
|
|
729
733
|
};
|
|
730
734
|
\`\`\`
|
|
731
735
|
|
|
@@ -733,6 +737,13 @@ O \`register(registry)\` é chamado quando o plugin é carregado. Use o registro
|
|
|
733
737
|
para expor filters (transformações) — veja o que existe em
|
|
734
738
|
\`GET /api/v1/hooks/catalog\` para os nomes e contratos disponíveis.
|
|
735
739
|
|
|
740
|
+
O carregamento acontece no boot de todos os processos (API, web e worker):
|
|
741
|
+
plugins com status \`ACTIVATED\` no banco têm o \`register\` chamado e os hooks
|
|
742
|
+
entram no registry compartilhado. Ativar/desativar pela API recarrega no
|
|
743
|
+
próprio processo da API na hora; web/worker pegam a mudança no próximo
|
|
744
|
+
restart. Um plugin que falha ao carregar é isolado: a falha é reportada no
|
|
745
|
+
log e nunca derruba o boot dos outros plugins nem do processo.
|
|
746
|
+
|
|
736
747
|
## Migrations do banco
|
|
737
748
|
|
|
738
749
|
Se o plugin cria ou altera tabelas, o SQL mora **dentro do plugin**:
|
|
@@ -775,16 +786,17 @@ okcms plugin:create --name meu-plugin
|
|
|
775
786
|
okcms plugin:install --name ../meu-plugin-fonte
|
|
776
787
|
|
|
777
788
|
# 4. Gestão
|
|
778
|
-
okcms plugin:list # instalados +
|
|
789
|
+
okcms plugin:list # instalados + estado local
|
|
779
790
|
okcms plugin:manage -n meu-plugin --info # informações do manifesto
|
|
780
|
-
okcms plugin:manage -n meu-plugin --disable #
|
|
781
|
-
okcms plugin:manage -n meu-plugin --enable #
|
|
782
|
-
okcms plugin:manage -n meu-plugin --uninstall # remove arquivos
|
|
791
|
+
okcms plugin:manage -n meu-plugin --disable # marca como desabilitado no estado local (.okcms/extensions.json)
|
|
792
|
+
okcms plugin:manage -n meu-plugin --enable # marca como habilitado de novo (mesmo estado local)
|
|
793
|
+
okcms plugin:manage -n meu-plugin --uninstall # remove os arquivos do projeto
|
|
794
|
+
# O runtime lê o status no banco: ative/desative pelo admin (carregado no boot).
|
|
783
795
|
|
|
784
796
|
# 5. Busca no npm (pacotes com a keyword okcms-plugin)
|
|
785
797
|
okcms plugin:search -q galeria
|
|
786
798
|
|
|
787
|
-
# 6. Publicou/atualizou? Stage do SQL + build dos temas + deploy
|
|
799
|
+
# 6. Publicou/atualizou? Stage do SQL + build dos temas + deploy (destino salvo)
|
|
788
800
|
okcms redeploy --dry-run # só mostra o plano
|
|
789
801
|
okcms redeploy
|
|
790
802
|
\`\`\`
|
|
@@ -815,10 +827,14 @@ okcms theme:create --name meu-tema --style css # css | scss | tailwind
|
|
|
815
827
|
\`\`\`
|
|
816
828
|
themes/meu-tema/
|
|
817
829
|
├── theme.json # manifest (type: theme + compatibilidade)
|
|
818
|
-
├── templates
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
├──
|
|
830
|
+
├── home.astro # templates da hierarquia NA RAIZ
|
|
831
|
+
├── index.astro
|
|
832
|
+
├── single.astro
|
|
833
|
+
├── page.astro
|
|
834
|
+
├── archive.astro
|
|
835
|
+
├── 404.astro
|
|
836
|
+
├── dist/theme.css # engine css — já servível
|
|
837
|
+
│ # (ou styles/main.scss — ou src/input.css)
|
|
822
838
|
└── README.md
|
|
823
839
|
\`\`\`
|
|
824
840
|
|
|
@@ -841,11 +857,13 @@ automaticamente, como nos plugins.
|
|
|
841
857
|
|
|
842
858
|
### Templates
|
|
843
859
|
|
|
844
|
-
|
|
860
|
+
Templates são arquivos \`*.astro\` **na raiz do tema** — é o formato que o
|
|
861
|
+
runtime do site busca (hierarquia \`home\` → \`index\` → \`404\`, com fallback
|
|
862
|
+
\`_shared\` → \`default\`). Sintaxe com variáveis, HTML cru e laços/condições:
|
|
845
863
|
|
|
846
864
|
\`\`\`html
|
|
847
865
|
<main class="site">
|
|
848
|
-
{{#each
|
|
866
|
+
{{#each items}}
|
|
849
867
|
<article>
|
|
850
868
|
<h2>{{title}}</h2>
|
|
851
869
|
<p>{{excerpt}}</p>
|
|
@@ -854,20 +872,27 @@ Sintaxe de template com variáveis e laços:
|
|
|
854
872
|
</main>
|
|
855
873
|
\`\`\`
|
|
856
874
|
|
|
857
|
-
- \`
|
|
858
|
-
- \`
|
|
875
|
+
- \`{{variável}}\` — valor com escape HTML; \`{{{html}}}\` — sem escape (HTML do conteúdo)
|
|
876
|
+
- \`{{#each}}\` / \`{{#if}}\` aninhados, caminhos pontuados (\`content.author.name\`)
|
|
877
|
+
- \`home.astro\` — home (\`{{site.title}}\`, \`{{#each items}}\`)
|
|
878
|
+
- \`index.astro\`, \`single.astro\`, \`page.astro\` — conteúdo (\`{{content.*}}\`, \`{{page.title}}\`)
|
|
879
|
+
- \`archive.astro\` — listagem por tipo/taxonomia (\`{{#each items}}\`)
|
|
880
|
+
- \`404.astro\` — última da cadeia
|
|
881
|
+
- Contexto disponível: \`site.*\`, \`page.*\`, \`content.*\` (colunas + campos), \`items\`,
|
|
882
|
+
\`menus\`, \`contentTypes\`, \`taxonomies\`, \`terms\`, \`settings\`
|
|
859
883
|
|
|
860
884
|
## Estilos por engine
|
|
861
885
|
|
|
862
886
|
| \`--style\` | Arquivo gerado | Build |
|
|
863
887
|
|---|---|---|
|
|
864
|
-
| \`css\` (default) | \`
|
|
888
|
+
| \`css\` (default) | \`dist/theme.css\` | nenhum — servido direto |
|
|
865
889
|
| \`scss\` | \`styles/main.scss\` (+ \`components.scss\`) | \`okcms theme:build -n meu-tema\` |
|
|
866
890
|
| \`tailwind\` | \`src/input.css\` + \`tailwind.config.js\` | \`okcms theme:build -n meu-tema\` |
|
|
867
891
|
|
|
868
|
-
O
|
|
869
|
-
\`
|
|
870
|
-
|
|
892
|
+
O site público só linka \`/themes/<tema>/dist/theme.css\` — no engine \`css\` o
|
|
893
|
+
arquivo já nasce em \`dist/\` (servível sem build). Nos demais, o build compila
|
|
894
|
+
para \`dist/theme.css\` **com isolamento \`[data-theme="meu-tema"]\`** (sem vazar
|
|
895
|
+
estilos entre temas; o Tailwind já sai com \`preflight: false\`).
|
|
871
896
|
|
|
872
897
|
> \`dist/theme.css\` é lido **pronto** pelo container — nada compila SCSS ou
|
|
873
898
|
> Tailwind dentro da imagem. O arquivo existe no host e só chega em
|
|
@@ -880,7 +905,7 @@ sai com \`preflight: false\`).
|
|
|
880
905
|
# 1. Crie
|
|
881
906
|
okcms theme:create --name meu-tema --style scss
|
|
882
907
|
|
|
883
|
-
# 2. Edite templates
|
|
908
|
+
# 2. Edite os templates *.astro na raiz e os estilos
|
|
884
909
|
|
|
885
910
|
# 3. Compile os estilos (scss/tailwind)
|
|
886
911
|
okcms theme:build --name meu-tema
|
|
@@ -888,11 +913,14 @@ okcms theme:build --name meu-tema
|
|
|
888
913
|
# 4. Ative (grava activeTheme no okcms.config.json)
|
|
889
914
|
okcms theme:manage --name meu-tema --set-active
|
|
890
915
|
# (equivalente: ACTIVE_THEME=meu-tema no .env)
|
|
916
|
+
# A tela Temas do admin também ativa — o tema ativo é lido do banco a
|
|
917
|
+
# cada request, sem restart do site.
|
|
891
918
|
|
|
892
919
|
# 5. Gestão
|
|
893
920
|
okcms theme:list # instalados + status
|
|
894
921
|
okcms theme:manage -n meu-tema --info # informações do theme.json
|
|
895
922
|
okcms theme:manage -n meu-tema --disable|enable
|
|
923
|
+
# (estado local .okcms/extensions.json; o tema ativo é o --set-active)
|
|
896
924
|
okcms theme:manage -n meu-tema --uninstall
|
|
897
925
|
okcms theme:search -q blog # busca no npm (keyword okcms-theme)
|
|
898
926
|
|
|
@@ -965,7 +993,13 @@ plugins/my-plugin/
|
|
|
965
993
|
'use strict';
|
|
966
994
|
|
|
967
995
|
module.exports.register = function register(registry) {
|
|
968
|
-
|
|
996
|
+
// Real filter: runs on every content listing (e.g. GET /api/v1/content)
|
|
997
|
+
registry.addFilter('content:query', (items) => items);
|
|
998
|
+
|
|
999
|
+
// Real action: fired after publishing a "post" entry
|
|
1000
|
+
registry.addAction('after_publish_content_post', (content) => {
|
|
1001
|
+
console.log('[my-plugin] published:', content.slug);
|
|
1002
|
+
});
|
|
969
1003
|
};
|
|
970
1004
|
\`\`\`
|
|
971
1005
|
|
|
@@ -973,6 +1007,13 @@ module.exports.register = function register(registry) {
|
|
|
973
1007
|
to expose filters (transformations) — see what exists at
|
|
974
1008
|
\`GET /api/v1/hooks/catalog\` for the available names and contracts.
|
|
975
1009
|
|
|
1010
|
+
Loading happens at the boot of every process (API, web and worker): plugins
|
|
1011
|
+
with \`ACTIVATED\` status in the database get \`register\` called and their hooks
|
|
1012
|
+
enter the shared registry. Activating/deactivating via the API reloads the
|
|
1013
|
+
API process in place; web/worker pick the change up on the next restart.
|
|
1014
|
+
A plugin that fails to load is isolated: the failure is logged and never
|
|
1015
|
+
breaks the boot of the other plugins or of the process.
|
|
1016
|
+
|
|
976
1017
|
## Database migrations
|
|
977
1018
|
|
|
978
1019
|
If the plugin creates or changes tables, the SQL lives **inside the plugin**:
|
|
@@ -1015,16 +1056,18 @@ okcms plugin:create --name my-plugin
|
|
|
1015
1056
|
okcms plugin:install --name ../my-plugin-source
|
|
1016
1057
|
|
|
1017
1058
|
# 4. Management
|
|
1018
|
-
okcms plugin:list # installed +
|
|
1059
|
+
okcms plugin:list # installed + local state
|
|
1019
1060
|
okcms plugin:manage -n my-plugin --info # manifest information
|
|
1020
|
-
okcms plugin:manage -n my-plugin --disable #
|
|
1021
|
-
okcms plugin:manage -n my-plugin --enable #
|
|
1022
|
-
okcms plugin:manage -n my-plugin --uninstall # removes
|
|
1061
|
+
okcms plugin:manage -n my-plugin --disable # marks as disabled in the local state (.okcms/extensions.json)
|
|
1062
|
+
okcms plugin:manage -n my-plugin --enable # marks as enabled again (same local state)
|
|
1063
|
+
okcms plugin:manage -n my-plugin --uninstall # removes the project files
|
|
1064
|
+
# Runtime effect comes from the admin: activate/deactivate flips the database
|
|
1065
|
+
# status loaded at boot (web/worker on the next restart).
|
|
1023
1066
|
|
|
1024
1067
|
# 5. Search npm (packages with the okcms-plugin keyword)
|
|
1025
1068
|
okcms plugin:search -q gallery
|
|
1026
1069
|
|
|
1027
|
-
# 6. Published/updated? Stage the SQL + build the themes +
|
|
1070
|
+
# 6. Published/updated? Stage the SQL + build the themes + deploy (saved target)
|
|
1028
1071
|
okcms redeploy --dry-run # only shows the plan
|
|
1029
1072
|
okcms redeploy
|
|
1030
1073
|
\`\`\`
|
|
@@ -1055,10 +1098,14 @@ okcms theme:create --name my-theme --style css # css | scss | tailwind
|
|
|
1055
1098
|
\`\`\`
|
|
1056
1099
|
themes/my-theme/
|
|
1057
1100
|
├── theme.json # manifest (type: theme + compatibility)
|
|
1058
|
-
├── templates
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
├──
|
|
1101
|
+
├── home.astro # hierarchy templates AT THE ROOT
|
|
1102
|
+
├── index.astro
|
|
1103
|
+
├── single.astro
|
|
1104
|
+
├── page.astro
|
|
1105
|
+
├── archive.astro
|
|
1106
|
+
├── 404.astro
|
|
1107
|
+
├── dist/theme.css # css engine — ready to serve
|
|
1108
|
+
│ # (or styles/main.scss — or src/input.css)
|
|
1062
1109
|
└── README.md
|
|
1063
1110
|
\`\`\`
|
|
1064
1111
|
|
|
@@ -1081,11 +1128,14 @@ automatically, just like with plugins.
|
|
|
1081
1128
|
|
|
1082
1129
|
### Templates
|
|
1083
1130
|
|
|
1084
|
-
|
|
1131
|
+
Templates are \`*.astro\` files **at the theme root** — that's what the site
|
|
1132
|
+
runtime looks up (hierarchy \`home\` → \`index\` → \`404\`, with \`_shared\` →
|
|
1133
|
+
\`default\` fallback). Syntax with variables, raw HTML, and nested
|
|
1134
|
+
loops/conditionals:
|
|
1085
1135
|
|
|
1086
1136
|
\`\`\`html
|
|
1087
1137
|
<main class="site">
|
|
1088
|
-
{{#each
|
|
1138
|
+
{{#each items}}
|
|
1089
1139
|
<article>
|
|
1090
1140
|
<h2>{{title}}</h2>
|
|
1091
1141
|
<p>{{excerpt}}</p>
|
|
@@ -1094,18 +1144,26 @@ Template syntax with variables and loops:
|
|
|
1094
1144
|
</main>
|
|
1095
1145
|
\`\`\`
|
|
1096
1146
|
|
|
1097
|
-
- \`
|
|
1098
|
-
- \`
|
|
1147
|
+
- \`{{variable}}\` — HTML-escaped value; \`{{{html}}}\` — raw (content HTML)
|
|
1148
|
+
- \`{{#each}}\` / \`{{#if}}\` nest, dotted paths (\`content.author.name\`)
|
|
1149
|
+
- \`home.astro\` — home (\`{{site.title}}\`, \`{{#each items}}\`)
|
|
1150
|
+
- \`index.astro\`, \`single.astro\`, \`page.astro\` — content (\`{{content.*}}\`, \`{{page.title}}\`)
|
|
1151
|
+
- \`archive.astro\` — type/taxonomy listing (\`{{#each items}}\`)
|
|
1152
|
+
- \`404.astro\` — last in the chain
|
|
1153
|
+
- Context available: \`site.*\`, \`page.*\`, \`content.*\` (columns + fields), \`items\`,
|
|
1154
|
+
\`menus\`, \`contentTypes\`, \`taxonomies\`, \`terms\`, \`settings\`
|
|
1099
1155
|
|
|
1100
1156
|
## Styles per engine
|
|
1101
1157
|
|
|
1102
1158
|
| \`--style\` | Generated file | Build |
|
|
1103
1159
|
|---|---|---|
|
|
1104
|
-
| \`css\` (default) | \`
|
|
1160
|
+
| \`css\` (default) | \`dist/theme.css\` | none — served as is |
|
|
1105
1161
|
| \`scss\` | \`styles/main.scss\` (+ \`components.scss\`) | \`okcms theme:build -n my-theme\` |
|
|
1106
1162
|
| \`tailwind\` | \`src/input.css\` + \`tailwind.config.js\` | \`okcms theme:build -n my-theme\` |
|
|
1107
1163
|
|
|
1108
|
-
The
|
|
1164
|
+
The public site only links \`/themes/<theme>/dist/theme.css\` — on the \`css\`
|
|
1165
|
+
engine the file is born in \`dist/\` (served with no build). On the others, the
|
|
1166
|
+
build compiles into \`dist/theme.css\` **with \`[data-theme="my-theme"]\`
|
|
1109
1167
|
isolation** (styles never leak between themes; Tailwind already ships with
|
|
1110
1168
|
\`preflight: false\`).
|
|
1111
1169
|
|
|
@@ -1120,7 +1178,7 @@ isolation** (styles never leak between themes; Tailwind already ships with
|
|
|
1120
1178
|
# 1. Create it
|
|
1121
1179
|
okcms theme:create --name my-theme --style scss
|
|
1122
1180
|
|
|
1123
|
-
# 2. Edit templates
|
|
1181
|
+
# 2. Edit the root *.astro templates and styles
|
|
1124
1182
|
|
|
1125
1183
|
# 3. Compile the styles (scss/tailwind)
|
|
1126
1184
|
okcms theme:build --name my-theme
|
|
@@ -1128,11 +1186,14 @@ okcms theme:build --name my-theme
|
|
|
1128
1186
|
# 4. Activate it (writes activeTheme into okcms.config.json)
|
|
1129
1187
|
okcms theme:manage --name my-theme --set-active
|
|
1130
1188
|
# (equivalent: ACTIVE_THEME=my-theme in .env)
|
|
1189
|
+
# The admin Themes screen activates too — the active theme is read from
|
|
1190
|
+
# the database on every request, no site restart needed.
|
|
1131
1191
|
|
|
1132
1192
|
# 5. Management
|
|
1133
1193
|
okcms theme:list # installed + status
|
|
1134
1194
|
okcms theme:manage -n my-theme --info # theme.json information
|
|
1135
1195
|
okcms theme:manage -n my-theme --disable|enable
|
|
1196
|
+
# (local state .okcms/extensions.json; the active theme is the --set-active)
|
|
1136
1197
|
okcms theme:manage -n my-theme --uninstall
|
|
1137
1198
|
okcms theme:search -q blog # npm search (keyword okcms-theme)
|
|
1138
1199
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold-docs.js","sourceRoot":"","sources":["../src/scaffold-docs.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,wEAAwE;AACxE,gFAAgF;AAChF,EAAE;AACF,sEAAsE;AACtE,6EAA6E;AAC7E,yDAAyD;AACzD,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAa,IAAI,CAAC;AAEhD;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAgC;IAC5D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACvD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,UAAU,KAAK,EAAE;QAAE,OAAO,IAAI,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a,CAC3B,WAAmB,EACnB,OAAiB,iBAAiB;IAElC,MAAM,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAC3F,OAAO,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAED,kCAAkC;AAClC,MAAM,UAAU,SAAS,CAAC,OAAiB,iBAAiB;IAC1D,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;AACvD,CAAC;AAED,iCAAiC;AACjC,MAAM,UAAU,QAAQ,CAAC,OAAiB,iBAAiB;IACzD,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC;AACrD,CAAC"}
|
package/dist/scaffold.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGnD,kEAAkE;AAClE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAWtD;AAoBD,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,QAA4B;AAClC,4EAA4E;AAC5E,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAClC,OAAO,CAAC,MAAM,CAAC,CAuQjB"}
|
package/dist/scaffold.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// @oktis-works/cms - Project Scaffolding
|
|
2
2
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
|
-
import { join, resolve } from 'node:path';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
5
5
|
import { defaultProjectConfig, DEFAULT_CONFIG_FILENAME } from './project-config.js';
|
|
6
6
|
import { DEPLOY_GITIGNORE } from './assets.js';
|
|
7
|
+
import { DEFAULT_THEME_FILES } from './theme-assets.js';
|
|
7
8
|
import { writeDeployAssets } from './bluegreen.js';
|
|
8
9
|
import { DEFAULT_DOCS_LANG, docsLangLabel, pluginDoc, projectReadme, themeDoc } from './scaffold-docs.js';
|
|
9
10
|
import { style, symbol } from './prompt.js';
|
|
@@ -68,6 +69,16 @@ beforeSummary) {
|
|
|
68
69
|
await mkdir(join(root, 'themes'), { recursive: true });
|
|
69
70
|
await mkdir(join(root, 'plugins'), { recursive: true });
|
|
70
71
|
await mkdir(join(root, 'migrations'), { recursive: true });
|
|
72
|
+
// Tema default pronto: o projeto novo já renderiza de cara (templates .astro
|
|
73
|
+
// na raiz + dist/theme.css servido direto). Nunca sobrescreve em re-init —
|
|
74
|
+
// o operador pode ter editado o tema.
|
|
75
|
+
for (const [relative, content] of Object.entries(DEFAULT_THEME_FILES)) {
|
|
76
|
+
const target = join(root, 'themes', 'default', relative);
|
|
77
|
+
if (existsSync(target))
|
|
78
|
+
continue;
|
|
79
|
+
await mkdir(dirname(target), { recursive: true });
|
|
80
|
+
await writeFile(target, content, 'utf-8');
|
|
81
|
+
}
|
|
71
82
|
const config = defaultProjectConfig(name);
|
|
72
83
|
await writeFile(join(root, DEFAULT_CONFIG_FILENAME), JSON.stringify(config, null, 2), 'utf-8');
|
|
73
84
|
// package.json do projeto — apps do OkCMS como dependências. O range vem de
|
package/dist/scaffold.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE1G,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5C,kEAAkE;AAClE,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,IAAI,GAAG,IAAI;SACd,WAAW,EAAE;SACb,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC;SAC/B,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACjC,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC;AAClD,CAAC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C,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;IAC7G,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,8BAA8B,CAAC,CAAC,CAAC;IAEpE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,CAAC,CAAC;IAE1H,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,sCAAsC,CAAC,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Manifesto do tema default (manifest.json = nome legado, aceito pelo runtime e pelo service). */
|
|
2
|
+
export declare const DEFAULT_THEME_MANIFEST: string;
|
|
3
|
+
/** Estilos básicos do tema default — servido direto de dist/theme.css (sem build). */
|
|
4
|
+
export declare const DEFAULT_THEME_CSS = "/* Tema default do OkCMS \u2014 estilos b\u00E1sicos (servido direto de dist/theme.css) */\n:root {\n --brand: #4f46e5;\n --text: #1f2937;\n --muted: #6b7280;\n --surface: #ffffff;\n --border: #e5e7eb;\n}\n\n* { box-sizing: border-box; }\n\nbody {\n margin: 0;\n font-family: system-ui, -apple-system, \"Segoe UI\", sans-serif;\n color: var(--text);\n background: var(--surface);\n line-height: 1.6;\n}\n\nmain {\n max-width: 46rem;\n margin: 0 auto;\n padding: 2.5rem 1.5rem;\n}\n\n.hero__title { margin: 0 0 0.5rem; font-size: 2rem; }\n.hero__description { margin: 0 0 2rem; color: var(--muted); }\n\n.listing { display: grid; gap: 1rem; }\n.card { border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; }\n.entry__title { margin: 0 0 0.25rem; font-size: 1.15rem; }\n.entry__title a { color: var(--brand); text-decoration: none; }\n.entry__title a:hover { text-decoration: underline; }\n.entry__excerpt { margin: 0; color: var(--muted); }\n\n.entry__header { margin-bottom: 1.5rem; }\n.entry__cover { max-width: 100%; border-radius: 8px; margin: 1rem 0; }\n.entry__body { font-size: 1.05rem; }\n.entry__date { color: var(--muted); font-size: 0.85rem; }\n\n.not-found__code { margin: 0; font-size: 4rem; color: var(--brand); }\n.not-found__message { color: var(--muted); }\n";
|
|
5
|
+
/**
|
|
6
|
+
* Templates da hierarquia (formato do runtime: `*.astro` NA RAIZ do tema,
|
|
7
|
+
* sintaxe `{{var}}` / `{{{raw}}}` / `{{#each}}` / `{{#if}}`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const THEME_TEMPLATE_FILES: Record<string, string>;
|
|
10
|
+
/** Tema default completo gravado pelo `okcms init` (caminhos relativos a themes/default/). */
|
|
11
|
+
export declare const DEFAULT_THEME_FILES: Record<string, string>;
|
|
12
|
+
//# sourceMappingURL=theme-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-assets.d.ts","sourceRoot":"","sources":["../src/theme-assets.ts"],"names":[],"mappings":"AAMA,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,QAuBlC,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,iBAAiB,kyCA0C7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqHvD,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAItD,CAAC"}
|