@janga/norna 0.7.2 → 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.
Files changed (145) hide show
  1. package/README.md +16 -16
  2. package/bin/norna-cli.mjs +12 -7
  3. package/docs/README.md +10 -11
  4. package/docs/commands.md +8 -8
  5. package/docs/configuration.md +13 -145
  6. package/docs/content.md +17 -15
  7. package/docs/design/command-organization.md +55 -55
  8. package/docs/design/site-examples-structure.md +2 -2
  9. package/docs/engine-development.md +5 -5
  10. package/docs/getting-started.md +19 -26
  11. package/docs/images-and-metadata.md +1 -1
  12. package/docs/local-development.md +2 -2
  13. package/docs/publishing.md +1 -1
  14. package/docs/routes.md +2 -2
  15. package/docs/site-structure.md +8 -7
  16. package/docs/theme.md +149 -7
  17. package/docs/typography.md +47 -28
  18. package/examples/dog-gallery/.astro/collections/site.schema.json +802 -0
  19. package/examples/dog-gallery/.astro/collections/theme.schema.json +714 -0
  20. package/examples/dog-gallery/.astro/content-assets.mjs +4 -0
  21. package/examples/dog-gallery/.astro/content-modules.mjs +1 -0
  22. package/examples/dog-gallery/.astro/content.d.ts +175 -0
  23. package/examples/dog-gallery/.astro/data-store.json +1 -0
  24. package/examples/dog-gallery/.astro/dev-local.json +8 -0
  25. package/examples/dog-gallery/.astro/dev.json +13 -0
  26. package/examples/dog-gallery/.astro/dev.log +49 -0
  27. package/examples/dog-gallery/.astro/settings.json +5 -0
  28. package/examples/dog-gallery/.astro/types.d.ts +2 -0
  29. package/examples/dog-gallery/dist/_astro/GalleryGrid.astro_astro_type_script_index_0_lang.B0kxDyGz.js +1 -0
  30. package/examples/dog-gallery/dist/_astro/SitePage.BFHZm5UG.css +1 -0
  31. package/examples/dog-gallery/dist/dog-care/index.html +15 -0
  32. package/examples/dog-gallery/dist/favicon.svg +7 -0
  33. package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-1080.webp +0 -0
  34. package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-1440.webp +0 -0
  35. package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-1536.webp +0 -0
  36. package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-480.webp +0 -0
  37. package/examples/dog-gallery/dist/images/generated/black-dogs/black-puppy-meadow-7255e3d9-768.webp +0 -0
  38. package/examples/dog-gallery/dist/images/generated/black-dogs/photo-of-a-black-dog-5cf614d2-480.webp +0 -0
  39. package/examples/dog-gallery/dist/images/generated/black-dogs/photo-of-a-black-dog-5cf614d2-768.webp +0 -0
  40. package/examples/dog-gallery/dist/images/generated/black-dogs/photo-of-a-black-dog-5cf614d2-960.webp +0 -0
  41. package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-1080.webp +0 -0
  42. package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-1440.webp +0 -0
  43. package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-1920.webp +0 -0
  44. package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-3939.webp +0 -0
  45. package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-480.webp +0 -0
  46. package/examples/dog-gallery/dist/images/generated/brown-dogs/brown-dog-50ef114e-768.webp +0 -0
  47. package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-1080.webp +0 -0
  48. package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-1440.webp +0 -0
  49. package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-1920.webp +0 -0
  50. package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-2400.webp +0 -0
  51. package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-480.webp +0 -0
  52. package/examples/dog-gallery/dist/images/generated/brown-dogs/dog-accompanies-master-7ef804d5-768.webp +0 -0
  53. package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-1080.webp +0 -0
  54. package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-1440.webp +0 -0
  55. package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-1600.webp +0 -0
  56. package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-480.webp +0 -0
  57. package/examples/dog-gallery/dist/images/generated/golden-dogs/golden-retriever-f797fd88-768.webp +0 -0
  58. package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-1080.webp +0 -0
  59. package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-1440.webp +0 -0
  60. package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-1920.webp +0 -0
  61. package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-2576.webp +0 -0
  62. package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-480.webp +0 -0
  63. package/examples/dog-gallery/dist/images/generated/golden-dogs/toller-puppy-a2a8fbc0-768.webp +0 -0
  64. package/examples/dog-gallery/dist/images/generated/white-dogs/white-cute-dog-077a0689-1080.webp +0 -0
  65. package/examples/dog-gallery/dist/images/generated/white-dogs/white-cute-dog-077a0689-1277.webp +0 -0
  66. package/examples/dog-gallery/dist/images/generated/white-dogs/white-cute-dog-077a0689-480.webp +0 -0
  67. package/examples/dog-gallery/dist/images/generated/white-dogs/white-cute-dog-077a0689-768.webp +0 -0
  68. package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-1080.webp +0 -0
  69. package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-1440.webp +0 -0
  70. package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-1536.webp +0 -0
  71. package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-480.webp +0 -0
  72. package/examples/dog-gallery/dist/images/generated/white-dogs/white-puppy-garden-d3ab2ca0-768.webp +0 -0
  73. package/examples/dog-gallery/dist/index.html +43 -0
  74. package/examples/dog-gallery/dist/robots.txt +2 -0
  75. package/examples/dog-gallery/node_modules/.vite/deps/_metadata.json +74 -0
  76. package/examples/dog-gallery/node_modules/.vite/deps/astro-D_GIpJIE.js +434 -0
  77. package/examples/dog-gallery/node_modules/.vite/deps/astro-D_GIpJIE.js.map +1 -0
  78. package/examples/dog-gallery/node_modules/.vite/deps/astro_n_aria-query.js +6390 -0
  79. package/examples/dog-gallery/node_modules/.vite/deps/astro_n_aria-query.js.map +1 -0
  80. package/examples/dog-gallery/node_modules/.vite/deps/astro_n_axobject-query.js +2702 -0
  81. package/examples/dog-gallery/node_modules/.vite/deps/astro_n_axobject-query.js.map +1 -0
  82. package/examples/dog-gallery/node_modules/.vite/deps/astro_n_html-escaper.js +65 -0
  83. package/examples/dog-gallery/node_modules/.vite/deps/astro_n_html-escaper.js.map +1 -0
  84. package/examples/dog-gallery/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js +455 -0
  85. package/examples/dog-gallery/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js.map +1 -0
  86. package/examples/dog-gallery/node_modules/.vite/deps/audit-DM9Hkl5B.js +1534 -0
  87. package/examples/dog-gallery/node_modules/.vite/deps/audit-DM9Hkl5B.js.map +1 -0
  88. package/examples/dog-gallery/node_modules/.vite/deps/highlight-DnZ1ULOL.js +48 -0
  89. package/examples/dog-gallery/node_modules/.vite/deps/highlight-DnZ1ULOL.js.map +1 -0
  90. package/examples/dog-gallery/node_modules/.vite/deps/icons-RyebKi45.js +42 -0
  91. package/examples/dog-gallery/node_modules/.vite/deps/icons-RyebKi45.js.map +1 -0
  92. package/examples/dog-gallery/node_modules/.vite/deps/package.json +3 -0
  93. package/examples/dog-gallery/node_modules/.vite/deps/rolldown-runtime-BvCyGRYZ.js +4 -0
  94. package/examples/dog-gallery/node_modules/.vite/deps/settings-DaU-gNnK.js +190 -0
  95. package/examples/dog-gallery/node_modules/.vite/deps/settings-DaU-gNnK.js.map +1 -0
  96. package/examples/dog-gallery/node_modules/.vite/deps/toolbar-63PA619H.js +458 -0
  97. package/examples/dog-gallery/node_modules/.vite/deps/toolbar-63PA619H.js.map +1 -0
  98. package/examples/dog-gallery/node_modules/.vite/deps/ui-library--bkcNSYz.js +1016 -0
  99. package/examples/dog-gallery/node_modules/.vite/deps/ui-library--bkcNSYz.js.map +1 -0
  100. package/examples/dog-gallery/node_modules/.vite/deps/window-jPkpKVcy.js +32 -0
  101. package/examples/dog-gallery/node_modules/.vite/deps/window-jPkpKVcy.js.map +1 -0
  102. package/examples/dog-gallery/node_modules/.vite/deps/xray-BXCHpEJP.js +111 -0
  103. package/examples/dog-gallery/node_modules/.vite/deps/xray-BXCHpEJP.js.map +1 -0
  104. package/examples/dog-gallery/site/config.mjs +12 -42
  105. package/examples/dog-gallery/site/content.md +27 -5
  106. package/examples/dog-gallery/site/routes/dog-care/route-content.md +17 -3
  107. package/examples/dog-gallery/site/theme.md +85 -26
  108. package/fixtures/basic/site/config.mjs +2 -22
  109. package/fixtures/basic/site/content.md +1 -1
  110. package/fixtures/basic/site/theme.md +7 -3
  111. package/package.json +3 -3
  112. package/scripts/check-config.mjs +3 -3
  113. package/scripts/deploy-site.mjs +3 -3
  114. package/scripts/init-site.mjs +10 -8
  115. package/scripts/lib/frontmatter-yaml.mjs +85 -0
  116. package/scripts/lib/presentation.mjs +10 -11
  117. package/scripts/lib/project-config.mjs +91 -45
  118. package/scripts/lib/site-content.mjs +20 -2
  119. package/scripts/lib/theme-config.mjs +34 -0
  120. package/scripts/lib/typography.mjs +100 -20
  121. package/scripts/show-typography.mjs +58 -154
  122. package/scripts/sync-content-sections.mjs +6 -6
  123. package/scripts/test-content-check.mjs +3 -4
  124. package/scripts/test-engine-commands.mjs +2 -2
  125. package/scripts/test-package-check.mjs +17 -16
  126. package/scripts/test-temporary-visibility.mjs +2 -3
  127. package/src/components/SitePage.astro +2 -3
  128. package/src/components/SiteSection.astro +39 -5
  129. package/src/content.config.ts +60 -2
  130. package/src/layouts/BaseLayout.astro +17 -0
  131. package/src/styles/global.css +54 -50
  132. package/starters/basic/README.md +10 -15
  133. package/starters/basic/package.json +2 -2
  134. package/starters/basic/site/config.mjs +3 -24
  135. package/starters/basic/site/content.md +40 -7
  136. package/starters/basic/site/theme.md +110 -17
  137. package/starters/project/.github/workflows/deploy.yml +65 -0
  138. package/starters/project/README.md +72 -0
  139. package/starters/project/package-lock.json +4296 -0
  140. package/starters/project/package.json +35 -0
  141. package/starters/project/site/config.mjs +43 -0
  142. package/starters/project/site/content.md +88 -0
  143. package/starters/project/site/public/robots.txt +2 -0
  144. package/starters/project/site/routes/guide/route-content.md +58 -0
  145. package/starters/project/site/theme.md +15 -0
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "project-site",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "npm run norna:dev --",
7
+ "norna:dev": "norna dev:local",
8
+ "norna:dev:lan": "norna dev:lan",
9
+ "norna:dev:restart": "norna dev:restart",
10
+ "norna:dev:status": "norna dev:status",
11
+ "norna:dev:logs": "norna dev:logs",
12
+ "norna:dev:stop": "norna dev:stop",
13
+ "norna:check": "npm run norna:config:check && npm run norna:content:check",
14
+ "norna:config:check": "norna config:check",
15
+ "norna:content:check": "norna content:check",
16
+ "norna:sync": "norna content:sync",
17
+ "norna:typography:presets": "norna typography presets",
18
+ "norna:typography:show": "norna typography show",
19
+ "norna:public": "norna site:public",
20
+ "norna:images": "norna images",
21
+ "norna:build": "norna build",
22
+ "norna:build:local": "norna build:local",
23
+ "norna:deploy": "norna deploy",
24
+ "norna:deploy:commit": "norna deploy:commit",
25
+ "norna:deploy:watch": "norna deploy:watch",
26
+ "norna:doctor": "norna doctor",
27
+ "norna:preview": "norna preview",
28
+ "norna:engine:update": "norna engine:update",
29
+ "norna:engine:version": "norna engine:version",
30
+ "build": "npm run norna:build"
31
+ },
32
+ "dependencies": {
33
+ "@janga/norna": "0.7.2"
34
+ }
35
+ }
@@ -0,0 +1,43 @@
1
+ export default {
2
+ site: {
3
+ url: 'https://example.com/',
4
+ basePath: '/',
5
+ },
6
+ navigation: {
7
+ smoothScroll: {
8
+ enabled: true,
9
+ minimumDurationMs: 500,
10
+ maximumDurationMs: 1_100,
11
+ durationPerPixelMs: 0.18,
12
+ },
13
+ },
14
+ locale: {
15
+ lang: 'en',
16
+ labels: {
17
+ skipToContent: 'Skip to content',
18
+ siteNavigation: 'Pages',
19
+ pageNavigation: 'On this page',
20
+ sectionNavigation: 'Sections',
21
+ menu: 'Menu',
22
+ gallery: 'Images',
23
+ },
24
+ },
25
+ footer: {
26
+ copyrightMessage: '(c) Project contributors.',
27
+ buildInfo: {
28
+ enabled: true,
29
+ text: 'Built',
30
+ dateTimeFormat: {
31
+ locale: 'en-GB',
32
+ timeZone: 'UTC',
33
+ dateStyle: 'short',
34
+ timeStyle: 'short',
35
+ },
36
+ },
37
+ },
38
+ github: {
39
+ repo: 'owner/project-name',
40
+ branch: 'main',
41
+ pagesWorkflow: 'Deploy to GitHub Pages',
42
+ },
43
+ };
@@ -0,0 +1,88 @@
1
+ ---
2
+ title: Project Name
3
+ description: A concise project site for an open source tool, library, or CLI.
4
+ navigation:
5
+ label: Home
6
+ order: 0
7
+ sections:
8
+ - id: intro
9
+ presentation:
10
+ typography:
11
+ preset: statement
12
+ - id: links
13
+ - id: install
14
+ - id: example
15
+ - id: features
16
+ - id: when-to-use
17
+ - id: next
18
+ ---
19
+
20
+ ## Project Name keeps project workflows predictable {#intro}
21
+
22
+ Project Name is a small open source tool for teams that want repeatable
23
+ results without adding a large platform. It provides one focused command-line
24
+ workflow and a compact JavaScript API for automation.
25
+
26
+ ## Links {#links}
27
+
28
+ - [GitHub repository](https://github.com/owner/project-name)
29
+ - [Documentation](https://example.com/docs/)
30
+ - [Package](https://www.npmjs.com/package/project-name)
31
+ - [Issue tracker](https://github.com/owner/project-name/issues)
32
+
33
+ ## Install {#install}
34
+
35
+ ```sh
36
+ npm install project-name
37
+ ```
38
+
39
+ Project Name supports current Node.js releases and works in local development,
40
+ CI jobs, and small publishing workflows.
41
+
42
+ ## Example {#example}
43
+
44
+ ```sh
45
+ project-name check ./src --format summary
46
+ ```
47
+
48
+ ```js
49
+ import { checkProject } from 'project-name';
50
+
51
+ const report = await checkProject({
52
+ input: './src',
53
+ format: 'summary',
54
+ });
55
+
56
+ console.log(report.status);
57
+ ```
58
+
59
+ Use the CLI for everyday checks and the API when the same behavior belongs
60
+ inside a larger build script.
61
+
62
+ ## Features {#features}
63
+
64
+ ### Simple inputs
65
+
66
+ The project works with ordinary files and predictable commands.
67
+
68
+ ### Scriptable results
69
+
70
+ The CLI prints human-readable summaries while the API returns structured data
71
+ for automation.
72
+
73
+ ### Small surface area
74
+
75
+ There are only a few concepts to learn, so the project stays easy to adopt and
76
+ easy to replace.
77
+
78
+ ## When to use it {#when-to-use}
79
+
80
+ - Validate repository conventions before a pull request is reviewed.
81
+ - Reuse the same checks locally and in CI.
82
+ - Add a focused command to an existing project without introducing a service.
83
+ - Expose a small API for downstream tooling.
84
+
85
+ ## Next steps {#next}
86
+
87
+ Read the [guide](/guide/) for configuration options and a longer example, or
88
+ open the repository to inspect the implementation.
@@ -0,0 +1,2 @@
1
+ User-agent: *
2
+ Allow: /
@@ -0,0 +1,58 @@
1
+ ---
2
+ title: Guide
3
+ description: Learn the basic Project Name workflow.
4
+ navigation:
5
+ label: Guide
6
+ order: 10
7
+ sections:
8
+ - id: quickstart
9
+ - id: configuration
10
+ - id: api
11
+ ---
12
+
13
+ ## Quickstart {#quickstart}
14
+
15
+ Install the package and run the default check against a source directory:
16
+
17
+ ```sh
18
+ npm install project-name
19
+ npx project-name check ./src
20
+ ```
21
+
22
+ The command exits with a non-zero status when it finds an issue, so it can run
23
+ unchanged in local scripts and CI jobs.
24
+
25
+ ## Configuration {#configuration}
26
+
27
+ Project Name looks for a project config file at the repository root:
28
+
29
+ ```js
30
+ export default {
31
+ include: ['src', 'scripts'],
32
+ reporter: 'summary',
33
+ };
34
+ ```
35
+
36
+ Keep configuration small and explicit. Defaults should be good enough for a new
37
+ project, while advanced projects can opt into stricter behavior one setting at a
38
+ time.
39
+
40
+ ## API {#api}
41
+
42
+ Use the API when checks need to be part of another tool:
43
+
44
+ ```js
45
+ import { checkProject } from 'project-name';
46
+
47
+ const report = await checkProject({
48
+ input: './src',
49
+ reporter: 'json',
50
+ });
51
+
52
+ if (!report.ok) {
53
+ process.exitCode = 1;
54
+ }
55
+ ```
56
+
57
+ The API returns structured results so callers can decide whether to print a
58
+ summary, write a report file, or fail a build.
@@ -0,0 +1,15 @@
1
+ ---
2
+ # Site-wide visual defaults. Remove a value to use the engine default.
3
+ navigation:
4
+ brand: Project Name
5
+ presentation:
6
+ backgroundColor: "#101314"
7
+ textColor: "#f6f1e8"
8
+ inlineStyles:
9
+ accent:
10
+ color: "#8fd3ff"
11
+ muted:
12
+ color: "#b8b1a6"
13
+ frame:
14
+ colors: presentation
15
+ ---