web-documentation 1.0.41 → 1.0.43
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/build/deploy.js +60675 -11
- package/package.json +68 -54
- package/source/deploy.ts +1 -1
- package/source/image/sprite.png +0 -0
- package/source/index.html.ejs +5 -5
- package/source/index.ts +45 -34
- package/source/test.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-documentation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
4
4
|
"description": "Declarative multilanguage documentation website generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"main": "source/index.html.ejs",
|
|
28
28
|
"bin": "build/deploy.js",
|
|
29
|
+
"type": "module",
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
|
31
32
|
"url": "https://github.com/thaibault/web-documentation"
|
|
@@ -51,9 +52,9 @@
|
|
|
51
52
|
"watch": "weboptimizer build --watch"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
|
-
"@aws-sdk/client-s3": "^3.
|
|
55
|
-
"@babel/eslint-parser": "^
|
|
56
|
-
"@babel/runtime": "^
|
|
55
|
+
"@aws-sdk/client-s3": "^3.1095.0",
|
|
56
|
+
"@babel/eslint-parser": "^8.0.1",
|
|
57
|
+
"@babel/runtime": "^8.0.0",
|
|
57
58
|
"@eslint/js": "^10.0.1",
|
|
58
59
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
59
60
|
"@types/archiver": "^8.0.0",
|
|
@@ -61,55 +62,55 @@
|
|
|
61
62
|
"@types/html-minifier": "^4.0.6",
|
|
62
63
|
"@types/jsdom": "^28.0.3",
|
|
63
64
|
"@types/marked": "^6.0.0",
|
|
64
|
-
"@types/node": "^
|
|
65
|
+
"@types/node": "^26.1.1",
|
|
65
66
|
"@types/unzipper": "^0.10.11",
|
|
66
67
|
"@types/webpack-env": "^1.18.8",
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
68
|
-
"@typescript-eslint/parser": "^8.
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
69
|
+
"@typescript-eslint/parser": "^8.65.0",
|
|
69
70
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
70
71
|
"archiver": "^8.0.0",
|
|
71
72
|
"bootstrap-icons": "^1.13.1",
|
|
72
|
-
"clientnode": "^4.0.
|
|
73
|
+
"clientnode": "^4.0.1472",
|
|
73
74
|
"css-loader": "^7.1.4",
|
|
74
75
|
"cssnano": "^8.0.2",
|
|
75
76
|
"default-gateway": "^7.2.2",
|
|
76
|
-
"errorreporter": "^1.0.
|
|
77
|
-
"eslint": "^10.
|
|
77
|
+
"errorreporter": "^1.0.355",
|
|
78
|
+
"eslint": "^10.8.0",
|
|
78
79
|
"eslint-config-google": "^0.14.0",
|
|
79
|
-
"eslint-plugin-jsdoc": "^63.0
|
|
80
|
-
"favicons": "^7.3.
|
|
80
|
+
"eslint-plugin-jsdoc": "^63.3.0",
|
|
81
|
+
"favicons": "^7.3.1",
|
|
81
82
|
"favicons-webpack-plugin": "^6.0.1",
|
|
82
83
|
"highlight.js": "^11.11.1",
|
|
83
84
|
"jest": "30.4.2",
|
|
84
85
|
"jsdoc": "^4.0.5",
|
|
85
86
|
"legal-notes": "^1.0.29",
|
|
86
|
-
"marked": "^18.0.
|
|
87
|
+
"marked": "^18.0.7",
|
|
87
88
|
"marked-gfm-heading-id": "^4.1.4",
|
|
88
89
|
"marked-highlight": "^2.2.4",
|
|
89
90
|
"marked-xhtml": "^1.0.15",
|
|
90
91
|
"mini-css-extract-plugin": "^2.10.2",
|
|
91
|
-
"postcss": "^8.5.
|
|
92
|
+
"postcss": "^8.5.23",
|
|
92
93
|
"postcss-fontpath": "^1.0.0",
|
|
93
94
|
"postcss-import": "^16.1.1",
|
|
94
95
|
"postcss-loader": "^8.2.1",
|
|
95
96
|
"postcss-mixins": "^12.1.2",
|
|
96
97
|
"postcss-nested": "^7.0.2",
|
|
97
|
-
"postcss-preset-env": "^11.3.
|
|
98
|
+
"postcss-preset-env": "^11.3.2",
|
|
98
99
|
"postcss-scss": "^4.0.9",
|
|
99
100
|
"postcss-sprites": "^4.2.1",
|
|
100
101
|
"postcss-url": "^10.1.4",
|
|
101
102
|
"prop-types": "^15.8.1",
|
|
102
103
|
"style-loader": "^4.0.0",
|
|
103
|
-
"stylelint": "^17.
|
|
104
|
+
"stylelint": "^17.14.1",
|
|
104
105
|
"stylelint-config-standard": "^40.0.0",
|
|
105
|
-
"typescript-eslint": "^8.
|
|
106
|
+
"typescript-eslint": "^8.65.0",
|
|
106
107
|
"ua-parser-js": "^2.0.10",
|
|
107
|
-
"unzipper": "^0.12.
|
|
108
|
-
"web-component-wrapper": "^0.0.
|
|
109
|
-
"web-internationalization": "^2.0.
|
|
110
|
-
"weboptimizer": "^
|
|
111
|
-
"webpack-dev-server": "^
|
|
112
|
-
"website-utilities": "^1.0.
|
|
108
|
+
"unzipper": "^0.12.5",
|
|
109
|
+
"web-component-wrapper": "^0.0.607",
|
|
110
|
+
"web-internationalization": "^2.0.45",
|
|
111
|
+
"weboptimizer": "^4.0.40",
|
|
112
|
+
"webpack-dev-server": "^6.0.0",
|
|
113
|
+
"website-utilities": "^1.0.458"
|
|
113
114
|
},
|
|
114
115
|
"engines": {
|
|
115
116
|
"node": ">=24",
|
|
@@ -146,10 +147,24 @@
|
|
|
146
147
|
"entry": {
|
|
147
148
|
"#": "errorreporter\": [\"ua-parser-js\", \"errorreporter\"]",
|
|
148
149
|
"__evaluate__": "2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith('test') ? {testBundle: './test.ts'} : {index: ['./index.css', '@webcomponents/webcomponentsjs/webcomponents-bundle.js', '@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js', './index']}"
|
|
150
|
+
},
|
|
151
|
+
"external": {
|
|
152
|
+
"#": "Externalize other's pre-build libraries for the test target so jest resolves the published bundles at runtime instead of re-bundling them.",
|
|
153
|
+
"implicit": {
|
|
154
|
+
"pattern": {
|
|
155
|
+
"include": {
|
|
156
|
+
"__evaluate__": "['@jest/globals'].concat(2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith('test') ? /^(?:clientnode|web-component-wrapper|website-utilities|web-internationalization|errorreporter)(?:$|\\/)/ : [])"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
149
160
|
}
|
|
150
161
|
},
|
|
151
162
|
"library": false,
|
|
152
163
|
"module": {
|
|
164
|
+
"aliases": {
|
|
165
|
+
"web-component-wrapper/decorator$": "web-component-wrapper/compatible/decorator",
|
|
166
|
+
"web-component-wrapper/Web": "web-component-wrapper/compatible/Web"
|
|
167
|
+
},
|
|
153
168
|
"enforceDeduplication": true,
|
|
154
169
|
"html": {
|
|
155
170
|
"options": {
|
|
@@ -161,19 +176,9 @@
|
|
|
161
176
|
}
|
|
162
177
|
},
|
|
163
178
|
"optimizer": {
|
|
164
|
-
"babelMinify": {
|
|
165
|
-
"#": "To provide a logging output we need to exclude this feature.",
|
|
166
|
-
"bundle": {
|
|
167
|
-
"transform": {
|
|
168
|
-
"removeConsole": false
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
"#1": "Avoids wrong this binding in some callbacks with class bound closure (e.g. in \"performStartUpEffects -> animate -> always\".",
|
|
172
|
-
"module": null
|
|
173
|
-
},
|
|
174
179
|
"#": "We have to add disable \"mergeRules\" since it removes header link color over writing.",
|
|
175
180
|
"cssnano": {
|
|
176
|
-
"
|
|
181
|
+
"__await_evaluate__": "module.optionalImport('cssnano-preset-default').then((module) => self.debug ? null : {preset: [module?.default, {autoprefixer: false, discardUnused: !self.library, mergeRules: false}]})"
|
|
177
182
|
},
|
|
178
183
|
"htmlMinifier": {
|
|
179
184
|
"ignoreCustomComments": [
|
|
@@ -187,6 +192,19 @@
|
|
|
187
192
|
"__evaluate__": "/^showExample(?::[a-zA-Z]+)?$/"
|
|
188
193
|
}
|
|
189
194
|
]
|
|
195
|
+
},
|
|
196
|
+
"terser": {
|
|
197
|
+
"terserOptions": {
|
|
198
|
+
"compress": {
|
|
199
|
+
"#": "To provide a logging output we need to exclude this feature.",
|
|
200
|
+
"drop_console": {
|
|
201
|
+
"__evaluate__": "false"
|
|
202
|
+
},
|
|
203
|
+
"drop_debugger": {
|
|
204
|
+
"__evaluate__": "false"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
190
208
|
}
|
|
191
209
|
},
|
|
192
210
|
"preprocessor": {
|
|
@@ -195,8 +213,8 @@
|
|
|
195
213
|
"plugins": {
|
|
196
214
|
"pre": {
|
|
197
215
|
"__append__": [
|
|
198
|
-
"
|
|
199
|
-
"
|
|
216
|
+
"module.optionalImport('postcss-mixins').then((module) => module?.default)",
|
|
217
|
+
"module.optionalImport('postcss-nested').then((module) => module?.default)"
|
|
200
218
|
]
|
|
201
219
|
}
|
|
202
220
|
}
|
|
@@ -213,6 +231,7 @@
|
|
|
213
231
|
"__evaluate__": "self.module.preprocessor.html.options.locals.NAME === 'web-documentation' ? ['enUS', 'deDE', 'frFR'] : ['enUS']"
|
|
214
232
|
},
|
|
215
233
|
"MARKED_OPTIONS": {
|
|
234
|
+
"async": true,
|
|
216
235
|
"#": "If true, add <br> on a single line break (copies GitHub behavior on comments, but not on rendered markdown files). Requires gfm be true.",
|
|
217
236
|
"breaks": false,
|
|
218
237
|
"#1": "If true, use approved GitHub Flavored Markdown (GFM) specification.",
|
|
@@ -223,14 +242,11 @@
|
|
|
223
242
|
"silent": false
|
|
224
243
|
},
|
|
225
244
|
"NAME": "web-documentation",
|
|
226
|
-
"IS_DIRECTORY": {
|
|
227
|
-
"__evaluate__": "filesystem.isDirectorySync"
|
|
228
|
-
},
|
|
229
245
|
"READ_FILE": {
|
|
230
|
-
"__evaluate__": "fs.
|
|
246
|
+
"__evaluate__": "fs.promises.readFile"
|
|
231
247
|
},
|
|
232
248
|
"RENDER_MARKDOWN": {
|
|
233
|
-
"
|
|
249
|
+
"__await_evaluate__": "module.optionalImport(path.resolve(currentPath, 'source/renderMarkdown.mjs')).then((module) => module?.default(self.module.preprocessor.ejs.options.locals.MARKED_OPTIONS))"
|
|
234
250
|
},
|
|
235
251
|
"META_TAGS": [],
|
|
236
252
|
"SOURCE_URL": {
|
|
@@ -272,14 +288,10 @@
|
|
|
272
288
|
"javaScript": {
|
|
273
289
|
"pattern": {
|
|
274
290
|
"#": "This is how we can make our main exported artefact executable.",
|
|
275
|
-
"__evaluate__": "`#!/usr/bin/env node\n// -*- coding: utf-8 -*-\n
|
|
291
|
+
"__evaluate__": "`#!/usr/bin/env node\n// -*- coding: utf-8 -*-\n{1}`"
|
|
276
292
|
}
|
|
277
293
|
}
|
|
278
294
|
},
|
|
279
|
-
"exportFormat": {
|
|
280
|
-
"external": "commonjs2",
|
|
281
|
-
"self": "commonjs2"
|
|
282
|
-
},
|
|
283
295
|
"files": {
|
|
284
296
|
"defaultHTML": {
|
|
285
297
|
"template": {
|
|
@@ -294,15 +306,17 @@
|
|
|
294
306
|
},
|
|
295
307
|
"module": {
|
|
296
308
|
"optimizer": {
|
|
297
|
-
"
|
|
298
|
-
"
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
"
|
|
309
|
+
"terser": {
|
|
310
|
+
"terserOptions": {
|
|
311
|
+
"compress": {
|
|
312
|
+
"#": "To provide a logging output we need to exclude this feature.",
|
|
313
|
+
"drop_console": {
|
|
314
|
+
"__evaluate__": "false"
|
|
315
|
+
},
|
|
316
|
+
"drop_debugger": {
|
|
317
|
+
"__evaluate__": "false"
|
|
318
|
+
}
|
|
302
319
|
}
|
|
303
|
-
},
|
|
304
|
-
"module": {
|
|
305
|
-
"removeConsole": false
|
|
306
320
|
}
|
|
307
321
|
}
|
|
308
322
|
}
|
package/source/deploy.ts
CHANGED
|
@@ -279,7 +279,7 @@ const generateAndPushNewDocumentationPage = async (
|
|
|
279
279
|
const serializedParameters: string =
|
|
280
280
|
JSON.stringify(evaluateDynamicData(
|
|
281
281
|
BUILD_DOCUMENTATION_PAGE_CONFIGURATION,
|
|
282
|
-
{parameters, ...PACKAGE_CONFIGURATION}
|
|
282
|
+
{scope: {parameters, ...PACKAGE_CONFIGURATION}}
|
|
283
283
|
))
|
|
284
284
|
const parametersFilePath: string =
|
|
285
285
|
await makeTemporaryFile({extension: '.json'})
|
|
Binary file
|
package/source/index.html.ejs
CHANGED
|
@@ -33,7 +33,7 @@ _%>
|
|
|
33
33
|
<%_ } _%>>
|
|
34
34
|
<%_ } _%>
|
|
35
35
|
<title><%- _.NAME %></title>
|
|
36
|
-
<%- _.include(
|
|
36
|
+
<%- await _.include(
|
|
37
37
|
'web-component-wrapper/polyfill.html', {webComponents: false}
|
|
38
38
|
) %>
|
|
39
39
|
<script>
|
|
@@ -194,13 +194,13 @@ _%>
|
|
|
194
194
|
let content = ''
|
|
195
195
|
if (_.CONTENT && !_.CONTENT.trim().startsWith('<!--html-->'))
|
|
196
196
|
if (_.CONTENT.endsWith('.html'))
|
|
197
|
-
content = _.READ_FILE(_.CONTENT, _.configuration.encoding)
|
|
197
|
+
content = await _.READ_FILE(_.CONTENT, _.configuration.encoding)
|
|
198
198
|
else if (_.CONTENT.endsWith('.md'))
|
|
199
|
-
content = _.RENDER_MARKDOWN(_.READ_FILE(
|
|
199
|
+
content = await _.RENDER_MARKDOWN(await _.READ_FILE(
|
|
200
200
|
_.CONTENT, _.configuration.encoding
|
|
201
201
|
))
|
|
202
202
|
else
|
|
203
|
-
content = _.RENDER_MARKDOWN(_.CONTENT)
|
|
203
|
+
content = await _.RENDER_MARKDOWN(_.CONTENT)
|
|
204
204
|
_%>
|
|
205
205
|
|
|
206
206
|
<%- content %>
|
|
@@ -257,7 +257,7 @@ _%>
|
|
|
257
257
|
</lang-replacement>
|
|
258
258
|
</a>
|
|
259
259
|
</p>
|
|
260
|
-
<%- _.include('legal-notes') %>
|
|
260
|
+
<%- await _.include('legal-notes') %>
|
|
261
261
|
</section>
|
|
262
262
|
<!--endregion-->
|
|
263
263
|
</main>
|
package/source/index.ts
CHANGED
|
@@ -33,9 +33,9 @@ import {
|
|
|
33
33
|
wrap
|
|
34
34
|
} from 'clientnode'
|
|
35
35
|
import {func, object} from 'clientnode/property-types'
|
|
36
|
-
import {property} from 'web-component-wrapper/
|
|
36
|
+
import {property} from 'web-component-wrapper/decorator'
|
|
37
37
|
import {WebComponentAPI} from 'web-component-wrapper/type'
|
|
38
|
-
import {Web} from 'web-component-wrapper/
|
|
38
|
+
import {Web} from 'web-component-wrapper/Web'
|
|
39
39
|
import {api as websiteUtilitiesAPI} from 'website-utilities'
|
|
40
40
|
import {api as webInternationalizationAPI} from 'web-internationalization'
|
|
41
41
|
|
|
@@ -417,7 +417,7 @@ export class WebDocumentation<
|
|
|
417
417
|
code = codeDomNode.innerText
|
|
418
418
|
|
|
419
419
|
try {
|
|
420
|
-
let domNode: HTMLElement |
|
|
420
|
+
let domNode: HTMLElement | null = null
|
|
421
421
|
let reInjectScripts = false
|
|
422
422
|
if (match.length > 2 && match[2])
|
|
423
423
|
if (
|
|
@@ -425,7 +425,17 @@ export class WebDocumentation<
|
|
|
425
425
|
.includes(match[2].toLowerCase())
|
|
426
426
|
)
|
|
427
427
|
try {
|
|
428
|
+
/*
|
|
429
|
+
eslint-disable
|
|
430
|
+
@typescript-eslint/no-implied-eval,
|
|
431
|
+
@typescript-eslint/no-unsafe-call
|
|
432
|
+
*/
|
|
428
433
|
new Function(code)()
|
|
434
|
+
/*
|
|
435
|
+
eslint-enable
|
|
436
|
+
@typescript-eslint/no-implied-eval,
|
|
437
|
+
@typescript-eslint/no-unsafe-call
|
|
438
|
+
*/
|
|
429
439
|
} catch (error) {
|
|
430
440
|
log.warn(
|
|
431
441
|
'Error occurred during running ' +
|
|
@@ -459,40 +469,41 @@ export class WebDocumentation<
|
|
|
459
469
|
reInjectScripts = true
|
|
460
470
|
}
|
|
461
471
|
|
|
462
|
-
if (domNode)
|
|
472
|
+
if (domNode) {
|
|
463
473
|
codeDomNode.after(domNode)
|
|
464
474
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
)
|
|
478
|
-
newScriptDomNode.setAttribute(
|
|
479
|
-
name,
|
|
480
|
-
scriptDomNode.getAttribute(name) as
|
|
481
|
-
string
|
|
475
|
+
if (reInjectScripts)
|
|
476
|
+
/*
|
|
477
|
+
Injected script tags are not executed by
|
|
478
|
+
default. So we need to reinject those.
|
|
479
|
+
*/
|
|
480
|
+
for (const scriptDomNode of
|
|
481
|
+
domNode.querySelectorAll('script')
|
|
482
|
+
) {
|
|
483
|
+
const newScriptDomNode =
|
|
484
|
+
document.createElement('script')
|
|
485
|
+
for (const name of
|
|
486
|
+
scriptDomNode.getAttributeNames()
|
|
482
487
|
)
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
488
|
+
newScriptDomNode.setAttribute(
|
|
489
|
+
name,
|
|
490
|
+
scriptDomNode.getAttribute(name) as
|
|
491
|
+
string
|
|
492
|
+
)
|
|
493
|
+
newScriptDomNode.textContent =
|
|
494
|
+
scriptDomNode.textContent
|
|
495
|
+
const promise = new Promise((resolve) => {
|
|
496
|
+
newScriptDomNode.addEventListener(
|
|
497
|
+
'load', resolve
|
|
498
|
+
)
|
|
499
|
+
})
|
|
500
|
+
if (scriptDomNode.parentNode)
|
|
501
|
+
scriptDomNode.parentNode.replaceChild(
|
|
502
|
+
newScriptDomNode, scriptDomNode
|
|
503
|
+
)
|
|
504
|
+
await promise
|
|
505
|
+
}
|
|
506
|
+
}
|
|
496
507
|
} catch (error) {
|
|
497
508
|
log.critical(
|
|
498
509
|
`Error while integrating code "${code}":`,
|