@janga/norna 0.7.1 → 0.7.3
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.md +32 -18
- package/astro.config.mjs +2 -0
- package/bin/norna-cli.mjs +175 -0
- package/bin/norna.mjs +149 -150
- package/docs/README.md +41 -22
- package/docs/commands.md +25 -12
- package/docs/configuration.md +38 -135
- package/docs/content.md +108 -265
- package/docs/{command-organization.md → design/command-organization.md} +64 -60
- package/docs/{site-examples-structure-note.md → design/site-examples-structure.md} +19 -24
- package/docs/engine-development.md +35 -7
- package/docs/getting-started.md +55 -26
- package/docs/images-and-metadata.md +1 -1
- package/docs/local-development.md +14 -1
- package/docs/publishing.md +24 -1
- package/docs/routes.md +90 -0
- package/docs/site-structure.md +18 -10
- package/docs/theme.md +292 -0
- package/docs/typography.md +144 -0
- package/examples/dog-gallery/.astro/collections/site.schema.json +802 -0
- package/examples/dog-gallery/.astro/collections/theme.schema.json +714 -0
- package/examples/dog-gallery/.astro/content-assets.mjs +4 -0
- package/examples/dog-gallery/.astro/content-modules.mjs +1 -0
- package/examples/dog-gallery/.astro/content.d.ts +175 -0
- package/examples/dog-gallery/.astro/data-store.json +1 -0
- package/examples/dog-gallery/.astro/dev-local.json +8 -0
- package/examples/dog-gallery/.astro/dev.json +13 -0
- package/examples/dog-gallery/.astro/dev.log +49 -0
- package/examples/dog-gallery/.astro/settings.json +5 -0
- package/examples/dog-gallery/.astro/types.d.ts +2 -0
- package/examples/dog-gallery/dist/_astro/GalleryGrid.astro_astro_type_script_index_0_lang.B0kxDyGz.js +1 -0
- package/examples/dog-gallery/dist/_astro/SitePage.BFHZm5UG.css +1 -0
- package/examples/dog-gallery/dist/dog-care/index.html +15 -0
- package/examples/dog-gallery/dist/favicon.svg +7 -0
- package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-1080.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-1440.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-1536.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-480.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-768.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/black-dogs/photo-of-a-black-dog-5cf614d2-480.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/black-dogs/photo-of-a-black-dog-5cf614d2-768.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/black-dogs/photo-of-a-black-dog-5cf614d2-960.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-1080.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-1440.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-1920.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-3939.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-480.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-768.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-1080.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-1440.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-1920.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-2400.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-480.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-768.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-1080.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-1440.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-1600.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-480.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-768.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-1080.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-1440.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-1920.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-2576.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-480.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-768.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/white-dogs/white-cute-dog-077a0689-1080.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/white-dogs/white-cute-dog-077a0689-1277.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/white-dogs/white-cute-dog-077a0689-480.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/white-dogs/white-cute-dog-077a0689-768.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-1080.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-1440.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-1536.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-480.webp +0 -0
- package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-768.webp +0 -0
- package/examples/dog-gallery/dist/index.html +43 -0
- package/examples/dog-gallery/dist/robots.txt +2 -0
- package/examples/dog-gallery/node_modules/.vite/deps/_metadata.json +74 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro-D_GIpJIE.js +434 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro-D_GIpJIE.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro_n_aria-query.js +6390 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro_n_aria-query.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro_n_axobject-query.js +2702 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro_n_axobject-query.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro_n_html-escaper.js +65 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro_n_html-escaper.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js +455 -0
- package/examples/dog-gallery/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/audit-DM9Hkl5B.js +1534 -0
- package/examples/dog-gallery/node_modules/.vite/deps/audit-DM9Hkl5B.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/highlight-DnZ1ULOL.js +48 -0
- package/examples/dog-gallery/node_modules/.vite/deps/highlight-DnZ1ULOL.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/icons-RyebKi45.js +42 -0
- package/examples/dog-gallery/node_modules/.vite/deps/icons-RyebKi45.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/package.json +3 -0
- package/examples/dog-gallery/node_modules/.vite/deps/rolldown-runtime-BvCyGRYZ.js +4 -0
- package/examples/dog-gallery/node_modules/.vite/deps/settings-DaU-gNnK.js +190 -0
- package/examples/dog-gallery/node_modules/.vite/deps/settings-DaU-gNnK.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/toolbar-63PA619H.js +458 -0
- package/examples/dog-gallery/node_modules/.vite/deps/toolbar-63PA619H.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/ui-library--bkcNSYz.js +1016 -0
- package/examples/dog-gallery/node_modules/.vite/deps/ui-library--bkcNSYz.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/window-jPkpKVcy.js +32 -0
- package/examples/dog-gallery/node_modules/.vite/deps/window-jPkpKVcy.js.map +1 -0
- package/examples/dog-gallery/node_modules/.vite/deps/xray-BXCHpEJP.js +111 -0
- package/examples/dog-gallery/node_modules/.vite/deps/xray-BXCHpEJP.js.map +1 -0
- package/examples/dog-gallery/site/.norna/generated-images.json +226 -0
- package/examples/dog-gallery/site/config.mjs +67 -0
- package/examples/dog-gallery/site/content.md +168 -0
- package/examples/dog-gallery/site/images/black-dogs/black-puppy-meadow.png +0 -0
- package/examples/dog-gallery/site/images/black-dogs/photo-of-a-black-dog.jpg +0 -0
- package/examples/dog-gallery/site/images/brown-dogs/brown-dog.jpg +0 -0
- package/examples/dog-gallery/site/images/brown-dogs/dog-accompanies-master.jpg +0 -0
- package/examples/dog-gallery/site/images/golden-dogs/golden-retriever.jpg +0 -0
- package/examples/dog-gallery/site/images/golden-dogs/toller-puppy.jpg +0 -0
- package/examples/dog-gallery/site/images/white-dogs/white-cute-dog.jpg +0 -0
- package/examples/dog-gallery/site/images/white-dogs/white-puppy-garden.png +0 -0
- package/examples/dog-gallery/site/public/favicon.svg +7 -0
- package/examples/dog-gallery/site/public/robots.txt +2 -0
- package/examples/dog-gallery/site/routes/dog-care/route-content.md +49 -0
- package/examples/dog-gallery/site/theme.md +114 -0
- package/fixtures/basic/site/config.mjs +3 -22
- package/fixtures/basic/site/content.md +1 -1
- package/fixtures/basic/site/theme.md +7 -3
- package/package.json +10 -9
- package/scripts/check-config.mjs +4 -3
- package/scripts/deploy-site.mjs +3 -3
- package/scripts/dev-local.mjs +64 -15
- package/scripts/init-site.mjs +11 -9
- package/scripts/lib/frontmatter-yaml.mjs +85 -0
- package/scripts/lib/presentation.mjs +10 -11
- package/scripts/lib/project-config.mjs +113 -45
- package/scripts/lib/site-content.mjs +21 -2
- package/scripts/lib/site-paths.mjs +18 -3
- package/scripts/lib/theme-config.mjs +34 -0
- package/scripts/lib/typography.mjs +103 -23
- package/scripts/show-typography.mjs +202 -75
- package/scripts/sync-content-sections.mjs +6 -6
- package/scripts/test-cli-discovery.mjs +124 -0
- package/scripts/test-content-check.mjs +3 -4
- package/scripts/test-engine-commands.mjs +20 -6
- package/scripts/test-navigation.mjs +10 -6
- package/scripts/test-package-check.mjs +40 -11
- package/scripts/test-temporary-visibility.mjs +2 -3
- package/src/components/SiteNavigation.astro +7 -5
- package/src/components/SitePage.astro +5 -3
- package/src/components/SiteSection.astro +63 -29
- package/src/content.config.ts +64 -2
- package/src/layouts/BaseLayout.astro +19 -1
- package/src/lib/basePath.ts +21 -0
- package/src/lib/generatedImages.ts +8 -4
- package/src/lib/sectionContent.ts +6 -1
- package/src/lib/sitePublicAssets.ts +8 -1
- package/src/styles/global.css +59 -55
- package/starters/basic/.github/workflows/deploy.yml +3 -3
- package/starters/basic/README.md +30 -14
- package/starters/basic/package.json +3 -3
- package/starters/basic/site/config.mjs +4 -24
- package/starters/basic/site/content.md +44 -9
- package/starters/basic/site/theme.md +113 -16
- package/starters/project/.github/workflows/deploy.yml +65 -0
- package/starters/project/README.md +72 -0
- package/starters/project/package-lock.json +4296 -0
- package/starters/project/package.json +35 -0
- package/starters/project/site/config.mjs +43 -0
- package/starters/project/site/content.md +88 -0
- package/starters/project/site/public/robots.txt +2 -0
- package/starters/project/site/routes/guide/route-content.md +58 -0
- package/starters/project/site/theme.md +15 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Command Organization
|
|
2
2
|
|
|
3
|
-
This document defines the naming principles for commands in `norna`,
|
|
4
|
-
|
|
3
|
+
This document defines the naming principles for commands in `norna`, site
|
|
4
|
+
repositories, and GitHub projects that embed a Norna site.
|
|
5
5
|
|
|
6
6
|
The goal is that command names reveal both the action and the scope they affect.
|
|
7
|
-
This matters because the same repository can contain a
|
|
7
|
+
This matters because the same repository can contain a Norna site, an app, tests,
|
|
8
8
|
and a publishing workflow that should not accidentally share ambiguous command
|
|
9
9
|
names.
|
|
10
10
|
|
|
@@ -12,10 +12,10 @@ names.
|
|
|
12
12
|
|
|
13
13
|
`norna` commands must be understandable in three situations:
|
|
14
14
|
|
|
15
|
-
-
|
|
15
|
+
- Standalone site project: the repository exists only to publish one
|
|
16
16
|
`norna` site.
|
|
17
|
-
- Mixed
|
|
18
|
-
|
|
17
|
+
- Mixed project: the repository contains another project, such as an app or
|
|
18
|
+
library, and includes a Norna site as one part of its
|
|
19
19
|
GitHub Pages output.
|
|
20
20
|
- Engine development: the repository is `norna` itself.
|
|
21
21
|
|
|
@@ -27,7 +27,7 @@ Use these namespaces consistently.
|
|
|
27
27
|
|
|
28
28
|
Use `norna:*` npm scripts in repositories that consume `norna`.
|
|
29
29
|
|
|
30
|
-
These scripts operate on a selected
|
|
30
|
+
These scripts operate on a selected site source directory. In a standalone site
|
|
31
31
|
project that directory is normally `site/`. In a mixed project it may be a more
|
|
32
32
|
specific directory such as `presentation/`, with the script setting
|
|
33
33
|
`NORNA_SITE_DIR` or passing `norna --site-dir`.
|
|
@@ -41,19 +41,19 @@ npm run norna:sync
|
|
|
41
41
|
npm run norna:build
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Mixed projects must use `norna:*` for
|
|
44
|
+
Mixed projects must use `norna:*` for Norna work so names such as `build`,
|
|
45
45
|
`test`, and `deploy` can remain under the containing project's control.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Standalone site projects should also use `norna:*` as the primary documented
|
|
48
48
|
interface. They may provide unprefixed aliases when the alias means the same
|
|
49
49
|
thing for the whole repository, for example `npm run build` as an alias for
|
|
50
50
|
`npm run norna:build`.
|
|
51
51
|
|
|
52
|
-
### Project Commands That Call
|
|
52
|
+
### Project Commands That Call Norna Commands
|
|
53
53
|
|
|
54
54
|
`norna` does not define a consuming project's unprefixed commands. Names
|
|
55
55
|
such as `build`, `test`, and `deploy` belong to the project that consumes the
|
|
56
|
-
|
|
56
|
+
Norna engine.
|
|
57
57
|
|
|
58
58
|
Examples:
|
|
59
59
|
|
|
@@ -63,18 +63,18 @@ npm run test
|
|
|
63
63
|
npm run deploy
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
When those project commands need the
|
|
66
|
+
When those project commands need the Norna site, they should call `norna:*`
|
|
67
67
|
scripts instead of calling `norna` directly. That keeps the selected
|
|
68
|
-
|
|
68
|
+
site source directory and other project-specific wrapper behavior in one
|
|
69
69
|
place.
|
|
70
70
|
|
|
71
71
|
In a mixed project, if `npm run build` exists, it should build the project's
|
|
72
|
-
complete publishable artifact, not only the
|
|
73
|
-
GitHub Pages artifact containing both a
|
|
72
|
+
complete publishable artifact, not only the Norna site. If the project publishes a
|
|
73
|
+
GitHub Pages artifact containing both a Norna site and an app, `build` should
|
|
74
74
|
produce that full artifact and may call `npm run norna:build` internally.
|
|
75
75
|
|
|
76
|
-
In a
|
|
77
|
-
commands because the
|
|
76
|
+
In a standalone site project, project commands may be aliases to `norna:*`
|
|
77
|
+
commands because the Norna site is the whole project.
|
|
78
78
|
|
|
79
79
|
### `release:*`
|
|
80
80
|
|
|
@@ -86,12 +86,15 @@ Examples:
|
|
|
86
86
|
npm run release:patch
|
|
87
87
|
npm run release:minor
|
|
88
88
|
npm run release:major
|
|
89
|
-
npm run release:publish
|
|
90
89
|
```
|
|
91
90
|
|
|
92
|
-
These commands change
|
|
91
|
+
These commands change and publish the reusable `@janga/norna` package.
|
|
93
92
|
They must not be part of ordinary site repositories.
|
|
94
93
|
|
|
94
|
+
`npm run release:publish` is a low-level script used by the release command
|
|
95
|
+
after the version has already been bumped. It is not the normal release entry
|
|
96
|
+
point.
|
|
97
|
+
|
|
95
98
|
### Direct CLI Commands
|
|
96
99
|
|
|
97
100
|
The `norna` binary is the stable low-level command surface.
|
|
@@ -111,19 +114,19 @@ can set the correct site directory for the repository.
|
|
|
111
114
|
|
|
112
115
|
## Functional Groups
|
|
113
116
|
|
|
114
|
-
### Install
|
|
117
|
+
### Install Norna Software
|
|
115
118
|
|
|
116
|
-
Creating a new
|
|
119
|
+
Creating a new standalone site project starts outside the target project because
|
|
117
120
|
the target does not have a `package.json` yet:
|
|
118
121
|
|
|
119
122
|
```sh
|
|
120
|
-
npx @janga/norna@latest init my-
|
|
121
|
-
cd my-
|
|
123
|
+
npx @janga/norna@latest init my-site
|
|
124
|
+
cd my-site
|
|
122
125
|
npm install
|
|
123
126
|
```
|
|
124
127
|
|
|
125
128
|
A mixed project already has its own repository and may have its own
|
|
126
|
-
`package.json`. In that situation the
|
|
129
|
+
`package.json`. In that situation the Norna dependency should be installed as
|
|
127
130
|
part of the existing project setup:
|
|
128
131
|
|
|
129
132
|
```sh
|
|
@@ -131,7 +134,7 @@ npm install --save-exact @janga/norna
|
|
|
131
134
|
```
|
|
132
135
|
|
|
133
136
|
The mixed project should then add `norna:*` scripts that point at the chosen
|
|
134
|
-
|
|
137
|
+
site source directory.
|
|
135
138
|
|
|
136
139
|
Engine development uses ordinary package installation in the engine repository:
|
|
137
140
|
|
|
@@ -139,9 +142,9 @@ Engine development uses ordinary package installation in the engine repository:
|
|
|
139
142
|
npm install
|
|
140
143
|
```
|
|
141
144
|
|
|
142
|
-
### Upgrade Or Inspect
|
|
145
|
+
### Upgrade Or Inspect Norna Software
|
|
143
146
|
|
|
144
|
-
In a consuming repository, upgrading or inspecting the installed
|
|
147
|
+
In a consuming repository, upgrading or inspecting the installed Norna engine
|
|
145
148
|
is norna maintenance, so the preferred namespace is `norna:*`:
|
|
146
149
|
|
|
147
150
|
```sh
|
|
@@ -157,16 +160,15 @@ In the engine repository, version changes belong to `release:*`:
|
|
|
157
160
|
|
|
158
161
|
```sh
|
|
159
162
|
npm run release:minor
|
|
160
|
-
npm run release:publish
|
|
161
163
|
```
|
|
162
164
|
|
|
163
|
-
### Initialize A
|
|
165
|
+
### Initialize A Site Project Directory
|
|
164
166
|
|
|
165
167
|
Initialization is a direct CLI operation because it usually happens before a
|
|
166
168
|
project has npm scripts:
|
|
167
169
|
|
|
168
170
|
```sh
|
|
169
|
-
npx @janga/norna@latest init my-
|
|
171
|
+
npx @janga/norna@latest init my-site
|
|
170
172
|
```
|
|
171
173
|
|
|
172
174
|
The initializer should support two setup modes that share the same `norna:*`
|
|
@@ -174,25 +176,25 @@ command vocabulary.
|
|
|
174
176
|
|
|
175
177
|
#### Pure Setup
|
|
176
178
|
|
|
177
|
-
Pure setup creates a new project where the
|
|
179
|
+
Pure setup creates a new project where the Norna site is the whole repository:
|
|
178
180
|
|
|
179
181
|
```sh
|
|
180
|
-
npx @janga/norna@latest init my-
|
|
182
|
+
npx @janga/norna@latest init my-site --type pure
|
|
181
183
|
```
|
|
182
184
|
|
|
183
185
|
This should be the default when the target is a new or empty directory.
|
|
184
186
|
|
|
185
187
|
Pure setup should create:
|
|
186
188
|
|
|
187
|
-
- a normal
|
|
189
|
+
- a normal site source directory, normally `site/`;
|
|
188
190
|
- a `package.json` with `norna:*` scripts;
|
|
189
191
|
- unprefixed convenience aliases only when they mean the same thing as the
|
|
190
192
|
whole project, for example `build` as an alias for `norna:build`;
|
|
191
|
-
- the standard GitHub Pages workflow for publishing the
|
|
193
|
+
- the standard GitHub Pages workflow for publishing the site.
|
|
192
194
|
|
|
193
195
|
#### Embedded Setup
|
|
194
196
|
|
|
195
|
-
Embedded setup adds a
|
|
197
|
+
Embedded setup adds a Norna site to an existing project without taking ownership
|
|
196
198
|
of that project's root commands:
|
|
197
199
|
|
|
198
200
|
```sh
|
|
@@ -202,9 +204,9 @@ npx @janga/norna@latest init . --type embedded --site-dir presentation
|
|
|
202
204
|
Embedded setup should be selected explicitly, or suggested when the target
|
|
203
205
|
already contains a `package.json`.
|
|
204
206
|
|
|
205
|
-
Embedded setup should create or update only the
|
|
207
|
+
Embedded setup should create or update only the Norna-owned parts:
|
|
206
208
|
|
|
207
|
-
- the chosen
|
|
209
|
+
- the chosen site source directory, for example `presentation/`;
|
|
208
210
|
- `@janga/norna` as a project dependency;
|
|
209
211
|
- `norna:*` scripts that set the selected site directory;
|
|
210
212
|
- no unprefixed aliases such as `build`, `test`, `dev`, or `deploy`;
|
|
@@ -231,7 +233,7 @@ npm run norna:dev:stop
|
|
|
231
233
|
The shorter `norna:dev` starts the normal local server. Subcommands manage
|
|
232
234
|
the same server.
|
|
233
235
|
|
|
234
|
-
In the engine repository, engine
|
|
236
|
+
In the engine repository, engine and example development may use the engine's own
|
|
235
237
|
unprefixed commands:
|
|
236
238
|
|
|
237
239
|
```sh
|
|
@@ -261,11 +263,11 @@ npm run test
|
|
|
261
263
|
|
|
262
264
|
If a mixed project defines `test`, that command should cover the whole project.
|
|
263
265
|
It may call `norna:check`, but it should not be a hidden synonym for only
|
|
264
|
-
|
|
266
|
+
Norna validation.
|
|
265
267
|
|
|
266
|
-
### Inspect
|
|
268
|
+
### Inspect Site Presentation
|
|
267
269
|
|
|
268
|
-
Commands that inspect
|
|
270
|
+
Commands that inspect site presentation without changing source files use
|
|
269
271
|
`norna:*` in consuming repositories:
|
|
270
272
|
|
|
271
273
|
```sh
|
|
@@ -275,11 +277,11 @@ npm run norna:typography:show
|
|
|
275
277
|
|
|
276
278
|
`norna:typography:presets` shows the built-in typography presets from the
|
|
277
279
|
installed engine. `norna:typography:show` shows the effective typography for
|
|
278
|
-
the selected
|
|
280
|
+
the selected site after presets and overrides have been applied.
|
|
279
281
|
|
|
280
282
|
### Correct Content And Configuration
|
|
281
283
|
|
|
282
|
-
Commands that modify
|
|
284
|
+
Commands that modify Norna-owned source files use `norna:*`:
|
|
283
285
|
|
|
284
286
|
```sh
|
|
285
287
|
npm run norna:sync
|
|
@@ -291,7 +293,7 @@ npm run norna:images
|
|
|
291
293
|
Messages emitted by the engine should mention the direct CLI command and the
|
|
292
294
|
starter-style npm wrapper when suggesting a fix.
|
|
293
295
|
|
|
294
|
-
Configuration edits are normally manual edits to the selected
|
|
296
|
+
Configuration edits are normally manual edits to the selected site
|
|
295
297
|
`config.mjs`, followed by:
|
|
296
298
|
|
|
297
299
|
```sh
|
|
@@ -300,7 +302,7 @@ npm run norna:config:check
|
|
|
300
302
|
|
|
301
303
|
### Build
|
|
302
304
|
|
|
303
|
-
In a
|
|
305
|
+
In a standalone site project:
|
|
304
306
|
|
|
305
307
|
```sh
|
|
306
308
|
npm run norna:build
|
|
@@ -309,7 +311,7 @@ npm run build
|
|
|
309
311
|
```
|
|
310
312
|
|
|
311
313
|
`norna:build:local` builds and restarts the local dev server. `build` may
|
|
312
|
-
alias `norna:build` because the
|
|
314
|
+
alias `norna:build` because the Norna site is the whole project.
|
|
313
315
|
|
|
314
316
|
In a mixed project:
|
|
315
317
|
|
|
@@ -319,10 +321,10 @@ npm run norna:build:local
|
|
|
319
321
|
npm run build
|
|
320
322
|
```
|
|
321
323
|
|
|
322
|
-
`norna:build` builds only the
|
|
323
|
-
|
|
324
|
+
`norna:build` builds only the Norna site. `norna:build:local` builds the
|
|
325
|
+
site and restarts the local Norna dev server. If the mixed project defines
|
|
324
326
|
`build`, that project command should build the complete publishable artifact,
|
|
325
|
-
such as a GitHub Pages output that combines the
|
|
327
|
+
such as a GitHub Pages output that combines the Norna site with an app. It may call
|
|
326
328
|
`norna:build` internally.
|
|
327
329
|
|
|
328
330
|
In the engine repository:
|
|
@@ -345,8 +347,8 @@ npm run norna:deploy
|
|
|
345
347
|
npm run norna:deploy:commit
|
|
346
348
|
```
|
|
347
349
|
|
|
348
|
-
Use these only when the
|
|
349
|
-
project deliberately delegates deployment to the
|
|
350
|
+
Use these only when the Norna site is the deployable site or when the containing
|
|
351
|
+
project deliberately delegates deployment to the Norna engine.
|
|
350
352
|
|
|
351
353
|
Mixed projects may instead have project-owned deploy commands:
|
|
352
354
|
|
|
@@ -355,24 +357,26 @@ npm run deploy
|
|
|
355
357
|
```
|
|
356
358
|
|
|
357
359
|
Those commands should publish the complete project artifact. If they need the
|
|
358
|
-
|
|
360
|
+
Norna site, they should call `norna:*` scripts internally.
|
|
359
361
|
|
|
360
362
|
Engine publishing uses `release:*`, not `norna:*`:
|
|
361
363
|
|
|
362
364
|
```sh
|
|
363
|
-
npm run release:
|
|
365
|
+
npm run release:patch
|
|
366
|
+
npm run release:minor
|
|
367
|
+
npm run release:major
|
|
364
368
|
```
|
|
365
369
|
|
|
366
370
|
### Monitor Publishing
|
|
367
371
|
|
|
368
|
-
|
|
372
|
+
GitHub Pages monitoring for a Norna site belongs under:
|
|
369
373
|
|
|
370
374
|
```sh
|
|
371
375
|
npm run norna:deploy:watch
|
|
372
376
|
```
|
|
373
377
|
|
|
374
378
|
Mixed projects may provide a project-owned monitoring command when monitoring
|
|
375
|
-
is not specific to the
|
|
379
|
+
is not specific to the Norna site:
|
|
376
380
|
|
|
377
381
|
```sh
|
|
378
382
|
npm run deploy:watch
|
|
@@ -384,19 +388,19 @@ norna-specific deploy settings, it should call `norna:deploy:watch`.
|
|
|
384
388
|
## Naming Rules
|
|
385
389
|
|
|
386
390
|
- Use `norna:*` for every npm script in a consuming repository whose direct
|
|
387
|
-
object is the
|
|
391
|
+
object is the Norna site, its source files, its generated images, its dev server,
|
|
388
392
|
or its engine dependency.
|
|
389
393
|
- `norna` does not define unprefixed project commands such as `build`,
|
|
390
394
|
`test`, and `deploy` in consuming repositories.
|
|
391
|
-
- If project commands need
|
|
395
|
+
- If project commands need Norna behavior, they should call `norna:*`
|
|
392
396
|
scripts.
|
|
393
|
-
- In
|
|
397
|
+
- In standalone site projects, unprefixed project commands may alias `norna:*`
|
|
394
398
|
commands.
|
|
395
399
|
- In mixed projects, unprefixed project commands must not be aliases for only
|
|
396
|
-
the
|
|
400
|
+
the Norna site unless the command name makes that scope explicit.
|
|
397
401
|
- Use `release:*` only for publishing the reusable engine package.
|
|
398
402
|
- Prefer direct `norna ...` commands in engine docs and diagnostics;
|
|
399
403
|
prefer npm scripts in site-repository docs.
|
|
400
404
|
- Do not create separate namespaces for every internal concept. If a command is
|
|
401
|
-
about maintaining the
|
|
405
|
+
about maintaining the Norna dependency in a consuming repository, keep it
|
|
402
406
|
under `norna:*`.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
# Site Examples Structure
|
|
1
|
+
# Site Examples Structure
|
|
2
2
|
|
|
3
|
-
This
|
|
4
|
-
|
|
5
|
-
note, not an implementation record.
|
|
3
|
+
This document defines the repository vocabulary for starter files, example
|
|
4
|
+
sites, fixtures, and documentation sites.
|
|
6
5
|
|
|
7
6
|
## Goal
|
|
8
7
|
|
|
@@ -10,8 +9,8 @@ note, not an implementation record.
|
|
|
10
9
|
files are product documentation, which files are examples, and which files are
|
|
11
10
|
test fixtures.
|
|
12
11
|
|
|
13
|
-
The
|
|
14
|
-
|
|
12
|
+
The repository grew from one local demo, one starter, and a set of tests. The
|
|
13
|
+
current structure keeps those roles separate.
|
|
15
14
|
|
|
16
15
|
## Terms
|
|
17
16
|
|
|
@@ -57,30 +56,31 @@ for human reading or visual appeal.
|
|
|
57
56
|
|
|
58
57
|
## Intended Direction
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
example:
|
|
59
|
+
Runnable site examples are collected under `examples/`:
|
|
62
60
|
|
|
63
61
|
```text
|
|
64
|
-
|
|
65
|
-
starter-basic/
|
|
62
|
+
examples/
|
|
66
63
|
dog-gallery/
|
|
67
64
|
routes-demo/
|
|
68
65
|
typography-demo/
|
|
69
|
-
docs-site/
|
|
70
66
|
```
|
|
71
67
|
|
|
72
|
-
|
|
68
|
+
Only `dog-gallery/` exists today. Additional examples should be added when
|
|
69
|
+
they demonstrate a distinct feature or workflow.
|
|
73
70
|
|
|
74
|
-
- `
|
|
75
|
-
|
|
76
|
-
- `routes-demo/`: focused route/navigation example if dog
|
|
77
|
-
broad.
|
|
71
|
+
- `dog-gallery/`: current local visual demo, manual inspection site, and
|
|
72
|
+
navigation diagnostic target.
|
|
73
|
+
- `routes-demo/`: focused route/navigation example if the dog example becomes
|
|
74
|
+
too broad.
|
|
78
75
|
- `typography-demo/`: focused typography preset and override example if needed.
|
|
79
|
-
- `docs-site/`: visual documentation built with `norna`.
|
|
80
76
|
|
|
77
|
+
The repository-local `site/` directory is reserved for the documentation site.
|
|
81
78
|
`docs/` should remain for reference documentation. It should link to the
|
|
82
79
|
documentation site when visual explanation is more useful than reference text.
|
|
83
80
|
|
|
81
|
+
`starters/basic/` stays separate from examples because it is copied by
|
|
82
|
+
`norna init`. It should stay small and conservative.
|
|
83
|
+
|
|
84
84
|
Fixtures may either stay under `fixtures/` or move under a clearly named test
|
|
85
85
|
area later. They should not be confused with examples.
|
|
86
86
|
|
|
@@ -94,12 +94,7 @@ area later. They should not be confused with examples.
|
|
|
94
94
|
|
|
95
95
|
## Open Decisions
|
|
96
96
|
|
|
97
|
-
- Exact top-level directory name: `sites/`, `examples/`, or another name.
|
|
98
|
-
- Whether `starter-basic/` belongs beside examples or in a separate template
|
|
99
|
-
area.
|
|
100
|
-
- Whether the current dog-gallery remains the primary manual test site or
|
|
101
|
-
becomes one example among several.
|
|
102
97
|
- Whether the documentation site should be published anywhere, or exist only as
|
|
103
98
|
a local/example build.
|
|
104
|
-
- How
|
|
105
|
-
|
|
99
|
+
- How local example selection should work when there are multiple runnable
|
|
100
|
+
examples.
|
|
@@ -4,7 +4,8 @@ This document is for work on the reusable `norna` package itself.
|
|
|
4
4
|
|
|
5
5
|
## Main Areas
|
|
6
6
|
|
|
7
|
-
- `bin/norna.mjs`: public CLI
|
|
7
|
+
- `bin/norna.mjs`: public CLI launcher and local-version resolver.
|
|
8
|
+
- `bin/norna-cli.mjs`: public CLI command dispatcher.
|
|
8
9
|
- `scripts/lib/site-paths.mjs`: engine/site path resolution.
|
|
9
10
|
- `scripts/lib/project-config.mjs`: `site/config.mjs` validation and defaults.
|
|
10
11
|
- `scripts/sync-content-sections.mjs`: content validation and sync behavior.
|
|
@@ -13,14 +14,17 @@ This document is for work on the reusable `norna` package itself.
|
|
|
13
14
|
- `scripts/deploy-site.mjs`: deploy and deploy:commit behavior.
|
|
14
15
|
- `scripts/watch-pages-deploy.mjs`: GitHub Pages workflow monitor.
|
|
15
16
|
- `src/content.config.ts`: Astro content schema.
|
|
16
|
-
- `src/components/` and `src/layouts/`: rendered page, navigation,
|
|
17
|
-
layout.
|
|
17
|
+
- `src/components/` and `src/layouts/`: rendered page, navigation, image rows,
|
|
18
|
+
and layout.
|
|
18
19
|
- `tests/`: Playwright navigation diagnostics.
|
|
19
20
|
- `fixtures/basic/site/`: minimal site used for engine checks.
|
|
20
21
|
- `starters/basic/`: copyable site starter.
|
|
22
|
+
- `examples/dog-gallery/site/`: visual dog example used by demo builds and
|
|
23
|
+
navigation diagnostics.
|
|
21
24
|
|
|
22
|
-
The repository-local `site/` directory is
|
|
23
|
-
|
|
25
|
+
The repository-local `site/` directory is reserved for a local documentation
|
|
26
|
+
site. It is useful for dogfooding `norna` documentation, but it is not the
|
|
27
|
+
primary visual regression demo.
|
|
24
28
|
|
|
25
29
|
## Common Checks
|
|
26
30
|
|
|
@@ -34,7 +38,24 @@ npm run demo:build
|
|
|
34
38
|
npm run package:check
|
|
35
39
|
```
|
|
36
40
|
|
|
37
|
-
`npm run test` runs the
|
|
41
|
+
`npm run test` runs the standard non-demo check sequence.
|
|
42
|
+
|
|
43
|
+
The root `site/` directory is the documentation site. Use the ordinary local
|
|
44
|
+
commands for it:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npm run dev:local
|
|
48
|
+
npm run build
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The dog example remains the visual demo and navigation diagnostic target:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
cd examples/dog-gallery/site
|
|
55
|
+
node ../../../bin/norna.mjs dev:local
|
|
56
|
+
cd ../../..
|
|
57
|
+
npm run demo:build
|
|
58
|
+
```
|
|
38
59
|
|
|
39
60
|
Navigation diagnostics are separate because they use Playwright:
|
|
40
61
|
|
|
@@ -92,11 +113,18 @@ npm run norna:engine:update -- <version>
|
|
|
92
113
|
Commit the resulting `package.json` and `package-lock.json` changes in the
|
|
93
114
|
site repository after the site's normal checks pass.
|
|
94
115
|
|
|
116
|
+
The installed `norna` command is created from the package `bin` field. The
|
|
117
|
+
launcher first looks for the nearest project `package.json`. If that project
|
|
118
|
+
declares `@janga/norna` and Node can resolve an installed copy from that project
|
|
119
|
+
root, the launcher delegates to that local entrypoint. The engine repository
|
|
120
|
+
itself is excluded from delegation so local engine development keeps using the
|
|
121
|
+
working tree entrypoint.
|
|
122
|
+
|
|
95
123
|
## npm Release
|
|
96
124
|
|
|
97
125
|
The npm package is published under the `@janga` scope. Choose the release type
|
|
98
126
|
when starting a release; the command requires a clean working tree, verifies npm
|
|
99
|
-
registry authentication for the same registry/cache used by
|
|
127
|
+
registry authentication for the same registry/cache used by the publish step,
|
|
100
128
|
runs `npm test`, requires a clean working tree after the checks, updates
|
|
101
129
|
`package.json` and `package-lock.json`, creates the release commit and Git tag,
|
|
102
130
|
publishes to npm, then pushes the commit and tag.
|
package/docs/getting-started.md
CHANGED
|
@@ -23,12 +23,17 @@ new site directory:
|
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
25
|
cd path/to/your/projects
|
|
26
|
-
npx @janga/norna@latest init my-
|
|
27
|
-
cd my-
|
|
26
|
+
npx @janga/norna@latest init my-site
|
|
27
|
+
cd my-site
|
|
28
28
|
npm install
|
|
29
|
-
npm run
|
|
29
|
+
npm run dev
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
After `npm install`, the project's npm scripts use the project-local `norna`
|
|
33
|
+
binary from `node_modules/.bin`. A globally installed `norna` can also be used
|
|
34
|
+
as a convenience launcher; inside a project with an installed `@janga/norna`
|
|
35
|
+
dependency, it delegates to the project's local version.
|
|
36
|
+
|
|
32
37
|
A freshly created empty directory is not a `norna` site yet. It becomes a
|
|
33
38
|
site when `init` copies the starter files, including `package.json`. If you run
|
|
34
39
|
`npm install` in an empty directory, npm may walk up to a parent directory and
|
|
@@ -40,7 +45,7 @@ engine repository. For example:
|
|
|
40
45
|
```text
|
|
41
46
|
Projects/
|
|
42
47
|
norna/
|
|
43
|
-
my-
|
|
48
|
+
my-site/
|
|
44
49
|
```
|
|
45
50
|
|
|
46
51
|
The starter contains:
|
|
@@ -57,12 +62,13 @@ Commit the generated `package-lock.json` after the first install.
|
|
|
57
62
|
|
|
58
63
|
## First Edits
|
|
59
64
|
|
|
60
|
-
1. Edit `site/config.mjs` for the site's URL,
|
|
61
|
-
|
|
62
|
-
2. Edit `site/theme.md` for site-wide
|
|
63
|
-
and frame colors, or omit it
|
|
65
|
+
1. Edit `site/config.mjs` for the site's URL, language labels, GitHub
|
|
66
|
+
repository, footer, and deploy settings.
|
|
67
|
+
2. Edit `site/theme.md` for site-wide layout, vertical spacing, image sizing,
|
|
68
|
+
font, typography preset, colors, inline styles, and frame colors, or omit it
|
|
69
|
+
to use engine defaults.
|
|
64
70
|
3. Edit `site/content.md` for homepage title, description, sections, text,
|
|
65
|
-
|
|
71
|
+
image rows, page/section presentation overrides, alt text, and captions.
|
|
66
72
|
4. Put source images under `site/images/<section-id>/`.
|
|
67
73
|
5. Add optional route pages under
|
|
68
74
|
`site/routes/<route-folder>/route-content.md`.
|
|
@@ -75,22 +81,45 @@ npm run norna:check
|
|
|
75
81
|
npm run build
|
|
76
82
|
```
|
|
77
83
|
|
|
78
|
-
|
|
84
|
+
## Configure The Public URL
|
|
85
|
+
|
|
86
|
+
For a custom domain or any site published at the web root, use:
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
site: {
|
|
90
|
+
url: 'https://example.com/',
|
|
91
|
+
basePath: '/',
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For a GitHub Pages project site without a custom domain, the site is served
|
|
96
|
+
under the repository name. Configure both values:
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
site: {
|
|
100
|
+
url: 'https://owner.github.io/repository-name/',
|
|
101
|
+
basePath: '/repository-name/',
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
After that, content files may still use root-style internal links such as
|
|
106
|
+
`/getting-started/` and `/workflow.svg`. Norna applies `site.basePath` during
|
|
107
|
+
rendering so the built links work under the GitHub Pages project path.
|
|
108
|
+
|
|
109
|
+
The starter includes a GitHub Pages workflow in `.github/workflows/deploy.yml`.
|
|
110
|
+
In the GitHub repository settings, configure Pages to build from GitHub
|
|
111
|
+
Actions.
|
|
112
|
+
|
|
113
|
+
Read [Site Structure](site-structure.md), [Content](content.md),
|
|
114
|
+
[Theme](theme.md), [Typography](typography.md), [Routes](routes.md), and
|
|
79
115
|
[Configuration](configuration.md) before publishing a real site.
|
|
80
116
|
|
|
81
|
-
To change the site's maximum page width,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
accepted format and default value.
|
|
91
|
-
|
|
92
|
-
To change the site-wide typography preset, edit `site/theme.md`. To change one
|
|
93
|
-
page or section, add a focused `presentation.typography` override in
|
|
94
|
-
`site/content.md`. Use `npm run norna:typography:presets` to inspect the
|
|
95
|
-
installed preset values and `npm run norna:typography:show` to inspect the
|
|
96
|
-
resolved typography for the selected site.
|
|
117
|
+
To change the site's maximum page width, side gutters, vertical spacing, image
|
|
118
|
+
width, image height limits, font, colors, or site-wide typography preset, edit
|
|
119
|
+
`site/theme.md`. See [Theme](theme.md) for the accepted shape.
|
|
120
|
+
|
|
121
|
+
To change one page or section, add a focused `presentation.typography`
|
|
122
|
+
override in `site/content.md`. See [Typography](typography.md). Use
|
|
123
|
+
`norna typography presets` to inspect the installed preset values and
|
|
124
|
+
`norna typography show` to inspect the resolved typography for the selected
|
|
125
|
+
site.
|
|
@@ -15,7 +15,7 @@ Supported source extensions:
|
|
|
15
15
|
- `.png`
|
|
16
16
|
|
|
17
17
|
Image filenames must be globally unique under `site/images/`. The content and
|
|
18
|
-
image scripts reject duplicate filenames because
|
|
18
|
+
image scripts reject duplicate filenames because image rows identify images by
|
|
19
19
|
filename only.
|
|
20
20
|
|
|
21
21
|
## Generated Variants
|
|
@@ -5,7 +5,7 @@ Use the local preview commands when editing a site or the engine demo.
|
|
|
5
5
|
## Start Preview
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm run
|
|
8
|
+
npm run dev
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
The wrapper:
|
|
@@ -24,6 +24,19 @@ localhost:4321
|
|
|
24
24
|
If the port is already in use, the command fails and asks you to stop the
|
|
25
25
|
process using it.
|
|
26
26
|
|
|
27
|
+
To stop any process that is blocking the standard port before starting, pass
|
|
28
|
+
`--kill`:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm run dev -- --kill
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For the pure starter's `dev` alias, use:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
npm run dev -- --kill
|
|
38
|
+
```
|
|
39
|
+
|
|
27
40
|
## Test On A Phone
|
|
28
41
|
|
|
29
42
|
To make the local dev server available to devices on the same Wi-Fi network:
|