@svelte-lean/vite 0.6.0 → 0.7.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/CHANGELOG.md +18 -0
- package/README.md +2 -0
- package/dist/behaviors.js +4 -2
- package/dist/scanner.d.ts +1 -1
- package/dist/scanner.js +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @svelte-lean/vite
|
|
2
2
|
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @svelte-lean/primitives@0.7.1
|
|
8
|
+
|
|
9
|
+
## 0.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 3bb9f7d: `data-slean-findable` on any element injects the findable registration module, whatever its value
|
|
14
|
+
(`ATTRIBUTE_BEHAVIORS`).
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [3bb9f7d]
|
|
19
|
+
- @svelte-lean/primitives@0.7.0
|
|
20
|
+
|
|
3
21
|
## 0.6.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -87,6 +87,8 @@ value, so a dynamic value is a use of the behavior and never a dynamic marker:
|
|
|
87
87
|
<!-- @svelte-lean/primitives/hint/register -->
|
|
88
88
|
<button data-slean-copy={row.id}>…</button>
|
|
89
89
|
<!-- @svelte-lean/primitives/copy/register -->
|
|
90
|
+
<span data-slean-findable={short(row.id)}>…</span>
|
|
91
|
+
<!-- @svelte-lean/primitives/findable/register -->
|
|
90
92
|
```
|
|
91
93
|
|
|
92
94
|
The attribute → behavior map is exported as `ATTRIBUTE_BEHAVIORS`. An attribute that reaches an
|
package/dist/behaviors.js
CHANGED
|
@@ -73,7 +73,8 @@ export const BUILTIN_BEHAVIORS = Object.freeze({
|
|
|
73
73
|
'hover-card': `${DEFAULT_PACKAGE}/hover-card/register`,
|
|
74
74
|
menubar: `${DEFAULT_PACKAGE}/menubar/register`,
|
|
75
75
|
hint: `${DEFAULT_PACKAGE}/hint/register`,
|
|
76
|
-
copy: `${DEFAULT_PACKAGE}/copy/register
|
|
76
|
+
copy: `${DEFAULT_PACKAGE}/copy/register`,
|
|
77
|
+
findable: `${DEFAULT_PACKAGE}/findable/register`
|
|
77
78
|
});
|
|
78
79
|
/**
|
|
79
80
|
* Attribute behaviors (ADR 0009): an element carrying one of these attributes uses the behavior,
|
|
@@ -83,7 +84,8 @@ export const BUILTIN_BEHAVIORS = Object.freeze({
|
|
|
83
84
|
*/
|
|
84
85
|
export const ATTRIBUTE_BEHAVIORS = Object.freeze({
|
|
85
86
|
'data-slean-hint': 'hint',
|
|
86
|
-
'data-slean-copy': 'copy'
|
|
87
|
+
'data-slean-copy': 'copy',
|
|
88
|
+
'data-slean-findable': 'findable'
|
|
87
89
|
});
|
|
88
90
|
/**
|
|
89
91
|
* Maps a behavior name to what the build should do with it. `options.behaviors` wins over the
|
package/dist/scanner.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare function locate(source: string, index: number): {
|
|
|
14
14
|
export declare function skipExpression(source: string, start: number, result?: ScanResult): number;
|
|
15
15
|
/**
|
|
16
16
|
* Finds static `data-slean="name"` markers, attribute behaviors (`data-slean-hint`,
|
|
17
|
-
* `data-slean-copy`) and dynamic `data-slean={…}` markers in Svelte source.
|
|
17
|
+
* `data-slean-copy`, `data-slean-findable`) and dynamic `data-slean={…}` markers in Svelte source.
|
|
18
18
|
* Pure: no I/O, no plugin context. `id` is only carried into the result for diagnostics.
|
|
19
19
|
*/
|
|
20
20
|
export declare function scan(source: string, id?: string): ScanResult;
|
package/dist/scanner.js
CHANGED
|
@@ -11,8 +11,8 @@ import { ATTRIBUTE_BEHAVIORS } from './behaviors.js';
|
|
|
11
11
|
* braces cannot unbalance it; an expression that never closes is recorded in
|
|
12
12
|
* `ScanResult.unterminated` so a miss is never silent.
|
|
13
13
|
*
|
|
14
|
-
* Attribute behaviors (ADR 0009) are found by attribute name: `data-slean-hint
|
|
15
|
-
* `data-slean-copy` on an element uses that behavior whatever its value, static, `{expression}`
|
|
14
|
+
* Attribute behaviors (ADR 0009) are found by attribute name: `data-slean-hint`,
|
|
15
|
+
* `data-slean-copy` or `data-slean-findable` on an element uses that behavior whatever its value, static, `{expression}`
|
|
16
16
|
* or absent, so they never produce a dynamic marker.
|
|
17
17
|
*/
|
|
18
18
|
const ATTRIBUTE = 'data-slean';
|
|
@@ -366,7 +366,7 @@ function scanTag(source, start, result) {
|
|
|
366
366
|
}
|
|
367
367
|
/**
|
|
368
368
|
* Finds static `data-slean="name"` markers, attribute behaviors (`data-slean-hint`,
|
|
369
|
-
* `data-slean-copy`) and dynamic `data-slean={…}` markers in Svelte source.
|
|
369
|
+
* `data-slean-copy`, `data-slean-findable`) and dynamic `data-slean={…}` markers in Svelte source.
|
|
370
370
|
* Pure: no I/O, no plugin context. `id` is only carried into the result for diagnostics.
|
|
371
371
|
*/
|
|
372
372
|
export function scan(source, id) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svelte-lean/vite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Vite integration for Svelte Lean: discovers data-slean behaviors in Svelte markup at build time and injects only the registration modules that are used.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ömer Say",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"test": "yarn run -T vitest run"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@svelte-lean/primitives": "^0.
|
|
32
|
+
"@svelte-lean/primitives": "^0.7.1",
|
|
33
33
|
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|