@nsis/dent-ui 0.3.5 → 0.4.1
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/.turbo/turbo-build.log +19 -0
- package/CHANGELOG.md +17 -0
- package/README.md +3 -1
- package/package.json +14 -13
- package/src/App.svelte +44 -11
- package/.gitignore +0 -12
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
$ vite build
|
|
2
|
+
6:24:22 AM [vite-plugin-svelte] no Svelte config found at /home/runner/work/nsis-org/nsis-org/packages/dent-ui - using default configuration.
|
|
3
|
+
[36mvite v8.3.4 [32mbuilding client environment for production...[36m[39m
|
|
4
|
+
transforming...
|
|
5
|
+
✓ 149 modules transformed.
|
|
6
|
+
rendering chunks...
|
|
7
|
+
computing gzip size...
|
|
8
|
+
dist/index.html 0.34 kB │ gzip: 0.24 kB
|
|
9
|
+
dist/assets/ardent_wasm_bg-Bz5RQ-Nz.wasm 209.73 kB │ gzip: 87.81 kB
|
|
10
|
+
dist/assets/web-CQZZv1Rg.js 6.65 kB │ gzip: 2.73 kB
|
|
11
|
+
dist/assets/dent-CuDUSuip.js 58.47 kB │ gzip: 17.01 kB
|
|
12
|
+
dist/assets/index-COh98auV.js 517.77 kB │ gzip: 170.87 kB
|
|
13
|
+
|
|
14
|
+
[32m✓ built in 364ms[39m
|
|
15
|
+
[33m[plugin builtin:vite-reporter]
|
|
16
|
+
(!) Some chunks are larger than 500 kB after minification. Consider:
|
|
17
|
+
- Using dynamic import() to code-split the application
|
|
18
|
+
- Use build.rolldownOptions.output.codeSplitting to improve chunking: https://rolldown.rs/reference/OutputOptions.codeSplitting
|
|
19
|
+
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @nsis/dent-ui
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4875a1f: add engine prop
|
|
8
|
+
|
|
9
|
+
## 0.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 4624557: switch formatter to ardent
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [4624557]
|
|
18
|
+
- @nsis/ardent-wasm@0.1.0
|
|
19
|
+
|
|
3
20
|
## 0.3.5
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://www.npmjs.org/package/@nsis/dent-ui)
|
|
7
7
|
[](https://github.com/idleberg/nsis-org/actions)
|
|
8
8
|
|
|
9
|
-
[Demo Time](https://idleberg.github.io/nsis-org/dent/) 🙌
|
|
9
|
+
[Demo Time](https://idleberg.github.io/nsis-org/dent-ui/) 🙌
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
> [!NOTE]
|
|
22
22
|
> By default, NSIS keywords are matched case-insensitively (e.g. `messagebox` and `MessageBox` are both highlighted). Set `strict` to `true` to require canonical casing.
|
|
23
23
|
|
|
24
|
+
Formatting uses [`@nsis/ardent-wasm`](../ardent-wasm#readme). Set `engine` to `"dent"` to use the classic [`@nsis/dent`](../dent#readme) instead. Only the selected engine is downloaded.
|
|
25
|
+
|
|
24
26
|
## License
|
|
25
27
|
|
|
26
28
|
This work is licensed under [The MIT License](LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsis/dent-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Web UI for the Dent NSIS code formatter",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,22 +26,23 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@codemirror/commands": "^6.11.1",
|
|
29
|
-
"@codemirror/language": "^6.
|
|
30
|
-
"@codemirror/state": "^6.7.
|
|
31
|
-
"@codemirror/view": "^6.43.
|
|
32
|
-
"@lezer/highlight": "^1.2.
|
|
29
|
+
"@codemirror/language": "^6.13.1",
|
|
30
|
+
"@codemirror/state": "^6.7.6",
|
|
31
|
+
"@codemirror/view": "^6.43.15",
|
|
32
|
+
"@lezer/highlight": "^1.2.5",
|
|
33
33
|
"@nsis/codemirror": "0.14.6",
|
|
34
|
+
"@nsis/ardent-wasm": "0.1.0",
|
|
34
35
|
"@nsis/dent": "0.17.0",
|
|
35
|
-
"svelte": "^5.57.
|
|
36
|
+
"svelte": "^5.57.2"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@sveltejs/vite-plugin-svelte": "^7.3.
|
|
39
|
-
"@vitest/browser": "^5.0.
|
|
40
|
-
"@vitest/browser-playwright": "^5.0.
|
|
41
|
-
"playwright": "^1.
|
|
42
|
-
"svelte-check": "^4.7.
|
|
43
|
-
"vite": "^8.3.
|
|
44
|
-
"vitest": "^5.0.
|
|
39
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
40
|
+
"@vitest/browser": "^5.0.5",
|
|
41
|
+
"@vitest/browser-playwright": "^5.0.5",
|
|
42
|
+
"playwright": "^1.64.1",
|
|
43
|
+
"svelte-check": "^4.7.7",
|
|
44
|
+
"vite": "^8.3.4",
|
|
45
|
+
"vitest": "^5.0.5",
|
|
45
46
|
"vitest-browser-svelte": "^3.1.0"
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
package/src/App.svelte
CHANGED
|
@@ -3,11 +3,35 @@ import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
|
|
|
3
3
|
import { indentOnInput } from '@codemirror/language';
|
|
4
4
|
import { EditorState } from '@codemirror/state';
|
|
5
5
|
import { EditorView, keymap } from '@codemirror/view';
|
|
6
|
-
import { createFormatter } from '@nsis/dent';
|
|
7
6
|
import { onDestroy, onMount } from 'svelte';
|
|
8
7
|
import Editor from './Editor.svelte';
|
|
9
8
|
|
|
10
|
-
let {
|
|
9
|
+
let {
|
|
10
|
+
strict = false,
|
|
11
|
+
sample = '',
|
|
12
|
+
engine = 'ardent',
|
|
13
|
+
}: { strict?: boolean; sample?: string; engine?: 'ardent' | 'dent' } = $props();
|
|
14
|
+
|
|
15
|
+
// Each engine is its own chunk, so neither weighs on the initial bundle.
|
|
16
|
+
const engines = {
|
|
17
|
+
ardent: () => import('@nsis/ardent-wasm'),
|
|
18
|
+
dent: () => import('@nsis/dent'),
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Re-imports only when `engine` changes; the module cache makes repeat switches free.
|
|
22
|
+
const formatter = $derived(engines[engine]());
|
|
23
|
+
let loading = $state(true);
|
|
24
|
+
|
|
25
|
+
// Reading `formatter` here starts the download on mount rather than on the first format.
|
|
26
|
+
$effect(() => {
|
|
27
|
+
const pending = formatter;
|
|
28
|
+
const done = () => {
|
|
29
|
+
if (pending === formatter) loading = false;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
loading = true;
|
|
33
|
+
pending.then(done, done);
|
|
34
|
+
});
|
|
11
35
|
|
|
12
36
|
let dark = $state(document.documentElement.dataset.theme !== 'light');
|
|
13
37
|
let themePreference = $state(localStorage.getItem('theme') || 'system');
|
|
@@ -69,16 +93,23 @@ function scheduleAutoFormat() {
|
|
|
69
93
|
debounceTimer = setTimeout(formatInput, 400);
|
|
70
94
|
}
|
|
71
95
|
|
|
72
|
-
function formatInput() {
|
|
73
|
-
|
|
74
|
-
const source = inputView?.state.doc.toString() ?? '';
|
|
75
|
-
|
|
76
|
-
if (!source.trim()) {
|
|
77
|
-
setOutput('');
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
96
|
+
async function formatInput() {
|
|
97
|
+
const requested = engine;
|
|
80
98
|
|
|
81
99
|
try {
|
|
100
|
+
const { createFormatter } = await formatter;
|
|
101
|
+
|
|
102
|
+
// A newer engine took over while this one loaded.
|
|
103
|
+
if (requested !== engine) return;
|
|
104
|
+
|
|
105
|
+
error = '';
|
|
106
|
+
const source = inputView?.state.doc.toString() ?? '';
|
|
107
|
+
|
|
108
|
+
if (!source.trim()) {
|
|
109
|
+
setOutput('');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
82
113
|
const { format } = createFormatter({
|
|
83
114
|
useTabs,
|
|
84
115
|
singleQuote,
|
|
@@ -247,7 +278,9 @@ const outputExtensions = [EditorState.readOnly.of(true), EditorView.lineWrapping
|
|
|
247
278
|
<label class="auto-label">
|
|
248
279
|
<input type="checkbox" bind:checked={autoFormat} /> Auto-format
|
|
249
280
|
</label>
|
|
250
|
-
{#if
|
|
281
|
+
{#if loading}
|
|
282
|
+
<span class="status" role="status" aria-live="polite">Loading formatter engine…</span>
|
|
283
|
+
{:else if status}
|
|
251
284
|
<span class="status" role="status" aria-live="polite">{status}</span>
|
|
252
285
|
{/if}
|
|
253
286
|
{#if error}
|