carbon-preprocess-svelte 0.6.0 → 0.8.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 +25 -12
- package/LICENSE +1 -1
- package/README.md +19 -12
- package/dist/build/build-components.d.ts +7 -4
- package/dist/build/index.d.ts +4 -0
- package/dist/carbon-components-svelte.d.ts +160 -191
- package/dist/carbon-elements.d.ts +1 -0
- package/dist/carbon-icons.d.ts +20853 -6222
- package/dist/carbon-pictograms.d.ts +1079 -704
- package/dist/index.js +12203 -2136
- package/dist/index.mjs +12203 -2136
- package/dist/walk-and-replace.d.ts +5 -1
- package/package.json +25 -19
- package/src/carbon-components-svelte.js +522 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,15 +5,28 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [0.
|
|
8
|
+
## [0.8.1](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.8.1) - 2022-04-10
|
|
9
|
+
|
|
10
|
+
- hot fix to re-build components imports map using a non-linked version of `carbon-components-svelte`
|
|
11
|
+
|
|
12
|
+
## [0.8.0](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.8.0) - 2022-04-10
|
|
13
|
+
|
|
14
|
+
- upgrade `@carbon/icons` to v11.0.1
|
|
15
|
+
- update `optimizeImports` to support `carbon-icons-svelte@11` component imports
|
|
16
|
+
|
|
17
|
+
## [0.7.0](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.7.0) - 2022-03-19
|
|
18
|
+
|
|
19
|
+
- upgrade `carbon-components-svelte` to v0.62.0 to account for the removed `Copy` component and inlined icon components
|
|
20
|
+
|
|
21
|
+
## [0.6.0](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.6.0) - 2021-07-11
|
|
9
22
|
|
|
10
23
|
- upgrade `carbon-components-svelte` to v0.40.0 to include `Breakpoint`, `Theme` components for `optimizeImports`
|
|
11
24
|
|
|
12
|
-
## [0.5.0](https://github.com/
|
|
25
|
+
## [0.5.0](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.5.0) - 2021-07-05
|
|
13
26
|
|
|
14
27
|
- upgrade `carbon-components-svelte` to v0.39.0 to include `RecursiveList`, `TreeView` components for `optimizeImports`
|
|
15
28
|
|
|
16
|
-
## [0.4.0](https://github.com/
|
|
29
|
+
## [0.4.0](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.4.0) - 2021-06-28
|
|
17
30
|
|
|
18
31
|
**Features**
|
|
19
32
|
|
|
@@ -23,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
23
36
|
|
|
24
37
|
- default `include` preprocessor entry test regex to high-level test option
|
|
25
38
|
|
|
26
|
-
## [0.3.0](https://github.com/
|
|
39
|
+
## [0.3.0](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.3.0) - 2021-05-21
|
|
27
40
|
|
|
28
41
|
**Features**
|
|
29
42
|
|
|
@@ -33,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
33
46
|
|
|
34
47
|
- support custom `test` regex per script/markup object in `include` preprocessor
|
|
35
48
|
|
|
36
|
-
## [0.2.0](https://github.com/
|
|
49
|
+
## [0.2.0](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.2.0) - 2021-05-21
|
|
37
50
|
|
|
38
51
|
**Features**
|
|
39
52
|
|
|
@@ -44,25 +57,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
44
57
|
- enrich preprocessor descriptions
|
|
45
58
|
- simplify sample SvelteKit set-up
|
|
46
59
|
|
|
47
|
-
## [0.1.0](https://github.com/
|
|
60
|
+
## [0.1.0](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.1.0) - 2021-05-11
|
|
48
61
|
|
|
49
62
|
**Documentation**
|
|
50
63
|
|
|
51
64
|
- improve preprocessor descriptions, add sample SvelteKit set-up
|
|
52
65
|
|
|
53
|
-
## [0.1.0-rc.5](https://github.com/
|
|
66
|
+
## [0.1.0-rc.5](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.1.0-rc.5) - 2021-05-11
|
|
54
67
|
|
|
55
68
|
**Fixes**
|
|
56
69
|
|
|
57
70
|
- add separate entry point for CJS bundle
|
|
58
71
|
|
|
59
|
-
## [0.1.0-rc.4](https://github.com/
|
|
72
|
+
## [0.1.0-rc.4](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.1.0-rc.4) - 2021-05-10
|
|
60
73
|
|
|
61
74
|
**Fixes**
|
|
62
75
|
|
|
63
76
|
- add TypeScript as a direct dependency
|
|
64
77
|
|
|
65
|
-
## [0.1.0-rc.3](https://github.com/
|
|
78
|
+
## [0.1.0-rc.3](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.1.0-rc.3) - 2021-05-10
|
|
66
79
|
|
|
67
80
|
**Features**
|
|
68
81
|
|
|
@@ -72,7 +85,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
72
85
|
|
|
73
86
|
- list available theme options for the `elements` preprocessor
|
|
74
87
|
|
|
75
|
-
## [0.1.0-rc.2](https://github.com/
|
|
88
|
+
## [0.1.0-rc.2](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.1.0-rc.2) - 2021-05-08
|
|
76
89
|
|
|
77
90
|
**Fixes**
|
|
78
91
|
|
|
@@ -82,7 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
82
95
|
|
|
83
96
|
- add `optimizeCss` API to README
|
|
84
97
|
|
|
85
|
-
## [0.1.0-rc.1](https://github.com/
|
|
98
|
+
## [0.1.0-rc.1](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.1.0-rc.1) - 2021-05-08
|
|
86
99
|
|
|
87
100
|
**Fixes**
|
|
88
101
|
|
|
@@ -95,6 +108,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
95
108
|
|
|
96
109
|
- use ESM instead of CJS syntax in `svelte.config.js` usage examples
|
|
97
110
|
|
|
98
|
-
## [0.1.0-rc.0](https://github.com/
|
|
111
|
+
## [0.1.0-rc.0](https://github.com/carbon-design-system/carbon-preprocess-svelte/releases/tag/v0.1.0-rc.0) - 2021-05-07
|
|
99
112
|
|
|
100
113
|
- initial release
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2021 IBM
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -3,18 +3,29 @@
|
|
|
3
3
|
[![NPM][npm]][npm-url]
|
|
4
4
|

|
|
5
5
|

|
|
6
|
-
[![Build][build]][build-badge]
|
|
7
6
|
|
|
8
7
|
> Collection of [Svelte preprocessors](https://svelte.dev/docs#svelte_preprocess) for the Carbon Design System
|
|
9
8
|
|
|
10
9
|
## Installation
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
**Yarn**
|
|
12
|
+
|
|
13
|
+
```sh
|
|
13
14
|
yarn add -D carbon-preprocess-svelte
|
|
14
|
-
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**NPM**
|
|
18
|
+
|
|
19
|
+
```sh
|
|
15
20
|
npm i -D carbon-preprocess-svelte
|
|
16
21
|
```
|
|
17
22
|
|
|
23
|
+
**pnpm**
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pnpm i -D carbon-preprocess-svelte
|
|
27
|
+
```
|
|
28
|
+
|
|
18
29
|
## Usage
|
|
19
30
|
|
|
20
31
|
This library contains the following preprocessors and plugins:
|
|
@@ -32,9 +43,9 @@ This library contains the following preprocessors and plugins:
|
|
|
32
43
|
|
|
33
44
|
The preprocessor optimizes imports from the following packages:
|
|
34
45
|
|
|
35
|
-
- [carbon-components-svelte](https://github.com/
|
|
36
|
-
- [carbon-icons-svelte](https://github.com/
|
|
37
|
-
- [carbon-pictograms-svelte](https://github.com/
|
|
46
|
+
- [carbon-components-svelte](https://github.com/carbon-design-system/carbon-components-svelte)
|
|
47
|
+
- [carbon-icons-svelte](https://github.com/carbon-design-system/carbon-icons-svelte)
|
|
48
|
+
- [carbon-pictograms-svelte](https://github.com/carbon-design-system/carbon-pictograms-svelte)
|
|
38
49
|
|
|
39
50
|
**Example**
|
|
40
51
|
|
|
@@ -73,7 +84,6 @@ import { optimizeCss } from "carbon-preprocess-svelte";
|
|
|
73
84
|
|
|
74
85
|
export default {
|
|
75
86
|
kit: {
|
|
76
|
-
target: "#svelte",
|
|
77
87
|
adapter: adapter(),
|
|
78
88
|
vite: {
|
|
79
89
|
plugins: [process.env.NODE_ENV === "production" && optimizeCss()],
|
|
@@ -185,7 +195,7 @@ interface ElementsOptions {
|
|
|
185
195
|
|
|
186
196
|
`icons` is a Svelte markup preprocessor that inlines [Carbon SVG icons](https://www.carbondesignsystem.com/guidelines/icons/library/).
|
|
187
197
|
|
|
188
|
-
The only required attribute is `name`, which represents the module name of the icon. Refer to [carbon-icons-svelte/ICON_INDEX.md](https://github.com/
|
|
198
|
+
The only required attribute is `name`, which represents the module name of the icon. Refer to [carbon-icons-svelte/ICON_INDEX.md](https://github.com/carbon-design-system/carbon-icons-svelte/blob/master/ICON_INDEX.md) for a list of supported icons.
|
|
189
199
|
|
|
190
200
|
**Example**
|
|
191
201
|
|
|
@@ -209,7 +219,7 @@ export default {
|
|
|
209
219
|
|
|
210
220
|
`pictograms` is a Svelte markup preprocessor that inlines [Carbon SVG pictograms](https://www.carbondesignsystem.com/guidelines/pictograms/library/).
|
|
211
221
|
|
|
212
|
-
The only required attribute is `name`, which represents the module name of the pictogram. Refer to [carbon-pictograms-svelte/PICTOGRAM_INDEX.md](https://github.com/
|
|
222
|
+
The only required attribute is `name`, which represents the module name of the pictogram. Refer to [carbon-pictograms-svelte/PICTOGRAM_INDEX.md](https://github.com/carbon-design-system/carbon-pictograms-svelte/blob/master/PICTOGRAM_INDEX.md) for a list of supported pictograms.
|
|
213
223
|
|
|
214
224
|
**Example**
|
|
215
225
|
|
|
@@ -438,7 +448,6 @@ import { optimizeImports, optimizeCss } from "carbon-preprocess-svelte";
|
|
|
438
448
|
export default {
|
|
439
449
|
preprocess: [optimizeImports()],
|
|
440
450
|
kit: {
|
|
441
|
-
target: "#svelte",
|
|
442
451
|
adapter: adapter(),
|
|
443
452
|
vite: {
|
|
444
453
|
plugins: [process.env.NODE_ENV === "production" && optimizeCss()],
|
|
@@ -457,5 +466,3 @@ Refer to the [contributing guidelines](CONTRIBUTING.md).
|
|
|
457
466
|
|
|
458
467
|
[npm]: https://img.shields.io/npm/v/carbon-preprocess-svelte.svg?color=262626&style=for-the-badge
|
|
459
468
|
[npm-url]: https://npmjs.com/package/carbon-preprocess-svelte
|
|
460
|
-
[build]: https://img.shields.io/travis/com/ibm/carbon-preprocess-svelte?color=24a148&style=for-the-badge
|
|
461
|
-
[build-badge]: https://travis-ci.com/ibm/carbon-preprocess-svelte
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { BuildApi } from "../build";
|
|
1
|
+
import type { BuildApi } from "../build";
|
|
2
|
+
declare type ExportName = string;
|
|
3
|
+
interface BuildComponentsApi {
|
|
4
|
+
path: string;
|
|
5
|
+
}
|
|
2
6
|
export interface BuildComponents extends BuildApi {
|
|
3
|
-
components: Record<
|
|
4
|
-
path: string;
|
|
5
|
-
}>;
|
|
7
|
+
components: Record<ExportName, BuildComponentsApi>;
|
|
6
8
|
}
|
|
9
|
+
export {};
|