miki-template 2.3.1 → 2.3.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 (167) hide show
  1. package/README.md +1 -1
  2. package/package.json +24 -2
  3. package/src/codegen.js +140 -9
  4. package/src/parser.js +69 -1
  5. package/src/tags/control.js +112 -51
  6. package/src/tags/extra.js +4 -17
  7. package/src/tags/i18n.js +6 -17
  8. package/src/tags/inheritance.js +6 -20
  9. package/src/tags/util.js +5 -20
  10. package/.eslintrc.json +0 -16
  11. package/.github/release-notes/v1.3.1.md +0 -55
  12. package/.github/release-notes/v1.3.3.md +0 -77
  13. package/.github/release-notes/v1.3.7.md +0 -20
  14. package/.github/workflows/ci.yml +0 -42
  15. package/.github/workflows/docs.yml +0 -107
  16. package/.github/workflows/release.yml +0 -107
  17. package/AGENT.md +0 -71
  18. package/API_REFERENCE.md +0 -341
  19. package/CHANGELOG.md +0 -173
  20. package/CODE_OF_CONDUCT.md +0 -14
  21. package/CONTRIBUTING.md +0 -27
  22. package/ROADMAP.md +0 -40
  23. package/assets/banner.png +0 -0
  24. package/assets/logo.png +0 -0
  25. package/benchmarks/ejs-results.json +0 -17
  26. package/benchmarks/ejs.js +0 -38
  27. package/benchmarks/handlebars-results.json +0 -17
  28. package/benchmarks/handlebars.js +0 -45
  29. package/benchmarks/miki-results.json +0 -17
  30. package/benchmarks/miki.js +0 -39
  31. package/benchmarks/pug-results.json +0 -17
  32. package/benchmarks/pug.js +0 -38
  33. package/benchmarks/report.json +0 -17
  34. package/benchmarks/run.js +0 -81
  35. package/benchmarks/stress.mjs +0 -647
  36. package/benchmarks/templates/large.dtpl +0 -7
  37. package/benchmarks/templates/medium.dtpl +0 -3
  38. package/benchmarks/templates/small.dtpl +0 -7
  39. package/context/component.md +0 -109
  40. package/context/prd.md +0 -131
  41. package/context/project-structure.md +0 -33
  42. package/dir/base.html +0 -23
  43. package/dir/cmpnt.html +0 -11
  44. package/dir/footer.html +0 -3
  45. package/dir/home.html +0 -80
  46. package/dir/index.html +0 -80
  47. package/dir/navbar.html +0 -9
  48. package/docs/api/async-render.md +0 -170
  49. package/docs/api/cache.md +0 -174
  50. package/docs/api/compile.md +0 -256
  51. package/docs/api/context-processors.md +0 -154
  52. package/docs/api/filters.md +0 -437
  53. package/docs/api/finder.md +0 -188
  54. package/docs/api/helpers.md +0 -106
  55. package/docs/api/i18n.md +0 -314
  56. package/docs/api/index.md +0 -108
  57. package/docs/api/libraries.md +0 -414
  58. package/docs/api/render-partial.md +0 -162
  59. package/docs/api/render.md +0 -184
  60. package/docs/api/security.md +0 -290
  61. package/docs/api/setup-express.md +0 -152
  62. package/docs/api/tags.md +0 -268
  63. package/docs/assets/banner.png +0 -0
  64. package/docs/assets/logo.png +0 -0
  65. package/docs/filter.md +0 -0
  66. package/docs/guide/advanced-usage.md +0 -794
  67. package/docs/guide/async-rendering.md +0 -616
  68. package/docs/guide/context-processors.md +0 -514
  69. package/docs/guide/custom-filters.md +0 -622
  70. package/docs/guide/custom-tags.md +0 -542
  71. package/docs/guide/filters.md +0 -1314
  72. package/docs/guide/getting-started.md +0 -204
  73. package/docs/guide/installation.md +0 -190
  74. package/docs/guide/partial-templates.md +0 -734
  75. package/docs/guide/quick-start.md +0 -444
  76. package/docs/guide/security.md +0 -690
  77. package/docs/guide/tags.md +0 -1566
  78. package/docs/guide/template-discovery.md +0 -340
  79. package/docs/guide/template-inheritance.md +0 -546
  80. package/docs/guide/what-is-miki-template.md +0 -28
  81. package/docs/guide/why-miki-template.md +0 -75
  82. package/docs/index.md +0 -86
  83. package/docs/integrations/elysia.md +0 -80
  84. package/docs/integrations/express.md +0 -219
  85. package/docs/integrations/fastify.md +0 -79
  86. package/docs/integrations/hono.md +0 -80
  87. package/docs/integrations/index.md +0 -68
  88. package/docs/integrations/koa.md +0 -90
  89. package/docs/integrations/nestjs.md +0 -80
  90. package/docs/integrations/tsed.md +0 -83
  91. package/docs/performance.md +0 -74
  92. package/eslint.config.mjs +0 -42
  93. package/ex.mjs +0 -36
  94. package/live-test/integrations/elysia-example.js +0 -16
  95. package/live-test/integrations/express-example.js +0 -24
  96. package/live-test/integrations/fastify-example.js +0 -20
  97. package/live-test/integrations/hono-example.js +0 -16
  98. package/live-test/integrations/koa-example.js +0 -30
  99. package/live-test/integrations/nestjs-example.js +0 -25
  100. package/live-test/integrations/smoke-test.js +0 -166
  101. package/live-test/integrations/tsed-example.js +0 -23
  102. package/live-test/package-lock.json +0 -1150
  103. package/live-test/package.json +0 -13
  104. package/live-test/packages/product/templates/product/detail.html +0 -7
  105. package/live-test/server.js +0 -38
  106. package/live-test/templates/app_templates/detail.html +0 -6
  107. package/live-test/views/base.html +0 -8
  108. package/live-test/views/child.html +0 -7
  109. package/live-test/views/home.html +0 -17
  110. package/live-test/views/index.html +0 -1
  111. package/miki-template-extension/.github/workflows/ci.yml +0 -116
  112. package/miki-template-extension/.vscodeignore +0 -7
  113. package/miki-template-extension/CHANGELOG.md +0 -99
  114. package/miki-template-extension/LICENSE +0 -21
  115. package/miki-template-extension/README.md +0 -273
  116. package/miki-template-extension/extension.js +0 -1013
  117. package/miki-template-extension/icon.png +0 -0
  118. package/miki-template-extension/icon.svg +0 -10
  119. package/miki-template-extension/miki-template-1.7.1.vsix +0 -0
  120. package/miki-template-extension/package.json +0 -280
  121. package/miki-template-extension/snippets/miki-template.json +0 -717
  122. package/miki-template-extension/syntaxes/language-configuration.json +0 -114
  123. package/miki-template-extension/syntaxes/miki-template.tmLanguage.json +0 -355
  124. package/miki-template-extension/tests/grammar-tests.json +0 -162
  125. package/miki-template-extension/tests/run-grammar-tests.js +0 -82
  126. package/mkdocs.yml +0 -195
  127. package/overrides/main.html +0 -26
  128. package/requirements-docs.txt +0 -2
  129. package/sample-app/package-lock.json +0 -901
  130. package/sample-app/package.json +0 -9
  131. package/sample-app/server.js +0 -14
  132. package/sample-app/views/index.html +0 -1
  133. package/scripts/build-vsix.js +0 -129
  134. package/scripts/build-vsix.ps1 +0 -15
  135. package/snippets/miki-template.json +0 -177
  136. package/src/asyncRender.js +0 -21
  137. package/src/types.d.ts +0 -107
  138. package/syntaxes/language-configuration.json +0 -26
  139. package/syntaxes/miki-template.tmLanguage.json +0 -146
  140. package/tests/asyncRender.test.js +0 -17
  141. package/tests/base.html +0 -6
  142. package/tests/child.html +0 -3
  143. package/tests/context_processors.test.js +0 -13
  144. package/tests/esm.test.mjs +0 -61
  145. package/tests/filters.test.js +0 -263
  146. package/tests/finder-appdirs.test.js +0 -19
  147. package/tests/finder.test.js +0 -17
  148. package/tests/fixtures/views/nested/index.html +0 -1
  149. package/tests/fixtures/views/partial.html +0 -1
  150. package/tests/fixtures/views/sub/deepfile.html +0 -1
  151. package/tests/fixtures/views-appdirs/product/site/detail.html +0 -1
  152. package/tests/include_security.test.js +0 -9
  153. package/tests/integration/README.md +0 -32
  154. package/tests/integration/features.test.cjs +0 -1681
  155. package/tests/integration/features.test.mjs +0 -1697
  156. package/tests/integration/finder.esm.test.mjs +0 -13
  157. package/tests/integration/partial-render.test.cjs +0 -13
  158. package/tests/integration/templates/base.miki +0 -6
  159. package/tests/integration/templates/child.miki +0 -6
  160. package/tests/integration/templates/index.html +0 -17
  161. package/tests/lexer.test.js +0 -45
  162. package/tests/parser.test.js +0 -57
  163. package/tests/partial.html +0 -1
  164. package/tests/partialdef.test.js +0 -79
  165. package/tests/production_checks.js +0 -57
  166. package/tests/security.test.js +0 -28
  167. package/tests/tags.test.js +0 -233
@@ -1,82 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const grammarTests = JSON.parse(fs.readFileSync(__dirname + '/grammar-tests.json', 'utf8'));
5
-
6
- let passed = 0;
7
- let failed = 0;
8
-
9
- console.log('Running grammar tests...\n');
10
-
11
- grammarTests.grammarTests.forEach(test => {
12
- try {
13
- console.log(`Test: ${test.name}`);
14
-
15
- if (test.input) {
16
- console.log(` Input: ${test.input.substring(0, 50)}${test.input.length > 50 ? '...' : ''}`);
17
- }
18
-
19
- if (test.expectedTags) {
20
- const missing = test.expectedTags.filter(tag => !test.input.includes(`{% ${tag}`));
21
- if (missing.length > 0) {
22
- console.log(` FAIL: Missing tags: ${missing.join(', ')}`);
23
- failed++;
24
- return;
25
- }
26
- }
27
-
28
- if (test.expectedFilters) {
29
- const missing = test.expectedFilters.filter(f => !test.input.includes(`|${f}`));
30
- if (missing.length > 0) {
31
- console.log(` FAIL: Missing filters: ${missing.join(', ')}`);
32
- failed++;
33
- return;
34
- }
35
- }
36
-
37
- if (test.expectedOperators) {
38
- const missing = test.expectedOperators.filter(op => !test.input.includes(op));
39
- if (missing.length > 0) {
40
- console.log(` FAIL: Missing operators: ${missing.join(', ')}`);
41
- failed++;
42
- return;
43
- }
44
- }
45
-
46
- console.log(' PASS');
47
- passed++;
48
- } catch (err) {
49
- console.log(` ERROR: ${err.message}`);
50
- failed++;
51
- }
52
- });
53
-
54
- console.log('\nValidation tests...\n');
55
-
56
- grammarTests.validationTests.forEach(test => {
57
- try {
58
- console.log(`Test: ${test.name}`);
59
- console.log(` Input: ${test.input.substring(0, 50)}${test.input.length > 50 ? '...' : ''}`);
60
-
61
- // Simple validation checks
62
- if (test.input.includes('{% extends') && test.input.indexOf('{% extends') > 0) {
63
- const firstNonWhitespace = test.input.match(/^\s*({%)/);
64
- if (firstNonWhitespace && firstNonWhitespace.index > 0) {
65
- console.log(` PASS: Detected extends not first`);
66
- passed++;
67
- }
68
- }
69
-
70
- console.log(' PASS');
71
- passed++;
72
- } catch (err) {
73
- console.log(` ERROR: ${err.message}`);
74
- failed++;
75
- }
76
- });
77
-
78
- console.log(`\n========================================`);
79
- console.log(`Tests: ${passed} passed, ${failed} failed`);
80
- console.log(`========================================`);
81
-
82
- process.exit(failed > 0 ? 1 : 0);
package/mkdocs.yml DELETED
@@ -1,195 +0,0 @@
1
- site_name: miki-template
2
- site_url: https://alainmiki.github.io/miki-template/
3
- site_description: Django-style template engine for Node.js and Express
4
- site_author: Alain Miki
5
-
6
- repo_name: miki-template
7
- repo_url: https://github.com/alainmiki/miki-template
8
- edit_uri: edit/main/docs/
9
-
10
- theme:
11
- name: material
12
- custom_dir: overrides
13
- logo: assets/logo.png
14
- favicon: assets/logo.png
15
- palette:
16
- - media: "(prefers-color-scheme: light)"
17
- scheme: default
18
- primary: custom
19
- accent: custom
20
- toggle:
21
- icon: material/brightness-7
22
- name: Switch to dark mode
23
- - media: "(prefers-color-scheme: dark)"
24
- scheme: custom
25
- primary: custom
26
- accent: custom
27
- toggle:
28
- icon: material/brightness-4
29
- name: Switch to light mode
30
- font:
31
- text: Inter
32
- code: JetBrains Mono
33
- features:
34
- - navigation.instant
35
- - navigation.instant.prefetch
36
- - navigation.instant.progress
37
- - navigation.tracking
38
- - navigation.tabs
39
- - navigation.tabs.sticky
40
- - navigation.sections
41
- - navigation.path
42
- - navigation.top
43
- - navigation.footer
44
- - navigation.prune
45
- - navigation.indexes
46
- - toc.integrate
47
- - toc.follow
48
- - search.suggest
49
- - search.highlight
50
- - content.code.copy
51
- - announce.dismiss
52
- icon:
53
- repo: fontawesome/brands/github
54
- admonition:
55
- note: fontawesome/solid/note-sticky
56
- abstract: fontawesome/solid/book-open
57
- info: fontawesome/solid/circle-info
58
- tip: fontawesome/solid/lightbulb
59
- success: fontawesome/solid/check-circle
60
- question: fontawesome/solid/question-circle
61
- warning: fontawesome/solid/triangle-exclamation
62
- failure: fontawesome/solid/circle-xmark
63
- danger: fontawesome/solid/skull
64
- bug: fontawesome/solid/robot
65
- example: fontawesome/solid/flask
66
- quote: fontawesome/solid/quote-left
67
-
68
- nav:
69
- - Home: index.md
70
- - Getting Started:
71
- - What is miki-template?: guide/what-is-miki-template.md
72
- - Why miki-template?: guide/why-miki-template.md
73
- - Getting Started: guide/getting-started.md
74
- - Installation: guide/installation.md
75
- - Quick Start: guide/quick-start.md
76
- - Core Features:
77
- - Partial Templates: guide/partial-templates.md
78
- - Smart Template Discovery: guide/template-discovery.md
79
- - Template Inheritance: guide/template-inheritance.md
80
- - Filters: guide/filters.md
81
- - Tags: guide/tags.md
82
- - Security: guide/security.md
83
- - Advanced:
84
- - Custom Tags: guide/custom-tags.md
85
- - Custom Filters: guide/custom-filters.md
86
- - Context Processors: guide/context-processors.md
87
- - Async Rendering: guide/async-rendering.md
88
- - Advanced Usage: guide/advanced-usage.md
89
- - API Reference:
90
- - API Overview: api/index.md
91
- - render(): api/render.md
92
- - compile(): api/compile.md
93
- - asyncRender(): api/async-render.md
94
- - renderPartial(): api/render-partial.md
95
- - setupExpress(): api/setup-express.md
96
- - Filters: api/filters.md
97
- - Tags: api/tags.md
98
- - Security: api/security.md
99
- - i18n: api/i18n.md
100
- - Libraries: api/libraries.md
101
- - Cache: api/cache.md
102
- - Finder: api/finder.md
103
- - Helpers: api/helpers.md
104
- - Context Processors: api/context-processors.md
105
- - Integrations:
106
- - Integrations Overview: integrations/index.md
107
- - Express: integrations/express.md
108
- - Koa: integrations/koa.md
109
- - Fastify: integrations/fastify.md
110
- - Hono: integrations/hono.md
111
- - Elysia: integrations/elysia.md
112
- - NestJS: integrations/nestjs.md
113
- - TSDX / TSed: integrations/tsed.md
114
- - Performance: performance.md
115
-
116
- markdown_extensions:
117
- - abbr
118
- - admonition
119
- - attr_list
120
- - def_list
121
- - footnotes
122
- - meta
123
- - toc:
124
- permalink: true
125
- title: On this page
126
- - pymdownx.arithmatex:
127
- generic: true
128
- - pymdownx.betterem:
129
- smart_enable: all
130
- - pymdownx.caret
131
- - pymdownx.details
132
- - pymdownx.emoji:
133
- emoji_index: !!python/name:material.extensions.emoji.twemoji
134
- emoji_generator: !!python/name:material.extensions.emoji.to_svg
135
- - pymdownx.highlight:
136
- anchor_linenums: true
137
- line_spans: __span
138
- pygments_lang_class: true
139
- - pymdownx.inlinehilite
140
- - pymdownx.keys
141
- - pymdownx.mark
142
- - pymdownx.smartsymbols
143
- - pymdownx.superfences:
144
- custom_fences:
145
- - name: mermaid
146
- class: mermaid
147
- format: !!python/name:pymdownx.superfences.fence_code_format
148
- - pymdownx.tabbed:
149
- alternate_style: true
150
- - pymdownx.tasklist:
151
- custom_checkbox: true
152
- - pymdownx.tilde
153
-
154
- extra:
155
- social:
156
- - icon: fontawesome/brands/github
157
- link: https://github.com/alainmiki/miki-template
158
- name: miki-template on GitHub
159
- - icon: fontawesome/brands/npm
160
- link: https://www.npmjs.com/package/miki-template
161
- name: miki-template on npm
162
- - icon: fontawesome/brands/youtube
163
- link: https://youtube.com/@codewithmiki6849
164
- name: Code with Miki on YouTube
165
- - icon: fontawesome/brands/facebook
166
- link: https://www.facebook.com/profile.php?id=100063798107667
167
- name: Alain Miki on Facebook
168
- - icon: fontawesome/brands/instagram
169
- link: https://www.instagram.com/alain_miki
170
- name: Alain Miki on Instagram
171
- - icon: fontawesome/brands/facebook
172
- link: https://www.facebook.com/codewithmiki
173
- name: Code with Miki on Facebook
174
- version:
175
- provider: mike
176
- homepage: https://alainmiki.github.io/miki-template/
177
- generator: false
178
- annotate:
179
- json: [.s2s]
180
-
181
- plugins:
182
- - search:
183
- separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
184
- - tags
185
- - meta
186
- - offline:
187
- enabled: !ENV [READTHEDOCS, false]
188
- - social:
189
- cards: true
190
- cards_layout_options:
191
- color: "#1a1a2e"
192
- font_family: Roboto
193
- - optimize:
194
- enabled: !ENV [READTHEDOCS, false]
195
- concurrency: 4
@@ -1,26 +0,0 @@
1
- {% extends "base.html" %}
2
-
3
- {% block announce %}
4
- <div class="md-announce" role="banner">
5
- <div class="md-announce__inner">
6
- <span>🚀 <strong>miki-template v2.3.1</strong> is now available with improved performance and new features!</span>
7
- <a href="https://github.com/alainmiki/miki-template/releases" target="_blank" rel="noopener">View Release Notes</a>
8
- <button class="md-announce__button" onclick="this.closest('.md-announce').remove()" aria-label="Dismiss announcement">
9
- <span class="md-icon">&#10005;</span>
10
- </button>
11
- </div>
12
- </div>
13
- {% endblock %}
14
-
15
- {% block extrahead %}
16
- <meta name="theme-color" content="#1a1a2e">
17
- <meta name="description" content="Django-style template magic for Node.js — blazing fast partials, smart template discovery, and zero friction for HTMX.">
18
- <meta property="og:title" content="miki-template - Django-style templating for Node.js">
19
- <meta property="og:description" content="Blazing fast partials, smart template discovery, and zero friction for HTMX. Bring Django's beloved template language to Node.js and Express.">
20
- <meta property="og:type" content="website">
21
- <meta property="og:url" content="https://alainmiki.github.io/miki-template/">
22
- <meta property="og:image" content="https://alainmiki.github.io/miki-template/social-card.png">
23
- <meta name="twitter:card" content="summary_large_image">
24
- <meta name="twitter:title" content="miki-template - Django-style templating for Node.js">
25
- <meta name="twitter:description" content="Blazing fast partials, smart template discovery, and zero friction for HTMX.">
26
- {% endblock %}
@@ -1,2 +0,0 @@
1
- mkdocs-material[imaging]<9.8
2
- mkdocs<2