Changes
54 changed files (+2734/-0)
-
.editorconfig (new)
-
@@ -0,0 +1,23 @@# Coding style for this project. # <https://editorconfig.org/> # # SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> # SPDX-License-Identifier: Apache-2.0 root = true [*] charset = utf-8 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = tab [*.md] # Trailing whitespaces is used as a line break in Markdown trim_trailing_whitespace = true # `gleam format` is not configurable [*.gleam] indent_style = space indent_size = 2
-
-
.gitignore (new)
-
@@ -0,0 +1,31 @@# Ignored files specific to this project. # Do not put an environment specific rule, such as OS files. # # SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> # SPDX-License-Identifier: Apache-2.0 # What: npm packages directory # Why: This contains auto-generated (downloaded) files. node_modules # What: Gleam build artifacts # Why: This contains auto generated files. build # What: BEAM (VM) files # Why: These are temporary or garbage files. *.beam *.ez erl_crash.dump # What: Transpiled JS files # Why: Checking-in built files often results in out-of-sync files. /esm # What: Build directory for Rollup and Vite # Why: Checking-in built files often results in out-of-sync files. dist # What: Tarball generated by `npm pack` # Why: This is a temporary file. /*.tgz
-
-
.tool-versions (new)
-
@@ -0,0 +1,10 @@# Version management tools read this file and install/setup corresponding # version of the tools. Popular version management tools: # * [ASDF](https://asdf-vm.com/) # * [mise](https://mise.jdx.dev/) # # SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> # SPDX-License-Identifier: Apache-2.0 nodejs 22 gleam 1.6 dprint 0.47
-
-
LICENSES/Apache-2.0.txt (new)
-
@@ -0,0 +1,73 @@Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
-
README.md (new)
-
@@ -0,0 +1,104 @@<!-- SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: Apache-2.0 --> # rollup-plugin-gleam A [Rollup](https://rollupjs.org/) plugin that add supports for [Gleam](https://gleam.run/) language. Also compatible with [Vite](https://vite.dev/). - Source code is available at [github.com:pocka/rollup-plugin-gleam](https://github.com/pocka/rollup-plugin-gleam) - Package is available as [npm:`@pocka/rollup-plugin-gleam`](https://npmjs.com/package/@pocka/rollup-plugin-gleam) ## Requirements This plugin requires Rollup >= v1.12.0 and a working Gleam executable (`gleam`). ## Usage Import the plugin in your `rollup.config.js` or `vite.config.js`: ```js import { gleam } from "@pocka/rollup-plugin-gleam"; export default { // ... plugins: [gleam()], }; ``` Then you can import `.gleam` files: ```gleam // hello.gleam pub fn hello(name: String) -> String { "Hello, " <> name } ``` ```js import { hello } from "./hello.gleam"; console.log(hello("World")); ``` ## Options ### `gleamToml` - Type: `URL` or String - Default: `"./gleam.toml"` File path or file URL to `gleam.toml`. If the value is relative path string, this plugin resolves the path from current working directory. ```js gleam({ gleamToml: new URL("./gleam.toml", import.meta.url), }); ``` ### `bin` - Type: String - Default: `"gleam"` Binary name or path to Gleam executable file. This plugin builds Gleam file using this value. ```js gleam({ bin: "/path/to/gleam", }); // > /path/to/gleam build --target javascript ``` ### `buildOptions.warningAsErrors` - Type: Boolean - Default: `false` This option activates `--warning-as-errors` compiler flag. If this option is enabled, warning made by Gleam compiler will be treated as a build error. ```js gleam({ buildOptions: { warningAsErrors: true, }, }); ``` ```gleam // This won't compile with the flag on, due to an unused variable warning. pub fn hello(name: String) -> String { "Hello World!" } ``` ## License This software is licensed under [Apache License Version 2.0](./LICENSES/Apache-2.0.txt). This project adheres to [REUSE Specification](https://reuse.software/spec-3.3/). Every checked-in file has copyright and license information inside a comment header, adjacent `*.license` file, or [REUSE.toml](./REUSE.toml) file.
-
-
REUSE.toml (new)
-
@@ -0,0 +1,13 @@# Config file for [REUSE](https://reuse.software/) tool. # # SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> # SPDX-License-Identifier: Apache-2.0 version = 1 [[annotations]] path = [ "tests/**/*", ] SPDX-FileCopyrightText = "2024 Shota FUJI <pockawoooh@gmail.com>" SPDX-License-Identifier = "Apache-2.0"
-
-
docs/CONTRIBUTING.md (new)
-
@@ -0,0 +1,27 @@<!-- SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: Apache-2.0 --> [issue-list]: https://github.com/pocka/rollup-plugin-gleam/issues # Contribution Guide Issues and Pull Requests that does not follow this guideline will be closed as invalid. ## Creating a bug report If you encounter a bug, search if there is an existing issue for the bug. When there is none, [open an issue on GitHub][issue-list]. Make sure to include expected behavior, actual result, reproduction steps, and versions of this plugin, Rollup or Vite, and Gleam compiler. An issue lacking necessary information will be closed as an invalid issue. ## Creating an update request If third-party libraries or tools that this project depends on released a new version and changes have to be made in this project's codebase, [open an issue on GitHub][issue-list]. ## Sending a patch This project only accepts small and simple patches, such as fixing typo. To make a change to codebase, see [Development Guide](./DEVELOPMENT.md).
-
-
docs/DEVELOPMENT.md (new)
-
@@ -0,0 +1,87 @@<!-- SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: Apache-2.0 --> [dprint]: https://dprint.dev/ [reuse-tool]: https://github.com/fsfe/reuse-tool # Development Guide This guide is for whom touches this project's codebase. ## Requirements This project uses below software tools: - [Node.js](https://nodejs.org) Active LTS and npm for building, testing and publishing. - [Gleam](https://gleam.run/) v1.x for testing. - [dprint][dprint] v0.x for code formatting. - [reuse][reuse-tool] v4 or later for copyright and license information checking. You can install these tools other than reuse tool, by using [ASDF](https://asdf-vm.com/) or [mise](https://mise.jdx.dev/). See [`.tool-versions`](../.tool-versions) for more specific versions. ## Source code and build process Source code is located under `src/` directory, written in TypeScript. Those files are compiled to JavaScript by TypeScript Compiler (tsc). You can manually compile them by running: ``` $ npm run build ``` Compiled JavaScript files are located under `esm/es2020/` directory. That directory is ignored from VCS, and included in published tarball. To clean the compiled files, simply delete `esm/` directory. ## Testing Plugin's source code is type-checked by TypeScript Compiler. If there is a type error, `npm run build` exits with non-zero code. To test the plugin's behavior, run unit tests by running: ``` $ npm test ``` If you don't want the test runner to go interactive mode, set `CI=true` and run the command: ``` $ CI=true npm test ``` Test files are inside [`tests/`](../tests/) directory, grouped into sub-directories. Each sub-directory simulates real-world usecase by having `gleam.toml` and `src/` files, and an unit test invokes Rollup/Vite using those files. Do not write flaky tests: keep assertions simple and avoid timer-based wait functions as much as possible. ## Code formatting Source code in this project should adhere to style guide defined in [`.editorconfig` file](../.editorconfig). Use of text editor supporting EditorConfig or EditorConfig plugin is preferable. Source code in this project should be consistently formatted using [dprint][dprint]. ``` $ dprint fmt ``` **Run the above command before creating a commit**. ## Copyright and license annotation Every checked-in files SHOULD have proper copyright and license annotation. Annotations MUST conform [REUSE v3.3 Specification](https://reuse.software/spec-3.3/). To check the annotations, run: ``` $ reuse lint ``` The above command requires [reuse tool][reuse-tool] to be installed on your system. **Run the above command before creating a commit**.
-
-
docs/SECURITY.md (new)
-
@@ -0,0 +1,11 @@<!-- SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: Apache-2.0 --> # Security related topics If you believe you have found a vulnerability in this plugin's codebase, please send an email to the address written at [`package.json`'s `author` field](../package.json). Do not send an email because you saw a publicly disclosed vulnerability for third-party package/tool/code this project depends on. [Create an issue](./CONTRIBUTING.md) instead.
-
-
dprint.json (new)
-
@@ -0,0 +1,26 @@{ "biome": { "lineWidth": 90 }, "markdown": { "lineWidth": 100 }, "toml": { "useTabs": true }, "exec": { "commands": [ { "command": "gleam format --stdin", "exts": ["gleam"] } ] }, "excludes": ["node_modules", "build", "/esm", "dist"], "plugins": [ "https://plugins.dprint.dev/markdown-0.17.8.wasm", "https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0", "https://plugins.dprint.dev/toml-0.6.3.wasm", "https://plugins.dprint.dev/biome-0.7.1.wasm" ] }
-
-
dprint.json.license (new)
-
@@ -0,0 +1,5 @@Config file for dprint, a pluggable code formatter. <https://dprint.dev/> SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: Apache-2.0
-
-
package-lock.json (new)
-
@@ -0,0 +1,1462 @@{ "name": "@pocka/rollup-plugin-gleam", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@pocka/rollup-plugin-gleam", "version": "0.1.0", "license": "Apache-2.0", "dependencies": { "js-toml": "^1.0.0" }, "devDependencies": { "@rollup/plugin-typescript": "^12.1.1", "@types/node": "^22.9.3", "rollup": "^4.27.3", "typescript": "^5.7.2", "vite": "^5.4.11", "vitest": "^2.1.5" }, "peerDependencies": { "rollup": "^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@babel/runtime-corejs3": { "version": "7.26.0", "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.26.0.tgz", "integrity": "sha512-YXHu5lN8kJCb1LOb9PgV6pvak43X2h4HvRApcN5SdWeaItQOzfn1hgP6jasD6KWQyJDBxrVmA9o9OivlnNJK/w==", "license": "MIT", "dependencies": { "core-js-pure": "^3.30.2", "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@chevrotain/cst-dts-gen": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.0.3.tgz", "integrity": "sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==", "license": "Apache-2.0", "dependencies": { "@chevrotain/gast": "11.0.3", "@chevrotain/types": "11.0.3", "lodash-es": "4.17.21" } }, "node_modules/@chevrotain/gast": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-11.0.3.tgz", "integrity": "sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==", "license": "Apache-2.0", "dependencies": { "@chevrotain/types": "11.0.3", "lodash-es": "4.17.21" } }, "node_modules/@chevrotain/regexp-to-ast": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.0.3.tgz", "integrity": "sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==", "license": "Apache-2.0" }, "node_modules/@chevrotain/types": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.0.3.tgz", "integrity": "sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==", "license": "Apache-2.0" }, "node_modules/@chevrotain/utils": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-11.0.3.tgz", "integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==", "license": "Apache-2.0" }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", "cpu": ["ppc64"], "dev": true, "license": "MIT", "optional": true, "os": ["aix"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/android-arm": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, "os": ["android"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/android-arm64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["android"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/android-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["android"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/darwin-arm64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["darwin"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/darwin-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["darwin"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/freebsd-arm64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["freebsd"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/freebsd-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["freebsd"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-arm": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-arm64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-ia32": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": ["ia32"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-loong64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": ["loong64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-mips64el": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": ["mips64el"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": ["ppc64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-riscv64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": ["riscv64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-s390x": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": ["s390x"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/netbsd-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["netbsd"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/openbsd-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["openbsd"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/sunos-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["sunos"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/win32-arm64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["win32"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/win32-ia32": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": ["ia32"], "dev": true, "license": "MIT", "optional": true, "os": ["win32"], "engines": { "node": ">=12" } }, "node_modules/@esbuild/win32-x64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["win32"], "engines": { "node": ">=12" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true, "license": "MIT" }, "node_modules/@rollup/plugin-typescript": { "version": "12.1.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.1.tgz", "integrity": "sha512-t7O653DpfB5MbFrqPe/VcKFFkvRuFNp9qId3xq4Eth5xlyymzxNpye2z8Hrl0RIMuXTSr5GGcFpkdlMeacUiFQ==", "dev": true, "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.1.0", "resolve": "^1.22.1" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^2.14.0||^3.0.0||^4.0.0", "tslib": "*", "typescript": ">=3.7.0" }, "peerDependenciesMeta": { "rollup": { "optional": true }, "tslib": { "optional": true } } }, "node_modules/@rollup/pluginutils": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.3.tgz", "integrity": "sha512-Pnsb6f32CD2W3uCaLZIzDmeFyQ2b8UWMFI7xtwUezpcGBDVDW6y9XgAWIlARiGAo6eNF5FK5aQTr0LFyNyqq5A==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", "picomatch": "^4.0.2" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@rollup/pluginutils/node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true, "license": "MIT" }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.3.tgz", "integrity": "sha512-EzxVSkIvCFxUd4Mgm4xR9YXrcp976qVaHnqom/Tgm+vU79k4vV4eYTjmRvGfeoW8m9LVcsAy/lGjcgVegKEhLQ==", "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, "os": ["android"] }, "node_modules/@rollup/rollup-android-arm64": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.3.tgz", "integrity": "sha512-LJc5pDf1wjlt9o/Giaw9Ofl+k/vLUaYsE2zeQGH85giX2F+wn/Cg8b3c5CDP3qmVmeO5NzwVUzQQxwZvC2eQKw==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["android"] }, "node_modules/@rollup/rollup-darwin-arm64": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.3.tgz", "integrity": "sha512-OuRysZ1Mt7wpWJ+aYKblVbJWtVn3Cy52h8nLuNSzTqSesYw1EuN6wKp5NW/4eSre3mp12gqFRXOKTcN3AI3LqA==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["darwin"] }, "node_modules/@rollup/rollup-darwin-x64": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.3.tgz", "integrity": "sha512-xW//zjJMlJs2sOrCmXdB4d0uiilZsOdlGQIC/jjmMWT47lkLLoB1nsNhPUcnoqyi5YR6I4h+FjBpILxbEy8JRg==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["darwin"] }, "node_modules/@rollup/rollup-freebsd-arm64": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.3.tgz", "integrity": "sha512-58E0tIcwZ+12nK1WiLzHOD8I0d0kdrY/+o7yFVPRHuVGY3twBwzwDdTIBGRxLmyjciMYl1B/U515GJy+yn46qw==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["freebsd"] }, "node_modules/@rollup/rollup-freebsd-x64": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.3.tgz", "integrity": "sha512-78fohrpcVwTLxg1ZzBMlwEimoAJmY6B+5TsyAZ3Vok7YabRBUvjYTsRXPTjGEvv/mfgVBepbW28OlMEz4w8wGA==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["freebsd"] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.3.tgz", "integrity": "sha512-h2Ay79YFXyQi+QZKo3ISZDyKaVD7uUvukEHTOft7kh00WF9mxAaxZsNs3o/eukbeKuH35jBvQqrT61fzKfAB/Q==", "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.3.tgz", "integrity": "sha512-Sv2GWmrJfRY57urktVLQ0VKZjNZGogVtASAgosDZ1aUB+ykPxSi3X1nWORL5Jk0sTIIwQiPH7iE3BMi9zGWfkg==", "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.3.tgz", "integrity": "sha512-FPoJBLsPW2bDNWjSrwNuTPUt30VnfM8GPGRoLCYKZpPx0xiIEdFip3dH6CqgoT0RnoGXptaNziM0WlKgBc+OWQ==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"] }, "node_modules/@rollup/rollup-linux-arm64-musl": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.3.tgz", "integrity": "sha512-TKxiOvBorYq4sUpA0JT+Fkh+l+G9DScnG5Dqx7wiiqVMiRSkzTclP35pE6eQQYjP4Gc8yEkJGea6rz4qyWhp3g==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.3.tgz", "integrity": "sha512-v2M/mPvVUKVOKITa0oCFksnQQ/TqGrT+yD0184/cWHIu0LoIuYHwox0Pm3ccXEz8cEQDLk6FPKd1CCm+PlsISw==", "cpu": ["ppc64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.3.tgz", "integrity": "sha512-LdrI4Yocb1a/tFVkzmOE5WyYRgEBOyEhWYJe4gsDWDiwnjYKjNs7PS6SGlTDB7maOHF4kxevsuNBl2iOcj3b4A==", "cpu": ["riscv64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.3.tgz", "integrity": "sha512-d4wVu6SXij/jyiwPvI6C4KxdGzuZOvJ6y9VfrcleHTwo68fl8vZC5ZYHsCVPUi4tndCfMlFniWgwonQ5CUpQcA==", "cpu": ["s390x"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"] }, "node_modules/@rollup/rollup-linux-x64-gnu": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.3.tgz", "integrity": "sha512-/6bn6pp1fsCGEY5n3yajmzZQAh+mW4QPItbiWxs69zskBzJuheb3tNynEjL+mKOsUSFK11X4LYF2BwwXnzWleA==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"] }, "node_modules/@rollup/rollup-linux-x64-musl": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.3.tgz", "integrity": "sha512-nBXOfJds8OzUT1qUreT/en3eyOXd2EH5b0wr2bVB5999qHdGKkzGzIyKYaKj02lXk6wpN71ltLIaQpu58YFBoQ==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["linux"] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.3.tgz", "integrity": "sha512-ogfbEVQgIZOz5WPWXF2HVb6En+kWzScuxJo/WdQTqEgeyGkaa2ui5sQav9Zkr7bnNCLK48uxmmK0TySm22eiuw==", "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, "os": ["win32"] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.3.tgz", "integrity": "sha512-ecE36ZBMLINqiTtSNQ1vzWc5pXLQHlf/oqGp/bSbi7iedcjcNb6QbCBNG73Euyy2C+l/fn8qKWEwxr+0SSfs3w==", "cpu": ["ia32"], "dev": true, "license": "MIT", "optional": true, "os": ["win32"] }, "node_modules/@rollup/rollup-win32-x64-msvc": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.3.tgz", "integrity": "sha512-vliZLrDmYKyaUoMzEbMTg2JkerfBjn03KmAw9CykO0Zzkzoyd7o3iZNam/TpyWNjNT+Cz2iO3P9Smv2wgrR+Eg==", "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, "os": ["win32"] }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true, "license": "MIT" }, "node_modules/@types/node": { "version": "22.9.3", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.3.tgz", "integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==", "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.19.8" } }, "node_modules/@vitest/expect": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.5.tgz", "integrity": "sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==", "dev": true, "license": "MIT", "dependencies": { "@vitest/spy": "2.1.5", "@vitest/utils": "2.1.5", "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/mocker": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz", "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==", "dev": true, "license": "MIT", "dependencies": { "@vitest/spy": "2.1.5", "estree-walker": "^3.0.3", "magic-string": "^0.30.12" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^5.0.0" }, "peerDependenciesMeta": { "msw": { "optional": true }, "vite": { "optional": true } } }, "node_modules/@vitest/pretty-format": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.5.tgz", "integrity": "sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==", "dev": true, "license": "MIT", "dependencies": { "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.5.tgz", "integrity": "sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==", "dev": true, "license": "MIT", "dependencies": { "@vitest/utils": "2.1.5", "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.5.tgz", "integrity": "sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==", "dev": true, "license": "MIT", "dependencies": { "@vitest/pretty-format": "2.1.5", "magic-string": "^0.30.12", "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.5.tgz", "integrity": "sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==", "dev": true, "license": "MIT", "dependencies": { "tinyspy": "^3.0.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.5.tgz", "integrity": "sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==", "dev": true, "license": "MIT", "dependencies": { "@vitest/pretty-format": "2.1.5", "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/chai": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, "license": "MIT", "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", "deep-eql": "^5.0.1", "loupe": "^3.1.0", "pathval": "^2.0.0" }, "engines": { "node": ">=12" } }, "node_modules/check-error": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, "license": "MIT", "engines": { "node": ">= 16" } }, "node_modules/chevrotain": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-11.0.3.tgz", "integrity": "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==", "license": "Apache-2.0", "dependencies": { "@chevrotain/cst-dts-gen": "11.0.3", "@chevrotain/gast": "11.0.3", "@chevrotain/regexp-to-ast": "11.0.3", "@chevrotain/types": "11.0.3", "@chevrotain/utils": "11.0.3", "lodash-es": "4.17.21" } }, "node_modules/core-js-pure": { "version": "3.39.0", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.39.0.tgz", "integrity": "sha512-7fEcWwKI4rJinnK+wLTezeg2smbFFdSBP6E2kQZNbnzM2s1rpKQ6aaRteZSSg7FLU3P0HGGVo/gbpfanU36urg==", "hasInstallScript": true, "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" } }, "node_modules/debug": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" }, "engines": { "node": ">=6.0" }, "peerDependenciesMeta": { "supports-color": { "optional": true } } }, "node_modules/deep-eql": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/es-module-lexer": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", "dev": true, "license": "MIT" }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, "engines": { "node": ">=12" }, "optionalDependencies": { "@esbuild/aix-ppc64": "0.21.5", "@esbuild/android-arm": "0.21.5", "@esbuild/android-arm64": "0.21.5", "@esbuild/android-x64": "0.21.5", "@esbuild/darwin-arm64": "0.21.5", "@esbuild/darwin-x64": "0.21.5", "@esbuild/freebsd-arm64": "0.21.5", "@esbuild/freebsd-x64": "0.21.5", "@esbuild/linux-arm": "0.21.5", "@esbuild/linux-arm64": "0.21.5", "@esbuild/linux-ia32": "0.21.5", "@esbuild/linux-loong64": "0.21.5", "@esbuild/linux-mips64el": "0.21.5", "@esbuild/linux-ppc64": "0.21.5", "@esbuild/linux-riscv64": "0.21.5", "@esbuild/linux-s390x": "0.21.5", "@esbuild/linux-x64": "0.21.5", "@esbuild/netbsd-x64": "0.21.5", "@esbuild/openbsd-x64": "0.21.5", "@esbuild/sunos-x64": "0.21.5", "@esbuild/win32-arm64": "0.21.5", "@esbuild/win32-ia32": "0.21.5", "@esbuild/win32-x64": "0.21.5" } }, "node_modules/estree-walker": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" } }, "node_modules/expect-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=12.0.0" } }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, "os": ["darwin"], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/is-core-module": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/js-toml": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/js-toml/-/js-toml-1.0.0.tgz", "integrity": "sha512-G757004huuG5Cjg8KUoVTS4zNRR4449KG8kjtFQS0yyQnceq3KfxcArThcqUV2cwdpd0C9I+e1WciK3Xm4cWJw==", "license": "MIT", "dependencies": { "chevrotain": "^11.0.3", "xregexp": "^5.1.1" } }, "node_modules/lodash-es": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "license": "MIT" }, "node_modules/loupe": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", "dev": true, "license": "MIT" }, "node_modules/magic-string": { "version": "0.30.13", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.13.tgz", "integrity": "sha512-8rYBO+MsWkgjDSOvLomYnzhdwEG51olQ4zL5KXnNJWV5MNmrb4rTZdrtkhxjnD/QyZUqR/Z/XDsUs/4ej2nx0g==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" } }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "license": "MIT" }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, "engines": { "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true, "license": "MIT" }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", "dev": true, "license": "MIT" }, "node_modules/pathval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, "license": "MIT", "engines": { "node": ">= 14.16" } }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, "license": "ISC" }, "node_modules/picomatch": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/postcss": { "version": "8.4.49", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/postcss/" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", "license": "MIT" }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "license": "MIT", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/rollup": { "version": "4.27.3", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.3.tgz", "integrity": "sha512-SLsCOnlmGt9VoZ9Ek8yBK8tAdmPHeppkw+Xa7yDlCEhDTvwYei03JlWo1fdc7YTfLZ4tD8riJCUyAgTbszk1fQ==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" }, "engines": { "node": ">=18.0.0", "npm": ">=8.0.0" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.27.3", "@rollup/rollup-android-arm64": "4.27.3", "@rollup/rollup-darwin-arm64": "4.27.3", "@rollup/rollup-darwin-x64": "4.27.3", "@rollup/rollup-freebsd-arm64": "4.27.3", "@rollup/rollup-freebsd-x64": "4.27.3", "@rollup/rollup-linux-arm-gnueabihf": "4.27.3", "@rollup/rollup-linux-arm-musleabihf": "4.27.3", "@rollup/rollup-linux-arm64-gnu": "4.27.3", "@rollup/rollup-linux-arm64-musl": "4.27.3", "@rollup/rollup-linux-powerpc64le-gnu": "4.27.3", "@rollup/rollup-linux-riscv64-gnu": "4.27.3", "@rollup/rollup-linux-s390x-gnu": "4.27.3", "@rollup/rollup-linux-x64-gnu": "4.27.3", "@rollup/rollup-linux-x64-musl": "4.27.3", "@rollup/rollup-win32-arm64-msvc": "4.27.3", "@rollup/rollup-win32-ia32-msvc": "4.27.3", "@rollup/rollup-win32-x64-msvc": "4.27.3", "fsevents": "~2.3.2" } }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true, "license": "ISC" }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true, "license": "MIT" }, "node_modules/std-env": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", "dev": true, "license": "MIT" }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", "dev": true, "license": "MIT" }, "node_modules/tinyexec": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz", "integrity": "sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==", "dev": true, "license": "MIT" }, "node_modules/tinypool": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz", "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==", "dev": true, "license": "MIT", "engines": { "node": "^18.0.0 || >=20.0.0" } }, "node_modules/tinyrainbow": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", "dev": true, "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", "dev": true, "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true, "license": "0BSD", "optional": true, "peer": true }, "node_modules/typescript": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=14.17" } }, "node_modules/undici-types": { "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true, "license": "MIT" }, "node_modules/vite": { "version": "5.4.11", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" }, "engines": { "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || >=20.0.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, "less": { "optional": true }, "lightningcss": { "optional": true }, "sass": { "optional": true }, "sass-embedded": { "optional": true }, "stylus": { "optional": true }, "sugarss": { "optional": true }, "terser": { "optional": true } } }, "node_modules/vite-node": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.5.tgz", "integrity": "sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==", "dev": true, "license": "MIT", "dependencies": { "cac": "^6.7.14", "debug": "^4.3.7", "es-module-lexer": "^1.5.4", "pathe": "^1.1.2", "vite": "^5.0.0" }, "bin": { "vite-node": "vite-node.mjs" }, "engines": { "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/vitest": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz", "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==", "dev": true, "license": "MIT", "dependencies": { "@vitest/expect": "2.1.5", "@vitest/mocker": "2.1.5", "@vitest/pretty-format": "^2.1.5", "@vitest/runner": "2.1.5", "@vitest/snapshot": "2.1.5", "@vitest/spy": "2.1.5", "@vitest/utils": "2.1.5", "chai": "^5.1.2", "debug": "^4.3.7", "expect-type": "^1.1.0", "magic-string": "^0.30.12", "pathe": "^1.1.2", "std-env": "^3.8.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.1", "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", "vite-node": "2.1.5", "why-is-node-running": "^2.3.0" }, "bin": { "vitest": "vitest.mjs" }, "engines": { "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", "@vitest/browser": "2.1.5", "@vitest/ui": "2.1.5", "happy-dom": "*", "jsdom": "*" }, "peerDependenciesMeta": { "@edge-runtime/vm": { "optional": true }, "@types/node": { "optional": true }, "@vitest/browser": { "optional": true }, "@vitest/ui": { "optional": true }, "happy-dom": { "optional": true }, "jsdom": { "optional": true } } }, "node_modules/why-is-node-running": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dev": true, "license": "MIT", "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" }, "engines": { "node": ">=8" } }, "node_modules/xregexp": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-5.1.1.tgz", "integrity": "sha512-fKXeVorD+CzWvFs7VBuKTYIW63YD1e1osxwQ8caZ6o1jg6pDAbABDG54LCIq0j5cy7PjRvGIq6sef9DYPXpncg==", "license": "MIT", "dependencies": { "@babel/runtime-corejs3": "^7.16.5" } } } }
-
-
-
@@ -0,0 +1,6 @@npm lockfile. While this is auto-generated and I don't care copyright of this contents, using same copyright & license is convenient for users. In fact, npm (package.json) does not allow mixing different licensed files. SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: Apache-2.0
-
-
package.json (new)
-
@@ -0,0 +1,49 @@{ "name": "@pocka/rollup-plugin-gleam", "version": "0.1.0", "description": "Rollup plugin for Gleam language.", "keywords": ["rollup-plugin", "vite-plugin"], "bugs": { "url": "https://github.com/pocka/rollup-plugin-gleam/issues" }, "license": "Apache-2.0", "author": { "name": "Shota FUJI", "email": "pockawoooh@gmail.com" }, "files": [ "esm/es2020/plugin.js", "esm/es2020/plugin.d.ts", "LICENSES/*.txt", "docs/SECURITY.md", "package.json.license" ], "type": "module", "exports": { ".": "esm/es2020/plugin.js" }, "peerDependencies": { "rollup": "^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } }, "dependencies": { "js-toml": "^1.0.0" }, "devDependencies": { "@rollup/plugin-typescript": "^12.1.1", "@types/node": "^22.9.3", "rollup": "^4.27.3", "typescript": "^5.7.2", "vite": "^5.4.11", "vitest": "^2.1.5" }, "scripts": { "build": "tsc -p tsconfig.build.json", "test": "vitest", "prepare": "npm run build" } }
-
-
package.json.license (new)
-
@@ -0,0 +1,2 @@SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: Apache-2.0
-
-
src/plugin.ts (new)
-
@@ -0,0 +1,204 @@//! Rollup plugin for Gleam language. // //! SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> //! SPDX-License-Identifier: Apache-2.0 import { execFile } from "node:child_process"; import { readFile } from "node:fs/promises"; import * as path from "node:path"; import { promisify } from "node:util"; import { fileURLToPath } from "node:url"; import * as toml from "js-toml"; import type { Plugin } from "rollup"; interface GleamTOML { name: string; version: string; } function isGleamTOML(x: unknown): x is GleamTOML { if (typeof x !== "object" || !x) { return false; } if (!("name" in x && typeof x.name === "string" && x.name)) { return false; } if (!("version" in x && typeof x.version === "string" && x.version)) { return false; } return true; } export interface GleamPluginOptions { /** * Path to `gleam.toml` file. * This plugin looks for source directory and build directory based on this file location. * * Current working directory will be used to resolve relative paths. * * @default "./gleam.toml" */ gleamToml?: URL | string; /** * Path to or name of the Gleam binary file to invoke. * @default "gleam" */ bin?: string; buildOptions?: { /** * Emit compile time warnings as errors. * Enables `--warnings-as-errors` CLI flag. */ warningsAsErrors?: boolean; }; } export function gleam({ bin = "gleam", buildOptions = {}, gleamToml: gleamTomlPathOrUrl = "./gleam.toml", }: GleamPluginOptions = {}): Plugin { /** * Parsed contents of `gleam.toml`. */ let gleamToml: GleamTOML | null = null; const projectRoot = typeof gleamTomlPathOrUrl === "string" ? path.resolve(gleamTomlPathOrUrl, "..") : fileURLToPath(new URL("./", gleamTomlPathOrUrl)); // Gleam expects a project to have `src/` directory at project root. const srcDir = path.resolve(projectRoot, "src"); // Gleam compiler outputs artifacts under `build/` directory at project root. // Directory structure inside is not documentated, but this is the only way // to access built JS files. There is no way to specify output directory also. const jsOutDir = path.resolve(projectRoot, "build/dev/javascript"); const buildCommandArgs = ["build", "--target", "javascript"]; if (buildOptions.warningsAsErrors) { buildCommandArgs.push("--warnings-as-errors"); } // Build command won't change during the plugin's lifetime. // It's fine to bind everything upfront. const buildProject = promisify(execFile).bind(null, bin, buildCommandArgs, { cwd: projectRoot, }); return { name: "gleam", async buildStart() { // Changes to `gleam.toml` should trigger rerun of this hook. // Otherwise, if `name` field got changed for example, Rollup tries to access nonexistent // files based on an old name (build/dev/javascript/old_name/foo.mjs). this.addWatchFile( typeof gleamTomlPathOrUrl === "string" ? gleamTomlPathOrUrl : fileURLToPath(gleamTomlPathOrUrl), ); const parsed = toml.load(await readFile(gleamTomlPathOrUrl, { encoding: "utf8" })); if (!isGleamTOML(parsed)) { // TypeScript can't narrow types using `never`. Putting `return` after this line // triggers `Unreachable code detected.` so we have to *return never*. // <https://github.com/microsoft/TypeScript/issues/12825> // Following code contains the same workaround for this reason. return this.error(`gleam.toml does not comform to official schema.`); } gleamToml = parsed; }, async watchChange(id, _change) { // Whenever indirectly imported .gleam file is changed, build the whole project. // Gleam compiler does the incremental compilation (we don't have a way to partially compile.) if (id.endsWith(".gleam")) { await buildProject(); return; } }, async transform(_code, id) { // Associate .mjs file generated by Gleam compiler to its source .gleam file. // This enables changing **imported** .gleam files to trigger rebuild. if (id.startsWith(jsOutDir) && id.endsWith(".mjs")) { if (!gleamToml) { this.warn( "Detected access to Gleam build artifacts without `gleam.toml` loaded.", ); return null; } if (id.endsWith("/gleam.mjs")) { // Skip if the file is Gleam runtime one (no corresponding .gleam file). return null; } if (!id.startsWith(path.resolve(jsOutDir, gleamToml.name))) { // Skip third-party packages, as users are not supposed to edit those source files directly. return null; } /** * Module namespace and module name. * * "build/dev/javascript/my_package/foo/bar.mjs" * -> "foo/bar" */ const modulePath = id // `+1` ... removing path separator .slice(path.resolve(jsOutDir, gleamToml.name).length + 1) .replace(/\.mjs$/, ""); /** * Gleam source code file that produces this .mjs file. * * "build/dev/javascript/my_package/foo/bar.mjs" * -> "src/foo/bar.gleam" */ const gleamSrc = path.resolve(srcDir, modulePath) + ".gleam"; this.addWatchFile(gleamSrc); // Do not touch code. Only important thing here is `addWatchFiles(gleamSrc)`. return null; } // .gleam files imported by non-Gleam modules (e.g. .js, .ts) run through this branch. // This branch triggers a build then returns proxy code that re-exports everything from // the generated .mjs file. if (id.endsWith(".gleam")) { if (!gleamToml) { return this.error( "Unable to resolve transpiled Gleam file without `gleam.toml`.", ); } const absPath = path.resolve(srcDir, id); if (!absPath.startsWith(srcDir)) { this.error("Gleam files must be inside the src/ directory."); } const modulePath = absPath // `+1` ... removing path separator .slice(srcDir.length + 1) .replace(/\.gleam$/, ".mjs"); const transpiledMjsPath = path.resolve(jsOutDir, gleamToml.name, modulePath); await buildProject(); return { code: `export * from ${JSON.stringify(transpiledMjsPath)}`, }; } }, }; } export default gleam;
-
-
-
@@ -0,0 +1,24 @@// Test suites for handling of malformed manifest file. // // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> // SPDX-License-Identifier: Apache-2.0 import { rollup } from "rollup"; import { describe, expect, it } from "vitest"; import { gleam } from "../../src/plugin"; describe("Malformed gleam.toml", () => { it("Should abort build when gleam.toml is malformed", async () => { await expect(() => rollup({ input: new URL("./src/main.js", import.meta.url).pathname, plugins: [ gleam({ gleamToml: new URL("./gleam.toml", import.meta.url), }), ], }), ).rejects.toThrow(); }); });
-
-
-
@@ -0,0 +1,1 @@version = "1.0.0"
-
-
-
@@ -0,0 +1,3 @@pub fn hello_world() -> String { "Hello, World!" }
-
-
-
@@ -0,0 +1,3 @@import { hello_world } from "./main.gleam"; console.log(hello_world());
-
-
-
@@ -0,0 +1,50 @@// Test suites for basic features. // // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> // SPDX-License-Identifier: Apache-2.0 import { rollup } from "rollup"; import { describe, expect, it } from "vitest"; import { gleam } from "../../src/plugin"; describe("Simple Gleam code", () => { it("Should transpile Gleam files to JS files", async ({ onTestFinished }) => { const build = await rollup({ input: new URL("./src/main.js", import.meta.url).pathname, plugins: [ gleam({ gleamToml: new URL("./gleam.toml", import.meta.url), }), ], }); onTestFinished(() => build.close()); const { output } = await build.generate({}); expect(output).toHaveLength(1); expect(output[0].code).toMatch("function hello_world("); expect(output[0].code).toMatch("function hello("); expect(build.watchFiles.some((id) => id.endsWith("/src/main.gleam"))).toBe(true); expect(build.watchFiles.some((id) => id.endsWith("/src/hello.gleam"))).toBe(true); expect( output[0].moduleIds.some((id) => id.endsWith("/dev/javascript/test_simple/hello.mjs"), ), ).toBe(true); }); it("Should abort build if gleam.toml does not exist", async () => { await expect(() => rollup({ input: new URL("./src/main.js", import.meta.url).pathname, plugins: [ gleam({ gleamToml: new URL("./not_gleam.toml", import.meta.url), }), ], }), ).rejects.toThrow(); }); });
-
-
tests/simple/gleam.toml (new)
-
@@ -0,0 +1,2 @@name = "test_simple" version = "1.0.0"
-
-
-
@@ -0,0 +1,6 @@# This file was generated by Gleam # You typically do not need to edit this file packages = [] [requirements]
-
-
-
@@ -0,0 +1,3 @@pub fn hello(person: String) -> String { "Hello " <> person }
-
-
-
@@ -0,0 +1,5 @@import hello pub fn hello_world() -> String { hello.hello("World") }
-
-
tests/simple/src/main.js (new)
-
@@ -0,0 +1,3 @@import { hello_world } from "./main.gleam"; console.log(hello_world());
-
-
-
@@ -0,0 +1,47 @@// Test suites for building third-party packages. // // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> // SPDX-License-Identifier: Apache-2.0 import { rollup } from "rollup"; import { describe, expect, it } from "vitest"; import { gleam } from "../../src/plugin"; const CIRCULAR_DEPS_FILES_PATTERN = /\/build\/dev\/javascript\/(gleam_stdlib|gleam_json|lustre)\//; describe("Third party packages", () => { it("Should include third party packages in the bundle", async ({ onTestFinished }) => { const build = await rollup({ input: new URL("./src/main.js", import.meta.url).pathname, onwarn(warning, defaultHandler) { // JS files generated by Gleam frequently have circular dependencies. // However, that warning is not related to this test because those are // upstream problem, not this plugin's one. if ( warning.code === "CIRCULAR_DEPENDENCY" && warning.ids?.every((id) => CIRCULAR_DEPS_FILES_PATTERN.test(id)) ) { return; } return defaultHandler(warning); }, plugins: [ gleam({ gleamToml: new URL("./gleam.toml", import.meta.url), }), ], }); onTestFinished(() => build.close()); const { output } = await build.generate({}); expect(output).toHaveLength(1); expect( output[0].moduleIds.some((id) => id.endsWith("/dev/javascript/lustre/lustre.mjs")), ).toBe(true); }); });
-
-
-
@@ -0,0 +1,6 @@name = "test_third_party_package" version = "1.0.0" [dependencies] gleam_stdlib = ">= 0.34.0 and < 2.0.0" lustre = ">= 4.3.2 and < 5.0.0"
-
-
-
@@ -0,0 +1,14 @@# This file was generated by Gleam # You typically do not need to edit this file packages = [ { name = "gleam_erlang", version = "0.30.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "760618870AE4A497B10C73548E6E44F43B76292A54F0207B3771CBB599C675B4" }, { name = "gleam_json", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "0A57FB5666E695FD2BEE74C0428A98B0FC11A395D2C7B4CDF5E22C5DD32C74C6" }, { name = "gleam_otp", version = "0.14.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "5A8CE8DBD01C29403390A7BD5C0A63D26F865C83173CF9708E6E827E53159C65" }, { name = "gleam_stdlib", version = "0.43.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "69EF22E78FDCA9097CBE7DF91C05B2A8B5436826D9F66680D879182C0860A747" }, { name = "lustre", version = "4.6.1", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "486C3CFBD126939CAD2CA8B92A979A2DAADA5BABAA62BF2B163CD21E257BD4A1" }, ] [requirements] gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" } lustre = { version = ">= 4.3.2 and < 5.0.0" }
-
-
-
@@ -0,0 +1,46 @@import gleam/string import lustre import lustre/attribute.{attribute, id} import lustre/element.{type Element} import lustre/element/html // MODEL pub type Model = String fn init(_) -> Model { "World" } // UPDATE pub type Msg { Reverse } fn update(model: Model, msg: Msg) -> Model { case msg { Reverse -> string.reverse(model) } } // VIEW fn view(model: Model) -> Element(Msg) { html.div([], [ html.p([id("greeting")], [element.text("Hello, "), element.text(model)]), html.button([attribute("aria-controls", "greeting")], [ element.text("Reverse"), ]), ]) } // MAIN pub fn main() { let app = lustre.simple(init, update, view) let assert Ok(_) = lustre.start(app, "#app", Nil) Nil }
-
-
-
@@ -0,0 +1,3 @@import { main } from "./main.gleam"; main();
-
-
tests/vite/build.test.ts (new)
-
@@ -0,0 +1,57 @@// Test suites for Vite compatibility. // // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> // SPDX-License-Identifier: Apache-2.0 import { readFile, writeFile } from "node:fs/promises"; import { fileURLToPath } from "node:url"; import { createServer } from "vite"; import { describe, expect, it, vitest } from "vitest"; import { gleam } from "../../src/plugin"; describe("Vite compatibility", () => { it("Should rebuild on a change to .gleam file", async ({ onTestFinished }) => { const app = new URL("./src/app.gleam", import.meta.url); const originalApp = await readFile(app, { encoding: "utf-8" }); onTestFinished(() => writeFile(app, originalApp, { encoding: "utf-8" })); const server = await createServer({ configFile: false, root: fileURLToPath(new URL(".", import.meta.url)), logLevel: "warn", plugins: [ gleam({ gleamToml: new URL("./gleam.toml", import.meta.url), }), ], }); await server.listen(); onTestFinished(() => server.close()); await server.warmupRequest("/src/main.js"); await server.waitForRequestsIdle(); const appMjsBefore = await server.transformRequest( "/build/dev/javascript/test_vite/app.mjs", ); expect(appMjsBefore!.code).toMatch(`"World"`); await writeFile(app, originalApp.replace("World", "Gleam"), { encoding: "utf-8", }); // Vite seems to have no way to test HMR/watch things from outside. // Unfortunately polling is the most reliable option. await vitest.waitFor(async () => { const appMjsAfter = await server.transformRequest( "/build/dev/javascript/test_vite/app.mjs", ); expect(appMjsAfter!.code).toMatch(`"Gleam"`); }); }); });
-
-
tests/vite/gleam.toml (new)
-
@@ -0,0 +1,2 @@name = "test_vite" version = "1.0.0"
-
-
tests/vite/index.html (new)
-
@@ -0,0 +1,8 @@<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <script type="module" src="./src/main.js"></script> </head> <body></body> </html>
-
-
tests/vite/manifest.toml (new)
-
@@ -0,0 +1,6 @@# This file was generated by Gleam # You typically do not need to edit this file packages = [] [requirements]
-
-
-
@@ -0,0 +1,3 @@export function render(text: string): void { document.body.textContent = text; }
-
-
tests/vite/src/app.gleam (new)
-
@@ -0,0 +1,8 @@import hello @external(javascript, "./app.ffi.ts", "render") fn render(text: String) -> Nil pub fn main() -> Nil { render(hello.hello("World")) }
-
-
-
@@ -0,0 +1,3 @@pub fn hello(name: String) -> String { "Hello, " <> name <> "!" }
-
-
tests/vite/src/main.js (new)
-
@@ -0,0 +1,3 @@import { main } from "./app.gleam"; main();
-
-
-
@@ -0,0 +1,46 @@// Test suites for `buildOptions.warningAsErrors` option. // // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> // SPDX-License-Identifier: Apache-2.0 import { rollup } from "rollup"; import { describe, expect, it } from "vitest"; import { gleam } from "../../src/plugin"; describe("warnings_as_errors", () => { it("Should abort build on warnings, when enabled", async () => { await expect(() => rollup({ input: new URL("./src/main.js", import.meta.url).pathname, plugins: [ gleam({ gleamToml: new URL("./gleam.toml", import.meta.url), buildOptions: { warningsAsErrors: true, }, }), ], }), ).rejects.toThrow(); }); it("Should not abort build on warnings, when disabled", async ({ onTestFinished }) => { const build = await rollup({ input: new URL("./src/main.js", import.meta.url).pathname, plugins: [ gleam({ gleamToml: new URL("./gleam.toml", import.meta.url), }), ], }); onTestFinished(() => build.close()); const { output } = await build.generate({}); expect(output).toHaveLength(1); expect(output[0].code).toMatch("function hello_world("); expect(build.watchFiles.some((id) => id.endsWith("/src/main.gleam"))).toBe(true); }); });
-
-
-
@@ -0,0 +1,2 @@name = "test_warnings_as_errors" version = "1.0.0"
-
-
-
@@ -0,0 +1,6 @@# This file was generated by Gleam # You typically do not need to edit this file packages = [] [requirements]
-
-
-
@@ -0,0 +1,5 @@pub fn hello_world() -> String { let world = "World!" "Hello, World!" }
-
-
-
@@ -0,0 +1,3 @@import { hello_world } from "./main.gleam"; console.log(hello_world());
-
-
-
@@ -0,0 +1,182 @@// Test suites for building on file changes. // // SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> // SPDX-License-Identifier: Apache-2.0 import { readFile, writeFile } from "node:fs/promises"; import { type RollupWatcherEvent, watch } from "rollup"; import { describe, expect, it } from "vitest"; import { gleam } from "../../src/plugin"; describe("Watch mode", () => { it("Should rebuild on a change to .gleam file", async ({ onTestFinished }) => { const main = new URL("./src/main.gleam", import.meta.url); const originalMain = await readFile(main, { encoding: "utf-8" }); onTestFinished(() => writeFile(main, originalMain, { encoding: "utf-8" })); const watcher = watch({ output: { dir: new URL("./dist", import.meta.url).pathname, }, input: new URL("./src/main.js", import.meta.url).pathname, plugins: [gleam({ gleamToml: new URL("./gleam.toml", import.meta.url) })], }); onTestFinished(() => watcher.close()); const build = () => new Promise<string>((resolve, reject) => { const listener = async (event: RollupWatcherEvent) => { switch (event.code) { case "ERROR": reject(event.error); break; case "BUNDLE_END": try { const build = await event.result.generate({}); resolve(build.output[0].code); } catch (error) { reject(error); } finally { event.result.close(); } break; default: return; } watcher.off("event", listener); }; watcher.on("event", listener); }); expect(await build()).toMatch(`"World"`); const [changedCode] = await Promise.all([ build(), writeFile(main, originalMain.replace("World", "John Doe"), { encoding: "utf-8", }), ]); expect(changedCode).toMatch(`"John Doe"`); }); it("Should rebuild on a change to indirect .gleam file", async ({ onTestFinished }) => { const hello = new URL("./src/hello.gleam", import.meta.url); const originalHello = await readFile(hello, { encoding: "utf-8", }); onTestFinished(() => writeFile(hello, originalHello, { encoding: "utf-8", }), ); const watcher = watch({ output: { dir: new URL("./dist", import.meta.url).pathname, }, input: new URL("./src/main.js", import.meta.url).pathname, plugins: [ gleam({ gleamToml: new URL("./gleam.toml", import.meta.url), }), ], }); onTestFinished(() => watcher.close()); const build = () => new Promise<string>((resolve, reject) => { const listener = async (event: RollupWatcherEvent) => { switch (event.code) { case "ERROR": reject(event.error); break; case "BUNDLE_END": try { const build = await event.result.generate({}); resolve(build.output[0].code); } catch (error) { reject(error); } finally { event.result.close(); } break; default: return; } watcher.off("event", listener); }; watcher.on("event", listener); }); expect(await build()).toMatch(`"Hello "`); const [changedCode] = await Promise.all([ build(), writeFile(hello, originalHello.replace("Hello", "Hi"), { encoding: "utf-8", }), ]); expect(changedCode).toMatch(`"Hi "`); }); it("Should rebuild on a change to gleam.toml", async ({ onTestFinished }) => { const gleamToml = new URL("./gleam.toml", import.meta.url); const originalGleamToml = await readFile(gleamToml, { encoding: "utf-8" }); onTestFinished(() => writeFile(gleamToml, originalGleamToml, { encoding: "utf-8" })); const watcher = watch({ output: { dir: new URL("./dist", import.meta.url).pathname, }, input: new URL("./src/main.js", import.meta.url).pathname, plugins: [gleam({ gleamToml })], }); onTestFinished(() => watcher.close()); const build = () => new Promise<boolean>((resolve, reject) => { const listener = (event: RollupWatcherEvent) => { switch (event.code) { case "ERROR": reject(event.error); break; case "BUNDLE_END": event.result.close(); resolve(true); break; default: return; } watcher.off("event", listener); }; watcher.on("event", listener); }); expect(await build()).toBe(true); await writeFile(gleamToml, originalGleamToml.replace("1.0.0", "1.0.1"), { encoding: "utf-8", }); expect(await build()).toBe(true); }); });
-
-
tests/watch/gleam.toml (new)
-
@@ -0,0 +1,2 @@name = "test_watch" version = "1.0.0"
-
-
-
@@ -0,0 +1,6 @@# This file was generated by Gleam # You typically do not need to edit this file packages = [] [requirements]
-
-
-
@@ -0,0 +1,3 @@pub fn hello(person: String) -> String { "Hello " <> person }
-
-
-
@@ -0,0 +1,5 @@import hello pub fn hello_world() -> String { hello.hello("World") }
-
-
tests/watch/src/main.js (new)
-
@@ -0,0 +1,3 @@import { hello_world } from "./main.gleam"; console.log(hello_world());
-
-
tsconfig.build.json (new)
-
@@ -0,0 +1,9 @@{ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "esm/es2020", "noEmit": false, "declaration": true }, "include": ["./src/plugin.ts"] }
-
-
-
@@ -0,0 +1,5 @@TypeScript config file. This one is for generating release JS files. SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: Apache-2.0
-
-
tsconfig.json (new)
-
@@ -0,0 +1,14 @@{ "compilerOptions": { "strict": true, "lib": ["ES2020"], "module": "NodeNext", "moduleResolution": "NodeNext", "target": "ES2020", "noUncheckedIndexedAccess": true, "noUnusedLocals": true, "noUnusedParameters": true, "noEmit": true }, "include": ["./src/**/*.ts", "./test/**/*.ts"] }
-
-
tsconfig.json.license (new)
-
@@ -0,0 +1,4 @@TypeScript config file. This one is for LSP. SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: Apache-2.0
-