Spaces:
Paused
Paused
Upload folder using huggingface_hub (part 2)
Browse files- node_modules/resolve-protobuf-schema/test/b.proto +5 -0
- node_modules/resolve-protobuf-schema/test/c.proto +3 -0
- node_modules/resolve-protobuf-schema/test/index.js +49 -0
- node_modules/right-now/LICENSE.md +18 -0
- node_modules/right-now/README.md +28 -0
- node_modules/right-now/browser.js +7 -0
- node_modules/right-now/index.js +4 -0
- node_modules/right-now/package.json +28 -0
- node_modules/ripemd160/.github/FUNDING.yml +12 -0
- node_modules/ripemd160/CHANGELOG.md +109 -0
- node_modules/ripemd160/LICENSE +21 -0
- node_modules/ripemd160/README.md +27 -0
- node_modules/ripemd160/index.js +167 -0
- node_modules/ripemd160/node_modules/hash-base/.github/FUNDING.yml +12 -0
- node_modules/ripemd160/node_modules/hash-base/CHANGELOG.md +166 -0
- node_modules/ripemd160/node_modules/hash-base/LICENSE +21 -0
- node_modules/ripemd160/node_modules/hash-base/README.md +48 -0
- node_modules/ripemd160/node_modules/hash-base/index.js +109 -0
- node_modules/ripemd160/node_modules/hash-base/package.json +64 -0
- node_modules/ripemd160/node_modules/hash-base/to-buffer.js +20 -0
- node_modules/ripemd160/package.json +64 -0
- node_modules/rollup/LICENSE.md +679 -0
- node_modules/rollup/README.md +134 -0
- node_modules/rollup/dist/bin/rollup +1912 -0
- node_modules/rollup/dist/es/getLogFilter.js +64 -0
- node_modules/rollup/dist/es/package.json +1 -0
- node_modules/rollup/dist/es/parseAst.js +12 -0
- node_modules/rollup/dist/es/rollup.js +17 -0
- node_modules/rollup/dist/es/shared/node-entry.js +0 -0
- node_modules/rollup/dist/es/shared/parseAst.js +2096 -0
- node_modules/rollup/dist/es/shared/watch.js +0 -0
- node_modules/rollup/dist/getLogFilter.d.ts +5 -0
- node_modules/rollup/dist/getLogFilter.js +69 -0
- node_modules/rollup/dist/loadConfigFile.d.ts +20 -0
- node_modules/rollup/dist/loadConfigFile.js +29 -0
- node_modules/rollup/dist/native.js +161 -0
- node_modules/rollup/dist/parseAst.d.ts +4 -0
- node_modules/rollup/dist/parseAst.js +22 -0
- node_modules/rollup/dist/rollup.d.ts +1225 -0
- node_modules/rollup/dist/rollup.js +127 -0
- node_modules/rollup/dist/shared/fsevents-importer.js +37 -0
- node_modules/rollup/dist/shared/index.js +0 -0
- node_modules/rollup/dist/shared/loadConfigFile.js +572 -0
- node_modules/rollup/dist/shared/parseAst.js +2330 -0
- node_modules/rollup/dist/shared/rollup.js +0 -0
- node_modules/rollup/dist/shared/watch-cli.js +542 -0
- node_modules/rollup/dist/shared/watch.js +324 -0
- node_modules/rollup/package.json +286 -0
- node_modules/router/HISTORY.md +228 -0
- node_modules/router/LICENSE +23 -0
node_modules/resolve-protobuf-schema/test/b.proto
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import "./c.proto";
|
| 2 |
+
|
| 3 |
+
message B {
|
| 4 |
+
optional string b = 1;
|
| 5 |
+
}
|
node_modules/resolve-protobuf-schema/test/c.proto
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
message C {
|
| 2 |
+
optional string c = 1;
|
| 3 |
+
}
|
node_modules/resolve-protobuf-schema/test/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var tape = require('tape')
|
| 2 |
+
var schema = require('../')
|
| 3 |
+
|
| 4 |
+
var test = function(name, fn) {
|
| 5 |
+
tape(name, function(t) {
|
| 6 |
+
fn(t, schema)
|
| 7 |
+
})
|
| 8 |
+
tape(name+' sync', function(t) {
|
| 9 |
+
fn(t, function(name, cb) {
|
| 10 |
+
cb(null, schema.sync(name))
|
| 11 |
+
})
|
| 12 |
+
})
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
test('c', function(t, schema) {
|
| 16 |
+
schema(__dirname+'/c.proto', function(err, sch) {
|
| 17 |
+
t.notOk(err, 'no err')
|
| 18 |
+
t.same(sch.messages.length, 1)
|
| 19 |
+
schema(__dirname+'/c', function(err, sch) {
|
| 20 |
+
t.notOk(err, 'no err')
|
| 21 |
+
t.same(sch.messages.length, 1)
|
| 22 |
+
t.end()
|
| 23 |
+
})
|
| 24 |
+
})
|
| 25 |
+
})
|
| 26 |
+
|
| 27 |
+
test('b imports c', function(t, schema) {
|
| 28 |
+
schema(__dirname+'/b.proto', function(err, sch) {
|
| 29 |
+
t.notOk(err, 'no err')
|
| 30 |
+
t.same(sch.messages.length, 2)
|
| 31 |
+
schema(__dirname+'/b', function(err, sch) {
|
| 32 |
+
t.notOk(err, 'no err')
|
| 33 |
+
t.same(sch.messages.length, 2)
|
| 34 |
+
t.end()
|
| 35 |
+
})
|
| 36 |
+
})
|
| 37 |
+
})
|
| 38 |
+
|
| 39 |
+
test('a imports b imports c', function(t, schema) {
|
| 40 |
+
schema(__dirname+'/a.proto', function(err, sch) {
|
| 41 |
+
t.notOk(err, 'no err')
|
| 42 |
+
t.same(sch.messages.length, 3)
|
| 43 |
+
schema(__dirname+'/a', function(err, sch) {
|
| 44 |
+
t.notOk(err, 'no err')
|
| 45 |
+
t.same(sch.messages.length, 3)
|
| 46 |
+
t.end()
|
| 47 |
+
})
|
| 48 |
+
})
|
| 49 |
+
})
|
node_modules/right-now/LICENSE.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This software is released under the MIT license:
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
| 4 |
+
this software and associated documentation files (the "Software"), to deal in
|
| 5 |
+
the Software without restriction, including without limitation the rights to
|
| 6 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
| 7 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
| 8 |
+
subject to the following conditions:
|
| 9 |
+
|
| 10 |
+
The above copyright notice and this permission notice shall be included in all
|
| 11 |
+
copies or substantial portions of the Software.
|
| 12 |
+
|
| 13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
| 15 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
| 16 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
| 17 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
| 18 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/right-now/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# right-now [](http://github.com/hughsk/stability-badges) #
|
| 2 |
+
|
| 3 |
+
Get the quickest, most high-resolution timestamp possible in node or the
|
| 4 |
+
browser.
|
| 5 |
+
|
| 6 |
+
Instead of returning the date, `right-now` may use `performance.now`,
|
| 7 |
+
`Date.now`, `+new Date` or `process.hrtime` to get a timestamp suitable for
|
| 8 |
+
measuring intervals of time. Handy for both animation loops and precision
|
| 9 |
+
benchmarking.
|
| 10 |
+
|
| 11 |
+
It's pretty small but saves me writing this boilerplate every time :)
|
| 12 |
+
|
| 13 |
+
## Installation ##
|
| 14 |
+
|
| 15 |
+
``` bash
|
| 16 |
+
npm install right-now
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
## Usage ##
|
| 20 |
+
|
| 21 |
+
### `require('right-now')()` ###
|
| 22 |
+
|
| 23 |
+
Returns a timestamp. In node, this uses `process.hrtime`. In the browser,
|
| 24 |
+
support for the following is checked in this order:
|
| 25 |
+
|
| 26 |
+
* `performance.now()`
|
| 27 |
+
* `Date.now()`
|
| 28 |
+
* `+new Date`
|
node_modules/right-now/browser.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module.exports =
|
| 2 |
+
global.performance &&
|
| 3 |
+
global.performance.now ? function now() {
|
| 4 |
+
return performance.now()
|
| 5 |
+
} : Date.now || function now() {
|
| 6 |
+
return +new Date
|
| 7 |
+
}
|
node_modules/right-now/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module.exports = function now() {
|
| 2 |
+
var time = process.hrtime()
|
| 3 |
+
return time[0] * 1e3 + time[1] / 1e6
|
| 4 |
+
}
|
node_modules/right-now/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "right-now",
|
| 3 |
+
"version": "1.0.0",
|
| 4 |
+
"description": "Get the quickest, most high-resolution timestamp possible in node or the browser",
|
| 5 |
+
"main": "index.js",
|
| 6 |
+
"browser": "browser.js",
|
| 7 |
+
"scripts": {
|
| 8 |
+
"test": "say sorry"
|
| 9 |
+
},
|
| 10 |
+
"repository": {
|
| 11 |
+
"type": "git",
|
| 12 |
+
"url": "git://github.com/hughsk/right-now.git"
|
| 13 |
+
},
|
| 14 |
+
"keywords": [
|
| 15 |
+
"time",
|
| 16 |
+
"high",
|
| 17 |
+
"resolution",
|
| 18 |
+
"fast",
|
| 19 |
+
"quick",
|
| 20 |
+
"nanosecond",
|
| 21 |
+
"millsecond",
|
| 22 |
+
"performance",
|
| 23 |
+
"now"
|
| 24 |
+
],
|
| 25 |
+
"author": "Hugh Kennedy <hughskennedy@gmail.com> (http://hughskennedy.com/)",
|
| 26 |
+
"license": "MIT",
|
| 27 |
+
"readmeFilename": "README.md"
|
| 28 |
+
}
|
node_modules/ripemd160/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# These are supported funding model platforms
|
| 2 |
+
|
| 3 |
+
github: [ljharb]
|
| 4 |
+
patreon: # Replace with a single Patreon username
|
| 5 |
+
open_collective: # Replace with a single Open Collective username
|
| 6 |
+
ko_fi: # Replace with a single Ko-fi username
|
| 7 |
+
tidelift: npm/ripemd160
|
| 8 |
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
| 9 |
+
liberapay: # Replace with a single Liberapay username
|
| 10 |
+
issuehunt: # Replace with a single IssueHunt username
|
| 11 |
+
otechie: # Replace with a single Otechie username
|
| 12 |
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
node_modules/ripemd160/CHANGELOG.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelog
|
| 2 |
+
|
| 3 |
+
All notable changes to this project will be documented in this file.
|
| 4 |
+
|
| 5 |
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
| 6 |
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
| 7 |
+
|
| 8 |
+
## [v2.0.3](https://github.com/browserify/ripemd160/compare/v2.0.2...v2.0.3) - 2025-09-22
|
| 9 |
+
|
| 10 |
+
### Commits
|
| 11 |
+
|
| 12 |
+
- [eslint] switch from standard to eslint [`ce1badd`](https://github.com/browserify/ripemd160/commit/ce1baddb99b40436d8253d5f4472ae5432e8ed24)
|
| 13 |
+
- [Tests] migrate from travis to GHA [`f0b036e`](https://github.com/browserify/ripemd160/commit/f0b036e204b77075a70a46c2ef457a6f53fc1e6c)
|
| 14 |
+
- [meta] use `auto-changelog` [`8f8b834`](https://github.com/browserify/ripemd160/commit/8f8b8340426e276df881296a138a0cbbaa44525a)
|
| 15 |
+
- [meta] use `npmignore` [`63eb742`](https://github.com/browserify/ripemd160/commit/63eb742d7dec26c45c4a60f93ace332b8be98179)
|
| 16 |
+
- [Tests] add coverage [`52e4349`](https://github.com/browserify/ripemd160/commit/52e43496031e21681d83e55ece0beba982b2cdca)
|
| 17 |
+
- Only apps should have lockfiles [`bbbc504`](https://github.com/browserify/ripemd160/commit/bbbc504d455f9692efc3c4be7d613bd57eea50de)
|
| 18 |
+
- [meta] add missing `engines.node` [`0dd76a0`](https://github.com/browserify/ripemd160/commit/0dd76a0c05658b23b3d10886f18c561901d57ce9)
|
| 19 |
+
- [Deps] update `hash-base`, `inherits` [`dcd9920`](https://github.com/browserify/ripemd160/commit/dcd99208dd3cab39b0ef5ee63fe604d278e03048)
|
| 20 |
+
- [meta] fix npmrc settings for auto-changelog [`329f18c`](https://github.com/browserify/ripemd160/commit/329f18cae8acee98f03d765a34f2f84afe6e1791)
|
| 21 |
+
- [Dev Deps] update `tape` [`8be8aba`](https://github.com/browserify/ripemd160/commit/8be8abaaf2dcf494abe10fa38d2a3db91f85de3d)
|
| 22 |
+
- [Dev Deps] add missing peer dep [`ac4ddb3`](https://github.com/browserify/ripemd160/commit/ac4ddb3a57b8625d69b5ca37b1b994b4dde1affe)
|
| 23 |
+
|
| 24 |
+
## [v2.0.2](https://github.com/browserify/ripemd160/compare/2.0.1...v2.0.2) - 2018-04-19
|
| 25 |
+
|
| 26 |
+
### Merged
|
| 27 |
+
|
| 28 |
+
- Don't use the deprecated Buffer() constructor [`#20`](https://github.com/browserify/ripemd160/pull/20)
|
| 29 |
+
- code optimization (30%) [`#14`](https://github.com/browserify/ripemd160/pull/14)
|
| 30 |
+
- Not a markdown file [`#18`](https://github.com/browserify/ripemd160/pull/18)
|
| 31 |
+
|
| 32 |
+
### Commits
|
| 33 |
+
|
| 34 |
+
- Explicitly require 'buffer' [`651ae24`](https://github.com/browserify/ripemd160/commit/651ae24445a9486fdea1707e45309b28fee35cfa)
|
| 35 |
+
|
| 36 |
+
<!-- auto-changelog-above -->
|
| 37 |
+
|
| 38 |
+
2.0.1 / 2016-06-22
|
| 39 |
+
------------------
|
| 40 |
+
- added LICENSE file.
|
| 41 |
+
|
| 42 |
+
2.0.0 / 2016-04-11
|
| 43 |
+
------------------
|
| 44 |
+
- rewritten, license change BSD-3 to MIT. [#13][#13]
|
| 45 |
+
- stream support [#13][#13]
|
| 46 |
+
|
| 47 |
+
1.0.1 / 2015-05-05
|
| 48 |
+
------------------
|
| 49 |
+
- standard formatting
|
| 50 |
+
|
| 51 |
+
1.0.0 / 2015-01-14
|
| 52 |
+
------------------
|
| 53 |
+
- updated dev deps
|
| 54 |
+
- added more test fixtures
|
| 55 |
+
- updated readme with usage, testing, etc
|
| 56 |
+
- moved from https://github.com/cryptocoinjs/ripemd160 to https://github.com/crypto-browserify/ripemd160
|
| 57 |
+
|
| 58 |
+
0.2.1 / 2014-12-31
|
| 59 |
+
------------------
|
| 60 |
+
- made license clear in `package.json`
|
| 61 |
+
- deleted `Makefile`, moved targets to `package.json`
|
| 62 |
+
- removed `terst` for `assert`
|
| 63 |
+
|
| 64 |
+
0.2.0 / 2014-03-09
|
| 65 |
+
------------------
|
| 66 |
+
* removed bower.json and component.json
|
| 67 |
+
* changed 4 spacing to 2
|
| 68 |
+
* returns `Buffer` type now, input must be Array, Uint8Array, Buffer, or string
|
| 69 |
+
* remove deps: `convert-hex` and `convert-string`
|
| 70 |
+
|
| 71 |
+
0.1.0 / 2013-11-20
|
| 72 |
+
------------------
|
| 73 |
+
* changed package name
|
| 74 |
+
* removed AMD support
|
| 75 |
+
|
| 76 |
+
0.0.2 / 2013-11-06
|
| 77 |
+
------------------
|
| 78 |
+
* fixed component.json file
|
| 79 |
+
|
| 80 |
+
0.0.1 / 2013-11-03
|
| 81 |
+
------------------
|
| 82 |
+
* initial release
|
| 83 |
+
|
| 84 |
+
<!--- add streams support, unroll loops [enhancement] -->
|
| 85 |
+
[#13]: https://github.com/crypto-browserify/ripemd160/pull/13
|
| 86 |
+
<!--- Update all dependencies 🌴 [greenkeeper] -->
|
| 87 |
+
[#12]: https://github.com/crypto-browserify/ripemd160/pull/12
|
| 88 |
+
<!--- little optimizations [enhancement] -->
|
| 89 |
+
[#11]: https://github.com/crypto-browserify/ripemd160/pull/11
|
| 90 |
+
<!--- Added LICENSE file to repo -->
|
| 91 |
+
[#10]: https://github.com/crypto-browserify/ripemd160/pull/10
|
| 92 |
+
<!--- Add LICENCE file -->
|
| 93 |
+
[#9]: https://github.com/crypto-browserify/ripemd160/pull/9
|
| 94 |
+
<!--- Support streaming [enhancement] -->
|
| 95 |
+
[#8]: https://github.com/crypto-browserify/ripemd160/issues/8
|
| 96 |
+
<!--- Unroll loops [enhancement] -->
|
| 97 |
+
[#7]: https://github.com/crypto-browserify/ripemd160/pull/7
|
| 98 |
+
<!--- Use SPDX-standard license naming -->
|
| 99 |
+
[#6]: https://github.com/crypto-browserify/ripemd160/pull/6
|
| 100 |
+
<!--- License -->
|
| 101 |
+
[#5]: https://github.com/crypto-browserify/ripemd160/issues/5
|
| 102 |
+
<!--- Add BSD license to package.json -->
|
| 103 |
+
[#4]: https://github.com/crypto-browserify/ripemd160/pull/4
|
| 104 |
+
<!--- Indicate byte array inputs are supported too -->
|
| 105 |
+
[#3]: https://github.com/crypto-browserify/ripemd160/pull/3
|
| 106 |
+
<!--- Node-specific implementation -->
|
| 107 |
+
[#2]: https://github.com/crypto-browserify/ripemd160/pull/2
|
| 108 |
+
<!--- Incorrect name of convert-string dependency in bower.json -->
|
| 109 |
+
[#1]: https://github.com/crypto-browserify/ripemd160/pull/1
|
node_modules/ripemd160/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The MIT License (MIT)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2016 crypto-browserify
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
node_modules/ripemd160/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ripemd160
|
| 2 |
+
|
| 3 |
+
[](https://www.npmjs.org/package/ripemd160)
|
| 4 |
+
[](https://travis-ci.org/crypto-browserify/ripemd160)
|
| 5 |
+
[](https://david-dm.org/crypto-browserify/ripemd160#info=dependencies)
|
| 6 |
+
|
| 7 |
+
[](https://github.com/feross/standard)
|
| 8 |
+
|
| 9 |
+
Node style `ripemd160` on pure JavaScript.
|
| 10 |
+
|
| 11 |
+
## Example
|
| 12 |
+
|
| 13 |
+
```js
|
| 14 |
+
var RIPEMD160 = require('ripemd160')
|
| 15 |
+
|
| 16 |
+
console.log(new RIPEMD160().update('42').digest('hex'))
|
| 17 |
+
// => 0df020ba32aa9b8b904471ff582ce6b579bf8bc8
|
| 18 |
+
|
| 19 |
+
var ripemd160stream = new RIPEMD160()
|
| 20 |
+
ripemd160stream.end('42')
|
| 21 |
+
console.log(ripemd160stream.read().toString('hex'))
|
| 22 |
+
// => 0df020ba32aa9b8b904471ff582ce6b579bf8bc8
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
## LICENSE
|
| 26 |
+
|
| 27 |
+
MIT
|
node_modules/ripemd160/index.js
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var Buffer = require('buffer').Buffer;
|
| 4 |
+
var inherits = require('inherits');
|
| 5 |
+
var HashBase = require('hash-base');
|
| 6 |
+
|
| 7 |
+
var ARRAY16 = new Array(16);
|
| 8 |
+
|
| 9 |
+
var zl = [
|
| 10 |
+
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
| 11 |
+
7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
|
| 12 |
+
3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
|
| 13 |
+
1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
|
| 14 |
+
4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
|
| 15 |
+
];
|
| 16 |
+
|
| 17 |
+
var zr = [
|
| 18 |
+
5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
|
| 19 |
+
6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
|
| 20 |
+
15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
|
| 21 |
+
8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
|
| 22 |
+
12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
|
| 23 |
+
];
|
| 24 |
+
|
| 25 |
+
var sl = [
|
| 26 |
+
11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
|
| 27 |
+
7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
|
| 28 |
+
11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
|
| 29 |
+
11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
|
| 30 |
+
9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
|
| 31 |
+
];
|
| 32 |
+
|
| 33 |
+
var sr = [
|
| 34 |
+
8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
|
| 35 |
+
9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
|
| 36 |
+
9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
|
| 37 |
+
15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
|
| 38 |
+
8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
|
| 39 |
+
];
|
| 40 |
+
|
| 41 |
+
var hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e];
|
| 42 |
+
var hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000];
|
| 43 |
+
|
| 44 |
+
function rotl(x, n) {
|
| 45 |
+
return (x << n) | (x >>> (32 - n));
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
function fn1(a, b, c, d, e, m, k, s) {
|
| 49 |
+
return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
function fn2(a, b, c, d, e, m, k, s) {
|
| 53 |
+
return (rotl((a + ((b & c) | (~b & d)) + m + k) | 0, s) + e) | 0;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
function fn3(a, b, c, d, e, m, k, s) {
|
| 57 |
+
return (rotl((a + ((b | ~c) ^ d) + m + k) | 0, s) + e) | 0;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
function fn4(a, b, c, d, e, m, k, s) {
|
| 61 |
+
return (rotl((a + ((b & d) | (c & ~d)) + m + k) | 0, s) + e) | 0;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
function fn5(a, b, c, d, e, m, k, s) {
|
| 65 |
+
return (rotl((a + (b ^ (c | ~d)) + m + k) | 0, s) + e) | 0;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
function RIPEMD160() {
|
| 69 |
+
HashBase.call(this, 64);
|
| 70 |
+
|
| 71 |
+
// state
|
| 72 |
+
this._a = 0x67452301;
|
| 73 |
+
this._b = 0xefcdab89;
|
| 74 |
+
this._c = 0x98badcfe;
|
| 75 |
+
this._d = 0x10325476;
|
| 76 |
+
this._e = 0xc3d2e1f0;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
inherits(RIPEMD160, HashBase);
|
| 80 |
+
|
| 81 |
+
RIPEMD160.prototype._update = function () {
|
| 82 |
+
var words = ARRAY16;
|
| 83 |
+
for (var j = 0; j < 16; ++j) {
|
| 84 |
+
words[j] = this._block.readInt32LE(j * 4);
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
var al = this._a | 0;
|
| 88 |
+
var bl = this._b | 0;
|
| 89 |
+
var cl = this._c | 0;
|
| 90 |
+
var dl = this._d | 0;
|
| 91 |
+
var el = this._e | 0;
|
| 92 |
+
|
| 93 |
+
var ar = this._a | 0;
|
| 94 |
+
var br = this._b | 0;
|
| 95 |
+
var cr = this._c | 0;
|
| 96 |
+
var dr = this._d | 0;
|
| 97 |
+
var er = this._e | 0;
|
| 98 |
+
|
| 99 |
+
// computation
|
| 100 |
+
for (var i = 0; i < 80; i += 1) {
|
| 101 |
+
var tl;
|
| 102 |
+
var tr;
|
| 103 |
+
if (i < 16) {
|
| 104 |
+
tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]);
|
| 105 |
+
tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i]);
|
| 106 |
+
} else if (i < 32) {
|
| 107 |
+
tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]);
|
| 108 |
+
tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i]);
|
| 109 |
+
} else if (i < 48) {
|
| 110 |
+
tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]);
|
| 111 |
+
tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i]);
|
| 112 |
+
} else if (i < 64) {
|
| 113 |
+
tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]);
|
| 114 |
+
tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i]);
|
| 115 |
+
} else { // if (i<80) {
|
| 116 |
+
tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]);
|
| 117 |
+
tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i]);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
al = el;
|
| 121 |
+
el = dl;
|
| 122 |
+
dl = rotl(cl, 10);
|
| 123 |
+
cl = bl;
|
| 124 |
+
bl = tl;
|
| 125 |
+
|
| 126 |
+
ar = er;
|
| 127 |
+
er = dr;
|
| 128 |
+
dr = rotl(cr, 10);
|
| 129 |
+
cr = br;
|
| 130 |
+
br = tr;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
// update state
|
| 134 |
+
var t = (this._b + cl + dr) | 0;
|
| 135 |
+
this._b = (this._c + dl + er) | 0;
|
| 136 |
+
this._c = (this._d + el + ar) | 0;
|
| 137 |
+
this._d = (this._e + al + br) | 0;
|
| 138 |
+
this._e = (this._a + bl + cr) | 0;
|
| 139 |
+
this._a = t;
|
| 140 |
+
};
|
| 141 |
+
|
| 142 |
+
RIPEMD160.prototype._digest = function () {
|
| 143 |
+
// create padding and handle blocks
|
| 144 |
+
this._block[this._blockOffset] = 0x80;
|
| 145 |
+
this._blockOffset += 1;
|
| 146 |
+
if (this._blockOffset > 56) {
|
| 147 |
+
this._block.fill(0, this._blockOffset, 64);
|
| 148 |
+
this._update();
|
| 149 |
+
this._blockOffset = 0;
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
this._block.fill(0, this._blockOffset, 56);
|
| 153 |
+
this._block.writeUInt32LE(this._length[0], 56);
|
| 154 |
+
this._block.writeUInt32LE(this._length[1], 60);
|
| 155 |
+
this._update();
|
| 156 |
+
|
| 157 |
+
// produce result
|
| 158 |
+
var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20); // eslint-disable-line no-buffer-constructor
|
| 159 |
+
buffer.writeInt32LE(this._a, 0);
|
| 160 |
+
buffer.writeInt32LE(this._b, 4);
|
| 161 |
+
buffer.writeInt32LE(this._c, 8);
|
| 162 |
+
buffer.writeInt32LE(this._d, 12);
|
| 163 |
+
buffer.writeInt32LE(this._e, 16);
|
| 164 |
+
return buffer;
|
| 165 |
+
};
|
| 166 |
+
|
| 167 |
+
module.exports = RIPEMD160;
|
node_modules/ripemd160/node_modules/hash-base/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# These are supported funding model platforms
|
| 2 |
+
|
| 3 |
+
github: [ljharb]
|
| 4 |
+
patreon: # Replace with a single Patreon username
|
| 5 |
+
open_collective: # Replace with a single Open Collective username
|
| 6 |
+
ko_fi: # Replace with a single Ko-fi username
|
| 7 |
+
tidelift: npm/hash-base
|
| 8 |
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
| 9 |
+
liberapay: # Replace with a single Liberapay username
|
| 10 |
+
issuehunt: # Replace with a single IssueHunt username
|
| 11 |
+
otechie: # Replace with a single Otechie username
|
| 12 |
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
node_modules/ripemd160/node_modules/hash-base/CHANGELOG.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelog
|
| 2 |
+
|
| 3 |
+
All notable changes to this project will be documented in this file.
|
| 4 |
+
|
| 5 |
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
| 6 |
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
| 7 |
+
|
| 8 |
+
## [v3.1.2](https://github.com/browserify/hash-base/compare/v3.1.1...v3.1.2) - 2025-09-22
|
| 9 |
+
|
| 10 |
+
### Commits
|
| 11 |
+
|
| 12 |
+
- [fix] package already works in node 0.8 [`1c19201`](https://github.com/browserify/hash-base/commit/1c1920112ef4baa65085b08ada90b4d0a83b69f2)
|
| 13 |
+
- [Dev Deps] add missing peer dep [`7ac34b6`](https://github.com/browserify/hash-base/commit/7ac34b6011fb02b7a8261ee35f01fe8828218dda)
|
| 14 |
+
|
| 15 |
+
## [v3.1.1](https://github.com/browserify/hash-base/compare/v3.1.0...v3.1.1) - 2025-09-22
|
| 16 |
+
|
| 17 |
+
### Commits
|
| 18 |
+
|
| 19 |
+
- [eslint] switch to eslint [`d63bf3b`](https://github.com/browserify/hash-base/commit/d63bf3b65c911e0de091918b7d331c6cf413567e)
|
| 20 |
+
- [meta] add `auto-changelog` [`b2c7408`](https://github.com/browserify/hash-base/commit/b2c74084f744d090a1c59d2f8326a639409281f2)
|
| 21 |
+
- [Tests] avoid tape-mutating beforeEach nonsense [`bb1f9b6`](https://github.com/browserify/hash-base/commit/bb1f9b6492acd97fd02acca575dcb334888b6fbb)
|
| 22 |
+
- [Tests] avoid tape-mutating beforeEach nonsense [`ae228cd`](https://github.com/browserify/hash-base/commit/ae228cd0e9421fcca4c7e9e41b5451fa7ad74c73)
|
| 23 |
+
- [readme] clean up formatting [`fd5cb3d`](https://github.com/browserify/hash-base/commit/fd5cb3d73a9be7617b6af647dd775ede7f5dab24)
|
| 24 |
+
- [readme] clean up formatting [`a13ed61`](https://github.com/browserify/hash-base/commit/a13ed61331879e342435e71569a49061fdf1889c)
|
| 25 |
+
- [Tests] migrate from travis to GHA [`9e2c04c`](https://github.com/browserify/hash-base/commit/9e2c04c435c25363fbe1f1fea8b32390f3f623b7)
|
| 26 |
+
- [Tests] migrate from travis to GHA [`31766d4`](https://github.com/browserify/hash-base/commit/31766d413a21e534c96e6e562174f74b3d0368ca)
|
| 27 |
+
- [Fix] return valid values on multi-byte-wide TypedArray input [`1af18ee`](https://github.com/browserify/hash-base/commit/1af18ee40d747bc177fba2cb89b4e937e3bd0724)
|
| 28 |
+
- [Refactor] use `to-buffer` [`41d738b`](https://github.com/browserify/hash-base/commit/41d738bca2c5fa97c09bed9cdc7b2f3d8f1f9958)
|
| 29 |
+
- [Dev Deps] update `tape`, downgrade `nyc`, clean up scripts [`13d373c`](https://github.com/browserify/hash-base/commit/13d373c1b06ed0a20db0fe158def49a7abf6a85b)
|
| 30 |
+
- [Dev Deps] update `tape`, downgrade `nyc`, clean up scripts [`84f4fab`](https://github.com/browserify/hash-base/commit/84f4fab691c35591f44b1781311de10fc6f76b16)
|
| 31 |
+
- [meta] use `npmignore` [`ecdd9a3`](https://github.com/browserify/hash-base/commit/ecdd9a312e26f81d6a84256d8bcdbf4427f84490)
|
| 32 |
+
- Merge tag 'v3.0.5' [`d59c766`](https://github.com/browserify/hash-base/commit/d59c766986d962868457d05299fe111323dedd6f)
|
| 33 |
+
- Only apps should have lockfiles [`de3ce83`](https://github.com/browserify/hash-base/commit/de3ce831c7f61a2ca3448f639d7b8ebe6b7b27ab)
|
| 34 |
+
- Only apps should have lockfiles [`05b7504`](https://github.com/browserify/hash-base/commit/05b7504d4038fdf380e5c3227ee0719df12f5bda)
|
| 35 |
+
- [Deps] update `inherits`, `safe-buffer` [`2b8687d`](https://github.com/browserify/hash-base/commit/2b8687d89f8e9de6c21bc277b147e76507ba74a6)
|
| 36 |
+
- [Deps] update `safe-buffer`; downgrade `readable-stream` [`523da5d`](https://github.com/browserify/hash-base/commit/523da5dbfcef879a5c6967978cd4d39946f20c5a)
|
| 37 |
+
- [Tests] clean up linting [`4274b7c`](https://github.com/browserify/hash-base/commit/4274b7cc9608712652e56091efcf5c66151be418)
|
| 38 |
+
- [Tests] in node 0.10, Buffer `.fill` returns `undefined` [`0fdfd67`](https://github.com/browserify/hash-base/commit/0fdfd676fc51987e5d93f17858cc0f740b56b6af)
|
| 39 |
+
- [Tests] in node 0.10, Buffer `.fill` returns `undefined` [`5d1f911`](https://github.com/browserify/hash-base/commit/5d1f91153a0c8365e970e0f9a4fde2fd901bb446)
|
| 40 |
+
- [Fix] restore `engines.node` from 3.0.0 [`8cbfd12`](https://github.com/browserify/hash-base/commit/8cbfd123b307d51b6588718baa2c343dddf13fa4)
|
| 41 |
+
- [Fix] restore `engines.node` from 3.0.0 [`b99d8a1`](https://github.com/browserify/hash-base/commit/b99d8a1ce428683c93ac005ea01e48f77ce005db)
|
| 42 |
+
- [Tests] use `safe-buffer` in tests, too [`84bdfe9`](https://github.com/browserify/hash-base/commit/84bdfe944f46edbcaffed7b48567faf460f13bb8)
|
| 43 |
+
- [Tests] use `safe-buffer` in tests, too [`9182f82`](https://github.com/browserify/hash-base/commit/9182f823b7f365189116a4582fa906f8fb008ab6)
|
| 44 |
+
|
| 45 |
+
## [v3.1.0](https://github.com/browserify/hash-base/compare/v3.0.5...v3.1.0) - 2020-05-01
|
| 46 |
+
|
| 47 |
+
### Merged
|
| 48 |
+
|
| 49 |
+
- Update deps, add readable-stream [`#14`](https://github.com/browserify/hash-base/pull/14)
|
| 50 |
+
|
| 51 |
+
## [v3.0.5](https://github.com/browserify/hash-base/compare/v3.0.4...v3.0.5) - 2024-11-23
|
| 52 |
+
|
| 53 |
+
### Commits
|
| 54 |
+
|
| 55 |
+
- [Tests] avoid tape-mutating beforeEach nonsense [`ae228cd`](https://github.com/browserify/hash-base/commit/ae228cd0e9421fcca4c7e9e41b5451fa7ad74c73)
|
| 56 |
+
- [readme] clean up formatting [`a13ed61`](https://github.com/browserify/hash-base/commit/a13ed61331879e342435e71569a49061fdf1889c)
|
| 57 |
+
- [Tests] migrate from travis to GHA [`31766d4`](https://github.com/browserify/hash-base/commit/31766d413a21e534c96e6e562174f74b3d0368ca)
|
| 58 |
+
- [Fix] return valid values on multi-byte-wide TypedArray input [`1af18ee`](https://github.com/browserify/hash-base/commit/1af18ee40d747bc177fba2cb89b4e937e3bd0724)
|
| 59 |
+
- [Dev Deps] update `tape`, downgrade `nyc`, clean up scripts [`13d373c`](https://github.com/browserify/hash-base/commit/13d373c1b06ed0a20db0fe158def49a7abf6a85b)
|
| 60 |
+
- Only apps should have lockfiles [`de3ce83`](https://github.com/browserify/hash-base/commit/de3ce831c7f61a2ca3448f639d7b8ebe6b7b27ab)
|
| 61 |
+
- [Deps] update `inherits`, `safe-buffer` [`2b8687d`](https://github.com/browserify/hash-base/commit/2b8687d89f8e9de6c21bc277b147e76507ba74a6)
|
| 62 |
+
- [Tests] clean up linting [`4274b7c`](https://github.com/browserify/hash-base/commit/4274b7cc9608712652e56091efcf5c66151be418)
|
| 63 |
+
- [Tests] in node 0.10, Buffer `.fill` returns `undefined` [`5d1f911`](https://github.com/browserify/hash-base/commit/5d1f91153a0c8365e970e0f9a4fde2fd901bb446)
|
| 64 |
+
- [Fix] restore `engines.node` from 3.0.0 [`8cbfd12`](https://github.com/browserify/hash-base/commit/8cbfd123b307d51b6588718baa2c343dddf13fa4)
|
| 65 |
+
- [Tests] use `safe-buffer` in tests, too [`9182f82`](https://github.com/browserify/hash-base/commit/9182f823b7f365189116a4582fa906f8fb008ab6)
|
| 66 |
+
|
| 67 |
+
## [v3.0.4](https://github.com/browserify/hash-base/compare/v3.0.3...v3.0.4) - 2017-05-24
|
| 68 |
+
|
| 69 |
+
### Merged
|
| 70 |
+
|
| 71 |
+
- use safe-buffer [`#12`](https://github.com/browserify/hash-base/pull/12)
|
| 72 |
+
- Only Node v4 or greater [Buffer only] [`#11`](https://github.com/browserify/hash-base/pull/11)
|
| 73 |
+
- Reset state after #_digest [`#10`](https://github.com/browserify/hash-base/pull/10)
|
| 74 |
+
|
| 75 |
+
### Commits
|
| 76 |
+
|
| 77 |
+
- Improve tests [`b20d350`](https://github.com/browserify/hash-base/commit/b20d3509f1d3b79f68bd9cd330938ca6472b9aa5)
|
| 78 |
+
- Only Node v4 or greater [`8e24ac9`](https://github.com/browserify/hash-base/commit/8e24ac9258a1c9294960ee24820eed7494c38e10)
|
| 79 |
+
- Real example in README [`71fc5bb`](https://github.com/browserify/hash-base/commit/71fc5bb4ac98a837bc68a34b58aa668e88031a33)
|
| 80 |
+
- Typecheck as function [`867095d`](https://github.com/browserify/hash-base/commit/867095d2d7d369d1c24a44d64bdf403ecb1dd653)
|
| 81 |
+
- Reset state after HashBase#_digest [`1a4298c`](https://github.com/browserify/hash-base/commit/1a4298c9401597c5e632b29a653ca88d965ae2b2)
|
| 82 |
+
- Update devdependencies [`3b46138`](https://github.com/browserify/hash-base/commit/3b46138ad6779cc7f50b4ab3a4a93c7c84cf9dda)
|
| 83 |
+
- Add node7 to travis [`3d29655`](https://github.com/browserify/hash-base/commit/3d29655b7add9008e88f76f4acb5bfe77df7833e)
|
| 84 |
+
- Fix example in README [`89cdcd8`](https://github.com/browserify/hash-base/commit/89cdcd885a0473b9b6109d6bf285baba8cbeea3f)
|
| 85 |
+
|
| 86 |
+
## [v3.0.3](https://github.com/browserify/hash-base/compare/v3.0.2...v3.0.3) - 2016-08-28
|
| 87 |
+
|
| 88 |
+
### Commits
|
| 89 |
+
|
| 90 |
+
- Add LICENSE file [`3d998aa`](https://github.com/browserify/hash-base/commit/3d998aaa4e6fbacc86b1b0f28b6fb7a4e4398998)
|
| 91 |
+
|
| 92 |
+
## [v3.0.2](https://github.com/browserify/hash-base/compare/v3.0.1...v3.0.2) - 2016-08-25
|
| 93 |
+
|
| 94 |
+
### Commits
|
| 95 |
+
|
| 96 |
+
- Remove extra check [`bd13db2`](https://github.com/browserify/hash-base/commit/bd13db2156ce1fa56ddfc7931ef034aebf693903)
|
| 97 |
+
|
| 98 |
+
## [v3.0.1](https://github.com/browserify/hash-base/compare/v3.0.0...v3.0.1) - 2016-08-09
|
| 99 |
+
|
| 100 |
+
### Merged
|
| 101 |
+
|
| 102 |
+
- Fix ._flush [`#7`](https://github.com/browserify/hash-base/pull/7)
|
| 103 |
+
- Update nyc to version 7.0.0 🚀 [`#6`](https://github.com/browserify/hash-base/pull/6)
|
| 104 |
+
|
| 105 |
+
### Commits
|
| 106 |
+
|
| 107 |
+
- Change ._digest to .digest in ._flush [`fdad9ad`](https://github.com/browserify/hash-base/commit/fdad9ad23f9a43f388123667e7ba917100e4fe3a)
|
| 108 |
+
- Fix typo in README.md [`13264ec`](https://github.com/browserify/hash-base/commit/13264ec7adf25d68c3ff6a8a9a26f7e57282080f)
|
| 109 |
+
- chore(package): update nyc to version 7.0.0 [`2a24e6a`](https://github.com/browserify/hash-base/commit/2a24e6a664bdd693dac080c81a903fb7548a89e4)
|
| 110 |
+
|
| 111 |
+
## [v3.0.0](https://github.com/browserify/hash-base/compare/v2.0.2...v3.0.0) - 2016-05-04
|
| 112 |
+
|
| 113 |
+
### Merged
|
| 114 |
+
|
| 115 |
+
- utf8 as default encoding [`#4`](https://github.com/browserify/hash-base/pull/4)
|
| 116 |
+
- Update standard to version 7.0.0 🚀 [`#5`](https://github.com/browserify/hash-base/pull/5)
|
| 117 |
+
|
| 118 |
+
### Commits
|
| 119 |
+
|
| 120 |
+
- chore(package): update standard to version 7.0.0 [`0720515`](https://github.com/browserify/hash-base/commit/0720515b0fa865bdbf772ea07a84c13e6f4db717)
|
| 121 |
+
|
| 122 |
+
## [v2.0.2](https://github.com/browserify/hash-base/compare/v2.0.1...v2.0.2) - 2016-04-17
|
| 123 |
+
|
| 124 |
+
### Commits
|
| 125 |
+
|
| 126 |
+
- Add type checking in .update [`96acf4a`](https://github.com/browserify/hash-base/commit/96acf4a5650fceb9dbaaba9873805a5c9d71eb88)
|
| 127 |
+
- Normalize encoding in tests (utf-8 to utf8) [`0bb7c88`](https://github.com/browserify/hash-base/commit/0bb7c8871b177230c83ef27523812590a22ad6b4)
|
| 128 |
+
|
| 129 |
+
## [v2.0.1](https://github.com/browserify/hash-base/compare/v2.0.0...v2.0.1) - 2016-04-14
|
| 130 |
+
|
| 131 |
+
### Commits
|
| 132 |
+
|
| 133 |
+
- Use this._block as local variable [`aa8bab9`](https://github.com/browserify/hash-base/commit/aa8bab94e5d2a905c1abd913684fc00ae6db7a69)
|
| 134 |
+
- Change Math.floor to |0 [`24f7bb5`](https://github.com/browserify/hash-base/commit/24f7bb573e4b9d2d3a8851fa72ed446a5df05960)
|
| 135 |
+
|
| 136 |
+
## [v2.0.0](https://github.com/browserify/hash-base/compare/v1.0.2...v2.0.0) - 2016-04-07
|
| 137 |
+
|
| 138 |
+
### Fixed
|
| 139 |
+
|
| 140 |
+
- (Closes #3) remove DEFAULT_ENCODING [`#3`](https://github.com/browserify/hash-base/issues/3)
|
| 141 |
+
|
| 142 |
+
### Commits
|
| 143 |
+
|
| 144 |
+
- Add blocks handling [`0c8fb67`](https://github.com/browserify/hash-base/commit/0c8fb676e7d15af1fb7d441a7b9d783c17da5d08)
|
| 145 |
+
- (#1) rename _initialized to _finalized [`ea3c00f`](https://github.com/browserify/hash-base/commit/ea3c00fdf768f68313e07f1d93652316f94d9de9)
|
| 146 |
+
- Fix code style [`964daa5`](https://github.com/browserify/hash-base/commit/964daa56acf87439b229ee4582cc29f4b6f3a722)
|
| 147 |
+
- Rename initialised_ to _initialised [`6e458c6`](https://github.com/browserify/hash-base/commit/6e458c69f9cf124758f68a01a8232fc7c3269945)
|
| 148 |
+
|
| 149 |
+
## [v1.0.2](https://github.com/browserify/hash-base/compare/v1.0.1...v1.0.2) - 2016-04-04
|
| 150 |
+
|
| 151 |
+
### Commits
|
| 152 |
+
|
| 153 |
+
- Update should return hash instance [`59fef2b`](https://github.com/browserify/hash-base/commit/59fef2bc3b417aac5563022bcc928d1ae8161ee9)
|
| 154 |
+
|
| 155 |
+
## [v1.0.1](https://github.com/browserify/hash-base/compare/v1.0.0...v1.0.1) - 2016-04-04
|
| 156 |
+
|
| 157 |
+
### Commits
|
| 158 |
+
|
| 159 |
+
- Throw error on second call digest [`f0b4caf`](https://github.com/browserify/hash-base/commit/f0b4cafb0a87e8bd3c22a6a3b31e323926dc4e63)
|
| 160 |
+
- Update README.md [`6ca4555`](https://github.com/browserify/hash-base/commit/6ca4555d3be194f31725ebf21569d759e0bb9b74)
|
| 161 |
+
|
| 162 |
+
## v1.0.0 - 2016-04-03
|
| 163 |
+
|
| 164 |
+
### Commits
|
| 165 |
+
|
| 166 |
+
- Initial commit [`e315bd2`](https://github.com/browserify/hash-base/commit/e315bd2c5c9e98ecac9a45bb5af1c38d87c3bc47)
|
node_modules/ripemd160/node_modules/hash-base/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The MIT License (MIT)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2016 Kirill Fomichev
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in
|
| 13 |
+
all copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 21 |
+
THE SOFTWARE.
|
node_modules/ripemd160/node_modules/hash-base/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# hash-base
|
| 2 |
+
|
| 3 |
+
[](https://www.npmjs.org/package/hash-base)
|
| 4 |
+
[](https://travis-ci.org/crypto-browserify/hash-base)
|
| 5 |
+
[](https://david-dm.org/crypto-browserify/hash-base#info=dependencies)
|
| 6 |
+
|
| 7 |
+
Abstract base class to inherit from if you want to create streams implementing the same API as node crypto [Hash][1] (for [Cipher][2] / [Decipher][3] check [crypto-browserify/cipher-base][4]).
|
| 8 |
+
|
| 9 |
+
## Example
|
| 10 |
+
|
| 11 |
+
```js
|
| 12 |
+
const HashBase = require('hash-base');
|
| 13 |
+
const inherits = require('inherits');
|
| 14 |
+
|
| 15 |
+
// our hash function is XOR sum of all bytes
|
| 16 |
+
function MyHash () {
|
| 17 |
+
HashBase.call(this, 1); // in bytes
|
| 18 |
+
|
| 19 |
+
this._sum = 0x00;
|
| 20 |
+
};
|
| 21 |
+
|
| 22 |
+
inherits(MyHash, HashBase)
|
| 23 |
+
|
| 24 |
+
MyHash.prototype._update = function () {
|
| 25 |
+
for (let i = 0; i < this._block.length; ++i) {
|
| 26 |
+
this._sum ^= this._block[i];
|
| 27 |
+
}
|
| 28 |
+
};
|
| 29 |
+
|
| 30 |
+
MyHash.prototype._digest = function () {
|
| 31 |
+
return this._sum;
|
| 32 |
+
};
|
| 33 |
+
|
| 34 |
+
const data = Buffer.from([0x00, 0x42, 0x01]);
|
| 35 |
+
const hash = new MyHash().update(data).digest();
|
| 36 |
+
console.log(hash); // => 67
|
| 37 |
+
```
|
| 38 |
+
You also can check [source code](index.js) or [crypto-browserify/md5.js][5]
|
| 39 |
+
|
| 40 |
+
## LICENSE
|
| 41 |
+
|
| 42 |
+
MIT
|
| 43 |
+
|
| 44 |
+
[1]: https://nodejs.org/api/crypto.html#crypto_class_hash
|
| 45 |
+
[2]: https://nodejs.org/api/crypto.html#crypto_class_cipher
|
| 46 |
+
[3]: https://nodejs.org/api/crypto.html#crypto_class_decipher
|
| 47 |
+
[4]: https://github.com/crypto-browserify/cipher-base
|
| 48 |
+
[5]: https://github.com/crypto-browserify/md5.js
|
node_modules/ripemd160/node_modules/hash-base/index.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var Buffer = require('safe-buffer').Buffer;
|
| 4 |
+
var toBuffer = require('./to-buffer');
|
| 5 |
+
var Transform = require('readable-stream').Transform;
|
| 6 |
+
var inherits = require('inherits');
|
| 7 |
+
|
| 8 |
+
function HashBase(blockSize) {
|
| 9 |
+
Transform.call(this);
|
| 10 |
+
|
| 11 |
+
this._block = Buffer.allocUnsafe(blockSize);
|
| 12 |
+
this._blockSize = blockSize;
|
| 13 |
+
this._blockOffset = 0;
|
| 14 |
+
this._length = [0, 0, 0, 0];
|
| 15 |
+
|
| 16 |
+
this._finalized = false;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
inherits(HashBase, Transform);
|
| 20 |
+
|
| 21 |
+
HashBase.prototype._transform = function (chunk, encoding, callback) {
|
| 22 |
+
var error = null;
|
| 23 |
+
try {
|
| 24 |
+
this.update(chunk, encoding);
|
| 25 |
+
} catch (err) {
|
| 26 |
+
error = err;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
callback(error);
|
| 30 |
+
};
|
| 31 |
+
|
| 32 |
+
HashBase.prototype._flush = function (callback) {
|
| 33 |
+
var error = null;
|
| 34 |
+
try {
|
| 35 |
+
this.push(this.digest());
|
| 36 |
+
} catch (err) {
|
| 37 |
+
error = err;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
callback(error);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
HashBase.prototype.update = function (data, encoding) {
|
| 44 |
+
if (this._finalized) {
|
| 45 |
+
throw new Error('Digest already called');
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
var dataBuffer = toBuffer(data, encoding); // asserts correct input type
|
| 49 |
+
|
| 50 |
+
// consume data
|
| 51 |
+
var block = this._block;
|
| 52 |
+
var offset = 0;
|
| 53 |
+
while (this._blockOffset + dataBuffer.length - offset >= this._blockSize) {
|
| 54 |
+
for (var i = this._blockOffset; i < this._blockSize;) {
|
| 55 |
+
block[i] = dataBuffer[offset];
|
| 56 |
+
i += 1;
|
| 57 |
+
offset += 1;
|
| 58 |
+
}
|
| 59 |
+
this._update();
|
| 60 |
+
this._blockOffset = 0;
|
| 61 |
+
}
|
| 62 |
+
while (offset < dataBuffer.length) {
|
| 63 |
+
block[this._blockOffset] = dataBuffer[offset];
|
| 64 |
+
this._blockOffset += 1;
|
| 65 |
+
offset += 1;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
// update length
|
| 69 |
+
for (var j = 0, carry = dataBuffer.length * 8; carry > 0; ++j) {
|
| 70 |
+
this._length[j] += carry;
|
| 71 |
+
carry = (this._length[j] / 0x0100000000) | 0;
|
| 72 |
+
if (carry > 0) {
|
| 73 |
+
this._length[j] -= 0x0100000000 * carry;
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
return this;
|
| 78 |
+
};
|
| 79 |
+
|
| 80 |
+
HashBase.prototype._update = function () {
|
| 81 |
+
throw new Error('_update is not implemented');
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
HashBase.prototype.digest = function (encoding) {
|
| 85 |
+
if (this._finalized) {
|
| 86 |
+
throw new Error('Digest already called');
|
| 87 |
+
}
|
| 88 |
+
this._finalized = true;
|
| 89 |
+
|
| 90 |
+
var digest = this._digest();
|
| 91 |
+
if (encoding !== undefined) {
|
| 92 |
+
digest = digest.toString(encoding);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
// reset state
|
| 96 |
+
this._block.fill(0);
|
| 97 |
+
this._blockOffset = 0;
|
| 98 |
+
for (var i = 0; i < 4; ++i) {
|
| 99 |
+
this._length[i] = 0;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
return digest;
|
| 103 |
+
};
|
| 104 |
+
|
| 105 |
+
HashBase.prototype._digest = function () {
|
| 106 |
+
throw new Error('_digest is not implemented');
|
| 107 |
+
};
|
| 108 |
+
|
| 109 |
+
module.exports = HashBase;
|
node_modules/ripemd160/node_modules/hash-base/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "hash-base",
|
| 3 |
+
"version": "3.1.2",
|
| 4 |
+
"description": "abstract base class for hash-streams",
|
| 5 |
+
"keywords": [
|
| 6 |
+
"hash",
|
| 7 |
+
"stream"
|
| 8 |
+
],
|
| 9 |
+
"homepage": "https://github.com/crypto-browserify/hash-base",
|
| 10 |
+
"bugs": {
|
| 11 |
+
"url": "https://github.com/crypto-browserify/hash-base/issues"
|
| 12 |
+
},
|
| 13 |
+
"license": "MIT",
|
| 14 |
+
"author": "Kirill Fomichev <fanatid@ya.ru> (https://github.com/fanatid)",
|
| 15 |
+
"main": "index.js",
|
| 16 |
+
"repository": {
|
| 17 |
+
"type": "git",
|
| 18 |
+
"url": "https://github.com/crypto-browserify/hash-base.git"
|
| 19 |
+
},
|
| 20 |
+
"scripts": {
|
| 21 |
+
"prepack": "npmignore --auto --commentLines=autogenerated",
|
| 22 |
+
"lint": "eslint --ext=js,mjs .",
|
| 23 |
+
"pretest": "npm run lint",
|
| 24 |
+
"test": "npm run tests-only",
|
| 25 |
+
"tests-only": "nyc tape \"test/**/*.js\"",
|
| 26 |
+
"posttest": "npx npm@\">=10.2\" audit --production",
|
| 27 |
+
"version": "auto-changelog && git add CHANGELOG.md",
|
| 28 |
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
| 29 |
+
},
|
| 30 |
+
"dependencies": {
|
| 31 |
+
"inherits": "^2.0.4",
|
| 32 |
+
"readable-stream": "^2.3.8",
|
| 33 |
+
"safe-buffer": "^5.2.1",
|
| 34 |
+
"to-buffer": "^1.2.1"
|
| 35 |
+
},
|
| 36 |
+
"devDependencies": {
|
| 37 |
+
"@ljharb/eslint-config": "^21.2.0",
|
| 38 |
+
"auto-changelog": "^2.5.0",
|
| 39 |
+
"encoding": "^0.1.13",
|
| 40 |
+
"eslint": "=8.8.0",
|
| 41 |
+
"npmignore": "^0.3.1",
|
| 42 |
+
"nyc": "^10.3.2",
|
| 43 |
+
"tape": "^5.9.0"
|
| 44 |
+
},
|
| 45 |
+
"engines": {
|
| 46 |
+
"node": ">= 0.8"
|
| 47 |
+
},
|
| 48 |
+
"publishConfig": {
|
| 49 |
+
"ignore": [
|
| 50 |
+
".github/workflows",
|
| 51 |
+
".eslintrc",
|
| 52 |
+
".nycrc",
|
| 53 |
+
"test"
|
| 54 |
+
]
|
| 55 |
+
},
|
| 56 |
+
"auto-changelog": {
|
| 57 |
+
"output": "CHANGELOG.md",
|
| 58 |
+
"template": "keepachangelog",
|
| 59 |
+
"unreleased": false,
|
| 60 |
+
"commitLimit": false,
|
| 61 |
+
"backfillLimit": false,
|
| 62 |
+
"hideCredit": true
|
| 63 |
+
}
|
| 64 |
+
}
|
node_modules/ripemd160/node_modules/hash-base/to-buffer.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var Buffer = require('safe-buffer').Buffer;
|
| 4 |
+
var toBuffer = require('to-buffer');
|
| 5 |
+
|
| 6 |
+
var useUint8Array = typeof Uint8Array !== 'undefined';
|
| 7 |
+
var useArrayBuffer = useUint8Array && typeof ArrayBuffer !== 'undefined';
|
| 8 |
+
var isView = useArrayBuffer && ArrayBuffer.isView;
|
| 9 |
+
|
| 10 |
+
module.exports = function (thing, encoding) {
|
| 11 |
+
if (
|
| 12 |
+
typeof thing === 'string'
|
| 13 |
+
|| Buffer.isBuffer(thing)
|
| 14 |
+
|| (useUint8Array && thing instanceof Uint8Array)
|
| 15 |
+
|| (isView && isView(thing))
|
| 16 |
+
) {
|
| 17 |
+
return toBuffer(thing, encoding);
|
| 18 |
+
}
|
| 19 |
+
throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView');
|
| 20 |
+
};
|
node_modules/ripemd160/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "ripemd160",
|
| 3 |
+
"version": "2.0.3",
|
| 4 |
+
"description": "Compute ripemd160 of bytes or strings.",
|
| 5 |
+
"keywords": [
|
| 6 |
+
"string",
|
| 7 |
+
"strings",
|
| 8 |
+
"ripemd160",
|
| 9 |
+
"ripe160",
|
| 10 |
+
"bitcoin",
|
| 11 |
+
"bytes",
|
| 12 |
+
"cryptography"
|
| 13 |
+
],
|
| 14 |
+
"license": "MIT",
|
| 15 |
+
"main": "./index",
|
| 16 |
+
"repository": {
|
| 17 |
+
"url": "https://github.com/crypto-browserify/ripemd160",
|
| 18 |
+
"type": "git"
|
| 19 |
+
},
|
| 20 |
+
"scripts": {
|
| 21 |
+
"prepack": "npmignore --auto --commentLines=autogenerated",
|
| 22 |
+
"lint": "eslint --ext=js,mjs .",
|
| 23 |
+
"pretest": "npm run lint",
|
| 24 |
+
"test": "npm run tests-only",
|
| 25 |
+
"tests-only": "nyc tape \"test/**/*.js\"",
|
| 26 |
+
"posttest": "npx npm@\">= 10.2\" audit --production",
|
| 27 |
+
"version": "auto-changelog && git add CHANGELOG.md",
|
| 28 |
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
| 29 |
+
},
|
| 30 |
+
"dependencies": {
|
| 31 |
+
"hash-base": "^3.1.2",
|
| 32 |
+
"inherits": "^2.0.4"
|
| 33 |
+
},
|
| 34 |
+
"devDependencies": {
|
| 35 |
+
"@ljharb/eslint-config": "^21.2.0",
|
| 36 |
+
"auto-changelog": "^2.5.0",
|
| 37 |
+
"encoding": "^0.1.13",
|
| 38 |
+
"eslint": "=8.8.0",
|
| 39 |
+
"hash-test-vectors": "^1.3.2",
|
| 40 |
+
"npmignore": "^0.3.1",
|
| 41 |
+
"nyc": "^10.3.2",
|
| 42 |
+
"tape": "^5.9.0"
|
| 43 |
+
},
|
| 44 |
+
"auto-changelog": {
|
| 45 |
+
"output": "CHANGELOG.md",
|
| 46 |
+
"template": "keepachangelog",
|
| 47 |
+
"unreleased": false,
|
| 48 |
+
"commitLimit": false,
|
| 49 |
+
"backfillLimit": false,
|
| 50 |
+
"hideCredit": true,
|
| 51 |
+
"startingVersion": "2.0.2"
|
| 52 |
+
},
|
| 53 |
+
"publishConfig": {
|
| 54 |
+
"ignore": [
|
| 55 |
+
".github/workflows",
|
| 56 |
+
".eslintrc",
|
| 57 |
+
".nycrc",
|
| 58 |
+
"test"
|
| 59 |
+
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Rollup core license
|
| 2 |
+
Rollup is released under the MIT license:
|
| 3 |
+
|
| 4 |
+
The MIT License (MIT)
|
| 5 |
+
|
| 6 |
+
Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors)
|
| 7 |
+
|
| 8 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 9 |
+
|
| 10 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 11 |
+
|
| 12 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 13 |
+
|
| 14 |
+
# Licenses of bundled dependencies
|
| 15 |
+
The published Rollup artifact additionally contains code with the following licenses:
|
| 16 |
+
MIT, ISC, 0BSD
|
| 17 |
+
|
| 18 |
+
# Bundled dependencies:
|
| 19 |
+
## @jridgewell/sourcemap-codec
|
| 20 |
+
License: MIT
|
| 21 |
+
By: Justin Ridgewell
|
| 22 |
+
Repository: git+https://github.com/jridgewell/sourcemaps.git
|
| 23 |
+
|
| 24 |
+
> Copyright 2024 Justin Ridgewell <justin@ridgewell.name>
|
| 25 |
+
>
|
| 26 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 27 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 28 |
+
> in the Software without restriction, including without limitation the rights
|
| 29 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 30 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 31 |
+
> furnished to do so, subject to the following conditions:
|
| 32 |
+
>
|
| 33 |
+
> The above copyright notice and this permission notice shall be included in
|
| 34 |
+
> all copies or substantial portions of the Software.
|
| 35 |
+
>
|
| 36 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 37 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 38 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 39 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 40 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 41 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 42 |
+
> SOFTWARE.
|
| 43 |
+
|
| 44 |
+
---------------------------------------
|
| 45 |
+
|
| 46 |
+
## @rollup/pluginutils
|
| 47 |
+
License: MIT
|
| 48 |
+
By: Rich Harris
|
| 49 |
+
Repository: rollup/plugins
|
| 50 |
+
|
| 51 |
+
> The MIT License (MIT)
|
| 52 |
+
>
|
| 53 |
+
> Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors)
|
| 54 |
+
>
|
| 55 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 56 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 57 |
+
> in the Software without restriction, including without limitation the rights
|
| 58 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 59 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 60 |
+
> furnished to do so, subject to the following conditions:
|
| 61 |
+
>
|
| 62 |
+
> The above copyright notice and this permission notice shall be included in
|
| 63 |
+
> all copies or substantial portions of the Software.
|
| 64 |
+
>
|
| 65 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 66 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 67 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 68 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 69 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 70 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 71 |
+
> THE SOFTWARE.
|
| 72 |
+
|
| 73 |
+
---------------------------------------
|
| 74 |
+
|
| 75 |
+
## anymatch
|
| 76 |
+
License: ISC
|
| 77 |
+
By: Elan Shanker
|
| 78 |
+
Repository: https://github.com/micromatch/anymatch
|
| 79 |
+
|
| 80 |
+
> The ISC License
|
| 81 |
+
>
|
| 82 |
+
> Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com)
|
| 83 |
+
>
|
| 84 |
+
> Permission to use, copy, modify, and/or distribute this software for any
|
| 85 |
+
> purpose with or without fee is hereby granted, provided that the above
|
| 86 |
+
> copyright notice and this permission notice appear in all copies.
|
| 87 |
+
>
|
| 88 |
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| 89 |
+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 90 |
+
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
| 91 |
+
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 92 |
+
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 93 |
+
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
| 94 |
+
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 95 |
+
|
| 96 |
+
---------------------------------------
|
| 97 |
+
|
| 98 |
+
## binary-extensions
|
| 99 |
+
License: MIT
|
| 100 |
+
By: Sindre Sorhus
|
| 101 |
+
Repository: sindresorhus/binary-extensions
|
| 102 |
+
|
| 103 |
+
> MIT License
|
| 104 |
+
>
|
| 105 |
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
| 106 |
+
> Copyright (c) Paul Miller (https://paulmillr.com)
|
| 107 |
+
>
|
| 108 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 109 |
+
>
|
| 110 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 111 |
+
>
|
| 112 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 113 |
+
|
| 114 |
+
---------------------------------------
|
| 115 |
+
|
| 116 |
+
## braces
|
| 117 |
+
License: MIT
|
| 118 |
+
By: Jon Schlinkert, Brian Woodward, Elan Shanker, Eugene Sharygin, hemanth.hm
|
| 119 |
+
Repository: micromatch/braces
|
| 120 |
+
|
| 121 |
+
> The MIT License (MIT)
|
| 122 |
+
>
|
| 123 |
+
> Copyright (c) 2014-present, Jon Schlinkert.
|
| 124 |
+
>
|
| 125 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 126 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 127 |
+
> in the Software without restriction, including without limitation the rights
|
| 128 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 129 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 130 |
+
> furnished to do so, subject to the following conditions:
|
| 131 |
+
>
|
| 132 |
+
> The above copyright notice and this permission notice shall be included in
|
| 133 |
+
> all copies or substantial portions of the Software.
|
| 134 |
+
>
|
| 135 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 136 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 137 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 138 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 139 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 140 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 141 |
+
> THE SOFTWARE.
|
| 142 |
+
|
| 143 |
+
---------------------------------------
|
| 144 |
+
|
| 145 |
+
## builtin-modules
|
| 146 |
+
License: MIT
|
| 147 |
+
By: Sindre Sorhus
|
| 148 |
+
Repository: sindresorhus/builtin-modules
|
| 149 |
+
|
| 150 |
+
> MIT License
|
| 151 |
+
>
|
| 152 |
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
| 153 |
+
>
|
| 154 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 155 |
+
>
|
| 156 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 157 |
+
>
|
| 158 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 159 |
+
|
| 160 |
+
---------------------------------------
|
| 161 |
+
|
| 162 |
+
## chokidar
|
| 163 |
+
License: MIT
|
| 164 |
+
By: Paul Miller, Elan Shanker
|
| 165 |
+
Repository: git+https://github.com/paulmillr/chokidar.git
|
| 166 |
+
|
| 167 |
+
> The MIT License (MIT)
|
| 168 |
+
>
|
| 169 |
+
> Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker
|
| 170 |
+
>
|
| 171 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 172 |
+
> of this software and associated documentation files (the “Software”), to deal
|
| 173 |
+
> in the Software without restriction, including without limitation the rights
|
| 174 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 175 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 176 |
+
> furnished to do so, subject to the following conditions:
|
| 177 |
+
>
|
| 178 |
+
> The above copyright notice and this permission notice shall be included in
|
| 179 |
+
> all copies or substantial portions of the Software.
|
| 180 |
+
>
|
| 181 |
+
> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 182 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 183 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 184 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 185 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 186 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 187 |
+
> THE SOFTWARE.
|
| 188 |
+
|
| 189 |
+
---------------------------------------
|
| 190 |
+
|
| 191 |
+
## date-time
|
| 192 |
+
License: MIT
|
| 193 |
+
By: Sindre Sorhus
|
| 194 |
+
Repository: sindresorhus/date-time
|
| 195 |
+
|
| 196 |
+
> MIT License
|
| 197 |
+
>
|
| 198 |
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
| 199 |
+
>
|
| 200 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 201 |
+
>
|
| 202 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 203 |
+
>
|
| 204 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 205 |
+
|
| 206 |
+
---------------------------------------
|
| 207 |
+
|
| 208 |
+
## fill-range
|
| 209 |
+
License: MIT
|
| 210 |
+
By: Jon Schlinkert, Edo Rivai, Paul Miller, Rouven Weßling
|
| 211 |
+
Repository: jonschlinkert/fill-range
|
| 212 |
+
|
| 213 |
+
> The MIT License (MIT)
|
| 214 |
+
>
|
| 215 |
+
> Copyright (c) 2014-present, Jon Schlinkert.
|
| 216 |
+
>
|
| 217 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 218 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 219 |
+
> in the Software without restriction, including without limitation the rights
|
| 220 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 221 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 222 |
+
> furnished to do so, subject to the following conditions:
|
| 223 |
+
>
|
| 224 |
+
> The above copyright notice and this permission notice shall be included in
|
| 225 |
+
> all copies or substantial portions of the Software.
|
| 226 |
+
>
|
| 227 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 228 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 229 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 230 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 231 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 232 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 233 |
+
> THE SOFTWARE.
|
| 234 |
+
|
| 235 |
+
---------------------------------------
|
| 236 |
+
|
| 237 |
+
## flru
|
| 238 |
+
License: MIT
|
| 239 |
+
By: Luke Edwards
|
| 240 |
+
Repository: lukeed/flru
|
| 241 |
+
|
| 242 |
+
> MIT License
|
| 243 |
+
>
|
| 244 |
+
> Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
| 245 |
+
>
|
| 246 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 247 |
+
>
|
| 248 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 249 |
+
>
|
| 250 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 251 |
+
|
| 252 |
+
---------------------------------------
|
| 253 |
+
|
| 254 |
+
## glob-parent
|
| 255 |
+
License: ISC
|
| 256 |
+
By: Gulp Team, Elan Shanker, Blaine Bublitz
|
| 257 |
+
Repository: gulpjs/glob-parent
|
| 258 |
+
|
| 259 |
+
> The ISC License
|
| 260 |
+
>
|
| 261 |
+
> Copyright (c) 2015, 2019 Elan Shanker
|
| 262 |
+
>
|
| 263 |
+
> Permission to use, copy, modify, and/or distribute this software for any
|
| 264 |
+
> purpose with or without fee is hereby granted, provided that the above
|
| 265 |
+
> copyright notice and this permission notice appear in all copies.
|
| 266 |
+
>
|
| 267 |
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| 268 |
+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 269 |
+
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
| 270 |
+
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 271 |
+
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 272 |
+
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
| 273 |
+
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 274 |
+
|
| 275 |
+
---------------------------------------
|
| 276 |
+
|
| 277 |
+
## is-binary-path
|
| 278 |
+
License: MIT
|
| 279 |
+
By: Sindre Sorhus
|
| 280 |
+
Repository: sindresorhus/is-binary-path
|
| 281 |
+
|
| 282 |
+
> MIT License
|
| 283 |
+
>
|
| 284 |
+
> Copyright (c) 2019 Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com), Paul Miller (https://paulmillr.com)
|
| 285 |
+
>
|
| 286 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 287 |
+
>
|
| 288 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 289 |
+
>
|
| 290 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 291 |
+
|
| 292 |
+
---------------------------------------
|
| 293 |
+
|
| 294 |
+
## is-extglob
|
| 295 |
+
License: MIT
|
| 296 |
+
By: Jon Schlinkert
|
| 297 |
+
Repository: jonschlinkert/is-extglob
|
| 298 |
+
|
| 299 |
+
> The MIT License (MIT)
|
| 300 |
+
>
|
| 301 |
+
> Copyright (c) 2014-2016, Jon Schlinkert
|
| 302 |
+
>
|
| 303 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 304 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 305 |
+
> in the Software without restriction, including without limitation the rights
|
| 306 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 307 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 308 |
+
> furnished to do so, subject to the following conditions:
|
| 309 |
+
>
|
| 310 |
+
> The above copyright notice and this permission notice shall be included in
|
| 311 |
+
> all copies or substantial portions of the Software.
|
| 312 |
+
>
|
| 313 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 314 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 315 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 316 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 317 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 318 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 319 |
+
> THE SOFTWARE.
|
| 320 |
+
|
| 321 |
+
---------------------------------------
|
| 322 |
+
|
| 323 |
+
## is-glob
|
| 324 |
+
License: MIT
|
| 325 |
+
By: Jon Schlinkert, Brian Woodward, Daniel Perez
|
| 326 |
+
Repository: micromatch/is-glob
|
| 327 |
+
|
| 328 |
+
> The MIT License (MIT)
|
| 329 |
+
>
|
| 330 |
+
> Copyright (c) 2014-2017, Jon Schlinkert.
|
| 331 |
+
>
|
| 332 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 333 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 334 |
+
> in the Software without restriction, including without limitation the rights
|
| 335 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 336 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 337 |
+
> furnished to do so, subject to the following conditions:
|
| 338 |
+
>
|
| 339 |
+
> The above copyright notice and this permission notice shall be included in
|
| 340 |
+
> all copies or substantial portions of the Software.
|
| 341 |
+
>
|
| 342 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 343 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 344 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 345 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 346 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 347 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 348 |
+
> THE SOFTWARE.
|
| 349 |
+
|
| 350 |
+
---------------------------------------
|
| 351 |
+
|
| 352 |
+
## is-number
|
| 353 |
+
License: MIT
|
| 354 |
+
By: Jon Schlinkert, Olsten Larck, Rouven Weßling
|
| 355 |
+
Repository: jonschlinkert/is-number
|
| 356 |
+
|
| 357 |
+
> The MIT License (MIT)
|
| 358 |
+
>
|
| 359 |
+
> Copyright (c) 2014-present, Jon Schlinkert.
|
| 360 |
+
>
|
| 361 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 362 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 363 |
+
> in the Software without restriction, including without limitation the rights
|
| 364 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 365 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 366 |
+
> furnished to do so, subject to the following conditions:
|
| 367 |
+
>
|
| 368 |
+
> The above copyright notice and this permission notice shall be included in
|
| 369 |
+
> all copies or substantial portions of the Software.
|
| 370 |
+
>
|
| 371 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 372 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 373 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 374 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 375 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 376 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 377 |
+
> THE SOFTWARE.
|
| 378 |
+
|
| 379 |
+
---------------------------------------
|
| 380 |
+
|
| 381 |
+
## is-reference
|
| 382 |
+
License: MIT
|
| 383 |
+
By: Rich Harris
|
| 384 |
+
Repository: git+https://github.com/Rich-Harris/is-reference.git
|
| 385 |
+
|
| 386 |
+
---------------------------------------
|
| 387 |
+
|
| 388 |
+
## locate-character
|
| 389 |
+
License: MIT
|
| 390 |
+
By: Rich Harris
|
| 391 |
+
Repository: git+https://gitlab.com/Rich-Harris/locate-character.git
|
| 392 |
+
|
| 393 |
+
---------------------------------------
|
| 394 |
+
|
| 395 |
+
## magic-string
|
| 396 |
+
License: MIT
|
| 397 |
+
By: Rich Harris
|
| 398 |
+
Repository: git+https://github.com/Rich-Harris/magic-string.git
|
| 399 |
+
|
| 400 |
+
> Copyright 2018 Rich Harris
|
| 401 |
+
>
|
| 402 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 403 |
+
>
|
| 404 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 405 |
+
>
|
| 406 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 407 |
+
|
| 408 |
+
---------------------------------------
|
| 409 |
+
|
| 410 |
+
## normalize-path
|
| 411 |
+
License: MIT
|
| 412 |
+
By: Jon Schlinkert, Blaine Bublitz
|
| 413 |
+
Repository: jonschlinkert/normalize-path
|
| 414 |
+
|
| 415 |
+
> The MIT License (MIT)
|
| 416 |
+
>
|
| 417 |
+
> Copyright (c) 2014-2018, Jon Schlinkert.
|
| 418 |
+
>
|
| 419 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 420 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 421 |
+
> in the Software without restriction, including without limitation the rights
|
| 422 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 423 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 424 |
+
> furnished to do so, subject to the following conditions:
|
| 425 |
+
>
|
| 426 |
+
> The above copyright notice and this permission notice shall be included in
|
| 427 |
+
> all copies or substantial portions of the Software.
|
| 428 |
+
>
|
| 429 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 430 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 431 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 432 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 433 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 434 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 435 |
+
> THE SOFTWARE.
|
| 436 |
+
|
| 437 |
+
---------------------------------------
|
| 438 |
+
|
| 439 |
+
## parse-ms
|
| 440 |
+
License: MIT
|
| 441 |
+
By: Sindre Sorhus
|
| 442 |
+
Repository: sindresorhus/parse-ms
|
| 443 |
+
|
| 444 |
+
> MIT License
|
| 445 |
+
>
|
| 446 |
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
| 447 |
+
>
|
| 448 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 449 |
+
>
|
| 450 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 451 |
+
>
|
| 452 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 453 |
+
|
| 454 |
+
---------------------------------------
|
| 455 |
+
|
| 456 |
+
## picocolors
|
| 457 |
+
License: ISC
|
| 458 |
+
By: Alexey Raspopov
|
| 459 |
+
Repository: alexeyraspopov/picocolors
|
| 460 |
+
|
| 461 |
+
> ISC License
|
| 462 |
+
>
|
| 463 |
+
> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
|
| 464 |
+
>
|
| 465 |
+
> Permission to use, copy, modify, and/or distribute this software for any
|
| 466 |
+
> purpose with or without fee is hereby granted, provided that the above
|
| 467 |
+
> copyright notice and this permission notice appear in all copies.
|
| 468 |
+
>
|
| 469 |
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| 470 |
+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 471 |
+
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
| 472 |
+
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 473 |
+
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 474 |
+
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
| 475 |
+
> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 476 |
+
|
| 477 |
+
---------------------------------------
|
| 478 |
+
|
| 479 |
+
## picomatch
|
| 480 |
+
License: MIT
|
| 481 |
+
By: Jon Schlinkert
|
| 482 |
+
Repository: micromatch/picomatch
|
| 483 |
+
|
| 484 |
+
> The MIT License (MIT)
|
| 485 |
+
>
|
| 486 |
+
> Copyright (c) 2017-present, Jon Schlinkert.
|
| 487 |
+
>
|
| 488 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 489 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 490 |
+
> in the Software without restriction, including without limitation the rights
|
| 491 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 492 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 493 |
+
> furnished to do so, subject to the following conditions:
|
| 494 |
+
>
|
| 495 |
+
> The above copyright notice and this permission notice shall be included in
|
| 496 |
+
> all copies or substantial portions of the Software.
|
| 497 |
+
>
|
| 498 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 499 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 500 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 501 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 502 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 503 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 504 |
+
> THE SOFTWARE.
|
| 505 |
+
|
| 506 |
+
---------------------------------------
|
| 507 |
+
|
| 508 |
+
## pretty-bytes
|
| 509 |
+
License: MIT
|
| 510 |
+
By: Sindre Sorhus
|
| 511 |
+
Repository: sindresorhus/pretty-bytes
|
| 512 |
+
|
| 513 |
+
> MIT License
|
| 514 |
+
>
|
| 515 |
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
| 516 |
+
>
|
| 517 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 518 |
+
>
|
| 519 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 520 |
+
>
|
| 521 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 522 |
+
|
| 523 |
+
---------------------------------------
|
| 524 |
+
|
| 525 |
+
## pretty-ms
|
| 526 |
+
License: MIT
|
| 527 |
+
By: Sindre Sorhus
|
| 528 |
+
Repository: sindresorhus/pretty-ms
|
| 529 |
+
|
| 530 |
+
> MIT License
|
| 531 |
+
>
|
| 532 |
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
| 533 |
+
>
|
| 534 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 535 |
+
>
|
| 536 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 537 |
+
>
|
| 538 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 539 |
+
|
| 540 |
+
---------------------------------------
|
| 541 |
+
|
| 542 |
+
## readdirp
|
| 543 |
+
License: MIT
|
| 544 |
+
By: Thorsten Lorenz, Paul Miller
|
| 545 |
+
Repository: git://github.com/paulmillr/readdirp.git
|
| 546 |
+
|
| 547 |
+
> MIT License
|
| 548 |
+
>
|
| 549 |
+
> Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com)
|
| 550 |
+
>
|
| 551 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 552 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 553 |
+
> in the Software without restriction, including without limitation the rights
|
| 554 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 555 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 556 |
+
> furnished to do so, subject to the following conditions:
|
| 557 |
+
>
|
| 558 |
+
> The above copyright notice and this permission notice shall be included in all
|
| 559 |
+
> copies or substantial portions of the Software.
|
| 560 |
+
>
|
| 561 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 562 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 563 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 564 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 565 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 566 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 567 |
+
> SOFTWARE.
|
| 568 |
+
|
| 569 |
+
---------------------------------------
|
| 570 |
+
|
| 571 |
+
## signal-exit
|
| 572 |
+
License: ISC
|
| 573 |
+
By: Ben Coe
|
| 574 |
+
Repository: https://github.com/tapjs/signal-exit.git
|
| 575 |
+
|
| 576 |
+
> The ISC License
|
| 577 |
+
>
|
| 578 |
+
> Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors
|
| 579 |
+
>
|
| 580 |
+
> Permission to use, copy, modify, and/or distribute this software
|
| 581 |
+
> for any purpose with or without fee is hereby granted, provided
|
| 582 |
+
> that the above copyright notice and this permission notice
|
| 583 |
+
> appear in all copies.
|
| 584 |
+
>
|
| 585 |
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| 586 |
+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
| 587 |
+
> OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
| 588 |
+
> LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
| 589 |
+
> OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 590 |
+
> WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
| 591 |
+
> ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 592 |
+
|
| 593 |
+
---------------------------------------
|
| 594 |
+
|
| 595 |
+
## time-zone
|
| 596 |
+
License: MIT
|
| 597 |
+
By: Sindre Sorhus
|
| 598 |
+
Repository: sindresorhus/time-zone
|
| 599 |
+
|
| 600 |
+
> MIT License
|
| 601 |
+
>
|
| 602 |
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
| 603 |
+
>
|
| 604 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 605 |
+
>
|
| 606 |
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 607 |
+
>
|
| 608 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 609 |
+
|
| 610 |
+
---------------------------------------
|
| 611 |
+
|
| 612 |
+
## to-regex-range
|
| 613 |
+
License: MIT
|
| 614 |
+
By: Jon Schlinkert, Rouven Weßling
|
| 615 |
+
Repository: micromatch/to-regex-range
|
| 616 |
+
|
| 617 |
+
> The MIT License (MIT)
|
| 618 |
+
>
|
| 619 |
+
> Copyright (c) 2015-present, Jon Schlinkert.
|
| 620 |
+
>
|
| 621 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 622 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 623 |
+
> in the Software without restriction, including without limitation the rights
|
| 624 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 625 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 626 |
+
> furnished to do so, subject to the following conditions:
|
| 627 |
+
>
|
| 628 |
+
> The above copyright notice and this permission notice shall be included in
|
| 629 |
+
> all copies or substantial portions of the Software.
|
| 630 |
+
>
|
| 631 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 632 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 633 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 634 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 635 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 636 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 637 |
+
> THE SOFTWARE.
|
| 638 |
+
|
| 639 |
+
---------------------------------------
|
| 640 |
+
|
| 641 |
+
## tslib
|
| 642 |
+
License: 0BSD
|
| 643 |
+
By: Microsoft Corp.
|
| 644 |
+
Repository: https://github.com/Microsoft/tslib.git
|
| 645 |
+
|
| 646 |
+
> Copyright (c) Microsoft Corporation.
|
| 647 |
+
>
|
| 648 |
+
> Permission to use, copy, modify, and/or distribute this software for any
|
| 649 |
+
> purpose with or without fee is hereby granted.
|
| 650 |
+
>
|
| 651 |
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
| 652 |
+
> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
| 653 |
+
> AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
| 654 |
+
> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
| 655 |
+
> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
| 656 |
+
> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
| 657 |
+
> PERFORMANCE OF THIS SOFTWARE.
|
| 658 |
+
|
| 659 |
+
---------------------------------------
|
| 660 |
+
|
| 661 |
+
## yargs-parser
|
| 662 |
+
License: ISC
|
| 663 |
+
By: Ben Coe
|
| 664 |
+
Repository: https://github.com/yargs/yargs-parser.git
|
| 665 |
+
|
| 666 |
+
> Copyright (c) 2016, Contributors
|
| 667 |
+
>
|
| 668 |
+
> Permission to use, copy, modify, and/or distribute this software
|
| 669 |
+
> for any purpose with or without fee is hereby granted, provided
|
| 670 |
+
> that the above copyright notice and this permission notice
|
| 671 |
+
> appear in all copies.
|
| 672 |
+
>
|
| 673 |
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| 674 |
+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
| 675 |
+
> OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
| 676 |
+
> LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
| 677 |
+
> OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 678 |
+
> WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
| 679 |
+
> ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
node_modules/rollup/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://rollupjs.org/"><img src="https://rollupjs.org/rollup-logo.svg" width="150" /></a>
|
| 3 |
+
</p>
|
| 4 |
+
|
| 5 |
+
<p align="center">
|
| 6 |
+
<a href="https://www.npmjs.com/package/rollup">
|
| 7 |
+
<img src="https://img.shields.io/npm/v/rollup.svg" alt="npm version" >
|
| 8 |
+
</a>
|
| 9 |
+
<a href="https://nodejs.org/en/about/previous-releases">
|
| 10 |
+
<img src="https://img.shields.io/node/v/rollup.svg" alt="node compatibility">
|
| 11 |
+
</a>
|
| 12 |
+
<a href="https://packagephobia.now.sh/result?p=rollup">
|
| 13 |
+
<img src="https://packagephobia.now.sh/badge?p=rollup" alt="install size" >
|
| 14 |
+
</a>
|
| 15 |
+
<a href="https://codecov.io/gh/rollup/rollup">
|
| 16 |
+
<img src="https://codecov.io/gh/rollup/rollup/graph/badge.svg" alt="code coverage" >
|
| 17 |
+
</a>
|
| 18 |
+
<a href="#backers" alt="sponsors on Open Collective">
|
| 19 |
+
<img src="https://opencollective.com/rollup/backers/badge.svg" alt="backers" >
|
| 20 |
+
</a>
|
| 21 |
+
<a href="#sponsors" alt="Sponsors on Open Collective">
|
| 22 |
+
<img src="https://opencollective.com/rollup/sponsors/badge.svg" alt="sponsors" >
|
| 23 |
+
</a>
|
| 24 |
+
<a href="https://github.com/rollup/rollup/blob/master/LICENSE.md">
|
| 25 |
+
<img src="https://img.shields.io/npm/l/rollup.svg" alt="license">
|
| 26 |
+
</a>
|
| 27 |
+
<a href='https://is.gd/rollup_chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge'>
|
| 28 |
+
<img src='https://img.shields.io/discord/466787075518365708?color=778cd1&label=chat' alt='Join the chat at https://is.gd/rollup_chat'>
|
| 29 |
+
</a>
|
| 30 |
+
</p>
|
| 31 |
+
|
| 32 |
+
<h1 align="center">Rollup</h1>
|
| 33 |
+
|
| 34 |
+
## Overview
|
| 35 |
+
|
| 36 |
+
Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library or application. It uses the standardized ES module format for code, instead of previous idiosyncratic solutions such as CommonJS and AMD. ES modules let you freely and seamlessly combine the most useful individual functions from your favorite libraries. Rollup can optimize ES modules for faster native loading in modern browsers, or output a legacy module format allowing ES module workflows today.
|
| 37 |
+
|
| 38 |
+
## Quick Start Guide
|
| 39 |
+
|
| 40 |
+
Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/command-line-interface/) with an optional configuration file or else through its [JavaScript API](https://rollupjs.org/javascript-api/). Run `rollup --help` to see the available options and parameters. The starter project templates, [rollup-starter-lib](https://github.com/rollup/rollup-starter-lib) and [rollup-starter-app](https://github.com/rollup/rollup-starter-app), demonstrate common configuration options, and more detailed instructions are available throughout the [user guide](https://rollupjs.org/introduction/).
|
| 41 |
+
|
| 42 |
+
### Commands
|
| 43 |
+
|
| 44 |
+
These commands assume the entry point to your application is named main.js, and that you'd like all imports compiled into a single file named bundle.js.
|
| 45 |
+
|
| 46 |
+
For browsers:
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# compile to a <script> containing a self-executing function
|
| 50 |
+
rollup main.js --format iife --name "myBundle" --file bundle.js
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
For Node.js:
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
# compile to a CommonJS module
|
| 57 |
+
rollup main.js --format cjs --file bundle.js
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
For both browsers and Node.js:
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
# UMD format requires a bundle name
|
| 64 |
+
rollup main.js --format umd --name "myBundle" --file bundle.js
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
## Why
|
| 68 |
+
|
| 69 |
+
Developing software is usually easier if you break your project into smaller separate pieces, since that often removes unexpected interactions and dramatically reduces the complexity of the problems you'll need to solve, and simply writing smaller projects in the first place [isn't necessarily the answer](https://medium.com/@Rich_Harris/small-modules-it-s-not-quite-that-simple-3ca532d65de4). Unfortunately, JavaScript has not historically included this capability as a core feature in the language.
|
| 70 |
+
|
| 71 |
+
This finally changed with ES modules support in JavaScript, which provides a syntax for importing and exporting functions and data so they can be shared between separate scripts. Most browsers and Node.js support ES modules. However, Node.js releases before 12.17 support ES modules only behind the `--experimental-modules` flag, and older browsers like Internet Explorer do not support ES modules at all. Rollup allows you to write your code using ES modules, and run your application even in environments that do not support ES modules natively. For environments that support them, Rollup can output optimized ES modules; for environments that don't, Rollup can compile your code to other formats such as CommonJS modules, AMD modules, and IIFE-style scripts. This means that you get to _write future-proof code_, and you also get the tremendous benefits of...
|
| 72 |
+
|
| 73 |
+
## Tree Shaking
|
| 74 |
+
|
| 75 |
+
In addition to enabling the use of ES modules, Rollup also statically analyzes and optimizes the code you are importing, and will exclude anything that isn't actually used. This allows you to build on top of existing tools and modules without adding extra dependencies or bloating the size of your project.
|
| 76 |
+
|
| 77 |
+
For example, with CommonJS, the _entire tool or library must be imported_.
|
| 78 |
+
|
| 79 |
+
```js
|
| 80 |
+
// import the entire utils object with CommonJS
|
| 81 |
+
var utils = require('node:utils');
|
| 82 |
+
var query = 'Rollup';
|
| 83 |
+
// use the ajax method of the utils object
|
| 84 |
+
utils.ajax('https://api.example.com?search=' + query).then(handleResponse);
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
But with ES modules, instead of importing the whole `utils` object, we can just import the one `ajax` function we need:
|
| 88 |
+
|
| 89 |
+
```js
|
| 90 |
+
// import the ajax function with an ES import statement
|
| 91 |
+
import { ajax } from 'node:utils';
|
| 92 |
+
|
| 93 |
+
var query = 'Rollup';
|
| 94 |
+
// call the ajax function
|
| 95 |
+
ajax('https://api.example.com?search=' + query).then(handleResponse);
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
Because Rollup includes the bare minimum, it results in lighter, faster, and less complicated libraries and applications. Since this approach is based on explicit `import` and `export` statements, it is vastly more effective than simply running an automated minifier to detect unused variables in the compiled output code.
|
| 99 |
+
|
| 100 |
+
## Compatibility
|
| 101 |
+
|
| 102 |
+
### Importing CommonJS
|
| 103 |
+
|
| 104 |
+
Rollup can import existing CommonJS modules [through a plugin](https://github.com/rollup/plugins/tree/master/packages/commonjs).
|
| 105 |
+
|
| 106 |
+
### Publishing ES Modules
|
| 107 |
+
|
| 108 |
+
To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the `main` property in your `package.json` file. If your `package.json` file also has a `module` field, ES-module-aware tools like Rollup and [webpack](https://webpack.js.org/) will [import the ES module version](https://github.com/rollup/rollup/wiki/pkg.module) directly.
|
| 109 |
+
|
| 110 |
+
## Contributors
|
| 111 |
+
|
| 112 |
+
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. <a href="https://github.com/rollup/rollup/graphs/contributors"><img src="https://opencollective.com/rollup/contributors.svg?width=890" /></a>. If you want to contribute yourself, head over to the [contribution guidelines](CONTRIBUTING.md).
|
| 113 |
+
|
| 114 |
+
## Backers
|
| 115 |
+
|
| 116 |
+
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/rollup#backer)]
|
| 117 |
+
|
| 118 |
+
<a href="https://opencollective.com/rollup#backers" target="_blank"><img src="https://opencollective.com/rollup/backers.svg?width=890"></a>
|
| 119 |
+
|
| 120 |
+
## Sponsors
|
| 121 |
+
|
| 122 |
+
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/rollup#sponsor)]
|
| 123 |
+
|
| 124 |
+
<a href="https://opencollective.com/rollup/sponsor/0/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/1/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/2/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/3/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/4/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/5/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/6/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/7/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/8/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/9/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/10/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/10/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/11/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/11/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/12/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/12/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/13/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/13/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/14/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/14/avatar.svg"></a>
|
| 125 |
+
|
| 126 |
+
## Special Sponsor
|
| 127 |
+
|
| 128 |
+
<a href="https://www.tngtech.com/en/index.html" target="_blank"><img src="https://avatars.githubusercontent.com/u/432256?s=200&v=4" alt="TNG Logo"/></a>
|
| 129 |
+
|
| 130 |
+
TNG has been supporting the work of [Lukas Taegert-Atkinson](https://github.com/lukastaegert) on Rollup since 2017.
|
| 131 |
+
|
| 132 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
/*
|
| 3 |
+
@license
|
| 4 |
+
Rollup.js v4.57.1
|
| 5 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 6 |
+
|
| 7 |
+
https://github.com/rollup/rollup
|
| 8 |
+
|
| 9 |
+
Released under the MIT License.
|
| 10 |
+
*/
|
| 11 |
+
'use strict';
|
| 12 |
+
|
| 13 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 14 |
+
|
| 15 |
+
const process$1 = require('node:process');
|
| 16 |
+
const rollup = require('../shared/rollup.js');
|
| 17 |
+
const require$$2 = require('util');
|
| 18 |
+
const require$$0 = require('path');
|
| 19 |
+
const require$$0$1 = require('fs');
|
| 20 |
+
const parseAst_js = require('../shared/parseAst.js');
|
| 21 |
+
const fseventsImporter = require('../shared/fsevents-importer.js');
|
| 22 |
+
const promises = require('node:fs/promises');
|
| 23 |
+
const path = require('node:path');
|
| 24 |
+
const loadConfigFile_js = require('../shared/loadConfigFile.js');
|
| 25 |
+
require('../native.js');
|
| 26 |
+
require('node:perf_hooks');
|
| 27 |
+
require('node:url');
|
| 28 |
+
require('../getLogFilter.js');
|
| 29 |
+
|
| 30 |
+
const help = "rollup version 4.57.1\n=====================================\n\nUsage: rollup [options] <entry file>\n\nOptions:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, Rollup will try to load configuration files in\n the following order:\n rollup.config.mjs -> rollup.config.cjs -> rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAttributes Omit import attributes in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--forceExit Force exit the process when done\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--hashCharacters <name> Use the specified character set for file hashes\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--importAttributesKey <name> Use the specified keyword for import attributes\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--no-interop Do not include interop block\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-reexportProtoFromExternal Ignore `__proto__` in star re-exports\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapDebugIds Emit unique debug ids in source and sourcemaps\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.allowInputInsideOutputPath Whether the input path is allowed to be a\n subpath of the output path\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* @license
|
| 34 |
+
* Copyright (c) 2016, Contributors
|
| 35 |
+
* SPDX-License-Identifier: ISC
|
| 36 |
+
*/
|
| 37 |
+
function camelCase(str) {
|
| 38 |
+
// Handle the case where an argument is provided as camel case, e.g., fooBar.
|
| 39 |
+
// by ensuring that the string isn't already mixed case:
|
| 40 |
+
const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
|
| 41 |
+
if (!isCamelCase) {
|
| 42 |
+
str = str.toLowerCase();
|
| 43 |
+
}
|
| 44 |
+
if (str.indexOf('-') === -1 && str.indexOf('_') === -1) {
|
| 45 |
+
return str;
|
| 46 |
+
}
|
| 47 |
+
else {
|
| 48 |
+
let camelcase = '';
|
| 49 |
+
let nextChrUpper = false;
|
| 50 |
+
const leadingHyphens = str.match(/^-+/);
|
| 51 |
+
for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) {
|
| 52 |
+
let chr = str.charAt(i);
|
| 53 |
+
if (nextChrUpper) {
|
| 54 |
+
nextChrUpper = false;
|
| 55 |
+
chr = chr.toUpperCase();
|
| 56 |
+
}
|
| 57 |
+
if (i !== 0 && (chr === '-' || chr === '_')) {
|
| 58 |
+
nextChrUpper = true;
|
| 59 |
+
}
|
| 60 |
+
else if (chr !== '-' && chr !== '_') {
|
| 61 |
+
camelcase += chr;
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
return camelcase;
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
function decamelize(str, joinString) {
|
| 68 |
+
const lowercase = str.toLowerCase();
|
| 69 |
+
joinString = joinString || '-';
|
| 70 |
+
let notCamelcase = '';
|
| 71 |
+
for (let i = 0; i < str.length; i++) {
|
| 72 |
+
const chrLower = lowercase.charAt(i);
|
| 73 |
+
const chrString = str.charAt(i);
|
| 74 |
+
if (chrLower !== chrString && i > 0) {
|
| 75 |
+
notCamelcase += `${joinString}${lowercase.charAt(i)}`;
|
| 76 |
+
}
|
| 77 |
+
else {
|
| 78 |
+
notCamelcase += chrString;
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
return notCamelcase;
|
| 82 |
+
}
|
| 83 |
+
function looksLikeNumber(x) {
|
| 84 |
+
if (x === null || x === undefined)
|
| 85 |
+
return false;
|
| 86 |
+
// if loaded from config, may already be a number.
|
| 87 |
+
if (typeof x === 'number')
|
| 88 |
+
return true;
|
| 89 |
+
// hexadecimal.
|
| 90 |
+
if (/^0x[0-9a-f]+$/i.test(x))
|
| 91 |
+
return true;
|
| 92 |
+
// don't treat 0123 as a number; as it drops the leading '0'.
|
| 93 |
+
if (/^0[^.]/.test(x))
|
| 94 |
+
return false;
|
| 95 |
+
return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
/**
|
| 99 |
+
* @license
|
| 100 |
+
* Copyright (c) 2016, Contributors
|
| 101 |
+
* SPDX-License-Identifier: ISC
|
| 102 |
+
*/
|
| 103 |
+
// take an un-split argv string and tokenize it.
|
| 104 |
+
function tokenizeArgString(argString) {
|
| 105 |
+
if (Array.isArray(argString)) {
|
| 106 |
+
return argString.map(e => typeof e !== 'string' ? e + '' : e);
|
| 107 |
+
}
|
| 108 |
+
argString = argString.trim();
|
| 109 |
+
let i = 0;
|
| 110 |
+
let prevC = null;
|
| 111 |
+
let c = null;
|
| 112 |
+
let opening = null;
|
| 113 |
+
const args = [];
|
| 114 |
+
for (let ii = 0; ii < argString.length; ii++) {
|
| 115 |
+
prevC = c;
|
| 116 |
+
c = argString.charAt(ii);
|
| 117 |
+
// split on spaces unless we're in quotes.
|
| 118 |
+
if (c === ' ' && !opening) {
|
| 119 |
+
if (!(prevC === ' ')) {
|
| 120 |
+
i++;
|
| 121 |
+
}
|
| 122 |
+
continue;
|
| 123 |
+
}
|
| 124 |
+
// don't split the string if we're in matching
|
| 125 |
+
// opening or closing single and double quotes.
|
| 126 |
+
if (c === opening) {
|
| 127 |
+
opening = null;
|
| 128 |
+
}
|
| 129 |
+
else if ((c === "'" || c === '"') && !opening) {
|
| 130 |
+
opening = c;
|
| 131 |
+
}
|
| 132 |
+
if (!args[i])
|
| 133 |
+
args[i] = '';
|
| 134 |
+
args[i] += c;
|
| 135 |
+
}
|
| 136 |
+
return args;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
/**
|
| 140 |
+
* @license
|
| 141 |
+
* Copyright (c) 2016, Contributors
|
| 142 |
+
* SPDX-License-Identifier: ISC
|
| 143 |
+
*/
|
| 144 |
+
var DefaultValuesForTypeKey;
|
| 145 |
+
(function (DefaultValuesForTypeKey) {
|
| 146 |
+
DefaultValuesForTypeKey["BOOLEAN"] = "boolean";
|
| 147 |
+
DefaultValuesForTypeKey["STRING"] = "string";
|
| 148 |
+
DefaultValuesForTypeKey["NUMBER"] = "number";
|
| 149 |
+
DefaultValuesForTypeKey["ARRAY"] = "array";
|
| 150 |
+
})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {}));
|
| 151 |
+
|
| 152 |
+
/**
|
| 153 |
+
* @license
|
| 154 |
+
* Copyright (c) 2016, Contributors
|
| 155 |
+
* SPDX-License-Identifier: ISC
|
| 156 |
+
*/
|
| 157 |
+
let mixin;
|
| 158 |
+
class YargsParser {
|
| 159 |
+
constructor(_mixin) {
|
| 160 |
+
mixin = _mixin;
|
| 161 |
+
}
|
| 162 |
+
parse(argsInput, options) {
|
| 163 |
+
const opts = Object.assign({
|
| 164 |
+
alias: undefined,
|
| 165 |
+
array: undefined,
|
| 166 |
+
boolean: undefined,
|
| 167 |
+
config: undefined,
|
| 168 |
+
configObjects: undefined,
|
| 169 |
+
configuration: undefined,
|
| 170 |
+
coerce: undefined,
|
| 171 |
+
count: undefined,
|
| 172 |
+
default: undefined,
|
| 173 |
+
envPrefix: undefined,
|
| 174 |
+
narg: undefined,
|
| 175 |
+
normalize: undefined,
|
| 176 |
+
string: undefined,
|
| 177 |
+
number: undefined,
|
| 178 |
+
__: undefined,
|
| 179 |
+
key: undefined
|
| 180 |
+
}, options);
|
| 181 |
+
// allow a string argument to be passed in rather
|
| 182 |
+
// than an argv array.
|
| 183 |
+
const args = tokenizeArgString(argsInput);
|
| 184 |
+
// tokenizeArgString adds extra quotes to args if argsInput is a string
|
| 185 |
+
// only strip those extra quotes in processValue if argsInput is a string
|
| 186 |
+
const inputIsString = typeof argsInput === 'string';
|
| 187 |
+
// aliases might have transitive relationships, normalize this.
|
| 188 |
+
const aliases = combineAliases(Object.assign(Object.create(null), opts.alias));
|
| 189 |
+
const configuration = Object.assign({
|
| 190 |
+
'boolean-negation': true,
|
| 191 |
+
'camel-case-expansion': true,
|
| 192 |
+
'combine-arrays': false,
|
| 193 |
+
'dot-notation': true,
|
| 194 |
+
'duplicate-arguments-array': true,
|
| 195 |
+
'flatten-duplicate-arrays': true,
|
| 196 |
+
'greedy-arrays': true,
|
| 197 |
+
'halt-at-non-option': false,
|
| 198 |
+
'nargs-eats-options': false,
|
| 199 |
+
'negation-prefix': 'no-',
|
| 200 |
+
'parse-numbers': true,
|
| 201 |
+
'parse-positional-numbers': true,
|
| 202 |
+
'populate--': false,
|
| 203 |
+
'set-placeholder-key': false,
|
| 204 |
+
'short-option-groups': true,
|
| 205 |
+
'strip-aliased': false,
|
| 206 |
+
'strip-dashed': false,
|
| 207 |
+
'unknown-options-as-args': false
|
| 208 |
+
}, opts.configuration);
|
| 209 |
+
const defaults = Object.assign(Object.create(null), opts.default);
|
| 210 |
+
const configObjects = opts.configObjects || [];
|
| 211 |
+
const envPrefix = opts.envPrefix;
|
| 212 |
+
const notFlagsOption = configuration['populate--'];
|
| 213 |
+
const notFlagsArgv = notFlagsOption ? '--' : '_';
|
| 214 |
+
const newAliases = Object.create(null);
|
| 215 |
+
const defaulted = Object.create(null);
|
| 216 |
+
// allow a i18n handler to be passed in, default to a fake one (util.format).
|
| 217 |
+
const __ = opts.__ || mixin.format;
|
| 218 |
+
const flags = {
|
| 219 |
+
aliases: Object.create(null),
|
| 220 |
+
arrays: Object.create(null),
|
| 221 |
+
bools: Object.create(null),
|
| 222 |
+
strings: Object.create(null),
|
| 223 |
+
numbers: Object.create(null),
|
| 224 |
+
counts: Object.create(null),
|
| 225 |
+
normalize: Object.create(null),
|
| 226 |
+
configs: Object.create(null),
|
| 227 |
+
nargs: Object.create(null),
|
| 228 |
+
coercions: Object.create(null),
|
| 229 |
+
keys: []
|
| 230 |
+
};
|
| 231 |
+
const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;
|
| 232 |
+
const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)');
|
| 233 |
+
[].concat(opts.array || []).filter(Boolean).forEach(function (opt) {
|
| 234 |
+
const key = typeof opt === 'object' ? opt.key : opt;
|
| 235 |
+
// assign to flags[bools|strings|numbers]
|
| 236 |
+
const assignment = Object.keys(opt).map(function (key) {
|
| 237 |
+
const arrayFlagKeys = {
|
| 238 |
+
boolean: 'bools',
|
| 239 |
+
string: 'strings',
|
| 240 |
+
number: 'numbers'
|
| 241 |
+
};
|
| 242 |
+
return arrayFlagKeys[key];
|
| 243 |
+
}).filter(Boolean).pop();
|
| 244 |
+
// assign key to be coerced
|
| 245 |
+
if (assignment) {
|
| 246 |
+
flags[assignment][key] = true;
|
| 247 |
+
}
|
| 248 |
+
flags.arrays[key] = true;
|
| 249 |
+
flags.keys.push(key);
|
| 250 |
+
});
|
| 251 |
+
[].concat(opts.boolean || []).filter(Boolean).forEach(function (key) {
|
| 252 |
+
flags.bools[key] = true;
|
| 253 |
+
flags.keys.push(key);
|
| 254 |
+
});
|
| 255 |
+
[].concat(opts.string || []).filter(Boolean).forEach(function (key) {
|
| 256 |
+
flags.strings[key] = true;
|
| 257 |
+
flags.keys.push(key);
|
| 258 |
+
});
|
| 259 |
+
[].concat(opts.number || []).filter(Boolean).forEach(function (key) {
|
| 260 |
+
flags.numbers[key] = true;
|
| 261 |
+
flags.keys.push(key);
|
| 262 |
+
});
|
| 263 |
+
[].concat(opts.count || []).filter(Boolean).forEach(function (key) {
|
| 264 |
+
flags.counts[key] = true;
|
| 265 |
+
flags.keys.push(key);
|
| 266 |
+
});
|
| 267 |
+
[].concat(opts.normalize || []).filter(Boolean).forEach(function (key) {
|
| 268 |
+
flags.normalize[key] = true;
|
| 269 |
+
flags.keys.push(key);
|
| 270 |
+
});
|
| 271 |
+
if (typeof opts.narg === 'object') {
|
| 272 |
+
Object.entries(opts.narg).forEach(([key, value]) => {
|
| 273 |
+
if (typeof value === 'number') {
|
| 274 |
+
flags.nargs[key] = value;
|
| 275 |
+
flags.keys.push(key);
|
| 276 |
+
}
|
| 277 |
+
});
|
| 278 |
+
}
|
| 279 |
+
if (typeof opts.coerce === 'object') {
|
| 280 |
+
Object.entries(opts.coerce).forEach(([key, value]) => {
|
| 281 |
+
if (typeof value === 'function') {
|
| 282 |
+
flags.coercions[key] = value;
|
| 283 |
+
flags.keys.push(key);
|
| 284 |
+
}
|
| 285 |
+
});
|
| 286 |
+
}
|
| 287 |
+
if (typeof opts.config !== 'undefined') {
|
| 288 |
+
if (Array.isArray(opts.config) || typeof opts.config === 'string') {
|
| 289 |
+
[].concat(opts.config).filter(Boolean).forEach(function (key) {
|
| 290 |
+
flags.configs[key] = true;
|
| 291 |
+
});
|
| 292 |
+
}
|
| 293 |
+
else if (typeof opts.config === 'object') {
|
| 294 |
+
Object.entries(opts.config).forEach(([key, value]) => {
|
| 295 |
+
if (typeof value === 'boolean' || typeof value === 'function') {
|
| 296 |
+
flags.configs[key] = value;
|
| 297 |
+
}
|
| 298 |
+
});
|
| 299 |
+
}
|
| 300 |
+
}
|
| 301 |
+
// create a lookup table that takes into account all
|
| 302 |
+
// combinations of aliases: {f: ['foo'], foo: ['f']}
|
| 303 |
+
extendAliases(opts.key, aliases, opts.default, flags.arrays);
|
| 304 |
+
// apply default values to all aliases.
|
| 305 |
+
Object.keys(defaults).forEach(function (key) {
|
| 306 |
+
(flags.aliases[key] || []).forEach(function (alias) {
|
| 307 |
+
defaults[alias] = defaults[key];
|
| 308 |
+
});
|
| 309 |
+
});
|
| 310 |
+
let error = null;
|
| 311 |
+
checkConfiguration();
|
| 312 |
+
let notFlags = [];
|
| 313 |
+
const argv = Object.assign(Object.create(null), { _: [] });
|
| 314 |
+
// TODO(bcoe): for the first pass at removing object prototype we didn't
|
| 315 |
+
// remove all prototypes from objects returned by this API, we might want
|
| 316 |
+
// to gradually move towards doing so.
|
| 317 |
+
const argvReturn = {};
|
| 318 |
+
for (let i = 0; i < args.length; i++) {
|
| 319 |
+
const arg = args[i];
|
| 320 |
+
const truncatedArg = arg.replace(/^-{3,}/, '---');
|
| 321 |
+
let broken;
|
| 322 |
+
let key;
|
| 323 |
+
let letters;
|
| 324 |
+
let m;
|
| 325 |
+
let next;
|
| 326 |
+
let value;
|
| 327 |
+
// any unknown option (except for end-of-options, "--")
|
| 328 |
+
if (arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg)) {
|
| 329 |
+
pushPositional(arg);
|
| 330 |
+
// ---, ---=, ----, etc,
|
| 331 |
+
}
|
| 332 |
+
else if (truncatedArg.match(/^---+(=|$)/)) {
|
| 333 |
+
// options without key name are invalid.
|
| 334 |
+
pushPositional(arg);
|
| 335 |
+
continue;
|
| 336 |
+
// -- separated by =
|
| 337 |
+
}
|
| 338 |
+
else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) {
|
| 339 |
+
// Using [\s\S] instead of . because js doesn't support the
|
| 340 |
+
// 'dotall' regex modifier. See:
|
| 341 |
+
// http://stackoverflow.com/a/1068308/13216
|
| 342 |
+
m = arg.match(/^--?([^=]+)=([\s\S]*)$/);
|
| 343 |
+
// arrays format = '--f=a b c'
|
| 344 |
+
if (m !== null && Array.isArray(m) && m.length >= 3) {
|
| 345 |
+
if (checkAllAliases(m[1], flags.arrays)) {
|
| 346 |
+
i = eatArray(i, m[1], args, m[2]);
|
| 347 |
+
}
|
| 348 |
+
else if (checkAllAliases(m[1], flags.nargs) !== false) {
|
| 349 |
+
// nargs format = '--f=monkey washing cat'
|
| 350 |
+
i = eatNargs(i, m[1], args, m[2]);
|
| 351 |
+
}
|
| 352 |
+
else {
|
| 353 |
+
setArg(m[1], m[2], true);
|
| 354 |
+
}
|
| 355 |
+
}
|
| 356 |
+
}
|
| 357 |
+
else if (arg.match(negatedBoolean) && configuration['boolean-negation']) {
|
| 358 |
+
m = arg.match(negatedBoolean);
|
| 359 |
+
if (m !== null && Array.isArray(m) && m.length >= 2) {
|
| 360 |
+
key = m[1];
|
| 361 |
+
setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false);
|
| 362 |
+
}
|
| 363 |
+
// -- separated by space.
|
| 364 |
+
}
|
| 365 |
+
else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) {
|
| 366 |
+
m = arg.match(/^--?(.+)/);
|
| 367 |
+
if (m !== null && Array.isArray(m) && m.length >= 2) {
|
| 368 |
+
key = m[1];
|
| 369 |
+
if (checkAllAliases(key, flags.arrays)) {
|
| 370 |
+
// array format = '--foo a b c'
|
| 371 |
+
i = eatArray(i, key, args);
|
| 372 |
+
}
|
| 373 |
+
else if (checkAllAliases(key, flags.nargs) !== false) {
|
| 374 |
+
// nargs format = '--foo a b c'
|
| 375 |
+
// should be truthy even if: flags.nargs[key] === 0
|
| 376 |
+
i = eatNargs(i, key, args);
|
| 377 |
+
}
|
| 378 |
+
else {
|
| 379 |
+
next = args[i + 1];
|
| 380 |
+
if (next !== undefined && (!next.match(/^-/) ||
|
| 381 |
+
next.match(negative)) &&
|
| 382 |
+
!checkAllAliases(key, flags.bools) &&
|
| 383 |
+
!checkAllAliases(key, flags.counts)) {
|
| 384 |
+
setArg(key, next);
|
| 385 |
+
i++;
|
| 386 |
+
}
|
| 387 |
+
else if (/^(true|false)$/.test(next)) {
|
| 388 |
+
setArg(key, next);
|
| 389 |
+
i++;
|
| 390 |
+
}
|
| 391 |
+
else {
|
| 392 |
+
setArg(key, defaultValue(key));
|
| 393 |
+
}
|
| 394 |
+
}
|
| 395 |
+
}
|
| 396 |
+
// dot-notation flag separated by '='.
|
| 397 |
+
}
|
| 398 |
+
else if (arg.match(/^-.\..+=/)) {
|
| 399 |
+
m = arg.match(/^-([^=]+)=([\s\S]*)$/);
|
| 400 |
+
if (m !== null && Array.isArray(m) && m.length >= 3) {
|
| 401 |
+
setArg(m[1], m[2]);
|
| 402 |
+
}
|
| 403 |
+
// dot-notation flag separated by space.
|
| 404 |
+
}
|
| 405 |
+
else if (arg.match(/^-.\..+/) && !arg.match(negative)) {
|
| 406 |
+
next = args[i + 1];
|
| 407 |
+
m = arg.match(/^-(.\..+)/);
|
| 408 |
+
if (m !== null && Array.isArray(m) && m.length >= 2) {
|
| 409 |
+
key = m[1];
|
| 410 |
+
if (next !== undefined && !next.match(/^-/) &&
|
| 411 |
+
!checkAllAliases(key, flags.bools) &&
|
| 412 |
+
!checkAllAliases(key, flags.counts)) {
|
| 413 |
+
setArg(key, next);
|
| 414 |
+
i++;
|
| 415 |
+
}
|
| 416 |
+
else {
|
| 417 |
+
setArg(key, defaultValue(key));
|
| 418 |
+
}
|
| 419 |
+
}
|
| 420 |
+
}
|
| 421 |
+
else if (arg.match(/^-[^-]+/) && !arg.match(negative)) {
|
| 422 |
+
letters = arg.slice(1, -1).split('');
|
| 423 |
+
broken = false;
|
| 424 |
+
for (let j = 0; j < letters.length; j++) {
|
| 425 |
+
next = arg.slice(j + 2);
|
| 426 |
+
if (letters[j + 1] && letters[j + 1] === '=') {
|
| 427 |
+
value = arg.slice(j + 3);
|
| 428 |
+
key = letters[j];
|
| 429 |
+
if (checkAllAliases(key, flags.arrays)) {
|
| 430 |
+
// array format = '-f=a b c'
|
| 431 |
+
i = eatArray(i, key, args, value);
|
| 432 |
+
}
|
| 433 |
+
else if (checkAllAliases(key, flags.nargs) !== false) {
|
| 434 |
+
// nargs format = '-f=monkey washing cat'
|
| 435 |
+
i = eatNargs(i, key, args, value);
|
| 436 |
+
}
|
| 437 |
+
else {
|
| 438 |
+
setArg(key, value);
|
| 439 |
+
}
|
| 440 |
+
broken = true;
|
| 441 |
+
break;
|
| 442 |
+
}
|
| 443 |
+
if (next === '-') {
|
| 444 |
+
setArg(letters[j], next);
|
| 445 |
+
continue;
|
| 446 |
+
}
|
| 447 |
+
// current letter is an alphabetic character and next value is a number
|
| 448 |
+
if (/[A-Za-z]/.test(letters[j]) &&
|
| 449 |
+
/^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) &&
|
| 450 |
+
checkAllAliases(next, flags.bools) === false) {
|
| 451 |
+
setArg(letters[j], next);
|
| 452 |
+
broken = true;
|
| 453 |
+
break;
|
| 454 |
+
}
|
| 455 |
+
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
| 456 |
+
setArg(letters[j], next);
|
| 457 |
+
broken = true;
|
| 458 |
+
break;
|
| 459 |
+
}
|
| 460 |
+
else {
|
| 461 |
+
setArg(letters[j], defaultValue(letters[j]));
|
| 462 |
+
}
|
| 463 |
+
}
|
| 464 |
+
key = arg.slice(-1)[0];
|
| 465 |
+
if (!broken && key !== '-') {
|
| 466 |
+
if (checkAllAliases(key, flags.arrays)) {
|
| 467 |
+
// array format = '-f a b c'
|
| 468 |
+
i = eatArray(i, key, args);
|
| 469 |
+
}
|
| 470 |
+
else if (checkAllAliases(key, flags.nargs) !== false) {
|
| 471 |
+
// nargs format = '-f a b c'
|
| 472 |
+
// should be truthy even if: flags.nargs[key] === 0
|
| 473 |
+
i = eatNargs(i, key, args);
|
| 474 |
+
}
|
| 475 |
+
else {
|
| 476 |
+
next = args[i + 1];
|
| 477 |
+
if (next !== undefined && (!/^(-|--)[^-]/.test(next) ||
|
| 478 |
+
next.match(negative)) &&
|
| 479 |
+
!checkAllAliases(key, flags.bools) &&
|
| 480 |
+
!checkAllAliases(key, flags.counts)) {
|
| 481 |
+
setArg(key, next);
|
| 482 |
+
i++;
|
| 483 |
+
}
|
| 484 |
+
else if (/^(true|false)$/.test(next)) {
|
| 485 |
+
setArg(key, next);
|
| 486 |
+
i++;
|
| 487 |
+
}
|
| 488 |
+
else {
|
| 489 |
+
setArg(key, defaultValue(key));
|
| 490 |
+
}
|
| 491 |
+
}
|
| 492 |
+
}
|
| 493 |
+
}
|
| 494 |
+
else if (arg.match(/^-[0-9]$/) &&
|
| 495 |
+
arg.match(negative) &&
|
| 496 |
+
checkAllAliases(arg.slice(1), flags.bools)) {
|
| 497 |
+
// single-digit boolean alias, e.g: xargs -0
|
| 498 |
+
key = arg.slice(1);
|
| 499 |
+
setArg(key, defaultValue(key));
|
| 500 |
+
}
|
| 501 |
+
else if (arg === '--') {
|
| 502 |
+
notFlags = args.slice(i + 1);
|
| 503 |
+
break;
|
| 504 |
+
}
|
| 505 |
+
else if (configuration['halt-at-non-option']) {
|
| 506 |
+
notFlags = args.slice(i);
|
| 507 |
+
break;
|
| 508 |
+
}
|
| 509 |
+
else {
|
| 510 |
+
pushPositional(arg);
|
| 511 |
+
}
|
| 512 |
+
}
|
| 513 |
+
// order of precedence:
|
| 514 |
+
// 1. command line arg
|
| 515 |
+
// 2. value from env var
|
| 516 |
+
// 3. value from config file
|
| 517 |
+
// 4. value from config objects
|
| 518 |
+
// 5. configured default value
|
| 519 |
+
applyEnvVars(argv, true); // special case: check env vars that point to config file
|
| 520 |
+
applyEnvVars(argv, false);
|
| 521 |
+
setConfig(argv);
|
| 522 |
+
setConfigObjects();
|
| 523 |
+
applyDefaultsAndAliases(argv, flags.aliases, defaults, true);
|
| 524 |
+
applyCoercions(argv);
|
| 525 |
+
if (configuration['set-placeholder-key'])
|
| 526 |
+
setPlaceholderKeys(argv);
|
| 527 |
+
// for any counts either not in args or without an explicit default, set to 0
|
| 528 |
+
Object.keys(flags.counts).forEach(function (key) {
|
| 529 |
+
if (!hasKey(argv, key.split('.')))
|
| 530 |
+
setArg(key, 0);
|
| 531 |
+
});
|
| 532 |
+
// '--' defaults to undefined.
|
| 533 |
+
if (notFlagsOption && notFlags.length)
|
| 534 |
+
argv[notFlagsArgv] = [];
|
| 535 |
+
notFlags.forEach(function (key) {
|
| 536 |
+
argv[notFlagsArgv].push(key);
|
| 537 |
+
});
|
| 538 |
+
if (configuration['camel-case-expansion'] && configuration['strip-dashed']) {
|
| 539 |
+
Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => {
|
| 540 |
+
delete argv[key];
|
| 541 |
+
});
|
| 542 |
+
}
|
| 543 |
+
if (configuration['strip-aliased']) {
|
| 544 |
+
[].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => {
|
| 545 |
+
if (configuration['camel-case-expansion'] && alias.includes('-')) {
|
| 546 |
+
delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')];
|
| 547 |
+
}
|
| 548 |
+
delete argv[alias];
|
| 549 |
+
});
|
| 550 |
+
}
|
| 551 |
+
// Push argument into positional array, applying numeric coercion:
|
| 552 |
+
function pushPositional(arg) {
|
| 553 |
+
const maybeCoercedNumber = maybeCoerceNumber('_', arg);
|
| 554 |
+
if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') {
|
| 555 |
+
argv._.push(maybeCoercedNumber);
|
| 556 |
+
}
|
| 557 |
+
}
|
| 558 |
+
// how many arguments should we consume, based
|
| 559 |
+
// on the nargs option?
|
| 560 |
+
function eatNargs(i, key, args, argAfterEqualSign) {
|
| 561 |
+
let ii;
|
| 562 |
+
let toEat = checkAllAliases(key, flags.nargs);
|
| 563 |
+
// NaN has a special meaning for the array type, indicating that one or
|
| 564 |
+
// more values are expected.
|
| 565 |
+
toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat;
|
| 566 |
+
if (toEat === 0) {
|
| 567 |
+
if (!isUndefined(argAfterEqualSign)) {
|
| 568 |
+
error = Error(__('Argument unexpected for: %s', key));
|
| 569 |
+
}
|
| 570 |
+
setArg(key, defaultValue(key));
|
| 571 |
+
return i;
|
| 572 |
+
}
|
| 573 |
+
let available = isUndefined(argAfterEqualSign) ? 0 : 1;
|
| 574 |
+
if (configuration['nargs-eats-options']) {
|
| 575 |
+
// classic behavior, yargs eats positional and dash arguments.
|
| 576 |
+
if (args.length - (i + 1) + available < toEat) {
|
| 577 |
+
error = Error(__('Not enough arguments following: %s', key));
|
| 578 |
+
}
|
| 579 |
+
available = toEat;
|
| 580 |
+
}
|
| 581 |
+
else {
|
| 582 |
+
// nargs will not consume flag arguments, e.g., -abc, --foo,
|
| 583 |
+
// and terminates when one is observed.
|
| 584 |
+
for (ii = i + 1; ii < args.length; ii++) {
|
| 585 |
+
if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii]))
|
| 586 |
+
available++;
|
| 587 |
+
else
|
| 588 |
+
break;
|
| 589 |
+
}
|
| 590 |
+
if (available < toEat)
|
| 591 |
+
error = Error(__('Not enough arguments following: %s', key));
|
| 592 |
+
}
|
| 593 |
+
let consumed = Math.min(available, toEat);
|
| 594 |
+
if (!isUndefined(argAfterEqualSign) && consumed > 0) {
|
| 595 |
+
setArg(key, argAfterEqualSign);
|
| 596 |
+
consumed--;
|
| 597 |
+
}
|
| 598 |
+
for (ii = i + 1; ii < (consumed + i + 1); ii++) {
|
| 599 |
+
setArg(key, args[ii]);
|
| 600 |
+
}
|
| 601 |
+
return (i + consumed);
|
| 602 |
+
}
|
| 603 |
+
// if an option is an array, eat all non-hyphenated arguments
|
| 604 |
+
// following it... YUM!
|
| 605 |
+
// e.g., --foo apple banana cat becomes ["apple", "banana", "cat"]
|
| 606 |
+
function eatArray(i, key, args, argAfterEqualSign) {
|
| 607 |
+
let argsToSet = [];
|
| 608 |
+
let next = argAfterEqualSign || args[i + 1];
|
| 609 |
+
// If both array and nargs are configured, enforce the nargs count:
|
| 610 |
+
const nargsCount = checkAllAliases(key, flags.nargs);
|
| 611 |
+
if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) {
|
| 612 |
+
argsToSet.push(true);
|
| 613 |
+
}
|
| 614 |
+
else if (isUndefined(next) ||
|
| 615 |
+
(isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) {
|
| 616 |
+
// for keys without value ==> argsToSet remains an empty []
|
| 617 |
+
// set user default value, if available
|
| 618 |
+
if (defaults[key] !== undefined) {
|
| 619 |
+
const defVal = defaults[key];
|
| 620 |
+
argsToSet = Array.isArray(defVal) ? defVal : [defVal];
|
| 621 |
+
}
|
| 622 |
+
}
|
| 623 |
+
else {
|
| 624 |
+
// value in --option=value is eaten as is
|
| 625 |
+
if (!isUndefined(argAfterEqualSign)) {
|
| 626 |
+
argsToSet.push(processValue(key, argAfterEqualSign, true));
|
| 627 |
+
}
|
| 628 |
+
for (let ii = i + 1; ii < args.length; ii++) {
|
| 629 |
+
if ((!configuration['greedy-arrays'] && argsToSet.length > 0) ||
|
| 630 |
+
(nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount))
|
| 631 |
+
break;
|
| 632 |
+
next = args[ii];
|
| 633 |
+
if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))
|
| 634 |
+
break;
|
| 635 |
+
i = ii;
|
| 636 |
+
argsToSet.push(processValue(key, next, inputIsString));
|
| 637 |
+
}
|
| 638 |
+
}
|
| 639 |
+
// If both array and nargs are configured, create an error if less than
|
| 640 |
+
// nargs positionals were found. NaN has special meaning, indicating
|
| 641 |
+
// that at least one value is required (more are okay).
|
| 642 |
+
if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) ||
|
| 643 |
+
(isNaN(nargsCount) && argsToSet.length === 0))) {
|
| 644 |
+
error = Error(__('Not enough arguments following: %s', key));
|
| 645 |
+
}
|
| 646 |
+
setArg(key, argsToSet);
|
| 647 |
+
return i;
|
| 648 |
+
}
|
| 649 |
+
function setArg(key, val, shouldStripQuotes = inputIsString) {
|
| 650 |
+
if (/-/.test(key) && configuration['camel-case-expansion']) {
|
| 651 |
+
const alias = key.split('.').map(function (prop) {
|
| 652 |
+
return camelCase(prop);
|
| 653 |
+
}).join('.');
|
| 654 |
+
addNewAlias(key, alias);
|
| 655 |
+
}
|
| 656 |
+
const value = processValue(key, val, shouldStripQuotes);
|
| 657 |
+
const splitKey = key.split('.');
|
| 658 |
+
setKey(argv, splitKey, value);
|
| 659 |
+
// handle populating aliases of the full key
|
| 660 |
+
if (flags.aliases[key]) {
|
| 661 |
+
flags.aliases[key].forEach(function (x) {
|
| 662 |
+
const keyProperties = x.split('.');
|
| 663 |
+
setKey(argv, keyProperties, value);
|
| 664 |
+
});
|
| 665 |
+
}
|
| 666 |
+
// handle populating aliases of the first element of the dot-notation key
|
| 667 |
+
if (splitKey.length > 1 && configuration['dot-notation']) {
|
| 668 |
+
(flags.aliases[splitKey[0]] || []).forEach(function (x) {
|
| 669 |
+
let keyProperties = x.split('.');
|
| 670 |
+
// expand alias with nested objects in key
|
| 671 |
+
const a = [].concat(splitKey);
|
| 672 |
+
a.shift(); // nuke the old key.
|
| 673 |
+
keyProperties = keyProperties.concat(a);
|
| 674 |
+
// populate alias only if is not already an alias of the full key
|
| 675 |
+
// (already populated above)
|
| 676 |
+
if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) {
|
| 677 |
+
setKey(argv, keyProperties, value);
|
| 678 |
+
}
|
| 679 |
+
});
|
| 680 |
+
}
|
| 681 |
+
// Set normalize getter and setter when key is in 'normalize' but isn't an array
|
| 682 |
+
if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) {
|
| 683 |
+
const keys = [key].concat(flags.aliases[key] || []);
|
| 684 |
+
keys.forEach(function (key) {
|
| 685 |
+
Object.defineProperty(argvReturn, key, {
|
| 686 |
+
enumerable: true,
|
| 687 |
+
get() {
|
| 688 |
+
return val;
|
| 689 |
+
},
|
| 690 |
+
set(value) {
|
| 691 |
+
val = typeof value === 'string' ? mixin.normalize(value) : value;
|
| 692 |
+
}
|
| 693 |
+
});
|
| 694 |
+
});
|
| 695 |
+
}
|
| 696 |
+
}
|
| 697 |
+
function addNewAlias(key, alias) {
|
| 698 |
+
if (!(flags.aliases[key] && flags.aliases[key].length)) {
|
| 699 |
+
flags.aliases[key] = [alias];
|
| 700 |
+
newAliases[alias] = true;
|
| 701 |
+
}
|
| 702 |
+
if (!(flags.aliases[alias] && flags.aliases[alias].length)) {
|
| 703 |
+
addNewAlias(alias, key);
|
| 704 |
+
}
|
| 705 |
+
}
|
| 706 |
+
function processValue(key, val, shouldStripQuotes) {
|
| 707 |
+
// strings may be quoted, clean this up as we assign values.
|
| 708 |
+
if (shouldStripQuotes) {
|
| 709 |
+
val = stripQuotes(val);
|
| 710 |
+
}
|
| 711 |
+
// handle parsing boolean arguments --foo=true --bar false.
|
| 712 |
+
if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
|
| 713 |
+
if (typeof val === 'string')
|
| 714 |
+
val = val === 'true';
|
| 715 |
+
}
|
| 716 |
+
let value = Array.isArray(val)
|
| 717 |
+
? val.map(function (v) { return maybeCoerceNumber(key, v); })
|
| 718 |
+
: maybeCoerceNumber(key, val);
|
| 719 |
+
// increment a count given as arg (either no value or value parsed as boolean)
|
| 720 |
+
if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) {
|
| 721 |
+
value = increment();
|
| 722 |
+
}
|
| 723 |
+
// Set normalized value when key is in 'normalize' and in 'arrays'
|
| 724 |
+
if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) {
|
| 725 |
+
if (Array.isArray(val))
|
| 726 |
+
value = val.map((val) => { return mixin.normalize(val); });
|
| 727 |
+
else
|
| 728 |
+
value = mixin.normalize(val);
|
| 729 |
+
}
|
| 730 |
+
return value;
|
| 731 |
+
}
|
| 732 |
+
function maybeCoerceNumber(key, value) {
|
| 733 |
+
if (!configuration['parse-positional-numbers'] && key === '_')
|
| 734 |
+
return value;
|
| 735 |
+
if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) {
|
| 736 |
+
const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`))));
|
| 737 |
+
if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) {
|
| 738 |
+
value = Number(value);
|
| 739 |
+
}
|
| 740 |
+
}
|
| 741 |
+
return value;
|
| 742 |
+
}
|
| 743 |
+
// set args from config.json file, this should be
|
| 744 |
+
// applied last so that defaults can be applied.
|
| 745 |
+
function setConfig(argv) {
|
| 746 |
+
const configLookup = Object.create(null);
|
| 747 |
+
// expand defaults/aliases, in-case any happen to reference
|
| 748 |
+
// the config.json file.
|
| 749 |
+
applyDefaultsAndAliases(configLookup, flags.aliases, defaults);
|
| 750 |
+
Object.keys(flags.configs).forEach(function (configKey) {
|
| 751 |
+
const configPath = argv[configKey] || configLookup[configKey];
|
| 752 |
+
if (configPath) {
|
| 753 |
+
try {
|
| 754 |
+
let config = null;
|
| 755 |
+
const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
|
| 756 |
+
const resolveConfig = flags.configs[configKey];
|
| 757 |
+
if (typeof resolveConfig === 'function') {
|
| 758 |
+
try {
|
| 759 |
+
config = resolveConfig(resolvedConfigPath);
|
| 760 |
+
}
|
| 761 |
+
catch (e) {
|
| 762 |
+
config = e;
|
| 763 |
+
}
|
| 764 |
+
if (config instanceof Error) {
|
| 765 |
+
error = config;
|
| 766 |
+
return;
|
| 767 |
+
}
|
| 768 |
+
}
|
| 769 |
+
else {
|
| 770 |
+
config = mixin.require(resolvedConfigPath);
|
| 771 |
+
}
|
| 772 |
+
setConfigObject(config);
|
| 773 |
+
}
|
| 774 |
+
catch (ex) {
|
| 775 |
+
// Deno will receive a PermissionDenied error if an attempt is
|
| 776 |
+
// made to load config without the --allow-read flag:
|
| 777 |
+
if (ex.name === 'PermissionDenied')
|
| 778 |
+
error = ex;
|
| 779 |
+
else if (argv[configKey])
|
| 780 |
+
error = Error(__('Invalid JSON config file: %s', configPath));
|
| 781 |
+
}
|
| 782 |
+
}
|
| 783 |
+
});
|
| 784 |
+
}
|
| 785 |
+
// set args from config object.
|
| 786 |
+
// it recursively checks nested objects.
|
| 787 |
+
function setConfigObject(config, prev) {
|
| 788 |
+
Object.keys(config).forEach(function (key) {
|
| 789 |
+
const value = config[key];
|
| 790 |
+
const fullKey = prev ? prev + '.' + key : key;
|
| 791 |
+
// if the value is an inner object and we have dot-notation
|
| 792 |
+
// enabled, treat inner objects in config the same as
|
| 793 |
+
// heavily nested dot notations (foo.bar.apple).
|
| 794 |
+
if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {
|
| 795 |
+
// if the value is an object but not an array, check nested object
|
| 796 |
+
setConfigObject(value, fullKey);
|
| 797 |
+
}
|
| 798 |
+
else {
|
| 799 |
+
// setting arguments via CLI takes precedence over
|
| 800 |
+
// values within the config file.
|
| 801 |
+
if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) {
|
| 802 |
+
setArg(fullKey, value);
|
| 803 |
+
}
|
| 804 |
+
}
|
| 805 |
+
});
|
| 806 |
+
}
|
| 807 |
+
// set all config objects passed in opts
|
| 808 |
+
function setConfigObjects() {
|
| 809 |
+
if (typeof configObjects !== 'undefined') {
|
| 810 |
+
configObjects.forEach(function (configObject) {
|
| 811 |
+
setConfigObject(configObject);
|
| 812 |
+
});
|
| 813 |
+
}
|
| 814 |
+
}
|
| 815 |
+
function applyEnvVars(argv, configOnly) {
|
| 816 |
+
if (typeof envPrefix === 'undefined')
|
| 817 |
+
return;
|
| 818 |
+
const prefix = typeof envPrefix === 'string' ? envPrefix : '';
|
| 819 |
+
const env = mixin.env();
|
| 820 |
+
Object.keys(env).forEach(function (envVar) {
|
| 821 |
+
if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) {
|
| 822 |
+
// get array of nested keys and convert them to camel case
|
| 823 |
+
const keys = envVar.split('__').map(function (key, i) {
|
| 824 |
+
if (i === 0) {
|
| 825 |
+
key = key.substring(prefix.length);
|
| 826 |
+
}
|
| 827 |
+
return camelCase(key);
|
| 828 |
+
});
|
| 829 |
+
if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) {
|
| 830 |
+
setArg(keys.join('.'), env[envVar]);
|
| 831 |
+
}
|
| 832 |
+
}
|
| 833 |
+
});
|
| 834 |
+
}
|
| 835 |
+
function applyCoercions(argv) {
|
| 836 |
+
let coerce;
|
| 837 |
+
const applied = new Set();
|
| 838 |
+
Object.keys(argv).forEach(function (key) {
|
| 839 |
+
if (!applied.has(key)) { // If we haven't already coerced this option via one of its aliases
|
| 840 |
+
coerce = checkAllAliases(key, flags.coercions);
|
| 841 |
+
if (typeof coerce === 'function') {
|
| 842 |
+
try {
|
| 843 |
+
const value = maybeCoerceNumber(key, coerce(argv[key]));
|
| 844 |
+
([].concat(flags.aliases[key] || [], key)).forEach(ali => {
|
| 845 |
+
applied.add(ali);
|
| 846 |
+
argv[ali] = value;
|
| 847 |
+
});
|
| 848 |
+
}
|
| 849 |
+
catch (err) {
|
| 850 |
+
error = err;
|
| 851 |
+
}
|
| 852 |
+
}
|
| 853 |
+
}
|
| 854 |
+
});
|
| 855 |
+
}
|
| 856 |
+
function setPlaceholderKeys(argv) {
|
| 857 |
+
flags.keys.forEach((key) => {
|
| 858 |
+
// don't set placeholder keys for dot notation options 'foo.bar'.
|
| 859 |
+
if (~key.indexOf('.'))
|
| 860 |
+
return;
|
| 861 |
+
if (typeof argv[key] === 'undefined')
|
| 862 |
+
argv[key] = undefined;
|
| 863 |
+
});
|
| 864 |
+
return argv;
|
| 865 |
+
}
|
| 866 |
+
function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) {
|
| 867 |
+
Object.keys(defaults).forEach(function (key) {
|
| 868 |
+
if (!hasKey(obj, key.split('.'))) {
|
| 869 |
+
setKey(obj, key.split('.'), defaults[key]);
|
| 870 |
+
if (canLog)
|
| 871 |
+
defaulted[key] = true;
|
| 872 |
+
(aliases[key] || []).forEach(function (x) {
|
| 873 |
+
if (hasKey(obj, x.split('.')))
|
| 874 |
+
return;
|
| 875 |
+
setKey(obj, x.split('.'), defaults[key]);
|
| 876 |
+
});
|
| 877 |
+
}
|
| 878 |
+
});
|
| 879 |
+
}
|
| 880 |
+
function hasKey(obj, keys) {
|
| 881 |
+
let o = obj;
|
| 882 |
+
if (!configuration['dot-notation'])
|
| 883 |
+
keys = [keys.join('.')];
|
| 884 |
+
keys.slice(0, -1).forEach(function (key) {
|
| 885 |
+
o = (o[key] || {});
|
| 886 |
+
});
|
| 887 |
+
const key = keys[keys.length - 1];
|
| 888 |
+
if (typeof o !== 'object')
|
| 889 |
+
return false;
|
| 890 |
+
else
|
| 891 |
+
return key in o;
|
| 892 |
+
}
|
| 893 |
+
function setKey(obj, keys, value) {
|
| 894 |
+
let o = obj;
|
| 895 |
+
if (!configuration['dot-notation'])
|
| 896 |
+
keys = [keys.join('.')];
|
| 897 |
+
keys.slice(0, -1).forEach(function (key) {
|
| 898 |
+
// TODO(bcoe): in the next major version of yargs, switch to
|
| 899 |
+
// Object.create(null) for dot notation:
|
| 900 |
+
key = sanitizeKey(key);
|
| 901 |
+
if (typeof o === 'object' && o[key] === undefined) {
|
| 902 |
+
o[key] = {};
|
| 903 |
+
}
|
| 904 |
+
if (typeof o[key] !== 'object' || Array.isArray(o[key])) {
|
| 905 |
+
// ensure that o[key] is an array, and that the last item is an empty object.
|
| 906 |
+
if (Array.isArray(o[key])) {
|
| 907 |
+
o[key].push({});
|
| 908 |
+
}
|
| 909 |
+
else {
|
| 910 |
+
o[key] = [o[key], {}];
|
| 911 |
+
}
|
| 912 |
+
// we want to update the empty object at the end of the o[key] array, so set o to that object
|
| 913 |
+
o = o[key][o[key].length - 1];
|
| 914 |
+
}
|
| 915 |
+
else {
|
| 916 |
+
o = o[key];
|
| 917 |
+
}
|
| 918 |
+
});
|
| 919 |
+
// TODO(bcoe): in the next major version of yargs, switch to
|
| 920 |
+
// Object.create(null) for dot notation:
|
| 921 |
+
const key = sanitizeKey(keys[keys.length - 1]);
|
| 922 |
+
const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays);
|
| 923 |
+
const isValueArray = Array.isArray(value);
|
| 924 |
+
let duplicate = configuration['duplicate-arguments-array'];
|
| 925 |
+
// nargs has higher priority than duplicate
|
| 926 |
+
if (!duplicate && checkAllAliases(key, flags.nargs)) {
|
| 927 |
+
duplicate = true;
|
| 928 |
+
if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) {
|
| 929 |
+
o[key] = undefined;
|
| 930 |
+
}
|
| 931 |
+
}
|
| 932 |
+
if (value === increment()) {
|
| 933 |
+
o[key] = increment(o[key]);
|
| 934 |
+
}
|
| 935 |
+
else if (Array.isArray(o[key])) {
|
| 936 |
+
if (duplicate && isTypeArray && isValueArray) {
|
| 937 |
+
o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]);
|
| 938 |
+
}
|
| 939 |
+
else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) {
|
| 940 |
+
o[key] = value;
|
| 941 |
+
}
|
| 942 |
+
else {
|
| 943 |
+
o[key] = o[key].concat([value]);
|
| 944 |
+
}
|
| 945 |
+
}
|
| 946 |
+
else if (o[key] === undefined && isTypeArray) {
|
| 947 |
+
o[key] = isValueArray ? value : [value];
|
| 948 |
+
}
|
| 949 |
+
else if (duplicate && !(o[key] === undefined ||
|
| 950 |
+
checkAllAliases(key, flags.counts) ||
|
| 951 |
+
checkAllAliases(key, flags.bools))) {
|
| 952 |
+
o[key] = [o[key], value];
|
| 953 |
+
}
|
| 954 |
+
else {
|
| 955 |
+
o[key] = value;
|
| 956 |
+
}
|
| 957 |
+
}
|
| 958 |
+
// extend the aliases list with inferred aliases.
|
| 959 |
+
function extendAliases(...args) {
|
| 960 |
+
args.forEach(function (obj) {
|
| 961 |
+
Object.keys(obj || {}).forEach(function (key) {
|
| 962 |
+
// short-circuit if we've already added a key
|
| 963 |
+
// to the aliases array, for example it might
|
| 964 |
+
// exist in both 'opts.default' and 'opts.key'.
|
| 965 |
+
if (flags.aliases[key])
|
| 966 |
+
return;
|
| 967 |
+
flags.aliases[key] = [].concat(aliases[key] || []);
|
| 968 |
+
// For "--option-name", also set argv.optionName
|
| 969 |
+
flags.aliases[key].concat(key).forEach(function (x) {
|
| 970 |
+
if (/-/.test(x) && configuration['camel-case-expansion']) {
|
| 971 |
+
const c = camelCase(x);
|
| 972 |
+
if (c !== key && flags.aliases[key].indexOf(c) === -1) {
|
| 973 |
+
flags.aliases[key].push(c);
|
| 974 |
+
newAliases[c] = true;
|
| 975 |
+
}
|
| 976 |
+
}
|
| 977 |
+
});
|
| 978 |
+
// For "--optionName", also set argv['option-name']
|
| 979 |
+
flags.aliases[key].concat(key).forEach(function (x) {
|
| 980 |
+
if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) {
|
| 981 |
+
const c = decamelize(x, '-');
|
| 982 |
+
if (c !== key && flags.aliases[key].indexOf(c) === -1) {
|
| 983 |
+
flags.aliases[key].push(c);
|
| 984 |
+
newAliases[c] = true;
|
| 985 |
+
}
|
| 986 |
+
}
|
| 987 |
+
});
|
| 988 |
+
flags.aliases[key].forEach(function (x) {
|
| 989 |
+
flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) {
|
| 990 |
+
return x !== y;
|
| 991 |
+
}));
|
| 992 |
+
});
|
| 993 |
+
});
|
| 994 |
+
});
|
| 995 |
+
}
|
| 996 |
+
function checkAllAliases(key, flag) {
|
| 997 |
+
const toCheck = [].concat(flags.aliases[key] || [], key);
|
| 998 |
+
const keys = Object.keys(flag);
|
| 999 |
+
const setAlias = toCheck.find(key => keys.includes(key));
|
| 1000 |
+
return setAlias ? flag[setAlias] : false;
|
| 1001 |
+
}
|
| 1002 |
+
function hasAnyFlag(key) {
|
| 1003 |
+
const flagsKeys = Object.keys(flags);
|
| 1004 |
+
const toCheck = [].concat(flagsKeys.map(k => flags[k]));
|
| 1005 |
+
return toCheck.some(function (flag) {
|
| 1006 |
+
return Array.isArray(flag) ? flag.includes(key) : flag[key];
|
| 1007 |
+
});
|
| 1008 |
+
}
|
| 1009 |
+
function hasFlagsMatching(arg, ...patterns) {
|
| 1010 |
+
const toCheck = [].concat(...patterns);
|
| 1011 |
+
return toCheck.some(function (pattern) {
|
| 1012 |
+
const match = arg.match(pattern);
|
| 1013 |
+
return match && hasAnyFlag(match[1]);
|
| 1014 |
+
});
|
| 1015 |
+
}
|
| 1016 |
+
// based on a simplified version of the short flag group parsing logic
|
| 1017 |
+
function hasAllShortFlags(arg) {
|
| 1018 |
+
// if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group
|
| 1019 |
+
if (arg.match(negative) || !arg.match(/^-[^-]+/)) {
|
| 1020 |
+
return false;
|
| 1021 |
+
}
|
| 1022 |
+
let hasAllFlags = true;
|
| 1023 |
+
let next;
|
| 1024 |
+
const letters = arg.slice(1).split('');
|
| 1025 |
+
for (let j = 0; j < letters.length; j++) {
|
| 1026 |
+
next = arg.slice(j + 2);
|
| 1027 |
+
if (!hasAnyFlag(letters[j])) {
|
| 1028 |
+
hasAllFlags = false;
|
| 1029 |
+
break;
|
| 1030 |
+
}
|
| 1031 |
+
if ((letters[j + 1] && letters[j + 1] === '=') ||
|
| 1032 |
+
next === '-' ||
|
| 1033 |
+
(/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) ||
|
| 1034 |
+
(letters[j + 1] && letters[j + 1].match(/\W/))) {
|
| 1035 |
+
break;
|
| 1036 |
+
}
|
| 1037 |
+
}
|
| 1038 |
+
return hasAllFlags;
|
| 1039 |
+
}
|
| 1040 |
+
function isUnknownOptionAsArg(arg) {
|
| 1041 |
+
return configuration['unknown-options-as-args'] && isUnknownOption(arg);
|
| 1042 |
+
}
|
| 1043 |
+
function isUnknownOption(arg) {
|
| 1044 |
+
arg = arg.replace(/^-{3,}/, '--');
|
| 1045 |
+
// ignore negative numbers
|
| 1046 |
+
if (arg.match(negative)) {
|
| 1047 |
+
return false;
|
| 1048 |
+
}
|
| 1049 |
+
// if this is a short option group and all of them are configured, it isn't unknown
|
| 1050 |
+
if (hasAllShortFlags(arg)) {
|
| 1051 |
+
return false;
|
| 1052 |
+
}
|
| 1053 |
+
// e.g. '--count=2'
|
| 1054 |
+
const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/;
|
| 1055 |
+
// e.g. '-a' or '--arg'
|
| 1056 |
+
const normalFlag = /^-+([^=]+?)$/;
|
| 1057 |
+
// e.g. '-a-'
|
| 1058 |
+
const flagEndingInHyphen = /^-+([^=]+?)-$/;
|
| 1059 |
+
// e.g. '-abc123'
|
| 1060 |
+
const flagEndingInDigits = /^-+([^=]+?\d+)$/;
|
| 1061 |
+
// e.g. '-a/usr/local'
|
| 1062 |
+
const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/;
|
| 1063 |
+
// check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method
|
| 1064 |
+
return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters);
|
| 1065 |
+
}
|
| 1066 |
+
// make a best effort to pick a default value
|
| 1067 |
+
// for an option based on name and type.
|
| 1068 |
+
function defaultValue(key) {
|
| 1069 |
+
if (!checkAllAliases(key, flags.bools) &&
|
| 1070 |
+
!checkAllAliases(key, flags.counts) &&
|
| 1071 |
+
`${key}` in defaults) {
|
| 1072 |
+
return defaults[key];
|
| 1073 |
+
}
|
| 1074 |
+
else {
|
| 1075 |
+
return defaultForType(guessType(key));
|
| 1076 |
+
}
|
| 1077 |
+
}
|
| 1078 |
+
// return a default value, given the type of a flag.,
|
| 1079 |
+
function defaultForType(type) {
|
| 1080 |
+
const def = {
|
| 1081 |
+
[DefaultValuesForTypeKey.BOOLEAN]: true,
|
| 1082 |
+
[DefaultValuesForTypeKey.STRING]: '',
|
| 1083 |
+
[DefaultValuesForTypeKey.NUMBER]: undefined,
|
| 1084 |
+
[DefaultValuesForTypeKey.ARRAY]: []
|
| 1085 |
+
};
|
| 1086 |
+
return def[type];
|
| 1087 |
+
}
|
| 1088 |
+
// given a flag, enforce a default type.
|
| 1089 |
+
function guessType(key) {
|
| 1090 |
+
let type = DefaultValuesForTypeKey.BOOLEAN;
|
| 1091 |
+
if (checkAllAliases(key, flags.strings))
|
| 1092 |
+
type = DefaultValuesForTypeKey.STRING;
|
| 1093 |
+
else if (checkAllAliases(key, flags.numbers))
|
| 1094 |
+
type = DefaultValuesForTypeKey.NUMBER;
|
| 1095 |
+
else if (checkAllAliases(key, flags.bools))
|
| 1096 |
+
type = DefaultValuesForTypeKey.BOOLEAN;
|
| 1097 |
+
else if (checkAllAliases(key, flags.arrays))
|
| 1098 |
+
type = DefaultValuesForTypeKey.ARRAY;
|
| 1099 |
+
return type;
|
| 1100 |
+
}
|
| 1101 |
+
function isUndefined(num) {
|
| 1102 |
+
return num === undefined;
|
| 1103 |
+
}
|
| 1104 |
+
// check user configuration settings for inconsistencies
|
| 1105 |
+
function checkConfiguration() {
|
| 1106 |
+
// count keys should not be set as array/narg
|
| 1107 |
+
Object.keys(flags.counts).find(key => {
|
| 1108 |
+
if (checkAllAliases(key, flags.arrays)) {
|
| 1109 |
+
error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key));
|
| 1110 |
+
return true;
|
| 1111 |
+
}
|
| 1112 |
+
else if (checkAllAliases(key, flags.nargs)) {
|
| 1113 |
+
error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key));
|
| 1114 |
+
return true;
|
| 1115 |
+
}
|
| 1116 |
+
return false;
|
| 1117 |
+
});
|
| 1118 |
+
}
|
| 1119 |
+
return {
|
| 1120 |
+
aliases: Object.assign({}, flags.aliases),
|
| 1121 |
+
argv: Object.assign(argvReturn, argv),
|
| 1122 |
+
configuration: configuration,
|
| 1123 |
+
defaulted: Object.assign({}, defaulted),
|
| 1124 |
+
error: error,
|
| 1125 |
+
newAliases: Object.assign({}, newAliases)
|
| 1126 |
+
};
|
| 1127 |
+
}
|
| 1128 |
+
}
|
| 1129 |
+
// if any aliases reference each other, we should
|
| 1130 |
+
// merge them together.
|
| 1131 |
+
function combineAliases(aliases) {
|
| 1132 |
+
const aliasArrays = [];
|
| 1133 |
+
const combined = Object.create(null);
|
| 1134 |
+
let change = true;
|
| 1135 |
+
// turn alias lookup hash {key: ['alias1', 'alias2']} into
|
| 1136 |
+
// a simple array ['key', 'alias1', 'alias2']
|
| 1137 |
+
Object.keys(aliases).forEach(function (key) {
|
| 1138 |
+
aliasArrays.push([].concat(aliases[key], key));
|
| 1139 |
+
});
|
| 1140 |
+
// combine arrays until zero changes are
|
| 1141 |
+
// made in an iteration.
|
| 1142 |
+
while (change) {
|
| 1143 |
+
change = false;
|
| 1144 |
+
for (let i = 0; i < aliasArrays.length; i++) {
|
| 1145 |
+
for (let ii = i + 1; ii < aliasArrays.length; ii++) {
|
| 1146 |
+
const intersect = aliasArrays[i].filter(function (v) {
|
| 1147 |
+
return aliasArrays[ii].indexOf(v) !== -1;
|
| 1148 |
+
});
|
| 1149 |
+
if (intersect.length) {
|
| 1150 |
+
aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]);
|
| 1151 |
+
aliasArrays.splice(ii, 1);
|
| 1152 |
+
change = true;
|
| 1153 |
+
break;
|
| 1154 |
+
}
|
| 1155 |
+
}
|
| 1156 |
+
}
|
| 1157 |
+
}
|
| 1158 |
+
// map arrays back to the hash-lookup (de-dupe while
|
| 1159 |
+
// we're at it).
|
| 1160 |
+
aliasArrays.forEach(function (aliasArray) {
|
| 1161 |
+
aliasArray = aliasArray.filter(function (v, i, self) {
|
| 1162 |
+
return self.indexOf(v) === i;
|
| 1163 |
+
});
|
| 1164 |
+
const lastAlias = aliasArray.pop();
|
| 1165 |
+
if (lastAlias !== undefined && typeof lastAlias === 'string') {
|
| 1166 |
+
combined[lastAlias] = aliasArray;
|
| 1167 |
+
}
|
| 1168 |
+
});
|
| 1169 |
+
return combined;
|
| 1170 |
+
}
|
| 1171 |
+
// this function should only be called when a count is given as an arg
|
| 1172 |
+
// it is NOT called to set a default value
|
| 1173 |
+
// thus we can start the count at 1 instead of 0
|
| 1174 |
+
function increment(orig) {
|
| 1175 |
+
return orig !== undefined ? orig + 1 : 1;
|
| 1176 |
+
}
|
| 1177 |
+
// TODO(bcoe): in the next major version of yargs, switch to
|
| 1178 |
+
// Object.create(null) for dot notation:
|
| 1179 |
+
function sanitizeKey(key) {
|
| 1180 |
+
if (key === '__proto__')
|
| 1181 |
+
return '___proto___';
|
| 1182 |
+
return key;
|
| 1183 |
+
}
|
| 1184 |
+
function stripQuotes(val) {
|
| 1185 |
+
return (typeof val === 'string' &&
|
| 1186 |
+
(val[0] === "'" || val[0] === '"') &&
|
| 1187 |
+
val[val.length - 1] === val[0])
|
| 1188 |
+
? val.substring(1, val.length - 1)
|
| 1189 |
+
: val;
|
| 1190 |
+
}
|
| 1191 |
+
|
| 1192 |
+
/**
|
| 1193 |
+
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
| 1194 |
+
* CJS and ESM environments.
|
| 1195 |
+
*
|
| 1196 |
+
* @license
|
| 1197 |
+
* Copyright (c) 2016, Contributors
|
| 1198 |
+
* SPDX-License-Identifier: ISC
|
| 1199 |
+
*/
|
| 1200 |
+
var _a, _b, _c;
|
| 1201 |
+
// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our
|
| 1202 |
+
// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only.
|
| 1203 |
+
const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
|
| 1204 |
+
? Number(process.env.YARGS_MIN_NODE_VERSION)
|
| 1205 |
+
: 12;
|
| 1206 |
+
const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
|
| 1207 |
+
if (nodeVersion) {
|
| 1208 |
+
const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
|
| 1209 |
+
if (major < minNodeVersion) {
|
| 1210 |
+
throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
| 1211 |
+
}
|
| 1212 |
+
}
|
| 1213 |
+
// Creates a yargs-parser instance using Node.js standard libraries:
|
| 1214 |
+
const env = process ? process.env : {};
|
| 1215 |
+
const parser = new YargsParser({
|
| 1216 |
+
cwd: process.cwd,
|
| 1217 |
+
env: () => {
|
| 1218 |
+
return env;
|
| 1219 |
+
},
|
| 1220 |
+
format: require$$2.format,
|
| 1221 |
+
normalize: require$$0.normalize,
|
| 1222 |
+
resolve: require$$0.resolve,
|
| 1223 |
+
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
| 1224 |
+
// we can exercise all the lines below:
|
| 1225 |
+
require: (path) => {
|
| 1226 |
+
if (typeof require !== 'undefined') {
|
| 1227 |
+
return require(path);
|
| 1228 |
+
}
|
| 1229 |
+
else if (path.match(/\.json$/)) {
|
| 1230 |
+
// Addresses: https://github.com/yargs/yargs/issues/2040
|
| 1231 |
+
return JSON.parse(require$$0$1.readFileSync(path, 'utf8'));
|
| 1232 |
+
}
|
| 1233 |
+
else {
|
| 1234 |
+
throw Error('only .json config files are supported in ESM');
|
| 1235 |
+
}
|
| 1236 |
+
}
|
| 1237 |
+
});
|
| 1238 |
+
const yargsParser = function Parser(args, opts) {
|
| 1239 |
+
const result = parser.parse(args.slice(), opts);
|
| 1240 |
+
return result.argv;
|
| 1241 |
+
};
|
| 1242 |
+
yargsParser.detailed = function (args, opts) {
|
| 1243 |
+
return parser.parse(args.slice(), opts);
|
| 1244 |
+
};
|
| 1245 |
+
yargsParser.camelCase = camelCase;
|
| 1246 |
+
yargsParser.decamelize = decamelize;
|
| 1247 |
+
yargsParser.looksLikeNumber = looksLikeNumber;
|
| 1248 |
+
|
| 1249 |
+
/******************************************************************************
|
| 1250 |
+
Copyright (c) Microsoft Corporation.
|
| 1251 |
+
|
| 1252 |
+
Permission to use, copy, modify, and/or distribute this software for any
|
| 1253 |
+
purpose with or without fee is hereby granted.
|
| 1254 |
+
|
| 1255 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
| 1256 |
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
| 1257 |
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
| 1258 |
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
| 1259 |
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
| 1260 |
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
| 1261 |
+
PERFORMANCE OF THIS SOFTWARE.
|
| 1262 |
+
***************************************************************************** */
|
| 1263 |
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
| 1264 |
+
|
| 1265 |
+
|
| 1266 |
+
function __addDisposableResource(env, value, async) {
|
| 1267 |
+
if (value !== null && value !== void 0) {
|
| 1268 |
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
| 1269 |
+
var dispose, inner;
|
| 1270 |
+
if (async) {
|
| 1271 |
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
| 1272 |
+
dispose = value[Symbol.asyncDispose];
|
| 1273 |
+
}
|
| 1274 |
+
if (dispose === void 0) {
|
| 1275 |
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
| 1276 |
+
dispose = value[Symbol.dispose];
|
| 1277 |
+
if (async) inner = dispose;
|
| 1278 |
+
}
|
| 1279 |
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
| 1280 |
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
| 1281 |
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
| 1282 |
+
}
|
| 1283 |
+
else if (async) {
|
| 1284 |
+
env.stack.push({ async: true });
|
| 1285 |
+
}
|
| 1286 |
+
return value;
|
| 1287 |
+
|
| 1288 |
+
}
|
| 1289 |
+
|
| 1290 |
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
| 1291 |
+
var e = new Error(message);
|
| 1292 |
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
| 1293 |
+
};
|
| 1294 |
+
|
| 1295 |
+
function __disposeResources(env) {
|
| 1296 |
+
function fail(e) {
|
| 1297 |
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
| 1298 |
+
env.hasError = true;
|
| 1299 |
+
}
|
| 1300 |
+
var r, s = 0;
|
| 1301 |
+
function next() {
|
| 1302 |
+
while (r = env.stack.pop()) {
|
| 1303 |
+
try {
|
| 1304 |
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
| 1305 |
+
if (r.dispose) {
|
| 1306 |
+
var result = r.dispose.call(r.value);
|
| 1307 |
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
| 1308 |
+
}
|
| 1309 |
+
else s |= 1;
|
| 1310 |
+
}
|
| 1311 |
+
catch (e) {
|
| 1312 |
+
fail(e);
|
| 1313 |
+
}
|
| 1314 |
+
}
|
| 1315 |
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
| 1316 |
+
if (env.hasError) throw env.error;
|
| 1317 |
+
}
|
| 1318 |
+
return next();
|
| 1319 |
+
}
|
| 1320 |
+
|
| 1321 |
+
const toZeroIfInfinity = value => Number.isFinite(value) ? value : 0;
|
| 1322 |
+
|
| 1323 |
+
function parseNumber(milliseconds) {
|
| 1324 |
+
return {
|
| 1325 |
+
days: Math.trunc(milliseconds / 86_400_000),
|
| 1326 |
+
hours: Math.trunc(milliseconds / 3_600_000 % 24),
|
| 1327 |
+
minutes: Math.trunc(milliseconds / 60_000 % 60),
|
| 1328 |
+
seconds: Math.trunc(milliseconds / 1000 % 60),
|
| 1329 |
+
milliseconds: Math.trunc(milliseconds % 1000),
|
| 1330 |
+
microseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1000) % 1000),
|
| 1331 |
+
nanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1000),
|
| 1332 |
+
};
|
| 1333 |
+
}
|
| 1334 |
+
|
| 1335 |
+
function parseBigint(milliseconds) {
|
| 1336 |
+
return {
|
| 1337 |
+
days: milliseconds / 86_400_000n,
|
| 1338 |
+
hours: milliseconds / 3_600_000n % 24n,
|
| 1339 |
+
minutes: milliseconds / 60_000n % 60n,
|
| 1340 |
+
seconds: milliseconds / 1000n % 60n,
|
| 1341 |
+
milliseconds: milliseconds % 1000n,
|
| 1342 |
+
microseconds: 0n,
|
| 1343 |
+
nanoseconds: 0n,
|
| 1344 |
+
};
|
| 1345 |
+
}
|
| 1346 |
+
|
| 1347 |
+
function parseMilliseconds(milliseconds) {
|
| 1348 |
+
switch (typeof milliseconds) {
|
| 1349 |
+
case 'number': {
|
| 1350 |
+
if (Number.isFinite(milliseconds)) {
|
| 1351 |
+
return parseNumber(milliseconds);
|
| 1352 |
+
}
|
| 1353 |
+
|
| 1354 |
+
break;
|
| 1355 |
+
}
|
| 1356 |
+
|
| 1357 |
+
case 'bigint': {
|
| 1358 |
+
return parseBigint(milliseconds);
|
| 1359 |
+
}
|
| 1360 |
+
|
| 1361 |
+
// No default
|
| 1362 |
+
}
|
| 1363 |
+
|
| 1364 |
+
throw new TypeError('Expected a finite number or bigint');
|
| 1365 |
+
}
|
| 1366 |
+
|
| 1367 |
+
const isZero = value => value === 0 || value === 0n;
|
| 1368 |
+
const pluralize = (word, count) => (count === 1 || count === 1n) ? word : `${word}s`;
|
| 1369 |
+
|
| 1370 |
+
const SECOND_ROUNDING_EPSILON = 0.000_000_1;
|
| 1371 |
+
const ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n;
|
| 1372 |
+
|
| 1373 |
+
function prettyMilliseconds(milliseconds, options) {
|
| 1374 |
+
const isBigInt = typeof milliseconds === 'bigint';
|
| 1375 |
+
if (!isBigInt && !Number.isFinite(milliseconds)) {
|
| 1376 |
+
throw new TypeError('Expected a finite number or bigint');
|
| 1377 |
+
}
|
| 1378 |
+
|
| 1379 |
+
options = {...options};
|
| 1380 |
+
|
| 1381 |
+
const sign = milliseconds < 0 ? '-' : '';
|
| 1382 |
+
milliseconds = milliseconds < 0 ? -milliseconds : milliseconds; // Cannot use `Math.abs()` because of BigInt support.
|
| 1383 |
+
|
| 1384 |
+
if (options.colonNotation) {
|
| 1385 |
+
options.compact = false;
|
| 1386 |
+
options.formatSubMilliseconds = false;
|
| 1387 |
+
options.separateMilliseconds = false;
|
| 1388 |
+
options.verbose = false;
|
| 1389 |
+
}
|
| 1390 |
+
|
| 1391 |
+
if (options.compact) {
|
| 1392 |
+
options.unitCount = 1;
|
| 1393 |
+
options.secondsDecimalDigits = 0;
|
| 1394 |
+
options.millisecondsDecimalDigits = 0;
|
| 1395 |
+
}
|
| 1396 |
+
|
| 1397 |
+
let result = [];
|
| 1398 |
+
|
| 1399 |
+
const floorDecimals = (value, decimalDigits) => {
|
| 1400 |
+
const flooredInterimValue = Math.floor((value * (10 ** decimalDigits)) + SECOND_ROUNDING_EPSILON);
|
| 1401 |
+
const flooredValue = Math.round(flooredInterimValue) / (10 ** decimalDigits);
|
| 1402 |
+
return flooredValue.toFixed(decimalDigits);
|
| 1403 |
+
};
|
| 1404 |
+
|
| 1405 |
+
const add = (value, long, short, valueString) => {
|
| 1406 |
+
if (
|
| 1407 |
+
(result.length === 0 || !options.colonNotation)
|
| 1408 |
+
&& isZero(value)
|
| 1409 |
+
&& !(options.colonNotation && short === 'm')) {
|
| 1410 |
+
return;
|
| 1411 |
+
}
|
| 1412 |
+
|
| 1413 |
+
valueString ??= String(value);
|
| 1414 |
+
if (options.colonNotation) {
|
| 1415 |
+
const wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length;
|
| 1416 |
+
const minLength = result.length > 0 ? 2 : 1;
|
| 1417 |
+
valueString = '0'.repeat(Math.max(0, minLength - wholeDigits)) + valueString;
|
| 1418 |
+
} else {
|
| 1419 |
+
valueString += options.verbose ? ' ' + pluralize(long, value) : short;
|
| 1420 |
+
}
|
| 1421 |
+
|
| 1422 |
+
result.push(valueString);
|
| 1423 |
+
};
|
| 1424 |
+
|
| 1425 |
+
const parsed = parseMilliseconds(milliseconds);
|
| 1426 |
+
const days = BigInt(parsed.days);
|
| 1427 |
+
|
| 1428 |
+
if (options.hideYearAndDays) {
|
| 1429 |
+
add((BigInt(days) * 24n) + BigInt(parsed.hours), 'hour', 'h');
|
| 1430 |
+
} else {
|
| 1431 |
+
if (options.hideYear) {
|
| 1432 |
+
add(days, 'day', 'd');
|
| 1433 |
+
} else {
|
| 1434 |
+
add(days / 365n, 'year', 'y');
|
| 1435 |
+
add(days % 365n, 'day', 'd');
|
| 1436 |
+
}
|
| 1437 |
+
|
| 1438 |
+
add(Number(parsed.hours), 'hour', 'h');
|
| 1439 |
+
}
|
| 1440 |
+
|
| 1441 |
+
add(Number(parsed.minutes), 'minute', 'm');
|
| 1442 |
+
|
| 1443 |
+
if (!options.hideSeconds) {
|
| 1444 |
+
if (
|
| 1445 |
+
options.separateMilliseconds
|
| 1446 |
+
|| options.formatSubMilliseconds
|
| 1447 |
+
|| (!options.colonNotation && milliseconds < 1000 && !options.subSecondsAsDecimals)
|
| 1448 |
+
) {
|
| 1449 |
+
const seconds = Number(parsed.seconds);
|
| 1450 |
+
const milliseconds = Number(parsed.milliseconds);
|
| 1451 |
+
const microseconds = Number(parsed.microseconds);
|
| 1452 |
+
const nanoseconds = Number(parsed.nanoseconds);
|
| 1453 |
+
|
| 1454 |
+
add(seconds, 'second', 's');
|
| 1455 |
+
|
| 1456 |
+
if (options.formatSubMilliseconds) {
|
| 1457 |
+
add(milliseconds, 'millisecond', 'ms');
|
| 1458 |
+
add(microseconds, 'microsecond', 'µs');
|
| 1459 |
+
add(nanoseconds, 'nanosecond', 'ns');
|
| 1460 |
+
} else {
|
| 1461 |
+
const millisecondsAndBelow
|
| 1462 |
+
= milliseconds
|
| 1463 |
+
+ (microseconds / 1000)
|
| 1464 |
+
+ (nanoseconds / 1e6);
|
| 1465 |
+
|
| 1466 |
+
const millisecondsDecimalDigits
|
| 1467 |
+
= typeof options.millisecondsDecimalDigits === 'number'
|
| 1468 |
+
? options.millisecondsDecimalDigits
|
| 1469 |
+
: 0;
|
| 1470 |
+
|
| 1471 |
+
const roundedMilliseconds = millisecondsAndBelow >= 1
|
| 1472 |
+
? Math.round(millisecondsAndBelow)
|
| 1473 |
+
: Math.ceil(millisecondsAndBelow);
|
| 1474 |
+
|
| 1475 |
+
const millisecondsString = millisecondsDecimalDigits
|
| 1476 |
+
? millisecondsAndBelow.toFixed(millisecondsDecimalDigits)
|
| 1477 |
+
: roundedMilliseconds;
|
| 1478 |
+
|
| 1479 |
+
add(
|
| 1480 |
+
Number.parseFloat(millisecondsString),
|
| 1481 |
+
'millisecond',
|
| 1482 |
+
'ms',
|
| 1483 |
+
millisecondsString,
|
| 1484 |
+
);
|
| 1485 |
+
}
|
| 1486 |
+
} else {
|
| 1487 |
+
const seconds = (
|
| 1488 |
+
(isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds)
|
| 1489 |
+
/ 1000
|
| 1490 |
+
) % 60;
|
| 1491 |
+
const secondsDecimalDigits
|
| 1492 |
+
= typeof options.secondsDecimalDigits === 'number'
|
| 1493 |
+
? options.secondsDecimalDigits
|
| 1494 |
+
: 1;
|
| 1495 |
+
const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
|
| 1496 |
+
const secondsString = options.keepDecimalsOnWholeSeconds
|
| 1497 |
+
? secondsFixed
|
| 1498 |
+
: secondsFixed.replace(/\.0+$/, '');
|
| 1499 |
+
add(Number.parseFloat(secondsString), 'second', 's', secondsString);
|
| 1500 |
+
}
|
| 1501 |
+
}
|
| 1502 |
+
|
| 1503 |
+
if (result.length === 0) {
|
| 1504 |
+
return sign + '0' + (options.verbose ? ' milliseconds' : 'ms');
|
| 1505 |
+
}
|
| 1506 |
+
|
| 1507 |
+
const separator = options.colonNotation ? ':' : ' ';
|
| 1508 |
+
if (typeof options.unitCount === 'number') {
|
| 1509 |
+
result = result.slice(0, Math.max(options.unitCount, 1));
|
| 1510 |
+
}
|
| 1511 |
+
|
| 1512 |
+
return sign + result.join(separator);
|
| 1513 |
+
}
|
| 1514 |
+
|
| 1515 |
+
const BYTE_UNITS = [
|
| 1516 |
+
'B',
|
| 1517 |
+
'kB',
|
| 1518 |
+
'MB',
|
| 1519 |
+
'GB',
|
| 1520 |
+
'TB',
|
| 1521 |
+
'PB',
|
| 1522 |
+
'EB',
|
| 1523 |
+
'ZB',
|
| 1524 |
+
'YB',
|
| 1525 |
+
];
|
| 1526 |
+
|
| 1527 |
+
const BIBYTE_UNITS = [
|
| 1528 |
+
'B',
|
| 1529 |
+
'KiB',
|
| 1530 |
+
'MiB',
|
| 1531 |
+
'GiB',
|
| 1532 |
+
'TiB',
|
| 1533 |
+
'PiB',
|
| 1534 |
+
'EiB',
|
| 1535 |
+
'ZiB',
|
| 1536 |
+
'YiB',
|
| 1537 |
+
];
|
| 1538 |
+
|
| 1539 |
+
const BIT_UNITS = [
|
| 1540 |
+
'b',
|
| 1541 |
+
'kbit',
|
| 1542 |
+
'Mbit',
|
| 1543 |
+
'Gbit',
|
| 1544 |
+
'Tbit',
|
| 1545 |
+
'Pbit',
|
| 1546 |
+
'Ebit',
|
| 1547 |
+
'Zbit',
|
| 1548 |
+
'Ybit',
|
| 1549 |
+
];
|
| 1550 |
+
|
| 1551 |
+
const BIBIT_UNITS = [
|
| 1552 |
+
'b',
|
| 1553 |
+
'kibit',
|
| 1554 |
+
'Mibit',
|
| 1555 |
+
'Gibit',
|
| 1556 |
+
'Tibit',
|
| 1557 |
+
'Pibit',
|
| 1558 |
+
'Eibit',
|
| 1559 |
+
'Zibit',
|
| 1560 |
+
'Yibit',
|
| 1561 |
+
];
|
| 1562 |
+
|
| 1563 |
+
/*
|
| 1564 |
+
Formats the given number using `Number#toLocaleString`.
|
| 1565 |
+
- If locale is a string, the value is expected to be a locale-key (for example: `de`).
|
| 1566 |
+
- If locale is true, the system default locale is used for translation.
|
| 1567 |
+
- If no value for locale is specified, the number is returned unmodified.
|
| 1568 |
+
*/
|
| 1569 |
+
const toLocaleString = (number, locale, options) => {
|
| 1570 |
+
let result = number;
|
| 1571 |
+
if (typeof locale === 'string' || Array.isArray(locale)) {
|
| 1572 |
+
result = number.toLocaleString(locale, options);
|
| 1573 |
+
} else if (locale === true || options !== undefined) {
|
| 1574 |
+
result = number.toLocaleString(undefined, options);
|
| 1575 |
+
}
|
| 1576 |
+
|
| 1577 |
+
return result;
|
| 1578 |
+
};
|
| 1579 |
+
|
| 1580 |
+
const log10 = numberOrBigInt => {
|
| 1581 |
+
if (typeof numberOrBigInt === 'number') {
|
| 1582 |
+
return Math.log10(numberOrBigInt);
|
| 1583 |
+
}
|
| 1584 |
+
|
| 1585 |
+
const string = numberOrBigInt.toString(10);
|
| 1586 |
+
|
| 1587 |
+
return string.length + Math.log10(`0.${string.slice(0, 15)}`);
|
| 1588 |
+
};
|
| 1589 |
+
|
| 1590 |
+
const log = numberOrBigInt => {
|
| 1591 |
+
if (typeof numberOrBigInt === 'number') {
|
| 1592 |
+
return Math.log(numberOrBigInt);
|
| 1593 |
+
}
|
| 1594 |
+
|
| 1595 |
+
return log10(numberOrBigInt) * Math.log(10);
|
| 1596 |
+
};
|
| 1597 |
+
|
| 1598 |
+
const divide = (numberOrBigInt, divisor) => {
|
| 1599 |
+
if (typeof numberOrBigInt === 'number') {
|
| 1600 |
+
return numberOrBigInt / divisor;
|
| 1601 |
+
}
|
| 1602 |
+
|
| 1603 |
+
const integerPart = numberOrBigInt / BigInt(divisor);
|
| 1604 |
+
const remainder = numberOrBigInt % BigInt(divisor);
|
| 1605 |
+
return Number(integerPart) + (Number(remainder) / divisor);
|
| 1606 |
+
};
|
| 1607 |
+
|
| 1608 |
+
const applyFixedWidth = (result, fixedWidth) => {
|
| 1609 |
+
if (fixedWidth === undefined) {
|
| 1610 |
+
return result;
|
| 1611 |
+
}
|
| 1612 |
+
|
| 1613 |
+
if (typeof fixedWidth !== 'number' || !Number.isSafeInteger(fixedWidth) || fixedWidth < 0) {
|
| 1614 |
+
throw new TypeError(`Expected fixedWidth to be a non-negative integer, got ${typeof fixedWidth}: ${fixedWidth}`);
|
| 1615 |
+
}
|
| 1616 |
+
|
| 1617 |
+
if (fixedWidth === 0) {
|
| 1618 |
+
return result;
|
| 1619 |
+
}
|
| 1620 |
+
|
| 1621 |
+
return result.length < fixedWidth ? result.padStart(fixedWidth, ' ') : result;
|
| 1622 |
+
};
|
| 1623 |
+
|
| 1624 |
+
const buildLocaleOptions = options => {
|
| 1625 |
+
const {minimumFractionDigits, maximumFractionDigits} = options;
|
| 1626 |
+
|
| 1627 |
+
if (minimumFractionDigits === undefined && maximumFractionDigits === undefined) {
|
| 1628 |
+
return undefined;
|
| 1629 |
+
}
|
| 1630 |
+
|
| 1631 |
+
return {
|
| 1632 |
+
...(minimumFractionDigits !== undefined && {minimumFractionDigits}),
|
| 1633 |
+
...(maximumFractionDigits !== undefined && {maximumFractionDigits}),
|
| 1634 |
+
roundingMode: 'trunc',
|
| 1635 |
+
};
|
| 1636 |
+
};
|
| 1637 |
+
|
| 1638 |
+
function prettyBytes(number, options) {
|
| 1639 |
+
if (typeof number !== 'bigint' && !Number.isFinite(number)) {
|
| 1640 |
+
throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
|
| 1641 |
+
}
|
| 1642 |
+
|
| 1643 |
+
options = {
|
| 1644 |
+
bits: false,
|
| 1645 |
+
binary: false,
|
| 1646 |
+
space: true,
|
| 1647 |
+
nonBreakingSpace: false,
|
| 1648 |
+
...options,
|
| 1649 |
+
};
|
| 1650 |
+
|
| 1651 |
+
const UNITS = options.bits
|
| 1652 |
+
? (options.binary ? BIBIT_UNITS : BIT_UNITS)
|
| 1653 |
+
: (options.binary ? BIBYTE_UNITS : BYTE_UNITS);
|
| 1654 |
+
|
| 1655 |
+
const separator = options.space ? (options.nonBreakingSpace ? '\u00A0' : ' ') : '';
|
| 1656 |
+
|
| 1657 |
+
// Handle signed zero case
|
| 1658 |
+
const isZero = typeof number === 'number' ? number === 0 : number === 0n;
|
| 1659 |
+
if (options.signed && isZero) {
|
| 1660 |
+
const result = ` 0${separator}${UNITS[0]}`;
|
| 1661 |
+
return applyFixedWidth(result, options.fixedWidth);
|
| 1662 |
+
}
|
| 1663 |
+
|
| 1664 |
+
const isNegative = number < 0;
|
| 1665 |
+
const prefix = isNegative ? '-' : (options.signed ? '+' : '');
|
| 1666 |
+
|
| 1667 |
+
if (isNegative) {
|
| 1668 |
+
number = -number;
|
| 1669 |
+
}
|
| 1670 |
+
|
| 1671 |
+
const localeOptions = buildLocaleOptions(options);
|
| 1672 |
+
let result;
|
| 1673 |
+
|
| 1674 |
+
if (number < 1) {
|
| 1675 |
+
const numberString = toLocaleString(number, options.locale, localeOptions);
|
| 1676 |
+
result = prefix + numberString + separator + UNITS[0];
|
| 1677 |
+
} else {
|
| 1678 |
+
const exponent = Math.min(Math.floor(options.binary ? log(number) / Math.log(1024) : log10(number) / 3), UNITS.length - 1);
|
| 1679 |
+
number = divide(number, (options.binary ? 1024 : 1000) ** exponent);
|
| 1680 |
+
|
| 1681 |
+
if (!localeOptions) {
|
| 1682 |
+
const minPrecision = Math.max(3, Math.floor(number).toString().length);
|
| 1683 |
+
number = number.toPrecision(minPrecision);
|
| 1684 |
+
}
|
| 1685 |
+
|
| 1686 |
+
const numberString = toLocaleString(Number(number), options.locale, localeOptions);
|
| 1687 |
+
const unit = UNITS[exponent];
|
| 1688 |
+
result = prefix + numberString + separator + unit;
|
| 1689 |
+
}
|
| 1690 |
+
|
| 1691 |
+
return applyFixedWidth(result, options.fixedWidth);
|
| 1692 |
+
}
|
| 1693 |
+
|
| 1694 |
+
function printTimings(timings) {
|
| 1695 |
+
for (const [label, [time, memory, total]] of Object.entries(timings)) {
|
| 1696 |
+
const appliedColor = label[0] === '#' ? (label[1] === '#' ? rollup.bold : rollup.underline) : (text) => text;
|
| 1697 |
+
const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes(memory)} / ${prettyBytes(total)}`;
|
| 1698 |
+
console.info(appliedColor(row));
|
| 1699 |
+
}
|
| 1700 |
+
}
|
| 1701 |
+
|
| 1702 |
+
async function build(inputOptions, warnings, silent = false) {
|
| 1703 |
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
| 1704 |
+
try {
|
| 1705 |
+
const outputOptions = inputOptions.output;
|
| 1706 |
+
const useStdout = !outputOptions[0].file && !outputOptions[0].dir;
|
| 1707 |
+
const start = Date.now();
|
| 1708 |
+
const files = useStdout ? ['stdout'] : outputOptions.map(t => parseAst_js.relativeId(t.file || t.dir));
|
| 1709 |
+
if (!silent) {
|
| 1710 |
+
let inputFiles;
|
| 1711 |
+
if (typeof inputOptions.input === 'string') {
|
| 1712 |
+
inputFiles = inputOptions.input;
|
| 1713 |
+
}
|
| 1714 |
+
else if (Array.isArray(inputOptions.input)) {
|
| 1715 |
+
inputFiles = inputOptions.input.join(', ');
|
| 1716 |
+
}
|
| 1717 |
+
else if (typeof inputOptions.input === 'object' && inputOptions.input !== null) {
|
| 1718 |
+
inputFiles = Object.values(inputOptions.input).join(', ');
|
| 1719 |
+
}
|
| 1720 |
+
rollup.stderr(rollup.cyan(`\n${rollup.bold(inputFiles)} → ${rollup.bold(files.join(', '))}...`));
|
| 1721 |
+
}
|
| 1722 |
+
const bundle = __addDisposableResource(env_1, await rollup.rollup(inputOptions), true);
|
| 1723 |
+
if (useStdout) {
|
| 1724 |
+
const output = outputOptions[0];
|
| 1725 |
+
if (output.sourcemap && output.sourcemap !== 'inline') {
|
| 1726 |
+
rollup.handleError(parseAst_js.logOnlyInlineSourcemapsForStdout());
|
| 1727 |
+
}
|
| 1728 |
+
const { output: outputs } = await bundle.generate(output);
|
| 1729 |
+
for (const file of outputs) {
|
| 1730 |
+
if (outputs.length > 1)
|
| 1731 |
+
process$1.stdout.write(`\n${rollup.cyan(rollup.bold(`//→ ${file.fileName}:`))}\n`);
|
| 1732 |
+
process$1.stdout.write(file.type === 'asset' ? file.source : file.code);
|
| 1733 |
+
}
|
| 1734 |
+
if (!silent) {
|
| 1735 |
+
warnings.flush();
|
| 1736 |
+
}
|
| 1737 |
+
return;
|
| 1738 |
+
}
|
| 1739 |
+
await Promise.all(outputOptions.map(bundle.write));
|
| 1740 |
+
if (!silent) {
|
| 1741 |
+
warnings.flush();
|
| 1742 |
+
rollup.stderr(rollup.green(`created ${rollup.bold(files.join(', '))} in ${rollup.bold(prettyMilliseconds(Date.now() - start))}`));
|
| 1743 |
+
if (bundle && bundle.getTimings) {
|
| 1744 |
+
printTimings(bundle.getTimings());
|
| 1745 |
+
}
|
| 1746 |
+
}
|
| 1747 |
+
}
|
| 1748 |
+
catch (e_1) {
|
| 1749 |
+
env_1.error = e_1;
|
| 1750 |
+
env_1.hasError = true;
|
| 1751 |
+
}
|
| 1752 |
+
finally {
|
| 1753 |
+
const result_1 = __disposeResources(env_1);
|
| 1754 |
+
if (result_1)
|
| 1755 |
+
await result_1;
|
| 1756 |
+
}
|
| 1757 |
+
}
|
| 1758 |
+
|
| 1759 |
+
const DEFAULT_CONFIG_BASE = 'rollup.config';
|
| 1760 |
+
async function getConfigPath(commandConfig) {
|
| 1761 |
+
if (commandConfig === true) {
|
| 1762 |
+
return path.resolve(await findConfigFileNameInCwd());
|
| 1763 |
+
}
|
| 1764 |
+
if (commandConfig.slice(0, 5) === 'node:') {
|
| 1765 |
+
const packageName = commandConfig.slice(5);
|
| 1766 |
+
try {
|
| 1767 |
+
return require.resolve(`rollup-config-${packageName}`, { paths: [process$1.cwd()] });
|
| 1768 |
+
}
|
| 1769 |
+
catch {
|
| 1770 |
+
try {
|
| 1771 |
+
return require.resolve(packageName, { paths: [process$1.cwd()] });
|
| 1772 |
+
}
|
| 1773 |
+
catch (error) {
|
| 1774 |
+
if (error.code === 'MODULE_NOT_FOUND') {
|
| 1775 |
+
rollup.handleError(parseAst_js.logMissingExternalConfig(commandConfig));
|
| 1776 |
+
}
|
| 1777 |
+
throw error;
|
| 1778 |
+
}
|
| 1779 |
+
}
|
| 1780 |
+
}
|
| 1781 |
+
return path.resolve(commandConfig);
|
| 1782 |
+
}
|
| 1783 |
+
async function findConfigFileNameInCwd() {
|
| 1784 |
+
const filesInWorkingDirectory = new Set(await promises.readdir(process$1.cwd()));
|
| 1785 |
+
for (const extension of ['mjs', 'cjs', 'ts']) {
|
| 1786 |
+
const fileName = `${DEFAULT_CONFIG_BASE}.${extension}`;
|
| 1787 |
+
if (filesInWorkingDirectory.has(fileName))
|
| 1788 |
+
return fileName;
|
| 1789 |
+
}
|
| 1790 |
+
return `${DEFAULT_CONFIG_BASE}.js`;
|
| 1791 |
+
}
|
| 1792 |
+
|
| 1793 |
+
async function loadConfigFromCommand(commandOptions, watchMode) {
|
| 1794 |
+
const warnings = loadConfigFile_js.batchWarnings(commandOptions);
|
| 1795 |
+
if (!commandOptions.input && (commandOptions.stdin || !process$1.stdin.isTTY)) {
|
| 1796 |
+
commandOptions.input = loadConfigFile_js.stdinName;
|
| 1797 |
+
}
|
| 1798 |
+
const options = await rollup.mergeOptions({ input: [] }, watchMode, commandOptions, warnings.log);
|
| 1799 |
+
await loadConfigFile_js.addCommandPluginsToInputOptions(options, commandOptions);
|
| 1800 |
+
return { options: [options], warnings };
|
| 1801 |
+
}
|
| 1802 |
+
|
| 1803 |
+
async function runRollup(command) {
|
| 1804 |
+
let inputSource;
|
| 1805 |
+
if (command._.length > 0) {
|
| 1806 |
+
if (command.input) {
|
| 1807 |
+
rollup.handleError(parseAst_js.logDuplicateImportOptions());
|
| 1808 |
+
}
|
| 1809 |
+
inputSource = command._;
|
| 1810 |
+
}
|
| 1811 |
+
else if (typeof command.input === 'string') {
|
| 1812 |
+
inputSource = [command.input];
|
| 1813 |
+
}
|
| 1814 |
+
else {
|
| 1815 |
+
inputSource = command.input;
|
| 1816 |
+
}
|
| 1817 |
+
if (inputSource && inputSource.length > 0) {
|
| 1818 |
+
if (inputSource.some((input) => input.includes('='))) {
|
| 1819 |
+
command.input = {};
|
| 1820 |
+
for (const input of inputSource) {
|
| 1821 |
+
const equalsIndex = input.indexOf('=');
|
| 1822 |
+
const value = input.slice(Math.max(0, equalsIndex + 1));
|
| 1823 |
+
const key = input.slice(0, Math.max(0, equalsIndex)) || parseAst_js.getAliasName(input);
|
| 1824 |
+
command.input[key] = value;
|
| 1825 |
+
}
|
| 1826 |
+
}
|
| 1827 |
+
else {
|
| 1828 |
+
command.input = inputSource;
|
| 1829 |
+
}
|
| 1830 |
+
}
|
| 1831 |
+
if (command.environment) {
|
| 1832 |
+
const environment = Array.isArray(command.environment)
|
| 1833 |
+
? command.environment
|
| 1834 |
+
: [command.environment];
|
| 1835 |
+
for (const argument of environment) {
|
| 1836 |
+
for (const pair of argument.split(',')) {
|
| 1837 |
+
const [key, ...value] = pair.split(':');
|
| 1838 |
+
process$1.env[key] = value.length === 0 ? String(true) : value.join(':');
|
| 1839 |
+
}
|
| 1840 |
+
}
|
| 1841 |
+
}
|
| 1842 |
+
if (rollup.isWatchEnabled(command.watch)) {
|
| 1843 |
+
await fseventsImporter.loadFsEvents();
|
| 1844 |
+
const { watch } = await Promise.resolve().then(() => require('../shared/watch-cli.js'));
|
| 1845 |
+
await watch(command);
|
| 1846 |
+
}
|
| 1847 |
+
else {
|
| 1848 |
+
try {
|
| 1849 |
+
const { options, warnings } = await getConfigs(command);
|
| 1850 |
+
try {
|
| 1851 |
+
for (const inputOptions of options) {
|
| 1852 |
+
if (!inputOptions.cache) {
|
| 1853 |
+
// We explicitly disable the cache when unused as the CLI will not
|
| 1854 |
+
// use the cache object on the bundle when not in watch mode. This
|
| 1855 |
+
// improves performance as the cache is not generated.
|
| 1856 |
+
inputOptions.cache = false;
|
| 1857 |
+
}
|
| 1858 |
+
await build(inputOptions, warnings, command.silent);
|
| 1859 |
+
}
|
| 1860 |
+
if (command.failAfterWarnings && warnings.warningOccurred) {
|
| 1861 |
+
warnings.flush();
|
| 1862 |
+
rollup.handleError(parseAst_js.logFailAfterWarnings());
|
| 1863 |
+
}
|
| 1864 |
+
}
|
| 1865 |
+
catch (error) {
|
| 1866 |
+
warnings.flush();
|
| 1867 |
+
rollup.handleError(error);
|
| 1868 |
+
}
|
| 1869 |
+
}
|
| 1870 |
+
catch (error) {
|
| 1871 |
+
rollup.handleError(error);
|
| 1872 |
+
}
|
| 1873 |
+
}
|
| 1874 |
+
}
|
| 1875 |
+
async function getConfigs(command) {
|
| 1876 |
+
if (command.config) {
|
| 1877 |
+
const configFile = await getConfigPath(command.config);
|
| 1878 |
+
const { options, warnings } = await loadConfigFile_js.loadConfigFile(configFile, command, false);
|
| 1879 |
+
return { options, warnings };
|
| 1880 |
+
}
|
| 1881 |
+
return await loadConfigFromCommand(command, false);
|
| 1882 |
+
}
|
| 1883 |
+
|
| 1884 |
+
const command = yargsParser(process$1.argv.slice(2), {
|
| 1885 |
+
alias: rollup.commandAliases,
|
| 1886 |
+
configuration: { 'camel-case-expansion': false }
|
| 1887 |
+
});
|
| 1888 |
+
if (command.help || (process$1.argv.length <= 2 && process$1.stdin.isTTY)) {
|
| 1889 |
+
console.log(`\n${help}\n`);
|
| 1890 |
+
}
|
| 1891 |
+
else if (command.version) {
|
| 1892 |
+
console.log(`rollup v${rollup.version}`);
|
| 1893 |
+
}
|
| 1894 |
+
else {
|
| 1895 |
+
try {
|
| 1896 |
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
| 1897 |
+
require('source-map-support').install();
|
| 1898 |
+
}
|
| 1899 |
+
catch {
|
| 1900 |
+
// do nothing
|
| 1901 |
+
}
|
| 1902 |
+
const promise = runRollup(command);
|
| 1903 |
+
if (command.forceExit) {
|
| 1904 |
+
promise.then(() => process$1.exit());
|
| 1905 |
+
}
|
| 1906 |
+
}
|
| 1907 |
+
|
| 1908 |
+
exports.getConfigPath = getConfigPath;
|
| 1909 |
+
exports.loadConfigFromCommand = loadConfigFromCommand;
|
| 1910 |
+
exports.prettyMilliseconds = prettyMilliseconds;
|
| 1911 |
+
exports.printTimings = printTimings;
|
| 1912 |
+
//# sourceMappingURL=rollup.map
|
node_modules/rollup/dist/es/getLogFilter.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
const getLogFilter = filters => {
|
| 11 |
+
if (filters.length === 0)
|
| 12 |
+
return () => true;
|
| 13 |
+
const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => {
|
| 14 |
+
const inverted = subFilter[0] === '!';
|
| 15 |
+
if (inverted)
|
| 16 |
+
subFilter = subFilter.slice(1);
|
| 17 |
+
const [key, ...value] = subFilter.split(':');
|
| 18 |
+
return { inverted, key: key.split('.'), parts: value.join(':').split('*') };
|
| 19 |
+
}));
|
| 20 |
+
return (log) => {
|
| 21 |
+
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
|
| 22 |
+
for (const { inverted, key, parts } of intersectedFilters) {
|
| 23 |
+
const isFilterSatisfied = testFilter(log, key, parts);
|
| 24 |
+
if (inverted ? isFilterSatisfied : !isFilterSatisfied) {
|
| 25 |
+
continue nextIntersectedFilter;
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
return true;
|
| 29 |
+
}
|
| 30 |
+
return false;
|
| 31 |
+
};
|
| 32 |
+
};
|
| 33 |
+
const testFilter = (log, key, parts) => {
|
| 34 |
+
let rawValue = log;
|
| 35 |
+
for (let index = 0; index < key.length; index++) {
|
| 36 |
+
if (!rawValue) {
|
| 37 |
+
return false;
|
| 38 |
+
}
|
| 39 |
+
const part = key[index];
|
| 40 |
+
if (!(part in rawValue)) {
|
| 41 |
+
return false;
|
| 42 |
+
}
|
| 43 |
+
rawValue = rawValue[part];
|
| 44 |
+
}
|
| 45 |
+
let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue);
|
| 46 |
+
if (parts.length === 1) {
|
| 47 |
+
return value === parts[0];
|
| 48 |
+
}
|
| 49 |
+
if (!value.startsWith(parts[0])) {
|
| 50 |
+
return false;
|
| 51 |
+
}
|
| 52 |
+
const lastPartIndex = parts.length - 1;
|
| 53 |
+
for (let index = 1; index < lastPartIndex; index++) {
|
| 54 |
+
const part = parts[index];
|
| 55 |
+
const position = value.indexOf(part);
|
| 56 |
+
if (position === -1) {
|
| 57 |
+
return false;
|
| 58 |
+
}
|
| 59 |
+
value = value.slice(position + part.length);
|
| 60 |
+
}
|
| 61 |
+
return value.endsWith(parts[lastPartIndex]);
|
| 62 |
+
};
|
| 63 |
+
|
| 64 |
+
export { getLogFilter };
|
node_modules/rollup/dist/es/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"type":"module"}
|
node_modules/rollup/dist/es/parseAst.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
import '../native.js';
|
| 11 |
+
export { parseAst, parseAstAsync } from './shared/parseAst.js';
|
| 12 |
+
import 'node:path';
|
node_modules/rollup/dist/es/rollup.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
export { version as VERSION, defineConfig, rollup, watch } from './shared/node-entry.js';
|
| 11 |
+
import './shared/parseAst.js';
|
| 12 |
+
import '../native.js';
|
| 13 |
+
import 'node:path';
|
| 14 |
+
import 'path';
|
| 15 |
+
import 'node:process';
|
| 16 |
+
import 'node:perf_hooks';
|
| 17 |
+
import 'node:fs/promises';
|
node_modules/rollup/dist/es/shared/node-entry.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
node_modules/rollup/dist/es/shared/parseAst.js
ADDED
|
@@ -0,0 +1,2096 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
import { parse, parseAsync } from '../../native.js';
|
| 11 |
+
import { resolve, dirname, basename, extname } from 'node:path';
|
| 12 |
+
|
| 13 |
+
// This file is generated by scripts/generate-node-types.js.
|
| 14 |
+
// Do not edit this file directly.
|
| 15 |
+
const ArrowFunctionExpression = 'ArrowFunctionExpression';
|
| 16 |
+
const AwaitExpression = 'AwaitExpression';
|
| 17 |
+
const BlockStatement = 'BlockStatement';
|
| 18 |
+
const CallExpression = 'CallExpression';
|
| 19 |
+
const CatchClause = 'CatchClause';
|
| 20 |
+
const ExportDefaultDeclaration = 'ExportDefaultDeclaration';
|
| 21 |
+
const ExpressionStatement = 'ExpressionStatement';
|
| 22 |
+
const FunctionExpression = 'FunctionExpression';
|
| 23 |
+
const Identifier = 'Identifier';
|
| 24 |
+
const Literal = 'Literal';
|
| 25 |
+
const MemberExpression = 'MemberExpression';
|
| 26 |
+
const ObjectExpression = 'ObjectExpression';
|
| 27 |
+
const PanicError = 'PanicError';
|
| 28 |
+
const ParseError = 'ParseError';
|
| 29 |
+
const Program = 'Program';
|
| 30 |
+
const Property = 'Property';
|
| 31 |
+
const RestElement = 'RestElement';
|
| 32 |
+
const ReturnStatement = 'ReturnStatement';
|
| 33 |
+
const StaticBlock = 'StaticBlock';
|
| 34 |
+
const TemplateLiteral = 'TemplateLiteral';
|
| 35 |
+
const VariableDeclarator = 'VariableDeclarator';
|
| 36 |
+
|
| 37 |
+
const BLANK = Object.freeze(Object.create(null));
|
| 38 |
+
const EMPTY_OBJECT = Object.freeze({});
|
| 39 |
+
const EMPTY_ARRAY = Object.freeze([]);
|
| 40 |
+
const EMPTY_SET = Object.freeze(new (class extends Set {
|
| 41 |
+
add() {
|
| 42 |
+
throw new Error('Cannot add to empty set');
|
| 43 |
+
}
|
| 44 |
+
})());
|
| 45 |
+
|
| 46 |
+
// This file is generated by scripts/generate-string-constants.js.
|
| 47 |
+
// Do not edit this file directly.
|
| 48 |
+
const FIXED_STRINGS = [
|
| 49 |
+
'var',
|
| 50 |
+
'let',
|
| 51 |
+
'const',
|
| 52 |
+
'init',
|
| 53 |
+
'get',
|
| 54 |
+
'set',
|
| 55 |
+
'constructor',
|
| 56 |
+
'method',
|
| 57 |
+
'-',
|
| 58 |
+
'+',
|
| 59 |
+
'!',
|
| 60 |
+
'~',
|
| 61 |
+
'typeof',
|
| 62 |
+
'void',
|
| 63 |
+
'delete',
|
| 64 |
+
'++',
|
| 65 |
+
'--',
|
| 66 |
+
'==',
|
| 67 |
+
'!=',
|
| 68 |
+
'===',
|
| 69 |
+
'!==',
|
| 70 |
+
'<',
|
| 71 |
+
'<=',
|
| 72 |
+
'>',
|
| 73 |
+
'>=',
|
| 74 |
+
'<<',
|
| 75 |
+
'>>',
|
| 76 |
+
'>>>',
|
| 77 |
+
'+',
|
| 78 |
+
'-',
|
| 79 |
+
'*',
|
| 80 |
+
'/',
|
| 81 |
+
'%',
|
| 82 |
+
'|',
|
| 83 |
+
'^',
|
| 84 |
+
'&',
|
| 85 |
+
'||',
|
| 86 |
+
'&&',
|
| 87 |
+
'in',
|
| 88 |
+
'instanceof',
|
| 89 |
+
'**',
|
| 90 |
+
'??',
|
| 91 |
+
'=',
|
| 92 |
+
'+=',
|
| 93 |
+
'-=',
|
| 94 |
+
'*=',
|
| 95 |
+
'/=',
|
| 96 |
+
'%=',
|
| 97 |
+
'<<=',
|
| 98 |
+
'>>=',
|
| 99 |
+
'>>>=',
|
| 100 |
+
'|=',
|
| 101 |
+
'^=',
|
| 102 |
+
'&=',
|
| 103 |
+
'**=',
|
| 104 |
+
'&&=',
|
| 105 |
+
'||=',
|
| 106 |
+
'??=',
|
| 107 |
+
'pure',
|
| 108 |
+
'noSideEffects',
|
| 109 |
+
'sourcemap',
|
| 110 |
+
'using',
|
| 111 |
+
'await using'
|
| 112 |
+
];
|
| 113 |
+
|
| 114 |
+
const ANNOTATION_KEY = '_rollupAnnotations';
|
| 115 |
+
const INVALID_ANNOTATION_KEY = '_rollupRemoved';
|
| 116 |
+
const convertAnnotations = (position, buffer) => {
|
| 117 |
+
if (position === 0)
|
| 118 |
+
return EMPTY_ARRAY;
|
| 119 |
+
const length = buffer[position++];
|
| 120 |
+
const list = new Array(length);
|
| 121 |
+
for (let index = 0; index < length; index++) {
|
| 122 |
+
list[index] = convertAnnotation(buffer[position++], buffer);
|
| 123 |
+
}
|
| 124 |
+
return list;
|
| 125 |
+
};
|
| 126 |
+
const convertAnnotation = (position, buffer) => {
|
| 127 |
+
const start = buffer[position++];
|
| 128 |
+
const end = buffer[position++];
|
| 129 |
+
const type = FIXED_STRINGS[buffer[position]];
|
| 130 |
+
return { end, start, type };
|
| 131 |
+
};
|
| 132 |
+
|
| 133 |
+
/** @typedef {import('./types').Location} Location */
|
| 134 |
+
|
| 135 |
+
/**
|
| 136 |
+
* @param {import('./types').Range} range
|
| 137 |
+
* @param {number} index
|
| 138 |
+
*/
|
| 139 |
+
function rangeContains(range, index) {
|
| 140 |
+
return range.start <= index && index < range.end;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
/**
|
| 144 |
+
* @param {string} source
|
| 145 |
+
* @param {import('./types').Options} [options]
|
| 146 |
+
*/
|
| 147 |
+
function getLocator(source, options = {}) {
|
| 148 |
+
const { offsetLine = 0, offsetColumn = 0 } = options;
|
| 149 |
+
|
| 150 |
+
let start = 0;
|
| 151 |
+
const ranges = source.split('\n').map((line, i) => {
|
| 152 |
+
const end = start + line.length + 1;
|
| 153 |
+
|
| 154 |
+
/** @type {import('./types').Range} */
|
| 155 |
+
const range = { start, end, line: i };
|
| 156 |
+
|
| 157 |
+
start = end;
|
| 158 |
+
return range;
|
| 159 |
+
});
|
| 160 |
+
|
| 161 |
+
let i = 0;
|
| 162 |
+
|
| 163 |
+
/**
|
| 164 |
+
* @param {string | number} search
|
| 165 |
+
* @param {number} [index]
|
| 166 |
+
* @returns {Location | undefined}
|
| 167 |
+
*/
|
| 168 |
+
function locator(search, index) {
|
| 169 |
+
if (typeof search === 'string') {
|
| 170 |
+
search = source.indexOf(search, index ?? 0);
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
if (search === -1) return undefined;
|
| 174 |
+
|
| 175 |
+
let range = ranges[i];
|
| 176 |
+
|
| 177 |
+
const d = search >= range.end ? 1 : -1;
|
| 178 |
+
|
| 179 |
+
while (range) {
|
| 180 |
+
if (rangeContains(range, search)) {
|
| 181 |
+
return {
|
| 182 |
+
line: offsetLine + range.line,
|
| 183 |
+
column: offsetColumn + search - range.start,
|
| 184 |
+
character: search
|
| 185 |
+
};
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
i += d;
|
| 189 |
+
range = ranges[i];
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
return locator;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
/**
|
| 197 |
+
* @param {string} source
|
| 198 |
+
* @param {string | number} search
|
| 199 |
+
* @param {import('./types').Options} [options]
|
| 200 |
+
* @returns {Location | undefined}
|
| 201 |
+
*/
|
| 202 |
+
function locate(source, search, options) {
|
| 203 |
+
return getLocator(source, options)(search, options && options.startIndex);
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
function spaces(index) {
|
| 207 |
+
let result = '';
|
| 208 |
+
while (index--)
|
| 209 |
+
result += ' ';
|
| 210 |
+
return result;
|
| 211 |
+
}
|
| 212 |
+
function tabsToSpaces(value) {
|
| 213 |
+
return value.replace(/^\t+/, match => match.split('\t').join(' '));
|
| 214 |
+
}
|
| 215 |
+
const LINE_TRUNCATE_LENGTH = 120;
|
| 216 |
+
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
| 217 |
+
const ELLIPSIS = '...';
|
| 218 |
+
function getCodeFrame(source, line, column) {
|
| 219 |
+
let lines = source.split('\n');
|
| 220 |
+
// Needed if a plugin did not generate correct sourcemaps
|
| 221 |
+
if (line > lines.length)
|
| 222 |
+
return '';
|
| 223 |
+
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length +
|
| 224 |
+
MIN_CHARACTERS_SHOWN_AFTER_LOCATION +
|
| 225 |
+
ELLIPSIS.length, LINE_TRUNCATE_LENGTH);
|
| 226 |
+
const frameStart = Math.max(0, line - 3);
|
| 227 |
+
let frameEnd = Math.min(line + 2, lines.length);
|
| 228 |
+
lines = lines.slice(frameStart, frameEnd);
|
| 229 |
+
while (!/\S/.test(lines[lines.length - 1])) {
|
| 230 |
+
lines.pop();
|
| 231 |
+
frameEnd -= 1;
|
| 232 |
+
}
|
| 233 |
+
const digits = String(frameEnd).length;
|
| 234 |
+
return lines
|
| 235 |
+
.map((sourceLine, index) => {
|
| 236 |
+
const isErrorLine = frameStart + index + 1 === line;
|
| 237 |
+
let lineNumber = String(index + frameStart + 1);
|
| 238 |
+
while (lineNumber.length < digits)
|
| 239 |
+
lineNumber = ` ${lineNumber}`;
|
| 240 |
+
let displayedLine = tabsToSpaces(sourceLine);
|
| 241 |
+
if (displayedLine.length > maxLineLength) {
|
| 242 |
+
displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`;
|
| 243 |
+
}
|
| 244 |
+
if (isErrorLine) {
|
| 245 |
+
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + '^';
|
| 246 |
+
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
| 247 |
+
}
|
| 248 |
+
return `${lineNumber}: ${displayedLine}`;
|
| 249 |
+
})
|
| 250 |
+
.join('\n');
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
const LOGLEVEL_SILENT = 'silent';
|
| 254 |
+
const LOGLEVEL_ERROR = 'error';
|
| 255 |
+
const LOGLEVEL_WARN = 'warn';
|
| 256 |
+
const LOGLEVEL_INFO = 'info';
|
| 257 |
+
const LOGLEVEL_DEBUG = 'debug';
|
| 258 |
+
const logLevelPriority = {
|
| 259 |
+
[LOGLEVEL_DEBUG]: 0,
|
| 260 |
+
[LOGLEVEL_INFO]: 1,
|
| 261 |
+
[LOGLEVEL_SILENT]: 3,
|
| 262 |
+
[LOGLEVEL_WARN]: 2
|
| 263 |
+
};
|
| 264 |
+
|
| 265 |
+
const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
|
| 266 |
+
const RELATIVE_PATH_REGEX = /^\.?\.(\/|$)/;
|
| 267 |
+
function isAbsolute(path) {
|
| 268 |
+
return ABSOLUTE_PATH_REGEX.test(path);
|
| 269 |
+
}
|
| 270 |
+
function isRelative(path) {
|
| 271 |
+
return RELATIVE_PATH_REGEX.test(path);
|
| 272 |
+
}
|
| 273 |
+
const BACKSLASH_REGEX = /\\/g;
|
| 274 |
+
function normalize(path) {
|
| 275 |
+
return path.replace(BACKSLASH_REGEX, '/');
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
function printQuotedStringList(list, verbs) {
|
| 279 |
+
const isSingleItem = list.length <= 1;
|
| 280 |
+
const quotedList = list.map(item => `"${item}"`);
|
| 281 |
+
let output = isSingleItem
|
| 282 |
+
? quotedList[0]
|
| 283 |
+
: `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`;
|
| 284 |
+
if (verbs) {
|
| 285 |
+
output += ` ${isSingleItem ? verbs[0] : verbs[1]}`;
|
| 286 |
+
}
|
| 287 |
+
return output;
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
const ANY_SLASH_REGEX = /[/\\]/;
|
| 291 |
+
function relative(from, to) {
|
| 292 |
+
const fromParts = from.split(ANY_SLASH_REGEX).filter(Boolean);
|
| 293 |
+
const toParts = to.split(ANY_SLASH_REGEX).filter(Boolean);
|
| 294 |
+
if (fromParts[0] === '.')
|
| 295 |
+
fromParts.shift();
|
| 296 |
+
if (toParts[0] === '.')
|
| 297 |
+
toParts.shift();
|
| 298 |
+
while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {
|
| 299 |
+
fromParts.shift();
|
| 300 |
+
toParts.shift();
|
| 301 |
+
}
|
| 302 |
+
while (toParts[0] === '..' && fromParts.length > 0) {
|
| 303 |
+
toParts.shift();
|
| 304 |
+
fromParts.pop();
|
| 305 |
+
}
|
| 306 |
+
while (fromParts.pop()) {
|
| 307 |
+
toParts.unshift('..');
|
| 308 |
+
}
|
| 309 |
+
return toParts.join('/');
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
function getAliasName(id) {
|
| 313 |
+
const base = basename(id);
|
| 314 |
+
return base.slice(0, Math.max(0, base.length - extname(id).length));
|
| 315 |
+
}
|
| 316 |
+
function relativeId(id) {
|
| 317 |
+
if (!isAbsolute(id))
|
| 318 |
+
return id;
|
| 319 |
+
return relative(resolve(), id);
|
| 320 |
+
}
|
| 321 |
+
function isPathFragment(name) {
|
| 322 |
+
// starting with "/", "./", "../", "C:/"
|
| 323 |
+
return (name[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name));
|
| 324 |
+
}
|
| 325 |
+
const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/;
|
| 326 |
+
function getImportPath(importerId, targetPath, stripJsExtension, ensureFileName) {
|
| 327 |
+
while (targetPath.startsWith('../')) {
|
| 328 |
+
targetPath = targetPath.slice(3);
|
| 329 |
+
importerId = '_/' + importerId;
|
| 330 |
+
}
|
| 331 |
+
let relativePath = normalize(relative(dirname(importerId), targetPath));
|
| 332 |
+
if (stripJsExtension && relativePath.endsWith('.js')) {
|
| 333 |
+
relativePath = relativePath.slice(0, -3);
|
| 334 |
+
}
|
| 335 |
+
if (ensureFileName) {
|
| 336 |
+
if (relativePath === '')
|
| 337 |
+
return '../' + basename(targetPath);
|
| 338 |
+
if (UPPER_DIR_REGEX.test(relativePath)) {
|
| 339 |
+
return [...relativePath.split('/'), '..', basename(targetPath)].join('/');
|
| 340 |
+
}
|
| 341 |
+
}
|
| 342 |
+
return relativePath ? (relativePath.startsWith('..') ? relativePath : './' + relativePath) : '.';
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
function isValidUrl(url) {
|
| 346 |
+
try {
|
| 347 |
+
new URL(url);
|
| 348 |
+
}
|
| 349 |
+
catch {
|
| 350 |
+
return false;
|
| 351 |
+
}
|
| 352 |
+
return true;
|
| 353 |
+
}
|
| 354 |
+
function getRollupUrl(snippet) {
|
| 355 |
+
return `https://rollupjs.org/${snippet}`;
|
| 356 |
+
}
|
| 357 |
+
function addTrailingSlashIfMissed(url) {
|
| 358 |
+
if (!url.endsWith('/')) {
|
| 359 |
+
return url + '/';
|
| 360 |
+
}
|
| 361 |
+
return url;
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
// troubleshooting
|
| 365 |
+
const URL_AVOIDING_EVAL = 'troubleshooting/#avoiding-eval';
|
| 366 |
+
const URL_NAME_IS_NOT_EXPORTED = 'troubleshooting/#error-name-is-not-exported-by-module';
|
| 367 |
+
const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined';
|
| 368 |
+
const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency';
|
| 369 |
+
const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect';
|
| 370 |
+
// configuration-options
|
| 371 |
+
const URL_JSX = 'configuration-options/#jsx';
|
| 372 |
+
const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id';
|
| 373 |
+
const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath';
|
| 374 |
+
const URL_OUTPUT_DIR = 'configuration-options/#output-dir';
|
| 375 |
+
const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports';
|
| 376 |
+
const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend';
|
| 377 |
+
const URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = 'configuration-options/#output-externalimportattributes';
|
| 378 |
+
const URL_OUTPUT_FORMAT = 'configuration-options/#output-format';
|
| 379 |
+
const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode';
|
| 380 |
+
const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals';
|
| 381 |
+
const URL_OUTPUT_INLINEDYNAMICIMPORTS = 'configuration-options/#output-inlinedynamicimports';
|
| 382 |
+
const URL_OUTPUT_INTEROP = 'configuration-options/#output-interop';
|
| 383 |
+
const URL_OUTPUT_MANUALCHUNKS = 'configuration-options/#output-manualchunks';
|
| 384 |
+
const URL_OUTPUT_NAME = 'configuration-options/#output-name';
|
| 385 |
+
const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-sourcemapbaseurl';
|
| 386 |
+
const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile';
|
| 387 |
+
const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures';
|
| 388 |
+
const URL_TREESHAKE = 'configuration-options/#treeshake';
|
| 389 |
+
const URL_TREESHAKE_PURE = 'configuration-options/#pure';
|
| 390 |
+
const URL_TREESHAKE_NOSIDEEFFECTS = 'configuration-options/#no-side-effects';
|
| 391 |
+
const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects';
|
| 392 |
+
const URL_WATCH = 'configuration-options/#watch';
|
| 393 |
+
const URL_GENERATEBUNDLE = 'plugin-development/#generatebundle';
|
| 394 |
+
const URL_LOAD = 'plugin-development/#load';
|
| 395 |
+
const URL_TRANSFORM = 'plugin-development/#transform';
|
| 396 |
+
|
| 397 |
+
function error(base) {
|
| 398 |
+
throw base instanceof Error ? base : getRollupError(base);
|
| 399 |
+
}
|
| 400 |
+
function getRollupError(base) {
|
| 401 |
+
augmentLogMessage(base);
|
| 402 |
+
const errorInstance = Object.assign(new Error(base.message), base);
|
| 403 |
+
Object.defineProperty(errorInstance, 'name', {
|
| 404 |
+
value: 'RollupError',
|
| 405 |
+
writable: true
|
| 406 |
+
});
|
| 407 |
+
return errorInstance;
|
| 408 |
+
}
|
| 409 |
+
function augmentCodeLocation(properties, pos, source, id) {
|
| 410 |
+
if (typeof pos === 'object') {
|
| 411 |
+
const { line, column } = pos;
|
| 412 |
+
properties.loc = { column, file: id, line };
|
| 413 |
+
}
|
| 414 |
+
else {
|
| 415 |
+
properties.pos = pos;
|
| 416 |
+
const location = locate(source, pos, { offsetLine: 1 });
|
| 417 |
+
if (!location) {
|
| 418 |
+
return;
|
| 419 |
+
}
|
| 420 |
+
const { line, column } = location;
|
| 421 |
+
properties.loc = { column, file: id, line };
|
| 422 |
+
}
|
| 423 |
+
if (properties.frame === undefined) {
|
| 424 |
+
const { line, column } = properties.loc;
|
| 425 |
+
properties.frame = getCodeFrame(source, line, column);
|
| 426 |
+
}
|
| 427 |
+
}
|
| 428 |
+
const symbolAugmented = Symbol('augmented');
|
| 429 |
+
function augmentLogMessage(log) {
|
| 430 |
+
// Make sure to only augment the log message once
|
| 431 |
+
if (!(log.plugin || log.loc) || log[symbolAugmented]) {
|
| 432 |
+
return;
|
| 433 |
+
}
|
| 434 |
+
log[symbolAugmented] = true;
|
| 435 |
+
let prefix = '';
|
| 436 |
+
if (log.plugin) {
|
| 437 |
+
prefix += `[plugin ${log.plugin}] `;
|
| 438 |
+
}
|
| 439 |
+
const id = log.id || log.loc?.file;
|
| 440 |
+
if (id) {
|
| 441 |
+
const position = log.loc ? ` (${log.loc.line}:${log.loc.column})` : '';
|
| 442 |
+
prefix += `${relativeId(id)}${position}: `;
|
| 443 |
+
}
|
| 444 |
+
const oldMessage = log.message;
|
| 445 |
+
log.message = prefix + log.message;
|
| 446 |
+
tweakStackMessage(log, oldMessage);
|
| 447 |
+
}
|
| 448 |
+
// Error codes should be sorted alphabetically while errors should be sorted by
|
| 449 |
+
// error code below
|
| 450 |
+
const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_CHUNK = 'CIRCULAR_CHUNK', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_JSX_EXPORT = 'MISSING_JSX_EXPORT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', RESERVED_NAMESPACE = 'RESERVED_NAMESPACE', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR';
|
| 451 |
+
function logAddonNotGenerated(message, hook, plugin) {
|
| 452 |
+
return {
|
| 453 |
+
code: ADDON_ERROR,
|
| 454 |
+
message: `Could not retrieve "${hook}". Check configuration of plugin "${plugin}".
|
| 455 |
+
\tError Message: ${message}`
|
| 456 |
+
};
|
| 457 |
+
}
|
| 458 |
+
function logAlreadyClosed() {
|
| 459 |
+
return {
|
| 460 |
+
code: ALREADY_CLOSED,
|
| 461 |
+
message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.'
|
| 462 |
+
};
|
| 463 |
+
}
|
| 464 |
+
function logAmbiguousExternalNamespaces(binding, reexportingModule, usedModule, sources) {
|
| 465 |
+
return {
|
| 466 |
+
binding,
|
| 467 |
+
code: AMBIGUOUS_EXTERNAL_NAMESPACES,
|
| 468 |
+
ids: sources,
|
| 469 |
+
message: `Ambiguous external namespace resolution: "${relativeId(reexportingModule)}" re-exports "${binding}" from one of the external modules ${printQuotedStringList(sources.map(module => relativeId(module)))}, guessing "${relativeId(usedModule)}".`,
|
| 470 |
+
reexporter: reexportingModule
|
| 471 |
+
};
|
| 472 |
+
}
|
| 473 |
+
function logAnonymousPluginCache() {
|
| 474 |
+
return {
|
| 475 |
+
code: ANONYMOUS_PLUGIN_CACHE,
|
| 476 |
+
message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.'
|
| 477 |
+
};
|
| 478 |
+
}
|
| 479 |
+
function logAssetNotFinalisedForFileName(name) {
|
| 480 |
+
return {
|
| 481 |
+
code: ASSET_NOT_FINALISED,
|
| 482 |
+
message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_<referenceId>, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.`
|
| 483 |
+
};
|
| 484 |
+
}
|
| 485 |
+
function logAssetReferenceIdNotFoundForSetSource(assetReferenceId) {
|
| 486 |
+
return {
|
| 487 |
+
code: ASSET_NOT_FOUND,
|
| 488 |
+
message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".`
|
| 489 |
+
};
|
| 490 |
+
}
|
| 491 |
+
function logAssetSourceAlreadySet(name) {
|
| 492 |
+
return {
|
| 493 |
+
code: ASSET_SOURCE_ALREADY_SET,
|
| 494 |
+
message: `Unable to set the source for asset "${name}", source already set.`
|
| 495 |
+
};
|
| 496 |
+
}
|
| 497 |
+
function logNoAssetSourceSet(assetName) {
|
| 498 |
+
return {
|
| 499 |
+
code: ASSET_SOURCE_MISSING,
|
| 500 |
+
message: `Plugin error creating asset "${assetName}" - no asset source set.`
|
| 501 |
+
};
|
| 502 |
+
}
|
| 503 |
+
function logBadLoader(id) {
|
| 504 |
+
return {
|
| 505 |
+
code: BAD_LOADER,
|
| 506 |
+
message: `Error loading "${relativeId(id)}": plugin load hook should return a string, a { code, map } object, or nothing/null.`
|
| 507 |
+
};
|
| 508 |
+
}
|
| 509 |
+
function logCannotCallNamespace(name) {
|
| 510 |
+
return {
|
| 511 |
+
code: CANNOT_CALL_NAMESPACE,
|
| 512 |
+
message: `Cannot call a namespace ("${name}").`
|
| 513 |
+
};
|
| 514 |
+
}
|
| 515 |
+
function logCannotEmitFromOptionsHook() {
|
| 516 |
+
return {
|
| 517 |
+
code: CANNOT_EMIT_FROM_OPTIONS_HOOK,
|
| 518 |
+
message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.`
|
| 519 |
+
};
|
| 520 |
+
}
|
| 521 |
+
function logChunkNotGeneratedForFileName(name) {
|
| 522 |
+
return {
|
| 523 |
+
code: CHUNK_NOT_GENERATED,
|
| 524 |
+
message: `Plugin error - Unable to get file name for emitted chunk "${name}". You can only get file names once chunks have been generated after the "renderStart" hook.`
|
| 525 |
+
};
|
| 526 |
+
}
|
| 527 |
+
function logChunkInvalid({ fileName, code }, { pos, message }) {
|
| 528 |
+
const errorProperties = {
|
| 529 |
+
code: CHUNK_INVALID,
|
| 530 |
+
message: `Chunk "${fileName}" is not valid JavaScript: ${message}.`
|
| 531 |
+
};
|
| 532 |
+
augmentCodeLocation(errorProperties, pos, code, fileName);
|
| 533 |
+
return errorProperties;
|
| 534 |
+
}
|
| 535 |
+
function logCircularDependency(cyclePath) {
|
| 536 |
+
return {
|
| 537 |
+
code: CIRCULAR_DEPENDENCY,
|
| 538 |
+
ids: cyclePath,
|
| 539 |
+
message: `Circular dependency: ${cyclePath.map(relativeId).join(' -> ')}`
|
| 540 |
+
};
|
| 541 |
+
}
|
| 542 |
+
function logCircularChunk(cyclePath, isManualChunkConflict) {
|
| 543 |
+
return {
|
| 544 |
+
code: CIRCULAR_CHUNK,
|
| 545 |
+
ids: cyclePath,
|
| 546 |
+
message: `Circular chunk: ${cyclePath.join(' -> ')}. ${isManualChunkConflict
|
| 547 |
+
? `Please adjust the manual chunk logic for these chunks.`
|
| 548 |
+
: `Consider disabling the "output.onlyExplicitManualChunks" option, as enabling it causes the static dependencies of the manual chunk "${cyclePath.at(-2)}" to be bundled into the chunk "${cyclePath.at(-1)}".`}`
|
| 549 |
+
};
|
| 550 |
+
}
|
| 551 |
+
function logCircularReexport(exportName, exporter) {
|
| 552 |
+
return {
|
| 553 |
+
code: CIRCULAR_REEXPORT,
|
| 554 |
+
exporter,
|
| 555 |
+
message: `"${exportName}" cannot be exported from "${relativeId(exporter)}" as it is a reexport that references itself.`
|
| 556 |
+
};
|
| 557 |
+
}
|
| 558 |
+
function logCyclicCrossChunkReexport(exportName, exporter, reexporter, importer, preserveModules) {
|
| 559 |
+
return {
|
| 560 |
+
code: CYCLIC_CROSS_CHUNK_REEXPORT,
|
| 561 |
+
exporter,
|
| 562 |
+
id: importer,
|
| 563 |
+
message: `Export "${exportName}" of module "${relativeId(exporter)}" was reexported through module "${relativeId(reexporter)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(importer)}" to point directly to the exporting module or ${preserveModules ? 'do not use "output.preserveModules"' : 'reconfigure "output.manualChunks"'} to ensure these modules end up in the same chunk.`,
|
| 564 |
+
reexporter
|
| 565 |
+
};
|
| 566 |
+
}
|
| 567 |
+
function logDeprecation(deprecation, urlSnippet, plugin) {
|
| 568 |
+
return {
|
| 569 |
+
code: DEPRECATED_FEATURE,
|
| 570 |
+
message: deprecation,
|
| 571 |
+
url: getRollupUrl(urlSnippet),
|
| 572 |
+
...({})
|
| 573 |
+
};
|
| 574 |
+
}
|
| 575 |
+
function logConstVariableReassignError() {
|
| 576 |
+
return {
|
| 577 |
+
code: CONST_REASSIGN,
|
| 578 |
+
message: 'Cannot reassign a variable declared with `const`'
|
| 579 |
+
};
|
| 580 |
+
}
|
| 581 |
+
function logDuplicateArgumentNameError(name) {
|
| 582 |
+
return {
|
| 583 |
+
code: DUPLICATE_ARGUMENT_NAME,
|
| 584 |
+
message: `Duplicate argument name "${name}"`
|
| 585 |
+
};
|
| 586 |
+
}
|
| 587 |
+
function logDuplicateExportError(name) {
|
| 588 |
+
return { code: DUPLICATE_EXPORT, message: `Duplicate export "${name}"` };
|
| 589 |
+
}
|
| 590 |
+
function logDuplicatePluginName(plugin) {
|
| 591 |
+
return {
|
| 592 |
+
code: DUPLICATE_PLUGIN_NAME,
|
| 593 |
+
message: `The plugin name ${plugin} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`
|
| 594 |
+
};
|
| 595 |
+
}
|
| 596 |
+
function logEmptyChunk(chunkName) {
|
| 597 |
+
return {
|
| 598 |
+
code: EMPTY_BUNDLE,
|
| 599 |
+
message: `Generated an empty chunk: "${chunkName}".`,
|
| 600 |
+
names: [chunkName]
|
| 601 |
+
};
|
| 602 |
+
}
|
| 603 |
+
function logEval(id) {
|
| 604 |
+
return {
|
| 605 |
+
code: EVAL,
|
| 606 |
+
id,
|
| 607 |
+
message: `Use of eval in "${relativeId(id)}" is strongly discouraged as it poses security risks and may cause issues with minification.`,
|
| 608 |
+
url: getRollupUrl(URL_AVOIDING_EVAL)
|
| 609 |
+
};
|
| 610 |
+
}
|
| 611 |
+
function logExternalSyntheticExports(id, importer) {
|
| 612 |
+
return {
|
| 613 |
+
code: EXTERNAL_SYNTHETIC_EXPORTS,
|
| 614 |
+
exporter: id,
|
| 615 |
+
message: `External "${id}" cannot have "syntheticNamedExports" enabled (imported by "${relativeId(importer)}").`
|
| 616 |
+
};
|
| 617 |
+
}
|
| 618 |
+
function logFileNameConflict(fileName) {
|
| 619 |
+
return {
|
| 620 |
+
code: FILE_NAME_CONFLICT,
|
| 621 |
+
message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.`
|
| 622 |
+
};
|
| 623 |
+
}
|
| 624 |
+
function logFileReferenceIdNotFoundForFilename(assetReferenceId) {
|
| 625 |
+
return {
|
| 626 |
+
code: FILE_NOT_FOUND,
|
| 627 |
+
message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".`
|
| 628 |
+
};
|
| 629 |
+
}
|
| 630 |
+
function logFirstSideEffect(source, id, { line, column }) {
|
| 631 |
+
return {
|
| 632 |
+
code: FIRST_SIDE_EFFECT,
|
| 633 |
+
message: `First side effect in ${relativeId(id)} is at (${line}:${column})\n${getCodeFrame(source, line, column)}`
|
| 634 |
+
};
|
| 635 |
+
}
|
| 636 |
+
function logIllegalIdentifierAsName(name) {
|
| 637 |
+
return {
|
| 638 |
+
code: ILLEGAL_IDENTIFIER_AS_NAME,
|
| 639 |
+
message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`,
|
| 640 |
+
url: getRollupUrl(URL_OUTPUT_EXTEND)
|
| 641 |
+
};
|
| 642 |
+
}
|
| 643 |
+
function logIllegalImportReassignment(name, importingId) {
|
| 644 |
+
return {
|
| 645 |
+
code: ILLEGAL_REASSIGNMENT,
|
| 646 |
+
message: `Illegal reassignment of import "${name}" in "${relativeId(importingId)}".`
|
| 647 |
+
};
|
| 648 |
+
}
|
| 649 |
+
function logInconsistentImportAttributes(existingAttributes, newAttributes, source, importer) {
|
| 650 |
+
return {
|
| 651 |
+
code: INCONSISTENT_IMPORT_ATTRIBUTES,
|
| 652 |
+
message: `Module "${relativeId(importer)}" tried to import "${relativeId(source)}" with ${formatAttributes(newAttributes)} attributes, but it was already imported elsewhere with ${formatAttributes(existingAttributes)} attributes. Please ensure that import attributes for the same module are always consistent.`
|
| 653 |
+
};
|
| 654 |
+
}
|
| 655 |
+
const formatAttributes = (attributes) => {
|
| 656 |
+
const entries = Object.entries(attributes);
|
| 657 |
+
if (entries.length === 0)
|
| 658 |
+
return 'no';
|
| 659 |
+
return entries.map(([key, value]) => `"${key}": "${value}"`).join(', ');
|
| 660 |
+
};
|
| 661 |
+
function logInvalidAnnotation(comment, id, type) {
|
| 662 |
+
return {
|
| 663 |
+
code: INVALID_ANNOTATION,
|
| 664 |
+
id,
|
| 665 |
+
message: `A comment\n\n"${comment}"\n\nin "${relativeId(id)}" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.`,
|
| 666 |
+
url: getRollupUrl(type === 'noSideEffects' ? URL_TREESHAKE_NOSIDEEFFECTS : URL_TREESHAKE_PURE)
|
| 667 |
+
};
|
| 668 |
+
}
|
| 669 |
+
function logInputHookInOutputPlugin(pluginName, hookName) {
|
| 670 |
+
return {
|
| 671 |
+
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
| 672 |
+
message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
|
| 673 |
+
};
|
| 674 |
+
}
|
| 675 |
+
function logCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) {
|
| 676 |
+
return {
|
| 677 |
+
code: INVALID_CHUNK,
|
| 678 |
+
message: `Cannot assign "${relativeId(moduleId)}" to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.`
|
| 679 |
+
};
|
| 680 |
+
}
|
| 681 |
+
function tweakStackMessage(error, oldMessage) {
|
| 682 |
+
if (!error.stack) {
|
| 683 |
+
return error;
|
| 684 |
+
}
|
| 685 |
+
error.stack = error.stack.replace(oldMessage, error.message);
|
| 686 |
+
return error;
|
| 687 |
+
}
|
| 688 |
+
function logInvalidExportOptionValue(optionValue) {
|
| 689 |
+
return {
|
| 690 |
+
code: INVALID_EXPORT_OPTION,
|
| 691 |
+
message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}".`,
|
| 692 |
+
url: getRollupUrl(URL_OUTPUT_EXPORTS)
|
| 693 |
+
};
|
| 694 |
+
}
|
| 695 |
+
function logIncompatibleExportOptionValue(optionValue, keys, entryModule) {
|
| 696 |
+
return {
|
| 697 |
+
code: INVALID_EXPORT_OPTION,
|
| 698 |
+
message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${printQuotedStringList(keys)}`,
|
| 699 |
+
url: getRollupUrl(URL_OUTPUT_EXPORTS)
|
| 700 |
+
};
|
| 701 |
+
}
|
| 702 |
+
function logInternalIdCannotBeExternal(source, importer) {
|
| 703 |
+
return {
|
| 704 |
+
code: INVALID_EXTERNAL_ID,
|
| 705 |
+
message: `"${source}" is imported as an external by "${relativeId(importer)}", but is already an existing non-external module id.`
|
| 706 |
+
};
|
| 707 |
+
}
|
| 708 |
+
function logImportOptionsAreInvalid(importer) {
|
| 709 |
+
return {
|
| 710 |
+
code: INVALID_IMPORT_ATTRIBUTE,
|
| 711 |
+
message: `Rollup could not statically analyze the options argument of a dynamic import in "${relativeId(importer)}". Dynamic import options need to be an object with a nested attributes object.`
|
| 712 |
+
};
|
| 713 |
+
}
|
| 714 |
+
function logImportAttributeIsInvalid(importer) {
|
| 715 |
+
return {
|
| 716 |
+
code: INVALID_IMPORT_ATTRIBUTE,
|
| 717 |
+
message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId(importer)}". Import attributes need to have string keys and values.`
|
| 718 |
+
};
|
| 719 |
+
}
|
| 720 |
+
function logInvalidLogPosition(plugin) {
|
| 721 |
+
return {
|
| 722 |
+
code: INVALID_LOG_POSITION,
|
| 723 |
+
message: `Plugin "${plugin}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
|
| 724 |
+
};
|
| 725 |
+
}
|
| 726 |
+
function logInvalidOption(option, urlSnippet, explanation, value) {
|
| 727 |
+
return {
|
| 728 |
+
code: INVALID_OPTION,
|
| 729 |
+
message: `Invalid value ${value === undefined ? '' : `${JSON.stringify(value)} `}for option "${option}" - ${explanation}.`,
|
| 730 |
+
url: getRollupUrl(urlSnippet)
|
| 731 |
+
};
|
| 732 |
+
}
|
| 733 |
+
function logInvalidAddonPluginHook(hook, plugin) {
|
| 734 |
+
return {
|
| 735 |
+
code: INVALID_PLUGIN_HOOK,
|
| 736 |
+
hook,
|
| 737 |
+
message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a string, a function hook or an object with a "handler" string or function.`,
|
| 738 |
+
plugin
|
| 739 |
+
};
|
| 740 |
+
}
|
| 741 |
+
function logInvalidFunctionPluginHook(hook, plugin) {
|
| 742 |
+
return {
|
| 743 |
+
code: INVALID_PLUGIN_HOOK,
|
| 744 |
+
hook,
|
| 745 |
+
message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a function hook or an object with a "handler" function.`,
|
| 746 |
+
plugin
|
| 747 |
+
};
|
| 748 |
+
}
|
| 749 |
+
function logInvalidRollupPhaseForChunkEmission() {
|
| 750 |
+
return {
|
| 751 |
+
code: INVALID_ROLLUP_PHASE,
|
| 752 |
+
message: `Cannot emit chunks after module loading has finished.`
|
| 753 |
+
};
|
| 754 |
+
}
|
| 755 |
+
function logInvalidSetAssetSourceCall() {
|
| 756 |
+
return {
|
| 757 |
+
code: INVALID_SETASSETSOURCE,
|
| 758 |
+
message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
|
| 759 |
+
};
|
| 760 |
+
}
|
| 761 |
+
function logInvalidFormatForTopLevelAwait(id, format) {
|
| 762 |
+
return {
|
| 763 |
+
code: INVALID_TLA_FORMAT,
|
| 764 |
+
id,
|
| 765 |
+
message: `Module format "${format}" does not support top-level await. Use the "es" or "system" output formats rather.`
|
| 766 |
+
};
|
| 767 |
+
}
|
| 768 |
+
function logMissingEntryExport(binding, exporter) {
|
| 769 |
+
return {
|
| 770 |
+
binding,
|
| 771 |
+
code: MISSING_EXPORT,
|
| 772 |
+
exporter,
|
| 773 |
+
message: `Exported variable "${binding}" is not defined in "${relativeId(exporter)}".`,
|
| 774 |
+
url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
|
| 775 |
+
};
|
| 776 |
+
}
|
| 777 |
+
function logMissingExport(binding, importingModule, exporter, missingButExportExists) {
|
| 778 |
+
const baseLog = {
|
| 779 |
+
binding,
|
| 780 |
+
code: MISSING_EXPORT,
|
| 781 |
+
exporter,
|
| 782 |
+
id: importingModule,
|
| 783 |
+
url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
|
| 784 |
+
};
|
| 785 |
+
if (missingButExportExists) {
|
| 786 |
+
return {
|
| 787 |
+
...baseLog,
|
| 788 |
+
message: `Exported variable "${binding}" is not defined in "${relativeId(exporter)}", but it is imported by "${relativeId(importingModule)}".`
|
| 789 |
+
};
|
| 790 |
+
}
|
| 791 |
+
const isJson = extname(exporter) === '.json';
|
| 792 |
+
return {
|
| 793 |
+
...baseLog,
|
| 794 |
+
message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId(importingModule)}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`
|
| 795 |
+
};
|
| 796 |
+
}
|
| 797 |
+
function logMissingGlobalName(externalId, guess) {
|
| 798 |
+
return {
|
| 799 |
+
code: MISSING_GLOBAL_NAME,
|
| 800 |
+
id: externalId,
|
| 801 |
+
message: `No name was provided for external module "${externalId}" in "output.globals" – guessing "${guess}".`,
|
| 802 |
+
names: [guess],
|
| 803 |
+
url: getRollupUrl(URL_OUTPUT_GLOBALS)
|
| 804 |
+
};
|
| 805 |
+
}
|
| 806 |
+
function logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) {
|
| 807 |
+
return {
|
| 808 |
+
code: MISSING_IMPLICIT_DEPENDANT,
|
| 809 |
+
message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.`
|
| 810 |
+
};
|
| 811 |
+
}
|
| 812 |
+
function logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) {
|
| 813 |
+
return {
|
| 814 |
+
code: MISSING_IMPLICIT_DEPENDANT,
|
| 815 |
+
message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.`
|
| 816 |
+
};
|
| 817 |
+
}
|
| 818 |
+
function logImplicitDependantIsNotIncluded(module) {
|
| 819 |
+
const implicitDependencies = [...module.implicitlyLoadedBefore]
|
| 820 |
+
.map(dependency => relativeId(dependency.id))
|
| 821 |
+
.sort();
|
| 822 |
+
return {
|
| 823 |
+
code: MISSING_IMPLICIT_DEPENDANT,
|
| 824 |
+
message: `Module "${relativeId(module.id)}" that should be implicitly loaded before ${printQuotedStringList(implicitDependencies)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
|
| 825 |
+
};
|
| 826 |
+
}
|
| 827 |
+
function logMissingJsxExport(name, exporter, importer) {
|
| 828 |
+
return {
|
| 829 |
+
code: MISSING_JSX_EXPORT,
|
| 830 |
+
exporter,
|
| 831 |
+
id: importer,
|
| 832 |
+
message: `Export "${name}" is not defined in module "${relativeId(exporter)}" even though it is needed in "${relativeId(importer)}" to provide JSX syntax. Please check your "jsx" option.`,
|
| 833 |
+
names: [name],
|
| 834 |
+
url: getRollupUrl(URL_JSX)
|
| 835 |
+
};
|
| 836 |
+
}
|
| 837 |
+
function logMissingNameOptionForIifeExport() {
|
| 838 |
+
return {
|
| 839 |
+
code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT,
|
| 840 |
+
message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`,
|
| 841 |
+
url: getRollupUrl(URL_OUTPUT_NAME)
|
| 842 |
+
};
|
| 843 |
+
}
|
| 844 |
+
function logMissingNameOptionForUmdExport() {
|
| 845 |
+
return {
|
| 846 |
+
code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT,
|
| 847 |
+
message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.',
|
| 848 |
+
url: getRollupUrl(URL_OUTPUT_NAME)
|
| 849 |
+
};
|
| 850 |
+
}
|
| 851 |
+
function logMissingNodeBuiltins(externalBuiltins) {
|
| 852 |
+
return {
|
| 853 |
+
code: MISSING_NODE_BUILTINS,
|
| 854 |
+
ids: externalBuiltins,
|
| 855 |
+
message: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(externalBuiltins)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`
|
| 856 |
+
};
|
| 857 |
+
}
|
| 858 |
+
function logMissingFileOrDirOption() {
|
| 859 |
+
return {
|
| 860 |
+
code: MISSING_OPTION,
|
| 861 |
+
message: 'You must specify "output.file" or "output.dir" for the build.',
|
| 862 |
+
url: getRollupUrl(URL_OUTPUT_DIR)
|
| 863 |
+
};
|
| 864 |
+
}
|
| 865 |
+
function logMixedExport(facadeModuleId, name) {
|
| 866 |
+
return {
|
| 867 |
+
code: MIXED_EXPORTS,
|
| 868 |
+
id: facadeModuleId,
|
| 869 |
+
message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}.default\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`,
|
| 870 |
+
url: getRollupUrl(URL_OUTPUT_EXPORTS)
|
| 871 |
+
};
|
| 872 |
+
}
|
| 873 |
+
function logModuleLevelDirective(directive, id) {
|
| 874 |
+
return {
|
| 875 |
+
code: MODULE_LEVEL_DIRECTIVE,
|
| 876 |
+
id,
|
| 877 |
+
message: `Module level directives cause errors when bundled, "${directive}" in "${relativeId(id)}" was ignored.`
|
| 878 |
+
};
|
| 879 |
+
}
|
| 880 |
+
function logNamespaceConflict(binding, reexportingModuleId, sources) {
|
| 881 |
+
return {
|
| 882 |
+
binding,
|
| 883 |
+
code: NAMESPACE_CONFLICT,
|
| 884 |
+
ids: sources,
|
| 885 |
+
message: `Conflicting namespaces: "${relativeId(reexportingModuleId)}" re-exports "${binding}" from one of the modules ${printQuotedStringList(sources.map(moduleId => relativeId(moduleId)))} (will be ignored).`,
|
| 886 |
+
reexporter: reexportingModuleId
|
| 887 |
+
};
|
| 888 |
+
}
|
| 889 |
+
function logNoTransformMapOrAstWithoutCode(pluginName) {
|
| 890 |
+
return {
|
| 891 |
+
code: NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,
|
| 892 |
+
message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` +
|
| 893 |
+
'a "code". This will be ignored.'
|
| 894 |
+
};
|
| 895 |
+
}
|
| 896 |
+
function logOptimizeChunkStatus(chunks, smallChunks, pointInTime) {
|
| 897 |
+
return {
|
| 898 |
+
code: OPTIMIZE_CHUNK_STATUS,
|
| 899 |
+
message: `${pointInTime}, there are\n` +
|
| 900 |
+
`${chunks} chunks, of which\n` +
|
| 901 |
+
`${smallChunks} are below minChunkSize.`
|
| 902 |
+
};
|
| 903 |
+
}
|
| 904 |
+
function logParseError(message, pos) {
|
| 905 |
+
return { code: PARSE_ERROR, message, pos };
|
| 906 |
+
}
|
| 907 |
+
function logRedeclarationError(name) {
|
| 908 |
+
return {
|
| 909 |
+
code: REDECLARATION_ERROR,
|
| 910 |
+
message: `Identifier "${name}" has already been declared`
|
| 911 |
+
};
|
| 912 |
+
}
|
| 913 |
+
function logReservedNamespace(namespace) {
|
| 914 |
+
return {
|
| 915 |
+
code: RESERVED_NAMESPACE,
|
| 916 |
+
message: `You have overridden reserved namespace "${namespace}"`
|
| 917 |
+
};
|
| 918 |
+
}
|
| 919 |
+
function logModuleParseError(error, moduleId) {
|
| 920 |
+
let message = error.message.replace(/ \(\d+:\d+\)$/, '');
|
| 921 |
+
if (moduleId.endsWith('.json')) {
|
| 922 |
+
message += ' (Note that you need @rollup/plugin-json to import JSON files)';
|
| 923 |
+
}
|
| 924 |
+
else if (!moduleId.endsWith('.js')) {
|
| 925 |
+
message += ' (Note that you need plugins to import files that are not JavaScript)';
|
| 926 |
+
}
|
| 927 |
+
return tweakStackMessage({
|
| 928 |
+
cause: error,
|
| 929 |
+
code: PARSE_ERROR,
|
| 930 |
+
id: moduleId,
|
| 931 |
+
message,
|
| 932 |
+
stack: error.stack
|
| 933 |
+
}, error.message);
|
| 934 |
+
}
|
| 935 |
+
function logPluginError(error, plugin, { hook, id } = {}) {
|
| 936 |
+
const code = error.code;
|
| 937 |
+
if (!error.pluginCode &&
|
| 938 |
+
code != null &&
|
| 939 |
+
(typeof code !== 'string' || !code.startsWith('PLUGIN_'))) {
|
| 940 |
+
error.pluginCode = code;
|
| 941 |
+
}
|
| 942 |
+
error.code = PLUGIN_ERROR;
|
| 943 |
+
error.plugin = plugin;
|
| 944 |
+
if (hook) {
|
| 945 |
+
error.hook = hook;
|
| 946 |
+
}
|
| 947 |
+
if (id) {
|
| 948 |
+
error.id = id;
|
| 949 |
+
}
|
| 950 |
+
return error;
|
| 951 |
+
}
|
| 952 |
+
function logShimmedExport(id, binding) {
|
| 953 |
+
return {
|
| 954 |
+
binding,
|
| 955 |
+
code: SHIMMED_EXPORT,
|
| 956 |
+
exporter: id,
|
| 957 |
+
message: `Missing export "${binding}" has been shimmed in module "${relativeId(id)}".`
|
| 958 |
+
};
|
| 959 |
+
}
|
| 960 |
+
function logSourcemapBroken(plugin) {
|
| 961 |
+
return {
|
| 962 |
+
code: SOURCEMAP_BROKEN,
|
| 963 |
+
message: `Sourcemap is likely to be incorrect: a plugin (${plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,
|
| 964 |
+
plugin,
|
| 965 |
+
url: getRollupUrl(URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT)
|
| 966 |
+
};
|
| 967 |
+
}
|
| 968 |
+
function logConflictingSourcemapSources(filename) {
|
| 969 |
+
return {
|
| 970 |
+
code: SOURCEMAP_BROKEN,
|
| 971 |
+
message: `Multiple conflicting contents for sourcemap source ${filename}`
|
| 972 |
+
};
|
| 973 |
+
}
|
| 974 |
+
function logInvalidSourcemapForError(error, id, column, line, pos) {
|
| 975 |
+
return {
|
| 976 |
+
cause: error,
|
| 977 |
+
code: SOURCEMAP_ERROR,
|
| 978 |
+
id,
|
| 979 |
+
loc: {
|
| 980 |
+
column,
|
| 981 |
+
file: id,
|
| 982 |
+
line
|
| 983 |
+
},
|
| 984 |
+
message: `Error when using sourcemap for reporting an error: ${error.message}`,
|
| 985 |
+
pos
|
| 986 |
+
};
|
| 987 |
+
}
|
| 988 |
+
function logSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOption) {
|
| 989 |
+
return {
|
| 990 |
+
code: SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,
|
| 991 |
+
exporter: id,
|
| 992 |
+
message: `Module "${relativeId(id)}" that is marked with \`syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}\` needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'
|
| 993 |
+
? `an explicit export named "${syntheticNamedExportsOption}"`
|
| 994 |
+
: 'a default export'} that does not reexport an unresolved named export of the same module.`
|
| 995 |
+
};
|
| 996 |
+
}
|
| 997 |
+
function logThisIsUndefined() {
|
| 998 |
+
return {
|
| 999 |
+
code: THIS_IS_UNDEFINED,
|
| 1000 |
+
message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,
|
| 1001 |
+
url: getRollupUrl(URL_THIS_IS_UNDEFINED)
|
| 1002 |
+
};
|
| 1003 |
+
}
|
| 1004 |
+
function logUnexpectedNamedImport(id, imported, isReexport) {
|
| 1005 |
+
const importType = isReexport ? 'reexport' : 'import';
|
| 1006 |
+
return {
|
| 1007 |
+
code: UNEXPECTED_NAMED_IMPORT,
|
| 1008 |
+
exporter: id,
|
| 1009 |
+
message: `The named export "${imported}" was ${importType}ed from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`,
|
| 1010 |
+
url: getRollupUrl(URL_OUTPUT_INTEROP)
|
| 1011 |
+
};
|
| 1012 |
+
}
|
| 1013 |
+
function logUnexpectedNamespaceReexport(id) {
|
| 1014 |
+
return {
|
| 1015 |
+
code: UNEXPECTED_NAMED_IMPORT,
|
| 1016 |
+
exporter: id,
|
| 1017 |
+
message: `There was a namespace "*" reexport from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,
|
| 1018 |
+
url: getRollupUrl(URL_OUTPUT_INTEROP)
|
| 1019 |
+
};
|
| 1020 |
+
}
|
| 1021 |
+
function logUnknownOption(optionType, unknownOptions, validOptions) {
|
| 1022 |
+
return {
|
| 1023 |
+
code: UNKNOWN_OPTION,
|
| 1024 |
+
message: `Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${validOptions.join(', ')}`
|
| 1025 |
+
};
|
| 1026 |
+
}
|
| 1027 |
+
function logEntryCannotBeExternal(unresolvedId) {
|
| 1028 |
+
return {
|
| 1029 |
+
code: UNRESOLVED_ENTRY,
|
| 1030 |
+
message: `Entry module "${relativeId(unresolvedId)}" cannot be external.`
|
| 1031 |
+
};
|
| 1032 |
+
}
|
| 1033 |
+
function logExternalModulesCannotBeIncludedInManualChunks(source) {
|
| 1034 |
+
return {
|
| 1035 |
+
code: EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS,
|
| 1036 |
+
message: `"${source}" cannot be included in manualChunks because it is resolved as an external module by the "external" option or plugins.`
|
| 1037 |
+
};
|
| 1038 |
+
}
|
| 1039 |
+
function logExternalModulesCannotBeTransformedToModules(source) {
|
| 1040 |
+
return {
|
| 1041 |
+
code: EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES,
|
| 1042 |
+
message: `${source} is resolved as a module now, but it was an external module before. Please check whether there are conflicts in your Rollup options "external" and "manualChunks", manualChunks cannot include external modules.`
|
| 1043 |
+
};
|
| 1044 |
+
}
|
| 1045 |
+
function logUnresolvedEntry(unresolvedId) {
|
| 1046 |
+
return {
|
| 1047 |
+
code: UNRESOLVED_ENTRY,
|
| 1048 |
+
message: `Could not resolve entry module "${relativeId(unresolvedId)}".`
|
| 1049 |
+
};
|
| 1050 |
+
}
|
| 1051 |
+
function logUnresolvedImport(source, importer) {
|
| 1052 |
+
return {
|
| 1053 |
+
code: UNRESOLVED_IMPORT,
|
| 1054 |
+
exporter: source,
|
| 1055 |
+
id: importer,
|
| 1056 |
+
message: `Could not resolve "${source}" from "${relativeId(importer)}"`
|
| 1057 |
+
};
|
| 1058 |
+
}
|
| 1059 |
+
function logUnresolvedImportTreatedAsExternal(source, importer) {
|
| 1060 |
+
return {
|
| 1061 |
+
code: UNRESOLVED_IMPORT,
|
| 1062 |
+
exporter: source,
|
| 1063 |
+
id: importer,
|
| 1064 |
+
message: `"${source}" is imported by "${relativeId(importer)}", but could not be resolved – treating it as an external dependency.`,
|
| 1065 |
+
url: getRollupUrl(URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY)
|
| 1066 |
+
};
|
| 1067 |
+
}
|
| 1068 |
+
function logUnusedExternalImports(externalId, names, importers) {
|
| 1069 |
+
return {
|
| 1070 |
+
code: UNUSED_EXTERNAL_IMPORT,
|
| 1071 |
+
exporter: externalId,
|
| 1072 |
+
ids: importers,
|
| 1073 |
+
message: `${printQuotedStringList(names, [
|
| 1074 |
+
'is',
|
| 1075 |
+
'are'
|
| 1076 |
+
])} imported from external module "${externalId}" but never used in ${printQuotedStringList(importers.map(importer => relativeId(importer)))}.`,
|
| 1077 |
+
names
|
| 1078 |
+
};
|
| 1079 |
+
}
|
| 1080 |
+
function logFailedValidation(message) {
|
| 1081 |
+
return {
|
| 1082 |
+
code: VALIDATION_ERROR,
|
| 1083 |
+
message
|
| 1084 |
+
};
|
| 1085 |
+
}
|
| 1086 |
+
function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, plugin) {
|
| 1087 |
+
warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onLog, options.strictDeprecations);
|
| 1088 |
+
}
|
| 1089 |
+
function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, log, strictDeprecations, plugin) {
|
| 1090 |
+
if (activeDeprecation || strictDeprecations) {
|
| 1091 |
+
const warning = logDeprecation(deprecation, urlSnippet);
|
| 1092 |
+
if (strictDeprecations) {
|
| 1093 |
+
return error(warning);
|
| 1094 |
+
}
|
| 1095 |
+
log(LOGLEVEL_WARN, warning);
|
| 1096 |
+
}
|
| 1097 |
+
}
|
| 1098 |
+
|
| 1099 |
+
// This file is generated by scripts/generate-buffer-to-ast.js.
|
| 1100 |
+
// Do not edit this file directly.
|
| 1101 |
+
function convertProgram(buffer) {
|
| 1102 |
+
const node = convertNode(0, buffer);
|
| 1103 |
+
switch (node.type) {
|
| 1104 |
+
case PanicError: {
|
| 1105 |
+
return error(getRollupError(logParseError(node.message)));
|
| 1106 |
+
}
|
| 1107 |
+
case ParseError: {
|
| 1108 |
+
return error(getRollupError(logParseError(node.message, node.start)));
|
| 1109 |
+
}
|
| 1110 |
+
default: {
|
| 1111 |
+
return node;
|
| 1112 |
+
}
|
| 1113 |
+
}
|
| 1114 |
+
}
|
| 1115 |
+
/* eslint-disable sort-keys */
|
| 1116 |
+
const nodeConverters = [
|
| 1117 |
+
function panicError(position, buffer) {
|
| 1118 |
+
return {
|
| 1119 |
+
type: 'PanicError',
|
| 1120 |
+
start: buffer[position],
|
| 1121 |
+
end: buffer[position + 1],
|
| 1122 |
+
message: buffer.convertString(buffer[position + 2])
|
| 1123 |
+
};
|
| 1124 |
+
},
|
| 1125 |
+
function parseError(position, buffer) {
|
| 1126 |
+
return {
|
| 1127 |
+
type: 'ParseError',
|
| 1128 |
+
start: buffer[position],
|
| 1129 |
+
end: buffer[position + 1],
|
| 1130 |
+
message: buffer.convertString(buffer[position + 2])
|
| 1131 |
+
};
|
| 1132 |
+
},
|
| 1133 |
+
function arrayExpression(position, buffer) {
|
| 1134 |
+
return {
|
| 1135 |
+
type: 'ArrayExpression',
|
| 1136 |
+
start: buffer[position],
|
| 1137 |
+
end: buffer[position + 1],
|
| 1138 |
+
elements: convertNodeList(buffer[position + 2], buffer)
|
| 1139 |
+
};
|
| 1140 |
+
},
|
| 1141 |
+
function arrayPattern(position, buffer) {
|
| 1142 |
+
return {
|
| 1143 |
+
type: 'ArrayPattern',
|
| 1144 |
+
start: buffer[position],
|
| 1145 |
+
end: buffer[position + 1],
|
| 1146 |
+
elements: convertNodeList(buffer[position + 2], buffer)
|
| 1147 |
+
};
|
| 1148 |
+
},
|
| 1149 |
+
function arrowFunctionExpression(position, buffer) {
|
| 1150 |
+
const flags = buffer[position + 2];
|
| 1151 |
+
const annotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1152 |
+
return {
|
| 1153 |
+
type: 'ArrowFunctionExpression',
|
| 1154 |
+
start: buffer[position],
|
| 1155 |
+
end: buffer[position + 1],
|
| 1156 |
+
async: (flags & 1) === 1,
|
| 1157 |
+
expression: (flags & 2) === 2,
|
| 1158 |
+
generator: (flags & 4) === 4,
|
| 1159 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1160 |
+
params: convertNodeList(buffer[position + 4], buffer),
|
| 1161 |
+
body: convertNode(buffer[position + 5], buffer),
|
| 1162 |
+
id: null
|
| 1163 |
+
};
|
| 1164 |
+
},
|
| 1165 |
+
function assignmentExpression(position, buffer) {
|
| 1166 |
+
return {
|
| 1167 |
+
type: 'AssignmentExpression',
|
| 1168 |
+
start: buffer[position],
|
| 1169 |
+
end: buffer[position + 1],
|
| 1170 |
+
operator: FIXED_STRINGS[buffer[position + 2]],
|
| 1171 |
+
left: convertNode(buffer[position + 3], buffer),
|
| 1172 |
+
right: convertNode(buffer[position + 4], buffer)
|
| 1173 |
+
};
|
| 1174 |
+
},
|
| 1175 |
+
function assignmentPattern(position, buffer) {
|
| 1176 |
+
return {
|
| 1177 |
+
type: 'AssignmentPattern',
|
| 1178 |
+
start: buffer[position],
|
| 1179 |
+
end: buffer[position + 1],
|
| 1180 |
+
left: convertNode(buffer[position + 2], buffer),
|
| 1181 |
+
right: convertNode(buffer[position + 3], buffer)
|
| 1182 |
+
};
|
| 1183 |
+
},
|
| 1184 |
+
function awaitExpression(position, buffer) {
|
| 1185 |
+
return {
|
| 1186 |
+
type: 'AwaitExpression',
|
| 1187 |
+
start: buffer[position],
|
| 1188 |
+
end: buffer[position + 1],
|
| 1189 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 1190 |
+
};
|
| 1191 |
+
},
|
| 1192 |
+
function binaryExpression(position, buffer) {
|
| 1193 |
+
return {
|
| 1194 |
+
type: 'BinaryExpression',
|
| 1195 |
+
start: buffer[position],
|
| 1196 |
+
end: buffer[position + 1],
|
| 1197 |
+
operator: FIXED_STRINGS[buffer[position + 2]],
|
| 1198 |
+
left: convertNode(buffer[position + 3], buffer),
|
| 1199 |
+
right: convertNode(buffer[position + 4], buffer)
|
| 1200 |
+
};
|
| 1201 |
+
},
|
| 1202 |
+
function blockStatement(position, buffer) {
|
| 1203 |
+
return {
|
| 1204 |
+
type: 'BlockStatement',
|
| 1205 |
+
start: buffer[position],
|
| 1206 |
+
end: buffer[position + 1],
|
| 1207 |
+
body: convertNodeList(buffer[position + 2], buffer)
|
| 1208 |
+
};
|
| 1209 |
+
},
|
| 1210 |
+
function breakStatement(position, buffer) {
|
| 1211 |
+
const labelPosition = buffer[position + 2];
|
| 1212 |
+
return {
|
| 1213 |
+
type: 'BreakStatement',
|
| 1214 |
+
start: buffer[position],
|
| 1215 |
+
end: buffer[position + 1],
|
| 1216 |
+
label: labelPosition === 0 ? null : convertNode(labelPosition, buffer)
|
| 1217 |
+
};
|
| 1218 |
+
},
|
| 1219 |
+
function callExpression(position, buffer) {
|
| 1220 |
+
const flags = buffer[position + 2];
|
| 1221 |
+
const annotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1222 |
+
return {
|
| 1223 |
+
type: 'CallExpression',
|
| 1224 |
+
start: buffer[position],
|
| 1225 |
+
end: buffer[position + 1],
|
| 1226 |
+
optional: (flags & 1) === 1,
|
| 1227 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1228 |
+
callee: convertNode(buffer[position + 4], buffer),
|
| 1229 |
+
arguments: convertNodeList(buffer[position + 5], buffer)
|
| 1230 |
+
};
|
| 1231 |
+
},
|
| 1232 |
+
function catchClause(position, buffer) {
|
| 1233 |
+
const parameterPosition = buffer[position + 2];
|
| 1234 |
+
return {
|
| 1235 |
+
type: 'CatchClause',
|
| 1236 |
+
start: buffer[position],
|
| 1237 |
+
end: buffer[position + 1],
|
| 1238 |
+
param: parameterPosition === 0 ? null : convertNode(parameterPosition, buffer),
|
| 1239 |
+
body: convertNode(buffer[position + 3], buffer)
|
| 1240 |
+
};
|
| 1241 |
+
},
|
| 1242 |
+
function chainExpression(position, buffer) {
|
| 1243 |
+
return {
|
| 1244 |
+
type: 'ChainExpression',
|
| 1245 |
+
start: buffer[position],
|
| 1246 |
+
end: buffer[position + 1],
|
| 1247 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1248 |
+
};
|
| 1249 |
+
},
|
| 1250 |
+
function classBody(position, buffer) {
|
| 1251 |
+
return {
|
| 1252 |
+
type: 'ClassBody',
|
| 1253 |
+
start: buffer[position],
|
| 1254 |
+
end: buffer[position + 1],
|
| 1255 |
+
body: convertNodeList(buffer[position + 2], buffer)
|
| 1256 |
+
};
|
| 1257 |
+
},
|
| 1258 |
+
function classDeclaration(position, buffer) {
|
| 1259 |
+
const idPosition = buffer[position + 3];
|
| 1260 |
+
const superClassPosition = buffer[position + 4];
|
| 1261 |
+
return {
|
| 1262 |
+
type: 'ClassDeclaration',
|
| 1263 |
+
start: buffer[position],
|
| 1264 |
+
end: buffer[position + 1],
|
| 1265 |
+
decorators: convertNodeList(buffer[position + 2], buffer),
|
| 1266 |
+
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
| 1267 |
+
superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer),
|
| 1268 |
+
body: convertNode(buffer[position + 5], buffer)
|
| 1269 |
+
};
|
| 1270 |
+
},
|
| 1271 |
+
function classExpression(position, buffer) {
|
| 1272 |
+
const idPosition = buffer[position + 3];
|
| 1273 |
+
const superClassPosition = buffer[position + 4];
|
| 1274 |
+
return {
|
| 1275 |
+
type: 'ClassExpression',
|
| 1276 |
+
start: buffer[position],
|
| 1277 |
+
end: buffer[position + 1],
|
| 1278 |
+
decorators: convertNodeList(buffer[position + 2], buffer),
|
| 1279 |
+
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
| 1280 |
+
superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer),
|
| 1281 |
+
body: convertNode(buffer[position + 5], buffer)
|
| 1282 |
+
};
|
| 1283 |
+
},
|
| 1284 |
+
function conditionalExpression(position, buffer) {
|
| 1285 |
+
return {
|
| 1286 |
+
type: 'ConditionalExpression',
|
| 1287 |
+
start: buffer[position],
|
| 1288 |
+
end: buffer[position + 1],
|
| 1289 |
+
test: convertNode(buffer[position + 2], buffer),
|
| 1290 |
+
consequent: convertNode(buffer[position + 3], buffer),
|
| 1291 |
+
alternate: convertNode(buffer[position + 4], buffer)
|
| 1292 |
+
};
|
| 1293 |
+
},
|
| 1294 |
+
function continueStatement(position, buffer) {
|
| 1295 |
+
const labelPosition = buffer[position + 2];
|
| 1296 |
+
return {
|
| 1297 |
+
type: 'ContinueStatement',
|
| 1298 |
+
start: buffer[position],
|
| 1299 |
+
end: buffer[position + 1],
|
| 1300 |
+
label: labelPosition === 0 ? null : convertNode(labelPosition, buffer)
|
| 1301 |
+
};
|
| 1302 |
+
},
|
| 1303 |
+
function debuggerStatement(position, buffer) {
|
| 1304 |
+
return {
|
| 1305 |
+
type: 'DebuggerStatement',
|
| 1306 |
+
start: buffer[position],
|
| 1307 |
+
end: buffer[position + 1]
|
| 1308 |
+
};
|
| 1309 |
+
},
|
| 1310 |
+
function decorator(position, buffer) {
|
| 1311 |
+
return {
|
| 1312 |
+
type: 'Decorator',
|
| 1313 |
+
start: buffer[position],
|
| 1314 |
+
end: buffer[position + 1],
|
| 1315 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1316 |
+
};
|
| 1317 |
+
},
|
| 1318 |
+
function directive(position, buffer) {
|
| 1319 |
+
return {
|
| 1320 |
+
type: 'ExpressionStatement',
|
| 1321 |
+
start: buffer[position],
|
| 1322 |
+
end: buffer[position + 1],
|
| 1323 |
+
directive: buffer.convertString(buffer[position + 2]),
|
| 1324 |
+
expression: convertNode(buffer[position + 3], buffer)
|
| 1325 |
+
};
|
| 1326 |
+
},
|
| 1327 |
+
function doWhileStatement(position, buffer) {
|
| 1328 |
+
return {
|
| 1329 |
+
type: 'DoWhileStatement',
|
| 1330 |
+
start: buffer[position],
|
| 1331 |
+
end: buffer[position + 1],
|
| 1332 |
+
body: convertNode(buffer[position + 2], buffer),
|
| 1333 |
+
test: convertNode(buffer[position + 3], buffer)
|
| 1334 |
+
};
|
| 1335 |
+
},
|
| 1336 |
+
function emptyStatement(position, buffer) {
|
| 1337 |
+
return {
|
| 1338 |
+
type: 'EmptyStatement',
|
| 1339 |
+
start: buffer[position],
|
| 1340 |
+
end: buffer[position + 1]
|
| 1341 |
+
};
|
| 1342 |
+
},
|
| 1343 |
+
function exportAllDeclaration(position, buffer) {
|
| 1344 |
+
const exportedPosition = buffer[position + 2];
|
| 1345 |
+
return {
|
| 1346 |
+
type: 'ExportAllDeclaration',
|
| 1347 |
+
start: buffer[position],
|
| 1348 |
+
end: buffer[position + 1],
|
| 1349 |
+
exported: exportedPosition === 0 ? null : convertNode(exportedPosition, buffer),
|
| 1350 |
+
source: convertNode(buffer[position + 3], buffer),
|
| 1351 |
+
attributes: convertNodeList(buffer[position + 4], buffer)
|
| 1352 |
+
};
|
| 1353 |
+
},
|
| 1354 |
+
function exportDefaultDeclaration(position, buffer) {
|
| 1355 |
+
return {
|
| 1356 |
+
type: 'ExportDefaultDeclaration',
|
| 1357 |
+
start: buffer[position],
|
| 1358 |
+
end: buffer[position + 1],
|
| 1359 |
+
declaration: convertNode(buffer[position + 2], buffer)
|
| 1360 |
+
};
|
| 1361 |
+
},
|
| 1362 |
+
function exportNamedDeclaration(position, buffer) {
|
| 1363 |
+
const sourcePosition = buffer[position + 3];
|
| 1364 |
+
const declarationPosition = buffer[position + 5];
|
| 1365 |
+
return {
|
| 1366 |
+
type: 'ExportNamedDeclaration',
|
| 1367 |
+
start: buffer[position],
|
| 1368 |
+
end: buffer[position + 1],
|
| 1369 |
+
specifiers: convertNodeList(buffer[position + 2], buffer),
|
| 1370 |
+
source: sourcePosition === 0 ? null : convertNode(sourcePosition, buffer),
|
| 1371 |
+
attributes: convertNodeList(buffer[position + 4], buffer),
|
| 1372 |
+
declaration: declarationPosition === 0 ? null : convertNode(declarationPosition, buffer)
|
| 1373 |
+
};
|
| 1374 |
+
},
|
| 1375 |
+
function exportSpecifier(position, buffer) {
|
| 1376 |
+
const local = convertNode(buffer[position + 2], buffer);
|
| 1377 |
+
const exportedPosition = buffer[position + 3];
|
| 1378 |
+
return {
|
| 1379 |
+
type: 'ExportSpecifier',
|
| 1380 |
+
start: buffer[position],
|
| 1381 |
+
end: buffer[position + 1],
|
| 1382 |
+
local,
|
| 1383 |
+
exported: exportedPosition === 0 ? { ...local } : convertNode(exportedPosition, buffer)
|
| 1384 |
+
};
|
| 1385 |
+
},
|
| 1386 |
+
function expressionStatement(position, buffer) {
|
| 1387 |
+
return {
|
| 1388 |
+
type: 'ExpressionStatement',
|
| 1389 |
+
start: buffer[position],
|
| 1390 |
+
end: buffer[position + 1],
|
| 1391 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1392 |
+
};
|
| 1393 |
+
},
|
| 1394 |
+
function forInStatement(position, buffer) {
|
| 1395 |
+
return {
|
| 1396 |
+
type: 'ForInStatement',
|
| 1397 |
+
start: buffer[position],
|
| 1398 |
+
end: buffer[position + 1],
|
| 1399 |
+
left: convertNode(buffer[position + 2], buffer),
|
| 1400 |
+
right: convertNode(buffer[position + 3], buffer),
|
| 1401 |
+
body: convertNode(buffer[position + 4], buffer)
|
| 1402 |
+
};
|
| 1403 |
+
},
|
| 1404 |
+
function forOfStatement(position, buffer) {
|
| 1405 |
+
const flags = buffer[position + 2];
|
| 1406 |
+
return {
|
| 1407 |
+
type: 'ForOfStatement',
|
| 1408 |
+
start: buffer[position],
|
| 1409 |
+
end: buffer[position + 1],
|
| 1410 |
+
await: (flags & 1) === 1,
|
| 1411 |
+
left: convertNode(buffer[position + 3], buffer),
|
| 1412 |
+
right: convertNode(buffer[position + 4], buffer),
|
| 1413 |
+
body: convertNode(buffer[position + 5], buffer)
|
| 1414 |
+
};
|
| 1415 |
+
},
|
| 1416 |
+
function forStatement(position, buffer) {
|
| 1417 |
+
const initPosition = buffer[position + 2];
|
| 1418 |
+
const testPosition = buffer[position + 3];
|
| 1419 |
+
const updatePosition = buffer[position + 4];
|
| 1420 |
+
return {
|
| 1421 |
+
type: 'ForStatement',
|
| 1422 |
+
start: buffer[position],
|
| 1423 |
+
end: buffer[position + 1],
|
| 1424 |
+
init: initPosition === 0 ? null : convertNode(initPosition, buffer),
|
| 1425 |
+
test: testPosition === 0 ? null : convertNode(testPosition, buffer),
|
| 1426 |
+
update: updatePosition === 0 ? null : convertNode(updatePosition, buffer),
|
| 1427 |
+
body: convertNode(buffer[position + 5], buffer)
|
| 1428 |
+
};
|
| 1429 |
+
},
|
| 1430 |
+
function functionDeclaration(position, buffer) {
|
| 1431 |
+
const flags = buffer[position + 2];
|
| 1432 |
+
const annotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1433 |
+
const idPosition = buffer[position + 4];
|
| 1434 |
+
return {
|
| 1435 |
+
type: 'FunctionDeclaration',
|
| 1436 |
+
start: buffer[position],
|
| 1437 |
+
end: buffer[position + 1],
|
| 1438 |
+
async: (flags & 1) === 1,
|
| 1439 |
+
generator: (flags & 2) === 2,
|
| 1440 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1441 |
+
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
| 1442 |
+
params: convertNodeList(buffer[position + 5], buffer),
|
| 1443 |
+
body: convertNode(buffer[position + 6], buffer),
|
| 1444 |
+
expression: false
|
| 1445 |
+
};
|
| 1446 |
+
},
|
| 1447 |
+
function functionExpression(position, buffer) {
|
| 1448 |
+
const flags = buffer[position + 2];
|
| 1449 |
+
const annotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1450 |
+
const idPosition = buffer[position + 4];
|
| 1451 |
+
return {
|
| 1452 |
+
type: 'FunctionExpression',
|
| 1453 |
+
start: buffer[position],
|
| 1454 |
+
end: buffer[position + 1],
|
| 1455 |
+
async: (flags & 1) === 1,
|
| 1456 |
+
generator: (flags & 2) === 2,
|
| 1457 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1458 |
+
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
| 1459 |
+
params: convertNodeList(buffer[position + 5], buffer),
|
| 1460 |
+
body: convertNode(buffer[position + 6], buffer),
|
| 1461 |
+
expression: false
|
| 1462 |
+
};
|
| 1463 |
+
},
|
| 1464 |
+
function identifier(position, buffer) {
|
| 1465 |
+
return {
|
| 1466 |
+
type: 'Identifier',
|
| 1467 |
+
start: buffer[position],
|
| 1468 |
+
end: buffer[position + 1],
|
| 1469 |
+
name: buffer.convertString(buffer[position + 2])
|
| 1470 |
+
};
|
| 1471 |
+
},
|
| 1472 |
+
function ifStatement(position, buffer) {
|
| 1473 |
+
const alternatePosition = buffer[position + 4];
|
| 1474 |
+
return {
|
| 1475 |
+
type: 'IfStatement',
|
| 1476 |
+
start: buffer[position],
|
| 1477 |
+
end: buffer[position + 1],
|
| 1478 |
+
test: convertNode(buffer[position + 2], buffer),
|
| 1479 |
+
consequent: convertNode(buffer[position + 3], buffer),
|
| 1480 |
+
alternate: alternatePosition === 0 ? null : convertNode(alternatePosition, buffer)
|
| 1481 |
+
};
|
| 1482 |
+
},
|
| 1483 |
+
function importAttribute(position, buffer) {
|
| 1484 |
+
return {
|
| 1485 |
+
type: 'ImportAttribute',
|
| 1486 |
+
start: buffer[position],
|
| 1487 |
+
end: buffer[position + 1],
|
| 1488 |
+
key: convertNode(buffer[position + 2], buffer),
|
| 1489 |
+
value: convertNode(buffer[position + 3], buffer)
|
| 1490 |
+
};
|
| 1491 |
+
},
|
| 1492 |
+
function importDeclaration(position, buffer) {
|
| 1493 |
+
return {
|
| 1494 |
+
type: 'ImportDeclaration',
|
| 1495 |
+
start: buffer[position],
|
| 1496 |
+
end: buffer[position + 1],
|
| 1497 |
+
specifiers: convertNodeList(buffer[position + 2], buffer),
|
| 1498 |
+
source: convertNode(buffer[position + 3], buffer),
|
| 1499 |
+
attributes: convertNodeList(buffer[position + 4], buffer)
|
| 1500 |
+
};
|
| 1501 |
+
},
|
| 1502 |
+
function importDefaultSpecifier(position, buffer) {
|
| 1503 |
+
return {
|
| 1504 |
+
type: 'ImportDefaultSpecifier',
|
| 1505 |
+
start: buffer[position],
|
| 1506 |
+
end: buffer[position + 1],
|
| 1507 |
+
local: convertNode(buffer[position + 2], buffer)
|
| 1508 |
+
};
|
| 1509 |
+
},
|
| 1510 |
+
function importExpression(position, buffer) {
|
| 1511 |
+
const optionsPosition = buffer[position + 3];
|
| 1512 |
+
return {
|
| 1513 |
+
type: 'ImportExpression',
|
| 1514 |
+
start: buffer[position],
|
| 1515 |
+
end: buffer[position + 1],
|
| 1516 |
+
source: convertNode(buffer[position + 2], buffer),
|
| 1517 |
+
options: optionsPosition === 0 ? null : convertNode(optionsPosition, buffer)
|
| 1518 |
+
};
|
| 1519 |
+
},
|
| 1520 |
+
function importNamespaceSpecifier(position, buffer) {
|
| 1521 |
+
return {
|
| 1522 |
+
type: 'ImportNamespaceSpecifier',
|
| 1523 |
+
start: buffer[position],
|
| 1524 |
+
end: buffer[position + 1],
|
| 1525 |
+
local: convertNode(buffer[position + 2], buffer)
|
| 1526 |
+
};
|
| 1527 |
+
},
|
| 1528 |
+
function importSpecifier(position, buffer) {
|
| 1529 |
+
const importedPosition = buffer[position + 2];
|
| 1530 |
+
const local = convertNode(buffer[position + 3], buffer);
|
| 1531 |
+
return {
|
| 1532 |
+
type: 'ImportSpecifier',
|
| 1533 |
+
start: buffer[position],
|
| 1534 |
+
end: buffer[position + 1],
|
| 1535 |
+
imported: importedPosition === 0 ? { ...local } : convertNode(importedPosition, buffer),
|
| 1536 |
+
local
|
| 1537 |
+
};
|
| 1538 |
+
},
|
| 1539 |
+
function jsxAttribute(position, buffer) {
|
| 1540 |
+
const valuePosition = buffer[position + 3];
|
| 1541 |
+
return {
|
| 1542 |
+
type: 'JSXAttribute',
|
| 1543 |
+
start: buffer[position],
|
| 1544 |
+
end: buffer[position + 1],
|
| 1545 |
+
name: convertNode(buffer[position + 2], buffer),
|
| 1546 |
+
value: valuePosition === 0 ? null : convertNode(valuePosition, buffer)
|
| 1547 |
+
};
|
| 1548 |
+
},
|
| 1549 |
+
function jsxClosingElement(position, buffer) {
|
| 1550 |
+
return {
|
| 1551 |
+
type: 'JSXClosingElement',
|
| 1552 |
+
start: buffer[position],
|
| 1553 |
+
end: buffer[position + 1],
|
| 1554 |
+
name: convertNode(buffer[position + 2], buffer)
|
| 1555 |
+
};
|
| 1556 |
+
},
|
| 1557 |
+
function jsxClosingFragment(position, buffer) {
|
| 1558 |
+
return {
|
| 1559 |
+
type: 'JSXClosingFragment',
|
| 1560 |
+
start: buffer[position],
|
| 1561 |
+
end: buffer[position + 1]
|
| 1562 |
+
};
|
| 1563 |
+
},
|
| 1564 |
+
function jsxElement(position, buffer) {
|
| 1565 |
+
const closingElementPosition = buffer[position + 4];
|
| 1566 |
+
return {
|
| 1567 |
+
type: 'JSXElement',
|
| 1568 |
+
start: buffer[position],
|
| 1569 |
+
end: buffer[position + 1],
|
| 1570 |
+
openingElement: convertNode(buffer[position + 2], buffer),
|
| 1571 |
+
children: convertNodeList(buffer[position + 3], buffer),
|
| 1572 |
+
closingElement: closingElementPosition === 0 ? null : convertNode(closingElementPosition, buffer)
|
| 1573 |
+
};
|
| 1574 |
+
},
|
| 1575 |
+
function jsxEmptyExpression(position, buffer) {
|
| 1576 |
+
return {
|
| 1577 |
+
type: 'JSXEmptyExpression',
|
| 1578 |
+
start: buffer[position],
|
| 1579 |
+
end: buffer[position + 1]
|
| 1580 |
+
};
|
| 1581 |
+
},
|
| 1582 |
+
function jsxExpressionContainer(position, buffer) {
|
| 1583 |
+
return {
|
| 1584 |
+
type: 'JSXExpressionContainer',
|
| 1585 |
+
start: buffer[position],
|
| 1586 |
+
end: buffer[position + 1],
|
| 1587 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1588 |
+
};
|
| 1589 |
+
},
|
| 1590 |
+
function jsxFragment(position, buffer) {
|
| 1591 |
+
return {
|
| 1592 |
+
type: 'JSXFragment',
|
| 1593 |
+
start: buffer[position],
|
| 1594 |
+
end: buffer[position + 1],
|
| 1595 |
+
openingFragment: convertNode(buffer[position + 2], buffer),
|
| 1596 |
+
children: convertNodeList(buffer[position + 3], buffer),
|
| 1597 |
+
closingFragment: convertNode(buffer[position + 4], buffer)
|
| 1598 |
+
};
|
| 1599 |
+
},
|
| 1600 |
+
function jsxIdentifier(position, buffer) {
|
| 1601 |
+
return {
|
| 1602 |
+
type: 'JSXIdentifier',
|
| 1603 |
+
start: buffer[position],
|
| 1604 |
+
end: buffer[position + 1],
|
| 1605 |
+
name: buffer.convertString(buffer[position + 2])
|
| 1606 |
+
};
|
| 1607 |
+
},
|
| 1608 |
+
function jsxMemberExpression(position, buffer) {
|
| 1609 |
+
return {
|
| 1610 |
+
type: 'JSXMemberExpression',
|
| 1611 |
+
start: buffer[position],
|
| 1612 |
+
end: buffer[position + 1],
|
| 1613 |
+
object: convertNode(buffer[position + 2], buffer),
|
| 1614 |
+
property: convertNode(buffer[position + 3], buffer)
|
| 1615 |
+
};
|
| 1616 |
+
},
|
| 1617 |
+
function jsxNamespacedName(position, buffer) {
|
| 1618 |
+
return {
|
| 1619 |
+
type: 'JSXNamespacedName',
|
| 1620 |
+
start: buffer[position],
|
| 1621 |
+
end: buffer[position + 1],
|
| 1622 |
+
namespace: convertNode(buffer[position + 2], buffer),
|
| 1623 |
+
name: convertNode(buffer[position + 3], buffer)
|
| 1624 |
+
};
|
| 1625 |
+
},
|
| 1626 |
+
function jsxOpeningElement(position, buffer) {
|
| 1627 |
+
const flags = buffer[position + 2];
|
| 1628 |
+
return {
|
| 1629 |
+
type: 'JSXOpeningElement',
|
| 1630 |
+
start: buffer[position],
|
| 1631 |
+
end: buffer[position + 1],
|
| 1632 |
+
selfClosing: (flags & 1) === 1,
|
| 1633 |
+
name: convertNode(buffer[position + 3], buffer),
|
| 1634 |
+
attributes: convertNodeList(buffer[position + 4], buffer)
|
| 1635 |
+
};
|
| 1636 |
+
},
|
| 1637 |
+
function jsxOpeningFragment(position, buffer) {
|
| 1638 |
+
return {
|
| 1639 |
+
type: 'JSXOpeningFragment',
|
| 1640 |
+
start: buffer[position],
|
| 1641 |
+
end: buffer[position + 1],
|
| 1642 |
+
attributes: [],
|
| 1643 |
+
selfClosing: false
|
| 1644 |
+
};
|
| 1645 |
+
},
|
| 1646 |
+
function jsxSpreadAttribute(position, buffer) {
|
| 1647 |
+
return {
|
| 1648 |
+
type: 'JSXSpreadAttribute',
|
| 1649 |
+
start: buffer[position],
|
| 1650 |
+
end: buffer[position + 1],
|
| 1651 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 1652 |
+
};
|
| 1653 |
+
},
|
| 1654 |
+
function jsxSpreadChild(position, buffer) {
|
| 1655 |
+
return {
|
| 1656 |
+
type: 'JSXSpreadChild',
|
| 1657 |
+
start: buffer[position],
|
| 1658 |
+
end: buffer[position + 1],
|
| 1659 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1660 |
+
};
|
| 1661 |
+
},
|
| 1662 |
+
function jsxText(position, buffer) {
|
| 1663 |
+
return {
|
| 1664 |
+
type: 'JSXText',
|
| 1665 |
+
start: buffer[position],
|
| 1666 |
+
end: buffer[position + 1],
|
| 1667 |
+
value: buffer.convertString(buffer[position + 2]),
|
| 1668 |
+
raw: buffer.convertString(buffer[position + 3])
|
| 1669 |
+
};
|
| 1670 |
+
},
|
| 1671 |
+
function labeledStatement(position, buffer) {
|
| 1672 |
+
return {
|
| 1673 |
+
type: 'LabeledStatement',
|
| 1674 |
+
start: buffer[position],
|
| 1675 |
+
end: buffer[position + 1],
|
| 1676 |
+
label: convertNode(buffer[position + 2], buffer),
|
| 1677 |
+
body: convertNode(buffer[position + 3], buffer)
|
| 1678 |
+
};
|
| 1679 |
+
},
|
| 1680 |
+
function literalBigInt(position, buffer) {
|
| 1681 |
+
const bigint = buffer.convertString(buffer[position + 2]);
|
| 1682 |
+
return {
|
| 1683 |
+
type: 'Literal',
|
| 1684 |
+
start: buffer[position],
|
| 1685 |
+
end: buffer[position + 1],
|
| 1686 |
+
bigint,
|
| 1687 |
+
raw: buffer.convertString(buffer[position + 3]),
|
| 1688 |
+
value: BigInt(bigint)
|
| 1689 |
+
};
|
| 1690 |
+
},
|
| 1691 |
+
function literalBoolean(position, buffer) {
|
| 1692 |
+
const flags = buffer[position + 2];
|
| 1693 |
+
const value = (flags & 1) === 1;
|
| 1694 |
+
return {
|
| 1695 |
+
type: 'Literal',
|
| 1696 |
+
start: buffer[position],
|
| 1697 |
+
end: buffer[position + 1],
|
| 1698 |
+
value,
|
| 1699 |
+
raw: value ? 'true' : 'false'
|
| 1700 |
+
};
|
| 1701 |
+
},
|
| 1702 |
+
function literalNull(position, buffer) {
|
| 1703 |
+
return {
|
| 1704 |
+
type: 'Literal',
|
| 1705 |
+
start: buffer[position],
|
| 1706 |
+
end: buffer[position + 1],
|
| 1707 |
+
raw: 'null',
|
| 1708 |
+
value: null
|
| 1709 |
+
};
|
| 1710 |
+
},
|
| 1711 |
+
function literalNumber(position, buffer) {
|
| 1712 |
+
const rawPosition = buffer[position + 2];
|
| 1713 |
+
return {
|
| 1714 |
+
type: 'Literal',
|
| 1715 |
+
start: buffer[position],
|
| 1716 |
+
end: buffer[position + 1],
|
| 1717 |
+
raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition),
|
| 1718 |
+
value: new DataView(buffer.buffer).getFloat64((position + 3) << 2, true)
|
| 1719 |
+
};
|
| 1720 |
+
},
|
| 1721 |
+
function literalRegExp(position, buffer) {
|
| 1722 |
+
const flags = buffer.convertString(buffer[position + 2]);
|
| 1723 |
+
const pattern = buffer.convertString(buffer[position + 3]);
|
| 1724 |
+
return {
|
| 1725 |
+
type: 'Literal',
|
| 1726 |
+
start: buffer[position],
|
| 1727 |
+
end: buffer[position + 1],
|
| 1728 |
+
raw: `/${pattern}/${flags}`,
|
| 1729 |
+
regex: { flags, pattern },
|
| 1730 |
+
value: new RegExp(pattern, flags)
|
| 1731 |
+
};
|
| 1732 |
+
},
|
| 1733 |
+
function literalString(position, buffer) {
|
| 1734 |
+
const rawPosition = buffer[position + 3];
|
| 1735 |
+
return {
|
| 1736 |
+
type: 'Literal',
|
| 1737 |
+
start: buffer[position],
|
| 1738 |
+
end: buffer[position + 1],
|
| 1739 |
+
value: buffer.convertString(buffer[position + 2]),
|
| 1740 |
+
raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition)
|
| 1741 |
+
};
|
| 1742 |
+
},
|
| 1743 |
+
function logicalExpression(position, buffer) {
|
| 1744 |
+
return {
|
| 1745 |
+
type: 'LogicalExpression',
|
| 1746 |
+
start: buffer[position],
|
| 1747 |
+
end: buffer[position + 1],
|
| 1748 |
+
operator: FIXED_STRINGS[buffer[position + 2]],
|
| 1749 |
+
left: convertNode(buffer[position + 3], buffer),
|
| 1750 |
+
right: convertNode(buffer[position + 4], buffer)
|
| 1751 |
+
};
|
| 1752 |
+
},
|
| 1753 |
+
function memberExpression(position, buffer) {
|
| 1754 |
+
const flags = buffer[position + 2];
|
| 1755 |
+
return {
|
| 1756 |
+
type: 'MemberExpression',
|
| 1757 |
+
start: buffer[position],
|
| 1758 |
+
end: buffer[position + 1],
|
| 1759 |
+
computed: (flags & 1) === 1,
|
| 1760 |
+
optional: (flags & 2) === 2,
|
| 1761 |
+
object: convertNode(buffer[position + 3], buffer),
|
| 1762 |
+
property: convertNode(buffer[position + 4], buffer)
|
| 1763 |
+
};
|
| 1764 |
+
},
|
| 1765 |
+
function metaProperty(position, buffer) {
|
| 1766 |
+
return {
|
| 1767 |
+
type: 'MetaProperty',
|
| 1768 |
+
start: buffer[position],
|
| 1769 |
+
end: buffer[position + 1],
|
| 1770 |
+
meta: convertNode(buffer[position + 2], buffer),
|
| 1771 |
+
property: convertNode(buffer[position + 3], buffer)
|
| 1772 |
+
};
|
| 1773 |
+
},
|
| 1774 |
+
function methodDefinition(position, buffer) {
|
| 1775 |
+
const flags = buffer[position + 2];
|
| 1776 |
+
return {
|
| 1777 |
+
type: 'MethodDefinition',
|
| 1778 |
+
start: buffer[position],
|
| 1779 |
+
end: buffer[position + 1],
|
| 1780 |
+
static: (flags & 1) === 1,
|
| 1781 |
+
computed: (flags & 2) === 2,
|
| 1782 |
+
decorators: convertNodeList(buffer[position + 3], buffer),
|
| 1783 |
+
key: convertNode(buffer[position + 4], buffer),
|
| 1784 |
+
value: convertNode(buffer[position + 5], buffer),
|
| 1785 |
+
kind: FIXED_STRINGS[buffer[position + 6]]
|
| 1786 |
+
};
|
| 1787 |
+
},
|
| 1788 |
+
function newExpression(position, buffer) {
|
| 1789 |
+
const annotations = convertAnnotations(buffer[position + 2], buffer);
|
| 1790 |
+
return {
|
| 1791 |
+
type: 'NewExpression',
|
| 1792 |
+
start: buffer[position],
|
| 1793 |
+
end: buffer[position + 1],
|
| 1794 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1795 |
+
callee: convertNode(buffer[position + 3], buffer),
|
| 1796 |
+
arguments: convertNodeList(buffer[position + 4], buffer)
|
| 1797 |
+
};
|
| 1798 |
+
},
|
| 1799 |
+
function objectExpression(position, buffer) {
|
| 1800 |
+
return {
|
| 1801 |
+
type: 'ObjectExpression',
|
| 1802 |
+
start: buffer[position],
|
| 1803 |
+
end: buffer[position + 1],
|
| 1804 |
+
properties: convertNodeList(buffer[position + 2], buffer)
|
| 1805 |
+
};
|
| 1806 |
+
},
|
| 1807 |
+
function objectPattern(position, buffer) {
|
| 1808 |
+
return {
|
| 1809 |
+
type: 'ObjectPattern',
|
| 1810 |
+
start: buffer[position],
|
| 1811 |
+
end: buffer[position + 1],
|
| 1812 |
+
properties: convertNodeList(buffer[position + 2], buffer)
|
| 1813 |
+
};
|
| 1814 |
+
},
|
| 1815 |
+
function privateIdentifier(position, buffer) {
|
| 1816 |
+
return {
|
| 1817 |
+
type: 'PrivateIdentifier',
|
| 1818 |
+
start: buffer[position],
|
| 1819 |
+
end: buffer[position + 1],
|
| 1820 |
+
name: buffer.convertString(buffer[position + 2])
|
| 1821 |
+
};
|
| 1822 |
+
},
|
| 1823 |
+
function program(position, buffer) {
|
| 1824 |
+
const invalidAnnotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1825 |
+
return {
|
| 1826 |
+
type: 'Program',
|
| 1827 |
+
start: buffer[position],
|
| 1828 |
+
end: buffer[position + 1],
|
| 1829 |
+
body: convertNodeList(buffer[position + 2], buffer),
|
| 1830 |
+
...(invalidAnnotations.length > 0 ? { [INVALID_ANNOTATION_KEY]: invalidAnnotations } : {}),
|
| 1831 |
+
sourceType: 'module'
|
| 1832 |
+
};
|
| 1833 |
+
},
|
| 1834 |
+
function property(position, buffer) {
|
| 1835 |
+
const flags = buffer[position + 2];
|
| 1836 |
+
const keyPosition = buffer[position + 3];
|
| 1837 |
+
const value = convertNode(buffer[position + 4], buffer);
|
| 1838 |
+
return {
|
| 1839 |
+
type: 'Property',
|
| 1840 |
+
start: buffer[position],
|
| 1841 |
+
end: buffer[position + 1],
|
| 1842 |
+
method: (flags & 1) === 1,
|
| 1843 |
+
shorthand: (flags & 2) === 2,
|
| 1844 |
+
computed: (flags & 4) === 4,
|
| 1845 |
+
key: keyPosition === 0 ? { ...value } : convertNode(keyPosition, buffer),
|
| 1846 |
+
value,
|
| 1847 |
+
kind: FIXED_STRINGS[buffer[position + 5]]
|
| 1848 |
+
};
|
| 1849 |
+
},
|
| 1850 |
+
function propertyDefinition(position, buffer) {
|
| 1851 |
+
const flags = buffer[position + 2];
|
| 1852 |
+
const valuePosition = buffer[position + 5];
|
| 1853 |
+
return {
|
| 1854 |
+
type: 'PropertyDefinition',
|
| 1855 |
+
start: buffer[position],
|
| 1856 |
+
end: buffer[position + 1],
|
| 1857 |
+
static: (flags & 1) === 1,
|
| 1858 |
+
computed: (flags & 2) === 2,
|
| 1859 |
+
decorators: convertNodeList(buffer[position + 3], buffer),
|
| 1860 |
+
key: convertNode(buffer[position + 4], buffer),
|
| 1861 |
+
value: valuePosition === 0 ? null : convertNode(valuePosition, buffer)
|
| 1862 |
+
};
|
| 1863 |
+
},
|
| 1864 |
+
function restElement(position, buffer) {
|
| 1865 |
+
return {
|
| 1866 |
+
type: 'RestElement',
|
| 1867 |
+
start: buffer[position],
|
| 1868 |
+
end: buffer[position + 1],
|
| 1869 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 1870 |
+
};
|
| 1871 |
+
},
|
| 1872 |
+
function returnStatement(position, buffer) {
|
| 1873 |
+
const argumentPosition = buffer[position + 2];
|
| 1874 |
+
return {
|
| 1875 |
+
type: 'ReturnStatement',
|
| 1876 |
+
start: buffer[position],
|
| 1877 |
+
end: buffer[position + 1],
|
| 1878 |
+
argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer)
|
| 1879 |
+
};
|
| 1880 |
+
},
|
| 1881 |
+
function sequenceExpression(position, buffer) {
|
| 1882 |
+
return {
|
| 1883 |
+
type: 'SequenceExpression',
|
| 1884 |
+
start: buffer[position],
|
| 1885 |
+
end: buffer[position + 1],
|
| 1886 |
+
expressions: convertNodeList(buffer[position + 2], buffer)
|
| 1887 |
+
};
|
| 1888 |
+
},
|
| 1889 |
+
function spreadElement(position, buffer) {
|
| 1890 |
+
return {
|
| 1891 |
+
type: 'SpreadElement',
|
| 1892 |
+
start: buffer[position],
|
| 1893 |
+
end: buffer[position + 1],
|
| 1894 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 1895 |
+
};
|
| 1896 |
+
},
|
| 1897 |
+
function staticBlock(position, buffer) {
|
| 1898 |
+
return {
|
| 1899 |
+
type: 'StaticBlock',
|
| 1900 |
+
start: buffer[position],
|
| 1901 |
+
end: buffer[position + 1],
|
| 1902 |
+
body: convertNodeList(buffer[position + 2], buffer)
|
| 1903 |
+
};
|
| 1904 |
+
},
|
| 1905 |
+
function superElement(position, buffer) {
|
| 1906 |
+
return {
|
| 1907 |
+
type: 'Super',
|
| 1908 |
+
start: buffer[position],
|
| 1909 |
+
end: buffer[position + 1]
|
| 1910 |
+
};
|
| 1911 |
+
},
|
| 1912 |
+
function switchCase(position, buffer) {
|
| 1913 |
+
const testPosition = buffer[position + 2];
|
| 1914 |
+
return {
|
| 1915 |
+
type: 'SwitchCase',
|
| 1916 |
+
start: buffer[position],
|
| 1917 |
+
end: buffer[position + 1],
|
| 1918 |
+
test: testPosition === 0 ? null : convertNode(testPosition, buffer),
|
| 1919 |
+
consequent: convertNodeList(buffer[position + 3], buffer)
|
| 1920 |
+
};
|
| 1921 |
+
},
|
| 1922 |
+
function switchStatement(position, buffer) {
|
| 1923 |
+
return {
|
| 1924 |
+
type: 'SwitchStatement',
|
| 1925 |
+
start: buffer[position],
|
| 1926 |
+
end: buffer[position + 1],
|
| 1927 |
+
discriminant: convertNode(buffer[position + 2], buffer),
|
| 1928 |
+
cases: convertNodeList(buffer[position + 3], buffer)
|
| 1929 |
+
};
|
| 1930 |
+
},
|
| 1931 |
+
function taggedTemplateExpression(position, buffer) {
|
| 1932 |
+
return {
|
| 1933 |
+
type: 'TaggedTemplateExpression',
|
| 1934 |
+
start: buffer[position],
|
| 1935 |
+
end: buffer[position + 1],
|
| 1936 |
+
tag: convertNode(buffer[position + 2], buffer),
|
| 1937 |
+
quasi: convertNode(buffer[position + 3], buffer)
|
| 1938 |
+
};
|
| 1939 |
+
},
|
| 1940 |
+
function templateElement(position, buffer) {
|
| 1941 |
+
const flags = buffer[position + 2];
|
| 1942 |
+
const cookedPosition = buffer[position + 3];
|
| 1943 |
+
const cooked = cookedPosition === 0 ? null : buffer.convertString(cookedPosition);
|
| 1944 |
+
const raw = buffer.convertString(buffer[position + 4]);
|
| 1945 |
+
return {
|
| 1946 |
+
type: 'TemplateElement',
|
| 1947 |
+
start: buffer[position],
|
| 1948 |
+
end: buffer[position + 1],
|
| 1949 |
+
tail: (flags & 1) === 1,
|
| 1950 |
+
value: { cooked, raw }
|
| 1951 |
+
};
|
| 1952 |
+
},
|
| 1953 |
+
function templateLiteral(position, buffer) {
|
| 1954 |
+
return {
|
| 1955 |
+
type: 'TemplateLiteral',
|
| 1956 |
+
start: buffer[position],
|
| 1957 |
+
end: buffer[position + 1],
|
| 1958 |
+
quasis: convertNodeList(buffer[position + 2], buffer),
|
| 1959 |
+
expressions: convertNodeList(buffer[position + 3], buffer)
|
| 1960 |
+
};
|
| 1961 |
+
},
|
| 1962 |
+
function thisExpression(position, buffer) {
|
| 1963 |
+
return {
|
| 1964 |
+
type: 'ThisExpression',
|
| 1965 |
+
start: buffer[position],
|
| 1966 |
+
end: buffer[position + 1]
|
| 1967 |
+
};
|
| 1968 |
+
},
|
| 1969 |
+
function throwStatement(position, buffer) {
|
| 1970 |
+
return {
|
| 1971 |
+
type: 'ThrowStatement',
|
| 1972 |
+
start: buffer[position],
|
| 1973 |
+
end: buffer[position + 1],
|
| 1974 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 1975 |
+
};
|
| 1976 |
+
},
|
| 1977 |
+
function tryStatement(position, buffer) {
|
| 1978 |
+
const handlerPosition = buffer[position + 3];
|
| 1979 |
+
const finalizerPosition = buffer[position + 4];
|
| 1980 |
+
return {
|
| 1981 |
+
type: 'TryStatement',
|
| 1982 |
+
start: buffer[position],
|
| 1983 |
+
end: buffer[position + 1],
|
| 1984 |
+
block: convertNode(buffer[position + 2], buffer),
|
| 1985 |
+
handler: handlerPosition === 0 ? null : convertNode(handlerPosition, buffer),
|
| 1986 |
+
finalizer: finalizerPosition === 0 ? null : convertNode(finalizerPosition, buffer)
|
| 1987 |
+
};
|
| 1988 |
+
},
|
| 1989 |
+
function unaryExpression(position, buffer) {
|
| 1990 |
+
return {
|
| 1991 |
+
type: 'UnaryExpression',
|
| 1992 |
+
start: buffer[position],
|
| 1993 |
+
end: buffer[position + 1],
|
| 1994 |
+
operator: FIXED_STRINGS[buffer[position + 2]],
|
| 1995 |
+
argument: convertNode(buffer[position + 3], buffer),
|
| 1996 |
+
prefix: true
|
| 1997 |
+
};
|
| 1998 |
+
},
|
| 1999 |
+
function updateExpression(position, buffer) {
|
| 2000 |
+
const flags = buffer[position + 2];
|
| 2001 |
+
return {
|
| 2002 |
+
type: 'UpdateExpression',
|
| 2003 |
+
start: buffer[position],
|
| 2004 |
+
end: buffer[position + 1],
|
| 2005 |
+
prefix: (flags & 1) === 1,
|
| 2006 |
+
operator: FIXED_STRINGS[buffer[position + 3]],
|
| 2007 |
+
argument: convertNode(buffer[position + 4], buffer)
|
| 2008 |
+
};
|
| 2009 |
+
},
|
| 2010 |
+
function variableDeclaration(position, buffer) {
|
| 2011 |
+
return {
|
| 2012 |
+
type: 'VariableDeclaration',
|
| 2013 |
+
start: buffer[position],
|
| 2014 |
+
end: buffer[position + 1],
|
| 2015 |
+
kind: FIXED_STRINGS[buffer[position + 2]],
|
| 2016 |
+
declarations: convertNodeList(buffer[position + 3], buffer)
|
| 2017 |
+
};
|
| 2018 |
+
},
|
| 2019 |
+
function variableDeclarator(position, buffer) {
|
| 2020 |
+
const initPosition = buffer[position + 3];
|
| 2021 |
+
return {
|
| 2022 |
+
type: 'VariableDeclarator',
|
| 2023 |
+
start: buffer[position],
|
| 2024 |
+
end: buffer[position + 1],
|
| 2025 |
+
id: convertNode(buffer[position + 2], buffer),
|
| 2026 |
+
init: initPosition === 0 ? null : convertNode(initPosition, buffer)
|
| 2027 |
+
};
|
| 2028 |
+
},
|
| 2029 |
+
function whileStatement(position, buffer) {
|
| 2030 |
+
return {
|
| 2031 |
+
type: 'WhileStatement',
|
| 2032 |
+
start: buffer[position],
|
| 2033 |
+
end: buffer[position + 1],
|
| 2034 |
+
test: convertNode(buffer[position + 2], buffer),
|
| 2035 |
+
body: convertNode(buffer[position + 3], buffer)
|
| 2036 |
+
};
|
| 2037 |
+
},
|
| 2038 |
+
function yieldExpression(position, buffer) {
|
| 2039 |
+
const flags = buffer[position + 2];
|
| 2040 |
+
const argumentPosition = buffer[position + 3];
|
| 2041 |
+
return {
|
| 2042 |
+
type: 'YieldExpression',
|
| 2043 |
+
start: buffer[position],
|
| 2044 |
+
end: buffer[position + 1],
|
| 2045 |
+
delegate: (flags & 1) === 1,
|
| 2046 |
+
argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer)
|
| 2047 |
+
};
|
| 2048 |
+
}
|
| 2049 |
+
];
|
| 2050 |
+
function convertNode(position, buffer) {
|
| 2051 |
+
const nodeType = buffer[position];
|
| 2052 |
+
const converter = nodeConverters[nodeType];
|
| 2053 |
+
/* istanbul ignore if: This should never be executed but is a safeguard against faulty buffers */
|
| 2054 |
+
if (!converter) {
|
| 2055 |
+
console.trace();
|
| 2056 |
+
throw new Error(`Unknown node type: ${nodeType}`);
|
| 2057 |
+
}
|
| 2058 |
+
return converter(position + 1, buffer);
|
| 2059 |
+
}
|
| 2060 |
+
function convertNodeList(position, buffer) {
|
| 2061 |
+
if (position === 0)
|
| 2062 |
+
return EMPTY_ARRAY;
|
| 2063 |
+
const length = buffer[position++];
|
| 2064 |
+
const list = new Array(length);
|
| 2065 |
+
for (let index = 0; index < length; index++) {
|
| 2066 |
+
const nodePosition = buffer[position++];
|
| 2067 |
+
list[index] = nodePosition ? convertNode(nodePosition, buffer) : null;
|
| 2068 |
+
}
|
| 2069 |
+
return list;
|
| 2070 |
+
}
|
| 2071 |
+
|
| 2072 |
+
function getAstBuffer(astBuffer) {
|
| 2073 |
+
const array = new Uint32Array(astBuffer.buffer);
|
| 2074 |
+
let convertString;
|
| 2075 |
+
if (typeof Buffer !== 'undefined' && astBuffer instanceof Buffer) {
|
| 2076 |
+
convertString = (position) => {
|
| 2077 |
+
const length = array[position++];
|
| 2078 |
+
const bytePosition = position << 2;
|
| 2079 |
+
return astBuffer.toString('utf8', bytePosition, bytePosition + length);
|
| 2080 |
+
};
|
| 2081 |
+
}
|
| 2082 |
+
else {
|
| 2083 |
+
const textDecoder = new TextDecoder();
|
| 2084 |
+
convertString = (position) => {
|
| 2085 |
+
const length = array[position++];
|
| 2086 |
+
const bytePosition = position << 2;
|
| 2087 |
+
return textDecoder.decode(astBuffer.subarray(bytePosition, bytePosition + length));
|
| 2088 |
+
};
|
| 2089 |
+
}
|
| 2090 |
+
return Object.assign(array, { convertString });
|
| 2091 |
+
}
|
| 2092 |
+
|
| 2093 |
+
const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(parse(input, allowReturnOutsideFunction, jsx)));
|
| 2094 |
+
const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await parseAsync(input, allowReturnOutsideFunction, jsx, signal)));
|
| 2095 |
+
|
| 2096 |
+
export { ANNOTATION_KEY, ArrowFunctionExpression, AwaitExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, FunctionExpression, INVALID_ANNOTATION_KEY, Identifier, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, Literal, MemberExpression, ObjectExpression, Program, Property, RestElement, ReturnStatement, StaticBlock, TemplateLiteral, URL_GENERATEBUNDLE, URL_JSX, URL_LOAD, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_SOURCEMAPFILE, URL_PRESERVEENTRYSIGNATURES, URL_TRANSFORM, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_WATCH, VariableDeclarator, addTrailingSlashIfMissed, augmentCodeLocation, augmentLogMessage, convertAnnotations, convertNode, error, getAliasName, getAstBuffer, getImportPath, getRollupError, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularChunk, logCircularDependency, logCircularReexport, logConflictingSourcemapSources, logConstVariableReassignError, logCyclicCrossChunkReexport, logDuplicateArgumentNameError, logDuplicateExportError, logDuplicatePluginName, logEmptyChunk, logEntryCannotBeExternal, logEval, logExternalModulesCannotBeIncludedInManualChunks, logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logFailedValidation, logFileNameConflict, logFileReferenceIdNotFoundForFilename, logFirstSideEffect, logIllegalIdentifierAsName, logIllegalImportReassignment, logImplicitDependantCannotBeExternal, logImplicitDependantIsNotIncluded, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logIncompatibleExportOptionValue, logInconsistentImportAttributes, logInputHookInOutputPlugin, logInternalIdCannotBeExternal, logInvalidAddonPluginHook, logInvalidAnnotation, logInvalidExportOptionValue, logInvalidFormatForTopLevelAwait, logInvalidFunctionPluginHook, logInvalidLogPosition, logInvalidOption, logInvalidRollupPhaseForChunkEmission, logInvalidSetAssetSourceCall, logInvalidSourcemapForError, logLevelPriority, logMissingEntryExport, logMissingExport, logMissingFileOrDirOption, logMissingGlobalName, logMissingJsxExport, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logOptimizeChunkStatus, logParseError, logPluginError, logRedeclarationError, logReservedNamespace, logShimmedExport, logSourcemapBroken, logSyntheticNamedExportsNeedNamespaceExport, logThisIsUndefined, logUnexpectedNamedImport, logUnexpectedNamespaceReexport, logUnknownOption, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logUnusedExternalImports, normalize, parseAst, parseAstAsync, printQuotedStringList, relative, relativeId, warnDeprecation };
|
node_modules/rollup/dist/es/shared/watch.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
node_modules/rollup/dist/getLogFilter.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { RollupLog } from './rollup';
|
| 2 |
+
|
| 3 |
+
export type GetLogFilter = typeof getLogFilter;
|
| 4 |
+
|
| 5 |
+
export function getLogFilter(filters: string[]): (log: RollupLog) => boolean;
|
node_modules/rollup/dist/getLogFilter.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
'use strict';
|
| 11 |
+
|
| 12 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 13 |
+
|
| 14 |
+
const getLogFilter = filters => {
|
| 15 |
+
if (filters.length === 0)
|
| 16 |
+
return () => true;
|
| 17 |
+
const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => {
|
| 18 |
+
const inverted = subFilter[0] === '!';
|
| 19 |
+
if (inverted)
|
| 20 |
+
subFilter = subFilter.slice(1);
|
| 21 |
+
const [key, ...value] = subFilter.split(':');
|
| 22 |
+
return { inverted, key: key.split('.'), parts: value.join(':').split('*') };
|
| 23 |
+
}));
|
| 24 |
+
return (log) => {
|
| 25 |
+
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
|
| 26 |
+
for (const { inverted, key, parts } of intersectedFilters) {
|
| 27 |
+
const isFilterSatisfied = testFilter(log, key, parts);
|
| 28 |
+
if (inverted ? isFilterSatisfied : !isFilterSatisfied) {
|
| 29 |
+
continue nextIntersectedFilter;
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
return true;
|
| 33 |
+
}
|
| 34 |
+
return false;
|
| 35 |
+
};
|
| 36 |
+
};
|
| 37 |
+
const testFilter = (log, key, parts) => {
|
| 38 |
+
let rawValue = log;
|
| 39 |
+
for (let index = 0; index < key.length; index++) {
|
| 40 |
+
if (!rawValue) {
|
| 41 |
+
return false;
|
| 42 |
+
}
|
| 43 |
+
const part = key[index];
|
| 44 |
+
if (!(part in rawValue)) {
|
| 45 |
+
return false;
|
| 46 |
+
}
|
| 47 |
+
rawValue = rawValue[part];
|
| 48 |
+
}
|
| 49 |
+
let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue);
|
| 50 |
+
if (parts.length === 1) {
|
| 51 |
+
return value === parts[0];
|
| 52 |
+
}
|
| 53 |
+
if (!value.startsWith(parts[0])) {
|
| 54 |
+
return false;
|
| 55 |
+
}
|
| 56 |
+
const lastPartIndex = parts.length - 1;
|
| 57 |
+
for (let index = 1; index < lastPartIndex; index++) {
|
| 58 |
+
const part = parts[index];
|
| 59 |
+
const position = value.indexOf(part);
|
| 60 |
+
if (position === -1) {
|
| 61 |
+
return false;
|
| 62 |
+
}
|
| 63 |
+
value = value.slice(position + part.length);
|
| 64 |
+
}
|
| 65 |
+
return value.endsWith(parts[lastPartIndex]);
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.getLogFilter = getLogFilter;
|
| 69 |
+
//# sourceMappingURL=getLogFilter.js.map
|
node_modules/rollup/dist/loadConfigFile.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { LogHandler, MergedRollupOptions, RollupLog } from './rollup';
|
| 2 |
+
|
| 3 |
+
export interface BatchWarnings {
|
| 4 |
+
add: (warning: RollupLog) => void;
|
| 5 |
+
readonly count: number;
|
| 6 |
+
flush: () => void;
|
| 7 |
+
log: LogHandler;
|
| 8 |
+
readonly warningOccurred: boolean;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
export type LoadConfigFile = typeof loadConfigFile;
|
| 12 |
+
|
| 13 |
+
export function loadConfigFile(
|
| 14 |
+
fileName: string,
|
| 15 |
+
commandOptions: any,
|
| 16 |
+
watchMode?: boolean
|
| 17 |
+
): Promise<{
|
| 18 |
+
options: MergedRollupOptions[];
|
| 19 |
+
warnings: BatchWarnings;
|
| 20 |
+
}>;
|
node_modules/rollup/dist/loadConfigFile.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
'use strict';
|
| 11 |
+
|
| 12 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 13 |
+
|
| 14 |
+
require('node:fs/promises');
|
| 15 |
+
require('node:path');
|
| 16 |
+
require('node:process');
|
| 17 |
+
require('node:url');
|
| 18 |
+
require('./shared/rollup.js');
|
| 19 |
+
require('./shared/parseAst.js');
|
| 20 |
+
const loadConfigFile_js = require('./shared/loadConfigFile.js');
|
| 21 |
+
require('path');
|
| 22 |
+
require('./native.js');
|
| 23 |
+
require('node:perf_hooks');
|
| 24 |
+
require('./getLogFilter.js');
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
exports.loadConfigFile = loadConfigFile_js.loadConfigFile;
|
| 29 |
+
//# sourceMappingURL=loadConfigFile.js.map
|
node_modules/rollup/dist/native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|
| 2 |
+
const path = require('node:path');
|
| 3 |
+
const { platform, arch, report } = require('node:process');
|
| 4 |
+
const { spawnSync } = require('node:child_process');
|
| 5 |
+
|
| 6 |
+
const getReportHeader = () => {
|
| 7 |
+
try {
|
| 8 |
+
if (platform !== 'win32') {
|
| 9 |
+
return report.getReport().header;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
// This is needed because report.getReport() crashes the process on Windows sometimes.
|
| 13 |
+
const script =
|
| 14 |
+
"console.log(JSON.stringify(require('node:process').report.getReport().header));";
|
| 15 |
+
const child = spawnSync(process.execPath, ['-p', script], {
|
| 16 |
+
encoding: 'utf8',
|
| 17 |
+
timeout: 3000,
|
| 18 |
+
windowsHide: true
|
| 19 |
+
});
|
| 20 |
+
|
| 21 |
+
if (child.status !== 0) {
|
| 22 |
+
return null;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
// The output from node -p might include a trailing 'undefined' and newline
|
| 26 |
+
const stdout = child.stdout?.replace(/undefined\r?\n?$/, '').trim();
|
| 27 |
+
if (!stdout) {
|
| 28 |
+
return null;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
return JSON.parse(stdout);
|
| 32 |
+
} catch {
|
| 33 |
+
return null;
|
| 34 |
+
}
|
| 35 |
+
};
|
| 36 |
+
|
| 37 |
+
let reportHeader;
|
| 38 |
+
const isMingw32 = () => {
|
| 39 |
+
reportHeader ??= getReportHeader();
|
| 40 |
+
|
| 41 |
+
return reportHeader?.osName?.startsWith('MINGW32_NT') ?? false;
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
const isMusl = () => {
|
| 45 |
+
reportHeader ??= getReportHeader();
|
| 46 |
+
|
| 47 |
+
return reportHeader ? !reportHeader.glibcVersionRuntime : false;
|
| 48 |
+
};
|
| 49 |
+
|
| 50 |
+
const bindingsByPlatformAndArch = {
|
| 51 |
+
android: {
|
| 52 |
+
arm: { base: 'android-arm-eabi' },
|
| 53 |
+
arm64: { base: 'android-arm64' }
|
| 54 |
+
},
|
| 55 |
+
darwin: {
|
| 56 |
+
arm64: { base: 'darwin-arm64' },
|
| 57 |
+
x64: { base: 'darwin-x64' }
|
| 58 |
+
},
|
| 59 |
+
freebsd: {
|
| 60 |
+
arm64: { base: 'freebsd-arm64' },
|
| 61 |
+
x64: { base: 'freebsd-x64' }
|
| 62 |
+
},
|
| 63 |
+
linux: {
|
| 64 |
+
arm: { base: 'linux-arm-gnueabihf', musl: 'linux-arm-musleabihf' },
|
| 65 |
+
arm64: { base: 'linux-arm64-gnu', musl: 'linux-arm64-musl' },
|
| 66 |
+
loong64: { base: 'linux-loong64-gnu', musl: 'linux-loong64-musl' },
|
| 67 |
+
ppc64: { base: 'linux-ppc64-gnu', musl: 'linux-ppc64-musl' },
|
| 68 |
+
riscv64: { base: 'linux-riscv64-gnu', musl: 'linux-riscv64-musl' },
|
| 69 |
+
s390x: { base: 'linux-s390x-gnu', musl: null },
|
| 70 |
+
x64: { base: 'linux-x64-gnu', musl: 'linux-x64-musl' }
|
| 71 |
+
},
|
| 72 |
+
openbsd: {
|
| 73 |
+
x64: { base: 'openbsd-x64' }
|
| 74 |
+
},
|
| 75 |
+
openharmony: {
|
| 76 |
+
arm64: { base: 'openharmony-arm64' }
|
| 77 |
+
},
|
| 78 |
+
win32: {
|
| 79 |
+
arm64: { base: 'win32-arm64-msvc' },
|
| 80 |
+
ia32: { base: 'win32-ia32-msvc' },
|
| 81 |
+
x64: {
|
| 82 |
+
base: isMingw32() ? 'win32-x64-gnu' : 'win32-x64-msvc'
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
};
|
| 86 |
+
|
| 87 |
+
const msvcLinkFilenameByArch = {
|
| 88 |
+
arm64: 'vc_redist.arm64.exe',
|
| 89 |
+
ia32: 'vc_redist.x86.exe',
|
| 90 |
+
x64: 'vc_redist.x64.exe'
|
| 91 |
+
};
|
| 92 |
+
|
| 93 |
+
const packageBase = getPackageBase();
|
| 94 |
+
const localName = `./rollup.${packageBase}.node`;
|
| 95 |
+
const requireWithFriendlyError = id => {
|
| 96 |
+
try {
|
| 97 |
+
return require(id);
|
| 98 |
+
} catch (error) {
|
| 99 |
+
if (
|
| 100 |
+
platform === 'win32' &&
|
| 101 |
+
error instanceof Error &&
|
| 102 |
+
error.code === 'ERR_DLOPEN_FAILED' &&
|
| 103 |
+
error.message.includes('The specified module could not be found')
|
| 104 |
+
) {
|
| 105 |
+
const msvcDownloadLink = `https://aka.ms/vs/17/release/${msvcLinkFilenameByArch[arch]}`;
|
| 106 |
+
throw new Error(
|
| 107 |
+
`Failed to load module ${id}. ` +
|
| 108 |
+
'Required DLL was not found. ' +
|
| 109 |
+
'This error usually happens when Microsoft Visual C++ Redistributable is not installed. ' +
|
| 110 |
+
`You can download it from ${msvcDownloadLink}`,
|
| 111 |
+
{ cause: error }
|
| 112 |
+
);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
throw new Error(
|
| 116 |
+
`Cannot find module ${id}. ` +
|
| 117 |
+
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
| 118 |
+
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
|
| 119 |
+
{ cause: error }
|
| 120 |
+
);
|
| 121 |
+
}
|
| 122 |
+
};
|
| 123 |
+
|
| 124 |
+
const { parse, parseAsync, xxhashBase64Url, xxhashBase36, xxhashBase16 } = requireWithFriendlyError(
|
| 125 |
+
existsSync(path.join(__dirname, localName)) ? localName : `@rollup/rollup-${packageBase}`
|
| 126 |
+
);
|
| 127 |
+
|
| 128 |
+
function getPackageBase() {
|
| 129 |
+
const imported = bindingsByPlatformAndArch[platform]?.[arch];
|
| 130 |
+
if (!imported) {
|
| 131 |
+
throwUnsupportedError(false);
|
| 132 |
+
}
|
| 133 |
+
if ('musl' in imported && isMusl()) {
|
| 134 |
+
return imported.musl || throwUnsupportedError(true);
|
| 135 |
+
}
|
| 136 |
+
return imported.base;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
function throwUnsupportedError(isMusl) {
|
| 140 |
+
throw new Error(
|
| 141 |
+
`Your current platform "${platform}${isMusl ? ' (musl)' : ''}" and architecture "${arch}" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.
|
| 142 |
+
|
| 143 |
+
The following platform-architecture combinations are supported:
|
| 144 |
+
${Object.entries(bindingsByPlatformAndArch)
|
| 145 |
+
.flatMap(([platformName, architectures]) =>
|
| 146 |
+
Object.entries(architectures).flatMap(([architectureName, { musl }]) => {
|
| 147 |
+
const name = `${platformName}-${architectureName}`;
|
| 148 |
+
return musl ? [name, `${name} (musl)`] : [name];
|
| 149 |
+
})
|
| 150 |
+
)
|
| 151 |
+
.join('\n')}
|
| 152 |
+
|
| 153 |
+
If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.`
|
| 154 |
+
);
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
module.exports.parse = parse;
|
| 158 |
+
module.exports.parseAsync = parseAsync;
|
| 159 |
+
module.exports.xxhashBase64Url = xxhashBase64Url;
|
| 160 |
+
module.exports.xxhashBase36 = xxhashBase36;
|
| 161 |
+
module.exports.xxhashBase16 = xxhashBase16;
|
node_modules/rollup/dist/parseAst.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { ParseAst, ParseAstAsync } from './rollup';
|
| 2 |
+
|
| 3 |
+
export const parseAst: ParseAst;
|
| 4 |
+
export const parseAstAsync: ParseAstAsync;
|
node_modules/rollup/dist/parseAst.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
'use strict';
|
| 11 |
+
|
| 12 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 13 |
+
|
| 14 |
+
require('./native.js');
|
| 15 |
+
const parseAst_js = require('./shared/parseAst.js');
|
| 16 |
+
require('node:path');
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
exports.parseAst = parseAst_js.parseAst;
|
| 21 |
+
exports.parseAstAsync = parseAst_js.parseAstAsync;
|
| 22 |
+
//# sourceMappingURL=parseAst.js.map
|
node_modules/rollup/dist/rollup.d.ts
ADDED
|
@@ -0,0 +1,1225 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type * as estree from 'estree';
|
| 2 |
+
|
| 3 |
+
declare module 'estree' {
|
| 4 |
+
export interface Decorator extends estree.BaseNode {
|
| 5 |
+
type: 'Decorator';
|
| 6 |
+
expression: estree.Expression;
|
| 7 |
+
}
|
| 8 |
+
interface PropertyDefinition {
|
| 9 |
+
decorators: estree.Decorator[];
|
| 10 |
+
}
|
| 11 |
+
interface MethodDefinition {
|
| 12 |
+
decorators: estree.Decorator[];
|
| 13 |
+
}
|
| 14 |
+
interface BaseClass {
|
| 15 |
+
decorators: estree.Decorator[];
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
export const VERSION: string;
|
| 20 |
+
|
| 21 |
+
// utils
|
| 22 |
+
type NullValue = null | undefined | void;
|
| 23 |
+
type MaybeArray<T> = T | T[];
|
| 24 |
+
type MaybePromise<T> = T | Promise<T>;
|
| 25 |
+
|
| 26 |
+
type PartialNull<T> = {
|
| 27 |
+
[P in keyof T]: T[P] | null;
|
| 28 |
+
};
|
| 29 |
+
|
| 30 |
+
export interface RollupError extends RollupLog {
|
| 31 |
+
name?: string | undefined;
|
| 32 |
+
stack?: string | undefined;
|
| 33 |
+
watchFiles?: string[] | undefined;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
export interface RollupLog {
|
| 37 |
+
binding?: string | undefined;
|
| 38 |
+
cause?: unknown | undefined;
|
| 39 |
+
code?: string | undefined;
|
| 40 |
+
exporter?: string | undefined;
|
| 41 |
+
frame?: string | undefined;
|
| 42 |
+
hook?: string | undefined;
|
| 43 |
+
id?: string | undefined;
|
| 44 |
+
ids?: string[] | undefined;
|
| 45 |
+
loc?: {
|
| 46 |
+
column: number;
|
| 47 |
+
file?: string | undefined;
|
| 48 |
+
line: number;
|
| 49 |
+
};
|
| 50 |
+
message: string;
|
| 51 |
+
meta?: any | undefined;
|
| 52 |
+
names?: string[] | undefined;
|
| 53 |
+
plugin?: string | undefined;
|
| 54 |
+
pluginCode?: unknown | undefined;
|
| 55 |
+
pos?: number | undefined;
|
| 56 |
+
reexporter?: string | undefined;
|
| 57 |
+
stack?: string | undefined;
|
| 58 |
+
url?: string | undefined;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
export type LogLevel = 'warn' | 'info' | 'debug';
|
| 62 |
+
export type LogLevelOption = LogLevel | 'silent';
|
| 63 |
+
|
| 64 |
+
export type SourceMapSegment =
|
| 65 |
+
| [number]
|
| 66 |
+
| [number, number, number, number]
|
| 67 |
+
| [number, number, number, number, number];
|
| 68 |
+
|
| 69 |
+
export interface ExistingDecodedSourceMap {
|
| 70 |
+
file?: string | undefined;
|
| 71 |
+
readonly mappings: SourceMapSegment[][];
|
| 72 |
+
names: string[];
|
| 73 |
+
sourceRoot?: string | undefined;
|
| 74 |
+
sources: string[];
|
| 75 |
+
sourcesContent?: string[] | undefined;
|
| 76 |
+
version: number;
|
| 77 |
+
x_google_ignoreList?: number[] | undefined;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
export interface ExistingRawSourceMap {
|
| 81 |
+
file?: string | undefined;
|
| 82 |
+
mappings: string;
|
| 83 |
+
names: string[];
|
| 84 |
+
sourceRoot?: string | undefined;
|
| 85 |
+
sources: string[];
|
| 86 |
+
sourcesContent?: string[] | undefined;
|
| 87 |
+
version: number;
|
| 88 |
+
x_google_ignoreList?: number[] | undefined;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
export type DecodedSourceMapOrMissing =
|
| 92 |
+
| {
|
| 93 |
+
missing: true;
|
| 94 |
+
plugin: string;
|
| 95 |
+
}
|
| 96 |
+
| (ExistingDecodedSourceMap & { missing?: false | undefined });
|
| 97 |
+
|
| 98 |
+
export interface SourceMap {
|
| 99 |
+
file: string;
|
| 100 |
+
mappings: string;
|
| 101 |
+
names: string[];
|
| 102 |
+
sources: string[];
|
| 103 |
+
sourcesContent?: string[] | undefined;
|
| 104 |
+
version: number;
|
| 105 |
+
debugId?: string | undefined;
|
| 106 |
+
toString(): string;
|
| 107 |
+
toUrl(): string;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
export type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' };
|
| 111 |
+
|
| 112 |
+
interface ModuleOptions {
|
| 113 |
+
attributes: Record<string, string>;
|
| 114 |
+
meta: CustomPluginOptions;
|
| 115 |
+
moduleSideEffects: boolean | 'no-treeshake';
|
| 116 |
+
syntheticNamedExports: boolean | string;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
export interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
|
| 120 |
+
ast?: ProgramNode | undefined;
|
| 121 |
+
code: string;
|
| 122 |
+
map?: SourceMapInput | undefined;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
export interface TransformModuleJSON {
|
| 126 |
+
ast?: ProgramNode | undefined;
|
| 127 |
+
code: string;
|
| 128 |
+
safeVariableNames: Record<string, string> | null;
|
| 129 |
+
// note if plugins use new this.cache to opt-out auto transform cache
|
| 130 |
+
customTransformCache: boolean;
|
| 131 |
+
originalCode: string;
|
| 132 |
+
originalSourcemap: ExistingDecodedSourceMap | null;
|
| 133 |
+
sourcemapChain: DecodedSourceMapOrMissing[];
|
| 134 |
+
transformDependencies: string[];
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
export interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
|
| 138 |
+
safeVariableNames: Record<string, string> | null;
|
| 139 |
+
ast: ProgramNode;
|
| 140 |
+
dependencies: string[];
|
| 141 |
+
id: string;
|
| 142 |
+
resolvedIds: ResolvedIdMap;
|
| 143 |
+
transformFiles: EmittedFile[] | undefined;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
export interface PluginCache {
|
| 147 |
+
delete(id: string): boolean;
|
| 148 |
+
get<T = any>(id: string): T;
|
| 149 |
+
has(id: string): boolean;
|
| 150 |
+
set<T = any>(id: string, value: T): void;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
export type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
|
| 154 |
+
|
| 155 |
+
export interface MinimalPluginContext {
|
| 156 |
+
debug: LoggingFunction;
|
| 157 |
+
error: (error: RollupError | string) => never;
|
| 158 |
+
info: LoggingFunction;
|
| 159 |
+
meta: PluginContextMeta;
|
| 160 |
+
warn: LoggingFunction;
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
export interface EmittedAsset {
|
| 164 |
+
fileName?: string | undefined;
|
| 165 |
+
name?: string | undefined;
|
| 166 |
+
needsCodeReference?: boolean | undefined;
|
| 167 |
+
originalFileName?: string | null | undefined;
|
| 168 |
+
source?: string | Uint8Array | undefined;
|
| 169 |
+
type: 'asset';
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
export interface EmittedChunk {
|
| 173 |
+
fileName?: string | undefined;
|
| 174 |
+
id: string;
|
| 175 |
+
implicitlyLoadedAfterOneOf?: string[] | undefined;
|
| 176 |
+
importer?: string | undefined;
|
| 177 |
+
name?: string | undefined;
|
| 178 |
+
preserveSignature?: PreserveEntrySignaturesOption | undefined;
|
| 179 |
+
type: 'chunk';
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
export interface EmittedPrebuiltChunk {
|
| 183 |
+
code: string;
|
| 184 |
+
exports?: string[] | undefined;
|
| 185 |
+
fileName: string;
|
| 186 |
+
map?: SourceMap | undefined;
|
| 187 |
+
sourcemapFileName?: string | undefined;
|
| 188 |
+
type: 'prebuilt-chunk';
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
export type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
|
| 192 |
+
|
| 193 |
+
export type EmitFile = (emittedFile: EmittedFile) => string;
|
| 194 |
+
|
| 195 |
+
export interface ModuleInfo extends ModuleOptions {
|
| 196 |
+
ast: ProgramNode | null;
|
| 197 |
+
code: string | null;
|
| 198 |
+
dynamicImporters: readonly string[];
|
| 199 |
+
dynamicallyImportedIdResolutions: readonly ResolvedId[];
|
| 200 |
+
dynamicallyImportedIds: readonly string[];
|
| 201 |
+
exportedBindings: Record<string, string[]> | null;
|
| 202 |
+
exports: string[] | null;
|
| 203 |
+
safeVariableNames: Record<string, string> | null;
|
| 204 |
+
hasDefaultExport: boolean | null;
|
| 205 |
+
id: string;
|
| 206 |
+
implicitlyLoadedAfterOneOf: readonly string[];
|
| 207 |
+
implicitlyLoadedBefore: readonly string[];
|
| 208 |
+
importedIdResolutions: readonly ResolvedId[];
|
| 209 |
+
importedIds: readonly string[];
|
| 210 |
+
importers: readonly string[];
|
| 211 |
+
isEntry: boolean;
|
| 212 |
+
isExternal: boolean;
|
| 213 |
+
isIncluded: boolean | null;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
export type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
|
| 217 |
+
|
| 218 |
+
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style -- this is an interface so that it can be extended by plugins
|
| 219 |
+
export interface CustomPluginOptions {
|
| 220 |
+
[plugin: string]: any;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
type LoggingFunctionWithPosition = (
|
| 224 |
+
log: RollupLog | string | (() => RollupLog | string),
|
| 225 |
+
pos?: number | { column: number; line: number }
|
| 226 |
+
) => void;
|
| 227 |
+
|
| 228 |
+
export type ParseAst = (
|
| 229 |
+
input: string,
|
| 230 |
+
options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean }
|
| 231 |
+
) => ProgramNode;
|
| 232 |
+
|
| 233 |
+
// declare AbortSignal here for environments without DOM lib or @types/node
|
| 234 |
+
declare global {
|
| 235 |
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
| 236 |
+
interface AbortSignal {}
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
export type ParseAstAsync = (
|
| 240 |
+
input: string,
|
| 241 |
+
options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean; signal?: AbortSignal }
|
| 242 |
+
) => Promise<ProgramNode>;
|
| 243 |
+
|
| 244 |
+
export interface PluginContext extends MinimalPluginContext {
|
| 245 |
+
addWatchFile: (id: string) => void;
|
| 246 |
+
cache: PluginCache;
|
| 247 |
+
debug: LoggingFunction;
|
| 248 |
+
emitFile: EmitFile;
|
| 249 |
+
error: (error: RollupError | string) => never;
|
| 250 |
+
fs: RollupFsModule;
|
| 251 |
+
getFileName: (fileReferenceId: string) => string;
|
| 252 |
+
getModuleIds: () => IterableIterator<string>;
|
| 253 |
+
getModuleInfo: GetModuleInfo;
|
| 254 |
+
getWatchFiles: () => string[];
|
| 255 |
+
info: LoggingFunction;
|
| 256 |
+
load: (
|
| 257 |
+
options: { id: string; resolveDependencies?: boolean } & Partial<PartialNull<ModuleOptions>>
|
| 258 |
+
) => Promise<ModuleInfo>;
|
| 259 |
+
parse: ParseAst;
|
| 260 |
+
resolve: (
|
| 261 |
+
source: string,
|
| 262 |
+
importer?: string,
|
| 263 |
+
options?: {
|
| 264 |
+
importerAttributes?: Record<string, string>;
|
| 265 |
+
attributes?: Record<string, string>;
|
| 266 |
+
custom?: CustomPluginOptions;
|
| 267 |
+
isEntry?: boolean;
|
| 268 |
+
skipSelf?: boolean;
|
| 269 |
+
}
|
| 270 |
+
) => Promise<ResolvedId | null>;
|
| 271 |
+
setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
|
| 272 |
+
warn: LoggingFunction;
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
export interface PluginContextMeta {
|
| 276 |
+
rollupVersion: string;
|
| 277 |
+
watchMode: boolean;
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
export type StringOrRegExp = string | RegExp;
|
| 281 |
+
|
| 282 |
+
export type StringFilter<Value = StringOrRegExp> =
|
| 283 |
+
| MaybeArray<Value>
|
| 284 |
+
| {
|
| 285 |
+
include?: MaybeArray<Value> | undefined;
|
| 286 |
+
exclude?: MaybeArray<Value> | undefined;
|
| 287 |
+
};
|
| 288 |
+
|
| 289 |
+
export interface HookFilter {
|
| 290 |
+
id?: StringFilter | undefined;
|
| 291 |
+
code?: StringFilter | undefined;
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
export interface ResolvedId extends ModuleOptions {
|
| 295 |
+
external: boolean | 'absolute';
|
| 296 |
+
id: string;
|
| 297 |
+
resolvedBy: string;
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
export type ResolvedIdMap = Record<string, ResolvedId>;
|
| 301 |
+
|
| 302 |
+
export interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
|
| 303 |
+
external?: boolean | 'absolute' | 'relative' | undefined;
|
| 304 |
+
id: string;
|
| 305 |
+
resolvedBy?: string | undefined;
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
export type ResolveIdResult = string | NullValue | false | PartialResolvedId;
|
| 309 |
+
|
| 310 |
+
export type ResolveIdResultWithoutNullValue = string | false | PartialResolvedId;
|
| 311 |
+
|
| 312 |
+
export type ResolveIdHook = (
|
| 313 |
+
this: PluginContext,
|
| 314 |
+
source: string,
|
| 315 |
+
importer: string | undefined,
|
| 316 |
+
options: {
|
| 317 |
+
attributes: Record<string, string>;
|
| 318 |
+
custom?: CustomPluginOptions;
|
| 319 |
+
importerAttributes?: Record<string, string> | undefined;
|
| 320 |
+
isEntry: boolean;
|
| 321 |
+
}
|
| 322 |
+
) => ResolveIdResult;
|
| 323 |
+
|
| 324 |
+
export type ShouldTransformCachedModuleHook = (
|
| 325 |
+
this: PluginContext,
|
| 326 |
+
options: {
|
| 327 |
+
ast: ProgramNode;
|
| 328 |
+
attributes: Record<string, string>;
|
| 329 |
+
code: string;
|
| 330 |
+
id: string;
|
| 331 |
+
meta: CustomPluginOptions;
|
| 332 |
+
moduleSideEffects: boolean | 'no-treeshake';
|
| 333 |
+
resolvedSources: ResolvedIdMap;
|
| 334 |
+
syntheticNamedExports: boolean | string;
|
| 335 |
+
}
|
| 336 |
+
) => boolean | NullValue;
|
| 337 |
+
|
| 338 |
+
export type IsExternal = (
|
| 339 |
+
source: string,
|
| 340 |
+
importer: string | undefined,
|
| 341 |
+
isResolved: boolean
|
| 342 |
+
) => boolean;
|
| 343 |
+
|
| 344 |
+
export type HasModuleSideEffects = (id: string, external: boolean) => boolean;
|
| 345 |
+
|
| 346 |
+
export type LoadResult = SourceDescription | string | NullValue;
|
| 347 |
+
|
| 348 |
+
export type LoadHook = (
|
| 349 |
+
this: PluginContext,
|
| 350 |
+
id: string,
|
| 351 |
+
// temporarily marked as optional for better Vite type-compatibility
|
| 352 |
+
options?:
|
| 353 |
+
| {
|
| 354 |
+
// unused, temporarily added for better Vite type-compatibility
|
| 355 |
+
ssr?: boolean | undefined;
|
| 356 |
+
// temporarily marked as optional for better Vite type-compatibility
|
| 357 |
+
attributes?: Record<string, string>;
|
| 358 |
+
}
|
| 359 |
+
| undefined
|
| 360 |
+
) => LoadResult;
|
| 361 |
+
|
| 362 |
+
export interface TransformPluginContext extends PluginContext {
|
| 363 |
+
debug: LoggingFunctionWithPosition;
|
| 364 |
+
error: (error: RollupError | string, pos?: number | { column: number; line: number }) => never;
|
| 365 |
+
getCombinedSourcemap: () => SourceMap;
|
| 366 |
+
info: LoggingFunctionWithPosition;
|
| 367 |
+
warn: LoggingFunctionWithPosition;
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
export type TransformResult = string | NullValue | Partial<SourceDescription>;
|
| 371 |
+
|
| 372 |
+
export type TransformHook = (
|
| 373 |
+
this: TransformPluginContext,
|
| 374 |
+
code: string,
|
| 375 |
+
id: string,
|
| 376 |
+
// temporarily marked as optional for better Vite type-compatibility
|
| 377 |
+
options?:
|
| 378 |
+
| {
|
| 379 |
+
// unused, temporarily added for better Vite type-compatibility
|
| 380 |
+
ssr?: boolean | undefined;
|
| 381 |
+
// temporarily marked as optional for better Vite type-compatibility
|
| 382 |
+
attributes?: Record<string, string>;
|
| 383 |
+
}
|
| 384 |
+
| undefined
|
| 385 |
+
) => TransformResult;
|
| 386 |
+
|
| 387 |
+
export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
|
| 388 |
+
|
| 389 |
+
export type RenderChunkHook = (
|
| 390 |
+
this: PluginContext,
|
| 391 |
+
code: string,
|
| 392 |
+
chunk: RenderedChunk,
|
| 393 |
+
options: NormalizedOutputOptions,
|
| 394 |
+
meta: { chunks: Record<string, RenderedChunk> }
|
| 395 |
+
) => { code: string; map?: SourceMapInput } | string | NullValue;
|
| 396 |
+
|
| 397 |
+
export type ResolveDynamicImportHook = (
|
| 398 |
+
this: PluginContext,
|
| 399 |
+
specifier: string | AstNode,
|
| 400 |
+
importer: string,
|
| 401 |
+
options: { attributes: Record<string, string>; importerAttributes: Record<string, string> }
|
| 402 |
+
) => ResolveIdResult;
|
| 403 |
+
|
| 404 |
+
export type ResolveImportMetaHook = (
|
| 405 |
+
this: PluginContext,
|
| 406 |
+
property: string | null,
|
| 407 |
+
options: {
|
| 408 |
+
attributes: Record<string, string>;
|
| 409 |
+
chunkId: string;
|
| 410 |
+
format: InternalModuleFormat;
|
| 411 |
+
moduleId: string;
|
| 412 |
+
}
|
| 413 |
+
) => string | NullValue;
|
| 414 |
+
|
| 415 |
+
export type ResolveFileUrlHook = (
|
| 416 |
+
this: PluginContext,
|
| 417 |
+
options: {
|
| 418 |
+
attributes: Record<string, string>;
|
| 419 |
+
chunkId: string;
|
| 420 |
+
fileName: string;
|
| 421 |
+
format: InternalModuleFormat;
|
| 422 |
+
moduleId: string;
|
| 423 |
+
referenceId: string;
|
| 424 |
+
relativePath: string;
|
| 425 |
+
}
|
| 426 |
+
) => string | NullValue;
|
| 427 |
+
|
| 428 |
+
export type AddonHookFunction = (
|
| 429 |
+
this: PluginContext,
|
| 430 |
+
chunk: RenderedChunk
|
| 431 |
+
) => string | Promise<string>;
|
| 432 |
+
export type AddonHook = string | AddonHookFunction;
|
| 433 |
+
|
| 434 |
+
export type ChangeEvent = 'create' | 'update' | 'delete';
|
| 435 |
+
export type WatchChangeHook = (
|
| 436 |
+
this: PluginContext,
|
| 437 |
+
id: string,
|
| 438 |
+
change: { event: ChangeEvent }
|
| 439 |
+
) => void;
|
| 440 |
+
|
| 441 |
+
/**
|
| 442 |
+
* use this type for plugin annotation
|
| 443 |
+
* @example
|
| 444 |
+
* ```ts
|
| 445 |
+
* interface Options {
|
| 446 |
+
* ...
|
| 447 |
+
* }
|
| 448 |
+
* const myPlugin: PluginImpl<Options> = (options = {}) => { ... }
|
| 449 |
+
* ```
|
| 450 |
+
*/
|
| 451 |
+
export type PluginImpl<O extends object = object, A = any> = (options?: O) => Plugin<A>;
|
| 452 |
+
|
| 453 |
+
export type OutputBundle = Record<string, OutputAsset | OutputChunk>;
|
| 454 |
+
|
| 455 |
+
export type PreRenderedChunkWithFileName = PreRenderedChunk & { fileName: string };
|
| 456 |
+
|
| 457 |
+
export interface ImportedInternalChunk {
|
| 458 |
+
type: 'internal';
|
| 459 |
+
fileName: string;
|
| 460 |
+
resolvedImportPath: string;
|
| 461 |
+
chunk: PreRenderedChunk;
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
export interface ImportedExternalChunk {
|
| 465 |
+
type: 'external';
|
| 466 |
+
fileName: string;
|
| 467 |
+
resolvedImportPath: string;
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
export type DynamicImportTargetChunk = ImportedInternalChunk | ImportedExternalChunk;
|
| 471 |
+
|
| 472 |
+
export interface FunctionPluginHooks {
|
| 473 |
+
augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void;
|
| 474 |
+
buildEnd: (this: PluginContext, error?: Error) => void;
|
| 475 |
+
buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
|
| 476 |
+
closeBundle: (this: PluginContext, error?: Error) => void;
|
| 477 |
+
closeWatcher: (this: PluginContext) => void;
|
| 478 |
+
generateBundle: (
|
| 479 |
+
this: PluginContext,
|
| 480 |
+
options: NormalizedOutputOptions,
|
| 481 |
+
bundle: OutputBundle,
|
| 482 |
+
isWrite: boolean
|
| 483 |
+
) => void;
|
| 484 |
+
load: LoadHook;
|
| 485 |
+
moduleParsed: ModuleParsedHook;
|
| 486 |
+
onLog: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => boolean | NullValue;
|
| 487 |
+
options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue;
|
| 488 |
+
outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue;
|
| 489 |
+
renderChunk: RenderChunkHook;
|
| 490 |
+
renderDynamicImport: (
|
| 491 |
+
this: PluginContext,
|
| 492 |
+
options: {
|
| 493 |
+
customResolution: string | null;
|
| 494 |
+
format: InternalModuleFormat;
|
| 495 |
+
moduleId: string;
|
| 496 |
+
targetModuleId: string | null;
|
| 497 |
+
chunk: PreRenderedChunkWithFileName;
|
| 498 |
+
targetChunk: PreRenderedChunkWithFileName | null;
|
| 499 |
+
getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
|
| 500 |
+
targetModuleAttributes: Record<string, string>;
|
| 501 |
+
}
|
| 502 |
+
) => { left: string; right: string } | NullValue;
|
| 503 |
+
renderError: (this: PluginContext, error?: Error) => void;
|
| 504 |
+
renderStart: (
|
| 505 |
+
this: PluginContext,
|
| 506 |
+
outputOptions: NormalizedOutputOptions,
|
| 507 |
+
inputOptions: NormalizedInputOptions
|
| 508 |
+
) => void;
|
| 509 |
+
resolveDynamicImport: ResolveDynamicImportHook;
|
| 510 |
+
resolveFileUrl: ResolveFileUrlHook;
|
| 511 |
+
resolveId: ResolveIdHook;
|
| 512 |
+
resolveImportMeta: ResolveImportMetaHook;
|
| 513 |
+
shouldTransformCachedModule: ShouldTransformCachedModuleHook;
|
| 514 |
+
transform: TransformHook;
|
| 515 |
+
watchChange: WatchChangeHook;
|
| 516 |
+
writeBundle: (
|
| 517 |
+
this: PluginContext,
|
| 518 |
+
options: NormalizedOutputOptions,
|
| 519 |
+
bundle: OutputBundle
|
| 520 |
+
) => void;
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
export type OutputPluginHooks =
|
| 524 |
+
| 'augmentChunkHash'
|
| 525 |
+
| 'generateBundle'
|
| 526 |
+
| 'outputOptions'
|
| 527 |
+
| 'renderChunk'
|
| 528 |
+
| 'renderDynamicImport'
|
| 529 |
+
| 'renderError'
|
| 530 |
+
| 'renderStart'
|
| 531 |
+
| 'resolveFileUrl'
|
| 532 |
+
| 'resolveImportMeta'
|
| 533 |
+
| 'writeBundle';
|
| 534 |
+
|
| 535 |
+
export type InputPluginHooks = Exclude<keyof FunctionPluginHooks, OutputPluginHooks>;
|
| 536 |
+
|
| 537 |
+
export type SyncPluginHooks =
|
| 538 |
+
| 'augmentChunkHash'
|
| 539 |
+
| 'onLog'
|
| 540 |
+
| 'outputOptions'
|
| 541 |
+
| 'renderDynamicImport'
|
| 542 |
+
| 'resolveFileUrl'
|
| 543 |
+
| 'resolveImportMeta';
|
| 544 |
+
|
| 545 |
+
export type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
|
| 546 |
+
|
| 547 |
+
export type FirstPluginHooks =
|
| 548 |
+
| 'load'
|
| 549 |
+
| 'renderDynamicImport'
|
| 550 |
+
| 'resolveDynamicImport'
|
| 551 |
+
| 'resolveFileUrl'
|
| 552 |
+
| 'resolveId'
|
| 553 |
+
| 'resolveImportMeta'
|
| 554 |
+
| 'shouldTransformCachedModule';
|
| 555 |
+
|
| 556 |
+
export type SequentialPluginHooks =
|
| 557 |
+
| 'augmentChunkHash'
|
| 558 |
+
| 'generateBundle'
|
| 559 |
+
| 'onLog'
|
| 560 |
+
| 'options'
|
| 561 |
+
| 'outputOptions'
|
| 562 |
+
| 'renderChunk'
|
| 563 |
+
| 'transform';
|
| 564 |
+
|
| 565 |
+
export type ParallelPluginHooks = Exclude<
|
| 566 |
+
keyof FunctionPluginHooks | AddonHooks,
|
| 567 |
+
FirstPluginHooks | SequentialPluginHooks
|
| 568 |
+
>;
|
| 569 |
+
|
| 570 |
+
export type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
|
| 571 |
+
|
| 572 |
+
type MakeAsync<Function_> = Function_ extends (
|
| 573 |
+
this: infer This,
|
| 574 |
+
...parameters: infer Arguments
|
| 575 |
+
) => infer Return
|
| 576 |
+
? (this: This, ...parameters: Arguments) => Return | Promise<Return>
|
| 577 |
+
: never;
|
| 578 |
+
|
| 579 |
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
| 580 |
+
export type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
|
| 581 |
+
|
| 582 |
+
export type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends 'transform'
|
| 583 |
+
? { filter?: HookFilter | undefined }
|
| 584 |
+
: K extends 'load'
|
| 585 |
+
? { filter?: Pick<HookFilter, 'id'> | undefined }
|
| 586 |
+
: K extends 'resolveId'
|
| 587 |
+
? { filter?: { id?: StringFilter<RegExp> | undefined } } | undefined
|
| 588 |
+
: // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
| 589 |
+
{};
|
| 590 |
+
|
| 591 |
+
export type PluginHooks = {
|
| 592 |
+
[K in keyof FunctionPluginHooks]: ObjectHook<
|
| 593 |
+
K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
|
| 594 |
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
| 595 |
+
HookFilterExtension<K> & (K extends ParallelPluginHooks ? { sequential?: boolean } : {})
|
| 596 |
+
>;
|
| 597 |
+
};
|
| 598 |
+
|
| 599 |
+
export interface OutputPlugin
|
| 600 |
+
extends
|
| 601 |
+
Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
|
| 602 |
+
Partial<Record<AddonHooks, ObjectHook<AddonHook>>> {
|
| 603 |
+
cacheKey?: string | undefined;
|
| 604 |
+
name: string;
|
| 605 |
+
version?: string | undefined;
|
| 606 |
+
}
|
| 607 |
+
|
| 608 |
+
export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
|
| 609 |
+
// for inter-plugin communication
|
| 610 |
+
api?: A | undefined;
|
| 611 |
+
}
|
| 612 |
+
|
| 613 |
+
export type JsxPreset = 'react' | 'react-jsx' | 'preserve' | 'preserve-react';
|
| 614 |
+
|
| 615 |
+
export type NormalizedJsxOptions =
|
| 616 |
+
| NormalizedJsxPreserveOptions
|
| 617 |
+
| NormalizedJsxClassicOptions
|
| 618 |
+
| NormalizedJsxAutomaticOptions;
|
| 619 |
+
|
| 620 |
+
interface NormalizedJsxPreserveOptions {
|
| 621 |
+
factory: string | null;
|
| 622 |
+
fragment: string | null;
|
| 623 |
+
importSource: string | null;
|
| 624 |
+
mode: 'preserve';
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
interface NormalizedJsxClassicOptions {
|
| 628 |
+
factory: string;
|
| 629 |
+
fragment: string;
|
| 630 |
+
importSource: string | null;
|
| 631 |
+
mode: 'classic';
|
| 632 |
+
}
|
| 633 |
+
|
| 634 |
+
interface NormalizedJsxAutomaticOptions {
|
| 635 |
+
factory: string;
|
| 636 |
+
importSource: string | null;
|
| 637 |
+
jsxImportSource: string;
|
| 638 |
+
mode: 'automatic';
|
| 639 |
+
}
|
| 640 |
+
|
| 641 |
+
export type JsxOptions = Partial<NormalizedJsxOptions> & {
|
| 642 |
+
preset?: JsxPreset | undefined;
|
| 643 |
+
};
|
| 644 |
+
|
| 645 |
+
export type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
|
| 646 |
+
|
| 647 |
+
export interface NormalizedTreeshakingOptions {
|
| 648 |
+
annotations: boolean;
|
| 649 |
+
correctVarValueBeforeDeclaration: boolean;
|
| 650 |
+
manualPureFunctions: readonly string[];
|
| 651 |
+
moduleSideEffects: HasModuleSideEffects;
|
| 652 |
+
propertyReadSideEffects: boolean | 'always';
|
| 653 |
+
tryCatchDeoptimization: boolean;
|
| 654 |
+
unknownGlobalSideEffects: boolean;
|
| 655 |
+
}
|
| 656 |
+
|
| 657 |
+
export interface TreeshakingOptions extends Partial<
|
| 658 |
+
Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>
|
| 659 |
+
> {
|
| 660 |
+
moduleSideEffects?: ModuleSideEffectsOption | undefined;
|
| 661 |
+
preset?: TreeshakingPreset | undefined;
|
| 662 |
+
}
|
| 663 |
+
|
| 664 |
+
interface ManualChunkMeta {
|
| 665 |
+
getModuleIds: () => IterableIterator<string>;
|
| 666 |
+
getModuleInfo: GetModuleInfo;
|
| 667 |
+
}
|
| 668 |
+
|
| 669 |
+
export type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
|
| 670 |
+
|
| 671 |
+
export type ExternalOption =
|
| 672 |
+
| (string | RegExp)[]
|
| 673 |
+
| string
|
| 674 |
+
| RegExp
|
| 675 |
+
| ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue);
|
| 676 |
+
|
| 677 |
+
export type GlobalsOption = Record<string, string> | ((name: string) => string);
|
| 678 |
+
|
| 679 |
+
export type InputOption = string | string[] | Record<string, string>;
|
| 680 |
+
|
| 681 |
+
export type ManualChunksOption = Record<string, string[]> | GetManualChunk;
|
| 682 |
+
|
| 683 |
+
export type LogHandlerWithDefault = (
|
| 684 |
+
level: LogLevel,
|
| 685 |
+
log: RollupLog,
|
| 686 |
+
defaultHandler: LogOrStringHandler
|
| 687 |
+
) => void;
|
| 688 |
+
|
| 689 |
+
export type LogOrStringHandler = (level: LogLevel | 'error', log: RollupLog | string) => void;
|
| 690 |
+
|
| 691 |
+
export type LogHandler = (level: LogLevel, log: RollupLog) => void;
|
| 692 |
+
|
| 693 |
+
export type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects;
|
| 694 |
+
|
| 695 |
+
export type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only';
|
| 696 |
+
|
| 697 |
+
export type SourcemapPathTransformOption = (
|
| 698 |
+
relativeSourcePath: string,
|
| 699 |
+
sourcemapPath: string
|
| 700 |
+
) => string;
|
| 701 |
+
|
| 702 |
+
export type SourcemapIgnoreListOption = (
|
| 703 |
+
relativeSourcePath: string,
|
| 704 |
+
sourcemapPath: string
|
| 705 |
+
) => boolean;
|
| 706 |
+
|
| 707 |
+
export type InputPluginOption = MaybePromise<Plugin | NullValue | false | InputPluginOption[]>;
|
| 708 |
+
|
| 709 |
+
export interface InputOptions {
|
| 710 |
+
cache?: boolean | RollupCache | undefined;
|
| 711 |
+
context?: string | undefined;
|
| 712 |
+
experimentalCacheExpiry?: number | undefined;
|
| 713 |
+
experimentalLogSideEffects?: boolean | undefined;
|
| 714 |
+
external?: ExternalOption | undefined;
|
| 715 |
+
fs?: RollupFsModule | undefined;
|
| 716 |
+
input?: InputOption | undefined;
|
| 717 |
+
jsx?: false | JsxPreset | JsxOptions | undefined;
|
| 718 |
+
logLevel?: LogLevelOption | undefined;
|
| 719 |
+
makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource' | undefined;
|
| 720 |
+
maxParallelFileOps?: number | undefined;
|
| 721 |
+
moduleContext?: ((id: string) => string | NullValue) | Record<string, string> | undefined;
|
| 722 |
+
onLog?: LogHandlerWithDefault | undefined;
|
| 723 |
+
onwarn?: WarningHandlerWithDefault | undefined;
|
| 724 |
+
perf?: boolean | undefined;
|
| 725 |
+
plugins?: InputPluginOption | undefined;
|
| 726 |
+
preserveEntrySignatures?: PreserveEntrySignaturesOption | undefined;
|
| 727 |
+
preserveSymlinks?: boolean | undefined;
|
| 728 |
+
shimMissingExports?: boolean | undefined;
|
| 729 |
+
strictDeprecations?: boolean | undefined;
|
| 730 |
+
treeshake?: boolean | TreeshakingPreset | TreeshakingOptions | undefined;
|
| 731 |
+
watch?: WatcherOptions | false | undefined;
|
| 732 |
+
}
|
| 733 |
+
|
| 734 |
+
export interface InputOptionsWithPlugins extends InputOptions {
|
| 735 |
+
plugins: Plugin[];
|
| 736 |
+
}
|
| 737 |
+
|
| 738 |
+
export interface NormalizedInputOptions {
|
| 739 |
+
cache: false | undefined | RollupCache;
|
| 740 |
+
context: string;
|
| 741 |
+
experimentalCacheExpiry: number;
|
| 742 |
+
experimentalLogSideEffects: boolean;
|
| 743 |
+
external: IsExternal;
|
| 744 |
+
fs: RollupFsModule;
|
| 745 |
+
input: string[] | Record<string, string>;
|
| 746 |
+
jsx: false | NormalizedJsxOptions;
|
| 747 |
+
logLevel: LogLevelOption;
|
| 748 |
+
makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
|
| 749 |
+
maxParallelFileOps: number;
|
| 750 |
+
moduleContext: (id: string) => string;
|
| 751 |
+
onLog: LogHandler;
|
| 752 |
+
perf: boolean;
|
| 753 |
+
plugins: Plugin[];
|
| 754 |
+
preserveEntrySignatures: PreserveEntrySignaturesOption;
|
| 755 |
+
preserveSymlinks: boolean;
|
| 756 |
+
shimMissingExports: boolean;
|
| 757 |
+
strictDeprecations: boolean;
|
| 758 |
+
treeshake: false | NormalizedTreeshakingOptions;
|
| 759 |
+
}
|
| 760 |
+
|
| 761 |
+
export type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
|
| 762 |
+
export type ImportAttributesKey = 'with' | 'assert';
|
| 763 |
+
|
| 764 |
+
export type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
|
| 765 |
+
|
| 766 |
+
type GeneratedCodePreset = 'es5' | 'es2015';
|
| 767 |
+
|
| 768 |
+
interface NormalizedGeneratedCodeOptions {
|
| 769 |
+
arrowFunctions: boolean;
|
| 770 |
+
constBindings: boolean;
|
| 771 |
+
objectShorthand: boolean;
|
| 772 |
+
reservedNamesAsProps: boolean;
|
| 773 |
+
symbols: boolean;
|
| 774 |
+
}
|
| 775 |
+
|
| 776 |
+
interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
|
| 777 |
+
preset?: GeneratedCodePreset | undefined;
|
| 778 |
+
}
|
| 779 |
+
|
| 780 |
+
export type OptionsPaths = Record<string, string> | ((id: string) => string);
|
| 781 |
+
|
| 782 |
+
export type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly';
|
| 783 |
+
|
| 784 |
+
export type GetInterop = (id: string | null) => InteropType;
|
| 785 |
+
|
| 786 |
+
export type AmdOptions = (
|
| 787 |
+
| {
|
| 788 |
+
autoId?: false | undefined;
|
| 789 |
+
id: string;
|
| 790 |
+
}
|
| 791 |
+
| {
|
| 792 |
+
autoId: true;
|
| 793 |
+
basePath?: string | undefined;
|
| 794 |
+
id?: undefined | undefined;
|
| 795 |
+
}
|
| 796 |
+
| {
|
| 797 |
+
autoId?: false | undefined;
|
| 798 |
+
id?: undefined | undefined;
|
| 799 |
+
}
|
| 800 |
+
) & {
|
| 801 |
+
define?: string | undefined;
|
| 802 |
+
forceJsExtensionForImports?: boolean | undefined;
|
| 803 |
+
};
|
| 804 |
+
|
| 805 |
+
export type NormalizedAmdOptions = (
|
| 806 |
+
| {
|
| 807 |
+
autoId: false;
|
| 808 |
+
id?: string | undefined;
|
| 809 |
+
}
|
| 810 |
+
| {
|
| 811 |
+
autoId: true;
|
| 812 |
+
basePath: string;
|
| 813 |
+
}
|
| 814 |
+
) & {
|
| 815 |
+
define: string;
|
| 816 |
+
forceJsExtensionForImports: boolean;
|
| 817 |
+
};
|
| 818 |
+
|
| 819 |
+
type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
|
| 820 |
+
|
| 821 |
+
type OutputPluginOption = MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>;
|
| 822 |
+
|
| 823 |
+
type HashCharacters = 'base64' | 'base36' | 'hex';
|
| 824 |
+
|
| 825 |
+
export interface OutputOptions {
|
| 826 |
+
amd?: AmdOptions | undefined;
|
| 827 |
+
assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string) | undefined;
|
| 828 |
+
banner?: string | AddonFunction | undefined;
|
| 829 |
+
chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
|
| 830 |
+
compact?: boolean | undefined;
|
| 831 |
+
// only required for bundle.write
|
| 832 |
+
dir?: string | undefined;
|
| 833 |
+
dynamicImportInCjs?: boolean | undefined;
|
| 834 |
+
entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
|
| 835 |
+
esModule?: boolean | 'if-default-prop' | undefined;
|
| 836 |
+
experimentalMinChunkSize?: number | undefined;
|
| 837 |
+
exports?: 'default' | 'named' | 'none' | 'auto' | undefined;
|
| 838 |
+
extend?: boolean | undefined;
|
| 839 |
+
/** @deprecated Use "externalImportAttributes" instead. */
|
| 840 |
+
externalImportAssertions?: boolean | undefined;
|
| 841 |
+
externalImportAttributes?: boolean | undefined;
|
| 842 |
+
externalLiveBindings?: boolean | undefined;
|
| 843 |
+
// only required for bundle.write
|
| 844 |
+
file?: string | undefined;
|
| 845 |
+
footer?: string | AddonFunction | undefined;
|
| 846 |
+
format?: ModuleFormat | undefined;
|
| 847 |
+
freeze?: boolean | undefined;
|
| 848 |
+
generatedCode?: GeneratedCodePreset | GeneratedCodeOptions | undefined;
|
| 849 |
+
globals?: GlobalsOption | undefined;
|
| 850 |
+
hashCharacters?: HashCharacters | undefined;
|
| 851 |
+
hoistTransitiveImports?: boolean | undefined;
|
| 852 |
+
importAttributesKey?: ImportAttributesKey | undefined;
|
| 853 |
+
indent?: string | boolean | undefined;
|
| 854 |
+
inlineDynamicImports?: boolean | undefined;
|
| 855 |
+
interop?: InteropType | GetInterop | undefined;
|
| 856 |
+
intro?: string | AddonFunction | undefined;
|
| 857 |
+
manualChunks?: ManualChunksOption | undefined;
|
| 858 |
+
minifyInternalExports?: boolean | undefined;
|
| 859 |
+
name?: string | undefined;
|
| 860 |
+
noConflict?: boolean | undefined;
|
| 861 |
+
/** @deprecated This will be the new default in Rollup 5. */
|
| 862 |
+
onlyExplicitManualChunks?: boolean | undefined;
|
| 863 |
+
outro?: string | AddonFunction | undefined;
|
| 864 |
+
paths?: OptionsPaths | undefined;
|
| 865 |
+
plugins?: OutputPluginOption | undefined;
|
| 866 |
+
preserveModules?: boolean | undefined;
|
| 867 |
+
preserveModulesRoot?: string | undefined;
|
| 868 |
+
reexportProtoFromExternal?: boolean | undefined;
|
| 869 |
+
sanitizeFileName?: boolean | ((fileName: string) => string) | undefined;
|
| 870 |
+
sourcemap?: boolean | 'inline' | 'hidden' | undefined;
|
| 871 |
+
sourcemapBaseUrl?: string | undefined;
|
| 872 |
+
sourcemapExcludeSources?: boolean | undefined;
|
| 873 |
+
sourcemapFile?: string | undefined;
|
| 874 |
+
sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
|
| 875 |
+
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | undefined;
|
| 876 |
+
sourcemapPathTransform?: SourcemapPathTransformOption | undefined;
|
| 877 |
+
sourcemapDebugIds?: boolean | undefined;
|
| 878 |
+
strict?: boolean | undefined;
|
| 879 |
+
systemNullSetters?: boolean | undefined;
|
| 880 |
+
validate?: boolean | undefined;
|
| 881 |
+
virtualDirname?: string | undefined;
|
| 882 |
+
}
|
| 883 |
+
|
| 884 |
+
export interface NormalizedOutputOptions {
|
| 885 |
+
amd: NormalizedAmdOptions;
|
| 886 |
+
assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
|
| 887 |
+
banner: AddonFunction;
|
| 888 |
+
chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
|
| 889 |
+
compact: boolean;
|
| 890 |
+
dir: string | undefined;
|
| 891 |
+
dynamicImportInCjs: boolean;
|
| 892 |
+
entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
|
| 893 |
+
esModule: boolean | 'if-default-prop';
|
| 894 |
+
experimentalMinChunkSize: number;
|
| 895 |
+
exports: 'default' | 'named' | 'none' | 'auto';
|
| 896 |
+
extend: boolean;
|
| 897 |
+
/** @deprecated Use "externalImportAttributes" instead. */
|
| 898 |
+
externalImportAssertions: boolean;
|
| 899 |
+
externalImportAttributes: boolean;
|
| 900 |
+
externalLiveBindings: boolean;
|
| 901 |
+
file: string | undefined;
|
| 902 |
+
footer: AddonFunction;
|
| 903 |
+
format: InternalModuleFormat;
|
| 904 |
+
freeze: boolean;
|
| 905 |
+
generatedCode: NormalizedGeneratedCodeOptions;
|
| 906 |
+
globals: GlobalsOption;
|
| 907 |
+
hashCharacters: HashCharacters;
|
| 908 |
+
hoistTransitiveImports: boolean;
|
| 909 |
+
importAttributesKey: ImportAttributesKey;
|
| 910 |
+
indent: true | string;
|
| 911 |
+
inlineDynamicImports: boolean;
|
| 912 |
+
interop: GetInterop;
|
| 913 |
+
intro: AddonFunction;
|
| 914 |
+
manualChunks: ManualChunksOption;
|
| 915 |
+
minifyInternalExports: boolean;
|
| 916 |
+
name: string | undefined;
|
| 917 |
+
noConflict: boolean;
|
| 918 |
+
onlyExplicitManualChunks: boolean;
|
| 919 |
+
outro: AddonFunction;
|
| 920 |
+
paths: OptionsPaths;
|
| 921 |
+
plugins: OutputPlugin[];
|
| 922 |
+
preserveModules: boolean;
|
| 923 |
+
preserveModulesRoot: string | undefined;
|
| 924 |
+
reexportProtoFromExternal: boolean;
|
| 925 |
+
sanitizeFileName: (fileName: string) => string;
|
| 926 |
+
sourcemap: boolean | 'inline' | 'hidden';
|
| 927 |
+
sourcemapBaseUrl: string | undefined;
|
| 928 |
+
sourcemapExcludeSources: boolean;
|
| 929 |
+
sourcemapFile: string | undefined;
|
| 930 |
+
sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
|
| 931 |
+
sourcemapIgnoreList: SourcemapIgnoreListOption;
|
| 932 |
+
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
| 933 |
+
sourcemapDebugIds: boolean;
|
| 934 |
+
strict: boolean;
|
| 935 |
+
systemNullSetters: boolean;
|
| 936 |
+
validate: boolean;
|
| 937 |
+
virtualDirname: string;
|
| 938 |
+
}
|
| 939 |
+
|
| 940 |
+
export type WarningHandlerWithDefault = (
|
| 941 |
+
warning: RollupLog,
|
| 942 |
+
defaultHandler: LoggingFunction
|
| 943 |
+
) => void;
|
| 944 |
+
|
| 945 |
+
export type SerializedTimings = Record<string, [number, number, number]>;
|
| 946 |
+
|
| 947 |
+
export interface PreRenderedAsset {
|
| 948 |
+
/** @deprecated Use "names" instead. */
|
| 949 |
+
name: string | undefined;
|
| 950 |
+
names: string[];
|
| 951 |
+
/** @deprecated Use "originalFileNames" instead. */
|
| 952 |
+
originalFileName: string | null;
|
| 953 |
+
originalFileNames: string[];
|
| 954 |
+
source: string | Uint8Array;
|
| 955 |
+
type: 'asset';
|
| 956 |
+
}
|
| 957 |
+
|
| 958 |
+
export interface OutputAsset extends PreRenderedAsset {
|
| 959 |
+
fileName: string;
|
| 960 |
+
needsCodeReference: boolean;
|
| 961 |
+
}
|
| 962 |
+
|
| 963 |
+
export interface RenderedModule {
|
| 964 |
+
readonly code: string | null;
|
| 965 |
+
originalLength: number;
|
| 966 |
+
removedExports: string[];
|
| 967 |
+
renderedExports: string[];
|
| 968 |
+
renderedLength: number;
|
| 969 |
+
}
|
| 970 |
+
|
| 971 |
+
export interface PreRenderedChunk {
|
| 972 |
+
exports: string[];
|
| 973 |
+
facadeModuleId: string | null;
|
| 974 |
+
isDynamicEntry: boolean;
|
| 975 |
+
isEntry: boolean;
|
| 976 |
+
isImplicitEntry: boolean;
|
| 977 |
+
moduleIds: string[];
|
| 978 |
+
name: string;
|
| 979 |
+
type: 'chunk';
|
| 980 |
+
}
|
| 981 |
+
|
| 982 |
+
export interface RenderedChunk extends PreRenderedChunk {
|
| 983 |
+
dynamicImports: string[];
|
| 984 |
+
fileName: string;
|
| 985 |
+
implicitlyLoadedBefore: string[];
|
| 986 |
+
importedBindings: Record<string, string[]>;
|
| 987 |
+
imports: string[];
|
| 988 |
+
modules: Record<string, RenderedModule>;
|
| 989 |
+
referencedFiles: string[];
|
| 990 |
+
}
|
| 991 |
+
|
| 992 |
+
export interface OutputChunk extends RenderedChunk {
|
| 993 |
+
code: string;
|
| 994 |
+
map: SourceMap | null;
|
| 995 |
+
sourcemapFileName: string | null;
|
| 996 |
+
preliminaryFileName: string;
|
| 997 |
+
}
|
| 998 |
+
|
| 999 |
+
export type SerializablePluginCache = Record<string, [number, any]>;
|
| 1000 |
+
|
| 1001 |
+
export interface RollupCache {
|
| 1002 |
+
modules: ModuleJSON[];
|
| 1003 |
+
plugins?: Record<string, SerializablePluginCache>;
|
| 1004 |
+
}
|
| 1005 |
+
|
| 1006 |
+
export interface RollupOutput {
|
| 1007 |
+
output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
|
| 1008 |
+
}
|
| 1009 |
+
|
| 1010 |
+
export interface RollupBuild {
|
| 1011 |
+
cache: RollupCache | undefined;
|
| 1012 |
+
close: () => Promise<void>;
|
| 1013 |
+
closed: boolean;
|
| 1014 |
+
[Symbol.asyncDispose](): Promise<void>;
|
| 1015 |
+
generate: (outputOptions: OutputOptions) => Promise<RollupOutput>;
|
| 1016 |
+
getTimings?: (() => SerializedTimings) | undefined;
|
| 1017 |
+
watchFiles: string[];
|
| 1018 |
+
write: (options: OutputOptions) => Promise<RollupOutput>;
|
| 1019 |
+
}
|
| 1020 |
+
|
| 1021 |
+
export interface RollupOptions extends InputOptions {
|
| 1022 |
+
// This is included for compatibility with config files but ignored by rollup.rollup
|
| 1023 |
+
output?: OutputOptions | OutputOptions[] | undefined;
|
| 1024 |
+
}
|
| 1025 |
+
|
| 1026 |
+
export interface MergedRollupOptions extends InputOptionsWithPlugins {
|
| 1027 |
+
output: OutputOptions[];
|
| 1028 |
+
}
|
| 1029 |
+
|
| 1030 |
+
export function rollup(options: RollupOptions): Promise<RollupBuild>;
|
| 1031 |
+
|
| 1032 |
+
export interface ChokidarOptions {
|
| 1033 |
+
alwaysStat?: boolean | undefined;
|
| 1034 |
+
atomic?: boolean | number | undefined;
|
| 1035 |
+
awaitWriteFinish?:
|
| 1036 |
+
| {
|
| 1037 |
+
pollInterval?: number | undefined;
|
| 1038 |
+
stabilityThreshold?: number | undefined;
|
| 1039 |
+
}
|
| 1040 |
+
| boolean
|
| 1041 |
+
| undefined;
|
| 1042 |
+
binaryInterval?: number | undefined;
|
| 1043 |
+
cwd?: string | undefined;
|
| 1044 |
+
depth?: number | undefined;
|
| 1045 |
+
disableGlobbing?: boolean | undefined;
|
| 1046 |
+
followSymlinks?: boolean | undefined;
|
| 1047 |
+
ignoreInitial?: boolean | undefined;
|
| 1048 |
+
ignorePermissionErrors?: boolean | undefined;
|
| 1049 |
+
ignored?: any | undefined;
|
| 1050 |
+
interval?: number | undefined;
|
| 1051 |
+
persistent?: boolean | undefined;
|
| 1052 |
+
useFsEvents?: boolean | undefined;
|
| 1053 |
+
usePolling?: boolean | undefined;
|
| 1054 |
+
}
|
| 1055 |
+
|
| 1056 |
+
export type RollupWatchHooks = 'onError' | 'onStart' | 'onBundleStart' | 'onBundleEnd' | 'onEnd';
|
| 1057 |
+
|
| 1058 |
+
export interface WatcherOptions {
|
| 1059 |
+
allowInputInsideOutputPath?: boolean | undefined;
|
| 1060 |
+
buildDelay?: number | undefined;
|
| 1061 |
+
chokidar?: ChokidarOptions | undefined;
|
| 1062 |
+
clearScreen?: boolean | undefined;
|
| 1063 |
+
exclude?: string | RegExp | (string | RegExp)[] | undefined;
|
| 1064 |
+
include?: string | RegExp | (string | RegExp)[] | undefined;
|
| 1065 |
+
skipWrite?: boolean | undefined;
|
| 1066 |
+
onInvalidate?: ((id: string) => void) | undefined;
|
| 1067 |
+
}
|
| 1068 |
+
|
| 1069 |
+
export interface RollupWatchOptions extends InputOptions {
|
| 1070 |
+
output?: OutputOptions | OutputOptions[] | undefined;
|
| 1071 |
+
watch?: WatcherOptions | false | undefined;
|
| 1072 |
+
}
|
| 1073 |
+
|
| 1074 |
+
export type AwaitedEventListener<
|
| 1075 |
+
T extends Record<string, (...parameters: any) => any>,
|
| 1076 |
+
K extends keyof T
|
| 1077 |
+
> = (...parameters: Parameters<T[K]>) => void | Promise<void>;
|
| 1078 |
+
|
| 1079 |
+
export interface AwaitingEventEmitter<T extends Record<string, (...parameters: any) => any>> {
|
| 1080 |
+
close(): Promise<void>;
|
| 1081 |
+
emit<K extends keyof T>(event: K, ...parameters: Parameters<T[K]>): Promise<unknown>;
|
| 1082 |
+
/**
|
| 1083 |
+
* Removes an event listener.
|
| 1084 |
+
*/
|
| 1085 |
+
off<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
|
| 1086 |
+
/**
|
| 1087 |
+
* Registers an event listener that will be awaited before Rollup continues.
|
| 1088 |
+
* All listeners will be awaited in parallel while rejections are tracked via
|
| 1089 |
+
* Promise.all.
|
| 1090 |
+
*/
|
| 1091 |
+
on<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
|
| 1092 |
+
/**
|
| 1093 |
+
* Registers an event listener that will be awaited before Rollup continues.
|
| 1094 |
+
* All listeners will be awaited in parallel while rejections are tracked via
|
| 1095 |
+
* Promise.all.
|
| 1096 |
+
* Listeners are removed automatically when removeListenersForCurrentRun is
|
| 1097 |
+
* called, which happens automatically after each run.
|
| 1098 |
+
*/
|
| 1099 |
+
onCurrentRun<K extends keyof T>(
|
| 1100 |
+
event: K,
|
| 1101 |
+
listener: (...parameters: Parameters<T[K]>) => Promise<ReturnType<T[K]>>
|
| 1102 |
+
): this;
|
| 1103 |
+
removeAllListeners(): this;
|
| 1104 |
+
removeListenersForCurrentRun(): this;
|
| 1105 |
+
}
|
| 1106 |
+
|
| 1107 |
+
export type RollupWatcherEvent =
|
| 1108 |
+
| { code: 'START' }
|
| 1109 |
+
| { code: 'BUNDLE_START'; input?: InputOption | undefined; output: readonly string[] }
|
| 1110 |
+
| {
|
| 1111 |
+
code: 'BUNDLE_END';
|
| 1112 |
+
duration: number;
|
| 1113 |
+
input?: InputOption | undefined;
|
| 1114 |
+
output: readonly string[];
|
| 1115 |
+
result: RollupBuild;
|
| 1116 |
+
}
|
| 1117 |
+
| { code: 'END' }
|
| 1118 |
+
| { code: 'ERROR'; error: RollupError; result: RollupBuild | null };
|
| 1119 |
+
|
| 1120 |
+
export type RollupWatcher = AwaitingEventEmitter<{
|
| 1121 |
+
change: (id: string, change: { event: ChangeEvent }) => void;
|
| 1122 |
+
close: () => void;
|
| 1123 |
+
event: (event: RollupWatcherEvent) => void;
|
| 1124 |
+
restart: () => void;
|
| 1125 |
+
}>;
|
| 1126 |
+
|
| 1127 |
+
export function watch(config: RollupWatchOptions | RollupWatchOptions[]): RollupWatcher;
|
| 1128 |
+
|
| 1129 |
+
interface AstNodeLocation {
|
| 1130 |
+
end: number;
|
| 1131 |
+
start: number;
|
| 1132 |
+
}
|
| 1133 |
+
|
| 1134 |
+
type OmittedEstreeKeys =
|
| 1135 |
+
| 'loc'
|
| 1136 |
+
| 'range'
|
| 1137 |
+
| 'leadingComments'
|
| 1138 |
+
| 'trailingComments'
|
| 1139 |
+
| 'innerComments'
|
| 1140 |
+
| 'comments';
|
| 1141 |
+
type RollupAstNode<T> = Omit<T, OmittedEstreeKeys> & AstNodeLocation;
|
| 1142 |
+
|
| 1143 |
+
type ProgramNode = RollupAstNode<estree.Program>;
|
| 1144 |
+
export type AstNode = RollupAstNode<estree.Node>;
|
| 1145 |
+
|
| 1146 |
+
export function defineConfig(options: RollupOptions): RollupOptions;
|
| 1147 |
+
export function defineConfig(options: RollupOptions[]): RollupOptions[];
|
| 1148 |
+
export function defineConfig(optionsFunction: RollupOptionsFunction): RollupOptionsFunction;
|
| 1149 |
+
|
| 1150 |
+
export type RollupOptionsFunction = (
|
| 1151 |
+
commandLineArguments: Record<string, any>
|
| 1152 |
+
) => MaybePromise<RollupOptions | RollupOptions[]>;
|
| 1153 |
+
|
| 1154 |
+
export interface RollupFsModule {
|
| 1155 |
+
appendFile(
|
| 1156 |
+
path: string,
|
| 1157 |
+
data: string | Uint8Array,
|
| 1158 |
+
options?: { encoding?: BufferEncoding | null; mode?: string | number; flag?: string | number }
|
| 1159 |
+
): Promise<void>;
|
| 1160 |
+
|
| 1161 |
+
copyFile(source: string, destination: string, mode?: string | number): Promise<void>;
|
| 1162 |
+
|
| 1163 |
+
mkdir(path: string, options?: { recursive?: boolean; mode?: string | number }): Promise<void>;
|
| 1164 |
+
|
| 1165 |
+
mkdtemp(prefix: string): Promise<string>;
|
| 1166 |
+
|
| 1167 |
+
readdir(path: string, options?: { withFileTypes?: false }): Promise<string[]>;
|
| 1168 |
+
readdir(path: string, options?: { withFileTypes: true }): Promise<RollupDirectoryEntry[]>;
|
| 1169 |
+
|
| 1170 |
+
readFile(
|
| 1171 |
+
path: string,
|
| 1172 |
+
options?: { encoding?: null; flag?: string | number; signal?: AbortSignal }
|
| 1173 |
+
): Promise<Uint8Array>;
|
| 1174 |
+
readFile(
|
| 1175 |
+
path: string,
|
| 1176 |
+
options?: { encoding: BufferEncoding; flag?: string | number; signal?: AbortSignal }
|
| 1177 |
+
): Promise<string>;
|
| 1178 |
+
|
| 1179 |
+
realpath(path: string): Promise<string>;
|
| 1180 |
+
|
| 1181 |
+
rename(oldPath: string, newPath: string): Promise<void>;
|
| 1182 |
+
|
| 1183 |
+
rmdir(path: string, options?: { recursive?: boolean }): Promise<void>;
|
| 1184 |
+
|
| 1185 |
+
stat(path: string): Promise<RollupFileStats>;
|
| 1186 |
+
|
| 1187 |
+
lstat(path: string): Promise<RollupFileStats>;
|
| 1188 |
+
|
| 1189 |
+
unlink(path: string): Promise<void>;
|
| 1190 |
+
|
| 1191 |
+
writeFile(
|
| 1192 |
+
path: string,
|
| 1193 |
+
data: string | Uint8Array,
|
| 1194 |
+
options?: { encoding?: BufferEncoding | null; mode?: string | number; flag?: string | number }
|
| 1195 |
+
): Promise<void>;
|
| 1196 |
+
}
|
| 1197 |
+
|
| 1198 |
+
export type BufferEncoding =
|
| 1199 |
+
| 'ascii'
|
| 1200 |
+
| 'utf8'
|
| 1201 |
+
| 'utf16le'
|
| 1202 |
+
| 'ucs2'
|
| 1203 |
+
| 'base64'
|
| 1204 |
+
| 'base64url'
|
| 1205 |
+
| 'latin1'
|
| 1206 |
+
| 'binary'
|
| 1207 |
+
| 'hex';
|
| 1208 |
+
|
| 1209 |
+
export interface RollupDirectoryEntry {
|
| 1210 |
+
isFile(): boolean;
|
| 1211 |
+
isDirectory(): boolean;
|
| 1212 |
+
isSymbolicLink(): boolean;
|
| 1213 |
+
name: string;
|
| 1214 |
+
}
|
| 1215 |
+
|
| 1216 |
+
export interface RollupFileStats {
|
| 1217 |
+
isFile(): boolean;
|
| 1218 |
+
isDirectory(): boolean;
|
| 1219 |
+
isSymbolicLink(): boolean;
|
| 1220 |
+
size: number;
|
| 1221 |
+
mtime: Date;
|
| 1222 |
+
ctime: Date;
|
| 1223 |
+
atime: Date;
|
| 1224 |
+
birthtime: Date;
|
| 1225 |
+
}
|
node_modules/rollup/dist/rollup.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
'use strict';
|
| 11 |
+
|
| 12 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 13 |
+
|
| 14 |
+
const rollup = require('./shared/rollup.js');
|
| 15 |
+
const parseAst_js = require('./shared/parseAst.js');
|
| 16 |
+
const fseventsImporter = require('./shared/fsevents-importer.js');
|
| 17 |
+
require('node:process');
|
| 18 |
+
require('node:path');
|
| 19 |
+
require('path');
|
| 20 |
+
require('./native.js');
|
| 21 |
+
require('node:perf_hooks');
|
| 22 |
+
require('node:fs/promises');
|
| 23 |
+
|
| 24 |
+
class WatchEmitter {
|
| 25 |
+
constructor() {
|
| 26 |
+
this.currentHandlers = Object.create(null);
|
| 27 |
+
this.persistentHandlers = Object.create(null);
|
| 28 |
+
}
|
| 29 |
+
// Will be overwritten by Rollup
|
| 30 |
+
async close() { }
|
| 31 |
+
emit(event, ...parameters) {
|
| 32 |
+
return Promise.all([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters)));
|
| 33 |
+
}
|
| 34 |
+
off(event, listener) {
|
| 35 |
+
const listeners = this.persistentHandlers[event];
|
| 36 |
+
if (listeners) {
|
| 37 |
+
// A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1
|
| 38 |
+
// (which would remove the last array element if used unchanged) is turned
|
| 39 |
+
// into max_int, which is outside the array and does not change anything.
|
| 40 |
+
listeners.splice(listeners.indexOf(listener) >>> 0, 1);
|
| 41 |
+
}
|
| 42 |
+
return this;
|
| 43 |
+
}
|
| 44 |
+
on(event, listener) {
|
| 45 |
+
this.getPersistentHandlers(event).push(listener);
|
| 46 |
+
return this;
|
| 47 |
+
}
|
| 48 |
+
onCurrentRun(event, listener) {
|
| 49 |
+
this.getCurrentHandlers(event).push(listener);
|
| 50 |
+
return this;
|
| 51 |
+
}
|
| 52 |
+
once(event, listener) {
|
| 53 |
+
const selfRemovingListener = (...parameters) => {
|
| 54 |
+
this.off(event, selfRemovingListener);
|
| 55 |
+
return listener(...parameters);
|
| 56 |
+
};
|
| 57 |
+
this.on(event, selfRemovingListener);
|
| 58 |
+
return this;
|
| 59 |
+
}
|
| 60 |
+
removeAllListeners() {
|
| 61 |
+
this.removeListenersForCurrentRun();
|
| 62 |
+
this.persistentHandlers = Object.create(null);
|
| 63 |
+
return this;
|
| 64 |
+
}
|
| 65 |
+
removeListenersForCurrentRun() {
|
| 66 |
+
this.currentHandlers = Object.create(null);
|
| 67 |
+
return this;
|
| 68 |
+
}
|
| 69 |
+
getCurrentHandlers(event) {
|
| 70 |
+
return this.currentHandlers[event] || (this.currentHandlers[event] = []);
|
| 71 |
+
}
|
| 72 |
+
getPersistentHandlers(event) {
|
| 73 |
+
return this.persistentHandlers[event] || (this.persistentHandlers[event] = []);
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
function watch(configs) {
|
| 78 |
+
const emitter = new WatchEmitter();
|
| 79 |
+
watchInternal(configs, emitter).catch(error => {
|
| 80 |
+
rollup.handleError(error);
|
| 81 |
+
});
|
| 82 |
+
return emitter;
|
| 83 |
+
}
|
| 84 |
+
function ensureTrailingSlash(path) {
|
| 85 |
+
if (path[path.length - 1] !== '/') {
|
| 86 |
+
return `${path}/`;
|
| 87 |
+
}
|
| 88 |
+
return path;
|
| 89 |
+
}
|
| 90 |
+
function checkWatchConfig(config) {
|
| 91 |
+
for (const item of config) {
|
| 92 |
+
if (typeof item.watch !== 'boolean' && item.watch?.allowInputInsideOutputPath) {
|
| 93 |
+
break;
|
| 94 |
+
}
|
| 95 |
+
if (item.input && item.output) {
|
| 96 |
+
const input = typeof item.input === 'string' ? rollup.ensureArray(item.input) : item.input;
|
| 97 |
+
const outputs = rollup.ensureArray(item.output);
|
| 98 |
+
for (const index in input) {
|
| 99 |
+
const inputPath = input[index];
|
| 100 |
+
if (typeof inputPath !== 'string') {
|
| 101 |
+
continue;
|
| 102 |
+
}
|
| 103 |
+
const outputWithInputAsSubPath = outputs.find(({ dir }) => dir && ensureTrailingSlash(inputPath).startsWith(ensureTrailingSlash(dir)));
|
| 104 |
+
if (outputWithInputAsSubPath) {
|
| 105 |
+
parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, `the input "${inputPath}" is a subpath of the output "${outputWithInputAsSubPath.dir}"`));
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
async function watchInternal(configs, emitter) {
|
| 112 |
+
const optionsList = await Promise.all(rollup.ensureArray(configs).map(config => rollup.mergeOptions(config, true)));
|
| 113 |
+
const watchOptionsList = optionsList.filter(config => config.watch !== false);
|
| 114 |
+
if (watchOptionsList.length === 0) {
|
| 115 |
+
return parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, 'there must be at least one config where "watch" is not set to "false"'));
|
| 116 |
+
}
|
| 117 |
+
checkWatchConfig(watchOptionsList);
|
| 118 |
+
await fseventsImporter.loadFsEvents();
|
| 119 |
+
const { Watcher } = await Promise.resolve().then(() => require('./shared/watch.js'));
|
| 120 |
+
new Watcher(watchOptionsList, emitter);
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
exports.VERSION = rollup.version;
|
| 124 |
+
exports.defineConfig = rollup.defineConfig;
|
| 125 |
+
exports.rollup = rollup.rollup;
|
| 126 |
+
exports.watch = watch;
|
| 127 |
+
//# sourceMappingURL=rollup.js.map
|
node_modules/rollup/dist/shared/fsevents-importer.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
'use strict';
|
| 11 |
+
|
| 12 |
+
let fsEvents;
|
| 13 |
+
let fsEventsImportError;
|
| 14 |
+
async function loadFsEvents() {
|
| 15 |
+
try {
|
| 16 |
+
({ default: fsEvents } = await import('fsevents'));
|
| 17 |
+
}
|
| 18 |
+
catch (error) {
|
| 19 |
+
fsEventsImportError = error;
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
// A call to this function will be injected into the chokidar code
|
| 23 |
+
function getFsEvents() {
|
| 24 |
+
if (fsEventsImportError)
|
| 25 |
+
throw fsEventsImportError;
|
| 26 |
+
return fsEvents;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
const fseventsImporter = /*#__PURE__*/Object.defineProperty({
|
| 30 |
+
__proto__: null,
|
| 31 |
+
getFsEvents,
|
| 32 |
+
loadFsEvents
|
| 33 |
+
}, Symbol.toStringTag, { value: 'Module' });
|
| 34 |
+
|
| 35 |
+
exports.fseventsImporter = fseventsImporter;
|
| 36 |
+
exports.loadFsEvents = loadFsEvents;
|
| 37 |
+
//# sourceMappingURL=fsevents-importer.js.map
|
node_modules/rollup/dist/shared/index.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
node_modules/rollup/dist/shared/loadConfigFile.js
ADDED
|
@@ -0,0 +1,572 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
'use strict';
|
| 11 |
+
|
| 12 |
+
const promises = require('node:fs/promises');
|
| 13 |
+
const path = require('node:path');
|
| 14 |
+
const process$1 = require('node:process');
|
| 15 |
+
const node_url = require('node:url');
|
| 16 |
+
const rollup = require('./rollup.js');
|
| 17 |
+
const parseAst_js = require('./parseAst.js');
|
| 18 |
+
const getLogFilter_js = require('../getLogFilter.js');
|
| 19 |
+
|
| 20 |
+
function batchWarnings(command) {
|
| 21 |
+
const silent = !!command.silent;
|
| 22 |
+
const logFilter = generateLogFilter(command);
|
| 23 |
+
let count = 0;
|
| 24 |
+
const deferredWarnings = new Map();
|
| 25 |
+
let warningOccurred = false;
|
| 26 |
+
const add = (warning) => {
|
| 27 |
+
count += 1;
|
| 28 |
+
warningOccurred = true;
|
| 29 |
+
if (silent)
|
| 30 |
+
return;
|
| 31 |
+
if (warning.code in deferredHandlers) {
|
| 32 |
+
rollup.getOrCreate(deferredWarnings, warning.code, rollup.getNewArray).push(warning);
|
| 33 |
+
}
|
| 34 |
+
else if (warning.code in immediateHandlers) {
|
| 35 |
+
immediateHandlers[warning.code](warning);
|
| 36 |
+
}
|
| 37 |
+
else {
|
| 38 |
+
title(warning.message);
|
| 39 |
+
defaultBody(warning);
|
| 40 |
+
}
|
| 41 |
+
};
|
| 42 |
+
return {
|
| 43 |
+
add,
|
| 44 |
+
get count() {
|
| 45 |
+
return count;
|
| 46 |
+
},
|
| 47 |
+
flush() {
|
| 48 |
+
if (count === 0 || silent)
|
| 49 |
+
return;
|
| 50 |
+
const codes = [...deferredWarnings.keys()].sort((a, b) => deferredWarnings.get(b).length - deferredWarnings.get(a).length);
|
| 51 |
+
for (const code of codes) {
|
| 52 |
+
deferredHandlers[code](deferredWarnings.get(code));
|
| 53 |
+
}
|
| 54 |
+
deferredWarnings.clear();
|
| 55 |
+
count = 0;
|
| 56 |
+
},
|
| 57 |
+
log(level, log) {
|
| 58 |
+
if (!logFilter(log))
|
| 59 |
+
return;
|
| 60 |
+
switch (level) {
|
| 61 |
+
case parseAst_js.LOGLEVEL_WARN: {
|
| 62 |
+
return add(log);
|
| 63 |
+
}
|
| 64 |
+
case parseAst_js.LOGLEVEL_DEBUG: {
|
| 65 |
+
if (!silent) {
|
| 66 |
+
rollup.stderr(rollup.bold(rollup.pc.blue(log.message)));
|
| 67 |
+
defaultBody(log);
|
| 68 |
+
}
|
| 69 |
+
return;
|
| 70 |
+
}
|
| 71 |
+
default: {
|
| 72 |
+
if (!silent) {
|
| 73 |
+
rollup.stderr(rollup.bold(rollup.pc.cyan(log.message)));
|
| 74 |
+
defaultBody(log);
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
get warningOccurred() {
|
| 80 |
+
return warningOccurred;
|
| 81 |
+
}
|
| 82 |
+
};
|
| 83 |
+
}
|
| 84 |
+
const immediateHandlers = {
|
| 85 |
+
MISSING_NODE_BUILTINS(warning) {
|
| 86 |
+
title(`Missing shims for Node.js built-ins`);
|
| 87 |
+
rollup.stderr(`Creating a browser bundle that depends on ${parseAst_js.printQuotedStringList(warning.ids)}. You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`);
|
| 88 |
+
},
|
| 89 |
+
UNKNOWN_OPTION(warning) {
|
| 90 |
+
title(`You have passed an unrecognized option`);
|
| 91 |
+
rollup.stderr(warning.message);
|
| 92 |
+
}
|
| 93 |
+
};
|
| 94 |
+
const deferredHandlers = {
|
| 95 |
+
CIRCULAR_DEPENDENCY(warnings) {
|
| 96 |
+
title(`Circular dependenc${warnings.length > 1 ? 'ies' : 'y'}`);
|
| 97 |
+
const displayed = warnings.length > 5 ? warnings.slice(0, 3) : warnings;
|
| 98 |
+
for (const warning of displayed) {
|
| 99 |
+
rollup.stderr(warning.ids.map(parseAst_js.relativeId).join(' -> '));
|
| 100 |
+
}
|
| 101 |
+
if (warnings.length > displayed.length) {
|
| 102 |
+
rollup.stderr(`...and ${warnings.length - displayed.length} more`);
|
| 103 |
+
}
|
| 104 |
+
},
|
| 105 |
+
EMPTY_BUNDLE(warnings) {
|
| 106 |
+
title(`Generated${warnings.length === 1 ? ' an' : ''} empty ${warnings.length > 1 ? 'chunks' : 'chunk'}`);
|
| 107 |
+
rollup.stderr(parseAst_js.printQuotedStringList(warnings.map(warning => warning.names[0])));
|
| 108 |
+
},
|
| 109 |
+
EVAL(warnings) {
|
| 110 |
+
title('Use of eval is strongly discouraged');
|
| 111 |
+
info(parseAst_js.getRollupUrl(parseAst_js.URL_AVOIDING_EVAL));
|
| 112 |
+
showTruncatedWarnings(warnings);
|
| 113 |
+
},
|
| 114 |
+
MISSING_EXPORT(warnings) {
|
| 115 |
+
title('Missing exports');
|
| 116 |
+
info(parseAst_js.getRollupUrl(parseAst_js.URL_NAME_IS_NOT_EXPORTED));
|
| 117 |
+
for (const warning of warnings) {
|
| 118 |
+
rollup.stderr(rollup.bold(parseAst_js.relativeId(warning.id)));
|
| 119 |
+
rollup.stderr(`${warning.binding} is not exported by ${parseAst_js.relativeId(warning.exporter)}`);
|
| 120 |
+
rollup.stderr(rollup.gray(warning.frame));
|
| 121 |
+
}
|
| 122 |
+
},
|
| 123 |
+
MISSING_GLOBAL_NAME(warnings) {
|
| 124 |
+
title(`Missing global variable ${warnings.length > 1 ? 'names' : 'name'}`);
|
| 125 |
+
info(parseAst_js.getRollupUrl(parseAst_js.URL_OUTPUT_GLOBALS));
|
| 126 |
+
rollup.stderr(`Use "output.globals" to specify browser global variable names corresponding to external modules:`);
|
| 127 |
+
for (const warning of warnings) {
|
| 128 |
+
rollup.stderr(`${rollup.bold(warning.id)} (guessing "${warning.names[0]}")`);
|
| 129 |
+
}
|
| 130 |
+
},
|
| 131 |
+
MIXED_EXPORTS(warnings) {
|
| 132 |
+
title('Mixing named and default exports');
|
| 133 |
+
info(parseAst_js.getRollupUrl(parseAst_js.URL_OUTPUT_EXPORTS));
|
| 134 |
+
rollup.stderr(rollup.bold('The following entry modules are using named and default exports together:'));
|
| 135 |
+
warnings.sort((a, b) => (a.id < b.id ? -1 : 1));
|
| 136 |
+
const displayedWarnings = warnings.length > 5 ? warnings.slice(0, 3) : warnings;
|
| 137 |
+
for (const warning of displayedWarnings) {
|
| 138 |
+
rollup.stderr(parseAst_js.relativeId(warning.id));
|
| 139 |
+
}
|
| 140 |
+
if (displayedWarnings.length < warnings.length) {
|
| 141 |
+
rollup.stderr(`...and ${warnings.length - displayedWarnings.length} other entry modules`);
|
| 142 |
+
}
|
| 143 |
+
rollup.stderr(`\nConsumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`);
|
| 144 |
+
},
|
| 145 |
+
NAMESPACE_CONFLICT(warnings) {
|
| 146 |
+
title(`Conflicting re-exports`);
|
| 147 |
+
for (const warning of warnings) {
|
| 148 |
+
rollup.stderr(`"${rollup.bold(parseAst_js.relativeId(warning.reexporter))}" re-exports "${warning.binding}" from both "${parseAst_js.relativeId(warning.ids[0])}" and "${parseAst_js.relativeId(warning.ids[1])}" (will be ignored).`);
|
| 149 |
+
}
|
| 150 |
+
},
|
| 151 |
+
PLUGIN_WARNING(warnings) {
|
| 152 |
+
const nestedByPlugin = nest(warnings, 'plugin');
|
| 153 |
+
for (const { items } of nestedByPlugin) {
|
| 154 |
+
const nestedByMessage = nest(items, 'message');
|
| 155 |
+
let lastUrl = '';
|
| 156 |
+
for (const { key: message, items } of nestedByMessage) {
|
| 157 |
+
title(message);
|
| 158 |
+
for (const warning of items) {
|
| 159 |
+
if (warning.url && warning.url !== lastUrl)
|
| 160 |
+
info((lastUrl = warning.url));
|
| 161 |
+
const loc = formatLocation(warning);
|
| 162 |
+
if (loc) {
|
| 163 |
+
rollup.stderr(rollup.bold(loc));
|
| 164 |
+
}
|
| 165 |
+
if (warning.frame)
|
| 166 |
+
info(warning.frame);
|
| 167 |
+
}
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
},
|
| 171 |
+
SOURCEMAP_BROKEN(warnings) {
|
| 172 |
+
title(`Broken sourcemap`);
|
| 173 |
+
info(parseAst_js.getRollupUrl(parseAst_js.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT));
|
| 174 |
+
const plugins = [...new Set(warnings.map(({ plugin }) => plugin).filter(Boolean))];
|
| 175 |
+
rollup.stderr(`Plugins that transform code (such as ${parseAst_js.printQuotedStringList(plugins)}) should generate accompanying sourcemaps.`);
|
| 176 |
+
},
|
| 177 |
+
THIS_IS_UNDEFINED(warnings) {
|
| 178 |
+
title('"this" has been rewritten to "undefined"');
|
| 179 |
+
info(parseAst_js.getRollupUrl(parseAst_js.URL_THIS_IS_UNDEFINED));
|
| 180 |
+
showTruncatedWarnings(warnings);
|
| 181 |
+
},
|
| 182 |
+
UNRESOLVED_IMPORT(warnings) {
|
| 183 |
+
title('Unresolved dependencies');
|
| 184 |
+
info(parseAst_js.getRollupUrl(parseAst_js.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY));
|
| 185 |
+
const dependencies = new Map();
|
| 186 |
+
for (const warning of warnings) {
|
| 187 |
+
rollup.getOrCreate(dependencies, parseAst_js.relativeId(warning.exporter), rollup.getNewArray).push(parseAst_js.relativeId(warning.id));
|
| 188 |
+
}
|
| 189 |
+
for (const [dependency, importers] of dependencies) {
|
| 190 |
+
rollup.stderr(`${rollup.bold(dependency)} (imported by ${parseAst_js.printQuotedStringList(importers)})`);
|
| 191 |
+
}
|
| 192 |
+
},
|
| 193 |
+
UNUSED_EXTERNAL_IMPORT(warnings) {
|
| 194 |
+
title('Unused external imports');
|
| 195 |
+
for (const warning of warnings) {
|
| 196 |
+
rollup.stderr(warning.names +
|
| 197 |
+
' imported from external module "' +
|
| 198 |
+
warning.exporter +
|
| 199 |
+
'" but never used in ' +
|
| 200 |
+
parseAst_js.printQuotedStringList(warning.ids.map(parseAst_js.relativeId)) +
|
| 201 |
+
'.');
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
+
};
|
| 205 |
+
function defaultBody(log) {
|
| 206 |
+
if (log.url) {
|
| 207 |
+
info(log.url);
|
| 208 |
+
}
|
| 209 |
+
const loc = formatLocation(log);
|
| 210 |
+
if (loc) {
|
| 211 |
+
rollup.stderr(rollup.bold(loc));
|
| 212 |
+
}
|
| 213 |
+
if (log.frame)
|
| 214 |
+
info(log.frame);
|
| 215 |
+
}
|
| 216 |
+
function title(string_) {
|
| 217 |
+
rollup.stderr(rollup.bold(rollup.yellow(`(!) ${string_}`)));
|
| 218 |
+
}
|
| 219 |
+
function info(url) {
|
| 220 |
+
rollup.stderr(rollup.gray(url));
|
| 221 |
+
}
|
| 222 |
+
function nest(array, property) {
|
| 223 |
+
const nested = [];
|
| 224 |
+
const lookup = new Map();
|
| 225 |
+
for (const item of array) {
|
| 226 |
+
const key = item[property];
|
| 227 |
+
rollup.getOrCreate(lookup, key, () => {
|
| 228 |
+
const items = {
|
| 229 |
+
items: [],
|
| 230 |
+
key
|
| 231 |
+
};
|
| 232 |
+
nested.push(items);
|
| 233 |
+
return items;
|
| 234 |
+
}).items.push(item);
|
| 235 |
+
}
|
| 236 |
+
return nested;
|
| 237 |
+
}
|
| 238 |
+
function showTruncatedWarnings(warnings) {
|
| 239 |
+
const nestedByModule = nest(warnings, 'id');
|
| 240 |
+
const displayedByModule = nestedByModule.length > 5 ? nestedByModule.slice(0, 3) : nestedByModule;
|
| 241 |
+
for (const { key: id, items } of displayedByModule) {
|
| 242 |
+
rollup.stderr(rollup.bold(parseAst_js.relativeId(id)));
|
| 243 |
+
rollup.stderr(rollup.gray(items[0].frame));
|
| 244 |
+
if (items.length > 1) {
|
| 245 |
+
rollup.stderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`);
|
| 246 |
+
}
|
| 247 |
+
}
|
| 248 |
+
if (nestedByModule.length > displayedByModule.length) {
|
| 249 |
+
rollup.stderr(`\n...and ${nestedByModule.length - displayedByModule.length} other files`);
|
| 250 |
+
}
|
| 251 |
+
}
|
| 252 |
+
function generateLogFilter(command) {
|
| 253 |
+
const filters = rollup.ensureArray(command.filterLogs).flatMap(filter => String(filter).split(','));
|
| 254 |
+
if (process.env.ROLLUP_FILTER_LOGS) {
|
| 255 |
+
filters.push(...process.env.ROLLUP_FILTER_LOGS.split(','));
|
| 256 |
+
}
|
| 257 |
+
return getLogFilter_js.getLogFilter(filters);
|
| 258 |
+
}
|
| 259 |
+
function formatLocation(log) {
|
| 260 |
+
const id = log.loc?.file || log.id;
|
| 261 |
+
if (!id)
|
| 262 |
+
return null;
|
| 263 |
+
return log.loc ? `${id}:${log.loc.line}:${log.loc.column}` : id;
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
const stdinName = '-';
|
| 267 |
+
let stdinResult = null;
|
| 268 |
+
function stdinPlugin(argument) {
|
| 269 |
+
const suffix = typeof argument == 'string' && argument.length > 0 ? '.' + argument : '';
|
| 270 |
+
return {
|
| 271 |
+
load(id) {
|
| 272 |
+
if (id === stdinName || id.startsWith(stdinName + '.')) {
|
| 273 |
+
return stdinResult || (stdinResult = readStdin());
|
| 274 |
+
}
|
| 275 |
+
},
|
| 276 |
+
name: 'stdin',
|
| 277 |
+
resolveId(id) {
|
| 278 |
+
if (id === stdinName) {
|
| 279 |
+
return id + suffix;
|
| 280 |
+
}
|
| 281 |
+
}
|
| 282 |
+
};
|
| 283 |
+
}
|
| 284 |
+
function readStdin() {
|
| 285 |
+
return new Promise((resolve, reject) => {
|
| 286 |
+
const chunks = [];
|
| 287 |
+
process$1.stdin.setEncoding('utf8');
|
| 288 |
+
process$1.stdin
|
| 289 |
+
.on('data', chunk => chunks.push(chunk))
|
| 290 |
+
.on('end', () => {
|
| 291 |
+
const result = chunks.join('');
|
| 292 |
+
resolve(result);
|
| 293 |
+
})
|
| 294 |
+
.on('error', error => {
|
| 295 |
+
reject(error);
|
| 296 |
+
});
|
| 297 |
+
});
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
function waitForInputPlugin() {
|
| 301 |
+
return {
|
| 302 |
+
async buildStart(options) {
|
| 303 |
+
const inputSpecifiers = Array.isArray(options.input)
|
| 304 |
+
? options.input
|
| 305 |
+
: Object.keys(options.input);
|
| 306 |
+
let lastAwaitedSpecifier = null;
|
| 307 |
+
checkSpecifiers: while (true) {
|
| 308 |
+
for (const specifier of inputSpecifiers) {
|
| 309 |
+
if ((await this.resolve(specifier)) === null) {
|
| 310 |
+
if (lastAwaitedSpecifier !== specifier) {
|
| 311 |
+
rollup.stderr(`waiting for input ${rollup.bold(specifier)}...`);
|
| 312 |
+
lastAwaitedSpecifier = specifier;
|
| 313 |
+
}
|
| 314 |
+
await new Promise(resolve => setTimeout(resolve, 500));
|
| 315 |
+
continue checkSpecifiers;
|
| 316 |
+
}
|
| 317 |
+
}
|
| 318 |
+
break;
|
| 319 |
+
}
|
| 320 |
+
},
|
| 321 |
+
name: 'wait-for-input'
|
| 322 |
+
};
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
async function addCommandPluginsToInputOptions(inputOptions, command) {
|
| 326 |
+
if (command.stdin !== false) {
|
| 327 |
+
inputOptions.plugins.push(stdinPlugin(command.stdin));
|
| 328 |
+
}
|
| 329 |
+
if (command.waitForBundleInput === true) {
|
| 330 |
+
inputOptions.plugins.push(waitForInputPlugin());
|
| 331 |
+
}
|
| 332 |
+
await addPluginsFromCommandOption(command.plugin, inputOptions);
|
| 333 |
+
}
|
| 334 |
+
async function addPluginsFromCommandOption(commandPlugin, inputOptions) {
|
| 335 |
+
if (commandPlugin) {
|
| 336 |
+
const plugins = await rollup.normalizePluginOption(commandPlugin);
|
| 337 |
+
for (const plugin of plugins) {
|
| 338 |
+
if (/[={}]/.test(plugin)) {
|
| 339 |
+
// -p plugin=value
|
| 340 |
+
// -p "{transform(c,i){...}}"
|
| 341 |
+
await loadAndRegisterPlugin(inputOptions, plugin);
|
| 342 |
+
}
|
| 343 |
+
else {
|
| 344 |
+
// split out plugins joined by commas
|
| 345 |
+
// -p node-resolve,commonjs,buble
|
| 346 |
+
for (const p of plugin.split(',')) {
|
| 347 |
+
await loadAndRegisterPlugin(inputOptions, p);
|
| 348 |
+
}
|
| 349 |
+
}
|
| 350 |
+
}
|
| 351 |
+
}
|
| 352 |
+
}
|
| 353 |
+
async function loadAndRegisterPlugin(inputOptions, pluginText) {
|
| 354 |
+
let plugin = null;
|
| 355 |
+
let pluginArgument = undefined;
|
| 356 |
+
if (pluginText[0] === '{') {
|
| 357 |
+
// -p "{transform(c,i){...}}"
|
| 358 |
+
plugin = new Function('return ' + pluginText);
|
| 359 |
+
}
|
| 360 |
+
else {
|
| 361 |
+
const match = pluginText.match(/^([\w./:@\\^{|}-]+)(=(.*))?$/);
|
| 362 |
+
if (match) {
|
| 363 |
+
// -p plugin
|
| 364 |
+
// -p plugin=arg
|
| 365 |
+
pluginText = match[1];
|
| 366 |
+
pluginArgument = new Function('return ' + match[3])();
|
| 367 |
+
}
|
| 368 |
+
else {
|
| 369 |
+
throw new Error(`Invalid --plugin argument format: ${JSON.stringify(pluginText)}`);
|
| 370 |
+
}
|
| 371 |
+
if (!/^\.|^rollup-plugin-|[/@\\]/.test(pluginText)) {
|
| 372 |
+
// Try using plugin prefix variations first if applicable.
|
| 373 |
+
// Prefix order is significant - left has higher precedence.
|
| 374 |
+
for (const prefix of ['@rollup/plugin-', 'rollup-plugin-']) {
|
| 375 |
+
try {
|
| 376 |
+
plugin = await requireOrImport(prefix + pluginText);
|
| 377 |
+
break;
|
| 378 |
+
}
|
| 379 |
+
catch {
|
| 380 |
+
// if this does not work, we try requiring the actual name below
|
| 381 |
+
}
|
| 382 |
+
}
|
| 383 |
+
}
|
| 384 |
+
if (!plugin) {
|
| 385 |
+
try {
|
| 386 |
+
if (pluginText[0] == '.')
|
| 387 |
+
pluginText = path.resolve(pluginText);
|
| 388 |
+
// Windows absolute paths must be specified as file:// protocol URL
|
| 389 |
+
// Note that we do not have coverage for Windows-only code paths
|
| 390 |
+
else if (/^[A-Za-z]:\\/.test(pluginText)) {
|
| 391 |
+
pluginText = node_url.pathToFileURL(path.resolve(pluginText)).href;
|
| 392 |
+
}
|
| 393 |
+
plugin = await requireOrImport(pluginText);
|
| 394 |
+
}
|
| 395 |
+
catch (error) {
|
| 396 |
+
throw new Error(`Cannot load plugin "${pluginText}": ${error.message}.`);
|
| 397 |
+
}
|
| 398 |
+
}
|
| 399 |
+
}
|
| 400 |
+
// some plugins do not use `module.exports` for their entry point,
|
| 401 |
+
// in which case we try the named default export and the plugin name
|
| 402 |
+
if (typeof plugin === 'object') {
|
| 403 |
+
plugin = plugin.default || plugin[getCamelizedPluginBaseName(pluginText)];
|
| 404 |
+
}
|
| 405 |
+
if (!plugin) {
|
| 406 |
+
throw new Error(`Cannot find entry for plugin "${pluginText}". The plugin needs to export a function either as "default" or "${getCamelizedPluginBaseName(pluginText)}" for Rollup to recognize it.`);
|
| 407 |
+
}
|
| 408 |
+
inputOptions.plugins.push(typeof plugin === 'function' ? plugin.call(plugin, pluginArgument) : plugin);
|
| 409 |
+
}
|
| 410 |
+
function getCamelizedPluginBaseName(pluginText) {
|
| 411 |
+
return (pluginText.match(/(@rollup\/plugin-|rollup-plugin-)(.+)$/)?.[2] || pluginText)
|
| 412 |
+
.split(/[/\\]/)
|
| 413 |
+
.slice(-1)[0]
|
| 414 |
+
.split('.')[0]
|
| 415 |
+
.split('-')
|
| 416 |
+
.map((part, index) => (index === 0 || !part ? part : part[0].toUpperCase() + part.slice(1)))
|
| 417 |
+
.join('');
|
| 418 |
+
}
|
| 419 |
+
async function requireOrImport(pluginPath) {
|
| 420 |
+
try {
|
| 421 |
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
| 422 |
+
return require(pluginPath);
|
| 423 |
+
}
|
| 424 |
+
catch {
|
| 425 |
+
return import(pluginPath);
|
| 426 |
+
}
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
const loadConfigFile = async (fileName, commandOptions = {}, watchMode = false) => {
|
| 430 |
+
const configs = await getConfigList(getDefaultFromCjs(await getConfigFileExport(fileName, commandOptions, watchMode)), commandOptions);
|
| 431 |
+
const warnings = batchWarnings(commandOptions);
|
| 432 |
+
try {
|
| 433 |
+
const normalizedConfigs = [];
|
| 434 |
+
for (const config of configs) {
|
| 435 |
+
const options = await rollup.mergeOptions(config, watchMode, commandOptions, warnings.log);
|
| 436 |
+
await addCommandPluginsToInputOptions(options, commandOptions);
|
| 437 |
+
normalizedConfigs.push(options);
|
| 438 |
+
}
|
| 439 |
+
return { options: normalizedConfigs, warnings };
|
| 440 |
+
}
|
| 441 |
+
catch (error_) {
|
| 442 |
+
warnings.flush();
|
| 443 |
+
throw error_;
|
| 444 |
+
}
|
| 445 |
+
};
|
| 446 |
+
async function getConfigFileExport(fileName, commandOptions, watchMode) {
|
| 447 |
+
if (commandOptions.configPlugin || commandOptions.bundleConfigAsCjs) {
|
| 448 |
+
try {
|
| 449 |
+
return await loadTranspiledConfigFile(fileName, commandOptions);
|
| 450 |
+
}
|
| 451 |
+
catch (error_) {
|
| 452 |
+
if (error_.message.includes('not defined in ES module scope')) {
|
| 453 |
+
return parseAst_js.error(parseAst_js.logCannotBundleConfigAsEsm(error_));
|
| 454 |
+
}
|
| 455 |
+
throw error_;
|
| 456 |
+
}
|
| 457 |
+
}
|
| 458 |
+
let cannotLoadEsm = false;
|
| 459 |
+
const handleWarning = (warning) => {
|
| 460 |
+
if (warning.message?.includes('To load an ES module') ||
|
| 461 |
+
warning.message?.includes('Failed to load the ES module')) {
|
| 462 |
+
cannotLoadEsm = true;
|
| 463 |
+
}
|
| 464 |
+
};
|
| 465 |
+
process$1.on('warning', handleWarning);
|
| 466 |
+
try {
|
| 467 |
+
const fileUrl = node_url.pathToFileURL(fileName);
|
| 468 |
+
if (watchMode) {
|
| 469 |
+
// We are adding the current date to allow reloads in watch mode
|
| 470 |
+
fileUrl.search = `?${Date.now()}`;
|
| 471 |
+
}
|
| 472 |
+
return (await import(fileUrl.href)).default;
|
| 473 |
+
}
|
| 474 |
+
catch (error_) {
|
| 475 |
+
if (cannotLoadEsm) {
|
| 476 |
+
return parseAst_js.error(parseAst_js.logCannotLoadConfigAsCjs(error_));
|
| 477 |
+
}
|
| 478 |
+
if (error_.message.includes('not defined in ES module scope')) {
|
| 479 |
+
return parseAst_js.error(parseAst_js.logCannotLoadConfigAsEsm(error_));
|
| 480 |
+
}
|
| 481 |
+
throw error_;
|
| 482 |
+
}
|
| 483 |
+
finally {
|
| 484 |
+
process$1.off('warning', handleWarning);
|
| 485 |
+
}
|
| 486 |
+
}
|
| 487 |
+
function getDefaultFromCjs(namespace) {
|
| 488 |
+
return namespace.default || namespace;
|
| 489 |
+
}
|
| 490 |
+
function getConfigImportAttributesKey(input) {
|
| 491 |
+
if (input === 'assert' || input === 'with')
|
| 492 |
+
return input;
|
| 493 |
+
return;
|
| 494 |
+
}
|
| 495 |
+
async function loadTranspiledConfigFile(fileName, commandOptions) {
|
| 496 |
+
const { bundleConfigAsCjs, configPlugin, configImportAttributesKey, silent } = commandOptions;
|
| 497 |
+
const warnings = batchWarnings(commandOptions);
|
| 498 |
+
const inputOptions = {
|
| 499 |
+
// Do *not* specify external callback here - instead, perform the externality check it via fallback-plugin just below this comment.
|
| 500 |
+
// This allows config plugin to first decide whether some import is external or not, and only then trigger the check in fallback-plugin.
|
| 501 |
+
// Since the check is ultra-simple during this stage of transforming the config file itself, it should be fallback instead of primary check.
|
| 502 |
+
// That way, e.g. importing workspace packages will work as expected - the workspace package will be bundled.
|
| 503 |
+
input: fileName,
|
| 504 |
+
onwarn: warnings.add,
|
| 505 |
+
plugins: [],
|
| 506 |
+
treeshake: false
|
| 507 |
+
};
|
| 508 |
+
await addPluginsFromCommandOption(configPlugin, inputOptions);
|
| 509 |
+
// Add plugin as *last* item after addPluginsFromCommandOption is complete.
|
| 510 |
+
// This plugin will trigger for imports not resolved by config plugin, and mark all non-relative imports as external.
|
| 511 |
+
inputOptions.plugins.push({
|
| 512 |
+
name: 'external-fallback',
|
| 513 |
+
resolveId: source => {
|
| 514 |
+
const looksLikeExternal = (source[0] !== '.' && !path.isAbsolute(source)) || source.slice(-5) === '.json';
|
| 515 |
+
return looksLikeExternal ? false : null;
|
| 516 |
+
}
|
| 517 |
+
});
|
| 518 |
+
const bundle = await rollup.rollup(inputOptions);
|
| 519 |
+
const { output: [{ code }] } = await bundle.generate({
|
| 520 |
+
exports: 'named',
|
| 521 |
+
format: bundleConfigAsCjs ? 'cjs' : 'es',
|
| 522 |
+
importAttributesKey: getConfigImportAttributesKey(configImportAttributesKey),
|
| 523 |
+
plugins: [
|
| 524 |
+
{
|
| 525 |
+
name: 'transpile-import-meta',
|
| 526 |
+
resolveImportMeta(property, { moduleId }) {
|
| 527 |
+
if (property === 'url') {
|
| 528 |
+
return `'${node_url.pathToFileURL(moduleId).href}'`;
|
| 529 |
+
}
|
| 530 |
+
if (property == 'filename') {
|
| 531 |
+
return `'${moduleId}'`;
|
| 532 |
+
}
|
| 533 |
+
if (property == 'dirname') {
|
| 534 |
+
return `'${path.dirname(moduleId)}'`;
|
| 535 |
+
}
|
| 536 |
+
if (property == null) {
|
| 537 |
+
return `{url:'${node_url.pathToFileURL(moduleId).href}', filename: '${moduleId}', dirname: '${path.dirname(moduleId)}'}`;
|
| 538 |
+
}
|
| 539 |
+
}
|
| 540 |
+
}
|
| 541 |
+
]
|
| 542 |
+
});
|
| 543 |
+
if (!silent && warnings.count > 0) {
|
| 544 |
+
rollup.stderr(rollup.bold(`loaded ${parseAst_js.relativeId(fileName)} with warnings`));
|
| 545 |
+
warnings.flush();
|
| 546 |
+
}
|
| 547 |
+
return loadConfigFromWrittenFile(path.join(path.dirname(fileName), `rollup.config-${Date.now()}.${bundleConfigAsCjs ? 'cjs' : 'mjs'}`), code);
|
| 548 |
+
}
|
| 549 |
+
async function loadConfigFromWrittenFile(bundledFileName, bundledCode) {
|
| 550 |
+
await promises.writeFile(bundledFileName, bundledCode);
|
| 551 |
+
try {
|
| 552 |
+
return (await import(node_url.pathToFileURL(bundledFileName).href)).default;
|
| 553 |
+
}
|
| 554 |
+
finally {
|
| 555 |
+
promises.unlink(bundledFileName).catch(error => console.warn(error?.message || error));
|
| 556 |
+
}
|
| 557 |
+
}
|
| 558 |
+
async function getConfigList(configFileExport, commandOptions) {
|
| 559 |
+
const config = await (typeof configFileExport === 'function'
|
| 560 |
+
? configFileExport(commandOptions)
|
| 561 |
+
: configFileExport);
|
| 562 |
+
if (Object.keys(config).length === 0) {
|
| 563 |
+
return parseAst_js.error(parseAst_js.logMissingConfig());
|
| 564 |
+
}
|
| 565 |
+
return Array.isArray(config) ? config : [config];
|
| 566 |
+
}
|
| 567 |
+
|
| 568 |
+
exports.addCommandPluginsToInputOptions = addCommandPluginsToInputOptions;
|
| 569 |
+
exports.batchWarnings = batchWarnings;
|
| 570 |
+
exports.loadConfigFile = loadConfigFile;
|
| 571 |
+
exports.stdinName = stdinName;
|
| 572 |
+
//# sourceMappingURL=loadConfigFile.js.map
|
node_modules/rollup/dist/shared/parseAst.js
ADDED
|
@@ -0,0 +1,2330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
'use strict';
|
| 11 |
+
|
| 12 |
+
const native_js = require('../native.js');
|
| 13 |
+
const path = require('node:path');
|
| 14 |
+
|
| 15 |
+
/** @typedef {import('./types').Location} Location */
|
| 16 |
+
|
| 17 |
+
/**
|
| 18 |
+
* @param {import('./types').Range} range
|
| 19 |
+
* @param {number} index
|
| 20 |
+
*/
|
| 21 |
+
function rangeContains(range, index) {
|
| 22 |
+
return range.start <= index && index < range.end;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* @param {string} source
|
| 27 |
+
* @param {import('./types').Options} [options]
|
| 28 |
+
*/
|
| 29 |
+
function getLocator(source, options = {}) {
|
| 30 |
+
const { offsetLine = 0, offsetColumn = 0 } = options;
|
| 31 |
+
|
| 32 |
+
let start = 0;
|
| 33 |
+
const ranges = source.split('\n').map((line, i) => {
|
| 34 |
+
const end = start + line.length + 1;
|
| 35 |
+
|
| 36 |
+
/** @type {import('./types').Range} */
|
| 37 |
+
const range = { start, end, line: i };
|
| 38 |
+
|
| 39 |
+
start = end;
|
| 40 |
+
return range;
|
| 41 |
+
});
|
| 42 |
+
|
| 43 |
+
let i = 0;
|
| 44 |
+
|
| 45 |
+
/**
|
| 46 |
+
* @param {string | number} search
|
| 47 |
+
* @param {number} [index]
|
| 48 |
+
* @returns {Location | undefined}
|
| 49 |
+
*/
|
| 50 |
+
function locator(search, index) {
|
| 51 |
+
if (typeof search === 'string') {
|
| 52 |
+
search = source.indexOf(search, index ?? 0);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
if (search === -1) return undefined;
|
| 56 |
+
|
| 57 |
+
let range = ranges[i];
|
| 58 |
+
|
| 59 |
+
const d = search >= range.end ? 1 : -1;
|
| 60 |
+
|
| 61 |
+
while (range) {
|
| 62 |
+
if (rangeContains(range, search)) {
|
| 63 |
+
return {
|
| 64 |
+
line: offsetLine + range.line,
|
| 65 |
+
column: offsetColumn + search - range.start,
|
| 66 |
+
character: search
|
| 67 |
+
};
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
i += d;
|
| 71 |
+
range = ranges[i];
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
return locator;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
/**
|
| 79 |
+
* @param {string} source
|
| 80 |
+
* @param {string | number} search
|
| 81 |
+
* @param {import('./types').Options} [options]
|
| 82 |
+
* @returns {Location | undefined}
|
| 83 |
+
*/
|
| 84 |
+
function locate(source, search, options) {
|
| 85 |
+
return getLocator(source, options)(search, options && options.startIndex);
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
function spaces(index) {
|
| 89 |
+
let result = '';
|
| 90 |
+
while (index--)
|
| 91 |
+
result += ' ';
|
| 92 |
+
return result;
|
| 93 |
+
}
|
| 94 |
+
function tabsToSpaces(value) {
|
| 95 |
+
return value.replace(/^\t+/, match => match.split('\t').join(' '));
|
| 96 |
+
}
|
| 97 |
+
const LINE_TRUNCATE_LENGTH = 120;
|
| 98 |
+
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
| 99 |
+
const ELLIPSIS = '...';
|
| 100 |
+
function getCodeFrame(source, line, column) {
|
| 101 |
+
let lines = source.split('\n');
|
| 102 |
+
// Needed if a plugin did not generate correct sourcemaps
|
| 103 |
+
if (line > lines.length)
|
| 104 |
+
return '';
|
| 105 |
+
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length +
|
| 106 |
+
MIN_CHARACTERS_SHOWN_AFTER_LOCATION +
|
| 107 |
+
ELLIPSIS.length, LINE_TRUNCATE_LENGTH);
|
| 108 |
+
const frameStart = Math.max(0, line - 3);
|
| 109 |
+
let frameEnd = Math.min(line + 2, lines.length);
|
| 110 |
+
lines = lines.slice(frameStart, frameEnd);
|
| 111 |
+
while (!/\S/.test(lines[lines.length - 1])) {
|
| 112 |
+
lines.pop();
|
| 113 |
+
frameEnd -= 1;
|
| 114 |
+
}
|
| 115 |
+
const digits = String(frameEnd).length;
|
| 116 |
+
return lines
|
| 117 |
+
.map((sourceLine, index) => {
|
| 118 |
+
const isErrorLine = frameStart + index + 1 === line;
|
| 119 |
+
let lineNumber = String(index + frameStart + 1);
|
| 120 |
+
while (lineNumber.length < digits)
|
| 121 |
+
lineNumber = ` ${lineNumber}`;
|
| 122 |
+
let displayedLine = tabsToSpaces(sourceLine);
|
| 123 |
+
if (displayedLine.length > maxLineLength) {
|
| 124 |
+
displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`;
|
| 125 |
+
}
|
| 126 |
+
if (isErrorLine) {
|
| 127 |
+
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + '^';
|
| 128 |
+
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
| 129 |
+
}
|
| 130 |
+
return `${lineNumber}: ${displayedLine}`;
|
| 131 |
+
})
|
| 132 |
+
.join('\n');
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
const LOGLEVEL_SILENT = 'silent';
|
| 136 |
+
const LOGLEVEL_ERROR = 'error';
|
| 137 |
+
const LOGLEVEL_WARN = 'warn';
|
| 138 |
+
const LOGLEVEL_INFO = 'info';
|
| 139 |
+
const LOGLEVEL_DEBUG = 'debug';
|
| 140 |
+
const logLevelPriority = {
|
| 141 |
+
[LOGLEVEL_DEBUG]: 0,
|
| 142 |
+
[LOGLEVEL_INFO]: 1,
|
| 143 |
+
[LOGLEVEL_SILENT]: 3,
|
| 144 |
+
[LOGLEVEL_WARN]: 2
|
| 145 |
+
};
|
| 146 |
+
|
| 147 |
+
const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
|
| 148 |
+
const RELATIVE_PATH_REGEX = /^\.?\.(\/|$)/;
|
| 149 |
+
function isAbsolute(path) {
|
| 150 |
+
return ABSOLUTE_PATH_REGEX.test(path);
|
| 151 |
+
}
|
| 152 |
+
function isRelative(path) {
|
| 153 |
+
return RELATIVE_PATH_REGEX.test(path);
|
| 154 |
+
}
|
| 155 |
+
const BACKSLASH_REGEX = /\\/g;
|
| 156 |
+
function normalize(path) {
|
| 157 |
+
return path.replace(BACKSLASH_REGEX, '/');
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
function printQuotedStringList(list, verbs) {
|
| 161 |
+
const isSingleItem = list.length <= 1;
|
| 162 |
+
const quotedList = list.map(item => `"${item}"`);
|
| 163 |
+
let output = isSingleItem
|
| 164 |
+
? quotedList[0]
|
| 165 |
+
: `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`;
|
| 166 |
+
if (verbs) {
|
| 167 |
+
output += ` ${isSingleItem ? verbs[0] : verbs[1]}`;
|
| 168 |
+
}
|
| 169 |
+
return output;
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
const ANY_SLASH_REGEX = /[/\\]/;
|
| 173 |
+
function relative(from, to) {
|
| 174 |
+
const fromParts = from.split(ANY_SLASH_REGEX).filter(Boolean);
|
| 175 |
+
const toParts = to.split(ANY_SLASH_REGEX).filter(Boolean);
|
| 176 |
+
if (fromParts[0] === '.')
|
| 177 |
+
fromParts.shift();
|
| 178 |
+
if (toParts[0] === '.')
|
| 179 |
+
toParts.shift();
|
| 180 |
+
while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {
|
| 181 |
+
fromParts.shift();
|
| 182 |
+
toParts.shift();
|
| 183 |
+
}
|
| 184 |
+
while (toParts[0] === '..' && fromParts.length > 0) {
|
| 185 |
+
toParts.shift();
|
| 186 |
+
fromParts.pop();
|
| 187 |
+
}
|
| 188 |
+
while (fromParts.pop()) {
|
| 189 |
+
toParts.unshift('..');
|
| 190 |
+
}
|
| 191 |
+
return toParts.join('/');
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
function getAliasName(id) {
|
| 195 |
+
const base = path.basename(id);
|
| 196 |
+
return base.slice(0, Math.max(0, base.length - path.extname(id).length));
|
| 197 |
+
}
|
| 198 |
+
function relativeId(id) {
|
| 199 |
+
if (!isAbsolute(id))
|
| 200 |
+
return id;
|
| 201 |
+
return relative(path.resolve(), id);
|
| 202 |
+
}
|
| 203 |
+
function isPathFragment(name) {
|
| 204 |
+
// starting with "/", "./", "../", "C:/"
|
| 205 |
+
return (name[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name));
|
| 206 |
+
}
|
| 207 |
+
const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/;
|
| 208 |
+
function getImportPath(importerId, targetPath, stripJsExtension, ensureFileName) {
|
| 209 |
+
while (targetPath.startsWith('../')) {
|
| 210 |
+
targetPath = targetPath.slice(3);
|
| 211 |
+
importerId = '_/' + importerId;
|
| 212 |
+
}
|
| 213 |
+
let relativePath = normalize(relative(path.dirname(importerId), targetPath));
|
| 214 |
+
if (stripJsExtension && relativePath.endsWith('.js')) {
|
| 215 |
+
relativePath = relativePath.slice(0, -3);
|
| 216 |
+
}
|
| 217 |
+
if (ensureFileName) {
|
| 218 |
+
if (relativePath === '')
|
| 219 |
+
return '../' + path.basename(targetPath);
|
| 220 |
+
if (UPPER_DIR_REGEX.test(relativePath)) {
|
| 221 |
+
return [...relativePath.split('/'), '..', path.basename(targetPath)].join('/');
|
| 222 |
+
}
|
| 223 |
+
}
|
| 224 |
+
return relativePath ? (relativePath.startsWith('..') ? relativePath : './' + relativePath) : '.';
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
function isValidUrl(url) {
|
| 228 |
+
try {
|
| 229 |
+
new URL(url);
|
| 230 |
+
}
|
| 231 |
+
catch {
|
| 232 |
+
return false;
|
| 233 |
+
}
|
| 234 |
+
return true;
|
| 235 |
+
}
|
| 236 |
+
function getRollupUrl(snippet) {
|
| 237 |
+
return `https://rollupjs.org/${snippet}`;
|
| 238 |
+
}
|
| 239 |
+
function addTrailingSlashIfMissed(url) {
|
| 240 |
+
if (!url.endsWith('/')) {
|
| 241 |
+
return url + '/';
|
| 242 |
+
}
|
| 243 |
+
return url;
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
// troubleshooting
|
| 247 |
+
const URL_AVOIDING_EVAL = 'troubleshooting/#avoiding-eval';
|
| 248 |
+
const URL_NAME_IS_NOT_EXPORTED = 'troubleshooting/#error-name-is-not-exported-by-module';
|
| 249 |
+
const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined';
|
| 250 |
+
const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency';
|
| 251 |
+
const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect';
|
| 252 |
+
// configuration-options
|
| 253 |
+
const URL_JSX = 'configuration-options/#jsx';
|
| 254 |
+
const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id';
|
| 255 |
+
const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath';
|
| 256 |
+
const URL_OUTPUT_DIR = 'configuration-options/#output-dir';
|
| 257 |
+
const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports';
|
| 258 |
+
const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend';
|
| 259 |
+
const URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = 'configuration-options/#output-externalimportattributes';
|
| 260 |
+
const URL_OUTPUT_FORMAT = 'configuration-options/#output-format';
|
| 261 |
+
const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode';
|
| 262 |
+
const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals';
|
| 263 |
+
const URL_OUTPUT_INLINEDYNAMICIMPORTS = 'configuration-options/#output-inlinedynamicimports';
|
| 264 |
+
const URL_OUTPUT_INTEROP = 'configuration-options/#output-interop';
|
| 265 |
+
const URL_OUTPUT_MANUALCHUNKS = 'configuration-options/#output-manualchunks';
|
| 266 |
+
const URL_OUTPUT_NAME = 'configuration-options/#output-name';
|
| 267 |
+
const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-sourcemapbaseurl';
|
| 268 |
+
const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile';
|
| 269 |
+
const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures';
|
| 270 |
+
const URL_TREESHAKE = 'configuration-options/#treeshake';
|
| 271 |
+
const URL_TREESHAKE_PURE = 'configuration-options/#pure';
|
| 272 |
+
const URL_TREESHAKE_NOSIDEEFFECTS = 'configuration-options/#no-side-effects';
|
| 273 |
+
const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects';
|
| 274 |
+
const URL_WATCH = 'configuration-options/#watch';
|
| 275 |
+
// command-line-interface
|
| 276 |
+
const URL_BUNDLE_CONFIG_AS_CJS = 'command-line-interface/#bundleconfigascjs';
|
| 277 |
+
const URL_CONFIGURATION_FILES = 'command-line-interface/#configuration-files';
|
| 278 |
+
const URL_GENERATEBUNDLE = 'plugin-development/#generatebundle';
|
| 279 |
+
const URL_LOAD = 'plugin-development/#load';
|
| 280 |
+
const URL_TRANSFORM = 'plugin-development/#transform';
|
| 281 |
+
|
| 282 |
+
function error(base) {
|
| 283 |
+
throw base instanceof Error ? base : getRollupError(base);
|
| 284 |
+
}
|
| 285 |
+
function getRollupError(base) {
|
| 286 |
+
augmentLogMessage(base);
|
| 287 |
+
const errorInstance = Object.assign(new Error(base.message), base);
|
| 288 |
+
Object.defineProperty(errorInstance, 'name', {
|
| 289 |
+
value: 'RollupError',
|
| 290 |
+
writable: true
|
| 291 |
+
});
|
| 292 |
+
return errorInstance;
|
| 293 |
+
}
|
| 294 |
+
function augmentCodeLocation(properties, pos, source, id) {
|
| 295 |
+
if (typeof pos === 'object') {
|
| 296 |
+
const { line, column } = pos;
|
| 297 |
+
properties.loc = { column, file: id, line };
|
| 298 |
+
}
|
| 299 |
+
else {
|
| 300 |
+
properties.pos = pos;
|
| 301 |
+
const location = locate(source, pos, { offsetLine: 1 });
|
| 302 |
+
if (!location) {
|
| 303 |
+
return;
|
| 304 |
+
}
|
| 305 |
+
const { line, column } = location;
|
| 306 |
+
properties.loc = { column, file: id, line };
|
| 307 |
+
}
|
| 308 |
+
if (properties.frame === undefined) {
|
| 309 |
+
const { line, column } = properties.loc;
|
| 310 |
+
properties.frame = getCodeFrame(source, line, column);
|
| 311 |
+
}
|
| 312 |
+
}
|
| 313 |
+
const symbolAugmented = Symbol('augmented');
|
| 314 |
+
function augmentLogMessage(log) {
|
| 315 |
+
// Make sure to only augment the log message once
|
| 316 |
+
if (!(log.plugin || log.loc) || log[symbolAugmented]) {
|
| 317 |
+
return;
|
| 318 |
+
}
|
| 319 |
+
log[symbolAugmented] = true;
|
| 320 |
+
let prefix = '';
|
| 321 |
+
if (log.plugin) {
|
| 322 |
+
prefix += `[plugin ${log.plugin}] `;
|
| 323 |
+
}
|
| 324 |
+
const id = log.id || log.loc?.file;
|
| 325 |
+
if (id) {
|
| 326 |
+
const position = log.loc ? ` (${log.loc.line}:${log.loc.column})` : '';
|
| 327 |
+
prefix += `${relativeId(id)}${position}: `;
|
| 328 |
+
}
|
| 329 |
+
const oldMessage = log.message;
|
| 330 |
+
log.message = prefix + log.message;
|
| 331 |
+
tweakStackMessage(log, oldMessage);
|
| 332 |
+
}
|
| 333 |
+
// Error codes should be sorted alphabetically while errors should be sorted by
|
| 334 |
+
// error code below
|
| 335 |
+
const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_CHUNK = 'CIRCULAR_CHUNK', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_IMPORT_OPTIONS = 'DUPLICATE_IMPORT_OPTIONS', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FAIL_AFTER_WARNINGS = 'FAIL_AFTER_WARNINGS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_CONFIG_MODULE_FORMAT = 'INVALID_CONFIG_MODULE_FORMAT', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_CONFIG = 'MISSING_CONFIG', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_EXTERNAL_CONFIG = 'MISSING_EXTERNAL_CONFIG', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_JSX_EXPORT = 'MISSING_JSX_EXPORT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', ONLY_INLINE_SOURCEMAPS = 'ONLY_INLINE_SOURCEMAPS', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', RESERVED_NAMESPACE = 'RESERVED_NAMESPACE', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR';
|
| 336 |
+
function logAddonNotGenerated(message, hook, plugin) {
|
| 337 |
+
return {
|
| 338 |
+
code: ADDON_ERROR,
|
| 339 |
+
message: `Could not retrieve "${hook}". Check configuration of plugin "${plugin}".
|
| 340 |
+
\tError Message: ${message}`
|
| 341 |
+
};
|
| 342 |
+
}
|
| 343 |
+
function logAlreadyClosed() {
|
| 344 |
+
return {
|
| 345 |
+
code: ALREADY_CLOSED,
|
| 346 |
+
message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.'
|
| 347 |
+
};
|
| 348 |
+
}
|
| 349 |
+
function logAmbiguousExternalNamespaces(binding, reexportingModule, usedModule, sources) {
|
| 350 |
+
return {
|
| 351 |
+
binding,
|
| 352 |
+
code: AMBIGUOUS_EXTERNAL_NAMESPACES,
|
| 353 |
+
ids: sources,
|
| 354 |
+
message: `Ambiguous external namespace resolution: "${relativeId(reexportingModule)}" re-exports "${binding}" from one of the external modules ${printQuotedStringList(sources.map(module => relativeId(module)))}, guessing "${relativeId(usedModule)}".`,
|
| 355 |
+
reexporter: reexportingModule
|
| 356 |
+
};
|
| 357 |
+
}
|
| 358 |
+
function logAnonymousPluginCache() {
|
| 359 |
+
return {
|
| 360 |
+
code: ANONYMOUS_PLUGIN_CACHE,
|
| 361 |
+
message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.'
|
| 362 |
+
};
|
| 363 |
+
}
|
| 364 |
+
function logAssetNotFinalisedForFileName(name) {
|
| 365 |
+
return {
|
| 366 |
+
code: ASSET_NOT_FINALISED,
|
| 367 |
+
message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_<referenceId>, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.`
|
| 368 |
+
};
|
| 369 |
+
}
|
| 370 |
+
function logAssetReferenceIdNotFoundForSetSource(assetReferenceId) {
|
| 371 |
+
return {
|
| 372 |
+
code: ASSET_NOT_FOUND,
|
| 373 |
+
message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".`
|
| 374 |
+
};
|
| 375 |
+
}
|
| 376 |
+
function logAssetSourceAlreadySet(name) {
|
| 377 |
+
return {
|
| 378 |
+
code: ASSET_SOURCE_ALREADY_SET,
|
| 379 |
+
message: `Unable to set the source for asset "${name}", source already set.`
|
| 380 |
+
};
|
| 381 |
+
}
|
| 382 |
+
function logNoAssetSourceSet(assetName) {
|
| 383 |
+
return {
|
| 384 |
+
code: ASSET_SOURCE_MISSING,
|
| 385 |
+
message: `Plugin error creating asset "${assetName}" - no asset source set.`
|
| 386 |
+
};
|
| 387 |
+
}
|
| 388 |
+
function logBadLoader(id) {
|
| 389 |
+
return {
|
| 390 |
+
code: BAD_LOADER,
|
| 391 |
+
message: `Error loading "${relativeId(id)}": plugin load hook should return a string, a { code, map } object, or nothing/null.`
|
| 392 |
+
};
|
| 393 |
+
}
|
| 394 |
+
function logCannotCallNamespace(name) {
|
| 395 |
+
return {
|
| 396 |
+
code: CANNOT_CALL_NAMESPACE,
|
| 397 |
+
message: `Cannot call a namespace ("${name}").`
|
| 398 |
+
};
|
| 399 |
+
}
|
| 400 |
+
function logCannotEmitFromOptionsHook() {
|
| 401 |
+
return {
|
| 402 |
+
code: CANNOT_EMIT_FROM_OPTIONS_HOOK,
|
| 403 |
+
message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.`
|
| 404 |
+
};
|
| 405 |
+
}
|
| 406 |
+
function logChunkNotGeneratedForFileName(name) {
|
| 407 |
+
return {
|
| 408 |
+
code: CHUNK_NOT_GENERATED,
|
| 409 |
+
message: `Plugin error - Unable to get file name for emitted chunk "${name}". You can only get file names once chunks have been generated after the "renderStart" hook.`
|
| 410 |
+
};
|
| 411 |
+
}
|
| 412 |
+
function logChunkInvalid({ fileName, code }, { pos, message }) {
|
| 413 |
+
const errorProperties = {
|
| 414 |
+
code: CHUNK_INVALID,
|
| 415 |
+
message: `Chunk "${fileName}" is not valid JavaScript: ${message}.`
|
| 416 |
+
};
|
| 417 |
+
augmentCodeLocation(errorProperties, pos, code, fileName);
|
| 418 |
+
return errorProperties;
|
| 419 |
+
}
|
| 420 |
+
function logCircularDependency(cyclePath) {
|
| 421 |
+
return {
|
| 422 |
+
code: CIRCULAR_DEPENDENCY,
|
| 423 |
+
ids: cyclePath,
|
| 424 |
+
message: `Circular dependency: ${cyclePath.map(relativeId).join(' -> ')}`
|
| 425 |
+
};
|
| 426 |
+
}
|
| 427 |
+
function logCircularChunk(cyclePath, isManualChunkConflict) {
|
| 428 |
+
return {
|
| 429 |
+
code: CIRCULAR_CHUNK,
|
| 430 |
+
ids: cyclePath,
|
| 431 |
+
message: `Circular chunk: ${cyclePath.join(' -> ')}. ${isManualChunkConflict
|
| 432 |
+
? `Please adjust the manual chunk logic for these chunks.`
|
| 433 |
+
: `Consider disabling the "output.onlyExplicitManualChunks" option, as enabling it causes the static dependencies of the manual chunk "${cyclePath.at(-2)}" to be bundled into the chunk "${cyclePath.at(-1)}".`}`
|
| 434 |
+
};
|
| 435 |
+
}
|
| 436 |
+
function logCircularReexport(exportName, exporter) {
|
| 437 |
+
return {
|
| 438 |
+
code: CIRCULAR_REEXPORT,
|
| 439 |
+
exporter,
|
| 440 |
+
message: `"${exportName}" cannot be exported from "${relativeId(exporter)}" as it is a reexport that references itself.`
|
| 441 |
+
};
|
| 442 |
+
}
|
| 443 |
+
function logCyclicCrossChunkReexport(exportName, exporter, reexporter, importer, preserveModules) {
|
| 444 |
+
return {
|
| 445 |
+
code: CYCLIC_CROSS_CHUNK_REEXPORT,
|
| 446 |
+
exporter,
|
| 447 |
+
id: importer,
|
| 448 |
+
message: `Export "${exportName}" of module "${relativeId(exporter)}" was reexported through module "${relativeId(reexporter)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(importer)}" to point directly to the exporting module or ${preserveModules ? 'do not use "output.preserveModules"' : 'reconfigure "output.manualChunks"'} to ensure these modules end up in the same chunk.`,
|
| 449 |
+
reexporter
|
| 450 |
+
};
|
| 451 |
+
}
|
| 452 |
+
function logDeprecation(deprecation, urlSnippet, plugin) {
|
| 453 |
+
return {
|
| 454 |
+
code: DEPRECATED_FEATURE,
|
| 455 |
+
message: deprecation,
|
| 456 |
+
url: getRollupUrl(urlSnippet),
|
| 457 |
+
...({})
|
| 458 |
+
};
|
| 459 |
+
}
|
| 460 |
+
function logConstVariableReassignError() {
|
| 461 |
+
return {
|
| 462 |
+
code: CONST_REASSIGN,
|
| 463 |
+
message: 'Cannot reassign a variable declared with `const`'
|
| 464 |
+
};
|
| 465 |
+
}
|
| 466 |
+
function logDuplicateArgumentNameError(name) {
|
| 467 |
+
return {
|
| 468 |
+
code: DUPLICATE_ARGUMENT_NAME,
|
| 469 |
+
message: `Duplicate argument name "${name}"`
|
| 470 |
+
};
|
| 471 |
+
}
|
| 472 |
+
function logDuplicateExportError(name) {
|
| 473 |
+
return { code: DUPLICATE_EXPORT, message: `Duplicate export "${name}"` };
|
| 474 |
+
}
|
| 475 |
+
function logDuplicateImportOptions() {
|
| 476 |
+
return {
|
| 477 |
+
code: DUPLICATE_IMPORT_OPTIONS,
|
| 478 |
+
message: 'Either use --input, or pass input path as argument'
|
| 479 |
+
};
|
| 480 |
+
}
|
| 481 |
+
function logDuplicatePluginName(plugin) {
|
| 482 |
+
return {
|
| 483 |
+
code: DUPLICATE_PLUGIN_NAME,
|
| 484 |
+
message: `The plugin name ${plugin} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`
|
| 485 |
+
};
|
| 486 |
+
}
|
| 487 |
+
function logEmptyChunk(chunkName) {
|
| 488 |
+
return {
|
| 489 |
+
code: EMPTY_BUNDLE,
|
| 490 |
+
message: `Generated an empty chunk: "${chunkName}".`,
|
| 491 |
+
names: [chunkName]
|
| 492 |
+
};
|
| 493 |
+
}
|
| 494 |
+
function logEval(id) {
|
| 495 |
+
return {
|
| 496 |
+
code: EVAL,
|
| 497 |
+
id,
|
| 498 |
+
message: `Use of eval in "${relativeId(id)}" is strongly discouraged as it poses security risks and may cause issues with minification.`,
|
| 499 |
+
url: getRollupUrl(URL_AVOIDING_EVAL)
|
| 500 |
+
};
|
| 501 |
+
}
|
| 502 |
+
function logExternalSyntheticExports(id, importer) {
|
| 503 |
+
return {
|
| 504 |
+
code: EXTERNAL_SYNTHETIC_EXPORTS,
|
| 505 |
+
exporter: id,
|
| 506 |
+
message: `External "${id}" cannot have "syntheticNamedExports" enabled (imported by "${relativeId(importer)}").`
|
| 507 |
+
};
|
| 508 |
+
}
|
| 509 |
+
function logFailAfterWarnings() {
|
| 510 |
+
return {
|
| 511 |
+
code: FAIL_AFTER_WARNINGS,
|
| 512 |
+
message: 'Warnings occurred and --failAfterWarnings flag present.'
|
| 513 |
+
};
|
| 514 |
+
}
|
| 515 |
+
function logFileNameConflict(fileName) {
|
| 516 |
+
return {
|
| 517 |
+
code: FILE_NAME_CONFLICT,
|
| 518 |
+
message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.`
|
| 519 |
+
};
|
| 520 |
+
}
|
| 521 |
+
function logFileReferenceIdNotFoundForFilename(assetReferenceId) {
|
| 522 |
+
return {
|
| 523 |
+
code: FILE_NOT_FOUND,
|
| 524 |
+
message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".`
|
| 525 |
+
};
|
| 526 |
+
}
|
| 527 |
+
function logFirstSideEffect(source, id, { line, column }) {
|
| 528 |
+
return {
|
| 529 |
+
code: FIRST_SIDE_EFFECT,
|
| 530 |
+
message: `First side effect in ${relativeId(id)} is at (${line}:${column})\n${getCodeFrame(source, line, column)}`
|
| 531 |
+
};
|
| 532 |
+
}
|
| 533 |
+
function logIllegalIdentifierAsName(name) {
|
| 534 |
+
return {
|
| 535 |
+
code: ILLEGAL_IDENTIFIER_AS_NAME,
|
| 536 |
+
message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`,
|
| 537 |
+
url: getRollupUrl(URL_OUTPUT_EXTEND)
|
| 538 |
+
};
|
| 539 |
+
}
|
| 540 |
+
function logIllegalImportReassignment(name, importingId) {
|
| 541 |
+
return {
|
| 542 |
+
code: ILLEGAL_REASSIGNMENT,
|
| 543 |
+
message: `Illegal reassignment of import "${name}" in "${relativeId(importingId)}".`
|
| 544 |
+
};
|
| 545 |
+
}
|
| 546 |
+
function logInconsistentImportAttributes(existingAttributes, newAttributes, source, importer) {
|
| 547 |
+
return {
|
| 548 |
+
code: INCONSISTENT_IMPORT_ATTRIBUTES,
|
| 549 |
+
message: `Module "${relativeId(importer)}" tried to import "${relativeId(source)}" with ${formatAttributes(newAttributes)} attributes, but it was already imported elsewhere with ${formatAttributes(existingAttributes)} attributes. Please ensure that import attributes for the same module are always consistent.`
|
| 550 |
+
};
|
| 551 |
+
}
|
| 552 |
+
const formatAttributes = (attributes) => {
|
| 553 |
+
const entries = Object.entries(attributes);
|
| 554 |
+
if (entries.length === 0)
|
| 555 |
+
return 'no';
|
| 556 |
+
return entries.map(([key, value]) => `"${key}": "${value}"`).join(', ');
|
| 557 |
+
};
|
| 558 |
+
function logInvalidAnnotation(comment, id, type) {
|
| 559 |
+
return {
|
| 560 |
+
code: INVALID_ANNOTATION,
|
| 561 |
+
id,
|
| 562 |
+
message: `A comment\n\n"${comment}"\n\nin "${relativeId(id)}" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.`,
|
| 563 |
+
url: getRollupUrl(type === 'noSideEffects' ? URL_TREESHAKE_NOSIDEEFFECTS : URL_TREESHAKE_PURE)
|
| 564 |
+
};
|
| 565 |
+
}
|
| 566 |
+
function logInputHookInOutputPlugin(pluginName, hookName) {
|
| 567 |
+
return {
|
| 568 |
+
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
| 569 |
+
message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
|
| 570 |
+
};
|
| 571 |
+
}
|
| 572 |
+
function logCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) {
|
| 573 |
+
return {
|
| 574 |
+
code: INVALID_CHUNK,
|
| 575 |
+
message: `Cannot assign "${relativeId(moduleId)}" to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.`
|
| 576 |
+
};
|
| 577 |
+
}
|
| 578 |
+
function tweakStackMessage(error, oldMessage) {
|
| 579 |
+
if (!error.stack) {
|
| 580 |
+
return error;
|
| 581 |
+
}
|
| 582 |
+
error.stack = error.stack.replace(oldMessage, error.message);
|
| 583 |
+
return error;
|
| 584 |
+
}
|
| 585 |
+
function logCannotBundleConfigAsEsm(originalError) {
|
| 586 |
+
return tweakStackMessage({
|
| 587 |
+
cause: originalError,
|
| 588 |
+
code: INVALID_CONFIG_MODULE_FORMAT,
|
| 589 |
+
message: `Rollup transpiled your configuration to an ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.\n\nOriginal error: ${originalError.message}`,
|
| 590 |
+
stack: originalError.stack,
|
| 591 |
+
url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS)
|
| 592 |
+
}, originalError.message);
|
| 593 |
+
}
|
| 594 |
+
function logCannotLoadConfigAsCjs(originalError) {
|
| 595 |
+
return tweakStackMessage({
|
| 596 |
+
cause: originalError,
|
| 597 |
+
code: INVALID_CONFIG_MODULE_FORMAT,
|
| 598 |
+
message: `Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${originalError.message}`,
|
| 599 |
+
stack: originalError.stack,
|
| 600 |
+
url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS)
|
| 601 |
+
}, originalError.message);
|
| 602 |
+
}
|
| 603 |
+
function logCannotLoadConfigAsEsm(originalError) {
|
| 604 |
+
return tweakStackMessage({
|
| 605 |
+
cause: originalError,
|
| 606 |
+
code: INVALID_CONFIG_MODULE_FORMAT,
|
| 607 |
+
message: `Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to ".cjs" or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${originalError.message}`,
|
| 608 |
+
stack: originalError.stack,
|
| 609 |
+
url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS)
|
| 610 |
+
}, originalError.message);
|
| 611 |
+
}
|
| 612 |
+
function logInvalidExportOptionValue(optionValue) {
|
| 613 |
+
return {
|
| 614 |
+
code: INVALID_EXPORT_OPTION,
|
| 615 |
+
message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}".`,
|
| 616 |
+
url: getRollupUrl(URL_OUTPUT_EXPORTS)
|
| 617 |
+
};
|
| 618 |
+
}
|
| 619 |
+
function logIncompatibleExportOptionValue(optionValue, keys, entryModule) {
|
| 620 |
+
return {
|
| 621 |
+
code: INVALID_EXPORT_OPTION,
|
| 622 |
+
message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${printQuotedStringList(keys)}`,
|
| 623 |
+
url: getRollupUrl(URL_OUTPUT_EXPORTS)
|
| 624 |
+
};
|
| 625 |
+
}
|
| 626 |
+
function logInternalIdCannotBeExternal(source, importer) {
|
| 627 |
+
return {
|
| 628 |
+
code: INVALID_EXTERNAL_ID,
|
| 629 |
+
message: `"${source}" is imported as an external by "${relativeId(importer)}", but is already an existing non-external module id.`
|
| 630 |
+
};
|
| 631 |
+
}
|
| 632 |
+
function logImportOptionsAreInvalid(importer) {
|
| 633 |
+
return {
|
| 634 |
+
code: INVALID_IMPORT_ATTRIBUTE,
|
| 635 |
+
message: `Rollup could not statically analyze the options argument of a dynamic import in "${relativeId(importer)}". Dynamic import options need to be an object with a nested attributes object.`
|
| 636 |
+
};
|
| 637 |
+
}
|
| 638 |
+
function logImportAttributeIsInvalid(importer) {
|
| 639 |
+
return {
|
| 640 |
+
code: INVALID_IMPORT_ATTRIBUTE,
|
| 641 |
+
message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId(importer)}". Import attributes need to have string keys and values.`
|
| 642 |
+
};
|
| 643 |
+
}
|
| 644 |
+
function logInvalidLogPosition(plugin) {
|
| 645 |
+
return {
|
| 646 |
+
code: INVALID_LOG_POSITION,
|
| 647 |
+
message: `Plugin "${plugin}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
|
| 648 |
+
};
|
| 649 |
+
}
|
| 650 |
+
function logInvalidOption(option, urlSnippet, explanation, value) {
|
| 651 |
+
return {
|
| 652 |
+
code: INVALID_OPTION,
|
| 653 |
+
message: `Invalid value ${value === undefined ? '' : `${JSON.stringify(value)} `}for option "${option}" - ${explanation}.`,
|
| 654 |
+
url: getRollupUrl(urlSnippet)
|
| 655 |
+
};
|
| 656 |
+
}
|
| 657 |
+
function logInvalidAddonPluginHook(hook, plugin) {
|
| 658 |
+
return {
|
| 659 |
+
code: INVALID_PLUGIN_HOOK,
|
| 660 |
+
hook,
|
| 661 |
+
message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a string, a function hook or an object with a "handler" string or function.`,
|
| 662 |
+
plugin
|
| 663 |
+
};
|
| 664 |
+
}
|
| 665 |
+
function logInvalidFunctionPluginHook(hook, plugin) {
|
| 666 |
+
return {
|
| 667 |
+
code: INVALID_PLUGIN_HOOK,
|
| 668 |
+
hook,
|
| 669 |
+
message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a function hook or an object with a "handler" function.`,
|
| 670 |
+
plugin
|
| 671 |
+
};
|
| 672 |
+
}
|
| 673 |
+
function logInvalidRollupPhaseForChunkEmission() {
|
| 674 |
+
return {
|
| 675 |
+
code: INVALID_ROLLUP_PHASE,
|
| 676 |
+
message: `Cannot emit chunks after module loading has finished.`
|
| 677 |
+
};
|
| 678 |
+
}
|
| 679 |
+
function logInvalidSetAssetSourceCall() {
|
| 680 |
+
return {
|
| 681 |
+
code: INVALID_SETASSETSOURCE,
|
| 682 |
+
message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
|
| 683 |
+
};
|
| 684 |
+
}
|
| 685 |
+
function logInvalidFormatForTopLevelAwait(id, format) {
|
| 686 |
+
return {
|
| 687 |
+
code: INVALID_TLA_FORMAT,
|
| 688 |
+
id,
|
| 689 |
+
message: `Module format "${format}" does not support top-level await. Use the "es" or "system" output formats rather.`
|
| 690 |
+
};
|
| 691 |
+
}
|
| 692 |
+
function logMissingConfig() {
|
| 693 |
+
return {
|
| 694 |
+
code: MISSING_CONFIG,
|
| 695 |
+
message: 'Config file must export an options object, or an array of options objects',
|
| 696 |
+
url: getRollupUrl(URL_CONFIGURATION_FILES)
|
| 697 |
+
};
|
| 698 |
+
}
|
| 699 |
+
function logMissingEntryExport(binding, exporter) {
|
| 700 |
+
return {
|
| 701 |
+
binding,
|
| 702 |
+
code: MISSING_EXPORT,
|
| 703 |
+
exporter,
|
| 704 |
+
message: `Exported variable "${binding}" is not defined in "${relativeId(exporter)}".`,
|
| 705 |
+
url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
|
| 706 |
+
};
|
| 707 |
+
}
|
| 708 |
+
function logMissingExport(binding, importingModule, exporter, missingButExportExists) {
|
| 709 |
+
const baseLog = {
|
| 710 |
+
binding,
|
| 711 |
+
code: MISSING_EXPORT,
|
| 712 |
+
exporter,
|
| 713 |
+
id: importingModule,
|
| 714 |
+
url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
|
| 715 |
+
};
|
| 716 |
+
if (missingButExportExists) {
|
| 717 |
+
return {
|
| 718 |
+
...baseLog,
|
| 719 |
+
message: `Exported variable "${binding}" is not defined in "${relativeId(exporter)}", but it is imported by "${relativeId(importingModule)}".`
|
| 720 |
+
};
|
| 721 |
+
}
|
| 722 |
+
const isJson = path.extname(exporter) === '.json';
|
| 723 |
+
return {
|
| 724 |
+
...baseLog,
|
| 725 |
+
message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId(importingModule)}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`
|
| 726 |
+
};
|
| 727 |
+
}
|
| 728 |
+
function logMissingExternalConfig(file) {
|
| 729 |
+
return {
|
| 730 |
+
code: MISSING_EXTERNAL_CONFIG,
|
| 731 |
+
message: `Could not resolve config file "${file}"`
|
| 732 |
+
};
|
| 733 |
+
}
|
| 734 |
+
function logMissingGlobalName(externalId, guess) {
|
| 735 |
+
return {
|
| 736 |
+
code: MISSING_GLOBAL_NAME,
|
| 737 |
+
id: externalId,
|
| 738 |
+
message: `No name was provided for external module "${externalId}" in "output.globals" – guessing "${guess}".`,
|
| 739 |
+
names: [guess],
|
| 740 |
+
url: getRollupUrl(URL_OUTPUT_GLOBALS)
|
| 741 |
+
};
|
| 742 |
+
}
|
| 743 |
+
function logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) {
|
| 744 |
+
return {
|
| 745 |
+
code: MISSING_IMPLICIT_DEPENDANT,
|
| 746 |
+
message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.`
|
| 747 |
+
};
|
| 748 |
+
}
|
| 749 |
+
function logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) {
|
| 750 |
+
return {
|
| 751 |
+
code: MISSING_IMPLICIT_DEPENDANT,
|
| 752 |
+
message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.`
|
| 753 |
+
};
|
| 754 |
+
}
|
| 755 |
+
function logImplicitDependantIsNotIncluded(module) {
|
| 756 |
+
const implicitDependencies = [...module.implicitlyLoadedBefore]
|
| 757 |
+
.map(dependency => relativeId(dependency.id))
|
| 758 |
+
.sort();
|
| 759 |
+
return {
|
| 760 |
+
code: MISSING_IMPLICIT_DEPENDANT,
|
| 761 |
+
message: `Module "${relativeId(module.id)}" that should be implicitly loaded before ${printQuotedStringList(implicitDependencies)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
|
| 762 |
+
};
|
| 763 |
+
}
|
| 764 |
+
function logMissingJsxExport(name, exporter, importer) {
|
| 765 |
+
return {
|
| 766 |
+
code: MISSING_JSX_EXPORT,
|
| 767 |
+
exporter,
|
| 768 |
+
id: importer,
|
| 769 |
+
message: `Export "${name}" is not defined in module "${relativeId(exporter)}" even though it is needed in "${relativeId(importer)}" to provide JSX syntax. Please check your "jsx" option.`,
|
| 770 |
+
names: [name],
|
| 771 |
+
url: getRollupUrl(URL_JSX)
|
| 772 |
+
};
|
| 773 |
+
}
|
| 774 |
+
function logMissingNameOptionForIifeExport() {
|
| 775 |
+
return {
|
| 776 |
+
code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT,
|
| 777 |
+
message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`,
|
| 778 |
+
url: getRollupUrl(URL_OUTPUT_NAME)
|
| 779 |
+
};
|
| 780 |
+
}
|
| 781 |
+
function logMissingNameOptionForUmdExport() {
|
| 782 |
+
return {
|
| 783 |
+
code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT,
|
| 784 |
+
message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.',
|
| 785 |
+
url: getRollupUrl(URL_OUTPUT_NAME)
|
| 786 |
+
};
|
| 787 |
+
}
|
| 788 |
+
function logMissingNodeBuiltins(externalBuiltins) {
|
| 789 |
+
return {
|
| 790 |
+
code: MISSING_NODE_BUILTINS,
|
| 791 |
+
ids: externalBuiltins,
|
| 792 |
+
message: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(externalBuiltins)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`
|
| 793 |
+
};
|
| 794 |
+
}
|
| 795 |
+
function logMissingFileOrDirOption() {
|
| 796 |
+
return {
|
| 797 |
+
code: MISSING_OPTION,
|
| 798 |
+
message: 'You must specify "output.file" or "output.dir" for the build.',
|
| 799 |
+
url: getRollupUrl(URL_OUTPUT_DIR)
|
| 800 |
+
};
|
| 801 |
+
}
|
| 802 |
+
function logMixedExport(facadeModuleId, name) {
|
| 803 |
+
return {
|
| 804 |
+
code: MIXED_EXPORTS,
|
| 805 |
+
id: facadeModuleId,
|
| 806 |
+
message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}.default\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`,
|
| 807 |
+
url: getRollupUrl(URL_OUTPUT_EXPORTS)
|
| 808 |
+
};
|
| 809 |
+
}
|
| 810 |
+
function logModuleLevelDirective(directive, id) {
|
| 811 |
+
return {
|
| 812 |
+
code: MODULE_LEVEL_DIRECTIVE,
|
| 813 |
+
id,
|
| 814 |
+
message: `Module level directives cause errors when bundled, "${directive}" in "${relativeId(id)}" was ignored.`
|
| 815 |
+
};
|
| 816 |
+
}
|
| 817 |
+
function logNamespaceConflict(binding, reexportingModuleId, sources) {
|
| 818 |
+
return {
|
| 819 |
+
binding,
|
| 820 |
+
code: NAMESPACE_CONFLICT,
|
| 821 |
+
ids: sources,
|
| 822 |
+
message: `Conflicting namespaces: "${relativeId(reexportingModuleId)}" re-exports "${binding}" from one of the modules ${printQuotedStringList(sources.map(moduleId => relativeId(moduleId)))} (will be ignored).`,
|
| 823 |
+
reexporter: reexportingModuleId
|
| 824 |
+
};
|
| 825 |
+
}
|
| 826 |
+
function logNoTransformMapOrAstWithoutCode(pluginName) {
|
| 827 |
+
return {
|
| 828 |
+
code: NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,
|
| 829 |
+
message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` +
|
| 830 |
+
'a "code". This will be ignored.'
|
| 831 |
+
};
|
| 832 |
+
}
|
| 833 |
+
function logOnlyInlineSourcemapsForStdout() {
|
| 834 |
+
return {
|
| 835 |
+
code: ONLY_INLINE_SOURCEMAPS,
|
| 836 |
+
message: 'Only inline sourcemaps are supported when bundling to stdout.'
|
| 837 |
+
};
|
| 838 |
+
}
|
| 839 |
+
function logOptimizeChunkStatus(chunks, smallChunks, pointInTime) {
|
| 840 |
+
return {
|
| 841 |
+
code: OPTIMIZE_CHUNK_STATUS,
|
| 842 |
+
message: `${pointInTime}, there are\n` +
|
| 843 |
+
`${chunks} chunks, of which\n` +
|
| 844 |
+
`${smallChunks} are below minChunkSize.`
|
| 845 |
+
};
|
| 846 |
+
}
|
| 847 |
+
function logParseError(message, pos) {
|
| 848 |
+
return { code: PARSE_ERROR, message, pos };
|
| 849 |
+
}
|
| 850 |
+
function logRedeclarationError(name) {
|
| 851 |
+
return {
|
| 852 |
+
code: REDECLARATION_ERROR,
|
| 853 |
+
message: `Identifier "${name}" has already been declared`
|
| 854 |
+
};
|
| 855 |
+
}
|
| 856 |
+
function logReservedNamespace(namespace) {
|
| 857 |
+
return {
|
| 858 |
+
code: RESERVED_NAMESPACE,
|
| 859 |
+
message: `You have overridden reserved namespace "${namespace}"`
|
| 860 |
+
};
|
| 861 |
+
}
|
| 862 |
+
function logModuleParseError(error, moduleId) {
|
| 863 |
+
let message = error.message.replace(/ \(\d+:\d+\)$/, '');
|
| 864 |
+
if (moduleId.endsWith('.json')) {
|
| 865 |
+
message += ' (Note that you need @rollup/plugin-json to import JSON files)';
|
| 866 |
+
}
|
| 867 |
+
else if (!moduleId.endsWith('.js')) {
|
| 868 |
+
message += ' (Note that you need plugins to import files that are not JavaScript)';
|
| 869 |
+
}
|
| 870 |
+
return tweakStackMessage({
|
| 871 |
+
cause: error,
|
| 872 |
+
code: PARSE_ERROR,
|
| 873 |
+
id: moduleId,
|
| 874 |
+
message,
|
| 875 |
+
stack: error.stack
|
| 876 |
+
}, error.message);
|
| 877 |
+
}
|
| 878 |
+
function logPluginError(error, plugin, { hook, id } = {}) {
|
| 879 |
+
const code = error.code;
|
| 880 |
+
if (!error.pluginCode &&
|
| 881 |
+
code != null &&
|
| 882 |
+
(typeof code !== 'string' || !code.startsWith('PLUGIN_'))) {
|
| 883 |
+
error.pluginCode = code;
|
| 884 |
+
}
|
| 885 |
+
error.code = PLUGIN_ERROR;
|
| 886 |
+
error.plugin = plugin;
|
| 887 |
+
if (hook) {
|
| 888 |
+
error.hook = hook;
|
| 889 |
+
}
|
| 890 |
+
if (id) {
|
| 891 |
+
error.id = id;
|
| 892 |
+
}
|
| 893 |
+
return error;
|
| 894 |
+
}
|
| 895 |
+
function logShimmedExport(id, binding) {
|
| 896 |
+
return {
|
| 897 |
+
binding,
|
| 898 |
+
code: SHIMMED_EXPORT,
|
| 899 |
+
exporter: id,
|
| 900 |
+
message: `Missing export "${binding}" has been shimmed in module "${relativeId(id)}".`
|
| 901 |
+
};
|
| 902 |
+
}
|
| 903 |
+
function logSourcemapBroken(plugin) {
|
| 904 |
+
return {
|
| 905 |
+
code: SOURCEMAP_BROKEN,
|
| 906 |
+
message: `Sourcemap is likely to be incorrect: a plugin (${plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,
|
| 907 |
+
plugin,
|
| 908 |
+
url: getRollupUrl(URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT)
|
| 909 |
+
};
|
| 910 |
+
}
|
| 911 |
+
function logConflictingSourcemapSources(filename) {
|
| 912 |
+
return {
|
| 913 |
+
code: SOURCEMAP_BROKEN,
|
| 914 |
+
message: `Multiple conflicting contents for sourcemap source ${filename}`
|
| 915 |
+
};
|
| 916 |
+
}
|
| 917 |
+
function logInvalidSourcemapForError(error, id, column, line, pos) {
|
| 918 |
+
return {
|
| 919 |
+
cause: error,
|
| 920 |
+
code: SOURCEMAP_ERROR,
|
| 921 |
+
id,
|
| 922 |
+
loc: {
|
| 923 |
+
column,
|
| 924 |
+
file: id,
|
| 925 |
+
line
|
| 926 |
+
},
|
| 927 |
+
message: `Error when using sourcemap for reporting an error: ${error.message}`,
|
| 928 |
+
pos
|
| 929 |
+
};
|
| 930 |
+
}
|
| 931 |
+
function logSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOption) {
|
| 932 |
+
return {
|
| 933 |
+
code: SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,
|
| 934 |
+
exporter: id,
|
| 935 |
+
message: `Module "${relativeId(id)}" that is marked with \`syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}\` needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'
|
| 936 |
+
? `an explicit export named "${syntheticNamedExportsOption}"`
|
| 937 |
+
: 'a default export'} that does not reexport an unresolved named export of the same module.`
|
| 938 |
+
};
|
| 939 |
+
}
|
| 940 |
+
function logThisIsUndefined() {
|
| 941 |
+
return {
|
| 942 |
+
code: THIS_IS_UNDEFINED,
|
| 943 |
+
message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,
|
| 944 |
+
url: getRollupUrl(URL_THIS_IS_UNDEFINED)
|
| 945 |
+
};
|
| 946 |
+
}
|
| 947 |
+
function logUnexpectedNamedImport(id, imported, isReexport) {
|
| 948 |
+
const importType = isReexport ? 'reexport' : 'import';
|
| 949 |
+
return {
|
| 950 |
+
code: UNEXPECTED_NAMED_IMPORT,
|
| 951 |
+
exporter: id,
|
| 952 |
+
message: `The named export "${imported}" was ${importType}ed from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`,
|
| 953 |
+
url: getRollupUrl(URL_OUTPUT_INTEROP)
|
| 954 |
+
};
|
| 955 |
+
}
|
| 956 |
+
function logUnexpectedNamespaceReexport(id) {
|
| 957 |
+
return {
|
| 958 |
+
code: UNEXPECTED_NAMED_IMPORT,
|
| 959 |
+
exporter: id,
|
| 960 |
+
message: `There was a namespace "*" reexport from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,
|
| 961 |
+
url: getRollupUrl(URL_OUTPUT_INTEROP)
|
| 962 |
+
};
|
| 963 |
+
}
|
| 964 |
+
function logUnknownOption(optionType, unknownOptions, validOptions) {
|
| 965 |
+
return {
|
| 966 |
+
code: UNKNOWN_OPTION,
|
| 967 |
+
message: `Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${validOptions.join(', ')}`
|
| 968 |
+
};
|
| 969 |
+
}
|
| 970 |
+
function logEntryCannotBeExternal(unresolvedId) {
|
| 971 |
+
return {
|
| 972 |
+
code: UNRESOLVED_ENTRY,
|
| 973 |
+
message: `Entry module "${relativeId(unresolvedId)}" cannot be external.`
|
| 974 |
+
};
|
| 975 |
+
}
|
| 976 |
+
function logExternalModulesCannotBeIncludedInManualChunks(source) {
|
| 977 |
+
return {
|
| 978 |
+
code: EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS,
|
| 979 |
+
message: `"${source}" cannot be included in manualChunks because it is resolved as an external module by the "external" option or plugins.`
|
| 980 |
+
};
|
| 981 |
+
}
|
| 982 |
+
function logExternalModulesCannotBeTransformedToModules(source) {
|
| 983 |
+
return {
|
| 984 |
+
code: EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES,
|
| 985 |
+
message: `${source} is resolved as a module now, but it was an external module before. Please check whether there are conflicts in your Rollup options "external" and "manualChunks", manualChunks cannot include external modules.`
|
| 986 |
+
};
|
| 987 |
+
}
|
| 988 |
+
function logUnresolvedEntry(unresolvedId) {
|
| 989 |
+
return {
|
| 990 |
+
code: UNRESOLVED_ENTRY,
|
| 991 |
+
message: `Could not resolve entry module "${relativeId(unresolvedId)}".`
|
| 992 |
+
};
|
| 993 |
+
}
|
| 994 |
+
function logUnresolvedImport(source, importer) {
|
| 995 |
+
return {
|
| 996 |
+
code: UNRESOLVED_IMPORT,
|
| 997 |
+
exporter: source,
|
| 998 |
+
id: importer,
|
| 999 |
+
message: `Could not resolve "${source}" from "${relativeId(importer)}"`
|
| 1000 |
+
};
|
| 1001 |
+
}
|
| 1002 |
+
function logUnresolvedImportTreatedAsExternal(source, importer) {
|
| 1003 |
+
return {
|
| 1004 |
+
code: UNRESOLVED_IMPORT,
|
| 1005 |
+
exporter: source,
|
| 1006 |
+
id: importer,
|
| 1007 |
+
message: `"${source}" is imported by "${relativeId(importer)}", but could not be resolved – treating it as an external dependency.`,
|
| 1008 |
+
url: getRollupUrl(URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY)
|
| 1009 |
+
};
|
| 1010 |
+
}
|
| 1011 |
+
function logUnusedExternalImports(externalId, names, importers) {
|
| 1012 |
+
return {
|
| 1013 |
+
code: UNUSED_EXTERNAL_IMPORT,
|
| 1014 |
+
exporter: externalId,
|
| 1015 |
+
ids: importers,
|
| 1016 |
+
message: `${printQuotedStringList(names, [
|
| 1017 |
+
'is',
|
| 1018 |
+
'are'
|
| 1019 |
+
])} imported from external module "${externalId}" but never used in ${printQuotedStringList(importers.map(importer => relativeId(importer)))}.`,
|
| 1020 |
+
names
|
| 1021 |
+
};
|
| 1022 |
+
}
|
| 1023 |
+
function logFailedValidation(message) {
|
| 1024 |
+
return {
|
| 1025 |
+
code: VALIDATION_ERROR,
|
| 1026 |
+
message
|
| 1027 |
+
};
|
| 1028 |
+
}
|
| 1029 |
+
function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, plugin) {
|
| 1030 |
+
warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onLog, options.strictDeprecations);
|
| 1031 |
+
}
|
| 1032 |
+
function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, log, strictDeprecations, plugin) {
|
| 1033 |
+
if (activeDeprecation || strictDeprecations) {
|
| 1034 |
+
const warning = logDeprecation(deprecation, urlSnippet);
|
| 1035 |
+
if (strictDeprecations) {
|
| 1036 |
+
return error(warning);
|
| 1037 |
+
}
|
| 1038 |
+
log(LOGLEVEL_WARN, warning);
|
| 1039 |
+
}
|
| 1040 |
+
}
|
| 1041 |
+
|
| 1042 |
+
const BLANK = Object.freeze(Object.create(null));
|
| 1043 |
+
const EMPTY_OBJECT = Object.freeze({});
|
| 1044 |
+
const EMPTY_ARRAY = Object.freeze([]);
|
| 1045 |
+
const EMPTY_SET = Object.freeze(new (class extends Set {
|
| 1046 |
+
add() {
|
| 1047 |
+
throw new Error('Cannot add to empty set');
|
| 1048 |
+
}
|
| 1049 |
+
})());
|
| 1050 |
+
|
| 1051 |
+
// This file is generated by scripts/generate-node-types.js.
|
| 1052 |
+
// Do not edit this file directly.
|
| 1053 |
+
const ArrowFunctionExpression = 'ArrowFunctionExpression';
|
| 1054 |
+
const AwaitExpression = 'AwaitExpression';
|
| 1055 |
+
const BlockStatement = 'BlockStatement';
|
| 1056 |
+
const CallExpression = 'CallExpression';
|
| 1057 |
+
const CatchClause = 'CatchClause';
|
| 1058 |
+
const ExportDefaultDeclaration = 'ExportDefaultDeclaration';
|
| 1059 |
+
const ExpressionStatement = 'ExpressionStatement';
|
| 1060 |
+
const FunctionExpression = 'FunctionExpression';
|
| 1061 |
+
const Identifier = 'Identifier';
|
| 1062 |
+
const Literal = 'Literal';
|
| 1063 |
+
const MemberExpression = 'MemberExpression';
|
| 1064 |
+
const ObjectExpression = 'ObjectExpression';
|
| 1065 |
+
const PanicError = 'PanicError';
|
| 1066 |
+
const ParseError = 'ParseError';
|
| 1067 |
+
const Program = 'Program';
|
| 1068 |
+
const Property = 'Property';
|
| 1069 |
+
const RestElement = 'RestElement';
|
| 1070 |
+
const ReturnStatement = 'ReturnStatement';
|
| 1071 |
+
const StaticBlock = 'StaticBlock';
|
| 1072 |
+
const TemplateLiteral = 'TemplateLiteral';
|
| 1073 |
+
const VariableDeclarator = 'VariableDeclarator';
|
| 1074 |
+
|
| 1075 |
+
// This file is generated by scripts/generate-string-constants.js.
|
| 1076 |
+
// Do not edit this file directly.
|
| 1077 |
+
const FIXED_STRINGS = [
|
| 1078 |
+
'var',
|
| 1079 |
+
'let',
|
| 1080 |
+
'const',
|
| 1081 |
+
'init',
|
| 1082 |
+
'get',
|
| 1083 |
+
'set',
|
| 1084 |
+
'constructor',
|
| 1085 |
+
'method',
|
| 1086 |
+
'-',
|
| 1087 |
+
'+',
|
| 1088 |
+
'!',
|
| 1089 |
+
'~',
|
| 1090 |
+
'typeof',
|
| 1091 |
+
'void',
|
| 1092 |
+
'delete',
|
| 1093 |
+
'++',
|
| 1094 |
+
'--',
|
| 1095 |
+
'==',
|
| 1096 |
+
'!=',
|
| 1097 |
+
'===',
|
| 1098 |
+
'!==',
|
| 1099 |
+
'<',
|
| 1100 |
+
'<=',
|
| 1101 |
+
'>',
|
| 1102 |
+
'>=',
|
| 1103 |
+
'<<',
|
| 1104 |
+
'>>',
|
| 1105 |
+
'>>>',
|
| 1106 |
+
'+',
|
| 1107 |
+
'-',
|
| 1108 |
+
'*',
|
| 1109 |
+
'/',
|
| 1110 |
+
'%',
|
| 1111 |
+
'|',
|
| 1112 |
+
'^',
|
| 1113 |
+
'&',
|
| 1114 |
+
'||',
|
| 1115 |
+
'&&',
|
| 1116 |
+
'in',
|
| 1117 |
+
'instanceof',
|
| 1118 |
+
'**',
|
| 1119 |
+
'??',
|
| 1120 |
+
'=',
|
| 1121 |
+
'+=',
|
| 1122 |
+
'-=',
|
| 1123 |
+
'*=',
|
| 1124 |
+
'/=',
|
| 1125 |
+
'%=',
|
| 1126 |
+
'<<=',
|
| 1127 |
+
'>>=',
|
| 1128 |
+
'>>>=',
|
| 1129 |
+
'|=',
|
| 1130 |
+
'^=',
|
| 1131 |
+
'&=',
|
| 1132 |
+
'**=',
|
| 1133 |
+
'&&=',
|
| 1134 |
+
'||=',
|
| 1135 |
+
'??=',
|
| 1136 |
+
'pure',
|
| 1137 |
+
'noSideEffects',
|
| 1138 |
+
'sourcemap',
|
| 1139 |
+
'using',
|
| 1140 |
+
'await using'
|
| 1141 |
+
];
|
| 1142 |
+
|
| 1143 |
+
const ANNOTATION_KEY = '_rollupAnnotations';
|
| 1144 |
+
const INVALID_ANNOTATION_KEY = '_rollupRemoved';
|
| 1145 |
+
const convertAnnotations = (position, buffer) => {
|
| 1146 |
+
if (position === 0)
|
| 1147 |
+
return EMPTY_ARRAY;
|
| 1148 |
+
const length = buffer[position++];
|
| 1149 |
+
const list = new Array(length);
|
| 1150 |
+
for (let index = 0; index < length; index++) {
|
| 1151 |
+
list[index] = convertAnnotation(buffer[position++], buffer);
|
| 1152 |
+
}
|
| 1153 |
+
return list;
|
| 1154 |
+
};
|
| 1155 |
+
const convertAnnotation = (position, buffer) => {
|
| 1156 |
+
const start = buffer[position++];
|
| 1157 |
+
const end = buffer[position++];
|
| 1158 |
+
const type = FIXED_STRINGS[buffer[position]];
|
| 1159 |
+
return { end, start, type };
|
| 1160 |
+
};
|
| 1161 |
+
|
| 1162 |
+
// This file is generated by scripts/generate-buffer-to-ast.js.
|
| 1163 |
+
// Do not edit this file directly.
|
| 1164 |
+
function convertProgram(buffer) {
|
| 1165 |
+
const node = convertNode(0, buffer);
|
| 1166 |
+
switch (node.type) {
|
| 1167 |
+
case PanicError: {
|
| 1168 |
+
return error(getRollupError(logParseError(node.message)));
|
| 1169 |
+
}
|
| 1170 |
+
case ParseError: {
|
| 1171 |
+
return error(getRollupError(logParseError(node.message, node.start)));
|
| 1172 |
+
}
|
| 1173 |
+
default: {
|
| 1174 |
+
return node;
|
| 1175 |
+
}
|
| 1176 |
+
}
|
| 1177 |
+
}
|
| 1178 |
+
/* eslint-disable sort-keys */
|
| 1179 |
+
const nodeConverters = [
|
| 1180 |
+
function panicError(position, buffer) {
|
| 1181 |
+
return {
|
| 1182 |
+
type: 'PanicError',
|
| 1183 |
+
start: buffer[position],
|
| 1184 |
+
end: buffer[position + 1],
|
| 1185 |
+
message: buffer.convertString(buffer[position + 2])
|
| 1186 |
+
};
|
| 1187 |
+
},
|
| 1188 |
+
function parseError(position, buffer) {
|
| 1189 |
+
return {
|
| 1190 |
+
type: 'ParseError',
|
| 1191 |
+
start: buffer[position],
|
| 1192 |
+
end: buffer[position + 1],
|
| 1193 |
+
message: buffer.convertString(buffer[position + 2])
|
| 1194 |
+
};
|
| 1195 |
+
},
|
| 1196 |
+
function arrayExpression(position, buffer) {
|
| 1197 |
+
return {
|
| 1198 |
+
type: 'ArrayExpression',
|
| 1199 |
+
start: buffer[position],
|
| 1200 |
+
end: buffer[position + 1],
|
| 1201 |
+
elements: convertNodeList(buffer[position + 2], buffer)
|
| 1202 |
+
};
|
| 1203 |
+
},
|
| 1204 |
+
function arrayPattern(position, buffer) {
|
| 1205 |
+
return {
|
| 1206 |
+
type: 'ArrayPattern',
|
| 1207 |
+
start: buffer[position],
|
| 1208 |
+
end: buffer[position + 1],
|
| 1209 |
+
elements: convertNodeList(buffer[position + 2], buffer)
|
| 1210 |
+
};
|
| 1211 |
+
},
|
| 1212 |
+
function arrowFunctionExpression(position, buffer) {
|
| 1213 |
+
const flags = buffer[position + 2];
|
| 1214 |
+
const annotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1215 |
+
return {
|
| 1216 |
+
type: 'ArrowFunctionExpression',
|
| 1217 |
+
start: buffer[position],
|
| 1218 |
+
end: buffer[position + 1],
|
| 1219 |
+
async: (flags & 1) === 1,
|
| 1220 |
+
expression: (flags & 2) === 2,
|
| 1221 |
+
generator: (flags & 4) === 4,
|
| 1222 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1223 |
+
params: convertNodeList(buffer[position + 4], buffer),
|
| 1224 |
+
body: convertNode(buffer[position + 5], buffer),
|
| 1225 |
+
id: null
|
| 1226 |
+
};
|
| 1227 |
+
},
|
| 1228 |
+
function assignmentExpression(position, buffer) {
|
| 1229 |
+
return {
|
| 1230 |
+
type: 'AssignmentExpression',
|
| 1231 |
+
start: buffer[position],
|
| 1232 |
+
end: buffer[position + 1],
|
| 1233 |
+
operator: FIXED_STRINGS[buffer[position + 2]],
|
| 1234 |
+
left: convertNode(buffer[position + 3], buffer),
|
| 1235 |
+
right: convertNode(buffer[position + 4], buffer)
|
| 1236 |
+
};
|
| 1237 |
+
},
|
| 1238 |
+
function assignmentPattern(position, buffer) {
|
| 1239 |
+
return {
|
| 1240 |
+
type: 'AssignmentPattern',
|
| 1241 |
+
start: buffer[position],
|
| 1242 |
+
end: buffer[position + 1],
|
| 1243 |
+
left: convertNode(buffer[position + 2], buffer),
|
| 1244 |
+
right: convertNode(buffer[position + 3], buffer)
|
| 1245 |
+
};
|
| 1246 |
+
},
|
| 1247 |
+
function awaitExpression(position, buffer) {
|
| 1248 |
+
return {
|
| 1249 |
+
type: 'AwaitExpression',
|
| 1250 |
+
start: buffer[position],
|
| 1251 |
+
end: buffer[position + 1],
|
| 1252 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 1253 |
+
};
|
| 1254 |
+
},
|
| 1255 |
+
function binaryExpression(position, buffer) {
|
| 1256 |
+
return {
|
| 1257 |
+
type: 'BinaryExpression',
|
| 1258 |
+
start: buffer[position],
|
| 1259 |
+
end: buffer[position + 1],
|
| 1260 |
+
operator: FIXED_STRINGS[buffer[position + 2]],
|
| 1261 |
+
left: convertNode(buffer[position + 3], buffer),
|
| 1262 |
+
right: convertNode(buffer[position + 4], buffer)
|
| 1263 |
+
};
|
| 1264 |
+
},
|
| 1265 |
+
function blockStatement(position, buffer) {
|
| 1266 |
+
return {
|
| 1267 |
+
type: 'BlockStatement',
|
| 1268 |
+
start: buffer[position],
|
| 1269 |
+
end: buffer[position + 1],
|
| 1270 |
+
body: convertNodeList(buffer[position + 2], buffer)
|
| 1271 |
+
};
|
| 1272 |
+
},
|
| 1273 |
+
function breakStatement(position, buffer) {
|
| 1274 |
+
const labelPosition = buffer[position + 2];
|
| 1275 |
+
return {
|
| 1276 |
+
type: 'BreakStatement',
|
| 1277 |
+
start: buffer[position],
|
| 1278 |
+
end: buffer[position + 1],
|
| 1279 |
+
label: labelPosition === 0 ? null : convertNode(labelPosition, buffer)
|
| 1280 |
+
};
|
| 1281 |
+
},
|
| 1282 |
+
function callExpression(position, buffer) {
|
| 1283 |
+
const flags = buffer[position + 2];
|
| 1284 |
+
const annotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1285 |
+
return {
|
| 1286 |
+
type: 'CallExpression',
|
| 1287 |
+
start: buffer[position],
|
| 1288 |
+
end: buffer[position + 1],
|
| 1289 |
+
optional: (flags & 1) === 1,
|
| 1290 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1291 |
+
callee: convertNode(buffer[position + 4], buffer),
|
| 1292 |
+
arguments: convertNodeList(buffer[position + 5], buffer)
|
| 1293 |
+
};
|
| 1294 |
+
},
|
| 1295 |
+
function catchClause(position, buffer) {
|
| 1296 |
+
const parameterPosition = buffer[position + 2];
|
| 1297 |
+
return {
|
| 1298 |
+
type: 'CatchClause',
|
| 1299 |
+
start: buffer[position],
|
| 1300 |
+
end: buffer[position + 1],
|
| 1301 |
+
param: parameterPosition === 0 ? null : convertNode(parameterPosition, buffer),
|
| 1302 |
+
body: convertNode(buffer[position + 3], buffer)
|
| 1303 |
+
};
|
| 1304 |
+
},
|
| 1305 |
+
function chainExpression(position, buffer) {
|
| 1306 |
+
return {
|
| 1307 |
+
type: 'ChainExpression',
|
| 1308 |
+
start: buffer[position],
|
| 1309 |
+
end: buffer[position + 1],
|
| 1310 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1311 |
+
};
|
| 1312 |
+
},
|
| 1313 |
+
function classBody(position, buffer) {
|
| 1314 |
+
return {
|
| 1315 |
+
type: 'ClassBody',
|
| 1316 |
+
start: buffer[position],
|
| 1317 |
+
end: buffer[position + 1],
|
| 1318 |
+
body: convertNodeList(buffer[position + 2], buffer)
|
| 1319 |
+
};
|
| 1320 |
+
},
|
| 1321 |
+
function classDeclaration(position, buffer) {
|
| 1322 |
+
const idPosition = buffer[position + 3];
|
| 1323 |
+
const superClassPosition = buffer[position + 4];
|
| 1324 |
+
return {
|
| 1325 |
+
type: 'ClassDeclaration',
|
| 1326 |
+
start: buffer[position],
|
| 1327 |
+
end: buffer[position + 1],
|
| 1328 |
+
decorators: convertNodeList(buffer[position + 2], buffer),
|
| 1329 |
+
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
| 1330 |
+
superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer),
|
| 1331 |
+
body: convertNode(buffer[position + 5], buffer)
|
| 1332 |
+
};
|
| 1333 |
+
},
|
| 1334 |
+
function classExpression(position, buffer) {
|
| 1335 |
+
const idPosition = buffer[position + 3];
|
| 1336 |
+
const superClassPosition = buffer[position + 4];
|
| 1337 |
+
return {
|
| 1338 |
+
type: 'ClassExpression',
|
| 1339 |
+
start: buffer[position],
|
| 1340 |
+
end: buffer[position + 1],
|
| 1341 |
+
decorators: convertNodeList(buffer[position + 2], buffer),
|
| 1342 |
+
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
| 1343 |
+
superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer),
|
| 1344 |
+
body: convertNode(buffer[position + 5], buffer)
|
| 1345 |
+
};
|
| 1346 |
+
},
|
| 1347 |
+
function conditionalExpression(position, buffer) {
|
| 1348 |
+
return {
|
| 1349 |
+
type: 'ConditionalExpression',
|
| 1350 |
+
start: buffer[position],
|
| 1351 |
+
end: buffer[position + 1],
|
| 1352 |
+
test: convertNode(buffer[position + 2], buffer),
|
| 1353 |
+
consequent: convertNode(buffer[position + 3], buffer),
|
| 1354 |
+
alternate: convertNode(buffer[position + 4], buffer)
|
| 1355 |
+
};
|
| 1356 |
+
},
|
| 1357 |
+
function continueStatement(position, buffer) {
|
| 1358 |
+
const labelPosition = buffer[position + 2];
|
| 1359 |
+
return {
|
| 1360 |
+
type: 'ContinueStatement',
|
| 1361 |
+
start: buffer[position],
|
| 1362 |
+
end: buffer[position + 1],
|
| 1363 |
+
label: labelPosition === 0 ? null : convertNode(labelPosition, buffer)
|
| 1364 |
+
};
|
| 1365 |
+
},
|
| 1366 |
+
function debuggerStatement(position, buffer) {
|
| 1367 |
+
return {
|
| 1368 |
+
type: 'DebuggerStatement',
|
| 1369 |
+
start: buffer[position],
|
| 1370 |
+
end: buffer[position + 1]
|
| 1371 |
+
};
|
| 1372 |
+
},
|
| 1373 |
+
function decorator(position, buffer) {
|
| 1374 |
+
return {
|
| 1375 |
+
type: 'Decorator',
|
| 1376 |
+
start: buffer[position],
|
| 1377 |
+
end: buffer[position + 1],
|
| 1378 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1379 |
+
};
|
| 1380 |
+
},
|
| 1381 |
+
function directive(position, buffer) {
|
| 1382 |
+
return {
|
| 1383 |
+
type: 'ExpressionStatement',
|
| 1384 |
+
start: buffer[position],
|
| 1385 |
+
end: buffer[position + 1],
|
| 1386 |
+
directive: buffer.convertString(buffer[position + 2]),
|
| 1387 |
+
expression: convertNode(buffer[position + 3], buffer)
|
| 1388 |
+
};
|
| 1389 |
+
},
|
| 1390 |
+
function doWhileStatement(position, buffer) {
|
| 1391 |
+
return {
|
| 1392 |
+
type: 'DoWhileStatement',
|
| 1393 |
+
start: buffer[position],
|
| 1394 |
+
end: buffer[position + 1],
|
| 1395 |
+
body: convertNode(buffer[position + 2], buffer),
|
| 1396 |
+
test: convertNode(buffer[position + 3], buffer)
|
| 1397 |
+
};
|
| 1398 |
+
},
|
| 1399 |
+
function emptyStatement(position, buffer) {
|
| 1400 |
+
return {
|
| 1401 |
+
type: 'EmptyStatement',
|
| 1402 |
+
start: buffer[position],
|
| 1403 |
+
end: buffer[position + 1]
|
| 1404 |
+
};
|
| 1405 |
+
},
|
| 1406 |
+
function exportAllDeclaration(position, buffer) {
|
| 1407 |
+
const exportedPosition = buffer[position + 2];
|
| 1408 |
+
return {
|
| 1409 |
+
type: 'ExportAllDeclaration',
|
| 1410 |
+
start: buffer[position],
|
| 1411 |
+
end: buffer[position + 1],
|
| 1412 |
+
exported: exportedPosition === 0 ? null : convertNode(exportedPosition, buffer),
|
| 1413 |
+
source: convertNode(buffer[position + 3], buffer),
|
| 1414 |
+
attributes: convertNodeList(buffer[position + 4], buffer)
|
| 1415 |
+
};
|
| 1416 |
+
},
|
| 1417 |
+
function exportDefaultDeclaration(position, buffer) {
|
| 1418 |
+
return {
|
| 1419 |
+
type: 'ExportDefaultDeclaration',
|
| 1420 |
+
start: buffer[position],
|
| 1421 |
+
end: buffer[position + 1],
|
| 1422 |
+
declaration: convertNode(buffer[position + 2], buffer)
|
| 1423 |
+
};
|
| 1424 |
+
},
|
| 1425 |
+
function exportNamedDeclaration(position, buffer) {
|
| 1426 |
+
const sourcePosition = buffer[position + 3];
|
| 1427 |
+
const declarationPosition = buffer[position + 5];
|
| 1428 |
+
return {
|
| 1429 |
+
type: 'ExportNamedDeclaration',
|
| 1430 |
+
start: buffer[position],
|
| 1431 |
+
end: buffer[position + 1],
|
| 1432 |
+
specifiers: convertNodeList(buffer[position + 2], buffer),
|
| 1433 |
+
source: sourcePosition === 0 ? null : convertNode(sourcePosition, buffer),
|
| 1434 |
+
attributes: convertNodeList(buffer[position + 4], buffer),
|
| 1435 |
+
declaration: declarationPosition === 0 ? null : convertNode(declarationPosition, buffer)
|
| 1436 |
+
};
|
| 1437 |
+
},
|
| 1438 |
+
function exportSpecifier(position, buffer) {
|
| 1439 |
+
const local = convertNode(buffer[position + 2], buffer);
|
| 1440 |
+
const exportedPosition = buffer[position + 3];
|
| 1441 |
+
return {
|
| 1442 |
+
type: 'ExportSpecifier',
|
| 1443 |
+
start: buffer[position],
|
| 1444 |
+
end: buffer[position + 1],
|
| 1445 |
+
local,
|
| 1446 |
+
exported: exportedPosition === 0 ? { ...local } : convertNode(exportedPosition, buffer)
|
| 1447 |
+
};
|
| 1448 |
+
},
|
| 1449 |
+
function expressionStatement(position, buffer) {
|
| 1450 |
+
return {
|
| 1451 |
+
type: 'ExpressionStatement',
|
| 1452 |
+
start: buffer[position],
|
| 1453 |
+
end: buffer[position + 1],
|
| 1454 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1455 |
+
};
|
| 1456 |
+
},
|
| 1457 |
+
function forInStatement(position, buffer) {
|
| 1458 |
+
return {
|
| 1459 |
+
type: 'ForInStatement',
|
| 1460 |
+
start: buffer[position],
|
| 1461 |
+
end: buffer[position + 1],
|
| 1462 |
+
left: convertNode(buffer[position + 2], buffer),
|
| 1463 |
+
right: convertNode(buffer[position + 3], buffer),
|
| 1464 |
+
body: convertNode(buffer[position + 4], buffer)
|
| 1465 |
+
};
|
| 1466 |
+
},
|
| 1467 |
+
function forOfStatement(position, buffer) {
|
| 1468 |
+
const flags = buffer[position + 2];
|
| 1469 |
+
return {
|
| 1470 |
+
type: 'ForOfStatement',
|
| 1471 |
+
start: buffer[position],
|
| 1472 |
+
end: buffer[position + 1],
|
| 1473 |
+
await: (flags & 1) === 1,
|
| 1474 |
+
left: convertNode(buffer[position + 3], buffer),
|
| 1475 |
+
right: convertNode(buffer[position + 4], buffer),
|
| 1476 |
+
body: convertNode(buffer[position + 5], buffer)
|
| 1477 |
+
};
|
| 1478 |
+
},
|
| 1479 |
+
function forStatement(position, buffer) {
|
| 1480 |
+
const initPosition = buffer[position + 2];
|
| 1481 |
+
const testPosition = buffer[position + 3];
|
| 1482 |
+
const updatePosition = buffer[position + 4];
|
| 1483 |
+
return {
|
| 1484 |
+
type: 'ForStatement',
|
| 1485 |
+
start: buffer[position],
|
| 1486 |
+
end: buffer[position + 1],
|
| 1487 |
+
init: initPosition === 0 ? null : convertNode(initPosition, buffer),
|
| 1488 |
+
test: testPosition === 0 ? null : convertNode(testPosition, buffer),
|
| 1489 |
+
update: updatePosition === 0 ? null : convertNode(updatePosition, buffer),
|
| 1490 |
+
body: convertNode(buffer[position + 5], buffer)
|
| 1491 |
+
};
|
| 1492 |
+
},
|
| 1493 |
+
function functionDeclaration(position, buffer) {
|
| 1494 |
+
const flags = buffer[position + 2];
|
| 1495 |
+
const annotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1496 |
+
const idPosition = buffer[position + 4];
|
| 1497 |
+
return {
|
| 1498 |
+
type: 'FunctionDeclaration',
|
| 1499 |
+
start: buffer[position],
|
| 1500 |
+
end: buffer[position + 1],
|
| 1501 |
+
async: (flags & 1) === 1,
|
| 1502 |
+
generator: (flags & 2) === 2,
|
| 1503 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1504 |
+
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
| 1505 |
+
params: convertNodeList(buffer[position + 5], buffer),
|
| 1506 |
+
body: convertNode(buffer[position + 6], buffer),
|
| 1507 |
+
expression: false
|
| 1508 |
+
};
|
| 1509 |
+
},
|
| 1510 |
+
function functionExpression(position, buffer) {
|
| 1511 |
+
const flags = buffer[position + 2];
|
| 1512 |
+
const annotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1513 |
+
const idPosition = buffer[position + 4];
|
| 1514 |
+
return {
|
| 1515 |
+
type: 'FunctionExpression',
|
| 1516 |
+
start: buffer[position],
|
| 1517 |
+
end: buffer[position + 1],
|
| 1518 |
+
async: (flags & 1) === 1,
|
| 1519 |
+
generator: (flags & 2) === 2,
|
| 1520 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1521 |
+
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
| 1522 |
+
params: convertNodeList(buffer[position + 5], buffer),
|
| 1523 |
+
body: convertNode(buffer[position + 6], buffer),
|
| 1524 |
+
expression: false
|
| 1525 |
+
};
|
| 1526 |
+
},
|
| 1527 |
+
function identifier(position, buffer) {
|
| 1528 |
+
return {
|
| 1529 |
+
type: 'Identifier',
|
| 1530 |
+
start: buffer[position],
|
| 1531 |
+
end: buffer[position + 1],
|
| 1532 |
+
name: buffer.convertString(buffer[position + 2])
|
| 1533 |
+
};
|
| 1534 |
+
},
|
| 1535 |
+
function ifStatement(position, buffer) {
|
| 1536 |
+
const alternatePosition = buffer[position + 4];
|
| 1537 |
+
return {
|
| 1538 |
+
type: 'IfStatement',
|
| 1539 |
+
start: buffer[position],
|
| 1540 |
+
end: buffer[position + 1],
|
| 1541 |
+
test: convertNode(buffer[position + 2], buffer),
|
| 1542 |
+
consequent: convertNode(buffer[position + 3], buffer),
|
| 1543 |
+
alternate: alternatePosition === 0 ? null : convertNode(alternatePosition, buffer)
|
| 1544 |
+
};
|
| 1545 |
+
},
|
| 1546 |
+
function importAttribute(position, buffer) {
|
| 1547 |
+
return {
|
| 1548 |
+
type: 'ImportAttribute',
|
| 1549 |
+
start: buffer[position],
|
| 1550 |
+
end: buffer[position + 1],
|
| 1551 |
+
key: convertNode(buffer[position + 2], buffer),
|
| 1552 |
+
value: convertNode(buffer[position + 3], buffer)
|
| 1553 |
+
};
|
| 1554 |
+
},
|
| 1555 |
+
function importDeclaration(position, buffer) {
|
| 1556 |
+
return {
|
| 1557 |
+
type: 'ImportDeclaration',
|
| 1558 |
+
start: buffer[position],
|
| 1559 |
+
end: buffer[position + 1],
|
| 1560 |
+
specifiers: convertNodeList(buffer[position + 2], buffer),
|
| 1561 |
+
source: convertNode(buffer[position + 3], buffer),
|
| 1562 |
+
attributes: convertNodeList(buffer[position + 4], buffer)
|
| 1563 |
+
};
|
| 1564 |
+
},
|
| 1565 |
+
function importDefaultSpecifier(position, buffer) {
|
| 1566 |
+
return {
|
| 1567 |
+
type: 'ImportDefaultSpecifier',
|
| 1568 |
+
start: buffer[position],
|
| 1569 |
+
end: buffer[position + 1],
|
| 1570 |
+
local: convertNode(buffer[position + 2], buffer)
|
| 1571 |
+
};
|
| 1572 |
+
},
|
| 1573 |
+
function importExpression(position, buffer) {
|
| 1574 |
+
const optionsPosition = buffer[position + 3];
|
| 1575 |
+
return {
|
| 1576 |
+
type: 'ImportExpression',
|
| 1577 |
+
start: buffer[position],
|
| 1578 |
+
end: buffer[position + 1],
|
| 1579 |
+
source: convertNode(buffer[position + 2], buffer),
|
| 1580 |
+
options: optionsPosition === 0 ? null : convertNode(optionsPosition, buffer)
|
| 1581 |
+
};
|
| 1582 |
+
},
|
| 1583 |
+
function importNamespaceSpecifier(position, buffer) {
|
| 1584 |
+
return {
|
| 1585 |
+
type: 'ImportNamespaceSpecifier',
|
| 1586 |
+
start: buffer[position],
|
| 1587 |
+
end: buffer[position + 1],
|
| 1588 |
+
local: convertNode(buffer[position + 2], buffer)
|
| 1589 |
+
};
|
| 1590 |
+
},
|
| 1591 |
+
function importSpecifier(position, buffer) {
|
| 1592 |
+
const importedPosition = buffer[position + 2];
|
| 1593 |
+
const local = convertNode(buffer[position + 3], buffer);
|
| 1594 |
+
return {
|
| 1595 |
+
type: 'ImportSpecifier',
|
| 1596 |
+
start: buffer[position],
|
| 1597 |
+
end: buffer[position + 1],
|
| 1598 |
+
imported: importedPosition === 0 ? { ...local } : convertNode(importedPosition, buffer),
|
| 1599 |
+
local
|
| 1600 |
+
};
|
| 1601 |
+
},
|
| 1602 |
+
function jsxAttribute(position, buffer) {
|
| 1603 |
+
const valuePosition = buffer[position + 3];
|
| 1604 |
+
return {
|
| 1605 |
+
type: 'JSXAttribute',
|
| 1606 |
+
start: buffer[position],
|
| 1607 |
+
end: buffer[position + 1],
|
| 1608 |
+
name: convertNode(buffer[position + 2], buffer),
|
| 1609 |
+
value: valuePosition === 0 ? null : convertNode(valuePosition, buffer)
|
| 1610 |
+
};
|
| 1611 |
+
},
|
| 1612 |
+
function jsxClosingElement(position, buffer) {
|
| 1613 |
+
return {
|
| 1614 |
+
type: 'JSXClosingElement',
|
| 1615 |
+
start: buffer[position],
|
| 1616 |
+
end: buffer[position + 1],
|
| 1617 |
+
name: convertNode(buffer[position + 2], buffer)
|
| 1618 |
+
};
|
| 1619 |
+
},
|
| 1620 |
+
function jsxClosingFragment(position, buffer) {
|
| 1621 |
+
return {
|
| 1622 |
+
type: 'JSXClosingFragment',
|
| 1623 |
+
start: buffer[position],
|
| 1624 |
+
end: buffer[position + 1]
|
| 1625 |
+
};
|
| 1626 |
+
},
|
| 1627 |
+
function jsxElement(position, buffer) {
|
| 1628 |
+
const closingElementPosition = buffer[position + 4];
|
| 1629 |
+
return {
|
| 1630 |
+
type: 'JSXElement',
|
| 1631 |
+
start: buffer[position],
|
| 1632 |
+
end: buffer[position + 1],
|
| 1633 |
+
openingElement: convertNode(buffer[position + 2], buffer),
|
| 1634 |
+
children: convertNodeList(buffer[position + 3], buffer),
|
| 1635 |
+
closingElement: closingElementPosition === 0 ? null : convertNode(closingElementPosition, buffer)
|
| 1636 |
+
};
|
| 1637 |
+
},
|
| 1638 |
+
function jsxEmptyExpression(position, buffer) {
|
| 1639 |
+
return {
|
| 1640 |
+
type: 'JSXEmptyExpression',
|
| 1641 |
+
start: buffer[position],
|
| 1642 |
+
end: buffer[position + 1]
|
| 1643 |
+
};
|
| 1644 |
+
},
|
| 1645 |
+
function jsxExpressionContainer(position, buffer) {
|
| 1646 |
+
return {
|
| 1647 |
+
type: 'JSXExpressionContainer',
|
| 1648 |
+
start: buffer[position],
|
| 1649 |
+
end: buffer[position + 1],
|
| 1650 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1651 |
+
};
|
| 1652 |
+
},
|
| 1653 |
+
function jsxFragment(position, buffer) {
|
| 1654 |
+
return {
|
| 1655 |
+
type: 'JSXFragment',
|
| 1656 |
+
start: buffer[position],
|
| 1657 |
+
end: buffer[position + 1],
|
| 1658 |
+
openingFragment: convertNode(buffer[position + 2], buffer),
|
| 1659 |
+
children: convertNodeList(buffer[position + 3], buffer),
|
| 1660 |
+
closingFragment: convertNode(buffer[position + 4], buffer)
|
| 1661 |
+
};
|
| 1662 |
+
},
|
| 1663 |
+
function jsxIdentifier(position, buffer) {
|
| 1664 |
+
return {
|
| 1665 |
+
type: 'JSXIdentifier',
|
| 1666 |
+
start: buffer[position],
|
| 1667 |
+
end: buffer[position + 1],
|
| 1668 |
+
name: buffer.convertString(buffer[position + 2])
|
| 1669 |
+
};
|
| 1670 |
+
},
|
| 1671 |
+
function jsxMemberExpression(position, buffer) {
|
| 1672 |
+
return {
|
| 1673 |
+
type: 'JSXMemberExpression',
|
| 1674 |
+
start: buffer[position],
|
| 1675 |
+
end: buffer[position + 1],
|
| 1676 |
+
object: convertNode(buffer[position + 2], buffer),
|
| 1677 |
+
property: convertNode(buffer[position + 3], buffer)
|
| 1678 |
+
};
|
| 1679 |
+
},
|
| 1680 |
+
function jsxNamespacedName(position, buffer) {
|
| 1681 |
+
return {
|
| 1682 |
+
type: 'JSXNamespacedName',
|
| 1683 |
+
start: buffer[position],
|
| 1684 |
+
end: buffer[position + 1],
|
| 1685 |
+
namespace: convertNode(buffer[position + 2], buffer),
|
| 1686 |
+
name: convertNode(buffer[position + 3], buffer)
|
| 1687 |
+
};
|
| 1688 |
+
},
|
| 1689 |
+
function jsxOpeningElement(position, buffer) {
|
| 1690 |
+
const flags = buffer[position + 2];
|
| 1691 |
+
return {
|
| 1692 |
+
type: 'JSXOpeningElement',
|
| 1693 |
+
start: buffer[position],
|
| 1694 |
+
end: buffer[position + 1],
|
| 1695 |
+
selfClosing: (flags & 1) === 1,
|
| 1696 |
+
name: convertNode(buffer[position + 3], buffer),
|
| 1697 |
+
attributes: convertNodeList(buffer[position + 4], buffer)
|
| 1698 |
+
};
|
| 1699 |
+
},
|
| 1700 |
+
function jsxOpeningFragment(position, buffer) {
|
| 1701 |
+
return {
|
| 1702 |
+
type: 'JSXOpeningFragment',
|
| 1703 |
+
start: buffer[position],
|
| 1704 |
+
end: buffer[position + 1],
|
| 1705 |
+
attributes: [],
|
| 1706 |
+
selfClosing: false
|
| 1707 |
+
};
|
| 1708 |
+
},
|
| 1709 |
+
function jsxSpreadAttribute(position, buffer) {
|
| 1710 |
+
return {
|
| 1711 |
+
type: 'JSXSpreadAttribute',
|
| 1712 |
+
start: buffer[position],
|
| 1713 |
+
end: buffer[position + 1],
|
| 1714 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 1715 |
+
};
|
| 1716 |
+
},
|
| 1717 |
+
function jsxSpreadChild(position, buffer) {
|
| 1718 |
+
return {
|
| 1719 |
+
type: 'JSXSpreadChild',
|
| 1720 |
+
start: buffer[position],
|
| 1721 |
+
end: buffer[position + 1],
|
| 1722 |
+
expression: convertNode(buffer[position + 2], buffer)
|
| 1723 |
+
};
|
| 1724 |
+
},
|
| 1725 |
+
function jsxText(position, buffer) {
|
| 1726 |
+
return {
|
| 1727 |
+
type: 'JSXText',
|
| 1728 |
+
start: buffer[position],
|
| 1729 |
+
end: buffer[position + 1],
|
| 1730 |
+
value: buffer.convertString(buffer[position + 2]),
|
| 1731 |
+
raw: buffer.convertString(buffer[position + 3])
|
| 1732 |
+
};
|
| 1733 |
+
},
|
| 1734 |
+
function labeledStatement(position, buffer) {
|
| 1735 |
+
return {
|
| 1736 |
+
type: 'LabeledStatement',
|
| 1737 |
+
start: buffer[position],
|
| 1738 |
+
end: buffer[position + 1],
|
| 1739 |
+
label: convertNode(buffer[position + 2], buffer),
|
| 1740 |
+
body: convertNode(buffer[position + 3], buffer)
|
| 1741 |
+
};
|
| 1742 |
+
},
|
| 1743 |
+
function literalBigInt(position, buffer) {
|
| 1744 |
+
const bigint = buffer.convertString(buffer[position + 2]);
|
| 1745 |
+
return {
|
| 1746 |
+
type: 'Literal',
|
| 1747 |
+
start: buffer[position],
|
| 1748 |
+
end: buffer[position + 1],
|
| 1749 |
+
bigint,
|
| 1750 |
+
raw: buffer.convertString(buffer[position + 3]),
|
| 1751 |
+
value: BigInt(bigint)
|
| 1752 |
+
};
|
| 1753 |
+
},
|
| 1754 |
+
function literalBoolean(position, buffer) {
|
| 1755 |
+
const flags = buffer[position + 2];
|
| 1756 |
+
const value = (flags & 1) === 1;
|
| 1757 |
+
return {
|
| 1758 |
+
type: 'Literal',
|
| 1759 |
+
start: buffer[position],
|
| 1760 |
+
end: buffer[position + 1],
|
| 1761 |
+
value,
|
| 1762 |
+
raw: value ? 'true' : 'false'
|
| 1763 |
+
};
|
| 1764 |
+
},
|
| 1765 |
+
function literalNull(position, buffer) {
|
| 1766 |
+
return {
|
| 1767 |
+
type: 'Literal',
|
| 1768 |
+
start: buffer[position],
|
| 1769 |
+
end: buffer[position + 1],
|
| 1770 |
+
raw: 'null',
|
| 1771 |
+
value: null
|
| 1772 |
+
};
|
| 1773 |
+
},
|
| 1774 |
+
function literalNumber(position, buffer) {
|
| 1775 |
+
const rawPosition = buffer[position + 2];
|
| 1776 |
+
return {
|
| 1777 |
+
type: 'Literal',
|
| 1778 |
+
start: buffer[position],
|
| 1779 |
+
end: buffer[position + 1],
|
| 1780 |
+
raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition),
|
| 1781 |
+
value: new DataView(buffer.buffer).getFloat64((position + 3) << 2, true)
|
| 1782 |
+
};
|
| 1783 |
+
},
|
| 1784 |
+
function literalRegExp(position, buffer) {
|
| 1785 |
+
const flags = buffer.convertString(buffer[position + 2]);
|
| 1786 |
+
const pattern = buffer.convertString(buffer[position + 3]);
|
| 1787 |
+
return {
|
| 1788 |
+
type: 'Literal',
|
| 1789 |
+
start: buffer[position],
|
| 1790 |
+
end: buffer[position + 1],
|
| 1791 |
+
raw: `/${pattern}/${flags}`,
|
| 1792 |
+
regex: { flags, pattern },
|
| 1793 |
+
value: new RegExp(pattern, flags)
|
| 1794 |
+
};
|
| 1795 |
+
},
|
| 1796 |
+
function literalString(position, buffer) {
|
| 1797 |
+
const rawPosition = buffer[position + 3];
|
| 1798 |
+
return {
|
| 1799 |
+
type: 'Literal',
|
| 1800 |
+
start: buffer[position],
|
| 1801 |
+
end: buffer[position + 1],
|
| 1802 |
+
value: buffer.convertString(buffer[position + 2]),
|
| 1803 |
+
raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition)
|
| 1804 |
+
};
|
| 1805 |
+
},
|
| 1806 |
+
function logicalExpression(position, buffer) {
|
| 1807 |
+
return {
|
| 1808 |
+
type: 'LogicalExpression',
|
| 1809 |
+
start: buffer[position],
|
| 1810 |
+
end: buffer[position + 1],
|
| 1811 |
+
operator: FIXED_STRINGS[buffer[position + 2]],
|
| 1812 |
+
left: convertNode(buffer[position + 3], buffer),
|
| 1813 |
+
right: convertNode(buffer[position + 4], buffer)
|
| 1814 |
+
};
|
| 1815 |
+
},
|
| 1816 |
+
function memberExpression(position, buffer) {
|
| 1817 |
+
const flags = buffer[position + 2];
|
| 1818 |
+
return {
|
| 1819 |
+
type: 'MemberExpression',
|
| 1820 |
+
start: buffer[position],
|
| 1821 |
+
end: buffer[position + 1],
|
| 1822 |
+
computed: (flags & 1) === 1,
|
| 1823 |
+
optional: (flags & 2) === 2,
|
| 1824 |
+
object: convertNode(buffer[position + 3], buffer),
|
| 1825 |
+
property: convertNode(buffer[position + 4], buffer)
|
| 1826 |
+
};
|
| 1827 |
+
},
|
| 1828 |
+
function metaProperty(position, buffer) {
|
| 1829 |
+
return {
|
| 1830 |
+
type: 'MetaProperty',
|
| 1831 |
+
start: buffer[position],
|
| 1832 |
+
end: buffer[position + 1],
|
| 1833 |
+
meta: convertNode(buffer[position + 2], buffer),
|
| 1834 |
+
property: convertNode(buffer[position + 3], buffer)
|
| 1835 |
+
};
|
| 1836 |
+
},
|
| 1837 |
+
function methodDefinition(position, buffer) {
|
| 1838 |
+
const flags = buffer[position + 2];
|
| 1839 |
+
return {
|
| 1840 |
+
type: 'MethodDefinition',
|
| 1841 |
+
start: buffer[position],
|
| 1842 |
+
end: buffer[position + 1],
|
| 1843 |
+
static: (flags & 1) === 1,
|
| 1844 |
+
computed: (flags & 2) === 2,
|
| 1845 |
+
decorators: convertNodeList(buffer[position + 3], buffer),
|
| 1846 |
+
key: convertNode(buffer[position + 4], buffer),
|
| 1847 |
+
value: convertNode(buffer[position + 5], buffer),
|
| 1848 |
+
kind: FIXED_STRINGS[buffer[position + 6]]
|
| 1849 |
+
};
|
| 1850 |
+
},
|
| 1851 |
+
function newExpression(position, buffer) {
|
| 1852 |
+
const annotations = convertAnnotations(buffer[position + 2], buffer);
|
| 1853 |
+
return {
|
| 1854 |
+
type: 'NewExpression',
|
| 1855 |
+
start: buffer[position],
|
| 1856 |
+
end: buffer[position + 1],
|
| 1857 |
+
...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
|
| 1858 |
+
callee: convertNode(buffer[position + 3], buffer),
|
| 1859 |
+
arguments: convertNodeList(buffer[position + 4], buffer)
|
| 1860 |
+
};
|
| 1861 |
+
},
|
| 1862 |
+
function objectExpression(position, buffer) {
|
| 1863 |
+
return {
|
| 1864 |
+
type: 'ObjectExpression',
|
| 1865 |
+
start: buffer[position],
|
| 1866 |
+
end: buffer[position + 1],
|
| 1867 |
+
properties: convertNodeList(buffer[position + 2], buffer)
|
| 1868 |
+
};
|
| 1869 |
+
},
|
| 1870 |
+
function objectPattern(position, buffer) {
|
| 1871 |
+
return {
|
| 1872 |
+
type: 'ObjectPattern',
|
| 1873 |
+
start: buffer[position],
|
| 1874 |
+
end: buffer[position + 1],
|
| 1875 |
+
properties: convertNodeList(buffer[position + 2], buffer)
|
| 1876 |
+
};
|
| 1877 |
+
},
|
| 1878 |
+
function privateIdentifier(position, buffer) {
|
| 1879 |
+
return {
|
| 1880 |
+
type: 'PrivateIdentifier',
|
| 1881 |
+
start: buffer[position],
|
| 1882 |
+
end: buffer[position + 1],
|
| 1883 |
+
name: buffer.convertString(buffer[position + 2])
|
| 1884 |
+
};
|
| 1885 |
+
},
|
| 1886 |
+
function program(position, buffer) {
|
| 1887 |
+
const invalidAnnotations = convertAnnotations(buffer[position + 3], buffer);
|
| 1888 |
+
return {
|
| 1889 |
+
type: 'Program',
|
| 1890 |
+
start: buffer[position],
|
| 1891 |
+
end: buffer[position + 1],
|
| 1892 |
+
body: convertNodeList(buffer[position + 2], buffer),
|
| 1893 |
+
...(invalidAnnotations.length > 0 ? { [INVALID_ANNOTATION_KEY]: invalidAnnotations } : {}),
|
| 1894 |
+
sourceType: 'module'
|
| 1895 |
+
};
|
| 1896 |
+
},
|
| 1897 |
+
function property(position, buffer) {
|
| 1898 |
+
const flags = buffer[position + 2];
|
| 1899 |
+
const keyPosition = buffer[position + 3];
|
| 1900 |
+
const value = convertNode(buffer[position + 4], buffer);
|
| 1901 |
+
return {
|
| 1902 |
+
type: 'Property',
|
| 1903 |
+
start: buffer[position],
|
| 1904 |
+
end: buffer[position + 1],
|
| 1905 |
+
method: (flags & 1) === 1,
|
| 1906 |
+
shorthand: (flags & 2) === 2,
|
| 1907 |
+
computed: (flags & 4) === 4,
|
| 1908 |
+
key: keyPosition === 0 ? { ...value } : convertNode(keyPosition, buffer),
|
| 1909 |
+
value,
|
| 1910 |
+
kind: FIXED_STRINGS[buffer[position + 5]]
|
| 1911 |
+
};
|
| 1912 |
+
},
|
| 1913 |
+
function propertyDefinition(position, buffer) {
|
| 1914 |
+
const flags = buffer[position + 2];
|
| 1915 |
+
const valuePosition = buffer[position + 5];
|
| 1916 |
+
return {
|
| 1917 |
+
type: 'PropertyDefinition',
|
| 1918 |
+
start: buffer[position],
|
| 1919 |
+
end: buffer[position + 1],
|
| 1920 |
+
static: (flags & 1) === 1,
|
| 1921 |
+
computed: (flags & 2) === 2,
|
| 1922 |
+
decorators: convertNodeList(buffer[position + 3], buffer),
|
| 1923 |
+
key: convertNode(buffer[position + 4], buffer),
|
| 1924 |
+
value: valuePosition === 0 ? null : convertNode(valuePosition, buffer)
|
| 1925 |
+
};
|
| 1926 |
+
},
|
| 1927 |
+
function restElement(position, buffer) {
|
| 1928 |
+
return {
|
| 1929 |
+
type: 'RestElement',
|
| 1930 |
+
start: buffer[position],
|
| 1931 |
+
end: buffer[position + 1],
|
| 1932 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 1933 |
+
};
|
| 1934 |
+
},
|
| 1935 |
+
function returnStatement(position, buffer) {
|
| 1936 |
+
const argumentPosition = buffer[position + 2];
|
| 1937 |
+
return {
|
| 1938 |
+
type: 'ReturnStatement',
|
| 1939 |
+
start: buffer[position],
|
| 1940 |
+
end: buffer[position + 1],
|
| 1941 |
+
argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer)
|
| 1942 |
+
};
|
| 1943 |
+
},
|
| 1944 |
+
function sequenceExpression(position, buffer) {
|
| 1945 |
+
return {
|
| 1946 |
+
type: 'SequenceExpression',
|
| 1947 |
+
start: buffer[position],
|
| 1948 |
+
end: buffer[position + 1],
|
| 1949 |
+
expressions: convertNodeList(buffer[position + 2], buffer)
|
| 1950 |
+
};
|
| 1951 |
+
},
|
| 1952 |
+
function spreadElement(position, buffer) {
|
| 1953 |
+
return {
|
| 1954 |
+
type: 'SpreadElement',
|
| 1955 |
+
start: buffer[position],
|
| 1956 |
+
end: buffer[position + 1],
|
| 1957 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 1958 |
+
};
|
| 1959 |
+
},
|
| 1960 |
+
function staticBlock(position, buffer) {
|
| 1961 |
+
return {
|
| 1962 |
+
type: 'StaticBlock',
|
| 1963 |
+
start: buffer[position],
|
| 1964 |
+
end: buffer[position + 1],
|
| 1965 |
+
body: convertNodeList(buffer[position + 2], buffer)
|
| 1966 |
+
};
|
| 1967 |
+
},
|
| 1968 |
+
function superElement(position, buffer) {
|
| 1969 |
+
return {
|
| 1970 |
+
type: 'Super',
|
| 1971 |
+
start: buffer[position],
|
| 1972 |
+
end: buffer[position + 1]
|
| 1973 |
+
};
|
| 1974 |
+
},
|
| 1975 |
+
function switchCase(position, buffer) {
|
| 1976 |
+
const testPosition = buffer[position + 2];
|
| 1977 |
+
return {
|
| 1978 |
+
type: 'SwitchCase',
|
| 1979 |
+
start: buffer[position],
|
| 1980 |
+
end: buffer[position + 1],
|
| 1981 |
+
test: testPosition === 0 ? null : convertNode(testPosition, buffer),
|
| 1982 |
+
consequent: convertNodeList(buffer[position + 3], buffer)
|
| 1983 |
+
};
|
| 1984 |
+
},
|
| 1985 |
+
function switchStatement(position, buffer) {
|
| 1986 |
+
return {
|
| 1987 |
+
type: 'SwitchStatement',
|
| 1988 |
+
start: buffer[position],
|
| 1989 |
+
end: buffer[position + 1],
|
| 1990 |
+
discriminant: convertNode(buffer[position + 2], buffer),
|
| 1991 |
+
cases: convertNodeList(buffer[position + 3], buffer)
|
| 1992 |
+
};
|
| 1993 |
+
},
|
| 1994 |
+
function taggedTemplateExpression(position, buffer) {
|
| 1995 |
+
return {
|
| 1996 |
+
type: 'TaggedTemplateExpression',
|
| 1997 |
+
start: buffer[position],
|
| 1998 |
+
end: buffer[position + 1],
|
| 1999 |
+
tag: convertNode(buffer[position + 2], buffer),
|
| 2000 |
+
quasi: convertNode(buffer[position + 3], buffer)
|
| 2001 |
+
};
|
| 2002 |
+
},
|
| 2003 |
+
function templateElement(position, buffer) {
|
| 2004 |
+
const flags = buffer[position + 2];
|
| 2005 |
+
const cookedPosition = buffer[position + 3];
|
| 2006 |
+
const cooked = cookedPosition === 0 ? null : buffer.convertString(cookedPosition);
|
| 2007 |
+
const raw = buffer.convertString(buffer[position + 4]);
|
| 2008 |
+
return {
|
| 2009 |
+
type: 'TemplateElement',
|
| 2010 |
+
start: buffer[position],
|
| 2011 |
+
end: buffer[position + 1],
|
| 2012 |
+
tail: (flags & 1) === 1,
|
| 2013 |
+
value: { cooked, raw }
|
| 2014 |
+
};
|
| 2015 |
+
},
|
| 2016 |
+
function templateLiteral(position, buffer) {
|
| 2017 |
+
return {
|
| 2018 |
+
type: 'TemplateLiteral',
|
| 2019 |
+
start: buffer[position],
|
| 2020 |
+
end: buffer[position + 1],
|
| 2021 |
+
quasis: convertNodeList(buffer[position + 2], buffer),
|
| 2022 |
+
expressions: convertNodeList(buffer[position + 3], buffer)
|
| 2023 |
+
};
|
| 2024 |
+
},
|
| 2025 |
+
function thisExpression(position, buffer) {
|
| 2026 |
+
return {
|
| 2027 |
+
type: 'ThisExpression',
|
| 2028 |
+
start: buffer[position],
|
| 2029 |
+
end: buffer[position + 1]
|
| 2030 |
+
};
|
| 2031 |
+
},
|
| 2032 |
+
function throwStatement(position, buffer) {
|
| 2033 |
+
return {
|
| 2034 |
+
type: 'ThrowStatement',
|
| 2035 |
+
start: buffer[position],
|
| 2036 |
+
end: buffer[position + 1],
|
| 2037 |
+
argument: convertNode(buffer[position + 2], buffer)
|
| 2038 |
+
};
|
| 2039 |
+
},
|
| 2040 |
+
function tryStatement(position, buffer) {
|
| 2041 |
+
const handlerPosition = buffer[position + 3];
|
| 2042 |
+
const finalizerPosition = buffer[position + 4];
|
| 2043 |
+
return {
|
| 2044 |
+
type: 'TryStatement',
|
| 2045 |
+
start: buffer[position],
|
| 2046 |
+
end: buffer[position + 1],
|
| 2047 |
+
block: convertNode(buffer[position + 2], buffer),
|
| 2048 |
+
handler: handlerPosition === 0 ? null : convertNode(handlerPosition, buffer),
|
| 2049 |
+
finalizer: finalizerPosition === 0 ? null : convertNode(finalizerPosition, buffer)
|
| 2050 |
+
};
|
| 2051 |
+
},
|
| 2052 |
+
function unaryExpression(position, buffer) {
|
| 2053 |
+
return {
|
| 2054 |
+
type: 'UnaryExpression',
|
| 2055 |
+
start: buffer[position],
|
| 2056 |
+
end: buffer[position + 1],
|
| 2057 |
+
operator: FIXED_STRINGS[buffer[position + 2]],
|
| 2058 |
+
argument: convertNode(buffer[position + 3], buffer),
|
| 2059 |
+
prefix: true
|
| 2060 |
+
};
|
| 2061 |
+
},
|
| 2062 |
+
function updateExpression(position, buffer) {
|
| 2063 |
+
const flags = buffer[position + 2];
|
| 2064 |
+
return {
|
| 2065 |
+
type: 'UpdateExpression',
|
| 2066 |
+
start: buffer[position],
|
| 2067 |
+
end: buffer[position + 1],
|
| 2068 |
+
prefix: (flags & 1) === 1,
|
| 2069 |
+
operator: FIXED_STRINGS[buffer[position + 3]],
|
| 2070 |
+
argument: convertNode(buffer[position + 4], buffer)
|
| 2071 |
+
};
|
| 2072 |
+
},
|
| 2073 |
+
function variableDeclaration(position, buffer) {
|
| 2074 |
+
return {
|
| 2075 |
+
type: 'VariableDeclaration',
|
| 2076 |
+
start: buffer[position],
|
| 2077 |
+
end: buffer[position + 1],
|
| 2078 |
+
kind: FIXED_STRINGS[buffer[position + 2]],
|
| 2079 |
+
declarations: convertNodeList(buffer[position + 3], buffer)
|
| 2080 |
+
};
|
| 2081 |
+
},
|
| 2082 |
+
function variableDeclarator(position, buffer) {
|
| 2083 |
+
const initPosition = buffer[position + 3];
|
| 2084 |
+
return {
|
| 2085 |
+
type: 'VariableDeclarator',
|
| 2086 |
+
start: buffer[position],
|
| 2087 |
+
end: buffer[position + 1],
|
| 2088 |
+
id: convertNode(buffer[position + 2], buffer),
|
| 2089 |
+
init: initPosition === 0 ? null : convertNode(initPosition, buffer)
|
| 2090 |
+
};
|
| 2091 |
+
},
|
| 2092 |
+
function whileStatement(position, buffer) {
|
| 2093 |
+
return {
|
| 2094 |
+
type: 'WhileStatement',
|
| 2095 |
+
start: buffer[position],
|
| 2096 |
+
end: buffer[position + 1],
|
| 2097 |
+
test: convertNode(buffer[position + 2], buffer),
|
| 2098 |
+
body: convertNode(buffer[position + 3], buffer)
|
| 2099 |
+
};
|
| 2100 |
+
},
|
| 2101 |
+
function yieldExpression(position, buffer) {
|
| 2102 |
+
const flags = buffer[position + 2];
|
| 2103 |
+
const argumentPosition = buffer[position + 3];
|
| 2104 |
+
return {
|
| 2105 |
+
type: 'YieldExpression',
|
| 2106 |
+
start: buffer[position],
|
| 2107 |
+
end: buffer[position + 1],
|
| 2108 |
+
delegate: (flags & 1) === 1,
|
| 2109 |
+
argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer)
|
| 2110 |
+
};
|
| 2111 |
+
}
|
| 2112 |
+
];
|
| 2113 |
+
function convertNode(position, buffer) {
|
| 2114 |
+
const nodeType = buffer[position];
|
| 2115 |
+
const converter = nodeConverters[nodeType];
|
| 2116 |
+
/* istanbul ignore if: This should never be executed but is a safeguard against faulty buffers */
|
| 2117 |
+
if (!converter) {
|
| 2118 |
+
console.trace();
|
| 2119 |
+
throw new Error(`Unknown node type: ${nodeType}`);
|
| 2120 |
+
}
|
| 2121 |
+
return converter(position + 1, buffer);
|
| 2122 |
+
}
|
| 2123 |
+
function convertNodeList(position, buffer) {
|
| 2124 |
+
if (position === 0)
|
| 2125 |
+
return EMPTY_ARRAY;
|
| 2126 |
+
const length = buffer[position++];
|
| 2127 |
+
const list = new Array(length);
|
| 2128 |
+
for (let index = 0; index < length; index++) {
|
| 2129 |
+
const nodePosition = buffer[position++];
|
| 2130 |
+
list[index] = nodePosition ? convertNode(nodePosition, buffer) : null;
|
| 2131 |
+
}
|
| 2132 |
+
return list;
|
| 2133 |
+
}
|
| 2134 |
+
|
| 2135 |
+
function getAstBuffer(astBuffer) {
|
| 2136 |
+
const array = new Uint32Array(astBuffer.buffer);
|
| 2137 |
+
let convertString;
|
| 2138 |
+
if (typeof Buffer !== 'undefined' && astBuffer instanceof Buffer) {
|
| 2139 |
+
convertString = (position) => {
|
| 2140 |
+
const length = array[position++];
|
| 2141 |
+
const bytePosition = position << 2;
|
| 2142 |
+
return astBuffer.toString('utf8', bytePosition, bytePosition + length);
|
| 2143 |
+
};
|
| 2144 |
+
}
|
| 2145 |
+
else {
|
| 2146 |
+
const textDecoder = new TextDecoder();
|
| 2147 |
+
convertString = (position) => {
|
| 2148 |
+
const length = array[position++];
|
| 2149 |
+
const bytePosition = position << 2;
|
| 2150 |
+
return textDecoder.decode(astBuffer.subarray(bytePosition, bytePosition + length));
|
| 2151 |
+
};
|
| 2152 |
+
}
|
| 2153 |
+
return Object.assign(array, { convertString });
|
| 2154 |
+
}
|
| 2155 |
+
|
| 2156 |
+
const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(native_js.parse(input, allowReturnOutsideFunction, jsx)));
|
| 2157 |
+
const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await native_js.parseAsync(input, allowReturnOutsideFunction, jsx, signal)));
|
| 2158 |
+
|
| 2159 |
+
exports.ANNOTATION_KEY = ANNOTATION_KEY;
|
| 2160 |
+
exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
| 2161 |
+
exports.AwaitExpression = AwaitExpression;
|
| 2162 |
+
exports.BLANK = BLANK;
|
| 2163 |
+
exports.BlockStatement = BlockStatement;
|
| 2164 |
+
exports.CallExpression = CallExpression;
|
| 2165 |
+
exports.CatchClause = CatchClause;
|
| 2166 |
+
exports.EMPTY_ARRAY = EMPTY_ARRAY;
|
| 2167 |
+
exports.EMPTY_OBJECT = EMPTY_OBJECT;
|
| 2168 |
+
exports.EMPTY_SET = EMPTY_SET;
|
| 2169 |
+
exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
|
| 2170 |
+
exports.ExpressionStatement = ExpressionStatement;
|
| 2171 |
+
exports.FIXED_STRINGS = FIXED_STRINGS;
|
| 2172 |
+
exports.FunctionExpression = FunctionExpression;
|
| 2173 |
+
exports.INVALID_ANNOTATION_KEY = INVALID_ANNOTATION_KEY;
|
| 2174 |
+
exports.Identifier = Identifier;
|
| 2175 |
+
exports.LOGLEVEL_DEBUG = LOGLEVEL_DEBUG;
|
| 2176 |
+
exports.LOGLEVEL_ERROR = LOGLEVEL_ERROR;
|
| 2177 |
+
exports.LOGLEVEL_INFO = LOGLEVEL_INFO;
|
| 2178 |
+
exports.LOGLEVEL_WARN = LOGLEVEL_WARN;
|
| 2179 |
+
exports.Literal = Literal;
|
| 2180 |
+
exports.MemberExpression = MemberExpression;
|
| 2181 |
+
exports.ObjectExpression = ObjectExpression;
|
| 2182 |
+
exports.Program = Program;
|
| 2183 |
+
exports.Property = Property;
|
| 2184 |
+
exports.RestElement = RestElement;
|
| 2185 |
+
exports.ReturnStatement = ReturnStatement;
|
| 2186 |
+
exports.StaticBlock = StaticBlock;
|
| 2187 |
+
exports.TemplateLiteral = TemplateLiteral;
|
| 2188 |
+
exports.URL_AVOIDING_EVAL = URL_AVOIDING_EVAL;
|
| 2189 |
+
exports.URL_GENERATEBUNDLE = URL_GENERATEBUNDLE;
|
| 2190 |
+
exports.URL_JSX = URL_JSX;
|
| 2191 |
+
exports.URL_LOAD = URL_LOAD;
|
| 2192 |
+
exports.URL_NAME_IS_NOT_EXPORTED = URL_NAME_IS_NOT_EXPORTED;
|
| 2193 |
+
exports.URL_OUTPUT_AMD_BASEPATH = URL_OUTPUT_AMD_BASEPATH;
|
| 2194 |
+
exports.URL_OUTPUT_AMD_ID = URL_OUTPUT_AMD_ID;
|
| 2195 |
+
exports.URL_OUTPUT_DIR = URL_OUTPUT_DIR;
|
| 2196 |
+
exports.URL_OUTPUT_EXPORTS = URL_OUTPUT_EXPORTS;
|
| 2197 |
+
exports.URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = URL_OUTPUT_EXTERNALIMPORTATTRIBUTES;
|
| 2198 |
+
exports.URL_OUTPUT_FORMAT = URL_OUTPUT_FORMAT;
|
| 2199 |
+
exports.URL_OUTPUT_GENERATEDCODE = URL_OUTPUT_GENERATEDCODE;
|
| 2200 |
+
exports.URL_OUTPUT_GLOBALS = URL_OUTPUT_GLOBALS;
|
| 2201 |
+
exports.URL_OUTPUT_INLINEDYNAMICIMPORTS = URL_OUTPUT_INLINEDYNAMICIMPORTS;
|
| 2202 |
+
exports.URL_OUTPUT_INTEROP = URL_OUTPUT_INTEROP;
|
| 2203 |
+
exports.URL_OUTPUT_MANUALCHUNKS = URL_OUTPUT_MANUALCHUNKS;
|
| 2204 |
+
exports.URL_OUTPUT_SOURCEMAPBASEURL = URL_OUTPUT_SOURCEMAPBASEURL;
|
| 2205 |
+
exports.URL_OUTPUT_SOURCEMAPFILE = URL_OUTPUT_SOURCEMAPFILE;
|
| 2206 |
+
exports.URL_PRESERVEENTRYSIGNATURES = URL_PRESERVEENTRYSIGNATURES;
|
| 2207 |
+
exports.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT;
|
| 2208 |
+
exports.URL_THIS_IS_UNDEFINED = URL_THIS_IS_UNDEFINED;
|
| 2209 |
+
exports.URL_TRANSFORM = URL_TRANSFORM;
|
| 2210 |
+
exports.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY;
|
| 2211 |
+
exports.URL_TREESHAKE = URL_TREESHAKE;
|
| 2212 |
+
exports.URL_TREESHAKE_MODULESIDEEFFECTS = URL_TREESHAKE_MODULESIDEEFFECTS;
|
| 2213 |
+
exports.URL_WATCH = URL_WATCH;
|
| 2214 |
+
exports.VariableDeclarator = VariableDeclarator;
|
| 2215 |
+
exports.addTrailingSlashIfMissed = addTrailingSlashIfMissed;
|
| 2216 |
+
exports.augmentCodeLocation = augmentCodeLocation;
|
| 2217 |
+
exports.augmentLogMessage = augmentLogMessage;
|
| 2218 |
+
exports.convertAnnotations = convertAnnotations;
|
| 2219 |
+
exports.convertNode = convertNode;
|
| 2220 |
+
exports.error = error;
|
| 2221 |
+
exports.getAliasName = getAliasName;
|
| 2222 |
+
exports.getAstBuffer = getAstBuffer;
|
| 2223 |
+
exports.getImportPath = getImportPath;
|
| 2224 |
+
exports.getRollupError = getRollupError;
|
| 2225 |
+
exports.getRollupUrl = getRollupUrl;
|
| 2226 |
+
exports.isAbsolute = isAbsolute;
|
| 2227 |
+
exports.isPathFragment = isPathFragment;
|
| 2228 |
+
exports.isRelative = isRelative;
|
| 2229 |
+
exports.isValidUrl = isValidUrl;
|
| 2230 |
+
exports.locate = locate;
|
| 2231 |
+
exports.logAddonNotGenerated = logAddonNotGenerated;
|
| 2232 |
+
exports.logAlreadyClosed = logAlreadyClosed;
|
| 2233 |
+
exports.logAmbiguousExternalNamespaces = logAmbiguousExternalNamespaces;
|
| 2234 |
+
exports.logAnonymousPluginCache = logAnonymousPluginCache;
|
| 2235 |
+
exports.logAssetNotFinalisedForFileName = logAssetNotFinalisedForFileName;
|
| 2236 |
+
exports.logAssetReferenceIdNotFoundForSetSource = logAssetReferenceIdNotFoundForSetSource;
|
| 2237 |
+
exports.logAssetSourceAlreadySet = logAssetSourceAlreadySet;
|
| 2238 |
+
exports.logBadLoader = logBadLoader;
|
| 2239 |
+
exports.logCannotAssignModuleToChunk = logCannotAssignModuleToChunk;
|
| 2240 |
+
exports.logCannotBundleConfigAsEsm = logCannotBundleConfigAsEsm;
|
| 2241 |
+
exports.logCannotCallNamespace = logCannotCallNamespace;
|
| 2242 |
+
exports.logCannotEmitFromOptionsHook = logCannotEmitFromOptionsHook;
|
| 2243 |
+
exports.logCannotLoadConfigAsCjs = logCannotLoadConfigAsCjs;
|
| 2244 |
+
exports.logCannotLoadConfigAsEsm = logCannotLoadConfigAsEsm;
|
| 2245 |
+
exports.logChunkInvalid = logChunkInvalid;
|
| 2246 |
+
exports.logChunkNotGeneratedForFileName = logChunkNotGeneratedForFileName;
|
| 2247 |
+
exports.logCircularChunk = logCircularChunk;
|
| 2248 |
+
exports.logCircularDependency = logCircularDependency;
|
| 2249 |
+
exports.logCircularReexport = logCircularReexport;
|
| 2250 |
+
exports.logConflictingSourcemapSources = logConflictingSourcemapSources;
|
| 2251 |
+
exports.logConstVariableReassignError = logConstVariableReassignError;
|
| 2252 |
+
exports.logCyclicCrossChunkReexport = logCyclicCrossChunkReexport;
|
| 2253 |
+
exports.logDuplicateArgumentNameError = logDuplicateArgumentNameError;
|
| 2254 |
+
exports.logDuplicateExportError = logDuplicateExportError;
|
| 2255 |
+
exports.logDuplicateImportOptions = logDuplicateImportOptions;
|
| 2256 |
+
exports.logDuplicatePluginName = logDuplicatePluginName;
|
| 2257 |
+
exports.logEmptyChunk = logEmptyChunk;
|
| 2258 |
+
exports.logEntryCannotBeExternal = logEntryCannotBeExternal;
|
| 2259 |
+
exports.logEval = logEval;
|
| 2260 |
+
exports.logExternalModulesCannotBeIncludedInManualChunks = logExternalModulesCannotBeIncludedInManualChunks;
|
| 2261 |
+
exports.logExternalModulesCannotBeTransformedToModules = logExternalModulesCannotBeTransformedToModules;
|
| 2262 |
+
exports.logExternalSyntheticExports = logExternalSyntheticExports;
|
| 2263 |
+
exports.logFailAfterWarnings = logFailAfterWarnings;
|
| 2264 |
+
exports.logFailedValidation = logFailedValidation;
|
| 2265 |
+
exports.logFileNameConflict = logFileNameConflict;
|
| 2266 |
+
exports.logFileReferenceIdNotFoundForFilename = logFileReferenceIdNotFoundForFilename;
|
| 2267 |
+
exports.logFirstSideEffect = logFirstSideEffect;
|
| 2268 |
+
exports.logIllegalIdentifierAsName = logIllegalIdentifierAsName;
|
| 2269 |
+
exports.logIllegalImportReassignment = logIllegalImportReassignment;
|
| 2270 |
+
exports.logImplicitDependantCannotBeExternal = logImplicitDependantCannotBeExternal;
|
| 2271 |
+
exports.logImplicitDependantIsNotIncluded = logImplicitDependantIsNotIncluded;
|
| 2272 |
+
exports.logImportAttributeIsInvalid = logImportAttributeIsInvalid;
|
| 2273 |
+
exports.logImportOptionsAreInvalid = logImportOptionsAreInvalid;
|
| 2274 |
+
exports.logIncompatibleExportOptionValue = logIncompatibleExportOptionValue;
|
| 2275 |
+
exports.logInconsistentImportAttributes = logInconsistentImportAttributes;
|
| 2276 |
+
exports.logInputHookInOutputPlugin = logInputHookInOutputPlugin;
|
| 2277 |
+
exports.logInternalIdCannotBeExternal = logInternalIdCannotBeExternal;
|
| 2278 |
+
exports.logInvalidAddonPluginHook = logInvalidAddonPluginHook;
|
| 2279 |
+
exports.logInvalidAnnotation = logInvalidAnnotation;
|
| 2280 |
+
exports.logInvalidExportOptionValue = logInvalidExportOptionValue;
|
| 2281 |
+
exports.logInvalidFormatForTopLevelAwait = logInvalidFormatForTopLevelAwait;
|
| 2282 |
+
exports.logInvalidFunctionPluginHook = logInvalidFunctionPluginHook;
|
| 2283 |
+
exports.logInvalidLogPosition = logInvalidLogPosition;
|
| 2284 |
+
exports.logInvalidOption = logInvalidOption;
|
| 2285 |
+
exports.logInvalidRollupPhaseForChunkEmission = logInvalidRollupPhaseForChunkEmission;
|
| 2286 |
+
exports.logInvalidSetAssetSourceCall = logInvalidSetAssetSourceCall;
|
| 2287 |
+
exports.logInvalidSourcemapForError = logInvalidSourcemapForError;
|
| 2288 |
+
exports.logLevelPriority = logLevelPriority;
|
| 2289 |
+
exports.logMissingConfig = logMissingConfig;
|
| 2290 |
+
exports.logMissingEntryExport = logMissingEntryExport;
|
| 2291 |
+
exports.logMissingExport = logMissingExport;
|
| 2292 |
+
exports.logMissingExternalConfig = logMissingExternalConfig;
|
| 2293 |
+
exports.logMissingFileOrDirOption = logMissingFileOrDirOption;
|
| 2294 |
+
exports.logMissingGlobalName = logMissingGlobalName;
|
| 2295 |
+
exports.logMissingJsxExport = logMissingJsxExport;
|
| 2296 |
+
exports.logMissingNameOptionForIifeExport = logMissingNameOptionForIifeExport;
|
| 2297 |
+
exports.logMissingNameOptionForUmdExport = logMissingNameOptionForUmdExport;
|
| 2298 |
+
exports.logMissingNodeBuiltins = logMissingNodeBuiltins;
|
| 2299 |
+
exports.logMixedExport = logMixedExport;
|
| 2300 |
+
exports.logModuleLevelDirective = logModuleLevelDirective;
|
| 2301 |
+
exports.logModuleParseError = logModuleParseError;
|
| 2302 |
+
exports.logNamespaceConflict = logNamespaceConflict;
|
| 2303 |
+
exports.logNoAssetSourceSet = logNoAssetSourceSet;
|
| 2304 |
+
exports.logNoTransformMapOrAstWithoutCode = logNoTransformMapOrAstWithoutCode;
|
| 2305 |
+
exports.logOnlyInlineSourcemapsForStdout = logOnlyInlineSourcemapsForStdout;
|
| 2306 |
+
exports.logOptimizeChunkStatus = logOptimizeChunkStatus;
|
| 2307 |
+
exports.logParseError = logParseError;
|
| 2308 |
+
exports.logPluginError = logPluginError;
|
| 2309 |
+
exports.logRedeclarationError = logRedeclarationError;
|
| 2310 |
+
exports.logReservedNamespace = logReservedNamespace;
|
| 2311 |
+
exports.logShimmedExport = logShimmedExport;
|
| 2312 |
+
exports.logSourcemapBroken = logSourcemapBroken;
|
| 2313 |
+
exports.logSyntheticNamedExportsNeedNamespaceExport = logSyntheticNamedExportsNeedNamespaceExport;
|
| 2314 |
+
exports.logThisIsUndefined = logThisIsUndefined;
|
| 2315 |
+
exports.logUnexpectedNamedImport = logUnexpectedNamedImport;
|
| 2316 |
+
exports.logUnexpectedNamespaceReexport = logUnexpectedNamespaceReexport;
|
| 2317 |
+
exports.logUnknownOption = logUnknownOption;
|
| 2318 |
+
exports.logUnresolvedEntry = logUnresolvedEntry;
|
| 2319 |
+
exports.logUnresolvedImplicitDependant = logUnresolvedImplicitDependant;
|
| 2320 |
+
exports.logUnresolvedImport = logUnresolvedImport;
|
| 2321 |
+
exports.logUnresolvedImportTreatedAsExternal = logUnresolvedImportTreatedAsExternal;
|
| 2322 |
+
exports.logUnusedExternalImports = logUnusedExternalImports;
|
| 2323 |
+
exports.normalize = normalize;
|
| 2324 |
+
exports.parseAst = parseAst;
|
| 2325 |
+
exports.parseAstAsync = parseAstAsync;
|
| 2326 |
+
exports.printQuotedStringList = printQuotedStringList;
|
| 2327 |
+
exports.relative = relative;
|
| 2328 |
+
exports.relativeId = relativeId;
|
| 2329 |
+
exports.warnDeprecation = warnDeprecation;
|
| 2330 |
+
//# sourceMappingURL=parseAst.js.map
|
node_modules/rollup/dist/shared/rollup.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
node_modules/rollup/dist/shared/watch-cli.js
ADDED
|
@@ -0,0 +1,542 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
'use strict';
|
| 11 |
+
|
| 12 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 13 |
+
|
| 14 |
+
const index = require('./index.js');
|
| 15 |
+
const promises = require('node:fs/promises');
|
| 16 |
+
const process$2 = require('node:process');
|
| 17 |
+
const cli = require('../bin/rollup');
|
| 18 |
+
const rollup = require('./rollup.js');
|
| 19 |
+
const parseAst_js = require('./parseAst.js');
|
| 20 |
+
const loadConfigFile_js = require('./loadConfigFile.js');
|
| 21 |
+
const node_child_process = require('node:child_process');
|
| 22 |
+
const rollup_js = require('../rollup.js');
|
| 23 |
+
require('path');
|
| 24 |
+
require('fs');
|
| 25 |
+
require('util');
|
| 26 |
+
require('stream');
|
| 27 |
+
require('os');
|
| 28 |
+
require('./fsevents-importer.js');
|
| 29 |
+
require('events');
|
| 30 |
+
require('node:path');
|
| 31 |
+
require('../native.js');
|
| 32 |
+
require('node:perf_hooks');
|
| 33 |
+
require('node:url');
|
| 34 |
+
require('../getLogFilter.js');
|
| 35 |
+
|
| 36 |
+
function timeZone(date = new Date()) {
|
| 37 |
+
const offset = date.getTimezoneOffset();
|
| 38 |
+
const absOffset = Math.abs(offset);
|
| 39 |
+
const hours = Math.floor(absOffset / 60);
|
| 40 |
+
const minutes = absOffset % 60;
|
| 41 |
+
const minutesOut = minutes > 0 ? ':' + ('0' + minutes).slice(-2) : '';
|
| 42 |
+
return (offset < 0 ? '+' : '-') + hours + minutesOut;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
function dateTime(options = {}) {
|
| 46 |
+
let {
|
| 47 |
+
date = new Date(),
|
| 48 |
+
local = true,
|
| 49 |
+
showTimeZone = false,
|
| 50 |
+
showMilliseconds = false
|
| 51 |
+
} = options;
|
| 52 |
+
|
| 53 |
+
if (local) {
|
| 54 |
+
// Offset the date so it will return the correct value when getting the ISO string.
|
| 55 |
+
date = new Date(date.getTime() - (date.getTimezoneOffset() * 60000));
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
let end = '';
|
| 59 |
+
|
| 60 |
+
if (showTimeZone) {
|
| 61 |
+
end = ' UTC' + (local ? timeZone(date) : '');
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
if (showMilliseconds && date.getUTCMilliseconds() > 0) {
|
| 65 |
+
end = ` ${date.getUTCMilliseconds()}ms${end}`;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
return date
|
| 69 |
+
.toISOString()
|
| 70 |
+
.replace(/T/, ' ')
|
| 71 |
+
.replace(/\..+/, end);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
/**
|
| 75 |
+
* This is not the set of all possible signals.
|
| 76 |
+
*
|
| 77 |
+
* It IS, however, the set of all signals that trigger
|
| 78 |
+
* an exit on either Linux or BSD systems. Linux is a
|
| 79 |
+
* superset of the signal names supported on BSD, and
|
| 80 |
+
* the unknown signals just fail to register, so we can
|
| 81 |
+
* catch that easily enough.
|
| 82 |
+
*
|
| 83 |
+
* Windows signals are a different set, since there are
|
| 84 |
+
* signals that terminate Windows processes, but don't
|
| 85 |
+
* terminate (or don't even exist) on Posix systems.
|
| 86 |
+
*
|
| 87 |
+
* Don't bother with SIGKILL. It's uncatchable, which
|
| 88 |
+
* means that we can't fire any callbacks anyway.
|
| 89 |
+
*
|
| 90 |
+
* If a user does happen to register a handler on a non-
|
| 91 |
+
* fatal signal like SIGWINCH or something, and then
|
| 92 |
+
* exit, it'll end up firing `process.emit('exit')`, so
|
| 93 |
+
* the handler will be fired anyway.
|
| 94 |
+
*
|
| 95 |
+
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
|
| 96 |
+
* artificially, inherently leave the process in a
|
| 97 |
+
* state from which it is not safe to try and enter JS
|
| 98 |
+
* listeners.
|
| 99 |
+
*/
|
| 100 |
+
const signals = [];
|
| 101 |
+
signals.push('SIGHUP', 'SIGINT', 'SIGTERM');
|
| 102 |
+
if (process.platform !== 'win32') {
|
| 103 |
+
signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'
|
| 104 |
+
// should detect profiler and enable/disable accordingly.
|
| 105 |
+
// see #21
|
| 106 |
+
// 'SIGPROF'
|
| 107 |
+
);
|
| 108 |
+
}
|
| 109 |
+
if (process.platform === 'linux') {
|
| 110 |
+
signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
// Note: since nyc uses this module to output coverage, any lines
|
| 114 |
+
// that are in the direct sync flow of nyc's outputCoverage are
|
| 115 |
+
// ignored, since we can never get coverage for them.
|
| 116 |
+
// grab a reference to node's real process object right away
|
| 117 |
+
const processOk = (process) => !!process &&
|
| 118 |
+
typeof process === 'object' &&
|
| 119 |
+
typeof process.removeListener === 'function' &&
|
| 120 |
+
typeof process.emit === 'function' &&
|
| 121 |
+
typeof process.reallyExit === 'function' &&
|
| 122 |
+
typeof process.listeners === 'function' &&
|
| 123 |
+
typeof process.kill === 'function' &&
|
| 124 |
+
typeof process.pid === 'number' &&
|
| 125 |
+
typeof process.on === 'function';
|
| 126 |
+
const kExitEmitter = Symbol.for('signal-exit emitter');
|
| 127 |
+
const global = globalThis;
|
| 128 |
+
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
| 129 |
+
// teeny special purpose ee
|
| 130 |
+
class Emitter {
|
| 131 |
+
emitted = {
|
| 132 |
+
afterExit: false,
|
| 133 |
+
exit: false,
|
| 134 |
+
};
|
| 135 |
+
listeners = {
|
| 136 |
+
afterExit: [],
|
| 137 |
+
exit: [],
|
| 138 |
+
};
|
| 139 |
+
count = 0;
|
| 140 |
+
id = Math.random();
|
| 141 |
+
constructor() {
|
| 142 |
+
if (global[kExitEmitter]) {
|
| 143 |
+
return global[kExitEmitter];
|
| 144 |
+
}
|
| 145 |
+
ObjectDefineProperty(global, kExitEmitter, {
|
| 146 |
+
value: this,
|
| 147 |
+
writable: false,
|
| 148 |
+
enumerable: false,
|
| 149 |
+
configurable: false,
|
| 150 |
+
});
|
| 151 |
+
}
|
| 152 |
+
on(ev, fn) {
|
| 153 |
+
this.listeners[ev].push(fn);
|
| 154 |
+
}
|
| 155 |
+
removeListener(ev, fn) {
|
| 156 |
+
const list = this.listeners[ev];
|
| 157 |
+
const i = list.indexOf(fn);
|
| 158 |
+
/* c8 ignore start */
|
| 159 |
+
if (i === -1) {
|
| 160 |
+
return;
|
| 161 |
+
}
|
| 162 |
+
/* c8 ignore stop */
|
| 163 |
+
if (i === 0 && list.length === 1) {
|
| 164 |
+
list.length = 0;
|
| 165 |
+
}
|
| 166 |
+
else {
|
| 167 |
+
list.splice(i, 1);
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
emit(ev, code, signal) {
|
| 171 |
+
if (this.emitted[ev]) {
|
| 172 |
+
return false;
|
| 173 |
+
}
|
| 174 |
+
this.emitted[ev] = true;
|
| 175 |
+
let ret = false;
|
| 176 |
+
for (const fn of this.listeners[ev]) {
|
| 177 |
+
ret = fn(code, signal) === true || ret;
|
| 178 |
+
}
|
| 179 |
+
if (ev === 'exit') {
|
| 180 |
+
ret = this.emit('afterExit', code, signal) || ret;
|
| 181 |
+
}
|
| 182 |
+
return ret;
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
+
class SignalExitBase {
|
| 186 |
+
}
|
| 187 |
+
const signalExitWrap = (handler) => {
|
| 188 |
+
return {
|
| 189 |
+
onExit(cb, opts) {
|
| 190 |
+
return handler.onExit(cb, opts);
|
| 191 |
+
},
|
| 192 |
+
load() {
|
| 193 |
+
return handler.load();
|
| 194 |
+
},
|
| 195 |
+
unload() {
|
| 196 |
+
return handler.unload();
|
| 197 |
+
},
|
| 198 |
+
};
|
| 199 |
+
};
|
| 200 |
+
class SignalExitFallback extends SignalExitBase {
|
| 201 |
+
onExit() {
|
| 202 |
+
return () => { };
|
| 203 |
+
}
|
| 204 |
+
load() { }
|
| 205 |
+
unload() { }
|
| 206 |
+
}
|
| 207 |
+
class SignalExit extends SignalExitBase {
|
| 208 |
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
| 209 |
+
// so use a supported signal instead
|
| 210 |
+
/* c8 ignore start */
|
| 211 |
+
#hupSig = process$1.platform === 'win32' ? 'SIGINT' : 'SIGHUP';
|
| 212 |
+
/* c8 ignore stop */
|
| 213 |
+
#emitter = new Emitter();
|
| 214 |
+
#process;
|
| 215 |
+
#originalProcessEmit;
|
| 216 |
+
#originalProcessReallyExit;
|
| 217 |
+
#sigListeners = {};
|
| 218 |
+
#loaded = false;
|
| 219 |
+
constructor(process) {
|
| 220 |
+
super();
|
| 221 |
+
this.#process = process;
|
| 222 |
+
// { <signal>: <listener fn>, ... }
|
| 223 |
+
this.#sigListeners = {};
|
| 224 |
+
for (const sig of signals) {
|
| 225 |
+
this.#sigListeners[sig] = () => {
|
| 226 |
+
// If there are no other listeners, an exit is coming!
|
| 227 |
+
// Simplest way: remove us and then re-send the signal.
|
| 228 |
+
// We know that this will kill the process, so we can
|
| 229 |
+
// safely emit now.
|
| 230 |
+
const listeners = this.#process.listeners(sig);
|
| 231 |
+
let { count } = this.#emitter;
|
| 232 |
+
// This is a workaround for the fact that signal-exit v3 and signal
|
| 233 |
+
// exit v4 are not aware of each other, and each will attempt to let
|
| 234 |
+
// the other handle it, so neither of them do. To correct this, we
|
| 235 |
+
// detect if we're the only handler *except* for previous versions
|
| 236 |
+
// of signal-exit, and increment by the count of listeners it has
|
| 237 |
+
// created.
|
| 238 |
+
/* c8 ignore start */
|
| 239 |
+
const p = process;
|
| 240 |
+
if (typeof p.__signal_exit_emitter__ === 'object' &&
|
| 241 |
+
typeof p.__signal_exit_emitter__.count === 'number') {
|
| 242 |
+
count += p.__signal_exit_emitter__.count;
|
| 243 |
+
}
|
| 244 |
+
/* c8 ignore stop */
|
| 245 |
+
if (listeners.length === count) {
|
| 246 |
+
this.unload();
|
| 247 |
+
const ret = this.#emitter.emit('exit', null, sig);
|
| 248 |
+
/* c8 ignore start */
|
| 249 |
+
const s = sig === 'SIGHUP' ? this.#hupSig : sig;
|
| 250 |
+
if (!ret)
|
| 251 |
+
process.kill(process.pid, s);
|
| 252 |
+
/* c8 ignore stop */
|
| 253 |
+
}
|
| 254 |
+
};
|
| 255 |
+
}
|
| 256 |
+
this.#originalProcessReallyExit = process.reallyExit;
|
| 257 |
+
this.#originalProcessEmit = process.emit;
|
| 258 |
+
}
|
| 259 |
+
onExit(cb, opts) {
|
| 260 |
+
/* c8 ignore start */
|
| 261 |
+
if (!processOk(this.#process)) {
|
| 262 |
+
return () => { };
|
| 263 |
+
}
|
| 264 |
+
/* c8 ignore stop */
|
| 265 |
+
if (this.#loaded === false) {
|
| 266 |
+
this.load();
|
| 267 |
+
}
|
| 268 |
+
const ev = opts?.alwaysLast ? 'afterExit' : 'exit';
|
| 269 |
+
this.#emitter.on(ev, cb);
|
| 270 |
+
return () => {
|
| 271 |
+
this.#emitter.removeListener(ev, cb);
|
| 272 |
+
if (this.#emitter.listeners['exit'].length === 0 &&
|
| 273 |
+
this.#emitter.listeners['afterExit'].length === 0) {
|
| 274 |
+
this.unload();
|
| 275 |
+
}
|
| 276 |
+
};
|
| 277 |
+
}
|
| 278 |
+
load() {
|
| 279 |
+
if (this.#loaded) {
|
| 280 |
+
return;
|
| 281 |
+
}
|
| 282 |
+
this.#loaded = true;
|
| 283 |
+
// This is the number of onSignalExit's that are in play.
|
| 284 |
+
// It's important so that we can count the correct number of
|
| 285 |
+
// listeners on signals, and don't wait for the other one to
|
| 286 |
+
// handle it instead of us.
|
| 287 |
+
this.#emitter.count += 1;
|
| 288 |
+
for (const sig of signals) {
|
| 289 |
+
try {
|
| 290 |
+
const fn = this.#sigListeners[sig];
|
| 291 |
+
if (fn)
|
| 292 |
+
this.#process.on(sig, fn);
|
| 293 |
+
}
|
| 294 |
+
catch (_) { }
|
| 295 |
+
}
|
| 296 |
+
this.#process.emit = (ev, ...a) => {
|
| 297 |
+
return this.#processEmit(ev, ...a);
|
| 298 |
+
};
|
| 299 |
+
this.#process.reallyExit = (code) => {
|
| 300 |
+
return this.#processReallyExit(code);
|
| 301 |
+
};
|
| 302 |
+
}
|
| 303 |
+
unload() {
|
| 304 |
+
if (!this.#loaded) {
|
| 305 |
+
return;
|
| 306 |
+
}
|
| 307 |
+
this.#loaded = false;
|
| 308 |
+
signals.forEach(sig => {
|
| 309 |
+
const listener = this.#sigListeners[sig];
|
| 310 |
+
/* c8 ignore start */
|
| 311 |
+
if (!listener) {
|
| 312 |
+
throw new Error('Listener not defined for signal: ' + sig);
|
| 313 |
+
}
|
| 314 |
+
/* c8 ignore stop */
|
| 315 |
+
try {
|
| 316 |
+
this.#process.removeListener(sig, listener);
|
| 317 |
+
/* c8 ignore start */
|
| 318 |
+
}
|
| 319 |
+
catch (_) { }
|
| 320 |
+
/* c8 ignore stop */
|
| 321 |
+
});
|
| 322 |
+
this.#process.emit = this.#originalProcessEmit;
|
| 323 |
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
| 324 |
+
this.#emitter.count -= 1;
|
| 325 |
+
}
|
| 326 |
+
#processReallyExit(code) {
|
| 327 |
+
/* c8 ignore start */
|
| 328 |
+
if (!processOk(this.#process)) {
|
| 329 |
+
return 0;
|
| 330 |
+
}
|
| 331 |
+
this.#process.exitCode = code || 0;
|
| 332 |
+
/* c8 ignore stop */
|
| 333 |
+
this.#emitter.emit('exit', this.#process.exitCode, null);
|
| 334 |
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
| 335 |
+
}
|
| 336 |
+
#processEmit(ev, ...args) {
|
| 337 |
+
const og = this.#originalProcessEmit;
|
| 338 |
+
if (ev === 'exit' && processOk(this.#process)) {
|
| 339 |
+
if (typeof args[0] === 'number') {
|
| 340 |
+
this.#process.exitCode = args[0];
|
| 341 |
+
/* c8 ignore start */
|
| 342 |
+
}
|
| 343 |
+
/* c8 ignore start */
|
| 344 |
+
const ret = og.call(this.#process, ev, ...args);
|
| 345 |
+
/* c8 ignore start */
|
| 346 |
+
this.#emitter.emit('exit', this.#process.exitCode, null);
|
| 347 |
+
/* c8 ignore stop */
|
| 348 |
+
return ret;
|
| 349 |
+
}
|
| 350 |
+
else {
|
| 351 |
+
return og.call(this.#process, ev, ...args);
|
| 352 |
+
}
|
| 353 |
+
}
|
| 354 |
+
}
|
| 355 |
+
const process$1 = globalThis.process;
|
| 356 |
+
// wrap so that we call the method on the actual handler, without
|
| 357 |
+
// exporting it directly.
|
| 358 |
+
const {
|
| 359 |
+
/**
|
| 360 |
+
* Called when the process is exiting, whether via signal, explicit
|
| 361 |
+
* exit, or running out of stuff to do.
|
| 362 |
+
*
|
| 363 |
+
* If the global process object is not suitable for instrumentation,
|
| 364 |
+
* then this will be a no-op.
|
| 365 |
+
*
|
| 366 |
+
* Returns a function that may be used to unload signal-exit.
|
| 367 |
+
*/
|
| 368 |
+
onExit} = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
|
| 369 |
+
|
| 370 |
+
const CLEAR_SCREEN = '\u001Bc';
|
| 371 |
+
function getResetScreen(configs, allowClearScreen) {
|
| 372 |
+
let clearScreen = allowClearScreen;
|
| 373 |
+
for (const config of configs) {
|
| 374 |
+
if (config.watch && config.watch.clearScreen === false) {
|
| 375 |
+
clearScreen = false;
|
| 376 |
+
}
|
| 377 |
+
}
|
| 378 |
+
if (clearScreen) {
|
| 379 |
+
return (heading) => rollup.stderr(CLEAR_SCREEN + heading);
|
| 380 |
+
}
|
| 381 |
+
let firstRun = true;
|
| 382 |
+
return (heading) => {
|
| 383 |
+
if (firstRun) {
|
| 384 |
+
rollup.stderr(heading);
|
| 385 |
+
firstRun = false;
|
| 386 |
+
}
|
| 387 |
+
};
|
| 388 |
+
}
|
| 389 |
+
|
| 390 |
+
function extractWatchHooks(command) {
|
| 391 |
+
if (!Array.isArray(command.watch))
|
| 392 |
+
return {};
|
| 393 |
+
return command.watch
|
| 394 |
+
.filter(value => typeof value === 'object')
|
| 395 |
+
.reduce((accumulator, keyValueOption) => ({ ...accumulator, ...keyValueOption }), {});
|
| 396 |
+
}
|
| 397 |
+
function createWatchHooks(command) {
|
| 398 |
+
const watchHooks = extractWatchHooks(command);
|
| 399 |
+
return function (hook) {
|
| 400 |
+
if (watchHooks[hook]) {
|
| 401 |
+
const cmd = watchHooks[hook];
|
| 402 |
+
if (!command.silent) {
|
| 403 |
+
rollup.stderr(rollup.cyan(`watch.${hook} ${rollup.bold(`$ ${cmd}`)}`));
|
| 404 |
+
}
|
| 405 |
+
try {
|
| 406 |
+
// !! important - use stderr for all writes from execSync
|
| 407 |
+
const stdio = [process.stdin, process.stderr, process.stderr];
|
| 408 |
+
node_child_process.execSync(cmd, { stdio: command.silent ? 'ignore' : stdio });
|
| 409 |
+
}
|
| 410 |
+
catch (error) {
|
| 411 |
+
rollup.stderr(error.message);
|
| 412 |
+
}
|
| 413 |
+
}
|
| 414 |
+
};
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
async function watch(command) {
|
| 418 |
+
process$2.env.ROLLUP_WATCH = 'true';
|
| 419 |
+
const isTTY = process$2.stderr.isTTY;
|
| 420 |
+
const silent = command.silent;
|
| 421 |
+
let watcher;
|
| 422 |
+
let configWatcher;
|
| 423 |
+
let resetScreen;
|
| 424 |
+
const configFile = command.config ? await cli.getConfigPath(command.config) : null;
|
| 425 |
+
const runWatchHook = createWatchHooks(command);
|
| 426 |
+
onExit(close);
|
| 427 |
+
process$2.on('uncaughtException', closeWithError);
|
| 428 |
+
async function loadConfigFromFileAndTrack(configFile) {
|
| 429 |
+
let configFileData = null;
|
| 430 |
+
let configFileRevision = 0;
|
| 431 |
+
configWatcher = index.chokidar.watch(configFile).on('change', reloadConfigFile);
|
| 432 |
+
await reloadConfigFile();
|
| 433 |
+
async function reloadConfigFile() {
|
| 434 |
+
try {
|
| 435 |
+
const newConfigFileData = await promises.readFile(configFile, 'utf8');
|
| 436 |
+
if (newConfigFileData === configFileData) {
|
| 437 |
+
return;
|
| 438 |
+
}
|
| 439 |
+
configFileRevision++;
|
| 440 |
+
const currentConfigFileRevision = configFileRevision;
|
| 441 |
+
if (configFileData) {
|
| 442 |
+
rollup.stderr(`\nReloading updated config...`);
|
| 443 |
+
}
|
| 444 |
+
configFileData = newConfigFileData;
|
| 445 |
+
const { options, warnings } = await loadConfigFile_js.loadConfigFile(configFile, command, true);
|
| 446 |
+
if (currentConfigFileRevision !== configFileRevision) {
|
| 447 |
+
return;
|
| 448 |
+
}
|
| 449 |
+
if (watcher) {
|
| 450 |
+
await watcher.close();
|
| 451 |
+
}
|
| 452 |
+
start(options, warnings);
|
| 453 |
+
}
|
| 454 |
+
catch (error) {
|
| 455 |
+
rollup.handleError(error, true);
|
| 456 |
+
}
|
| 457 |
+
}
|
| 458 |
+
}
|
| 459 |
+
if (configFile) {
|
| 460 |
+
await loadConfigFromFileAndTrack(configFile);
|
| 461 |
+
}
|
| 462 |
+
else {
|
| 463 |
+
const { options, warnings } = await cli.loadConfigFromCommand(command, true);
|
| 464 |
+
await start(options, warnings);
|
| 465 |
+
}
|
| 466 |
+
async function start(configs, warnings) {
|
| 467 |
+
watcher = rollup_js.watch(configs);
|
| 468 |
+
watcher.on('event', event => {
|
| 469 |
+
switch (event.code) {
|
| 470 |
+
case 'ERROR': {
|
| 471 |
+
warnings.flush();
|
| 472 |
+
rollup.handleError(event.error, true);
|
| 473 |
+
runWatchHook('onError');
|
| 474 |
+
break;
|
| 475 |
+
}
|
| 476 |
+
case 'START': {
|
| 477 |
+
if (!silent) {
|
| 478 |
+
if (!resetScreen) {
|
| 479 |
+
resetScreen = getResetScreen(configs, isTTY);
|
| 480 |
+
}
|
| 481 |
+
resetScreen(rollup.underline(`rollup v${rollup.version}`));
|
| 482 |
+
}
|
| 483 |
+
runWatchHook('onStart');
|
| 484 |
+
break;
|
| 485 |
+
}
|
| 486 |
+
case 'BUNDLE_START': {
|
| 487 |
+
if (!silent) {
|
| 488 |
+
let input = event.input;
|
| 489 |
+
if (typeof input !== 'string') {
|
| 490 |
+
input = Array.isArray(input)
|
| 491 |
+
? input.join(', ')
|
| 492 |
+
: Object.values(input).join(', ');
|
| 493 |
+
}
|
| 494 |
+
rollup.stderr(rollup.cyan(`bundles ${rollup.bold(input)} → ${rollup.bold(event.output.map(parseAst_js.relativeId).join(', '))}...`));
|
| 495 |
+
}
|
| 496 |
+
runWatchHook('onBundleStart');
|
| 497 |
+
break;
|
| 498 |
+
}
|
| 499 |
+
case 'BUNDLE_END': {
|
| 500 |
+
warnings.flush();
|
| 501 |
+
if (!silent)
|
| 502 |
+
rollup.stderr(rollup.green(`created ${rollup.bold(event.output.map(parseAst_js.relativeId).join(', '))} in ${rollup.bold(cli.prettyMilliseconds(event.duration))}`));
|
| 503 |
+
runWatchHook('onBundleEnd');
|
| 504 |
+
if (event.result && event.result.getTimings) {
|
| 505 |
+
cli.printTimings(event.result.getTimings());
|
| 506 |
+
}
|
| 507 |
+
break;
|
| 508 |
+
}
|
| 509 |
+
case 'END': {
|
| 510 |
+
runWatchHook('onEnd');
|
| 511 |
+
if (!silent) {
|
| 512 |
+
rollup.stderr(`\n[${dateTime()}] waiting for changes...`);
|
| 513 |
+
}
|
| 514 |
+
}
|
| 515 |
+
}
|
| 516 |
+
if ('result' in event && event.result) {
|
| 517 |
+
event.result.close().catch(error => rollup.handleError(error, true));
|
| 518 |
+
}
|
| 519 |
+
});
|
| 520 |
+
}
|
| 521 |
+
function close(code) {
|
| 522 |
+
process$2.removeListener('uncaughtException', closeWithError);
|
| 523 |
+
// removing a non-existent listener is a no-op
|
| 524 |
+
process$2.stdin.removeListener('end', close);
|
| 525 |
+
if (configWatcher)
|
| 526 |
+
configWatcher.close();
|
| 527 |
+
Promise.resolve(watcher?.close()).finally(() => {
|
| 528 |
+
process$2.exit(typeof code === 'number' ? code : 0);
|
| 529 |
+
});
|
| 530 |
+
// Tell signal-exit that we are handling this gracefully
|
| 531 |
+
return true;
|
| 532 |
+
}
|
| 533 |
+
// return a promise that never resolves to keep the process running
|
| 534 |
+
return new Promise(() => { });
|
| 535 |
+
}
|
| 536 |
+
function closeWithError(error) {
|
| 537 |
+
error.name = `Uncaught ${error.name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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
@license
|
| 3 |
+
Rollup.js v4.57.1
|
| 4 |
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
| 5 |
+
|
| 6 |
+
https://github.com/rollup/rollup
|
| 7 |
+
|
| 8 |
+
Released under the MIT License.
|
| 9 |
+
*/
|
| 10 |
+
'use strict';
|
| 11 |
+
|
| 12 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 13 |
+
|
| 14 |
+
const rollup = require('./rollup.js');
|
| 15 |
+
const path = require('node:path');
|
| 16 |
+
const process = require('node:process');
|
| 17 |
+
const index = require('./index.js');
|
| 18 |
+
const node_os = require('node:os');
|
| 19 |
+
require('./parseAst.js');
|
| 20 |
+
require('../native.js');
|
| 21 |
+
require('path');
|
| 22 |
+
require('node:perf_hooks');
|
| 23 |
+
require('node:fs/promises');
|
| 24 |
+
require('fs');
|
| 25 |
+
require('util');
|
| 26 |
+
require('stream');
|
| 27 |
+
require('os');
|
| 28 |
+
require('./fsevents-importer.js');
|
| 29 |
+
require('events');
|
| 30 |
+
|
| 31 |
+
class FileWatcher {
|
| 32 |
+
constructor(task, chokidarOptions) {
|
| 33 |
+
this.transformWatchers = new Map();
|
| 34 |
+
this.chokidarOptions = chokidarOptions;
|
| 35 |
+
this.task = task;
|
| 36 |
+
this.watcher = this.createWatcher(null);
|
| 37 |
+
}
|
| 38 |
+
close() {
|
| 39 |
+
this.watcher.close();
|
| 40 |
+
for (const watcher of this.transformWatchers.values()) {
|
| 41 |
+
watcher.close();
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
unwatch(id) {
|
| 45 |
+
this.watcher.unwatch(id);
|
| 46 |
+
const transformWatcher = this.transformWatchers.get(id);
|
| 47 |
+
if (transformWatcher) {
|
| 48 |
+
this.transformWatchers.delete(id);
|
| 49 |
+
transformWatcher.close();
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
watch(id, isTransformDependency) {
|
| 53 |
+
if (isTransformDependency) {
|
| 54 |
+
const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id);
|
| 55 |
+
watcher.add(id);
|
| 56 |
+
this.transformWatchers.set(id, watcher);
|
| 57 |
+
}
|
| 58 |
+
else {
|
| 59 |
+
this.watcher.add(id);
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
createWatcher(transformWatcherId) {
|
| 63 |
+
const task = this.task;
|
| 64 |
+
const isLinux = node_os.platform() === 'linux';
|
| 65 |
+
const isFreeBSD = node_os.platform() === 'freebsd';
|
| 66 |
+
const isTransformDependency = transformWatcherId !== null;
|
| 67 |
+
const handleChange = (id, event) => {
|
| 68 |
+
const changedId = transformWatcherId || id;
|
| 69 |
+
if (isLinux || isFreeBSD) {
|
| 70 |
+
// unwatching and watching fixes an issue with chokidar where on certain systems,
|
| 71 |
+
// a file that was unlinked and immediately recreated would create a change event
|
| 72 |
+
// but then no longer any further events
|
| 73 |
+
watcher.unwatch(changedId);
|
| 74 |
+
watcher.add(changedId);
|
| 75 |
+
}
|
| 76 |
+
task.invalidate(changedId, { event, isTransformDependency });
|
| 77 |
+
};
|
| 78 |
+
const watcher = index.chokidar
|
| 79 |
+
.watch([], this.chokidarOptions)
|
| 80 |
+
.on('add', id => handleChange(id, 'create'))
|
| 81 |
+
.on('change', id => handleChange(id, 'update'))
|
| 82 |
+
.on('unlink', id => handleChange(id, 'delete'));
|
| 83 |
+
return watcher;
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
const eventsRewrites = {
|
| 88 |
+
create: {
|
| 89 |
+
create: 'buggy',
|
| 90 |
+
delete: null, //delete file from map
|
| 91 |
+
update: 'create'
|
| 92 |
+
},
|
| 93 |
+
delete: {
|
| 94 |
+
create: 'update',
|
| 95 |
+
delete: 'buggy',
|
| 96 |
+
update: 'buggy'
|
| 97 |
+
},
|
| 98 |
+
update: {
|
| 99 |
+
create: 'buggy',
|
| 100 |
+
delete: 'delete',
|
| 101 |
+
update: 'update'
|
| 102 |
+
}
|
| 103 |
+
};
|
| 104 |
+
class Watcher {
|
| 105 |
+
constructor(optionsList, emitter) {
|
| 106 |
+
this.buildDelay = 0;
|
| 107 |
+
this.buildTimeout = null;
|
| 108 |
+
this.closed = false;
|
| 109 |
+
this.invalidatedIds = new Map();
|
| 110 |
+
this.rerun = false;
|
| 111 |
+
this.running = true;
|
| 112 |
+
this.emitter = emitter;
|
| 113 |
+
emitter.close = this.close.bind(this);
|
| 114 |
+
this.tasks = optionsList.map(options => new Task(this, options));
|
| 115 |
+
for (const { watch } of optionsList) {
|
| 116 |
+
if (watch && typeof watch.buildDelay === 'number') {
|
| 117 |
+
this.buildDelay = Math.max(this.buildDelay, watch.buildDelay);
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
process.nextTick(() => this.run());
|
| 121 |
+
}
|
| 122 |
+
async close() {
|
| 123 |
+
if (this.closed)
|
| 124 |
+
return;
|
| 125 |
+
this.closed = true;
|
| 126 |
+
if (this.buildTimeout)
|
| 127 |
+
clearTimeout(this.buildTimeout);
|
| 128 |
+
for (const task of this.tasks) {
|
| 129 |
+
task.close();
|
| 130 |
+
}
|
| 131 |
+
await this.emitter.emit('close');
|
| 132 |
+
this.emitter.removeAllListeners();
|
| 133 |
+
}
|
| 134 |
+
invalidate(file) {
|
| 135 |
+
if (file) {
|
| 136 |
+
const previousEvent = this.invalidatedIds.get(file.id);
|
| 137 |
+
const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event;
|
| 138 |
+
if (event === 'buggy') {
|
| 139 |
+
//TODO: throws or warn? Currently just ignore, uses new event
|
| 140 |
+
this.invalidatedIds.set(file.id, file.event);
|
| 141 |
+
}
|
| 142 |
+
else if (event === null) {
|
| 143 |
+
this.invalidatedIds.delete(file.id);
|
| 144 |
+
}
|
| 145 |
+
else {
|
| 146 |
+
this.invalidatedIds.set(file.id, event);
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
if (this.running) {
|
| 150 |
+
this.rerun = true;
|
| 151 |
+
return;
|
| 152 |
+
}
|
| 153 |
+
if (this.buildTimeout)
|
| 154 |
+
clearTimeout(this.buildTimeout);
|
| 155 |
+
this.buildTimeout = setTimeout(async () => {
|
| 156 |
+
this.buildTimeout = null;
|
| 157 |
+
try {
|
| 158 |
+
await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })));
|
| 159 |
+
this.invalidatedIds.clear();
|
| 160 |
+
await this.emitter.emit('restart');
|
| 161 |
+
this.emitter.removeListenersForCurrentRun();
|
| 162 |
+
this.run();
|
| 163 |
+
}
|
| 164 |
+
catch (error) {
|
| 165 |
+
this.invalidatedIds.clear();
|
| 166 |
+
await this.emitter.emit('event', {
|
| 167 |
+
code: 'ERROR',
|
| 168 |
+
error,
|
| 169 |
+
result: null
|
| 170 |
+
});
|
| 171 |
+
await this.emitter.emit('event', {
|
| 172 |
+
code: 'END'
|
| 173 |
+
});
|
| 174 |
+
}
|
| 175 |
+
}, this.buildDelay);
|
| 176 |
+
}
|
| 177 |
+
async run() {
|
| 178 |
+
this.running = true;
|
| 179 |
+
await this.emitter.emit('event', {
|
| 180 |
+
code: 'START'
|
| 181 |
+
});
|
| 182 |
+
for (const task of this.tasks) {
|
| 183 |
+
await task.run();
|
| 184 |
+
}
|
| 185 |
+
this.running = false;
|
| 186 |
+
await this.emitter.emit('event', {
|
| 187 |
+
code: 'END'
|
| 188 |
+
});
|
| 189 |
+
if (this.rerun) {
|
| 190 |
+
this.rerun = false;
|
| 191 |
+
this.invalidate();
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
class Task {
|
| 196 |
+
constructor(watcher, options) {
|
| 197 |
+
this.cache = { modules: [] };
|
| 198 |
+
this.watchFiles = [];
|
| 199 |
+
this.closed = false;
|
| 200 |
+
this.invalidated = true;
|
| 201 |
+
this.watched = new Set();
|
| 202 |
+
this.watcher = watcher;
|
| 203 |
+
this.options = options;
|
| 204 |
+
this.skipWrite = Boolean(options.watch && options.watch.skipWrite);
|
| 205 |
+
this.outputs = this.options.output;
|
| 206 |
+
this.outputFiles = this.outputs.map(output => {
|
| 207 |
+
if (output.file || output.dir)
|
| 208 |
+
return path.resolve(output.file || output.dir);
|
| 209 |
+
return undefined;
|
| 210 |
+
});
|
| 211 |
+
this.watchOptions = this.options.watch || {};
|
| 212 |
+
this.filter = rollup.createFilter(this.watchOptions.include, this.watchOptions.exclude);
|
| 213 |
+
this.fileWatcher = new FileWatcher(this, {
|
| 214 |
+
...this.watchOptions.chokidar,
|
| 215 |
+
disableGlobbing: true,
|
| 216 |
+
ignoreInitial: true
|
| 217 |
+
});
|
| 218 |
+
}
|
| 219 |
+
close() {
|
| 220 |
+
this.closed = true;
|
| 221 |
+
this.fileWatcher.close();
|
| 222 |
+
}
|
| 223 |
+
invalidate(id, details) {
|
| 224 |
+
this.invalidated = true;
|
| 225 |
+
if (details.isTransformDependency) {
|
| 226 |
+
for (const module of this.cache.modules) {
|
| 227 |
+
if (!module.transformDependencies.includes(id))
|
| 228 |
+
continue;
|
| 229 |
+
// effective invalidation
|
| 230 |
+
module.originalCode = null;
|
| 231 |
+
}
|
| 232 |
+
}
|
| 233 |
+
this.watcher.invalidate({ event: details.event, id });
|
| 234 |
+
this.watchOptions.onInvalidate?.(id);
|
| 235 |
+
}
|
| 236 |
+
async run() {
|
| 237 |
+
if (!this.invalidated)
|
| 238 |
+
return;
|
| 239 |
+
this.invalidated = false;
|
| 240 |
+
const options = {
|
| 241 |
+
...this.options,
|
| 242 |
+
cache: this.cache
|
| 243 |
+
};
|
| 244 |
+
const start = Date.now();
|
| 245 |
+
await this.watcher.emitter.emit('event', {
|
| 246 |
+
code: 'BUNDLE_START',
|
| 247 |
+
input: this.options.input,
|
| 248 |
+
output: this.outputFiles
|
| 249 |
+
});
|
| 250 |
+
let result = null;
|
| 251 |
+
try {
|
| 252 |
+
result = await rollup.rollupInternal(options, this.watcher.emitter);
|
| 253 |
+
if (this.closed) {
|
| 254 |
+
return;
|
| 255 |
+
}
|
| 256 |
+
this.updateWatchedFiles(result);
|
| 257 |
+
if (!this.skipWrite) {
|
| 258 |
+
await Promise.all(this.outputs.map(output => result.write(output)));
|
| 259 |
+
if (this.closed) {
|
| 260 |
+
return;
|
| 261 |
+
}
|
| 262 |
+
this.updateWatchedFiles(result);
|
| 263 |
+
}
|
| 264 |
+
await this.watcher.emitter.emit('event', {
|
| 265 |
+
code: 'BUNDLE_END',
|
| 266 |
+
duration: Date.now() - start,
|
| 267 |
+
input: this.options.input,
|
| 268 |
+
output: this.outputFiles,
|
| 269 |
+
result
|
| 270 |
+
});
|
| 271 |
+
}
|
| 272 |
+
catch (error) {
|
| 273 |
+
if (!this.closed) {
|
| 274 |
+
if (Array.isArray(error.watchFiles)) {
|
| 275 |
+
for (const id of error.watchFiles) {
|
| 276 |
+
this.watchFile(id);
|
| 277 |
+
}
|
| 278 |
+
}
|
| 279 |
+
if (error.id) {
|
| 280 |
+
this.cache.modules = this.cache.modules.filter(module => module.id !== error.id);
|
| 281 |
+
}
|
| 282 |
+
}
|
| 283 |
+
await this.watcher.emitter.emit('event', {
|
| 284 |
+
code: 'ERROR',
|
| 285 |
+
error,
|
| 286 |
+
result
|
| 287 |
+
});
|
| 288 |
+
}
|
| 289 |
+
}
|
| 290 |
+
updateWatchedFiles(result) {
|
| 291 |
+
const previouslyWatched = this.watched;
|
| 292 |
+
this.watched = new Set();
|
| 293 |
+
this.watchFiles = result.watchFiles;
|
| 294 |
+
this.cache = result.cache;
|
| 295 |
+
for (const id of this.watchFiles) {
|
| 296 |
+
this.watchFile(id);
|
| 297 |
+
}
|
| 298 |
+
for (const module of this.cache.modules) {
|
| 299 |
+
for (const depId of module.transformDependencies) {
|
| 300 |
+
this.watchFile(depId, true);
|
| 301 |
+
}
|
| 302 |
+
}
|
| 303 |
+
for (const id of previouslyWatched) {
|
| 304 |
+
if (!this.watched.has(id)) {
|
| 305 |
+
this.fileWatcher.unwatch(id);
|
| 306 |
+
}
|
| 307 |
+
}
|
| 308 |
+
}
|
| 309 |
+
watchFile(id, isTransformDependency = false) {
|
| 310 |
+
if (!this.filter(id))
|
| 311 |
+
return;
|
| 312 |
+
this.watched.add(id);
|
| 313 |
+
if (this.outputFiles.includes(id)) {
|
| 314 |
+
throw new Error('Cannot import the generated bundle');
|
| 315 |
+
}
|
| 316 |
+
// this is necessary to ensure that any 'renamed' files
|
| 317 |
+
// continue to be watched following an error
|
| 318 |
+
this.fileWatcher.watch(id, isTransformDependency);
|
| 319 |
+
}
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
exports.Task = Task;
|
| 323 |
+
exports.Watcher = Watcher;
|
| 324 |
+
//# sourceMappingURL=watch.js.map
|
node_modules/rollup/package.json
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "rollup",
|
| 3 |
+
"version": "4.57.1",
|
| 4 |
+
"description": "Next-generation ES module bundler",
|
| 5 |
+
"main": "dist/rollup.js",
|
| 6 |
+
"module": "dist/es/rollup.js",
|
| 7 |
+
"types": "dist/rollup.d.ts",
|
| 8 |
+
"bin": {
|
| 9 |
+
"rollup": "dist/bin/rollup"
|
| 10 |
+
},
|
| 11 |
+
"napi": {
|
| 12 |
+
"binaryName": "rollup",
|
| 13 |
+
"packageName": "@rollup/rollup",
|
| 14 |
+
"targets": [
|
| 15 |
+
"aarch64-apple-darwin",
|
| 16 |
+
"aarch64-linux-android",
|
| 17 |
+
"aarch64-pc-windows-msvc",
|
| 18 |
+
"aarch64-unknown-freebsd",
|
| 19 |
+
"aarch64-unknown-linux-gnu",
|
| 20 |
+
"aarch64-unknown-linux-musl",
|
| 21 |
+
"armv7-linux-androideabi",
|
| 22 |
+
"armv7-unknown-linux-gnueabihf",
|
| 23 |
+
"armv7-unknown-linux-musleabihf",
|
| 24 |
+
"i686-pc-windows-msvc",
|
| 25 |
+
"loongarch64-unknown-linux-gnu",
|
| 26 |
+
"loongarch64-unknown-linux-musl",
|
| 27 |
+
"riscv64gc-unknown-linux-gnu",
|
| 28 |
+
"riscv64gc-unknown-linux-musl",
|
| 29 |
+
"powerpc64le-unknown-linux-gnu",
|
| 30 |
+
"powerpc64le-unknown-linux-musl",
|
| 31 |
+
"s390x-unknown-linux-gnu",
|
| 32 |
+
"x86_64-apple-darwin",
|
| 33 |
+
"x86_64-pc-windows-gnu",
|
| 34 |
+
"x86_64-pc-windows-msvc",
|
| 35 |
+
"x86_64-unknown-freebsd",
|
| 36 |
+
"x86_64-unknown-linux-gnu",
|
| 37 |
+
"x86_64-unknown-linux-musl",
|
| 38 |
+
"x86_64-unknown-openbsd",
|
| 39 |
+
"aarch64-unknown-linux-ohos"
|
| 40 |
+
]
|
| 41 |
+
},
|
| 42 |
+
"scripts": {
|
| 43 |
+
"build": "concurrently -c green,blue \"npm run build:wasm\" \"npm:build:ast-converters\" && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native",
|
| 44 |
+
"build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native",
|
| 45 |
+
"build:napi": "napi build --cwd rust/bindings_napi --platform --dts ../../native.d.ts --no-js --output-dir ../.. --package-json-path ../../package.json",
|
| 46 |
+
"build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
|
| 47 |
+
"build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore",
|
| 48 |
+
"update:napi": "npm run build:napi && npm run build:copy-native",
|
| 49 |
+
"build:js": "rollup --config rollup.config.ts --configPlugin typescript --forceExit",
|
| 50 |
+
"build:js:node": "rollup --config rollup.config.ts --configPlugin typescript --configIsBuildNode --forceExit",
|
| 51 |
+
"build:prepare": "concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js:node\" && npm run build:copy-native",
|
| 52 |
+
"update:js": "npm run build:js && npm run build:copy-native",
|
| 53 |
+
"build:copy-native": "shx mkdir -p dist && shx cp rollup.*.node dist/",
|
| 54 |
+
"dev": "concurrently -kc green,blue 'nodemon --watch rust -e rs --exec \"npm run build:wasm\"' 'vitepress dev docs'",
|
| 55 |
+
"build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit",
|
| 56 |
+
"build:bootstrap": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --forceExit && shx rm -rf dist-build",
|
| 57 |
+
"build:bootstrap:cjs": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit && shx rm -rf dist-build",
|
| 58 |
+
"build:docs": "vitepress build docs",
|
| 59 |
+
"build:ast-converters": "node scripts/generate-ast-converters.js",
|
| 60 |
+
"preview:docs": "vitepress preview docs",
|
| 61 |
+
"ci:artifacts": "napi artifacts",
|
| 62 |
+
"ci:lint": "concurrently -c red,yellow,green,blue 'npm:lint:js:nofix' 'npm:lint:native-js' 'npm:lint:markdown:nofix' 'npm:lint:rust:nofix'",
|
| 63 |
+
"ci:test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan 'npm:test:only' 'npm:test:typescript' 'npm:test:leak' 'npm:test:browser'",
|
| 64 |
+
"ci:coverage": "NODE_OPTIONS=--no-experimental-require-module nyc --reporter lcovonly mocha",
|
| 65 |
+
"lint": "concurrently -c red,yellow,green,blue 'npm:lint:js' 'npm:lint:native-js' 'npm:lint:markdown' 'npm:lint:rust'",
|
| 66 |
+
"lint:js": "eslint . --fix --cache --concurrency auto",
|
| 67 |
+
"lint:js:nofix": "eslint . --cache --concurrency auto",
|
| 68 |
+
"lint:native-js": "node scripts/lint-native-js.js",
|
| 69 |
+
"lint:markdown": "prettier --write \"**/*.md\"",
|
| 70 |
+
"lint:markdown:nofix": "prettier --check \"**/*.md\"",
|
| 71 |
+
"lint:rust": "cd rust && cargo fmt && cargo clippy --fix --allow-dirty",
|
| 72 |
+
"lint:rust:nofix": "cd rust && cargo fmt --check && cargo clippy",
|
| 73 |
+
"perf": "npm run build:bootstrap:cjs && node --expose-gc scripts/perf-report/index.js",
|
| 74 |
+
"prepare": "husky && npm run prepare:patch && node scripts/check-release.js || npm run build:prepare",
|
| 75 |
+
"prepare:patch": "patch-package",
|
| 76 |
+
"prepublishOnly": "node scripts/check-release.js && node scripts/prepublish.js",
|
| 77 |
+
"postpublish": "node scripts/postpublish.js",
|
| 78 |
+
"prepublish:napi": "napi prepublish --no-gh-release",
|
| 79 |
+
"release": "node scripts/prepare-release.js",
|
| 80 |
+
"release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published",
|
| 81 |
+
"check-audit": "check-audit",
|
| 82 |
+
"resolve-audit": "resolve-audit",
|
| 83 |
+
"test": "npm run build && npm run test:all",
|
| 84 |
+
"test:update-snapshots": "node scripts/update-snapshots.js",
|
| 85 |
+
"test:cjs": "npm run build:cjs && npm run test:only",
|
| 86 |
+
"test:quick": "mocha -b test/test.js",
|
| 87 |
+
"test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:package' 'npm:test:options'",
|
| 88 |
+
"test:coverage": "npm run build:cjs && shx rm -rf coverage/* && nyc --reporter html mocha test/test.js",
|
| 89 |
+
"test:coverage:browser": "npm run build && shx rm -rf coverage/* && nyc mocha test/browser/index.js",
|
| 90 |
+
"test:leak": "npm install --no-save weak-napi && node --expose-gc test/leak/index.js",
|
| 91 |
+
"test:package": "node scripts/test-package.js",
|
| 92 |
+
"test:options": "node scripts/test-options.js",
|
| 93 |
+
"test:only": "mocha test/test.js",
|
| 94 |
+
"test:typescript": "shx rm -rf test/typescript/dist && shx cp -r dist test/typescript/ && tsc --noEmit -p test/typescript && tsc --noEmit -p . && tsc --noEmit -p scripts && vue-tsc --noEmit -p docs",
|
| 95 |
+
"test:browser": "mocha test/browser/index.js",
|
| 96 |
+
"watch": "rollup --config rollup.config.ts --configPlugin typescript --watch"
|
| 97 |
+
},
|
| 98 |
+
"repository": {
|
| 99 |
+
"type": "git",
|
| 100 |
+
"url": "git+https://github.com/rollup/rollup.git"
|
| 101 |
+
},
|
| 102 |
+
"keywords": [
|
| 103 |
+
"modules",
|
| 104 |
+
"bundler",
|
| 105 |
+
"bundling",
|
| 106 |
+
"es6",
|
| 107 |
+
"optimizer"
|
| 108 |
+
],
|
| 109 |
+
"author": "Rich Harris",
|
| 110 |
+
"license": "MIT",
|
| 111 |
+
"bugs": {
|
| 112 |
+
"url": "https://github.com/rollup/rollup/issues"
|
| 113 |
+
},
|
| 114 |
+
"homepage": "https://rollupjs.org/",
|
| 115 |
+
"optionalDependencies": {
|
| 116 |
+
"fsevents": "~2.3.2",
|
| 117 |
+
"@rollup/rollup-darwin-arm64": "4.57.1",
|
| 118 |
+
"@rollup/rollup-android-arm64": "4.57.1",
|
| 119 |
+
"@rollup/rollup-win32-arm64-msvc": "4.57.1",
|
| 120 |
+
"@rollup/rollup-freebsd-arm64": "4.57.1",
|
| 121 |
+
"@rollup/rollup-linux-arm64-gnu": "4.57.1",
|
| 122 |
+
"@rollup/rollup-linux-arm64-musl": "4.57.1",
|
| 123 |
+
"@rollup/rollup-android-arm-eabi": "4.57.1",
|
| 124 |
+
"@rollup/rollup-linux-arm-gnueabihf": "4.57.1",
|
| 125 |
+
"@rollup/rollup-linux-arm-musleabihf": "4.57.1",
|
| 126 |
+
"@rollup/rollup-win32-ia32-msvc": "4.57.1",
|
| 127 |
+
"@rollup/rollup-linux-loong64-gnu": "4.57.1",
|
| 128 |
+
"@rollup/rollup-linux-loong64-musl": "4.57.1",
|
| 129 |
+
"@rollup/rollup-linux-riscv64-gnu": "4.57.1",
|
| 130 |
+
"@rollup/rollup-linux-riscv64-musl": "4.57.1",
|
| 131 |
+
"@rollup/rollup-linux-ppc64-gnu": "4.57.1",
|
| 132 |
+
"@rollup/rollup-linux-ppc64-musl": "4.57.1",
|
| 133 |
+
"@rollup/rollup-linux-s390x-gnu": "4.57.1",
|
| 134 |
+
"@rollup/rollup-darwin-x64": "4.57.1",
|
| 135 |
+
"@rollup/rollup-win32-x64-gnu": "4.57.1",
|
| 136 |
+
"@rollup/rollup-win32-x64-msvc": "4.57.1",
|
| 137 |
+
"@rollup/rollup-freebsd-x64": "4.57.1",
|
| 138 |
+
"@rollup/rollup-linux-x64-gnu": "4.57.1",
|
| 139 |
+
"@rollup/rollup-linux-x64-musl": "4.57.1",
|
| 140 |
+
"@rollup/rollup-openbsd-x64": "4.57.1",
|
| 141 |
+
"@rollup/rollup-openharmony-arm64": "4.57.1"
|
| 142 |
+
},
|
| 143 |
+
"dependencies": {
|
| 144 |
+
"@types/estree": "1.0.8"
|
| 145 |
+
},
|
| 146 |
+
"devDependenciesComments": {
|
| 147 |
+
"core-js": "We only update manually as every update requires a snapshot update"
|
| 148 |
+
},
|
| 149 |
+
"devDependencies": {
|
| 150 |
+
"@codemirror/commands": "^6.10.1",
|
| 151 |
+
"@codemirror/lang-javascript": "^6.2.4",
|
| 152 |
+
"@codemirror/language": "^6.12.1",
|
| 153 |
+
"@codemirror/search": "^6.6.0",
|
| 154 |
+
"@codemirror/state": "^6.5.4",
|
| 155 |
+
"@codemirror/view": "^6.39.11",
|
| 156 |
+
"@eslint/js": "^9.39.2",
|
| 157 |
+
"@inquirer/prompts": "^7.10.1",
|
| 158 |
+
"@jridgewell/sourcemap-codec": "^1.5.5",
|
| 159 |
+
"@mermaid-js/mermaid-cli": "^11.12.0",
|
| 160 |
+
"@napi-rs/cli": "3.4.1",
|
| 161 |
+
"@rollup/plugin-alias": "^6.0.0",
|
| 162 |
+
"@rollup/plugin-buble": "^1.0.3",
|
| 163 |
+
"@rollup/plugin-commonjs": "^29.0.0",
|
| 164 |
+
"@rollup/plugin-json": "^6.1.0",
|
| 165 |
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
| 166 |
+
"@rollup/plugin-replace": "^6.0.3",
|
| 167 |
+
"@rollup/plugin-terser": "^0.4.4",
|
| 168 |
+
"@rollup/plugin-typescript": "^12.3.0",
|
| 169 |
+
"@rollup/pluginutils": "^5.3.0",
|
| 170 |
+
"@shikijs/vitepress-twoslash": "^3.21.0",
|
| 171 |
+
"@types/mocha": "^10.0.10",
|
| 172 |
+
"@types/node": "^20.19.30",
|
| 173 |
+
"@types/picomatch": "^4.0.2",
|
| 174 |
+
"@types/semver": "^7.7.1",
|
| 175 |
+
"@types/yargs-parser": "^21.0.3",
|
| 176 |
+
"@vue/language-server": "^3.2.4",
|
| 177 |
+
"acorn": "^8.15.0",
|
| 178 |
+
"acorn-import-assertions": "^1.9.0",
|
| 179 |
+
"acorn-jsx": "^5.3.2",
|
| 180 |
+
"buble": "^0.20.0",
|
| 181 |
+
"builtin-modules": "^5.0.0",
|
| 182 |
+
"chokidar": "^3.6.0",
|
| 183 |
+
"concurrently": "^9.2.1",
|
| 184 |
+
"core-js": "3.38.1",
|
| 185 |
+
"cross-env": "^10.1.0",
|
| 186 |
+
"date-time": "^4.0.0",
|
| 187 |
+
"es5-shim": "^4.6.7",
|
| 188 |
+
"es6-shim": "^0.35.8",
|
| 189 |
+
"eslint": "^9.39.2",
|
| 190 |
+
"eslint-config-prettier": "^10.1.8",
|
| 191 |
+
"eslint-plugin-prettier": "^5.5.5",
|
| 192 |
+
"eslint-plugin-unicorn": "^62.0.0",
|
| 193 |
+
"eslint-plugin-vue": "^10.7.0",
|
| 194 |
+
"fixturify": "^3.0.0",
|
| 195 |
+
"flru": "^1.0.2",
|
| 196 |
+
"fs-extra": "^11.3.3",
|
| 197 |
+
"github-api": "^3.4.0",
|
| 198 |
+
"globals": "^17.1.0",
|
| 199 |
+
"husky": "^9.1.7",
|
| 200 |
+
"is-reference": "^3.0.3",
|
| 201 |
+
"lint-staged": "^16.2.7",
|
| 202 |
+
"locate-character": "^3.0.0",
|
| 203 |
+
"magic-string": "^0.30.21",
|
| 204 |
+
"memfs": "^4.56.10",
|
| 205 |
+
"mocha": "^11.7.5",
|
| 206 |
+
"nodemon": "^3.1.11",
|
| 207 |
+
"npm-audit-resolver": "^3.0.0-RC.0",
|
| 208 |
+
"nyc": "^17.1.0",
|
| 209 |
+
"patch-package": "^8.0.1",
|
| 210 |
+
"picocolors": "^1.1.1",
|
| 211 |
+
"picomatch": "^4.0.3",
|
| 212 |
+
"pinia": "^3.0.4",
|
| 213 |
+
"prettier": "^3.8.1",
|
| 214 |
+
"prettier-plugin-organize-imports": "^4.3.0",
|
| 215 |
+
"pretty-bytes": "^7.1.0",
|
| 216 |
+
"pretty-ms": "^9.3.0",
|
| 217 |
+
"requirejs": "^2.3.8",
|
| 218 |
+
"rollup": "^4.56.0",
|
| 219 |
+
"rollup-plugin-license": "^3.6.0",
|
| 220 |
+
"semver": "^7.7.3",
|
| 221 |
+
"shx": "^0.4.0",
|
| 222 |
+
"signal-exit": "^4.1.0",
|
| 223 |
+
"source-map": "^0.7.6",
|
| 224 |
+
"source-map-support": "^0.5.21",
|
| 225 |
+
"systemjs": "^6.15.1",
|
| 226 |
+
"terser": "^5.46.0",
|
| 227 |
+
"tslib": "^2.8.1",
|
| 228 |
+
"typescript": "^5.9.3",
|
| 229 |
+
"typescript-eslint": "^8.54.0",
|
| 230 |
+
"vite": "^7.3.1",
|
| 231 |
+
"vitepress": "^1.6.4",
|
| 232 |
+
"vue": "^3.5.27",
|
| 233 |
+
"vue-eslint-parser": "^10.2.0",
|
| 234 |
+
"vue-tsc": "^3.2.4",
|
| 235 |
+
"wasm-pack": "^0.14.0",
|
| 236 |
+
"yargs-parser": "^21.1.1"
|
| 237 |
+
},
|
| 238 |
+
"overrides": {
|
| 239 |
+
"axios": "^1.13.3",
|
| 240 |
+
"esbuild": ">0.24.2",
|
| 241 |
+
"readable-stream": "npm:@built-in/readable-stream@1",
|
| 242 |
+
"semver": "^7.7.3",
|
| 243 |
+
"vite": "$vite",
|
| 244 |
+
"path-scurry": {
|
| 245 |
+
"lru-cache": "^11.2.5"
|
| 246 |
+
}
|
| 247 |
+
},
|
| 248 |
+
"comments": {
|
| 249 |
+
"vue-tsc": "This is necessary so that prettier-plugin-organize-imports works correctly in Vue templatges"
|
| 250 |
+
},
|
| 251 |
+
"files": [
|
| 252 |
+
"dist/*.node",
|
| 253 |
+
"dist/**/*.js",
|
| 254 |
+
"dist/*.d.ts",
|
| 255 |
+
"dist/bin/rollup",
|
| 256 |
+
"dist/es/package.json"
|
| 257 |
+
],
|
| 258 |
+
"engines": {
|
| 259 |
+
"node": ">=18.0.0",
|
| 260 |
+
"npm": ">=8.0.0"
|
| 261 |
+
},
|
| 262 |
+
"exports": {
|
| 263 |
+
".": {
|
| 264 |
+
"types": "./dist/rollup.d.ts",
|
| 265 |
+
"import": "./dist/es/rollup.js",
|
| 266 |
+
"require": "./dist/rollup.js"
|
| 267 |
+
},
|
| 268 |
+
"./loadConfigFile": {
|
| 269 |
+
"types": "./dist/loadConfigFile.d.ts",
|
| 270 |
+
"require": "./dist/loadConfigFile.js",
|
| 271 |
+
"default": "./dist/loadConfigFile.js"
|
| 272 |
+
},
|
| 273 |
+
"./getLogFilter": {
|
| 274 |
+
"types": "./dist/getLogFilter.d.ts",
|
| 275 |
+
"import": "./dist/es/getLogFilter.js",
|
| 276 |
+
"require": "./dist/getLogFilter.js"
|
| 277 |
+
},
|
| 278 |
+
"./parseAst": {
|
| 279 |
+
"types": "./dist/parseAst.d.ts",
|
| 280 |
+
"import": "./dist/es/parseAst.js",
|
| 281 |
+
"require": "./dist/parseAst.js"
|
| 282 |
+
},
|
| 283 |
+
"./dist/*": "./dist/*",
|
| 284 |
+
"./package.json": "./package.json"
|
| 285 |
+
}
|
| 286 |
+
}
|
node_modules/router/HISTORY.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
+
* Restore `debug` dependency
|
| 6 |
+
|
| 7 |
+
2.1.0 / 2025-02-10
|
| 8 |
+
==================
|
| 9 |
+
|
| 10 |
+
* Updated `engines` field to Node@18 or higher
|
| 11 |
+
* Remove `Object.setPrototypeOf` polyfill
|
| 12 |
+
* Use `Array.flat` instead of `array-flatten` package
|
| 13 |
+
* Replace `methods` dependency with standard library
|
| 14 |
+
* deps: parseurl@^1.3.3
|
| 15 |
+
* deps: is-promise@^4.0.0
|
| 16 |
+
* Replace `utils-merge` dependency with `Object.assign`
|
| 17 |
+
* deps: Remove unused dep `after`
|
| 18 |
+
|
| 19 |
+
2.0.0 / 2024-09-09
|
| 20 |
+
==================
|
| 21 |
+
|
| 22 |
+
* Drop support for node <18
|
| 23 |
+
* deps: path-to-regexp@^8.0.0
|
| 24 |
+
- Drop support for partial capture group `router.route('/user(s?)/:user/:op')` but still have optional non-capture `/user{s}/:user/:op`
|
| 25 |
+
- `:name?` becomes `{:name}`
|
| 26 |
+
- `:name*` becomes `*name`.
|
| 27 |
+
- The splat change also changes splat from strings to an array of strings
|
| 28 |
+
- Optional splats become `{*name}`
|
| 29 |
+
- `:name+` becomes `*name` and thus equivalent to `*name` so I dropped those tests
|
| 30 |
+
- Strings as regular expressions are fully removed, need to be converted to native regular expressions
|
| 31 |
+
|
| 32 |
+
2.0.0-beta.2 / 2024-03-20
|
| 33 |
+
=========================
|
| 34 |
+
|
| 35 |
+
This incorporates all changes after 1.3.5 up to 1.3.8.
|
| 36 |
+
|
| 37 |
+
* Add support for returned, rejected Promises to `router.param`
|
| 38 |
+
|
| 39 |
+
2.0.0-beta.1 / 2020-03-29
|
| 40 |
+
=========================
|
| 41 |
+
|
| 42 |
+
This incorporates all changes after 1.3.3 up to 1.3.5.
|
| 43 |
+
|
| 44 |
+
* Internalize private `router.process_params` method
|
| 45 |
+
* Remove `debug` dependency
|
| 46 |
+
* deps: array-flatten@3.0.0
|
| 47 |
+
* deps: parseurl@~1.3.3
|
| 48 |
+
* deps: path-to-regexp@3.2.0
|
| 49 |
+
- Add new `?`, `*`, and `+` parameter modifiers.
|
| 50 |
+
- Matching group expressions are only RegExp syntax.
|
| 51 |
+
`(*)` is no longer valid and must be written as `(.*)`, for example.
|
| 52 |
+
- Named matching groups no longer available by position in `req.params`.
|
| 53 |
+
`/:foo(.*)` only captures as `req.params.foo` and not available as
|
| 54 |
+
`req.params[0]`.
|
| 55 |
+
- Regular expressions can only be used in a matching group.
|
| 56 |
+
`/\\d+` is no longer valid and must be written as `/(\\d+)`.
|
| 57 |
+
- Matching groups are now literal regular expressions.
|
| 58 |
+
`:foo` named captures can no longer be included inside a capture group.
|
| 59 |
+
- Special `*` path segment behavior removed.
|
| 60 |
+
`/foo/*/bar` will match a literal `*` as the middle segment.
|
| 61 |
+
* deps: setprototypeof@1.2.0
|
| 62 |
+
|
| 63 |
+
2.0.0-alpha.1 / 2018-07-27
|
| 64 |
+
==========================
|
| 65 |
+
|
| 66 |
+
* Add basic support for returned, rejected Promises
|
| 67 |
+
- Rejected Promises from middleware functions `next(error)`
|
| 68 |
+
* Drop support for Node.js below 0.10
|
| 69 |
+
* deps: debug@3.1.0
|
| 70 |
+
- Add `DEBUG_HIDE_DATE` environment variable
|
| 71 |
+
- Change timer to per-namespace instead of global
|
| 72 |
+
- Change non-TTY date format
|
| 73 |
+
- Remove `DEBUG_FD` environment variable support
|
| 74 |
+
- Support 256 namespace colors
|
| 75 |
+
|
| 76 |
+
1.3.8 / 2023-02-24
|
| 77 |
+
==================
|
| 78 |
+
|
| 79 |
+
* Fix routing requests without method
|
| 80 |
+
|
| 81 |
+
1.3.7 / 2022-04-28
|
| 82 |
+
==================
|
| 83 |
+
|
| 84 |
+
* Fix hanging on large stack of sync routes
|
| 85 |
+
|
| 86 |
+
1.3.6 / 2021-11-15
|
| 87 |
+
==================
|
| 88 |
+
|
| 89 |
+
* Fix handling very large stacks of sync middleware
|
| 90 |
+
* deps: safe-buffer@5.2.1
|
| 91 |
+
|
| 92 |
+
1.3.5 / 2020-03-24
|
| 93 |
+
==================
|
| 94 |
+
|
| 95 |
+
* Fix incorrect middleware execution with unanchored `RegExp`s
|
| 96 |
+
* perf: use plain object for internal method map
|
| 97 |
+
|
| 98 |
+
1.3.4 / 2020-01-24
|
| 99 |
+
==================
|
| 100 |
+
|
| 101 |
+
* deps: array-flatten@3.0.0
|
| 102 |
+
* deps: parseurl@~1.3.3
|
| 103 |
+
* deps: setprototypeof@1.2.0
|
| 104 |
+
|
| 105 |
+
1.3.3 / 2018-07-06
|
| 106 |
+
==================
|
| 107 |
+
|
| 108 |
+
* Fix JSDoc for `Router` constructor
|
| 109 |
+
|
| 110 |
+
1.3.2 / 2017-09-24
|
| 111 |
+
==================
|
| 112 |
+
|
| 113 |
+
* deps: debug@2.6.9
|
| 114 |
+
* deps: parseurl@~1.3.2
|
| 115 |
+
- perf: reduce overhead for full URLs
|
| 116 |
+
- perf: unroll the "fast-path" `RegExp`
|
| 117 |
+
* deps: setprototypeof@1.1.0
|
| 118 |
+
* deps: utils-merge@1.0.1
|
| 119 |
+
|
| 120 |
+
1.3.1 / 2017-05-19
|
| 121 |
+
==================
|
| 122 |
+
|
| 123 |
+
* deps: debug@2.6.8
|
| 124 |
+
- Fix `DEBUG_MAX_ARRAY_LENGTH`
|
| 125 |
+
- deps: ms@2.0.0
|
| 126 |
+
|
| 127 |
+
1.3.0 / 2017-02-25
|
| 128 |
+
==================
|
| 129 |
+
|
| 130 |
+
* Add `next("router")` to exit from router
|
| 131 |
+
* Fix case where `router.use` skipped requests routes did not
|
| 132 |
+
* Use `%o` in path debug to tell types apart
|
| 133 |
+
* deps: setprototypeof@1.0.3
|
| 134 |
+
* perf: add fast match path for `*` route
|
| 135 |
+
|
| 136 |
+
1.2.0 / 2017-02-17
|
| 137 |
+
==================
|
| 138 |
+
|
| 139 |
+
* Skip routing when `req.url` is not set
|
| 140 |
+
* deps: debug@2.6.1
|
| 141 |
+
- Allow colors in workers
|
| 142 |
+
- Deprecated `DEBUG_FD` environment variable set to `3` or higher
|
| 143 |
+
- Fix error when running under React Native
|
| 144 |
+
- Use same color for same namespace
|
| 145 |
+
- deps: ms@0.7.2
|
| 146 |
+
|
| 147 |
+
1.1.5 / 2017-01-28
|
| 148 |
+
==================
|
| 149 |
+
|
| 150 |
+
* deps: array-flatten@2.1.1
|
| 151 |
+
* deps: setprototypeof@1.0.2
|
| 152 |
+
- Fix using fallback even when native method exists
|
| 153 |
+
|
| 154 |
+
1.1.4 / 2016-01-21
|
| 155 |
+
==================
|
| 156 |
+
|
| 157 |
+
* deps: array-flatten@2.0.0
|
| 158 |
+
* deps: methods@~1.1.2
|
| 159 |
+
- perf: enable strict mode
|
| 160 |
+
* deps: parseurl@~1.3.1
|
| 161 |
+
- perf: enable strict mode
|
| 162 |
+
|
| 163 |
+
1.1.3 / 2015-08-02
|
| 164 |
+
==================
|
| 165 |
+
|
| 166 |
+
* Fix infinite loop condition using `mergeParams: true`
|
| 167 |
+
* Fix inner numeric indices incorrectly altering parent `req.params`
|
| 168 |
+
* deps: array-flatten@1.1.1
|
| 169 |
+
- perf: enable strict mode
|
| 170 |
+
* deps: path-to-regexp@0.1.7
|
| 171 |
+
- Fix regression with escaped round brackets and matching groups
|
| 172 |
+
|
| 173 |
+
1.1.2 / 2015-07-06
|
| 174 |
+
==================
|
| 175 |
+
|
| 176 |
+
* Fix hiding platform issues with `decodeURIComponent`
|
| 177 |
+
- Only `URIError`s are a 400
|
| 178 |
+
* Fix using `*` before params in routes
|
| 179 |
+
* Fix using capture groups before params in routes
|
| 180 |
+
* deps: path-to-regexp@0.1.6
|
| 181 |
+
* perf: enable strict mode
|
| 182 |
+
* perf: remove argument reassignments in routing
|
| 183 |
+
* perf: skip attempting to decode zero length string
|
| 184 |
+
* perf: use plain for loops
|
| 185 |
+
|
| 186 |
+
1.1.1 / 2015-05-25
|
| 187 |
+
==================
|
| 188 |
+
|
| 189 |
+
* Fix issue where `next('route')` in `router.param` would incorrectly skip values
|
| 190 |
+
* deps: array-flatten@1.1.0
|
| 191 |
+
* deps: debug@~2.2.0
|
| 192 |
+
- deps: ms@0.7.1
|
| 193 |
+
|
| 194 |
+
1.1.0 / 2015-04-22
|
| 195 |
+
==================
|
| 196 |
+
|
| 197 |
+
* Use `setprototypeof` instead of `__proto__`
|
| 198 |
+
* deps: debug@~2.1.3
|
| 199 |
+
- Fix high intensity foreground color for bold
|
| 200 |
+
- deps: ms@0.7.0
|
| 201 |
+
|
| 202 |
+
1.0.0 / 2015-01-13
|
| 203 |
+
==================
|
| 204 |
+
|
| 205 |
+
* Fix crash from error within `OPTIONS` response handler
|
| 206 |
+
* deps: array-flatten@1.0.2
|
| 207 |
+
- Remove redundant code path
|
| 208 |
+
|
| 209 |
+
1.0.0-beta.3 / 2015-01-11
|
| 210 |
+
=========================
|
| 211 |
+
|
| 212 |
+
* Fix duplicate methods appearing in OPTIONS responses
|
| 213 |
+
* Fix OPTIONS responses to include the HEAD method properly
|
| 214 |
+
* Remove support for leading colon in `router.param(name, fn)`
|
| 215 |
+
* Use `array-flatten` for flattening arrays
|
| 216 |
+
* deps: debug@~2.1.1
|
| 217 |
+
* deps: methods@~1.1.1
|
| 218 |
+
|
| 219 |
+
1.0.0-beta.2 / 2014-11-19
|
| 220 |
+
=========================
|
| 221 |
+
|
| 222 |
+
* Match routes iteratively to prevent stack overflows
|
| 223 |
+
|
| 224 |
+
1.0.0-beta.1 / 2014-11-16
|
| 225 |
+
=========================
|
| 226 |
+
|
| 227 |
+
* Initial release ported from Express 4.x
|
| 228 |
+
- Altered to work without Express
|
node_modules/router/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(The MIT License)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2013 Roman Shtylman
|
| 4 |
+
Copyright (c) 2014-2022 Douglas Christopher Wilson
|
| 5 |
+
|
| 6 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 7 |
+
a copy of this software and associated documentation files (the
|
| 8 |
+
'Software'), to deal in the Software without restriction, including
|
| 9 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 10 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 11 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 12 |
+
the following conditions:
|
| 13 |
+
|
| 14 |
+
The above copyright notice and this permission notice shall be
|
| 15 |
+
included in all copies or substantial portions of the Software.
|
| 16 |
+
|
| 17 |
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
| 18 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 19 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| 20 |
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
| 21 |
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
| 22 |
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
| 23 |
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|