├── .gitignore
├── .npmignore
├── CODE_OF_CONDUCT.md
├── README.md
├── example
├── .gitignore
├── favicon.svg
├── index.html
├── package.json
├── pnpm-lock.yaml
├── pubspec.lock
├── pubspec.yaml
├── src
│ ├── icons.js
│ ├── index.dart
│ ├── main.js
│ └── style.scss
└── vite.config.mjs
├── index.d.ts
├── package.json
├── renovate.json
└── src
└── index.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | yarn.lock
3 | pnpm-lock.yaml
4 | package-lock.json
5 | .pnpm-debug.log
6 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | example/
2 | CODE_OF_CONDUCT.md
3 | renovate.json
4 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, caste, color, religion, or sexual identity
10 | and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the
26 | overall community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or
31 | advances of any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email
35 | address, without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | coc@geopjr.dev.
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series
86 | of actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or
93 | permanent ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within
113 | the community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.1, available at
119 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120 |
121 | Community Impact Guidelines were inspired by
122 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123 |
124 | For answers to common questions about this code of conduct, see the FAQ at
125 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available
126 | at [https://www.contributor-covenant.org/translations][translations].
127 |
128 | [homepage]: https://www.contributor-covenant.org
129 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130 | [Mozilla CoC]: https://github.com/mozilla/diversity
131 | [FAQ]: https://www.contributor-covenant.org/faq
132 | [translations]: https://www.contributor-covenant.org/translations
133 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | vite-plugin-dart
5 | Import .dart files effortlessly.
6 |
7 |
8 |
9 |
10 |
11 | #
12 |
13 | ## Install
14 |
15 | - Install the plugin:
16 |
17 | ```bash
18 | pnpm i -D vite-plugin-dart # npm, yarn
19 | ```
20 |
21 | - Install [Dart](https://dart.dev/get-dart)
22 |
23 | - Add `vite-plugin-dart` to your `vite.config.mjs`:
24 |
25 | ```js
26 | // vite.config.mjs (or .ts)
27 | import Dart from "vite-plugin-dart";
28 |
29 | export default {
30 | plugins: [Dart()],
31 | };
32 | ```
33 |
34 | #
35 |
36 | ## Importing
37 |
38 | It's as simple as:
39 |
40 | ```js
41 | import "./index.dart";
42 | ```
43 |
44 | All your Pub packages should work as expected! For an example take a look at the [example](./example) folder.
45 |
46 | #
47 |
48 | ## Options
49 |
50 | Here's the default options:
51 |
52 | ```js
53 | const defaultConfig = {
54 | dart: "dart",
55 | minify: false,
56 | "enable-asserts": false,
57 | verbose: false,
58 | define: [],
59 | packages: "",
60 | "suppress-warnings": false,
61 | "fatal-warnings": false,
62 | "suppress-hints": false,
63 | "enable-diagnostic-colors": false,
64 | terse: false,
65 | "show-package-warnings": false,
66 | csp: false,
67 | "no-source-maps": false,
68 | "omit-late-names": false,
69 | O: 1,
70 | "omit-implicit-checks": false,
71 | "trust-primitives": false,
72 | "lax-runtime-type-to-string": false,
73 | verbosity: "warning",
74 | stdio: true,
75 | };
76 | ```
77 |
78 | For most, you can read their description by running `dart compile js -h -v`.
79 |
80 | The ones that are not there are:
81 |
82 | ```
83 | dart: Dart binary location
84 | verbosity: Verbosity level (all, info, warning, error)
85 | stdio: Whether or not to pass the dart stdio to parent
86 | ```
87 |
88 | It uses JSDoc, so make sure to follow your IDE's annotations.
89 |
90 | #
91 |
92 | ## Example
93 |
94 | See the [example](./example) folder.
95 |
96 | All tools used there are Dart packages!
97 |
98 | #
99 |
100 | ## How does it work?
101 |
102 | Dart can compile to JS using `dart2js`. This plugin compiles your Dart files using that at your OS' tmp folder and then after cleaning the generated sourcemaps, returns it to Vite which imports it.
103 |
104 | #
105 |
106 | ## Deploying
107 |
108 | Most platforms do not provide `dart` pre-installed so you need to install it.
109 |
110 | The general workflow is: `Install Dart => npm i => dart pub get => npm run build`.
111 |
112 | For example, here's the Vercel config for this repo:
113 |
114 | ```bash
115 | Build Command: cd example && npm run build
116 |
117 | Output Dir: ./example/dist
118 |
119 | Install Command: yum install unzip -y && cd example && if [ ! -d "./dart-sdk/" ]; then curl -L https://storage.googleapis.com/dart-archive/channels/be/raw/latest/sdk/dartsdk-linux-x64-release.zip > dart.zip; fi && unzip -qq dart.zip && npm i && ./dart-sdk/bin/dart pub get
120 | ```
121 |
122 | At the same time, [vite.config.mjs](./example/vite.config.mjs) has some options for this plugin based on the current environment:
123 |
124 | ```js
125 | Dart({
126 | // Optimizations set to 2 on prod
127 | O: mode === "development" ? 1 : 2,
128 | // Dart location when on Vercel (This is a custom env var on Vercel, set to true)
129 | dart: process.env.VERCEL ? "./dart-sdk/bin/dart" : "dart",
130 | }),
131 | ```
132 |
133 | #
134 |
135 | ## Contributing
136 |
137 | 1. Read the [Code of Conduct](https://github.com/GeopJr/vite-plugin-dart/blob/main/CODE_OF_CONDUCT.md)
138 | 2. Fork it ( https://github.com/GeopJr/vite-plugin-dart/fork )
139 | 3. Create your feature branch (git checkout -b my-new-feature)
140 | 4. Commit your changes (git commit -am 'Add some feature')
141 | 5. Push to the branch (git push origin my-new-feature)
142 | 6. Create a new Pull Request
143 |
144 | > Dart and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.
145 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | .dart_tool/
2 | .packages
3 | dist/
4 |
--------------------------------------------------------------------------------
/example/favicon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/example/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite Plugin Dart
8 |
9 |
13 |
14 |
15 |
24 |
25 |
26 |
37 | QRCode Generator
38 |
39 |
44 |
45 |
48 |
49 |
50 |
51 | QR
52 |
53 |
54 |
55 |
61 |
62 |
63 |
64 | UUIDv4 Generator
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | Generate
74 |
75 |
76 |
77 |
78 | Text Art Generator
79 |
80 |
81 |
82 |
83 |
84 | Text Art
85 |
86 |
87 |
88 |
96 |
97 |
98 |
103 | Tip: Try typing "Crystal", "Svelte", "Vue", "Dart" & More!
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vite_plugin_dart_example",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "dev": "vite",
6 | "build": "vite build",
7 | "serve": "vite preview"
8 | },
9 | "devDependencies": {
10 | "sass": "1.58.0",
11 | "vite": "4.1.1"
12 | },
13 | "dependencies": {
14 | "@iconify/icons-logos": "1.2.23",
15 | "@material/button": "14.0.0",
16 | "@material/card": "14.0.0",
17 | "@material/ripple": "14.0.0",
18 | "@material/textfield": "14.0.0",
19 | "@material/top-app-bar": "14.0.0",
20 | "@material/typography": "14.0.0",
21 | "ress": "5.0.2"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/pnpm-lock.yaml:
--------------------------------------------------------------------------------
1 | lockfileVersion: 5.4
2 |
3 | specifiers:
4 | '@iconify/icons-logos': 1.2.23
5 | '@material/button': 14.0.0
6 | '@material/card': 14.0.0
7 | '@material/ripple': 14.0.0
8 | '@material/textfield': 14.0.0
9 | '@material/top-app-bar': 14.0.0
10 | '@material/typography': 14.0.0
11 | ress: 5.0.2
12 | sass: 1.58.0
13 | vite: 4.1.1
14 |
15 | dependencies:
16 | '@iconify/icons-logos': 1.2.23
17 | '@material/button': 14.0.0
18 | '@material/card': 14.0.0
19 | '@material/ripple': 14.0.0
20 | '@material/textfield': 14.0.0
21 | '@material/top-app-bar': 14.0.0
22 | '@material/typography': 14.0.0
23 | ress: 5.0.2
24 |
25 | devDependencies:
26 | sass: 1.58.0
27 | vite: 4.1.1_sass@1.58.0
28 |
29 | packages:
30 |
31 | /@esbuild/android-arm/0.16.17:
32 | resolution: {integrity: sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==}
33 | engines: {node: '>=12'}
34 | cpu: [arm]
35 | os: [android]
36 | requiresBuild: true
37 | dev: true
38 | optional: true
39 |
40 | /@esbuild/android-arm64/0.16.17:
41 | resolution: {integrity: sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==}
42 | engines: {node: '>=12'}
43 | cpu: [arm64]
44 | os: [android]
45 | requiresBuild: true
46 | dev: true
47 | optional: true
48 |
49 | /@esbuild/android-x64/0.16.17:
50 | resolution: {integrity: sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==}
51 | engines: {node: '>=12'}
52 | cpu: [x64]
53 | os: [android]
54 | requiresBuild: true
55 | dev: true
56 | optional: true
57 |
58 | /@esbuild/darwin-arm64/0.16.17:
59 | resolution: {integrity: sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==}
60 | engines: {node: '>=12'}
61 | cpu: [arm64]
62 | os: [darwin]
63 | requiresBuild: true
64 | dev: true
65 | optional: true
66 |
67 | /@esbuild/darwin-x64/0.16.17:
68 | resolution: {integrity: sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==}
69 | engines: {node: '>=12'}
70 | cpu: [x64]
71 | os: [darwin]
72 | requiresBuild: true
73 | dev: true
74 | optional: true
75 |
76 | /@esbuild/freebsd-arm64/0.16.17:
77 | resolution: {integrity: sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==}
78 | engines: {node: '>=12'}
79 | cpu: [arm64]
80 | os: [freebsd]
81 | requiresBuild: true
82 | dev: true
83 | optional: true
84 |
85 | /@esbuild/freebsd-x64/0.16.17:
86 | resolution: {integrity: sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==}
87 | engines: {node: '>=12'}
88 | cpu: [x64]
89 | os: [freebsd]
90 | requiresBuild: true
91 | dev: true
92 | optional: true
93 |
94 | /@esbuild/linux-arm/0.16.17:
95 | resolution: {integrity: sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==}
96 | engines: {node: '>=12'}
97 | cpu: [arm]
98 | os: [linux]
99 | requiresBuild: true
100 | dev: true
101 | optional: true
102 |
103 | /@esbuild/linux-arm64/0.16.17:
104 | resolution: {integrity: sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==}
105 | engines: {node: '>=12'}
106 | cpu: [arm64]
107 | os: [linux]
108 | requiresBuild: true
109 | dev: true
110 | optional: true
111 |
112 | /@esbuild/linux-ia32/0.16.17:
113 | resolution: {integrity: sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==}
114 | engines: {node: '>=12'}
115 | cpu: [ia32]
116 | os: [linux]
117 | requiresBuild: true
118 | dev: true
119 | optional: true
120 |
121 | /@esbuild/linux-loong64/0.16.17:
122 | resolution: {integrity: sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==}
123 | engines: {node: '>=12'}
124 | cpu: [loong64]
125 | os: [linux]
126 | requiresBuild: true
127 | dev: true
128 | optional: true
129 |
130 | /@esbuild/linux-mips64el/0.16.17:
131 | resolution: {integrity: sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==}
132 | engines: {node: '>=12'}
133 | cpu: [mips64el]
134 | os: [linux]
135 | requiresBuild: true
136 | dev: true
137 | optional: true
138 |
139 | /@esbuild/linux-ppc64/0.16.17:
140 | resolution: {integrity: sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==}
141 | engines: {node: '>=12'}
142 | cpu: [ppc64]
143 | os: [linux]
144 | requiresBuild: true
145 | dev: true
146 | optional: true
147 |
148 | /@esbuild/linux-riscv64/0.16.17:
149 | resolution: {integrity: sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==}
150 | engines: {node: '>=12'}
151 | cpu: [riscv64]
152 | os: [linux]
153 | requiresBuild: true
154 | dev: true
155 | optional: true
156 |
157 | /@esbuild/linux-s390x/0.16.17:
158 | resolution: {integrity: sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==}
159 | engines: {node: '>=12'}
160 | cpu: [s390x]
161 | os: [linux]
162 | requiresBuild: true
163 | dev: true
164 | optional: true
165 |
166 | /@esbuild/linux-x64/0.16.17:
167 | resolution: {integrity: sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==}
168 | engines: {node: '>=12'}
169 | cpu: [x64]
170 | os: [linux]
171 | requiresBuild: true
172 | dev: true
173 | optional: true
174 |
175 | /@esbuild/netbsd-x64/0.16.17:
176 | resolution: {integrity: sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==}
177 | engines: {node: '>=12'}
178 | cpu: [x64]
179 | os: [netbsd]
180 | requiresBuild: true
181 | dev: true
182 | optional: true
183 |
184 | /@esbuild/openbsd-x64/0.16.17:
185 | resolution: {integrity: sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==}
186 | engines: {node: '>=12'}
187 | cpu: [x64]
188 | os: [openbsd]
189 | requiresBuild: true
190 | dev: true
191 | optional: true
192 |
193 | /@esbuild/sunos-x64/0.16.17:
194 | resolution: {integrity: sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==}
195 | engines: {node: '>=12'}
196 | cpu: [x64]
197 | os: [sunos]
198 | requiresBuild: true
199 | dev: true
200 | optional: true
201 |
202 | /@esbuild/win32-arm64/0.16.17:
203 | resolution: {integrity: sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==}
204 | engines: {node: '>=12'}
205 | cpu: [arm64]
206 | os: [win32]
207 | requiresBuild: true
208 | dev: true
209 | optional: true
210 |
211 | /@esbuild/win32-ia32/0.16.17:
212 | resolution: {integrity: sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==}
213 | engines: {node: '>=12'}
214 | cpu: [ia32]
215 | os: [win32]
216 | requiresBuild: true
217 | dev: true
218 | optional: true
219 |
220 | /@esbuild/win32-x64/0.16.17:
221 | resolution: {integrity: sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==}
222 | engines: {node: '>=12'}
223 | cpu: [x64]
224 | os: [win32]
225 | requiresBuild: true
226 | dev: true
227 | optional: true
228 |
229 | /@iconify/icons-logos/1.2.23:
230 | resolution: {integrity: sha512-XQZyfF4AiXgQjZYN12LPymGhd9UMG0666hIzTYecM+d+jNqdLcs2zJLxNmBnTtPi+3t5JsHW+TSus7k9YydQzw==}
231 | dependencies:
232 | '@iconify/types': 1.0.12
233 | dev: false
234 |
235 | /@iconify/types/1.0.12:
236 | resolution: {integrity: sha512-6er6wSGF3hgc1JEZqiGpg21CTCjHBYOUwqLmb2Idzkjiw6ogalGP0ZMLVutCzah+0WB4yP+Zd2oVPN8jvJ+Ftg==}
237 | dev: false
238 |
239 | /@material/animation/14.0.0:
240 | resolution: {integrity: sha512-VlYSfUaIj/BBVtRZI8Gv0VvzikFf+XgK0Zdgsok5c1v5DDnNz5tpB8mnGrveWz0rHbp1X4+CWLKrTwNmjrw3Xw==}
241 | dependencies:
242 | tslib: 2.3.1
243 | dev: false
244 |
245 | /@material/base/14.0.0:
246 | resolution: {integrity: sha512-Ou7vS7n1H4Y10MUZyYAbt6H0t67c6urxoCgeVT7M38aQlaNUwFMODp7KT/myjYz2YULfhu3PtfSV3Sltgac9mA==}
247 | dependencies:
248 | tslib: 2.3.1
249 | dev: false
250 |
251 | /@material/button/14.0.0:
252 | resolution: {integrity: sha512-dqqHaJq0peyXBZupFzCjmvScrfljyVU66ZCS3oldsaaj5iz8sn33I/45Z4zPzdR5F5z8ExToHkRcXhakj1UEAA==}
253 | dependencies:
254 | '@material/density': 14.0.0
255 | '@material/dom': 14.0.0
256 | '@material/elevation': 14.0.0
257 | '@material/feature-targeting': 14.0.0
258 | '@material/focus-ring': 14.0.0
259 | '@material/ripple': 14.0.0
260 | '@material/rtl': 14.0.0
261 | '@material/shape': 14.0.0
262 | '@material/theme': 14.0.0
263 | '@material/tokens': 14.0.0
264 | '@material/touch-target': 14.0.0
265 | '@material/typography': 14.0.0
266 | tslib: 2.3.1
267 | dev: false
268 |
269 | /@material/card/14.0.0:
270 | resolution: {integrity: sha512-SnpYWUrCb92meGYLXV7qa/k40gnHR6rPki6A1wz0OAyG2twY48f0HLscAqxBLvbbm1LuRaqjz0RLKGH3VzxZHw==}
271 | dependencies:
272 | '@material/dom': 14.0.0
273 | '@material/elevation': 14.0.0
274 | '@material/feature-targeting': 14.0.0
275 | '@material/ripple': 14.0.0
276 | '@material/rtl': 14.0.0
277 | '@material/shape': 14.0.0
278 | '@material/theme': 14.0.0
279 | tslib: 2.3.1
280 | dev: false
281 |
282 | /@material/density/14.0.0:
283 | resolution: {integrity: sha512-NlxXBV5XjNsKd8UXF4K/+fOXLxoFNecKbsaQO6O2u+iG8QBfFreKRmkhEBb2hPPwC3w8nrODwXX0lHV+toICQw==}
284 | dependencies:
285 | tslib: 2.3.1
286 | dev: false
287 |
288 | /@material/dom/14.0.0:
289 | resolution: {integrity: sha512-8t88XyacclTj8qsIw9q0vEj4PI2KVncLoIsIMzwuMx49P2FZg6TsLjor262MI3Qs00UWAifuLMrhnOnfyrbe7Q==}
290 | dependencies:
291 | '@material/feature-targeting': 14.0.0
292 | tslib: 2.3.1
293 | dev: false
294 |
295 | /@material/elevation/14.0.0:
296 | resolution: {integrity: sha512-Di3tkxTpXwvf1GJUmaC8rd+zVh5dB2SWMBGagL4+kT8UmjSISif/OPRGuGnXs3QhF6nmEjkdC0ijdZLcYQkepw==}
297 | dependencies:
298 | '@material/animation': 14.0.0
299 | '@material/base': 14.0.0
300 | '@material/feature-targeting': 14.0.0
301 | '@material/rtl': 14.0.0
302 | '@material/theme': 14.0.0
303 | tslib: 2.3.1
304 | dev: false
305 |
306 | /@material/feature-targeting/14.0.0:
307 | resolution: {integrity: sha512-a5WGgHEq5lJeeNL5yevtgoZjBjXWy6+klfVWQEh8oyix/rMJygGgO7gEc52uv8fB8uAIoYEB3iBMOv8jRq8FeA==}
308 | dependencies:
309 | tslib: 2.3.1
310 | dev: false
311 |
312 | /@material/floating-label/14.0.0:
313 | resolution: {integrity: sha512-Aq8BboP1sbNnOtsV72AfaYirHyOrQ/GKFoLrZ1Jt+ZGIAuXPETcj9z7nQDznst0ZeKcz420PxNn9tsybTbeL/Q==}
314 | dependencies:
315 | '@material/animation': 14.0.0
316 | '@material/base': 14.0.0
317 | '@material/dom': 14.0.0
318 | '@material/feature-targeting': 14.0.0
319 | '@material/rtl': 14.0.0
320 | '@material/theme': 14.0.0
321 | '@material/typography': 14.0.0
322 | tslib: 2.3.1
323 | dev: false
324 |
325 | /@material/focus-ring/14.0.0:
326 | resolution: {integrity: sha512-fqqka6iSfQGJG3Le48RxPCtnOiaLGPDPikhktGbxlyW9srBVMgeCiONfHM7IT/1eu80O0Y67Lh/4ohu5+C+VAQ==}
327 | dependencies:
328 | '@material/dom': 14.0.0
329 | '@material/feature-targeting': 14.0.0
330 | '@material/rtl': 14.0.0
331 | dev: false
332 |
333 | /@material/line-ripple/14.0.0:
334 | resolution: {integrity: sha512-Rx9eSnfp3FcsNz4O+fobNNq2PSm5tYHC3hRpY2ZK3ghTvgp3Y40/soaGEi/Vdg0F7jJXRaBSNOe6p5t9CVfy8Q==}
335 | dependencies:
336 | '@material/animation': 14.0.0
337 | '@material/base': 14.0.0
338 | '@material/feature-targeting': 14.0.0
339 | '@material/theme': 14.0.0
340 | tslib: 2.3.1
341 | dev: false
342 |
343 | /@material/notched-outline/14.0.0:
344 | resolution: {integrity: sha512-6S58DlWmhCDr4RQF2RuwqANxlmLdHtWy2mF4JQLD9WOiCg4qY9eCQnMXu3Tbhr7f/nOZ0vzc7AtA3vfJoZmCSw==}
345 | dependencies:
346 | '@material/base': 14.0.0
347 | '@material/feature-targeting': 14.0.0
348 | '@material/floating-label': 14.0.0
349 | '@material/rtl': 14.0.0
350 | '@material/shape': 14.0.0
351 | '@material/theme': 14.0.0
352 | tslib: 2.3.1
353 | dev: false
354 |
355 | /@material/ripple/14.0.0:
356 | resolution: {integrity: sha512-9XoGBFd5JhFgELgW7pqtiLy+CnCIcV2s9cQ2BWbOQeA8faX9UZIDUx/g76nHLZ7UzKFtsULJxZTwORmsEt2zvw==}
357 | dependencies:
358 | '@material/animation': 14.0.0
359 | '@material/base': 14.0.0
360 | '@material/dom': 14.0.0
361 | '@material/feature-targeting': 14.0.0
362 | '@material/rtl': 14.0.0
363 | '@material/theme': 14.0.0
364 | tslib: 2.3.1
365 | dev: false
366 |
367 | /@material/rtl/14.0.0:
368 | resolution: {integrity: sha512-xl6OZYyRjuiW2hmbjV2omMV8sQtfmKAjeWnD1RMiAPLCTyOW9Lh/PYYnXjxUrNa0cRwIIbOn5J7OYXokja8puA==}
369 | dependencies:
370 | '@material/theme': 14.0.0
371 | tslib: 2.3.1
372 | dev: false
373 |
374 | /@material/shape/14.0.0:
375 | resolution: {integrity: sha512-o0mJB0+feOv473KckI8gFnUo8IQAaEA6ynXzw3VIYFjPi48pJwrxa0mZcJP/OoTXrCbDzDeFJfDPXEmRioBb9A==}
376 | dependencies:
377 | '@material/feature-targeting': 14.0.0
378 | '@material/rtl': 14.0.0
379 | '@material/theme': 14.0.0
380 | tslib: 2.3.1
381 | dev: false
382 |
383 | /@material/textfield/14.0.0:
384 | resolution: {integrity: sha512-HGbtAlvlIB2vWBq85yw5wQeeP3Kndl6Z0TJzQ6piVtcfdl2mPyWhuuVHQRRAOis3rCIaAAaxCQYYTJh8wIi0XQ==}
385 | dependencies:
386 | '@material/animation': 14.0.0
387 | '@material/base': 14.0.0
388 | '@material/density': 14.0.0
389 | '@material/dom': 14.0.0
390 | '@material/feature-targeting': 14.0.0
391 | '@material/floating-label': 14.0.0
392 | '@material/line-ripple': 14.0.0
393 | '@material/notched-outline': 14.0.0
394 | '@material/ripple': 14.0.0
395 | '@material/rtl': 14.0.0
396 | '@material/shape': 14.0.0
397 | '@material/theme': 14.0.0
398 | '@material/tokens': 14.0.0
399 | '@material/typography': 14.0.0
400 | tslib: 2.3.1
401 | dev: false
402 |
403 | /@material/theme/14.0.0:
404 | resolution: {integrity: sha512-6/SENWNIFuXzeHMPHrYwbsXKgkvCtWuzzQ3cUu4UEt3KcQ5YpViazIM6h8ByYKZP8A9d8QpkJ0WGX5btGDcVoA==}
405 | dependencies:
406 | '@material/feature-targeting': 14.0.0
407 | tslib: 2.3.1
408 | dev: false
409 |
410 | /@material/tokens/14.0.0:
411 | resolution: {integrity: sha512-SXgB9VwsKW4DFkHmJfDIS0x0cGdMWC1D06m6z/WQQ5P5j6/m0pKrbHVlrLzXcRjau+mFhXGvj/KyPo9Pp/Rc8Q==}
412 | dependencies:
413 | '@material/elevation': 14.0.0
414 | dev: false
415 |
416 | /@material/top-app-bar/14.0.0:
417 | resolution: {integrity: sha512-uPej5vHgZnlSB1+koiA9FnabXrHh3O/Npl2ifpUgDVwHDSOxKvLp2LNjyCO71co1QLNnNHIU0xXv3B97Gb0rpA==}
418 | dependencies:
419 | '@material/animation': 14.0.0
420 | '@material/base': 14.0.0
421 | '@material/elevation': 14.0.0
422 | '@material/ripple': 14.0.0
423 | '@material/rtl': 14.0.0
424 | '@material/shape': 14.0.0
425 | '@material/theme': 14.0.0
426 | '@material/typography': 14.0.0
427 | tslib: 2.3.1
428 | dev: false
429 |
430 | /@material/touch-target/14.0.0:
431 | resolution: {integrity: sha512-o3kvxmS4HkmZoQTvtzLJrqSG+ezYXkyINm3Uiwio1PTg67pDgK5FRwInkz0VNaWPcw9+5jqjUQGjuZMtjQMq8w==}
432 | dependencies:
433 | '@material/base': 14.0.0
434 | '@material/feature-targeting': 14.0.0
435 | '@material/rtl': 14.0.0
436 | tslib: 2.3.1
437 | dev: false
438 |
439 | /@material/typography/14.0.0:
440 | resolution: {integrity: sha512-/QtHBYiTR+TPMryM/CT386B2WlAQf/Ae32V324Z7P40gHLKY/YBXx7FDutAWZFeOerq/two4Nd2aAHBcMM2wMw==}
441 | dependencies:
442 | '@material/feature-targeting': 14.0.0
443 | '@material/theme': 14.0.0
444 | tslib: 2.3.1
445 | dev: false
446 |
447 | /anymatch/3.1.2:
448 | resolution: {integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==}
449 | engines: {node: '>= 8'}
450 | dependencies:
451 | normalize-path: 3.0.0
452 | picomatch: 2.3.0
453 | dev: true
454 |
455 | /binary-extensions/2.2.0:
456 | resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
457 | engines: {node: '>=8'}
458 | dev: true
459 |
460 | /braces/3.0.2:
461 | resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
462 | engines: {node: '>=8'}
463 | dependencies:
464 | fill-range: 7.0.1
465 | dev: true
466 |
467 | /chokidar/3.5.2:
468 | resolution: {integrity: sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==}
469 | engines: {node: '>= 8.10.0'}
470 | dependencies:
471 | anymatch: 3.1.2
472 | braces: 3.0.2
473 | glob-parent: 5.1.2
474 | is-binary-path: 2.1.0
475 | is-glob: 4.0.2
476 | normalize-path: 3.0.0
477 | readdirp: 3.6.0
478 | optionalDependencies:
479 | fsevents: 2.3.2
480 | dev: true
481 |
482 | /esbuild/0.16.17:
483 | resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==}
484 | engines: {node: '>=12'}
485 | hasBin: true
486 | requiresBuild: true
487 | optionalDependencies:
488 | '@esbuild/android-arm': 0.16.17
489 | '@esbuild/android-arm64': 0.16.17
490 | '@esbuild/android-x64': 0.16.17
491 | '@esbuild/darwin-arm64': 0.16.17
492 | '@esbuild/darwin-x64': 0.16.17
493 | '@esbuild/freebsd-arm64': 0.16.17
494 | '@esbuild/freebsd-x64': 0.16.17
495 | '@esbuild/linux-arm': 0.16.17
496 | '@esbuild/linux-arm64': 0.16.17
497 | '@esbuild/linux-ia32': 0.16.17
498 | '@esbuild/linux-loong64': 0.16.17
499 | '@esbuild/linux-mips64el': 0.16.17
500 | '@esbuild/linux-ppc64': 0.16.17
501 | '@esbuild/linux-riscv64': 0.16.17
502 | '@esbuild/linux-s390x': 0.16.17
503 | '@esbuild/linux-x64': 0.16.17
504 | '@esbuild/netbsd-x64': 0.16.17
505 | '@esbuild/openbsd-x64': 0.16.17
506 | '@esbuild/sunos-x64': 0.16.17
507 | '@esbuild/win32-arm64': 0.16.17
508 | '@esbuild/win32-ia32': 0.16.17
509 | '@esbuild/win32-x64': 0.16.17
510 | dev: true
511 |
512 | /fill-range/7.0.1:
513 | resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
514 | engines: {node: '>=8'}
515 | dependencies:
516 | to-regex-range: 5.0.1
517 | dev: true
518 |
519 | /fsevents/2.3.2:
520 | resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
521 | engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
522 | os: [darwin]
523 | requiresBuild: true
524 | dev: true
525 | optional: true
526 |
527 | /function-bind/1.1.1:
528 | resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
529 | dev: true
530 |
531 | /glob-parent/5.1.2:
532 | resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
533 | engines: {node: '>= 6'}
534 | dependencies:
535 | is-glob: 4.0.2
536 | dev: true
537 |
538 | /has/1.0.3:
539 | resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
540 | engines: {node: '>= 0.4.0'}
541 | dependencies:
542 | function-bind: 1.1.1
543 | dev: true
544 |
545 | /immutable/4.0.0:
546 | resolution: {integrity: sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==}
547 | dev: true
548 |
549 | /is-binary-path/2.1.0:
550 | resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
551 | engines: {node: '>=8'}
552 | dependencies:
553 | binary-extensions: 2.2.0
554 | dev: true
555 |
556 | /is-core-module/2.9.0:
557 | resolution: {integrity: sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==}
558 | dependencies:
559 | has: 1.0.3
560 | dev: true
561 |
562 | /is-extglob/2.1.1:
563 | resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
564 | engines: {node: '>=0.10.0'}
565 | dev: true
566 |
567 | /is-glob/4.0.2:
568 | resolution: {integrity: sha512-ZZTOjRcDjuAAAv2cTBQP/lL59ZTArx77+7UzHdWW/XB1mrfp7DEaVpKmZ0XIzx+M7AxfhKcqV+nMetUQmFifwg==}
569 | engines: {node: '>=0.10.0'}
570 | dependencies:
571 | is-extglob: 2.1.1
572 | dev: true
573 |
574 | /is-number/7.0.0:
575 | resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
576 | engines: {node: '>=0.12.0'}
577 | dev: true
578 |
579 | /nanoid/3.3.4:
580 | resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==}
581 | engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
582 | hasBin: true
583 | dev: true
584 |
585 | /normalize-path/3.0.0:
586 | resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
587 | engines: {node: '>=0.10.0'}
588 | dev: true
589 |
590 | /path-parse/1.0.7:
591 | resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
592 | dev: true
593 |
594 | /picocolors/1.0.0:
595 | resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
596 | dev: true
597 |
598 | /picomatch/2.3.0:
599 | resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==}
600 | engines: {node: '>=8.6'}
601 | dev: true
602 |
603 | /postcss/8.4.21:
604 | resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==}
605 | engines: {node: ^10 || ^12 || >=14}
606 | dependencies:
607 | nanoid: 3.3.4
608 | picocolors: 1.0.0
609 | source-map-js: 1.0.2
610 | dev: true
611 |
612 | /readdirp/3.6.0:
613 | resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
614 | engines: {node: '>=8.10.0'}
615 | dependencies:
616 | picomatch: 2.3.0
617 | dev: true
618 |
619 | /resolve/1.22.1:
620 | resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==}
621 | hasBin: true
622 | dependencies:
623 | is-core-module: 2.9.0
624 | path-parse: 1.0.7
625 | supports-preserve-symlinks-flag: 1.0.0
626 | dev: true
627 |
628 | /ress/5.0.2:
629 | resolution: {integrity: sha512-oHBtOWo/Uc8SzQMbQNIKTcgi8wKmAs7IlNlRywmXudbOtF+c27FlOIq7tnwLDVcTywe6JXYo1pDXHO6kABwNYA==}
630 | dev: false
631 |
632 | /rollup/3.12.1:
633 | resolution: {integrity: sha512-t9elERrz2i4UU9z7AwISj3CQcXP39cWxgRWLdf4Tm6aKm1eYrqHIgjzXBgb67GNY1sZckTFFi0oMozh3/S++Ig==}
634 | engines: {node: '>=14.18.0', npm: '>=8.0.0'}
635 | hasBin: true
636 | optionalDependencies:
637 | fsevents: 2.3.2
638 | dev: true
639 |
640 | /sass/1.58.0:
641 | resolution: {integrity: sha512-PiMJcP33DdKtZ/1jSjjqVIKihoDc6yWmYr9K/4r3fVVIEDAluD0q7XZiRKrNJcPK3qkLRF/79DND1H5q1LBjgg==}
642 | engines: {node: '>=12.0.0'}
643 | hasBin: true
644 | dependencies:
645 | chokidar: 3.5.2
646 | immutable: 4.0.0
647 | source-map-js: 1.0.2
648 | dev: true
649 |
650 | /source-map-js/1.0.2:
651 | resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
652 | engines: {node: '>=0.10.0'}
653 | dev: true
654 |
655 | /supports-preserve-symlinks-flag/1.0.0:
656 | resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
657 | engines: {node: '>= 0.4'}
658 | dev: true
659 |
660 | /to-regex-range/5.0.1:
661 | resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
662 | engines: {node: '>=8.0'}
663 | dependencies:
664 | is-number: 7.0.0
665 | dev: true
666 |
667 | /tslib/2.3.1:
668 | resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==}
669 | dev: false
670 |
671 | /vite/4.1.1_sass@1.58.0:
672 | resolution: {integrity: sha512-LM9WWea8vsxhr782r9ntg+bhSFS06FJgCvvB0+8hf8UWtvaiDagKYWXndjfX6kGl74keHJUcpzrQliDXZlF5yg==}
673 | engines: {node: ^14.18.0 || >=16.0.0}
674 | hasBin: true
675 | peerDependencies:
676 | '@types/node': '>= 14'
677 | less: '*'
678 | sass: '*'
679 | stylus: '*'
680 | sugarss: '*'
681 | terser: ^5.4.0
682 | peerDependenciesMeta:
683 | '@types/node':
684 | optional: true
685 | less:
686 | optional: true
687 | sass:
688 | optional: true
689 | stylus:
690 | optional: true
691 | sugarss:
692 | optional: true
693 | terser:
694 | optional: true
695 | dependencies:
696 | esbuild: 0.16.17
697 | postcss: 8.4.21
698 | resolve: 1.22.1
699 | rollup: 3.12.1
700 | sass: 1.58.0
701 | optionalDependencies:
702 | fsevents: 2.3.2
703 | dev: true
704 |
--------------------------------------------------------------------------------
/example/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | barcode:
5 | dependency: "direct main"
6 | description:
7 | name: barcode
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.1.0"
11 | collection:
12 | dependency: transitive
13 | description:
14 | name: collection
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "1.15.0"
18 | crypto:
19 | dependency: transitive
20 | description:
21 | name: crypto
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "3.0.1"
25 | js:
26 | dependency: "direct main"
27 | description:
28 | name: js
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "0.6.3"
32 | meta:
33 | dependency: transitive
34 | description:
35 | name: meta
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.7.0"
39 | qr:
40 | dependency: transitive
41 | description:
42 | name: qr
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "2.1.0"
46 | textifier:
47 | dependency: "direct main"
48 | description:
49 | name: textifier
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.0.0"
53 | typed_data:
54 | dependency: transitive
55 | description:
56 | name: typed_data
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.3.0"
60 | uuid:
61 | dependency: "direct main"
62 | description:
63 | name: uuid
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "3.0.4"
67 | sdks:
68 | dart: ">=2.12.0 <4.0.0"
69 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: vite_plugin_dart_example
2 | description: Just an example for vite-plugin-dart
3 | version: 1.0.0
4 | environment:
5 | sdk: ">=2.10.0 <4.0.0"
6 | dependencies:
7 | barcode: ^2.1.0
8 | js: ^0.6.3
9 | textifier: ^1.0.0
10 | uuid: ^3.0.4
11 |
--------------------------------------------------------------------------------
/example/src/icons.js:
--------------------------------------------------------------------------------
1 | import "./style.scss";
2 | import viteLogo from "@iconify/icons-logos/vitejs";
3 | import dartLogo from "@iconify/icons-logos/dart";
4 | import svelteLogo from "@iconify/icons-logos/svelte-icon";
5 | import vueLogo from "@iconify/icons-logos/vue";
6 | import crystalLogo from "@iconify/icons-logos/crystal";
7 | import flutterLogo from "@iconify/icons-logos/flutter";
8 | import nuxtLogo from "@iconify/icons-logos/nuxt-icon";
9 | import kemalLogo from "@iconify/icons-logos/kemal";
10 | import nodeLogo from "@iconify/icons-logos/nodejs-icon";
11 | import phoenixLogo from "@iconify/icons-logos/phoenix";
12 | import rubyLogo from "@iconify/icons-logos/ruby";
13 | import sassLogo from "@iconify/icons-logos/sass";
14 | import lessLogo from "@iconify/icons-logos/less";
15 | import nativeScriptLogo from "@iconify/icons-logos/nativescript";
16 | import archLogo from "@iconify/icons-logos/archlinux";
17 | import kdeLogo from "@iconify/icons-logos/kde";
18 | import copyleftLogo from "@iconify/icons-logos/copyleft";
19 | import firefoxLogo from "@iconify/icons-logos/firefox";
20 | import mozillaLogo from "@iconify/icons-logos/mozilla";
21 | import apacheLogo from "@iconify/icons-logos/apache";
22 |
23 | const icons = {
24 | vite: viteLogo,
25 | dart: dartLogo,
26 | svelte: svelteLogo,
27 | vue: vueLogo,
28 | crystal: crystalLogo,
29 | flutter: flutterLogo,
30 | nuxt: nuxtLogo,
31 | kemal: kemalLogo,
32 | node: nodeLogo,
33 | phoenix: phoenixLogo,
34 | ruby: rubyLogo,
35 | sass: sassLogo,
36 | less: lessLogo,
37 | nativescript: nativeScriptLogo,
38 | arch: archLogo,
39 | kde: kdeLogo,
40 | copyleft: copyleftLogo,
41 | firefox: firefoxLogo,
42 | mozilla: mozillaLogo,
43 | apache: apacheLogo,
44 | };
45 |
46 | const iconsParent = document.getElementById("icons");
47 | Object.keys(icons).forEach((icon) => {
48 | const img = document.createElement("img");
49 | img.id = icon;
50 | img.src =
51 | "data:image/svg+xml;base64," +
52 | btoa(
53 | '' +
54 | icons[icon].body +
55 | " "
56 | );
57 | iconsParent.appendChild(img);
58 | });
59 |
60 | console.log("[bonk!] Here's all the available text art logos!");
61 | console.log(Object.keys(icons));
62 |
--------------------------------------------------------------------------------
/example/src/index.dart:
--------------------------------------------------------------------------------
1 | @JS()
2 | library callable_function;
3 |
4 | import 'dart:html';
5 | import 'package:js/js.dart';
6 | import 'package:barcode/barcode.dart';
7 | import 'package:textifier/textifier.dart';
8 | import 'package:uuid/uuid.dart';
9 |
10 | final uuid = Uuid();
11 | final dm = Barcode.qrCode();
12 | final qrCodeDiv = querySelector('#qrcode') as DivElement;
13 | final qrCodeTextInput = querySelector('#source') as InputElement;
14 | final textArt = querySelector('#textart') as DivElement;
15 | final textArtInput = querySelector('#textArtText') as InputElement;
16 | final viteLogo = querySelector("#vite") as ImageElement;
17 | final dartLogo = querySelector("#dart") as ImageElement;
18 | final uuidHolder = querySelector("#uuid") as SpanElement;
19 | final uuidBtn = querySelector("#uuidBtn") as ButtonElement;
20 |
21 | class AllowAllElements implements NodeValidator {
22 | @override
23 | bool allowsAttribute(Element element, String attributeName, String value) {
24 | return true;
25 | }
26 |
27 | @override
28 | bool allowsElement(Element element) {
29 | return true;
30 | }
31 | }
32 |
33 | void createQrCode(String input) {
34 | final qrcode = dm.toSvg(input, width: 200, height: 200);
35 | qrCodeDiv.setInnerHtml(qrcode, validator: AllowAllElements());
36 | }
37 |
38 | void createViteText(String input) async {
39 | final cleanInput = input.replaceAll(new RegExp(r'[^\w\s]+'), '');
40 | final characters =
41 | cleanInput.length == 0 || cleanInput.replaceAll(" ", "").length == 0
42 | ? "vite"
43 | : cleanInput;
44 | final icon = (querySelector("#" + characters.toLowerCase()) ?? viteLogo)
45 | as ImageElement;
46 | await new Textifier(maxWidth: 100, characters: characters, ordered: true)
47 | .write(icon.src, textArt);
48 | textArt.setInnerHtml(textArt.innerHtml.replaceAll(new RegExp(r'\s+\n'), '\n'),
49 | validator: AllowAllElements());
50 | }
51 |
52 | void createUUID() {
53 | uuidHolder.innerText = uuid.v4();
54 | }
55 |
56 | // Example function export
57 | @JS('helloWorld')
58 | external set _helloWorld(void Function() f);
59 |
60 | void _printHW() {
61 | print('Hello from Dart!');
62 | }
63 |
64 | void main() {
65 | // You should now be able to call helloWorld()
66 | // from outside Dart!
67 | _helloWorld = allowInterop(_printHW);
68 |
69 | // Set initial values
70 | qrCodeTextInput.value = "Hello Vite!";
71 | textArtInput.value = "vite";
72 |
73 | // Run initial functions
74 | createQrCode(qrCodeTextInput.value);
75 | createViteText(textArtInput.value);
76 | new Textifier(maxWidth: 100, characters: 'You found me! ', ordered: true).log(
77 | "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgZmlsbD0ibm9uZSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJhIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiMwMTU3OWIiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM0MGM0ZmYiLz48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBpZD0iYyIgeDE9IjE5NC42NSIgeTE9IjguODIiIHgyPSIyMzYuMDgiIHkyPSIyOTIuOTkiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0icm90YXRlKDE1LjM5IDM3NC4zMyAzNDYuNjQpIHNjYWxlKDEuNDE4MzQpIj48c3RvcCBzdG9wLWNvbG9yPSIjZmZlNjY1Ii8+PHN0b3Agb2Zmc2V0PSIuMDgiIHN0b3AtY29sb3I9IiNmN2NjMDAiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNiZDdkMDAiLz48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCB4bGluazpocmVmPSIjYSIgaWQ9ImIiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iLTk3MC41NyIgeTE9IjQ3OS4yMSIgeDI9Ii0xMDY4LjI5IiB5Mj0iMTc4LjU0IiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDE0NTAuNyAtMTA2LjEpIHNjYWxlKDEuMjY0MzMpIi8+PC9kZWZzPjxwYXRoIGQ9Ik0yNTcgMjBjLTI4LjcxIDkuNjQtNTEuNTUgMzIuMjUtNzcuODUgNDcuMjVsLTc5LjEzIDUyLjM3QzIwMy41IDIyMy4wOCAzMDYuOTUgMzI2LjU4IDQxMC40NyA0MzAuMDFjMjAuNDctMTAuMjYgNTUuMTUtMTAuMTIgNjYuNi0yNi45OGwuMTQtMTc2Ljk1Yy0yOS43NS0yOC40NC01Ni44MS02MC04OC40NS04Ni4yNy05Ljc5LTguMy00Ny4wMy0yOC4yMi0zMS41Ny4zNWw4MC41NCAyMjguMzVjLTI5LjEtODItNTcuNTctMTY0LjItODcuMDYtMjQ2LjA1LTEyLjE3LjgzIDcuNjItNC4zNC00LjYtMTMuNDktNi45My0zMS40NC0zOC4xLTQ3LjY0LTU3LjY4LTcwLjg5LTktOC4yMS0xOC4zLTE3LjgxLTMxLjQtMTguMDhabS0xNTYuOTggOTkuNjRjLTMyLjY3IDQ5LjI4LTY1LjIzIDk4LjY0LTk3Ljk3IDE0Ny44OS03LjIxIDI3LjQ3IDIyLjEgNDMuNjQgMzcuMzMgNjEuNDkgMTUuNyAxNi45IDMxLjMyIDM0Ljg2IDU1LjM4IDM4LjY4IDQuNTQgMS40NyAxMS45NCA1Ljg4IDUuOTUtMi4yIDcuNzQgMTEuNzkgMjIuOCAxMC41OSAzNC40NCAxNi40M2wyMTMuNzkgNzUuMzktMjQ1LjgtODYuNjdjOS44NCA0NC4xMyA0OS43NCA2OS45IDc4LjU2IDEwMS4zMyAxMy42MyAxMC4wNiAyMi4yNyAzMi4xNyA0MS44NyAyNy44bDE2NC40My4yYzIuNTItMjUuMTMgMjIuNDctNjkuOTcgMjIuNDctNjkuOTctMTAxLjA0LTEwMS4wNC0yMDkuNC0yMDkuMzQtMzEwLjQ1LTMxMC4zN1oiIGZpbGw9InVybCgjYikiIHN0cm9rZT0idXJsKCNiKSIgc3Ryb2tlLXdpZHRoPSIxLjg4Ii8+PHBhdGggZD0iTTUwNS40MyAyNS41MSAzMDkuMiAxMC43NWE3LjEgNy4xIDAgMCAwLTcuMjUgNC43OWwtNjQuNyAxOTAuM2E3LjEgNy4xIDAgMCAwIDYuNDIgOS4zN2w1NS4xNCAyLjNhNy4xIDcuMSAwIDAgMSA2LjAyIDEwLjNsLTM2LjE1IDcxLjE4YTcuMSA3LjEgMCAwIDAgNi41IDEwLjNsMzQuNy0uOTFhNy4xIDcuMSAwIDAgMSA2LjUgMTAuMzFMMjU5LjMgNDMwLjQzYy0zLjU3IDYuOTkgNS4xOCAxMy43NCAxMS4wNCA4LjUybDMuOTEtMy40OUw1MDkuMyAxNzQuNDFhNy4xIDcuMSAwIDAgMC00LjcyLTExLjgxbC01Ni4yLTQuMzlhNy4xIDcuMSAwIDAgMS01LjQ5LTEwLjc3bDY4LjA2LTExMS4xNmE3LjEgNy4xIDAgMCAwLTUuNTItMTAuNzd6IiBmaWxsPSJ1cmwoI2MpIi8+PC9zdmc+");
78 | createUUID();
79 |
80 | // Bind events
81 | textArtInput.onInput.listen((event) => createViteText(textArtInput.value));
82 | qrCodeTextInput.onInput
83 | .listen((event) => createQrCode(qrCodeTextInput.value));
84 | uuidBtn.onClick.listen((event) => createUUID());
85 | }
86 |
--------------------------------------------------------------------------------
/example/src/main.js:
--------------------------------------------------------------------------------
1 | import "./index.dart";
2 | import { MDCTopAppBar } from "@material/top-app-bar";
3 | import { MDCTextField } from "@material/textfield";
4 | import { MDCRipple } from "@material/ripple";
5 |
6 | const topAppBarElement = document.querySelector(".mdc-top-app-bar");
7 |
8 | new MDCTopAppBar(topAppBarElement);
9 | new MDCTextField(document.querySelector(".mdc-text-field1"));
10 | new MDCTextField(document.querySelector(".mdc-text-field2"));
11 | new MDCRipple(document.querySelector(".mdc-button1"));
12 | new MDCRipple(document.querySelector(".mdc-button2"));
13 |
14 | const app = document.getElementById("app");
15 |
16 | app.innerHTML = `
17 | Hello Vite!
18 | `;
19 |
--------------------------------------------------------------------------------
/example/src/style.scss:
--------------------------------------------------------------------------------
1 | @use "ress/dist/ress.min.css";
2 | @use "@material/typography/mdc-typography";
3 | @use "@material/top-app-bar/mdc-top-app-bar";
4 | @use "@material/card/mdc-card";
5 | @use "@material/button/mdc-button";
6 | @use "@material/textfield/mdc-text-field";
7 |
8 | html,
9 | body {
10 | overflow-x: hidden;
11 | }
12 |
13 | main > div {
14 | margin: 2rem 0;
15 | }
16 |
17 | .vpd-center {
18 | display: flex;
19 | justify-content: center;
20 | align-items: center;
21 | flex-direction: column;
22 | }
23 |
24 | #qrcode {
25 | max-width: 200px;
26 | align-self: center;
27 | }
28 |
29 | #uuidcard {
30 | flex-direction: row;
31 | flex-wrap: wrap;
32 | padding: 16px;
33 | max-width: 512px;
34 | justify-content: space-between;
35 | .mdc-card.mdc-card--outlined {
36 | padding: 16px;
37 | }
38 | span {
39 | text-align: center;
40 | }
41 | .mdc-touch-target-wrapper {
42 | display: inline-flex;
43 | }
44 | button {
45 | margin-left: 16px;
46 | }
47 | }
48 |
49 | #canvascard {
50 | padding: 16px;
51 | }
52 |
53 | #textart {
54 | display: flex;
55 | align-content: center;
56 | justify-content: center;
57 | margin: 2rem 0;
58 | }
59 |
--------------------------------------------------------------------------------
/example/vite.config.mjs:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import Dart from "../src/index.js";
3 |
4 | export default defineConfig(({ _, mode }) => {
5 | return {
6 | plugins: [
7 | Dart({
8 | O: mode === "development" ? 1 : 2,
9 | dart: process.env.VERCEL ? "./dart-sdk/bin/dart" : "dart",
10 | }),
11 | ],
12 | base: "./",
13 | build: {
14 | rollupOptions: {
15 | input: "./index.html",
16 | },
17 | },
18 | };
19 | });
20 |
--------------------------------------------------------------------------------
/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module "vite-plugin-dart" {
2 | import { Plugin } from "vite";
3 |
4 | interface IConfig {
5 | dart: string;
6 | minify: boolean;
7 | "enable-asserts": boolean;
8 | verbose: boolean;
9 | define: Array;
10 | packages: string;
11 | "suppress-warnings": boolean;
12 | "fatal-warnings": boolean;
13 | "suppress-hints": boolean;
14 | "enable-diagnostic-colors": boolean;
15 | terse: boolean;
16 | "show-package-warnings": boolean;
17 | csp: boolean;
18 | "no-source-maps": boolean;
19 | "omit-late-names": boolean;
20 | O: 0 | 1 | 2 | 3 | 4;
21 | "omit-implicit-checks": boolean;
22 | "trust-primitives": boolean;
23 | "lax-runtime-type-to-string": boolean;
24 | verbosity: "warning" | "all" | "error" | "info",
25 | stdio: boolean;
26 | }
27 |
28 | export default function Dart(config?: Partial): Plugin;
29 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vite-plugin-dart",
3 | "version": "1.0.3",
4 | "description": "Vite Dart Plugin",
5 | "main": "src/index.js",
6 | "type": "module",
7 | "repository": {
8 | "type": "git",
9 | "url": "git+https://github.com/GeopJr/vite-plugin-dart.git"
10 | },
11 | "keywords": [
12 | "vite",
13 | "plugin",
14 | "dart"
15 | ],
16 | "author": "GeopJr",
17 | "license": "MIT",
18 | "bugs": {
19 | "url": "https://github.com/GeopJr/vite-plugin-dart/issues"
20 | },
21 | "homepage": "https://github.com/GeopJr/vite-plugin-dart#readme",
22 | "devDependencies": {
23 | "vite": "4.1.1"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["config:base"]
3 | }
4 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import { execSync } from "child_process";
2 | import { readFileSync, mkdtempSync, rmSync } from "fs";
3 | import { tmpdir } from "os";
4 | import { join, parse } from "path";
5 |
6 | const fileRegex = /\.(dart)$/;
7 |
8 | /**
9 | * @typedef {Object} Config
10 | * @property {Number} [O] - Only numbers between <0,1,2,3,4> allowed.
11 | * @property {Boolean} [csp]
12 | * @property {String} [dart=dart] - Dart binary path.
13 | * @property {String[]} [define] - Array items in the "=" fromat each.
14 | * @property {Boolean} [enable-asserts]
15 | * @property {Boolean} [enable-diagnostic-colors]
16 | * @property {Boolean} [fatal-warnings]
17 | * @property {Boolean} [lax-runtime-type-to-string]
18 | * @property {Boolean} [minify]
19 | * @property {Boolean} [no-source-maps]
20 | * @property {Boolean} [omit-implicit-checks]
21 | * @property {Boolean} [omit-late-names]
22 | * @property {String} [packages]
23 | * @property {Boolean} [show-package-warnings]
24 | * @property {Boolean} [suppress-hints]
25 | * @property {Boolean} [suppress-warnings]
26 | * @property {Boolean} [terse]
27 | * @property {Boolean} [trust-primitives]
28 | * @property {Boolean} [verbose]
29 | * @property {String} [verbosity=warning] - Available: all, error, info, warning.
30 | * @property {Boolean} [stdio=true] - Whether or not to pass the dart stdio to parent.
31 | */
32 | const defaultConfig = {
33 | dart: "dart",
34 | minify: false,
35 | "enable-asserts": false,
36 | verbose: false,
37 | define: [],
38 | packages: "",
39 | "suppress-warnings": false,
40 | "fatal-warnings": false,
41 | "suppress-hints": false,
42 | "enable-diagnostic-colors": false,
43 | terse: false,
44 | "show-package-warnings": false,
45 | csp: false,
46 | "no-source-maps": false,
47 | "omit-late-names": false,
48 | O: 1,
49 | "omit-implicit-checks": false,
50 | "trust-primitives": false,
51 | "lax-runtime-type-to-string": false,
52 | verbosity: "warning",
53 | stdio: true,
54 | };
55 |
56 | const nonFlagBool = ["stdio"];
57 |
58 | /**
59 | * @param {Config} options
60 | */
61 | export default function dartPlugin(options = defaultConfig) {
62 | options = {...defaultConfig, ...options}
63 | // Create the dart args
64 | const execArgs = [];
65 |
66 | if (options.dart.length === 0) options.dart = "dart";
67 | if (options.packages.length > 0)
68 | execArgs.push(`--packages=${options.packages}`);
69 | if (options.O >= 0 && options.O <= 4 && options.O % 1 === 0)
70 | execArgs.push(`-O${options.O}`);
71 |
72 | execArgs.push(
73 | `--verbosity=${
74 | ["info", "error", "warning", "all"].includes(
75 | options.verbosity.toLowerCase()
76 | )
77 | ? options.verbosity.toLowerCase()
78 | : "warning"
79 | }`
80 | );
81 |
82 | execArgs.push(
83 | ...Object.keys(options)
84 | .filter((x) => options[x] === true && !nonFlagBool.includes(x))
85 | .map((x) => `--${x}`)
86 | );
87 |
88 | if (options.define.length > 0)
89 | execArgs.push(
90 | ...options.define
91 | .filter((x) => x.includes("="))
92 | .map((x) => `--define=${x}`)
93 | );
94 |
95 | return {
96 | name: "vite-plugin-dart",
97 |
98 | transform(_, path) {
99 | if (!fileRegex.test(path)) return;
100 | // Create a tmp folder to hold the dart compile
101 | // output
102 | const tmpFolder = mkdtempSync(join(tmpdir(), "vite-plugin-dart-"));
103 | const parsedPath = parse(path);
104 | const compiledDartFilename = parsedPath.name + ".js";
105 | const compiledDartOutput = join(tmpFolder, compiledDartFilename);
106 |
107 | // Construct the dart command & execute
108 | const command = `"${options.dart}" compile js ${execArgs
109 | .map((x) => `"${x}"`)
110 | .join(" ")} -o "${compiledDartOutput}" "${path}"`;
111 |
112 | execSync(command, {
113 | stdio: `${options.stdio === true ? "inherit" : "ignore"}`,
114 | });
115 |
116 | let compiledDart = readFileSync(compiledDartOutput, "utf8");
117 | let compiledDartMap = null;
118 |
119 | if (options["no-source-maps"] === false) {
120 | // Remove the included sourcemap (Vite handles it)
121 | compiledDart = compiledDart.replace(
122 | `//# sourceMappingURL=${encodeURIComponent(
123 | compiledDartFilename
124 | )}.map`,
125 | ""
126 | );
127 | // Patch the sourcemap so it points to the correct files
128 | compiledDartMap = JSON.parse(
129 | readFileSync(compiledDartOutput + ".map", "utf8")
130 | );
131 | compiledDartMap.sources = compiledDartMap.sources.map((x) => {
132 | if (!x.startsWith(".")) return;
133 | x.replace(/^(?:\.\.(\/|\\))+/, "");
134 | x = "file://" + x;
135 | });
136 | compiledDartMap = JSON.stringify(compiledDartMap);
137 | }
138 |
139 | // Delete the tmp folder
140 | rmSync(tmpFolder, { recursive: true, force: true });
141 |
142 | return {
143 | code: compiledDart,
144 | map: compiledDartMap,
145 | };
146 | },
147 | };
148 | }
149 |
--------------------------------------------------------------------------------