IDK its for prsima error on deploy i think is fixed

This commit is contained in:
Ali Taghavi
2026-05-19 09:34:17 +03:30
parent 4d714114d7
commit 49ab7cd685
29366 changed files with 4911919 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
'use strict';
var testArray = function testArray(t, actual, expected, msg) {
t.deepEqual(actual, expected, msg);
t.equal(actual.length, expected.length, 'expected ' + expected.length + ', got ' + actual.length);
};
module.exports = function (flat, t) {
t.test('flattens', function (st) {
testArray(st, flat([1, [2], [[3]], [[['four']]]]), [1, 2, [3], [['four']]], 'missing depth only flattens 1 deep');
testArray(st, flat([1, [2], [[3]], [[['four']]]], 1), [1, 2, [3], [['four']]], 'depth of 1 only flattens 1 deep');
st.notDeepEqual(flat([1, [2], [[3]], [[['four']]]], 1), [1, 2, 3, ['four']], 'depth of 1 only flattens 1 deep: sanity check');
testArray(st, flat([1, [2], [[3]], [[['four']]]], 2), [1, 2, 3, ['four']], 'depth of 2 only flattens 2 deep');
st.notDeepEqual(flat([1, [2], [[3]], [[['four']]]], 2), [1, 2, 3, 'four'], 'depth of 2 only flattens 2 deep: sanity check');
testArray(st, flat([1, [2], [[3]], [[['four']]]], 3), [1, 2, 3, 'four'], 'depth of 3 only flattens 3 deep');
testArray(st, flat([1, [2], [[3]], [[['four']]]], Infinity), [1, 2, 3, 'four'], 'depth of Infinity flattens all the way');
st.end();
});
t.test('sparse arrays', function (st) {
// eslint-disable-next-line no-sparse-arrays
st.deepEqual(flat([, [1]]), flat([[], [1]]), 'an array hole is treated the same as an empty array');
st.end();
});
};

View File

@@ -0,0 +1,971 @@
1.24.2 / 2026-04-07
=================
- [Fix] `IfAbruptCloseIterator`: handle all abrupt completions, not just throw
- [Robustness] use `+x` instead of `Number(x)`
- [Robustness] use `isFinite`/`parseInt` intrinsics, and isNaN helper
- [Robustness] ensure `undefined` is `undefined`
- [patch] add a TODO to remove an unused helper
- [Dev Deps] update `@ljharb/eslint-config`, `npmignore`
1.24.1 / 2025-12-12
=================
- [Fix] `ES2025`+: `GeneratorResumeAbrupt`: properly handle return completions
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@unicode/unicode-15.0.0`, `make-generator-function`, `npmignore`, `ses`
1.24.0 / 2025-05-28
=================
- [New] add `ES2025` (#159)
- [New] `ES2023`+: add `GetNamedTimeZoneEpochNanoseconds`, `GetUTCEpochNanoseconds`, `IsTimeZoneOffsetString`
- [New] `ES2015`+: `CharacterRange`: also accept CharSets
- [New] `ES2024`+: add `AllCharacters`, `CharacterComplement`
- [Refactor] StringIndexOf: anticipate ES2025 not found sentinel change
- [Deps] update `stop-iteration-iterator`
- [Tests] increase coverage
1.23.10 / 2025-05-21
=================
- [Fix] properly handle Float16Array
- [Fix] `ES2024`+: `IsViewOutOfBounds`: properly handle resizable array buffers
- [Fix] `ES2024`+: `IsTypedArrayOutOfBounds`: properly handle resizable arrays
- [Fix] `ES2024`+: `GetViewByteLength`, `TypedArrayByteLength`, `TypedArrayLength`: properly handle resizable arrays
- [Fix] `ES2020`+: `abs` should accept bigints too
- [Fix] `ES2024`+: `ArrayBufferByteLength`: return the byte length for SABs, not NaN
- [Fix] `ES2024`+: `ArrayBufferCopyAndDetach`: properly handle resizable ArrayBuffers; add tests
- [Fix] `ES2021`: `SetTypedArrayFromTypedArray`: get proper source element size
- [Fix] `ES2023`+: `SetTypedArrayFromTypedArray`: ArrayBuffer shouldnt be bound
- [Fix] `ES2022`,`ES2023`: `ValidateIntegerTypedArray`: return the buffer
- [patch] `ES2023`+: `SortIndexedProperties`: improve error message
- [patch] clean up some comments
- [patch] `ES2023`+: `InternalizeJSONProperty`: remove extra argument
- [patch] `ES2020`+`: `GetIterator`: fix comment to indicate that it changed in ES2018
- [Refactor] Typed Array stuff: store "choices" string in the table file
- [Refactor] `ES2021`+: use isInteger directly in a few AOs
- [Refactor] `ES2022`+: `ValidateAndApplyPropertyDescriptor`: use `typeof` over `Type()`
- [Refactor] `helpers/getIteratorMethod`: no longer require a passed-in `IsArray`
- [Refactor] `ES2017`+: `Num{ber,eric}ToRawBytes`, `RawBytesToNum{ber,eric}`: use TAO table sizes
- [Refactor] `ES2015`+: `{,Ordinary}ObjectCreate`: prefer `__proto__` syntax over `Object.create`
- [Refactor] `CopyDataProperties` tests are the same in ES2020 as in ES2018
- [Refactor] `ES2016` - `ES2020`: `UTF16Encoding`: match `UTF16EncodeCodePoint`
- [Refactor] use `es-object-atoms/isObject` directly
- [Refactor] add `isSameType` helper, and use it
- [Refactor] `ES2017`+: `WordCharacters`: `String.prototype.indexOf` should always be present
- [Refactor] use `arr[arr.length] = x` instead of `$push(arr, x)`
- [Robustness] `ES2015`+: `ObjectDefineProperties`: use `OrdinaryGetOwnProperty` to handle a missing `gOPD`
- [meta] add missing comments
- [meta] fix operations npmignores
- [meta] fix URL in comment
- [meta] note `isNegativeZero` helper is slated for removal (#155)
- [Deps] update `call-bound`, `which-typed-array`, `es-object-atoms`, `get-intrinsic`, `get-proto`, `regexp.prototype.flags`, `is-weakref`, `object-inspect`
- [Dev Deps] pin `glob` to v7
- [Dev Deps] update `@unicode/unicode-15.0.0`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `ses`
- [Tests] avoid an OOM in node 20 on SES tests
- [Tests] compare correct TA type
- [Tests] consolidate map of AO property names to prose names
- [Tests] extract common helpers
- [Tests] increase coverage
- [Tests] increase coverage
- [Tests] node 20 throws with RABs that are not a multiple of 4 and 8
- [Tests] refactor TA types arrays to year-taking functions
- [Tests] refactor test megafile into file-per-method tests
- [Tests] remove now-unused test mega-file
- [Tests] some cleanups
- [Tests] use proper import
1.23.9 / 2025-01-02
=================
* [Refactor] use `get-proto` directly
* [Refactor] use `set-proto` directly
* [Refactor] use `Reflect.setPrototypeOf` and `dunder-proto` in `setProto` helper
* [Refactor] `ES2015`+: `ArrayCreate`: use `setProto` helper
* [Deps] update `es-set-tostringtag`, `own-keys`
* [Dev Deps] update `is-core-module`
* [Tests] use `own-keys` directly
1.23.8 / 2024-12-28
=================
* [Refactor] use `own-keys`
* [Refactor] use `safe-push-apply`
1.23.7 / 2024-12-20
=================
* [Refactor] create and use `helpers/isPropertyKey`
* [Refactor] add `timeValue` helper, use it
* [Deps] update `array-buffer-byte-length`, `data-view-buffer`, `data-view-byte-length`, `data-view-byte-offset`, `function.prototype.name`, `get-symbol-description`, `is-array-buffer`, `is-shared-array-buffer`, `is-typed-array`, `math-intrinsics`, `object.assign`, `typed-array-buffer`, `typed-array-byte-length`, `typed-array-byte-offset`, `unbox-primitive`, `which-typed-array`
* [Deps] remove unused dep
* [Dev Deps] update `array.prototype.indexof`, `has-bigints`, `is-registered-symbol`, `safe-bigint`
1.23.6 / 2024-12-15
=================
* [Fix] `ES2015` - `ES2019`: `IntegerIndexedElementSet`: reject BigInt Typed Arrays prior to ES2020
* [Fix] `ES2023`+: `SetTypedArrayFromTypedArray`: provide missing `cloneConstructor` argument to `CloneArrayBuffer`
* [Fix] `ES2024`+: `FindViaPredicate`: spec enums are uppercase now
* [Fix] `ES2017` - `ES2019`: `SetValueInBuffer`: handle proper number of arguments
* [Fix] `ES2015`+: `QuoteJSONString`: properly handle surrogates
* [Fix] `ES2015`+: `TestIntegrityLevel`: properly handle envs without property descriptors
* [patch] `ES2018` - `ES2023`: `thisSymbolValue`: only require `Symbol.prototype.valueOf` for boxed Symbols
* [Robustness] `ES2015` - `ES2016`: `SetValueInBuffer`: salt dictionary keys in case of pre-proto envs
* [Refactor] use `math-intrinsics`
* [Refactor] use `call-bound` directly
* [Refactor] `ES2015`+: `GetIterator`: hoist an object to module scope
* [Refactor] use `typeof` over `Type()` when possible
* [Refactor] `ES2015` - `ES2016`: `GetValueFromBuffer`: remove unnecessary extra helper argument
* [Refactor] misc cleanups
* [Refactor] make and use `isObject` helper
* [Refactor] `ES5`+: `MonthFromTime`: throw a `RangeError` for an out of range timestamp
* [Refactor] use `+` over `Number()`
* [Deps] update `arraybuffer.prototype.slice`, `call-bind`, `es-define-property`, `es-to-primitive`, `function.prototype.name`, `get-intrinsic`, `gopd`, `has-proto`, `has-symbols`, `internal-slot`, `is-data-view`, `is-regex`, `is-string`, `which-typed-array`, `is-weakref`, `safe-array-concat`, `safe-regex-test`, `string.prototype.trim`, `string.prototype.trimend`, `typed-array-byte-offset`, `typed-array-length`
* [meta] remove unnecessary unspackles
* [Tests] `isStringOrUndefined`: increase coverage
* [Tests] bigint tests are ES2020+ only
* [Dev Deps] update `array.prototype.flatmap`, `is-core-module`, `is-registered-symbol`
1.23.5 / 2024-11-14
=================
* [Fix] `ES2015`+: `CompletionRecord`: ensure `?` works on any non-abrupt completion
1.23.4 / 2024-11-12
=================
* [Fix] `ES2024`+: Iterator Records can now have non-functions in `[[NextMethod]]`
* [meta] update spec URL comments
* [Deps] update `globalthis`, `object-inspect`, `regexp.prototype.flags`
* [Dev Deps] update `@ljharb/eslint-config`, `@unicode/unicode-15.0.0`, `diff`, `es-value-fixtures`, `is-core-module`, `mock-property`, `ses`, `tape`
* [actions] split out node 10-20, and 20+
* [Tests] switch to `npm audit` from `aud`
* [Tests] use `.assertion` instead of monkeypatching tape
* [Tests] increase coverage
1.23.3 / 2024-03-29
=================
* [Fix] `ES2024`: `StringPad`, `StringPaddingBuiltinsImpl`: prefer uppercase spec enums
* [Fix] `helpers/bytesAsInteger`: avoid a crash in node 10.4 - 10.8
* [Fix] `ES5`: `CheckObjectCoercible`: restore `optMessage` optional arg
* [Refactor] `ES2022`+: update `TimeString` to use `ToZeroPaddedDecimalString`
* [Robustness] use cached copies of builtins
* [Deps] update `string.prototype.trimstart`, `typed-array-length`
* [Dev Deps] update `array.from`, `array.prototype.filter`, `array.prototype.indexof`, `object.fromentries`, `safe-bigint`
1.23.2 / 2024-03-17
=================
* [Fix] `records/regexp-record`: add optional `[[UnicodeSets]]` boolean field
* [Fix] `ES2024`+: `AddValueToKeyedGroup`: avoid adding matched values twice
* [Fix] `ES5`: `CheckObjectCoercible`: use the right function name
* [Fix] `ES2024`+: `AddEntriesFromIterable`, `GetIterator`, `GroupBy`: properly capitalize spec enums
* [Deps] update `string.prototype.trim`, `string.prototype.trimend`
* [Tests] increase coverage
1.23.1 / 2024-03-16
=================
* [Refactor] use `es-object-atoms`
* [Deps] update `hasown`, `which-typed-array`, `data-view-byte-length`, `safe-array-concat`
* [Dev Deps] update `diff`
1.23.0 / 2024-03-04
=================
* [New] add `ES2024`
* [New] `ES2015`+: add `InternalizeJSONProperty`
* [New] `ES2015`+: add `IntegerIndexedElement{Get,Set}`
* [New] `ES2018`+: add `TimeZoneString`
* [New] `ES2022`+: add `DefineMethodProperty`
* [New] `ES2023`: add `DefaultTimeZone`
* [Fix] `ES2023`+: `SetTypedArrayFrom{TypedArray,ArrayLike}`: match engine reality
* [Fix] `ES2024`+: `GetViewByteLength`, `IsViewOutOfBounds`: support engines with only own DV properties
* [Tests] use `safe-bigint`
1.22.5 / 2024-02-28
=================
* [Fix] `ES2015`+: `DetachArrayBuffer`: node v21.0.0+ structuredClone throws with an already-detached ArrayBuffer
* [Fix] `helpers/assertRecord`: partial revert of 87c340d2; unintentional breaking change
* [patch] records: fix indentation, improve object checks
* [Refactor] extract TA tables to separate files
* [meta] extract "list spackled files" to separate run-script
* [Deps] update `available-typed-arrays`, `es-set-tostringtag`, `has-proto`, `is-negative-zero`, `is-shared-array-buffer`, `typed-array-buffer`, `typed-array-byte-length`, `typed-array-byte-offset`, `typed-array-length`
* [Dev Deps] update `available-regexp-flags`, `tape`
* [Dev Deps] pin `jackspeak` and `glob`, since v2.1.2+ and v10.3.8+ respectively depend on npm aliases, which kill the install process in npm < 6
* [Tests] use `define-{accessor,data}-property`
* [Tests] fix some test cases
* [Tests] use `safeBigInt` for `Z()` pattern to handle node 10.4 - 10.8
1.22.4 / 2024-02-13
=================
* [Fix] `ES2017`+: `IsDetachedBuffer`: properly allow SABs
* [Fix] `ES2022`+: `ToBigInt`: properly throw on an unparseable string
* [Fix] `ES2015`+: `ValidateTypedArray`: proper detachment check and return value
* [Fix] `ES2022`+: `GetSubstitution`: match updated semantics
* [Refactor] prefer `typeof` over `Type()`, except for Object, where possible
* [Refactor] use `es-errors` instead of `get-intrinsic` where possible
* [Refactor] use `es-define-property`
* [Refactor] records: extract predicates to individual files
* [Refactor] `ES2015`+: `Canonicalize`, `WordCharacters`: use explicit `.json` extension for imports
* [Deps] update `array-buffer-byte-length`, `arraybuffer.prototype.slice`, `available-typed-arrays`, `call-bind`, `es-set-tostringtag`, `get-intrinsic`, `get-symbol-description`, `has-proper ty-descriptors`, `has-property-descriptors`, `hasown`, `internal-slot`, `is-array-buffer`, `is-typed-array`, `object.assign`, `regexp.prototype.flags`, `safe-array-concat`, `safe-regex-test`, `typed-array-buffer`, `which-typed-array`
* [eslint] remove unused overrides
* [Tests] increase/fix coverage
* [Dev Deps] update `aud`, `npmignore`, `mock-property`, `tape`
1.22.3 / 2023-10-20
=================
* [Fix] `ES2015`+: `GetSubstitution`: accept `undefined` instead of a hole
* [Refactor] use `hasown` instead of `has`
* [Deps] update `call-bind`, `get-intrinsic`, `object-inspect`, `which-typed-array`
* [Dev Deps] update `function-bind`, `is-core-module`, `mock-property`, `tape`
1.22.2 / 2023-09-14
=================
* [Fix] `ES2015`+: `NewPromiseCapability`: use AOs from the current year, not 2022
* [Refactor] `ES2021`+: `SetTypedArrayFromArrayLike`: use `IsBigIntElementType`
* [Refactor] properly name `helpers/typedArrayConstructors`
* [Refactor] simplify helpers
* [Deps] update `arraybuffer.prototype.slice`, `function.prototype.name`, `is-typed-array`, `regexp.prototype.flags`, `safe-array-concat`, `string.prototype.trim`, `string.prototype.trimend`, `string.prototype.trimstart`, `which-typed-array`
* [actions] update actions
* [Tests] run SES tests on more node versions
* [Dev Deps] update `@unicode/unicode-15.0.0`, `array.from`, `array.prototype.filter`, `array.prototype.flatmap`, `array.prototype.indexof`, `is-core-module`, `object.fromentries`, `ses`, `tape`
1.22.1 / 2023-07-15
=================
* [Deps] add missing `safe-array-concat` dep
1.22.0 / 2023-07-15
=================
* [New] add `ES2023`
* [New] `ES2021+`: add `SetTypedArrayFromArrayLike`, `SetTypedArrayFromTypedArray`
* [New] `ES2021`+: add `CloneArrayBuffer`
* [New] `ES2020`+: add `IsValidIntegerIndex`
* [New] `ES2015`+: add `GetValueFromBuffer`, `SetValueInBuffer`
* [New] `ES2016`+: add `TypedArrayCreate`, `TypedArraySpeciesCreate`
* [New] `ES2015`+: add `IsWordChar`
* [New] `ES2017`+ add `WordCharacters`
* [New] `ES2015`+: add `Canonicalize`
* [New] `ES2015`+: add `NewPromiseCapability`
* [Fix] `ES2017+`: `NumberToRawBytes`, `NumericToRawBytes`: reimplement Float64, fix integer scenarios
* [Refactor] add `helpers/isLineTerminator`
* [Refactor] add `isInteger` helper, and use it
* [Refactor] extract `isStringOrHole` to a helper
* [Refactor] `ES2017`+: `RawBytesToNumber`, `RawBytesToNumeric`: extract common code to helpers
* [Refactor] make a `MAX_VALUE` helper
* [Tests] fix RawBytesToNumeric tests in node v10.4-10.8
* [Tests] fix buffer test cases in node v10.4-v10.8
1.21.3 / 2023-07-12
=================
* [Fix] `ES2017+`: `RawBytesToNumber`, `RawBytesToNumeric`: properly handle some scenarios
* [Fix] `ES2015`+: `GetV`: the receiver is `V`, not `O`
* [Fix] `ES2017`+: `RawBytesToNumber`, `RawBytesToNumeric`: fix exponent calculation for Float64, improve tests
* [Fix] `ES2017`+: `RawBytesToNumber`, `RawBytesToNumeric`: fix logic, improve tests
* [Fix] `ES2019`+: `thisTimeValue`: fix spackling
* [Robustness] `ES2017`+: `NumberToRawBytes`, `NumericToRawBytes`: use `SameValue` instead of `Object.is`
* [Refactor] `ES2021`+: `ValidateAtomicAccess`: use `typed-array-byte-offset`
* [Refactor] `ES2019`+: `AddEntriesFromIterable`: use `ThrowCompletion`
* [patch] `ES2015`+: `ObjectDefineProperties`: satisfy TODO
* [patch] `ES2015`+: `GetV`: improve error message
* [patch] fix spec URLs
* [Deps] update `get-intrinsic`, `regexp.prototype.flags`, `which-typed-array`
* [actions] fix permissions
* [Tests] add buffer test case fixtures + tests
* [Tests] skip test that modifies the env in SES
* [Tests] fix regex flags tests for node 20
* [Dev Deps] update `@ljharb/eslint-config`, `aud`, `available-regexp-flags`, `is-core-module`, `tape`
1.21.2 / 2023-03-12
=================
* [Fix] `ES2015`+: `CreateDataProperty`: use `OrdinaryDefineOwnProperty`
* [Fix] `ES2015`+: `CreateDataProperty`: use `OrdinaryDefineOwnProperty`
* [Fix] `ES2015`+: `GetPrototypeFromConstructor`: add missing assertion that `intrinsicDefaultProto` is an object
* [Fix] `ES2015`+: `IsDetachedBuffer`: ensure a nullish error does not crash
* [Fix] `ES2015`+: `ToDateString`: properly handle time values that arent "now"
* [Fix] `ES2015`+: `ToUint8Clamp`: avoid an extra observable ToNumber
* [Fix] `ES2015`+`: `GetMethod`: when `func` is not callable and `P` is a symbol, avoid the wrong TypeError
* [Fix] `ES2020`+: `ToBigInt`: properly throw on anything besides string, bigint, boolean
* [Fix] `ES2021`+: `SplitMatch`: instead of `false`, return `'not-matched'`
* [Fix] `helpers/assertRecord`: handle nullish input
* [Fix] `helpers/isFullyPopulatedPropertyDescriptor`: handle primitive inputs
* [Robustness] `ES5`: `ToNumber`: avoid relying on runtime `.test` and `.replace`
* [Refactor] `ES2015`: mark `IsDataDescriptor` and `IsAccessorDescriptor` as spackled
* [Refactor] `ES2015`+: `IsDetachedBuffer`: use `array-buffer-byte-length` package
* [Refactor] `ES2015`+: `OrdinaryHasInstance`: rely on falsiness
* [Refactor] `ES2016`+: `CreateListFromArrayLike`: hoist default element types to module level
* [Refactor] `ES2022`+: `StringToNumber`, `ToNumber`: use `string.prototype.trim`
* [patch] `ES2022`+: `IsLessThan`: fix a comment
* [patch] `ES2022`+: `TypedArrayElementSize`, `TypedArrayElementType`: throw a SyntaxError with an unknown TA type
* [patch] `ES2022`+: `IsLessThan`: fix a comment
* [patch] `ES2020`+: `thisBigIntValue`: throw a SyntaxError, not TypeError, for unsupported features
* [patch] `helpers/getIteratorMethod`: `String` is always available
* [patch] fix commented spec URLs
* [patch] omit `%` for `callBound`
* [meta] fix spec URLs
* [meta] fix spackle metadata, comments
* [Deps] update `get-intrinsic`, `internal-slot`, `is-array-buffer`, `object-inspect`
* [Deps] move `function-bind` to dev deps
* [Tests] String.fromCharCode takes numbers, not strings
* [Tests] use `makeIteratorRecord` helper
* [Tests] increase coverage
* [Tests] fix tests that throw a sentinel
* [Dev Deps] update `array.from`, `available-regexp-flags`, `tape`
1.21.1 / 2023-01-10
=================
* [Fix] move `available-typed-arrays` to runtime deps
* [Fix] `ES2021`+: `NumberToBigInt`: throw the proper error on an env without BigInts
* [Fix] `ES2018`+: `CreateAsyncFromSyncIterator`: properly check `next` method args length
* [Fix] `ES2020`-`ES2021`: Abstract Relational Comparison: handle BigInts properly
* [Fix] `ES2022`+: `StringToBigInt`: invalid BigInts should be `undefined`, not `NaN` as in previous years
* [Fix] `helpers/isFinite`: properly handle BigInt values
* [Fix] `ES2020`+: `CreateListFromArrayLike`: accept BigInts
* [Fix] `ES2019`+: `AsyncFromSyncIteratorContinuation`: throw a SyntaxError when > 1 arg is passed
* [patch] `ES2020`+: `GetIterator`: use SyntaxError for intentionally unsupported
* [patch] `ES2015`+: `GetPrototypeFromContructor`: use SyntaxError for intentionally unsupported
* [patch] `ES2022`+: `StringToNumber`: fix non-string assertion failure message
* [Deps] update `es-set-tostringtag`, `is-array-buffer`
* [Tests] increase coverage
* [Tests] exclude coverage from files that have been replaced by an extracted package
1.21.0 / 2023-01-04
=================
* [New] `ES2015`+: add `IsDetachedBuffer`
* [New] `ES2015+`: add `DetachArrayBuffer`
* [New] `ES2020`+: add `NumericToRawBytes`
* [New] `ES2017` - `ES2019`: add `NumberToRawBytes`
* [New] `ES2020+`: add `RawBytesToNumeric`
* [New] `ES2017-ES2019`: add `RawBytesToNumber`
* [New] `ES2017`+: add `ValidateAtomicAccess`
* [New] `ES2021`+: add `ValidateIntegerTypedArray`
* [New] `ES2015`+: add `ValidateTypedArray`
* [New] `ES2015`+: add `GetGlobalObject`
* [New] `ES2022`+: add `TypedArrayElementSize`, `TypedArrayElementType`
* [New] `ES2015`+: add `max`, `min`
* [New] `helpers/assertRecord`: add predicates for PromiseCapability and AsyncGeneratorRequest Records
* [New] `ES2018`+: add `AsyncIteratorClose`
* [New] `ES2015`+: `IteratorClose`: also accept a Completion Record instance instead of a completion thunk
* [New] `ES2015`+ (CompletionRecord, NormalCompletion), `ES2018`+ (ThrowCompletion): add new AOs
* [New] `ES2015`+ (`ObjectCreate`) and `ES2020`+ (`OrdinaryObjectCreate`): use `internal-slot` to support additional slots
* [New] `ES2018`+: add `CreateAsyncFromSyncIterator`
* [patch] `ES2015`+: `GetMethod`: better failure message
* [Refactor] use `es-set-tostringtag` package
* [Refactor] use `has-proto` package
* [Deps] update `has-proto`, `es-set-tostringtag`, `internal-slot`
* [meta] fix spackle script to `git add` after all writing is done
* [meta] autogenerate esX entry points
* [meta] use a leading slash in gitattributes for proper spackle matching
* [Tests] fix comments on missing AOs
* [Tests] filter out host-defined AOs
* [Dev Deps] update `@ljharb/eslint-config`, `aud`
1.20.5 / 2022-12-07
=================
* [Fix] `ES2020+`: `floor`: make it work with BigInts as well
* [Refactor] use `gopd`
* [Tests] add `mod` helper tests (#147)
* [Deps] update `string.prototype.trimend`, `string.prototype.trimstart`
* [Dev Deps] update `array.prototype.filter`, `array.prototype.flatmap`, `array.prototype.indexof`, `object.fromentries`
1.20.4 / 2022-10-06
=================
* [Fix] `ES2021+`: values that truncate to -0 in `ToIntegerOrInfinity` (#146)
* [Deps] update `is-callable`
1.20.3 / 2022-09-22
=================
* [Refactor] extract regex tester to `safe-regex-test` package
* [Deps] update `get-intrinsic`, `is-callable`
* [Dev Deps] update `aud`, `tape`
1.20.2 / 2022-09-01
=================
* [Fix] `ES2020+`: `SameValueNonNumeric`: properly throw on BigInt values
* [Deps] update `object.assign`, `get-intrinsic`, `object-inspect`
* [Dev Deps] update `array.prototype.indexof`, `diff`, `es-value-fixtures`, `tape`
* [meta] `spackle`: always mkdirp new files to be written
* [Tests] fix vscode auto-const from 8fc256d
1.20.1 / 2022-05-16
=================
* [Fix] `thisTimeValue`: use `getTime`, not `valueOf`, to get the time value
* [Refactor] create `IsArray` helper
* [Deps] update `regexp.prototype.flags`
* [Dev Deps] use `for-each` instead of `foreach`
1.20.0 / 2022-05-05
=================
* [New] add ES2022
* [New] `ES2015+`: add `ObjectDefineProperties`
* [Refactor] create `fromPropertyDescriptor` helper
* [Refactor] use `has-property-descriptors`
* [Deps] update `string.prototype.trimend`, `string.prototype.trimstart`, `unbox-primitive`
* [meta] use `npmignore` to autogenerate an npmignore file
* [Dev Deps] update `es-value-fixtures`, `has-bigints`, `functions-have-names`
* [Tests] copy GetIntrinsic tests over from `get-intrinsic`
1.19.5 / 2022-04-13
=================
* [Fix] `DefineOwnProperty`: FF 4-22 throws an exception when defining length of an array
* [Dev Deps] update `@ljharb/eslint-config`
1.19.4 / 2022-04-12
=================
* [Fix] `ES2015+`: `CreateDataProperty`: a nonwritable but configurable property is still converted to a data property
1.19.3 / 2022-04-11
=================
* [Fix] `ES2015+`: `GetIterator`, `IterableToArrayLike`: in Symbol-less envs, handle boxed string objects
* [Robustness] use `exec` instead of `test`, since the latter observably looks up `exec`
* [Deps] update `is-shared-array-buffer`
* [actions] restrict permissions
* [Dev Deps] update `tape`
* [Tests] add test coverage
* [Tests] avoid a bug in node v4.0 with bound function names
1.19.2 / 2022-03-28
=================
* [Fix] `ES2018+`: `EnumerableOwnPropertyNames`, `ToIntegerOrInfinity`, `UTF16SurrogatePairToCodePoint`: proper function names
* [Fix] `ES2015+`: `GetOwnPropertyKeys`/`IsExtensible`/`{Set,Test}IntegrityLevel`: avoid a crash in IE 8 on missing ES5 intrinsics
* [Fix] `helpers/DefineOwnProperty`: avoid a crash in IE 8
* [Fix] `ES2015+`: `StringCreate`: properly check for `prototype` being `String.prototype`
* [Docs] `ES2015+`: `GetV`: Fix spec URL
* [meta] operations: use a URL object instead of a URL string
* [meta] remove defunct greenkeeper config
* [meta] better `eccheck` command; fix indentation
* [Tests] node v0.6 lacks `RegExp.prototype.source`
* [Tests] remove a stray `console.log`
* [Tests] properly set the lastIndex in IE 8
* [Tests] skip test due to IE 6-8 sparse/undefined bug
* [Tests] in IE 8, an empty regex is `` and not `(?:)`
* [Tests] ES3 engines dont have `.bind`
* [Tests] avoid needless failures in ES3 engines that don't support descriptors
* [Tests] add test to cover https://github.com/tc39/ecma262/issues/2611
* [Deps] update `has-symbols`, `is-negative-zero`, `is-weakref`, `object-inspect`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object.fromentries`, `safe-publish-latest`, `tape`
* [actions] reuse common workflows
* [actions] update codecov uploader
1.19.1 / 2021-10-02
=================
* [Fix] `ES2020+`: `CreateRegExpStringIterator`: should not have enumerable methods
* [Dev Deps] update `array.prototype.filter`, `array.prototype.indexof`
1.19.0 / 2021-09-30
=================
* [New] `ES2021+`: `IterableToList`: make `method` parameter optional (#61)
* [New] add ES2021
* [New] `ES2020+`: add `StringToBigInt`, `ToBigInt`, `ToBigInt64`, `ToBigUint64`
* [New] `ES2017`+: add `IsSharedArrayBuffer`, `OrdinaryToPrimitive`
* [New] `ES2015+`: add `CharacterRange`, `IsCompatiblePropertyDescriptor`
* [New] `ES2020+`: add `CreateRegExpStringIterator`
* [Fix] `ES2020+`: `ToBigInt64`/`ToBigUint64`: avoid node v10.4-v10.8 bug with limited BigInt range
* [Fix] `ES2020+`: `AbstractRelationalComparison`, `AbstractEqualityComparison`: support BigInt
* [Fix] `ES2020+`: `ToBigInt64`/`ToBigUint64`: Improve the definitions of twoSixtyThree and twoSixtyFour (#140)
* [meta] do not publish .gitattributes
* [Tests] Correct the behavior of `safeBigInt`
* [Tests] Exclude dotfiles from the testing sweep (#141)
1.18.7 / 2021-09-28
=================
* [Fix] `getOwnPropertyDescriptor` helper: avoid crashing in IE < 9
* [Fix] `ArraySetLength`: `node` `v0.6` has a bug where array lengths can be Set but not Defined
* [eslint] remove unused directive
* [Tests] fix spelling
1.18.6 / 2021-09-07
=================
* [Fix] `ES2020+`: `NumberToBigInt`: throw a SyntaxError when BigInts are not supported
* [Refactor] extract getSymbolDescription logic to `get-symbol-description`
* [Refactor] `ES2018+`: `AbstractRelationalComparison`: use `IsStringPrefix`
* [Deps] update `is-callable`, `is-regex`, `is-string`
* [Dev Deps] update `@ljharb/eslint-config`, `tape`
* [Tests] `GetSubstitution`: add cases
1.18.5 / 2021-08-01
=================
* [meta] remove "exports" (#133)
* [Dev Deps] update `eslint`
1.18.4 / 2021-07-29
=================
* [meta] partial revert of b54cfe8525faff482450e843a49d43be3a086225
* [Deps] update `internal-slot`, `object-inspect`
* [Dev Deps] update `eslint`, `tape`
* [Tests] `ArraySetLength`: increase coverage
1.18.3 / 2021-05-27
=================
* [Fix] `ES2020+`: `ToNumber`: ensure it throws on a BigInt (#130)
1.18.2 / 2021-05-25
=================
* [meta] add `helpers` to "exports" field, for back compat
1.18.1 / 2021-05-25
=================
* [readme] update and clarify entry points
* [meta] add "exports" field, with escape hatch
* [meta] add `sideEffects` field
* [meta] use `prepublishOnly`, for npm 7+
* [eslint] clean up eslint rules
* [Deps] update `is-regex`, `is-string`, `object-inspect`, `unbox-primitive`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape`
* [actions] disable fail-fast on matrix jobs
* [actions] use `node/install` action instead of `node/run`
* [actions] update codeql-analysis to new best practices
1.18.0 / 2021-03-03
=================
* [New] add `ES2020`, and a number of additional AOs: See the changelog entries for the prereleases for more information:
- [next.3](./CHANGELOG.md#1180-next3--2021-03-01)
- [next.2](./CHANGELOG.md#1180-next2--2021-01-17)
- [next.1](./CHANGELOG.md#1180-next1--2020-09-30)
- [next.0](./CHANGELOG.md#1180-next0--2020-08-14)
* [Refactor] `ES5+`: `Abstract Relational Comparison`: increase coverage
* [Tests] increase coverage
* [Tests] do not run coverage on node 0.6
1.18.0-next.3 / 2021-03-01
=================
* [New] `ES2015`: add `StringGetIndexProperty`
* [New] `ES2015+`: add `RegExpCreate`, `SplitMatch`, `StringCreate`
* [New] `ES2016-ES2019`: add `UTF16Decode`
* [New] `ES2020+`: add `NumberToBigInt`
* [New] `ES2020+: add `BigInt::`/`Number::` methods:
* [Fix] `ES5`: `ToNumber`: properly refuse to parse ES6+ forms
* [Fix] `ES2015+`: `Invoke`: optional argumentsList must be a List of arguments, not a list of arguments
* [Fix] `ES2016+`: `UTF16Encoding`: properly return a string code point instead of a numeric code point
* [Fix] `ES2020`: `NumberBitwiseOp`: assert that x and y are Numbers
* [readme] remove travis/testling badge, fix repo URLs
* [meta] `ES2015`: add missing `CreateArrayIterator` AO
* [meta] `ES2015-ES2017`: add missing `DaylightSavingTA` AO
* [meta] rerun `npm run spackle` to update URLs left after 11d8c8df11c0d15d094a6035afed662e22b440ef
* [meta] update ecma URLs
* [meta] unignore 2020 operations list
* [meta] update operations scripts linting
* [meta] refactor getOps script to fetch all years at once
* [meta] refactor operations script to keep years in one place
* [meta] fix ES2015 spec URL
* [Deps] update `has-symbols`, `string.prototype.trimend`, `string.prototype.trimstart`, `get-intrinsic`, `is-callable`, `is-regex`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `array.prototype.indexof`, `aud`, `es-value-fixtures`, `object.fromentries`, `tape`, `diff`
* [operations] detect ES2020+ style `T::` numeric operations
* [Tests] increase coverage
* [Tests] `BigInt(1e17)` throws on node v10.4-v10.6
* [Tests] improve coverage on `Number::` methods
* [Tests] `tape` v5 `.equal` now uses strict equality, so no more need for `is()`
* [Tests] improve BigInt:: and Number:: coverage
* [Tests] actually run all the helpers tests
* [Tests] ensure "expected missing" ops list is accurate
* [Tests] abstract away per-operation skips
* [Tests] skip BigInt:: tests on envs without BigInts
* [Tests] use `es-value-fixtures`
* [actions] update workflows
1.18.0-next.2 / 2021-01-17
=================
* [New] `helpers`: add `isByteValue`, `isCodePoint`, `some`
* [Fix] `ES2018+`: fix `GetSubstitution` with named captures
* [Fix] `ES2020`: `GetIterator`: add omitted `hint` parameter
* [Fix] `ES2018`/`ES2019`: `SetFunctionLength`: Infinities should throw
* [Fix] `ES2020`: `ToIndex` uses `SameValue` instead of `SameValueZero`
* [Fix] `ES2020`: `CopyDataProperties` uses `CreateDataPropertyOrThrow` instead of `CreateDataProperty`
* [Refactor] use extracted `call-bind` instead of local helpers
* [Refactor] use extracted `get-intrinsic` package
* [Deps] update `call-bind`, `get-intrinsic`, `is-callable`, `is-negative-zero`, `is-regex`, `object-inspect`, `object.assign`, `string.prototype.trimend`, `string.prototype.trimstart`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `array.prototype.indexof`, `aud`, `diff`, `functions-have-names`, `has-bigints`, `has-strict-mode`, `object-is`, `object.fromentries`, `tape`
* [actions] switch Automatic Rebase workflow to `pull_request_target` event
* [actions] add "Allow Edits" workflow
* [meta] pin cheerio to v1.0.0-rc.3, to fix getOps
* [meta] make all URLs consistent, and point to spec artifacts
* [meta] refactor `deltas` script; update eslint on operations scripts
* [meta] do not publish .github dir (#123)
* [Tests] add `v.notNonNegativeIntegers`, `v.nonConstructorFunctions`
* [Tests] migrate tests to Github Actions
* [Tests] run coverage on all tests
* [Tests] add `npm run test:ses`
1.18.0-next.1 / 2020-09-30
=================
* [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116)
* [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115)
* [Fix] `callBind`: ensure compatibility with SES
* [Deps] update `is-callable`, `object.assign`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`
* [eslint] fix warning
* [Tests] temporarily allow SES tests to fail (#115)
* [Tests] ses-compat - initialize module after ses lockdown (#113)
* [Tests] [Refactor] use defineProperty helper rather than assignment
* [Tests] [Refactor] clean up defineProperty test helper
1.18.0-next.0 / 2020-08-14
=================
* [New] add `ES2020`
* [New] `GetIntrinsic`: add `%AggregateError%`, `%FinalizationRegistry%`, and `%WeakRef%`
* [New] `ES5`+: add `abs`, `floor`; use `modulo` consistently
* [New] `GetIntrinsic`: Cache accessed intrinsics (#98)
* [New] `GetIntrinsic`: Add ES201x function intrinsics (#97)
* [New] `ES2015`+: add `QuoteJSONString`, `OrdinaryCreateFromConstructor`
* [New] `ES2017`+: add `StringGetOwnProperty`
* [New] `ES2016`+: add `UTF16Encoding`
* [New] `ES2018`+: add `SetFunctionLength`, `UnicodeEscape`
* [New] add `isLeadingSurrogate`/`isTrailingSurrogate` helpers
* [Fix] `ES5`+: `ToPropertyDescriptor`: use intrinsic TypeError
* [Fix] `ES2018+`: `CopyDataProperties`/`NumberToString`: use intrinsic TypeError
* [Deps] update `is-regex`, `object-inspect`
* [Dev Deps] update `eslint`
1.17.7 / 2020-09-30
=================
* [Fix] `ES2020`: `ToInteger`: `-0` should always be normalized to `+0` (#116)
* [patch] `GetIntrinsic`: Adapt to override-mistake-fix pattern (#115)
* [Fix] `callBind`: ensure compatibility with SES
* [Deps] update `is-callable`, `is-regex`, `object-inspect`, `object.assign`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`
1.17.6 / 2020-06-13
=================
* [Fix] `helpers/getSymbolDescription`: use the global Symbol registry when available (#92)
* [Fix] `ES2015+`: `IsConstructor`: when `Reflect.construct` is available, be spec-accurate (#93)
* [Fix] `ES2015+`: `Set`: Always return boolean value (#101)
* [Fix] `ES2015+`: `Set`: ensure exceptions are thrown in IE 9 when requested
* [Fix] Use `Reflect.apply(…)` if available (#99)
* [Fix] `helpers/floor`: module-cache `Math.floor`
* [Fix] `helpers/getSymbolDescription`: Prefer bound `description` getter when present
* [Fix] `2016`: Use `getIteratorMethod` in `IterableToArrayLike` (#94)
* [Fix] `helpers/OwnPropertyKeys`: Use `Reflect.ownKeys(…)` if available (#91)
* [Fix] `2018+`: Fix `CopyDataProperties` depending on `this` (#95)
* [meta] mark spackled files as autogenerated
* [meta] `Type`: fix spec URL
* [meta] `ES2015`: complete ops list
* [Deps] update `iscallable`, `isregex`
* [Deps] switch from `string.prototype.trimleft`/`string.prototype.trimright` to `string.prototype.trimstart`/`string.prototype.trimend`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `in-publish`, `object-is`, `tape`; add `aud`
* [eslint] `helpers/isPropertyDescriptor`: fix indentation
* [Tests] `helpers/getSymbolDescription`: add test cases; some envs have `Symbol.for` but can not infer a name (#92)
* [Tests] try out CodeQL analysis
* [Tests] reformat expected missing ops
* [Tests] Run tests with `undefined` this (#96)
1.17.5 / 2020-03-22
=================
* [Fix] `CreateDataProperty`: update an existing property
* [Fix] run missing spackle from cd7504701879ddea0f5981e99cbcf93bfea9171d
* [Dev Deps] update `make-arrow-function`, `tape`, `@ljharb/eslint-config`
1.17.4 / 2020-01-21
=================
* [Fix] `2015+`: add code to handle IE 8s problems
* [Tests] fix tests for IE 8
1.17.3 / 2020-01-19
=================
* [Fix] `ObjectCreate` `2015+`: Fall back to `__proto__` and normal `new` in older browsers
* [Fix] `GetIntrinsic`: ensure the `allowMissing` property actually works on dotted intrinsics
1.17.2 / 2020-01-14
=================
* [Fix] `helpers/OwnPropertyKeys`: include non-enumerables too
1.17.1 / 2020-01-14
=================
* [Refactor] add `OwnPropertyKeys` helper, use it in `CopyDataProperties`
* [Refactor] `IteratorClose`: remove useless assignment
* [Dev Deps] update `eslint`, `tape`, `diff`
1.17.0 / 2019-12-20
=================
* [New] Split up each operation into its own file (prereleased)
* [Fix] `GetIntrinsic`: IE 8 has a broken `Object.getOwnPropertyDescriptor`
* [Fix] `object.assign` is a runtime dep (prereleased)
* [Refactor] `GetIntrinsic`: remove the internal property salts, since % already handles that
* [Refactor] `GetIntrinsic`: further simplification
* [Deps] update `is-callable`, `string.prototype.trimleft`, `string.prototype.trimright`, `is-regex`
* [Dev Deps] update `@ljharb/eslint-config`, `object-is`, `object.fromentries`, `tape`
* [Tests] add `.eslintignore`
* [meta] remove unused Makefile and associated utils
* [meta] only run spackle script in publish (#78) (prereleased)
1.17.0-next.1 / 2019-12-11
=================
* [Fix] `object.assign` is a runtime dep
* [meta] only run spackle script in publish (#78)
1.17.0-next.0 / 2019-12-11
=================
* [New] Split up each operation into its own file
1.16.3 / 2019-12-04
=================
* [Fix] `GetIntrinsic`: when given a path to a getter, return the actual getter
* [Dev Deps] update `eslint`
1.16.2 / 2019-11-24
=================
* [Fix] IE 6-7 lack JSON
* [Fix] IE 6-8 strings cant use array slice, they need string slice
* [Dev Deps] update `eslint`
1.16.1 / 2019-11-24
=================
* [Fix] `GetIntrinsics`: turns out IE 8 throws when `Object.getOwnPropertyDescriptor(arguments);`, and does not throw on `callee` anyways
* [Deps] update `es-to-primitive`, `has-symbols`, `object-inspect`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`
* [meta] re-include year files inside `operations`
* [meta] add `funding` field
* [actions] add Automatic Rebase github action
* [Tests] use shared travis-ci config
* [Tests] disable `check-coverage`, and let codecov do it
1.16.0 / 2019-10-18
=================
* [New] `ES2015+`: add `SetFunctionName`
* [New] `ES2015+`: add `GetPrototypeFromConstructor`, with caveats
* [New] `ES2015+`: add `CreateListFromArrayLike`
* [New] `ES2016+`: add `OrdinarySetPrototypeOf`
* [New] `ES2016+`: add `OrdinaryGetPrototypeOf`
* [New] add `getSymbolDescription` and `getInferredName` helpers
* [Fix] `GetIterator`: add fallback for pre-Symbol environments, tests
* [Dev Deps] update `object.fromentries`
* [Tests] add `node` `v12.2`
1.15.0 / 2019-10-02
=================
* [New] `ES2018`+: add `DateString`, `TimeString`
* [New] `ES2015`+: add `ToDateString`
* [New] `ES5`+: add `msFromTime`, `SecFromTime`, `MinFromTime`, `HourFromTime`, `TimeWithinDay`, `Day`, `DayFromYear`, `TimeFromYear`, `YearFromTime`, `WeekDay`, `DaysInYear`, `InLeapYear`, `DayWithinYear`, `MonthFromTime`, `DateFromTime`, `MakeDay`, `MakeDate`, `MakeTime`, `TimeClip`, `modulo`
* [New] add `regexTester` helper
* [New] add `callBound` helper
* [New] add ES2020s intrinsic dot notation
* [New] add `isPrefixOf` helper
* [New] add `maxSafeInteger` helper
* [Deps] update `string.prototype.trimleft`, `string.prototype.trimright`
* [Dev Deps] update `eslint`
* [Tests] on `node` `v12.11`
* [meta] npmignore operations scripts; add "deltas"
1.14.2 / 2019-09-08
=================
* [Fix] `ES2016`: `IterableToArrayLike`: add proper fallback for strings, pre-Symbols
* [Tests] on `node` `v12.10`
1.14.1 / 2019-09-03
=================
* [meta] republish with some extra files removed
1.14.0 / 2019-09-02
=================
* [New] add ES2019
* [New] `ES2017+`: add `IterableToList`
* [New] `ES2016`: add `IterableToArrayLike`
* [New] `ES2015+`: add `ArrayCreate`, `ArraySetLength`, `OrdinaryDefineOwnProperty`, `OrdinaryGetOwnProperty`, `OrdinaryHasProperty`, `CreateHTML`, `GetOwnPropertyKeys`, `InstanceofOperator`, `SymbolDescriptiveString`, `GetSubstitution`, `ValidateAndApplyPropertyDescriptor`, `IsPromise`, `OrdinaryHasInstance`, `TestIntegrityLevel`, `SetIntegrityLevel`
* [New] add `callBind` helper, and use it
* [New] add helpers: `isPropertyDescriptor`, `every`
* [New] ES5+: add `Abstract Relational Comparison`
* [New] ES5+: add `Abstract Equality Comparison`, `Strict Equality Comparison`
* [Fix] `ES2015+`: `GetIterator`: only require native Symbols when `method` is omitted
* [Fix] `ES2015`: `Call`: error message now properly displays Symbols using `object-inspect`
* [Fix] `ES2015+`: `ValidateAndApplyPropertyDescriptor`: use ES2017 logic to bypass spec bugs
* [Fix] `ES2015+`: `CreateDataProperty`, `DefinePropertyOrThrow`, `ValidateAndApplyPropertyDescriptor`: add fallbacks for ES3
* [Fix] `ES2015+`: `FromPropertyDescriptor`: no longer requires a fully complete Property Descriptor
* [Fix] `ES5`: `IsPropertyDescriptor`: call into `IsDataDescriptor` and `IsAccessorDescriptor`
* [Refactor] use `has-symbols` for Symbol detection
* [Fix] `helpers/assertRecord`: remove `console.log`
* [Deps] update `object-keys`
* [readme] add security note
* [meta] change http URLs to https
* [meta] linter cleanup
* [meta] fix getOps script
* [meta] add FUNDING.yml
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `semver`, `replace`, `cheerio`, `tape`
* [Tests] up to `node` `v12.9`, `v11.15`, `v10.16`, `v8.16`, `v6.17`
* [Tests] temporarily allow node 0.6 to fail; segfaulting in travis
* [Tests] use the values helper more in es5 tests
* [Tests] fix linting to apply to all files
* [Tests] run `npx aud` only on prod deps
* [Tests] add v.descriptors helpers
* [Tests] use `npx aud` instead of `npm audit` with hoops
* [Tests] use `eclint` instead of `editorconfig-tools`
* [Tests] some intrinsic cleanup
* [Tests] migrate es5 tests to use values helper
* [Tests] add some missing ES2015 ops
1.13.0 / 2019-01-02
=================
* [New] add ES2018
* [New] add ES2015/ES2016: EnumerableOwnNames; ES2017: EnumerableOwnProperties
* [New] `ES2015+`: add `thisBooleanValue`, `thisNumberValue`, `thisStringValue`, `thisTimeValue`
* [New] `ES2015+`: add `DefinePropertyOrThrow`, `DeletePropertyOrThrow`, `CreateMethodProperty`
* [New] add `assertRecord` helper
* [Deps] update `is-callable`, `has`, `object-keys`, `es-to-primitive`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `semver`, `safe-publish-latest`, `replace`
* [Tests] use `npm audit` instead of `nsp`
* [Tests] remove `jscs`
* [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16`
* [Tests] move descriptor factories to `values` helper
* [Tests] add `getOps` to programmatically fetch abstract operation names
1.12.0 / 2018-05-31
=================
* [New] add `GetIntrinsic` entry point
* [New] `ES2015`+: add `ObjectCreate`
* [Robustness]: `ES2015+`: ensure `Math.{abs,floor}` and `Function.call` are cached
1.11.0 / 2018-03-21
=================
* [New] `ES2015+`: add iterator abstract ops
* [Dev Deps] update `eslint`, `nsp`, `object.assign`, `semver`, `tape`
* [Tests] up to `node` `v9.8`, `v8.10`, `v6.13`
1.10.0 / 2017-11-24
=================
* [New] ES2015+: `AdvanceStringIndex`
* [Dev Deps] update `eslint`, `nsp`
* [Tests] require node 0.6 to pass again
* [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS
1.9.0 / 2017-09-30
=================
* [New] `es2015+`: add `ArraySpeciesCreate`
* [New] ES2015+: add `CreateDataProperty` and `CreateDataPropertyOrThrow`
* [Tests] consolidate duplicated tests
* [Tests] increase coverage
* [Dev Deps] update `nsp`, `eslint`
1.8.2 / 2017-09-03
=================
* [Fix] `es2015`+: `ToNumber`: provide the proper hint for Date objects (#27)
* [Dev Deps] update `eslint`
1.8.1 / 2017-08-30
=================
* [Fix] ES2015+: `ToPropertyKey`: should return a symbol for Symbols (#26)
* [Deps] update `function-bind`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`
* [Docs] github broke markdown parsing
1.8.0 / 2017-08-04
=================
* [New] add ES2017
* [New] move es6+ to es2015+; leave es6/es7 as aliases
* [New] ES5+: add `IsPropertyDescriptor`, `IsAccessorDescriptor`, `IsDataDescriptor`, `IsGenericDescriptor`, `FromPropertyDescriptor`, `ToPropertyDescriptor`
* [New] ES2015+: add `CompletePropertyDescriptor`, `Set`, `HasOwnProperty`, `HasProperty`, `IsConcatSpreadable`, `Invoke`, `CreateIterResultObject`, `RegExpExec`
* [Fix] es7/es2016: do not mutate ES6
* [Fix] assign helper only supports one source
* [Deps] update `is-regex`
* [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `tape`
* [Tests] add tests for missing and excess operations
* [Tests] add codecov for coverage
* [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v4.8`; newer npm breaks on older node
* [Tests] use same lists of value types across tests; ensure tests are the same when ops are the same
* [Tests] ES2015: add ToNumber symbol tests
* [Tests] switch to `nyc` for code coverage
* [Tests] make IsRegExp tests consistent across editions
1.7.0 / 2017-01-22
=================
* [New] ES6: Add `GetMethod` (#16)
* [New] ES6: Add `GetV` (#16)
* [New] ES6: Add `Get` (#17)
* [Tests] up to `node` `v7.4`, `v6.9`, `v4.6`; improve test matrix
* [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`
1.6.1 / 2016-08-21
=================
* [Fix] ES6: IsConstructor should return true for `class` constructors.
1.6.0 / 2016-08-20
=================
* [New] ES5 / ES6: add `Type`
* [New] ES6: `SpeciesConstructor`
* [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`; add `safe-publish-latest`
* [Tests] up to `node` `v6.4`, `v5.12`, `v4.5`
1.5.1 / 2016-05-30
=================
* [Fix] `ES.IsRegExp`: actually look up `Symbol.match` on the argument
* [Refactor] create `isNaN` helper
* [Deps] update `is-callable`, `function-bind`
* [Deps] update `es-to-primitive`, fix ES5 tests
* [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`, `nsp`
* [Tests] up to `node` `v6.2`, `v5.11`, `v4.4`
* [Tests] use pretest/posttest for linting/security
1.5.0 / 2015-12-27
=================
* [New] adds `Symbol.toPrimitive` support via `es-to-primitive`
* [Deps] update `is-callable`, `es-to-primitive`
* [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `tape`
* [Tests] up to `node` `v5.3`
1.4.3 / 2015-11-04
=================
* [Fix] `ES6.ToNumber`: should give `NaN` for explicitly signed hex strings (#4)
* [Refactor] `ES6.ToNumber`: No need to double-trim
* [Refactor] group tests better
* [Tests] should still pass on `node` `v0.8`
1.4.2 / 2015-11-02
=================
* [Fix] ensure `ES.ToNumber` trims whitespace, and does not trim non-whitespace (#3)
1.4.1 / 2015-10-31
=================
* [Fix] ensure only 0-1 are valid binary and 0-7 are valid octal digits (#2)
* [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`
* [Tests] on `node` `v5.0`
* [Tests] fix npm upgrades for older node versions
* package.json: use object form of "authors", add "contributors"
1.4.0 / 2015-09-26
=================
* [Deps] update `is-callable`
* [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config`
* [Tests] on `node` `v4.2`
* [New] Add `SameValueNonNumber` to ES7
1.3.2 / 2015-09-26
=================
* [Fix] Fix `ES6.IsRegExp` to properly handle `Symbol.match`, per spec.
* [Tests] up to `io.js` `v3.3`, `node` `v4.1`
* [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`
1.3.1 / 2015-08-15
=================
* [Fix] Ensure that objects that `toString` to a binary or octal literal also convert properly
1.3.0 / 2015-08-15
=================
* [New] ES6s ToNumber now supports binary and octal literals.
* [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`
* [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG
* [Tests] up to `io.js` `v3.0`
1.2.2 / 2015-07-28
=================
* [Fix] Both `ES5.CheckObjectCoercible` and `ES6.RequireObjectCoercible` return the value if they don't throw.
* [Tests] Test on latest `io.js` versions.
* [Dev Deps] Update `eslint`, `jscs`, `tape`, `semver`, `covert`, `nsp`
1.2.1 / 2015-03-20
=================
* Fix `isFinite` helper.
1.2.0 / 2015-03-19
=================
* Use `es-to-primitive` for ToPrimitive methods.
* Test on latest `io.js` versions; allow failures on all but 2 latest `node`/`io.js` versions.
1.1.2 / 2015-03-20
=================
* Fix isFinite helper.
1.1.1 / 2015-03-19
=================
* Fix isPrimitive check for functions
* Update `eslint`, `editorconfig-tools`, `semver`, `nsp`
1.1.0 / 2015-02-17
=================
* Add ES7 export (non-default).
* All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`.
* Test on `iojs-v1.2`.
1.0.1 / 2015-01-30
=================
* Use `is-callable` instead of an internal function.
* Update `tape`, `jscs`, `nsp`, `eslint`
1.0.0 / 2015-01-10
=================
* v1.0.0

View File

@@ -0,0 +1,183 @@
import type { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree';
import type { ClassicConfig } from './Config';
import type { Linter } from './Linter';
import type { ParserOptions } from './ParserOptions';
import type { ReportDescriptorMessageData, RuleCreateFunction, RuleModule, SharedConfigurationSettings } from './Rule';
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface ValidTestCase<Options extends readonly unknown[]> {
/**
* Code for the test case.
*/
readonly code: string;
/**
* Environments for the test case.
*/
readonly env?: Readonly<Linter.EnvironmentConfig>;
/**
* The fake filename for the test case. Useful for rules that make assertion about filenames.
*/
readonly filename?: string;
/**
* The additional global variables.
*/
readonly globals?: Readonly<Linter.GlobalsConfig>;
/**
* Name for the test case.
*/
readonly name?: string;
/**
* Run this case exclusively for debugging in supported test frameworks.
*/
readonly only?: boolean;
/**
* Options for the test case.
*/
readonly options?: Readonly<Options>;
/**
* The absolute path for the parser.
*/
readonly parser?: string;
/**
* Options for the parser.
*/
readonly parserOptions?: Readonly<ParserOptions>;
/**
* Settings for the test case.
*/
readonly settings?: Readonly<SharedConfigurationSettings>;
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface SuggestionOutput<MessageIds extends string> {
/**
* The data used to fill the message template.
*/
readonly data?: ReportDescriptorMessageData;
/**
* Reported message ID.
*/
readonly messageId: MessageIds;
/**
* NOTE: Suggestions will be applied as a stand-alone change, without triggering multi-pass fixes.
* Each individual error has its own suggestion, so you have to show the correct, _isolated_ output for each suggestion.
*/
readonly output: string;
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface InvalidTestCase<MessageIds extends string, Options extends readonly unknown[]> extends ValidTestCase<Options> {
/**
* Expected errors.
*/
readonly errors: readonly TestCaseError<MessageIds>[];
/**
* The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested.
*/
readonly output?: string | string[] | null;
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface TestCaseError<MessageIds extends string> {
/**
* The 1-based column number of the reported start location.
*/
readonly column?: number;
/**
* The data used to fill the message template.
*/
readonly data?: ReportDescriptorMessageData;
/**
* The 1-based column number of the reported end location.
*/
readonly endColumn?: number;
/**
* The 1-based line number of the reported end location.
*/
readonly endLine?: number;
/**
* The 1-based line number of the reported start location.
*/
readonly line?: number;
/**
* Reported message ID.
*/
readonly messageId: MessageIds;
/**
* Reported suggestions.
*/
readonly suggestions?: readonly SuggestionOutput<MessageIds>[] | null;
/**
* The type of the reported AST node.
*/
readonly type?: AST_NODE_TYPES | AST_TOKEN_TYPES;
}
/**
* @param text a string describing the rule
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export type RuleTesterTestFrameworkFunction = (text: string, callback: () => void) => void;
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface RunTests<MessageIds extends string, Options extends readonly unknown[]> {
readonly invalid: readonly InvalidTestCase<MessageIds, Options>[];
readonly valid: readonly (string | ValidTestCase<Options>)[];
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface RuleTesterConfig extends ClassicConfig.Config {
readonly parser: string;
readonly parserOptions?: Readonly<ParserOptions>;
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
declare class RuleTesterBase {
/**
* Creates a new instance of RuleTester.
* @param testerConfig extra configuration for the tester
*/
constructor(testerConfig?: RuleTesterConfig);
/**
* Adds a new rule test to execute.
* @param ruleName The name of the rule to run.
* @param rule The rule to test.
* @param tests The collection of tests to run.
*/
run<MessageIds extends string, Options extends readonly unknown[]>(ruleName: string, rule: RuleModule<MessageIds, Options>, tests: RunTests<MessageIds, Options>): void;
/**
* If you supply a value to this property, the rule tester will call this instead of using the version defined on
* the global namespace.
*/
static get describe(): RuleTesterTestFrameworkFunction;
static set describe(value: RuleTesterTestFrameworkFunction | undefined);
/**
* If you supply a value to this property, the rule tester will call this instead of using the version defined on
* the global namespace.
*/
static get it(): RuleTesterTestFrameworkFunction;
static set it(value: RuleTesterTestFrameworkFunction | undefined);
/**
* If you supply a value to this property, the rule tester will call this instead of using the version defined on
* the global namespace.
*/
static get itOnly(): RuleTesterTestFrameworkFunction;
static set itOnly(value: RuleTesterTestFrameworkFunction | undefined);
/**
* Define a rule for one particular run of tests.
*/
defineRule<MessageIds extends string, Options extends readonly unknown[]>(name: string, rule: RuleCreateFunction<MessageIds, Options> | RuleModule<MessageIds, Options>): void;
}
declare const RuleTester_base: typeof RuleTesterBase;
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export declare class RuleTester extends RuleTester_base {
}
export {};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/app-render/module-loading/track-dynamic-import.ts"],"sourcesContent":["import { InvariantError } from '../../../shared/lib/invariant-error'\nimport { isThenable } from '../../../shared/lib/is-thenable'\nimport { trackPendingImport } from './track-module-loading.external'\n\n/**\n * in CacheComponents, `import(...)` will be transformed into `trackDynamicImport(import(...))`.\n * A dynamic import is essentially a cached async function, except it's cached by the module system.\n *\n * The promises are tracked globally regardless of if the `import()` happens inside a render or outside of it.\n * When rendering, we can make the `cacheSignal` wait for all pending promises via `trackPendingModules`.\n * */\nexport function trackDynamicImport<TExports extends Record<string, any>>(\n modulePromise: Promise<TExports>\n): Promise<TExports> {\n if (process.env.NEXT_RUNTIME === 'edge') {\n throw new InvariantError(\n \"Dynamic imports should not be instrumented in the edge runtime, because `cacheComponents` doesn't support it\"\n )\n }\n\n if (!isThenable(modulePromise)) {\n // We're expecting `import()` to always return a promise. If it's not, something's very wrong.\n throw new InvariantError(\n '`trackDynamicImport` should always receive a promise. Something went wrong in the dynamic imports transform.'\n )\n }\n\n // Even if we're inside a prerender and have `workUnitStore.cacheSignal`, we always track the promise globally.\n // (i.e. via the global `moduleLoadingSignal` that `trackPendingImport` uses internally).\n //\n // We do this because the `import()` promise might be cached in userspace:\n // (which is quite common for e.g. lazy initialization in libraries)\n //\n // let promise;\n // function doDynamicImportOnce() {\n // if (!promise) {\n // promise = import(\"...\");\n // // transformed into:\n // // promise = trackDynamicImport(import(\"...\"));\n // }\n // return promise;\n // }\n //\n // If multiple prerenders (e.g. multiple pages) depend on `doDynamicImportOnce`,\n // we have to wait for the import *in all of them*.\n // If we only tracked it using `workUnitStore.cacheSignal.trackRead()`,\n // then only the first prerender to call `doDynamicImportOnce` would wait --\n // Subsequent prerenders would re-use the existing `promise`,\n // and `trackDynamicImport` wouldn't be called again in their scope,\n // so their respective CacheSignals wouldn't wait for the promise.\n trackPendingImport(modulePromise)\n\n return modulePromise\n}\n"],"names":["InvariantError","isThenable","trackPendingImport","trackDynamicImport","modulePromise","process","env","NEXT_RUNTIME"],"mappings":"AAAA,SAASA,cAAc,QAAQ,sCAAqC;AACpE,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,kBAAkB,QAAQ,kCAAiC;AAEpE;;;;;;GAMG,GACH,OAAO,SAASC,mBACdC,aAAgC;IAEhC,IAAIC,QAAQC,GAAG,CAACC,YAAY,KAAK,QAAQ;QACvC,MAAM,qBAEL,CAFK,IAAIP,eACR,iHADI,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,IAAI,CAACC,WAAWG,gBAAgB;QAC9B,8FAA8F;QAC9F,MAAM,qBAEL,CAFK,IAAIJ,eACR,iHADI,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,+GAA+G;IAC/G,yFAAyF;IACzF,EAAE;IACF,0EAA0E;IAC1E,oEAAoE;IACpE,EAAE;IACF,iBAAiB;IACjB,qCAAqC;IACrC,sBAAsB;IACtB,iCAAiC;IACjC,6BAA6B;IAC7B,wDAAwD;IACxD,QAAQ;IACR,sBAAsB;IACtB,MAAM;IACN,EAAE;IACF,gFAAgF;IAChF,mDAAmD;IACnD,uEAAuE;IACvE,4EAA4E;IAC5E,6DAA6D;IAC7D,oEAAoE;IACpE,kEAAkE;IAClEE,mBAAmBE;IAEnB,OAAOA;AACT","ignoreList":[0]}

View File

@@ -0,0 +1,61 @@
import { encodeURIPath } from '../../shared/lib/encode-uri-path';
import ReactDOM from 'react-dom';
export function getRequiredScripts(buildManifest, assetPrefix, crossOrigin, SRIManifest, qs, nonce, pagePath) {
var _buildManifest_rootMainFilesTree;
let preinitScripts;
let preinitScriptCommands = [];
const bootstrapScript = {
src: '',
crossOrigin
};
const files = (((_buildManifest_rootMainFilesTree = buildManifest.rootMainFilesTree) == null ? void 0 : _buildManifest_rootMainFilesTree[pagePath]) || buildManifest.rootMainFiles).map(encodeURIPath);
if (files.length === 0) {
throw Object.defineProperty(new Error('Invariant: missing bootstrap script. This is a bug in Next.js'), "__NEXT_ERROR_CODE", {
value: "E459",
enumerable: false,
configurable: true
});
}
if (SRIManifest) {
bootstrapScript.src = `${assetPrefix}/_next/` + files[0] + qs;
bootstrapScript.integrity = SRIManifest[files[0]];
for(let i = 1; i < files.length; i++){
const src = `${assetPrefix}/_next/` + files[i] + qs;
const integrity = SRIManifest[files[i]];
preinitScriptCommands.push(src, integrity);
}
preinitScripts = ()=>{
// preinitScriptCommands is a double indexed array of src/integrity pairs
for(let i = 0; i < preinitScriptCommands.length; i += 2){
ReactDOM.preinit(preinitScriptCommands[i], {
as: 'script',
integrity: preinitScriptCommands[i + 1],
crossOrigin,
nonce
});
}
};
} else {
bootstrapScript.src = `${assetPrefix}/_next/` + files[0] + qs;
for(let i = 1; i < files.length; i++){
const src = `${assetPrefix}/_next/` + files[i] + qs;
preinitScriptCommands.push(src);
}
preinitScripts = ()=>{
// preinitScriptCommands is a singled indexed array of src values
for(let i = 0; i < preinitScriptCommands.length; i++){
ReactDOM.preinit(preinitScriptCommands[i], {
as: 'script',
nonce,
crossOrigin
});
}
};
}
return [
preinitScripts,
bootstrapScript
];
}
//# sourceMappingURL=required-scripts.js.map

View File

@@ -0,0 +1,53 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var chunk_IPLRRT6O_exports = {};
__export(chunk_IPLRRT6O_exports, {
binaryTargetRegex: () => binaryTargetRegex,
binaryTargetRegex_exports: () => binaryTargetRegex_exports,
init_binaryTargetRegex: () => init_binaryTargetRegex
});
module.exports = __toCommonJS(chunk_IPLRRT6O_exports);
var import_chunk_7MLUNQIZ = require("./chunk-7MLUNQIZ.js");
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
function escapeStringRegexp(string) {
if (typeof string !== "string") {
throw new TypeError("Expected a string");
}
return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
}
var init_escape_string_regexp = (0, import_chunk_2ESYSVXG.__esm)({
"../../node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.js"() {
"use strict";
}
});
var binaryTargetRegex_exports = {};
(0, import_chunk_2ESYSVXG.__export)(binaryTargetRegex_exports, {
binaryTargetRegex: () => binaryTargetRegex
});
var binaryTargetRegex;
var init_binaryTargetRegex = (0, import_chunk_2ESYSVXG.__esm)({
"src/test-utils/binaryTargetRegex.ts"() {
init_escape_string_regexp();
(0, import_chunk_7MLUNQIZ.init_binaryTargets)();
binaryTargetRegex = new RegExp(
"(" + [...import_chunk_7MLUNQIZ.binaryTargets].sort((a, b) => b.length - a.length).map((p) => escapeStringRegexp(p)).join("|") + ")",
"g"
);
}
});

View File

@@ -0,0 +1,74 @@
/**
* Find the starting index of Uint8Array `b` within Uint8Array `a`.
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
indexOfUint8Array: null,
isEquivalentUint8Arrays: null,
removeFromUint8Array: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
indexOfUint8Array: function() {
return indexOfUint8Array;
},
isEquivalentUint8Arrays: function() {
return isEquivalentUint8Arrays;
},
removeFromUint8Array: function() {
return removeFromUint8Array;
}
});
function indexOfUint8Array(a, b) {
if (b.length === 0) return 0;
if (a.length === 0 || b.length > a.length) return -1;
// Use Node's native implementation when available.
if (typeof Buffer !== 'undefined') {
const haystack = Buffer.isBuffer(a) ? a : Buffer.from(a.buffer, a.byteOffset, a.byteLength);
return haystack.indexOf(b);
}
// start iterating through `a`
for(let i = 0; i <= a.length - b.length; i++){
let completeMatch = true;
// from index `i`, iterate through `b` and check for mismatch
for(let j = 0; j < b.length; j++){
// if the values do not match, then this isn't a complete match, exit `b` iteration early and iterate to next index of `a`.
if (a[i + j] !== b[j]) {
completeMatch = false;
break;
}
}
if (completeMatch) {
return i;
}
}
return -1;
}
function isEquivalentUint8Arrays(a, b) {
if (a.length !== b.length) return false;
for(let i = 0; i < a.length; i++){
if (a[i] !== b[i]) return false;
}
return true;
}
function removeFromUint8Array(a, b) {
const tagIndex = indexOfUint8Array(a, b);
if (tagIndex === 0) return a.subarray(b.length);
if (tagIndex > -1) {
const removed = new Uint8Array(a.length - b.length);
removed.set(a.subarray(0, tagIndex));
removed.set(a.subarray(tagIndex + b.length), tagIndex);
return removed;
} else {
return a;
}
}
//# sourceMappingURL=uint8array-helpers.js.map

View File

@@ -0,0 +1,39 @@
/**
Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag.
@param flag - CLI flag to look for. The `--` prefix is optional.
@param argv - CLI arguments. Default: `process.argv`.
@returns Whether the flag exists.
@example
```
// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow
// foo.ts
import hasFlag = require('has-flag');
hasFlag('unicorn');
//=> true
hasFlag('--unicorn');
//=> true
hasFlag('f');
//=> true
hasFlag('-f');
//=> true
hasFlag('foo=bar');
//=> true
hasFlag('foo');
//=> false
hasFlag('rainbow');
//=> false
```
*/
declare function hasFlag(flag: string, argv?: string[]): boolean;
export = hasFlag;

View File

@@ -0,0 +1,123 @@
import { type ExecaChildProcess } from 'execa';
import type { FSJetpack } from 'fs-jetpack/types';
import { type MockInstance } from 'vitest';
/**
* Base test context.
*/
export type BaseContext = {
tmpDir: string;
fs: FSJetpack;
mocked: {
cwd: string;
};
/**
* Set up the temporary directory based on the contents of some fixture.
*/
fixture: (name: string) => void;
/**
* Spawn the Prisma cli using the temporary directory as the CWD.
*
* @remarks
*
* For this to work the source must be built
*/
cli: (...input: string[]) => ExecaChildProcess<string>;
printDir(dir: string, extensions: string[]): void;
/**
* JavaScript-friendly implementation of the `tree` command. It skips the `node_modules` directory.
* @param itemPath The path to start the tree from, defaults to the root of the temporary directory
* @param indent How much to indent each level of the tree, defaults to ''
* @returns String representation of the directory tree
*/
tree: (itemPath?: string, indent?: string) => void;
};
/**
* Create test context to use in tests. Provides the following:
*
* - A temporary directory
* - an fs-jetpack instance bound to the temporary directory
* - Mocked process.cwd via Node process.chdir
* - Fixture loader for bootstrapping the temporary directory with content
*/
export declare const vitestContext: {
new: (ctx?: BaseContext) => {
add<NewContext>(contextContributor: ContextContributor<BaseContext, NewContext>): {
add<NewContext_1>(contextContributor: ContextContributor<BaseContext & NewContext, NewContext_1>): {
add<NewContext_2>(contextContributor: ContextContributor<BaseContext & NewContext & NewContext_1, NewContext_2>): {
add<NewContext_3>(contextContributor: ContextContributor<BaseContext & NewContext & NewContext_1 & NewContext_2, NewContext_3>): {
add<NewContext_4>(contextContributor: ContextContributor<BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3, NewContext_4>): {
add<NewContext_5>(contextContributor: ContextContributor<BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4, NewContext_5>): {
add<NewContext_6>(contextContributor: ContextContributor<BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5, NewContext_6>): {
add<NewContext_7>(contextContributor: ContextContributor<BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5 & NewContext_6, NewContext_7>): {
add<NewContext_8>(contextContributor: ContextContributor<BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5 & NewContext_6 & NewContext_7, NewContext_8>): {
add<NewContext_9>(contextContributor: ContextContributor<BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5 & NewContext_6 & NewContext_7 & NewContext_8, NewContext_9>): {
add<NewContext_10>(contextContributor: ContextContributor<BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5 & NewContext_6 & NewContext_7 & NewContext_8 & NewContext_9, NewContext_10>): any;
assemble(): BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5 & NewContext_6 & NewContext_7 & NewContext_8 & NewContext_9;
};
assemble(): BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5 & NewContext_6 & NewContext_7 & NewContext_8;
};
assemble(): BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5 & NewContext_6 & NewContext_7;
};
assemble(): BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5 & NewContext_6;
};
assemble(): BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4 & NewContext_5;
};
assemble(): BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3 & NewContext_4;
};
assemble(): BaseContext & NewContext & NewContext_1 & NewContext_2 & NewContext_3;
};
assemble(): BaseContext & NewContext & NewContext_1 & NewContext_2;
};
assemble(): BaseContext & NewContext & NewContext_1;
};
assemble(): BaseContext & NewContext;
};
assemble(): BaseContext;
};
};
/**
* A function that provides additional test context.
*/
type ContextContributor<Context, NewContext> = (ctx: Context) => Context & NewContext;
/**
* Test context contributor. Mocks console.error with a Vitest spy before each test.
*/
type ConsoleContext = {
mocked: {
'console.error': MockInstance<typeof console.error>;
'console.log': MockInstance<typeof console.log>;
'console.info': MockInstance<typeof console.info>;
'console.warn': MockInstance<typeof console.warn>;
};
};
export declare const vitestConsoleContext: <Ctx extends BaseContext>() => (c: Ctx) => Ctx & ConsoleContext;
/**
* Test context contributor. Mocks process.std(out|err).write with a Vitest spy before each test.
*/
type ProcessContext = {
mocked: {
'process.stderr.write': MockInstance<typeof process.stderr.write>;
'process.stdout.write': MockInstance<typeof process.stdout.write>;
};
normalizedCapturedStdout: () => string;
normalizedCapturedStderr: () => string;
clearCapturedStdout: () => void;
clearCapturedStderr: () => void;
};
type NormalizationRule = [RegExp | string, string];
export type ProcessContextSettings = {
normalizationRules: NormalizationRule[];
};
export declare const vitestStdoutContext: <Ctx extends BaseContext>({ normalizationRules }?: ProcessContextSettings) => (c: Ctx) => Ctx & ProcessContext;
/**
* Test context contributor. Mocks process.exit with a spy and records the exit code.
*/
type ProcessExitContext = {
mocked: {
'process.exit': MockInstance<typeof process.exit>;
};
recordedExitCode: () => number;
};
export declare const vitestProcessExitContext: <C extends BaseContext>() => (c: C) => C & ProcessExitContext;
export declare const processExitContext: <C extends BaseContext>() => (c: C) => C & ProcessExitContext;
export {};

View File

@@ -0,0 +1,36 @@
'use strict';
require('../auto');
var runTests = require('./tests');
var test = require('tape');
var defineProperties = require('define-properties');
var callBind = require('call-bind');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names')();
test('shimmed', function (t) {
t.equal(String.prototype.trimEnd.length, 0, 'String#trimEnd has a length of 0');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal((/^(?:trimRight|trimEnd)$/).test(String.prototype.trimEnd.name), true, 'String#trimEnd has name "trimRight" or "trimEnd"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(String.prototype, 'trimEnd'), 'String#trimEnd is not enumerable');
et.end();
});
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
t.test('bad string/this value', { skip: !supportsStrictMode }, function (st) {
st['throws'](function () { return String.prototype.trimEnd.call(undefined, 'a'); }, TypeError, 'undefined is not an object');
st['throws'](function () { return String.prototype.trimEnd.call(null, 'a'); }, TypeError, 'null is not an object');
st.end();
});
runTests(callBind(String.prototype.trimEnd), t);
t.end();
});

View File

@@ -0,0 +1,182 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-inferrable-types',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean',
recommended: 'stylistic',
},
fixable: 'code',
messages: {
noInferrableType: 'Type {{type}} trivially inferred from a {{type}} literal, remove type annotation.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
ignoreParameters: {
type: 'boolean',
description: 'Whether to ignore function parameters.',
},
ignoreProperties: {
type: 'boolean',
description: 'Whether to ignore class properties.',
},
},
},
],
},
defaultOptions: [
{
ignoreParameters: false,
ignoreProperties: false,
},
],
create(context, [{ ignoreParameters, ignoreProperties }]) {
function isFunctionCall(init, callName) {
const node = (0, util_1.skipChainExpression)(init);
return (node.type === utils_1.AST_NODE_TYPES.CallExpression &&
node.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
node.callee.name === callName);
}
function isLiteral(init, typeName) {
return (init.type === utils_1.AST_NODE_TYPES.Literal && typeof init.value === typeName);
}
function isIdentifier(init, ...names) {
return (init.type === utils_1.AST_NODE_TYPES.Identifier && names.includes(init.name));
}
function hasUnaryPrefix(init, ...operators) {
return (init.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
operators.includes(init.operator));
}
const keywordMap = {
[utils_1.AST_NODE_TYPES.TSBigIntKeyword]: 'bigint',
[utils_1.AST_NODE_TYPES.TSBooleanKeyword]: 'boolean',
[utils_1.AST_NODE_TYPES.TSNullKeyword]: 'null',
[utils_1.AST_NODE_TYPES.TSNumberKeyword]: 'number',
[utils_1.AST_NODE_TYPES.TSStringKeyword]: 'string',
[utils_1.AST_NODE_TYPES.TSSymbolKeyword]: 'symbol',
[utils_1.AST_NODE_TYPES.TSUndefinedKeyword]: 'undefined',
};
/**
* Returns whether a node has an inferrable value or not
*/
function isInferrable(annotation, init) {
switch (annotation.type) {
case utils_1.AST_NODE_TYPES.TSBigIntKeyword: {
// note that bigint cannot have + prefixed to it
const unwrappedInit = hasUnaryPrefix(init, '-')
? init.argument
: init;
return (isFunctionCall(unwrappedInit, 'BigInt') ||
unwrappedInit.type === utils_1.AST_NODE_TYPES.Literal);
}
case utils_1.AST_NODE_TYPES.TSBooleanKeyword:
return (hasUnaryPrefix(init, '!') ||
isFunctionCall(init, 'Boolean') ||
isLiteral(init, 'boolean'));
case utils_1.AST_NODE_TYPES.TSNumberKeyword: {
const unwrappedInit = hasUnaryPrefix(init, '+', '-')
? init.argument
: init;
return (isIdentifier(unwrappedInit, 'Infinity', 'NaN') ||
isFunctionCall(unwrappedInit, 'Number') ||
isLiteral(unwrappedInit, 'number'));
}
case utils_1.AST_NODE_TYPES.TSNullKeyword:
return init.type === utils_1.AST_NODE_TYPES.Literal && init.value == null;
case utils_1.AST_NODE_TYPES.TSStringKeyword:
return (isFunctionCall(init, 'String') ||
isLiteral(init, 'string') ||
init.type === utils_1.AST_NODE_TYPES.TemplateLiteral);
case utils_1.AST_NODE_TYPES.TSSymbolKeyword:
return isFunctionCall(init, 'Symbol');
case utils_1.AST_NODE_TYPES.TSTypeReference: {
if (annotation.typeName.type === utils_1.AST_NODE_TYPES.Identifier &&
annotation.typeName.name === 'RegExp') {
const isRegExpLiteral = init.type === utils_1.AST_NODE_TYPES.Literal &&
init.value instanceof RegExp;
const isRegExpNewCall = init.type === utils_1.AST_NODE_TYPES.NewExpression &&
init.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
init.callee.name === 'RegExp';
const isRegExpCall = isFunctionCall(init, 'RegExp');
return isRegExpLiteral || isRegExpCall || isRegExpNewCall;
}
return false;
}
case utils_1.AST_NODE_TYPES.TSUndefinedKeyword:
return (hasUnaryPrefix(init, 'void') || isIdentifier(init, 'undefined'));
}
return false;
}
/**
* Reports an inferrable type declaration, if any
*/
function reportInferrableType(node, typeNode, initNode) {
if (!typeNode || !initNode) {
return;
}
if (!isInferrable(typeNode.typeAnnotation, initNode)) {
return;
}
const type = typeNode.typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference
? // TODO - if we add more references
'RegExp'
: keywordMap[typeNode.typeAnnotation.type];
context.report({
node,
messageId: 'noInferrableType',
data: {
type,
},
*fix(fixer) {
if ((node.type === utils_1.AST_NODE_TYPES.AssignmentPattern &&
node.left.optional) ||
(node.type === utils_1.AST_NODE_TYPES.PropertyDefinition && node.definite)) {
yield fixer.remove((0, util_1.nullThrows)(context.sourceCode.getTokenBefore(typeNode), util_1.NullThrowsReasons.MissingToken('token before', 'type node')));
}
yield fixer.remove(typeNode);
},
});
}
function inferrableVariableVisitor(node) {
reportInferrableType(node, node.id.typeAnnotation, node.init);
}
function inferrableParameterVisitor(node) {
if (ignoreParameters) {
return;
}
node.params.forEach(param => {
if (param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) {
param = param.parameter;
}
if (param.type === utils_1.AST_NODE_TYPES.AssignmentPattern) {
reportInferrableType(param, param.left.typeAnnotation, param.right);
}
});
}
function inferrablePropertyVisitor(node) {
// We ignore `readonly` because of Microsoft/TypeScript#14416
// Essentially a readonly property without a type
// will result in its value being the type, leading to
// compile errors if the type is stripped.
if (ignoreProperties || node.readonly || node.optional) {
return;
}
reportInferrableType(node, node.typeAnnotation, node.value);
}
return {
AccessorProperty: inferrablePropertyVisitor,
ArrowFunctionExpression: inferrableParameterVisitor,
FunctionDeclaration: inferrableParameterVisitor,
FunctionExpression: inferrableParameterVisitor,
PropertyDefinition: inferrablePropertyVisitor,
VariableDeclarator: inferrableVariableVisitor,
};
},
});

View File

@@ -0,0 +1,192 @@
/**
* @fileoverview Rule to warn when a function expression does not have a name.
* @author Kyle T. Nunery
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
/**
* Checks whether or not a given variable is a function name.
* @param {eslint-scope.Variable} variable A variable to check.
* @returns {boolean} `true` if the variable is a function name.
*/
function isFunctionName(variable) {
return variable && variable.defs[0].type === "FunctionName";
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: ["always", {}],
docs: {
description: "Require or disallow named `function` expressions",
recommended: false,
url: "https://eslint.org/docs/latest/rules/func-names",
},
schema: {
definitions: {
value: {
enum: ["always", "as-needed", "never"],
},
},
items: [
{
$ref: "#/definitions/value",
},
{
type: "object",
properties: {
generators: {
$ref: "#/definitions/value",
},
},
additionalProperties: false,
},
],
},
messages: {
unnamed: "Unexpected unnamed {{name}}.",
named: "Unexpected named {{name}}.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Returns the config option for the given node.
* @param {ASTNode} node A node to get the config for.
* @returns {string} The config option.
*/
function getConfigForNode(node) {
if (node.generator && context.options[1].generators) {
return context.options[1].generators;
}
return context.options[0];
}
/**
* Determines whether the current FunctionExpression node is a get, set, or
* shorthand method in an object literal or a class.
* @param {ASTNode} node A node to check.
* @returns {boolean} True if the node is a get, set, or shorthand method.
*/
function isObjectOrClassMethod(node) {
const parent = node.parent;
return (
parent.type === "MethodDefinition" ||
(parent.type === "Property" &&
(parent.method ||
parent.kind === "get" ||
parent.kind === "set"))
);
}
/**
* Determines whether the current FunctionExpression node has a name that would be
* inferred from context in a conforming ES6 environment.
* @param {ASTNode} node A node to check.
* @returns {boolean} True if the node would have a name assigned automatically.
*/
function hasInferredName(node) {
const parent = node.parent;
return (
isObjectOrClassMethod(node) ||
(parent.type === "VariableDeclarator" &&
parent.id.type === "Identifier" &&
parent.init === node) ||
(parent.type === "Property" && parent.value === node) ||
(parent.type === "PropertyDefinition" &&
parent.value === node) ||
(parent.type === "AssignmentExpression" &&
parent.left.type === "Identifier" &&
parent.right === node) ||
(parent.type === "AssignmentPattern" &&
parent.left.type === "Identifier" &&
parent.right === node)
);
}
/**
* Reports that an unnamed function should be named
* @param {ASTNode} node The node to report in the event of an error.
* @returns {void}
*/
function reportUnexpectedUnnamedFunction(node) {
context.report({
node,
messageId: "unnamed",
loc: astUtils.getFunctionHeadLoc(node, sourceCode),
data: { name: astUtils.getFunctionNameWithKind(node) },
});
}
/**
* Reports that a named function should be unnamed
* @param {ASTNode} node The node to report in the event of an error.
* @returns {void}
*/
function reportUnexpectedNamedFunction(node) {
context.report({
node,
messageId: "named",
loc: astUtils.getFunctionHeadLoc(node, sourceCode),
data: { name: astUtils.getFunctionNameWithKind(node) },
});
}
/**
* The listener for function nodes.
* @param {ASTNode} node function node
* @returns {void}
*/
function handleFunction(node) {
// Skip recursive functions.
const nameVar = sourceCode.getDeclaredVariables(node)[0];
if (isFunctionName(nameVar) && nameVar.references.length > 0) {
return;
}
const hasName = Boolean(node.id && node.id.name);
const config = getConfigForNode(node);
if (config === "never") {
if (hasName && node.type !== "FunctionDeclaration") {
reportUnexpectedNamedFunction(node);
}
} else if (config === "as-needed") {
if (!hasName && !hasInferredName(node)) {
reportUnexpectedUnnamedFunction(node);
}
} else {
if (!hasName && !isObjectOrClassMethod(node)) {
reportUnexpectedUnnamedFunction(node);
}
}
}
return {
"FunctionExpression:exit": handleFunction,
"ExportDefaultDeclaration > FunctionDeclaration": handleFunction,
};
},
};

View File

@@ -0,0 +1,59 @@
/**
* @license React
* use-sync-external-store-shim.native.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var React = require("react");
function is(x, y) {
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
}
var objectIs = "function" === typeof Object.is ? Object.is : is,
useState = React.useState,
useEffect = React.useEffect,
useLayoutEffect = React.useLayoutEffect,
useDebugValue = React.useDebugValue;
function useSyncExternalStore$1(subscribe, getSnapshot) {
var value = getSnapshot(),
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
inst = _useState[0].inst,
forceUpdate = _useState[1];
useLayoutEffect(
function () {
inst.value = value;
inst.getSnapshot = getSnapshot;
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
},
[subscribe, value, getSnapshot]
);
useEffect(
function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
return subscribe(function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
});
},
[subscribe]
);
useDebugValue(value);
return value;
}
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
inst = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(inst, nextValue);
} catch (error) {
return !0;
}
}
exports.useSyncExternalStore =
void 0 !== React.useSyncExternalStore
? React.useSyncExternalStore
: useSyncExternalStore$1;

View File

@@ -0,0 +1,17 @@
// This regex contains the bots that we need to do a blocking render for and can't safely stream the response
// due to how they parse the DOM. For example, they might explicitly check for metadata in the `head` tag, so we can't stream metadata tags after the `head` was sent.
// Note: The pattern [\w-]+-Google captures all Google crawlers with "-Google" suffix (e.g., Mediapartners-Google, AdsBot-Google, Storebot-Google)
// as well as crawlers starting with "Google-" (e.g., Google-PageRenderer, Google-InspectionTool)
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "HTML_LIMITED_BOT_UA_RE", {
enumerable: true,
get: function() {
return HTML_LIMITED_BOT_UA_RE;
}
});
const HTML_LIMITED_BOT_UA_RE = /[\w-]+-Google|Google-[\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight/i;
//# sourceMappingURL=html-bots.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/build/adapter/setup-node-env.external.ts"],"sourcesContent":["// This is a minimal import that initializes the node\n// environment, it is traced automatically for entries\n// and can be used to ensure Node.js APIs are setup\n// as expected without require `next-server`\nif (process.env.NEXT_RUNTIME !== 'edge') {\n // eslint-disable-next-line @next/internal/typechecked-require\n require('next/dist/server/node-environment')\n // eslint-disable-next-line @next/internal/typechecked-require\n require('next/dist/server/require-hook')\n // eslint-disable-next-line @next/internal/typechecked-require\n require('next/dist/server/node-polyfill-crypto')\n}\n"],"names":["process","env","NEXT_RUNTIME","require"],"mappings":"AAAA,qDAAqD;AACrD,sDAAsD;AACtD,mDAAmD;AACnD,4CAA4C;AAC5C,IAAIA,QAAQC,GAAG,CAACC,YAAY,KAAK,QAAQ;IACvC,8DAA8D;IAC9DC,QAAQ;IACR,8DAA8D;IAC9DA,QAAQ;IACR,8DAA8D;IAC9DA,QAAQ;AACV","ignoreList":[0]}

View File

@@ -0,0 +1,28 @@
/**
* Vary Params Decoding
*
* This module is shared between server and client.
*/
export type VaryParams = Set<string>;
type FulfilledVaryParamsThenable = {
status: 'fulfilled';
value: VaryParams;
} & PromiseLike<VaryParams>;
type PendingVaryParamsThenable = {
status: 'pending' | 'resolved_model';
value: unknown;
} & PromiseLike<VaryParams>;
export type VaryParamsThenable = FulfilledVaryParamsThenable | PendingVaryParamsThenable;
/**
* Synchronously reads vary params from a thenable.
*
* By the time this is called (client-side or in collectSegmentData), the
* thenable should already be fulfilled because the Flight stream has been
* fully received. We check the status synchronously to avoid unnecessary
* microtasks.
*
* Returns null if the thenable is still pending (which shouldn't happen in
* normal operation - it indicates the server failed to track vary params).
*/
export declare function readVaryParams(thenable: VaryParamsThenable): VaryParams | null;
export {};

View File

@@ -0,0 +1,192 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
import type {Program} from 'hermes-estree';
import type {HermesNode} from './HermesAST';
import type {ParserOptions} from './ParserOptions';
import {
HERMES_AST_VISITOR_KEYS,
NODE_CHILD,
NODE_LIST_CHILD,
} from './generated/ParserVisitorKeys';
/**
* The base class for transforming the Hermes AST to the desired output format.
* Extended by concrete adapters which output an ESTree or Babel AST.
*/
export default class HermesASTAdapter {
sourceFilename: ParserOptions['sourceFilename'];
sourceType: ParserOptions['sourceType'];
constructor(options: ParserOptions) {
this.sourceFilename = options.sourceFilename;
this.sourceType = options.sourceType;
}
/**
* Transform the input Hermes AST to the desired output format.
* This modifies the input AST in place instead of constructing a new AST.
*/
transform(program: HermesNode): Program {
// Comments are not traversed via visitor keys
const comments = program.comments;
for (let i = 0; i < comments.length; i++) {
const comment = comments[i];
this.fixSourceLocation(comment);
comments[i] = this.mapComment(comment);
}
// The first comment may be an interpreter directive and is stored directly on the program node
program.interpreter =
comments.length > 0 && comments[0].type === 'InterpreterDirective'
? comments.shift()
: null;
// Tokens are not traversed via visitor keys
const tokens = program.tokens;
if (tokens) {
for (let i = 0; i < tokens.length; i++) {
this.fixSourceLocation(tokens[i]);
}
}
const resultNode = this.mapNode(program);
if (resultNode.type !== 'Program') {
throw new Error(
`HermesToESTreeAdapter: Must return a Program node, instead of "${resultNode.type}". `,
);
}
// $FlowExpectedError[incompatible-return] We know this is a program at this point.
return resultNode;
}
/**
* Transform a Hermes AST node to the output AST format.
*
* This may modify the input node in-place and return that same node, or a completely
* new node may be constructed and returned. Overriden in child classes.
*/
mapNode(_node: HermesNode): HermesNode {
throw new Error('Implemented in subclasses');
}
mapNodeDefault(node: HermesNode): HermesNode {
const visitorKeys = HERMES_AST_VISITOR_KEYS[node.type];
for (const key in visitorKeys) {
const childType = visitorKeys[key];
if (childType === NODE_CHILD) {
const child = node[key];
if (child != null) {
node[key] = this.mapNode(child);
}
} else if (childType === NODE_LIST_CHILD) {
const children = node[key];
for (let i = 0; i < children.length; i++) {
const child = children[i];
if (child != null) {
children[i] = this.mapNode(child);
}
}
}
}
return node;
}
/**
* Update the source location for this node depending on the output AST format.
* This can modify the input node in-place. Overriden in child classes.
*/
fixSourceLocation(_node: HermesNode): void {
throw new Error('Implemented in subclasses');
}
getSourceType(): ParserOptions['sourceType'] {
return this.sourceType ?? 'script';
}
setModuleSourceType(): void {
if (this.sourceType == null) {
this.sourceType = 'module';
}
}
mapComment(node: HermesNode): HermesNode {
return node;
}
mapEmpty(_node: HermesNode): HermesNode {
// $FlowExpectedError
return null;
}
mapImportDeclaration(node: HermesNode): HermesNode {
if (node.importKind === 'value') {
this.setModuleSourceType();
}
return this.mapNodeDefault(node);
}
mapImportSpecifier(node: HermesNode): HermesNode {
if (node.importKind === 'value') {
node.importKind = null;
}
return this.mapNodeDefault(node);
}
mapExportDefaultDeclaration(node: HermesNode): HermesNode {
this.setModuleSourceType();
return this.mapNodeDefault(node);
}
mapExportNamedDeclaration(node: HermesNode): HermesNode {
if (node.exportKind === 'value') {
this.setModuleSourceType();
}
return this.mapNodeDefault(node);
}
mapExportAllDeclaration(node: HermesNode): HermesNode {
if (node.exportKind === 'value') {
this.setModuleSourceType();
}
return this.mapNodeDefault(node);
}
formatError(node: HermesNode, message: string): string {
return `${message} (${node.loc.start.line}:${node.loc.start.column})`;
}
getBigIntLiteralValue(bigintString: string): {
bigint: string,
value: $FlowFixMe /* bigint */,
} {
// TODO - once we update flow we can remove this
declare var BigInt: ?(value: $FlowFixMe) => mixed;
const bigint = bigintString
// estree spec is to not have a trailing `n` on this property
// https://github.com/estree/estree/blob/db962bb417a97effcfe9892f87fbb93c81a68584/es2020.md#bigintliteral
.replace(/n$/, '')
// `BigInt` doesn't accept numeric separator and `bigint` property should not include numeric separator
.replace(/_/, '');
return {
bigint,
// coerce the string to a bigint value if supported by the environment
value: typeof BigInt === 'function' ? BigInt(bigint) : null,
};
}
}

View File

@@ -0,0 +1,8 @@
---
title: How to use Sass in Next.js
nav_title: Sass
description: Learn how to use Sass in your Next.js application.
source: app/guides/sass
---
{/* DO NOT EDIT. The content of this doc is generated from the source above. To edit the content of this page, navigate to the source page in your editor. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}

View File

@@ -0,0 +1,112 @@
'use strict';
/* eslint global-require: 0 */
/** @satisfies {Record<string, import('eslint').Rule.RuleModule>} */
const rules = {
'boolean-prop-naming': require('./boolean-prop-naming'),
'button-has-type': require('./button-has-type'),
'checked-requires-onchange-or-readonly': require('./checked-requires-onchange-or-readonly'),
'default-props-match-prop-types': require('./default-props-match-prop-types'),
'destructuring-assignment': require('./destructuring-assignment'),
'display-name': require('./display-name'),
'forbid-component-props': require('./forbid-component-props'),
'forbid-dom-props': require('./forbid-dom-props'),
'forbid-elements': require('./forbid-elements'),
'forbid-foreign-prop-types': require('./forbid-foreign-prop-types'),
'forbid-prop-types': require('./forbid-prop-types'),
'forward-ref-uses-ref': require('./forward-ref-uses-ref'),
'function-component-definition': require('./function-component-definition'),
'hook-use-state': require('./hook-use-state'),
'iframe-missing-sandbox': require('./iframe-missing-sandbox'),
'jsx-boolean-value': require('./jsx-boolean-value'),
'jsx-child-element-spacing': require('./jsx-child-element-spacing'),
'jsx-closing-bracket-location': require('./jsx-closing-bracket-location'),
'jsx-closing-tag-location': require('./jsx-closing-tag-location'),
'jsx-curly-spacing': require('./jsx-curly-spacing'),
'jsx-curly-newline': require('./jsx-curly-newline'),
'jsx-equals-spacing': require('./jsx-equals-spacing'),
'jsx-filename-extension': require('./jsx-filename-extension'),
'jsx-first-prop-new-line': require('./jsx-first-prop-new-line'),
'jsx-handler-names': require('./jsx-handler-names'),
'jsx-indent': require('./jsx-indent'),
'jsx-indent-props': require('./jsx-indent-props'),
'jsx-key': require('./jsx-key'),
'jsx-max-depth': require('./jsx-max-depth'),
'jsx-max-props-per-line': require('./jsx-max-props-per-line'),
'jsx-newline': require('./jsx-newline'),
'jsx-no-bind': require('./jsx-no-bind'),
'jsx-no-comment-textnodes': require('./jsx-no-comment-textnodes'),
'jsx-no-constructed-context-values': require('./jsx-no-constructed-context-values'),
'jsx-no-duplicate-props': require('./jsx-no-duplicate-props'),
'jsx-no-leaked-render': require('./jsx-no-leaked-render'),
'jsx-no-literals': require('./jsx-no-literals'),
'jsx-no-script-url': require('./jsx-no-script-url'),
'jsx-no-target-blank': require('./jsx-no-target-blank'),
'jsx-no-useless-fragment': require('./jsx-no-useless-fragment'),
'jsx-one-expression-per-line': require('./jsx-one-expression-per-line'),
'jsx-no-undef': require('./jsx-no-undef'),
'jsx-curly-brace-presence': require('./jsx-curly-brace-presence'),
'jsx-pascal-case': require('./jsx-pascal-case'),
'jsx-fragments': require('./jsx-fragments'),
'jsx-props-no-multi-spaces': require('./jsx-props-no-multi-spaces'),
'jsx-props-no-spreading': require('./jsx-props-no-spreading'),
'jsx-props-no-spread-multi': require('./jsx-props-no-spread-multi'),
'jsx-sort-default-props': require('./jsx-sort-default-props'),
'jsx-sort-props': require('./jsx-sort-props'),
'jsx-space-before-closing': require('./jsx-space-before-closing'),
'jsx-tag-spacing': require('./jsx-tag-spacing'),
'jsx-uses-react': require('./jsx-uses-react'),
'jsx-uses-vars': require('./jsx-uses-vars'),
'jsx-wrap-multilines': require('./jsx-wrap-multilines'),
'no-invalid-html-attribute': require('./no-invalid-html-attribute'),
'no-access-state-in-setstate': require('./no-access-state-in-setstate'),
'no-adjacent-inline-elements': require('./no-adjacent-inline-elements'),
'no-array-index-key': require('./no-array-index-key'),
'no-arrow-function-lifecycle': require('./no-arrow-function-lifecycle'),
'no-children-prop': require('./no-children-prop'),
'no-danger': require('./no-danger'),
'no-danger-with-children': require('./no-danger-with-children'),
'no-deprecated': require('./no-deprecated'),
'no-did-mount-set-state': require('./no-did-mount-set-state'),
'no-did-update-set-state': require('./no-did-update-set-state'),
'no-direct-mutation-state': require('./no-direct-mutation-state'),
'no-find-dom-node': require('./no-find-dom-node'),
'no-is-mounted': require('./no-is-mounted'),
'no-multi-comp': require('./no-multi-comp'),
'no-namespace': require('./no-namespace'),
'no-set-state': require('./no-set-state'),
'no-string-refs': require('./no-string-refs'),
'no-redundant-should-component-update': require('./no-redundant-should-component-update'),
'no-render-return-value': require('./no-render-return-value'),
'no-this-in-sfc': require('./no-this-in-sfc'),
'no-typos': require('./no-typos'),
'no-unescaped-entities': require('./no-unescaped-entities'),
'no-unknown-property': require('./no-unknown-property'),
'no-unsafe': require('./no-unsafe'),
'no-unstable-nested-components': require('./no-unstable-nested-components'),
'no-unused-class-component-methods': require('./no-unused-class-component-methods'),
'no-unused-prop-types': require('./no-unused-prop-types'),
'no-unused-state': require('./no-unused-state'),
'no-object-type-as-default-prop': require('./no-object-type-as-default-prop'),
'no-will-update-set-state': require('./no-will-update-set-state'),
'prefer-es6-class': require('./prefer-es6-class'),
'prefer-exact-props': require('./prefer-exact-props'),
'prefer-read-only-props': require('./prefer-read-only-props'),
'prefer-stateless-function': require('./prefer-stateless-function'),
'prop-types': require('./prop-types'),
'react-in-jsx-scope': require('./react-in-jsx-scope'),
'require-default-props': require('./require-default-props'),
'require-optimization': require('./require-optimization'),
'require-render-return': require('./require-render-return'),
'self-closing-comp': require('./self-closing-comp'),
'sort-comp': require('./sort-comp'),
'sort-default-props': require('./sort-default-props'),
'sort-prop-types': require('./sort-prop-types'),
'state-in-constructor': require('./state-in-constructor'),
'static-property-placement': require('./static-property-placement'),
'style-prop-object': require('./style-prop-object'),
'void-dom-elements-no-children': require('./void-dom-elements-no-children'),
};
module.exports = rules;

View File

@@ -0,0 +1,6 @@
/**
* Wait for a given number of milliseconds and then resolve.
*
* @param ms the number of milliseconds to wait
*/
export declare function wait(ms: number): Promise<unknown>;

View File

@@ -0,0 +1,3 @@
declare const _exports: import('eslint').Rule.RuleModule;
export = _exports;
//# sourceMappingURL=no-unsafe.d.ts.map

View File

@@ -0,0 +1,93 @@
/**
* License for programmatically and manually incorporated
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
*
* Copyright Node.js contributors. All rights reserved.
* 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:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* 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.
*/
// NOTE: These definitions support Node.js and TypeScript 5.7+.
// Reference required TypeScript libs:
/// <reference lib="es2020" />
// TypeScript backwards-compatibility definitions:
/// <reference path="compatibility/index.d.ts" />
// Definitions specific to TypeScript 5.7+:
/// <reference path="globals.typedarray.d.ts" />
/// <reference path="buffer.buffer.d.ts" />
// Definitions for Node.js modules that are not specific to any version of TypeScript:
/// <reference path="globals.d.ts" />
/// <reference path="web-globals/abortcontroller.d.ts" />
/// <reference path="web-globals/domexception.d.ts" />
/// <reference path="web-globals/events.d.ts" />
/// <reference path="web-globals/fetch.d.ts" />
/// <reference path="assert.d.ts" />
/// <reference path="assert/strict.d.ts" />
/// <reference path="async_hooks.d.ts" />
/// <reference path="buffer.d.ts" />
/// <reference path="child_process.d.ts" />
/// <reference path="cluster.d.ts" />
/// <reference path="console.d.ts" />
/// <reference path="constants.d.ts" />
/// <reference path="crypto.d.ts" />
/// <reference path="dgram.d.ts" />
/// <reference path="diagnostics_channel.d.ts" />
/// <reference path="dns.d.ts" />
/// <reference path="dns/promises.d.ts" />
/// <reference path="domain.d.ts" />
/// <reference path="events.d.ts" />
/// <reference path="fs.d.ts" />
/// <reference path="fs/promises.d.ts" />
/// <reference path="http.d.ts" />
/// <reference path="http2.d.ts" />
/// <reference path="https.d.ts" />
/// <reference path="inspector.generated.d.ts" />
/// <reference path="module.d.ts" />
/// <reference path="net.d.ts" />
/// <reference path="os.d.ts" />
/// <reference path="path.d.ts" />
/// <reference path="perf_hooks.d.ts" />
/// <reference path="process.d.ts" />
/// <reference path="punycode.d.ts" />
/// <reference path="querystring.d.ts" />
/// <reference path="readline.d.ts" />
/// <reference path="readline/promises.d.ts" />
/// <reference path="repl.d.ts" />
/// <reference path="sea.d.ts" />
/// <reference path="stream.d.ts" />
/// <reference path="stream/promises.d.ts" />
/// <reference path="stream/consumers.d.ts" />
/// <reference path="stream/web.d.ts" />
/// <reference path="string_decoder.d.ts" />
/// <reference path="test.d.ts" />
/// <reference path="timers.d.ts" />
/// <reference path="timers/promises.d.ts" />
/// <reference path="tls.d.ts" />
/// <reference path="trace_events.d.ts" />
/// <reference path="tty.d.ts" />
/// <reference path="url.d.ts" />
/// <reference path="util.d.ts" />
/// <reference path="v8.d.ts" />
/// <reference path="vm.d.ts" />
/// <reference path="wasi.d.ts" />
/// <reference path="worker_threads.d.ts" />
/// <reference path="zlib.d.ts" />

View File

@@ -0,0 +1,13 @@
import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js';
/**
* For single unicode characters - any of the code points defined in the unicode standard
*
* WARNING: Generated values can have a length greater than 1.
*
* {@link https://tc39.github.io/ecma262/#sec-utf16encoding}
*
* @deprecated Please use ${@link string} with `fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 })` or `fc.string({ unit: 'binary', minLength: 1, maxLength: 1 })` instead
* @remarks Since 0.0.11
* @public
*/
export declare function fullUnicode(): Arbitrary<string>;

View File

@@ -0,0 +1,270 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.isStaticMemberAccessOfValue = exports.MemberNameType = void 0;
exports.isDefinitionFile = isDefinitionFile;
exports.upperCaseFirst = upperCaseFirst;
exports.arrayGroupByToMap = arrayGroupByToMap;
exports.arraysAreEqual = arraysAreEqual;
exports.findFirstResult = findFirstResult;
exports.getNameFromIndexSignature = getNameFromIndexSignature;
exports.getNameFromMember = getNameFromMember;
exports.getEnumNames = getEnumNames;
exports.formatWordList = formatWordList;
exports.findLastIndex = findLastIndex;
exports.typeNodeRequiresParentheses = typeNodeRequiresParentheses;
exports.isRestParameterDeclaration = isRestParameterDeclaration;
exports.isParenlessArrowFunction = isParenlessArrowFunction;
exports.getStaticMemberAccessValue = getStaticMemberAccessValue;
const type_utils_1 = require("@typescript-eslint/type-utils");
const utils_1 = require("@typescript-eslint/utils");
const ts = __importStar(require("typescript"));
const astUtils_1 = require("./astUtils");
const DEFINITION_EXTENSIONS = [
ts.Extension.Dts,
ts.Extension.Dcts,
ts.Extension.Dmts,
];
/**
* Check if the context file name is *.d.ts or *.d.tsx
*/
function isDefinitionFile(fileName) {
const lowerFileName = fileName.toLowerCase();
for (const definitionExt of DEFINITION_EXTENSIONS) {
if (lowerFileName.endsWith(definitionExt)) {
return true;
}
}
return /\.d\.(ts|cts|mts|.*\.ts)$/.test(lowerFileName);
}
/**
* Upper cases the first character or the string
*/
function upperCaseFirst(str) {
return str[0].toUpperCase() + str.slice(1);
}
function arrayGroupByToMap(array, getKey) {
const groups = new Map();
for (const item of array) {
const key = getKey(item);
const existing = groups.get(key);
if (existing) {
existing.push(item);
}
else {
groups.set(key, [item]);
}
}
return groups;
}
function arraysAreEqual(a, b, eq) {
return (a === b ||
(a != null && a.length === b?.length && a.every((x, idx) => eq(x, b[idx]))));
}
/** Returns the first non-`undefined` result. */
function findFirstResult(inputs, getResult) {
for (const element of inputs) {
const result = getResult(element);
// eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish
if (result !== undefined) {
return result;
}
}
return undefined;
}
/**
* Gets a string representation of the name of the index signature.
*/
function getNameFromIndexSignature(node) {
const propName = node.parameters.find((parameter) => parameter.type === utils_1.AST_NODE_TYPES.Identifier);
return propName ? propName.name : '(index signature)';
}
var MemberNameType;
(function (MemberNameType) {
MemberNameType[MemberNameType["Private"] = 1] = "Private";
MemberNameType[MemberNameType["Quoted"] = 2] = "Quoted";
MemberNameType[MemberNameType["Normal"] = 3] = "Normal";
MemberNameType[MemberNameType["Expression"] = 4] = "Expression";
})(MemberNameType || (exports.MemberNameType = MemberNameType = {}));
/**
* Gets a string name representation of the name of the given MethodDefinition
* or PropertyDefinition node, with handling for computed property names.
*/
function getNameFromMember(member, sourceCode) {
if (member.key.type === utils_1.AST_NODE_TYPES.Identifier) {
return {
name: member.key.name,
type: MemberNameType.Normal,
};
}
if (member.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) {
return {
name: `#${member.key.name}`,
type: MemberNameType.Private,
};
}
if (member.key.type === utils_1.AST_NODE_TYPES.Literal) {
const name = `${member.key.value}`;
if ((0, type_utils_1.requiresQuoting)(name)) {
return {
name: `"${name}"`,
type: MemberNameType.Quoted,
};
}
return {
name,
type: MemberNameType.Normal,
};
}
return {
name: sourceCode.text.slice(...member.key.range),
type: MemberNameType.Expression,
};
}
function getEnumNames(myEnum) {
return Object.keys(myEnum).filter(x => isNaN(Number(x)));
}
/**
* Given an array of words, returns an English-friendly concatenation, separated with commas, with
* the `and` clause inserted before the last item.
*
* Example: ['foo', 'bar', 'baz' ] returns the string "foo, bar, and baz".
*/
function formatWordList(words) {
if (!words.length) {
return '';
}
if (words.length === 1) {
return words[0];
}
return [words.slice(0, -1).join(', '), words.slice(-1)[0]].join(' and ');
}
/**
* Iterates the array in reverse and returns the index of the first element it
* finds which passes the predicate function.
*
* @returns Returns the index of the element if it finds it or -1 otherwise.
*/
function findLastIndex(members, predicate) {
let idx = members.length - 1;
while (idx >= 0) {
const valid = predicate(members[idx]);
if (valid) {
return idx;
}
idx--;
}
return -1;
}
function typeNodeRequiresParentheses(node, text) {
return (node.type === utils_1.AST_NODE_TYPES.TSFunctionType ||
node.type === utils_1.AST_NODE_TYPES.TSConstructorType ||
node.type === utils_1.AST_NODE_TYPES.TSConditionalType ||
(node.type === utils_1.AST_NODE_TYPES.TSUnionType && text.startsWith('|')) ||
(node.type === utils_1.AST_NODE_TYPES.TSIntersectionType && text.startsWith('&')));
}
function isRestParameterDeclaration(decl) {
return ts.isParameter(decl) && decl.dotDotDotToken != null;
}
function isParenlessArrowFunction(node, sourceCode) {
return (node.params.length === 1 && !(0, astUtils_1.isParenthesized)(node.params[0], sourceCode));
}
/**
* Gets a member being accessed or declared if its value can be determined statically, and
* resolves it to the string or symbol value that will be used as the actual member
* access key at runtime. Otherwise, returns `undefined`.
*
* ```ts
* x.member // returns 'member'
* ^^^^^^^^
*
* x?.member // returns 'member' (optional chaining is treated the same)
* ^^^^^^^^^
*
* x['value'] // returns 'value'
* ^^^^^^^^^^
*
* x[Math.random()] // returns undefined (not a static value)
* ^^^^^^^^^^^^^^^^
*
* arr[0] // returns '0' (NOT 0)
* ^^^^^^
*
* arr[0n] // returns '0' (NOT 0n)
* ^^^^^^^
*
* const s = Symbol.for('symbolName')
* x[s] // returns `Symbol.for('symbolName')` (since it's a static/global symbol)
* ^^^^
*
* const us = Symbol('symbolName')
* x[us] // returns undefined (since it's a unique symbol, so not statically analyzable)
* ^^^^^
*
* var object = {
* 1234: '4567', // returns '1234' (NOT 1234)
* ^^^^^^^^^^^^
* method() { } // returns 'method'
* ^^^^^^^^^^^^
* }
*
* class WithMembers {
* foo: string // returns 'foo'
* ^^^^^^^^^^^
* }
* ```
*/
function getStaticMemberAccessValue(node, { sourceCode }) {
const key = node.type === utils_1.AST_NODE_TYPES.MemberExpression ? node.property : node.key;
const { type } = key;
if (!node.computed &&
(type === utils_1.AST_NODE_TYPES.Identifier ||
type === utils_1.AST_NODE_TYPES.PrivateIdentifier)) {
return key.name;
}
const result = (0, astUtils_1.getStaticValue)(key, sourceCode.getScope(node));
if (!result) {
return undefined;
}
const { value } = result;
return typeof value === 'symbol' ? value : String(value);
}
/**
* Answers whether the member expression looks like
* `x.value`, `x['value']`,
* or even `const v = 'value'; x[v]` (or optional variants thereof).
*/
const isStaticMemberAccessOfValue = (memberExpression, context, ...values) => values.includes(getStaticMemberAccessValue(memberExpression, context));
exports.isStaticMemberAccessOfValue = isStaticMemberAccessOfValue;

View File

@@ -0,0 +1,35 @@
const unicode = require('../lib/unicode')
module.exports = {
isSpaceSeparator (c) {
return typeof c === 'string' && unicode.Space_Separator.test(c)
},
isIdStartChar (c) {
return typeof c === 'string' && (
(c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c === '$') || (c === '_') ||
unicode.ID_Start.test(c)
)
},
isIdContinueChar (c) {
return typeof c === 'string' && (
(c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c >= '0' && c <= '9') ||
(c === '$') || (c === '_') ||
(c === '\u200C') || (c === '\u200D') ||
unicode.ID_Continue.test(c)
)
},
isDigit (c) {
return typeof c === 'string' && /[0-9]/.test(c)
},
isHexDigit (c) {
return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)
},
}

View File

@@ -0,0 +1,63 @@
import type { Linter } from './Linter';
export declare namespace Processor {
interface ProcessorMeta {
/**
* The unique name of the processor.
*/
name: string;
/**
* The a string identifying the version of the processor.
*/
version?: string;
}
type PreProcess = (text: string, filename: string) => (string | {
filename: string;
text: string;
})[];
type PostProcess = (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[];
interface ProcessorModule {
/**
* Information about the processor to uniquely identify it when serializing.
*/
meta?: ProcessorMeta;
/**
* The function to merge messages.
*/
postprocess?: PostProcess;
/**
* The function to extract code blocks.
*/
preprocess?: PreProcess;
/**
* If `true` then it means the processor supports autofix.
*/
supportsAutofix?: boolean;
}
/**
* A loose definition of the ParserModule type for use with configs
* This type intended to relax validation of configs so that parsers that have
* different AST types or scope managers can still be passed to configs
*
* @see {@link LooseRuleDefinition}, {@link LooseParserModule}
*/
interface LooseProcessorModule {
/**
* Information about the processor to uniquely identify it when serializing.
*/
meta?: {
[K in keyof ProcessorMeta]?: ProcessorMeta[K] | undefined;
};
/**
* The function to merge messages.
*/
postprocess?: (messagesList: any, filename: string) => any;
/**
* The function to extract code blocks.
*/
preprocess?: (text: string, filename: string) => any;
/**
* If `true` then it means the processor supports autofix.
*/
supportsAutofix?: boolean | undefined;
}
}

View File

@@ -0,0 +1 @@
{"name":"util","main":"util.js","author":{"name":"Joyent","url":"http://www.joyent.com"},"license":"MIT"}

View File

@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.501.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const __iconNode = [
[
"path",
{
d: "m21.12 6.4-6.05-4.06a2 2 0 0 0-2.17-.05L2.95 8.41a2 2 0 0 0-.95 1.7v5.82a2 2 0 0 0 .88 1.66l6.05 4.07a2 2 0 0 0 2.17.05l9.95-6.12a2 2 0 0 0 .95-1.7V8.06a2 2 0 0 0-.88-1.66Z",
key: "1u2ovd"
}
],
["path", { d: "M10 22v-8L2.25 9.15", key: "11pn4q" }],
["path", { d: "m10 14 11.77-6.87", key: "1kt1wh" }]
];
const Cuboid = createLucideIcon("cuboid", __iconNode);
export { __iconNode, Cuboid as default };
//# sourceMappingURL=cuboid.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B 5C"},B:{"2":"0 1 2 3 4 5 6 7 8 9 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB MB NB OB BB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 6C YC J eB K D E F A B C L M G N O P fB CB DB EB FB GB HB IB JB KB LB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B ZC 9B aC AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC Q H R bC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB MB NB OB BB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB I cC dC RC 7C 8C 9C AD BD"},D:{"2":"0 1 2 3 4 5 6 7 8 9 J eB K D E F A B C L M G N O P fB CB DB EB FB GB HB IB JB KB LB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B ZC 9B aC AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB MB NB OB BB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB I cC dC RC"},E:{"2":"J eB K D E F A B C L M G CD eC DD ED FD GD fC SC TC HD ID JD gC hC UC KD VC iC jC kC lC mC LD WC nC oC pC qC rC MD XC sC tC uC vC wC xC yC zC 0C 1C 2C ND"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G N O P fB CB DB EB FB GB HB IB JB KB LB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC Q H R bC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB OD PD QD RD SC 3C SD TC"},G:{"2":"E eC TD 4C UD VD WD XD YD ZD aD bD cD dD eD fD gD hD iD jD kD lD mD gC hC UC nD VC iC jC kC lC mC oD WC nC oC pC qC rC pD XC sC tC uC vC wC xC yC zC 0C 1C 2C"},H:{"2":"qD"},I:{"2":"YC J I rD sD tD uD 4C vD wD"},J:{"2":"D A"},K:{"2":"A B C H SC 3C TC"},L:{"2":"I"},M:{"2":"RC"},N:{"2":"A B"},O:{"2":"UC"},P:{"2":"J CB DB EB FB GB HB IB JB KB LB xD yD zD 0D 1D fC 2D 3D 4D 5D 6D VC WC XC 7D"},Q:{"2":"8D"},R:{"2":"9D"},S:{"2":"AE BE"}},B:5,C:"Media Queries: scripting media feature",D:false};

View File

@@ -0,0 +1,61 @@
type Pathname = string
interface TestResult {
ignored: boolean
unignored: boolean
}
export interface Ignore {
/**
* Adds one or several rules to the current manager.
* @param {string[]} patterns
* @returns IgnoreBase
*/
add(patterns: string | Ignore | readonly (string | Ignore)[]): this
/**
* Filters the given array of pathnames, and returns the filtered array.
* NOTICE that each path here should be a relative path to the root of your repository.
* @param paths the array of paths to be filtered.
* @returns The filtered array of paths
*/
filter(pathnames: readonly Pathname[]): Pathname[]
/**
* Creates a filter function which could filter
* an array of paths with Array.prototype.filter.
*/
createFilter(): (pathname: Pathname) => boolean
/**
* Returns Boolean whether pathname should be ignored.
* @param {string} pathname a path to check
* @returns boolean
*/
ignores(pathname: Pathname): boolean
/**
* Returns whether pathname should be ignored or unignored
* @param {string} pathname a path to check
* @returns TestResult
*/
test(pathname: Pathname): TestResult
}
export interface Options {
ignorecase?: boolean
// For compatibility
ignoreCase?: boolean
allowRelativePaths?: boolean
}
/**
* Creates new ignore manager.
*/
declare function ignore(options?: Options): Ignore
declare namespace ignore {
export function isPathValid (pathname: string): boolean
}
export default ignore

View File

@@ -0,0 +1,52 @@
{
"name": "esrecurse",
"description": "ECMAScript AST recursive visitor",
"homepage": "https://github.com/estools/esrecurse",
"main": "esrecurse.js",
"version": "4.3.0",
"engines": {
"node": ">=4.0"
},
"maintainers": [
{
"name": "Yusuke Suzuki",
"email": "utatane.tea@gmail.com",
"web": "https://github.com/Constellation"
}
],
"repository": {
"type": "git",
"url": "https://github.com/estools/esrecurse.git"
},
"dependencies": {
"estraverse": "^5.2.0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-eslint": "^7.2.3",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.24.1",
"chai": "^4.0.2",
"esprima": "^4.0.0",
"gulp": "^3.9.0",
"gulp-bump": "^2.7.0",
"gulp-eslint": "^4.0.0",
"gulp-filter": "^5.0.0",
"gulp-git": "^2.4.1",
"gulp-mocha": "^4.3.1",
"gulp-tag-version": "^1.2.1",
"jsdoc": "^3.3.0-alpha10",
"minimist": "^1.1.0"
},
"license": "BSD-2-Clause",
"scripts": {
"test": "gulp travis",
"unit-test": "gulp test",
"lint": "gulp lint"
},
"babel": {
"presets": [
"es2015"
]
}
}

View File

@@ -0,0 +1,166 @@
"use client";
import { optimizedAppearDataAttribute } from 'motion-dom';
import { useContext, useRef, useInsertionEffect, useEffect } from 'react';
import { LazyContext } from '../../context/LazyContext.mjs';
import { MotionConfigContext } from '../../context/MotionConfigContext.mjs';
import { MotionContext } from '../../context/MotionContext/index.mjs';
import { PresenceContext } from '../../context/PresenceContext.mjs';
import { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';
import { isRefObject } from '../../utils/is-ref-object.mjs';
import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {
const { visualElement: parent } = useContext(MotionContext);
const lazyContext = useContext(LazyContext);
const presenceContext = useContext(PresenceContext);
const motionConfig = useContext(MotionConfigContext);
const reducedMotionConfig = motionConfig.reducedMotion;
const skipAnimations = motionConfig.skipAnimations;
const visualElementRef = useRef(null);
/**
* Track whether the component has been through React's commit phase.
* Used to detect when LazyMotion features load after the component has mounted.
*/
const hasMountedOnce = useRef(false);
/**
* If we haven't preloaded a renderer, check to see if we have one lazy-loaded
*/
createVisualElement =
createVisualElement ||
lazyContext.renderer;
if (!visualElementRef.current && createVisualElement) {
visualElementRef.current = createVisualElement(Component, {
visualState,
parent,
props,
presenceContext,
blockInitialAnimation: presenceContext
? presenceContext.initial === false
: false,
reducedMotionConfig,
skipAnimations,
isSVG,
});
/**
* If the component has already mounted before features loaded (e.g. via
* LazyMotion with async feature loading), we need to force the initial
* animation to run. Otherwise state changes that occurred before features
* loaded will be lost and the element will snap to its final state.
*/
if (hasMountedOnce.current && visualElementRef.current) {
visualElementRef.current.manuallyAnimateOnMount = true;
}
}
const visualElement = visualElementRef.current;
/**
* Load Motion gesture and animation features. These are rendered as renderless
* components so each feature can optionally make use of React lifecycle methods.
*/
const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);
if (visualElement &&
!visualElement.projection &&
ProjectionNodeConstructor &&
(visualElement.type === "html" || visualElement.type === "svg")) {
createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
}
const isMounted = useRef(false);
useInsertionEffect(() => {
/**
* Check the component has already mounted before calling
* `update` unnecessarily. This ensures we skip the initial update.
*/
if (visualElement && isMounted.current) {
visualElement.update(props, presenceContext);
}
});
/**
* Cache this value as we want to know whether HandoffAppearAnimations
* was present on initial render - it will be deleted after this.
*/
const optimisedAppearId = props[optimizedAppearDataAttribute];
const wantsHandoff = useRef(Boolean(optimisedAppearId) &&
typeof window !== "undefined" &&
!window.MotionHandoffIsComplete?.(optimisedAppearId) &&
window.MotionHasOptimisedAnimation?.(optimisedAppearId));
useIsomorphicLayoutEffect(() => {
/**
* Track that this component has mounted. This is used to detect when
* LazyMotion features load after the component has already committed.
*/
hasMountedOnce.current = true;
if (!visualElement)
return;
isMounted.current = true;
window.MotionIsMounted = true;
visualElement.updateFeatures();
visualElement.scheduleRenderMicrotask();
/**
* Ideally this function would always run in a useEffect.
*
* However, if we have optimised appear animations to handoff from,
* it needs to happen synchronously to ensure there's no flash of
* incorrect styles in the event of a hydration error.
*
* So if we detect a situtation where optimised appear animations
* are running, we use useLayoutEffect to trigger animations.
*/
if (wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
});
useEffect(() => {
if (!visualElement)
return;
if (!wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
if (wantsHandoff.current) {
// This ensures all future calls to animateChanges() in this component will run in useEffect
queueMicrotask(() => {
window.MotionHandoffMarkAsComplete?.(optimisedAppearId);
});
wantsHandoff.current = false;
}
/**
* Now we've finished triggering animations for this element we
* can wipe the enteringChildren set for the next render.
*/
visualElement.enteringChildren = undefined;
});
return visualElement;
}
function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props;
visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
? undefined
: getClosestProjectingNode(visualElement.parent));
visualElement.projection.setOptions({
layoutId,
layout,
alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),
visualElement,
/**
* TODO: Update options in an effect. This could be tricky as it'll be too late
* to update by the time layout animations run.
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
* ensuring it gets called if there's no potential layout animations.
*
*/
animationType: typeof layout === "string" ? layout : "both",
initialPromotionConfig,
crossfade: layoutCrossfade,
layoutScroll,
layoutRoot,
layoutAnchor,
});
}
function getClosestProjectingNode(visualElement) {
if (!visualElement)
return undefined;
return visualElement.options.allowProjection !== false
? visualElement.projection
: getClosestProjectingNode(visualElement.parent);
}
export { useVisualElement };
//# sourceMappingURL=use-visual-element.mjs.map

View File

@@ -0,0 +1,141 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "caracteres", verb: "tener" },
file: { unit: "bytes", verb: "tener" },
array: { unit: "elementos", verb: "tener" },
set: { unit: "elementos", verb: "tener" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "entrada",
email: "dirección de correo electrónico",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "fecha y hora ISO",
date: "fecha ISO",
time: "hora ISO",
duration: "duración ISO",
ipv4: "dirección IPv4",
ipv6: "dirección IPv6",
cidrv4: "rango IPv4",
cidrv6: "rango IPv6",
base64: "cadena codificada en base64",
base64url: "URL codificada en base64",
json_string: "cadena JSON",
e164: "número E.164",
jwt: "JWT",
template_literal: "entrada",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
string: "texto",
number: "número",
boolean: "booleano",
array: "arreglo",
object: "objeto",
set: "conjunto",
file: "archivo",
date: "fecha",
bigint: "número grande",
symbol: "símbolo",
undefined: "indefinido",
null: "nulo",
function: "función",
map: "mapa",
record: "registro",
tuple: "tupla",
enum: "enumeración",
union: "unión",
literal: "literal",
promise: "promesa",
void: "vacío",
never: "nunca",
unknown: "desconocido",
any: "cualquiera",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Entrada inválida: se esperaba instanceof ${issue.expected}, recibido ${received}`;
}
return `Entrada inválida: se esperaba ${expected}, recibido ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Entrada inválida: se esperaba ${util.stringifyPrimitive(issue.values[0])}`;
return `Opción inválida: se esperaba una de ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
const origin = TypeDictionary[issue.origin] ?? issue.origin;
if (sizing)
return `Demasiado grande: se esperaba que ${origin ?? "valor"} tuviera ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
return `Demasiado grande: se esperaba que ${origin ?? "valor"} fuera ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
const origin = TypeDictionary[issue.origin] ?? issue.origin;
if (sizing) {
return `Demasiado pequeño: se esperaba que ${origin} tuviera ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Demasiado pequeño: se esperaba que ${origin} fuera ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `Cadena inválida: debe comenzar con "${_issue.prefix}"`;
if (_issue.format === "ends_with") return `Cadena inválida: debe terminar en "${_issue.suffix}"`;
if (_issue.format === "includes") return `Cadena inválida: debe incluir "${_issue.includes}"`;
if (_issue.format === "regex") return `Cadena inválida: debe coincidir con el patrón ${_issue.pattern}`;
return `Inválido ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Número inválido: debe ser múltiplo de ${issue.divisor}`;
case "unrecognized_keys":
return `Llave${issue.keys.length > 1 ? "s" : ""} desconocida${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Llave inválida en ${TypeDictionary[issue.origin] ?? issue.origin}`;
case "invalid_union":
return "Entrada inválida";
case "invalid_element":
return `Valor inválido en ${TypeDictionary[issue.origin] ?? issue.origin}`;
default:
return `Entrada inválida`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1,21 @@
'use strict';
var define = require('define-properties');
var getPolyfill = require('./polyfill');
module.exports = function shimGetPrototypeOf() {
define(
global,
{ Reflect: {} },
{ Reflect: function () { return typeof Reflect !== 'object' || !Reflect; } }
);
var polyfill = getPolyfill();
define(
Reflect,
{ getPrototypeOf: polyfill },
{ getPrototypeOf: function () { return Reflect.getPrototypeOf !== polyfill; } }
);
return polyfill;
};

View File

@@ -0,0 +1,5 @@
'use strict';
// https://262.ecma-international.org/6.0/#sec-algorithm-conventions
module.exports = require('math-intrinsics/min');

View File

@@ -0,0 +1,88 @@
import { LRUCache } from './lru-cache';
import { createRequestResponseMocks } from './mock-request';
import { HMR_MESSAGE_SENT_TO_BROWSER } from '../dev/hot-reloader-types';
/**
* The DevBundlerService provides an interface to perform tasks with the
* bundler while in development.
*/ export class DevBundlerService {
constructor(bundler, handler){
this.bundler = bundler;
this.handler = handler;
this.ensurePage = async (definition)=>{
// TODO: remove after ensure is pulled out of server
return await this.bundler.hotReloader.ensurePage(definition);
};
this.logErrorWithOriginalStack = this.bundler.logErrorWithOriginalStack.bind(this.bundler);
this.appIsrManifestInner = new LRUCache(8000, function length() {
return 16;
});
const { hotReloader } = bundler;
this.close = hotReloader.close.bind(hotReloader);
this.setCacheStatus = hotReloader.setCacheStatus.bind(hotReloader);
this.setReactDebugChannel = hotReloader.setReactDebugChannel.bind(hotReloader);
this.sendErrorsToBrowser = hotReloader.sendErrorsToBrowser.bind(hotReloader);
}
async getFallbackErrorComponents(url) {
await this.bundler.hotReloader.buildFallbackError();
// Build the error page to ensure the fallback is built too.
// TODO: See if this can be moved into hotReloader or removed.
await this.bundler.hotReloader.ensurePage({
page: '/_error',
clientOnly: false,
definition: undefined,
url
});
}
async getCompilationError(page) {
const errors = await this.bundler.hotReloader.getCompilationErrors(page);
if (!errors) return;
// Return the very first error we found.
return errors[0];
}
async revalidate({ urlPath, headers, opts: revalidateOpts }) {
const mocked = createRequestResponseMocks({
url: urlPath,
headers
});
await this.handler(mocked.req, mocked.res);
await mocked.res.hasStreamed;
if (mocked.res.getHeader('x-nextjs-cache') !== 'REVALIDATED' && mocked.res.statusCode !== 200 && !(mocked.res.statusCode === 404 && revalidateOpts.unstable_onlyGenerated)) {
throw Object.defineProperty(new Error(`Invalid response ${mocked.res.statusCode}`), "__NEXT_ERROR_CODE", {
value: "E175",
enumerable: false,
configurable: true
});
}
return {};
}
get appIsrManifest() {
const serializableManifest = {};
for (const [key, value] of this.appIsrManifestInner){
serializableManifest[key] = value;
}
return serializableManifest;
}
setIsrStatus(key, value) {
var // Only send the ISR manifest to legacy clients, i.e. Pages Router clients,
// or App Router clients that have Cache Components disabled. The ISR
// manifest is only used to inform the static indicator, which currently
// does not provide useful information if Cache Components is enabled due to
// its binary nature (i.e. it does not support showing info for partially
// static pages).
_this_bundler_hotReloader, _this_bundler;
if (value === undefined) {
this.appIsrManifestInner.remove(key);
} else {
this.appIsrManifestInner.set(key, value);
}
(_this_bundler = this.bundler) == null ? void 0 : (_this_bundler_hotReloader = _this_bundler.hotReloader) == null ? void 0 : _this_bundler_hotReloader.sendToLegacyClients({
type: HMR_MESSAGE_SENT_TO_BROWSER.ISR_MANIFEST,
data: this.appIsrManifest
});
}
sendHmrMessage(message) {
this.bundler.hotReloader.send(message);
}
}
//# sourceMappingURL=dev-bundler-service.js.map

View File

@@ -0,0 +1,42 @@
import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';
import { createSelectorEffect } from '../utils/create-dom-effect.mjs';
import { createEffect } from '../utils/create-effect.mjs';
function canSetAsProperty(element, name) {
if (!(name in element))
return false;
const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||
Object.getOwnPropertyDescriptor(element, name);
// Check if it has a setter
return descriptor && typeof descriptor.set === "function";
}
const addAttrValue = (element, state, key, value) => {
const isProp = canSetAsProperty(element, key);
const name = isProp
? key
: key.startsWith("data") || key.startsWith("aria")
? camelToDash(key)
: key;
/**
* Set attribute directly via property if available
*/
const render = isProp
? () => {
element[name] = state.latest[key];
}
: () => {
const v = state.latest[key];
if (v === null || v === undefined) {
element.removeAttribute(name);
}
else {
element.setAttribute(name, String(v));
}
};
return state.set(key, value, render);
};
const attrEffect = /*@__PURE__*/ createSelectorEffect(
/*@__PURE__*/ createEffect(addAttrValue));
export { addAttrValue, attrEffect };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/server/app-render/render-css-resource.tsx"],"sourcesContent":["import type { CssResource } from '../../build/webpack/plugins/flight-manifest-plugin'\nimport { encodeURIPath } from '../../shared/lib/encode-uri-path'\nimport type { AppRenderContext } from './app-render'\nimport { getAssetQueryString } from './get-asset-query-string'\nimport type { PreloadCallbacks } from './types'\n\n/**\n * Abstracts the rendering of CSS files based on whether they are inlined or not.\n * For inlined CSS, renders a <style> tag with the CSS content directly embedded.\n * For external CSS files, renders a <link> tag pointing to the CSS file.\n */\nexport function renderCssResource(\n entryCssFiles: CssResource[],\n ctx: AppRenderContext,\n preloadCallbacks?: PreloadCallbacks\n) {\n const {\n componentMod: { createElement },\n } = ctx\n return entryCssFiles.map((entryCssFile, index) => {\n // `Precedence` is an opt-in signal for React to handle resource\n // loading and deduplication, etc. It's also used as the key to sort\n // resources so they will be injected in the correct order.\n // During HMR, it's critical to use different `precedence` values\n // for different stylesheets, so their order will be kept.\n // https://github.com/facebook/react/pull/25060\n const precedence =\n process.env.NODE_ENV === 'development'\n ? 'next_' + entryCssFile.path\n : 'next'\n\n // In dev, Safari and Firefox will cache the resource during HMR:\n // - https://github.com/vercel/next.js/issues/5860\n // - https://bugs.webkit.org/show_bug.cgi?id=187726\n // Because of this, we add a `?v=` query to bypass the cache during\n // development. We need to also make sure that the number is always\n // increasing.\n const fullHref = `${ctx.assetPrefix}/_next/${encodeURIPath(\n entryCssFile.path\n )}${getAssetQueryString(ctx, true)}`\n\n if (entryCssFile.inlined && !ctx.parsedRequestHeaders.isRSCRequest) {\n return createElement(\n 'style',\n {\n key: index,\n nonce: ctx.nonce,\n precedence: precedence,\n href: fullHref,\n },\n entryCssFile.content\n )\n }\n\n preloadCallbacks?.push(() => {\n ctx.componentMod.preloadStyle(\n fullHref,\n ctx.renderOpts.crossOrigin,\n ctx.nonce\n )\n })\n\n return createElement('link', {\n key: index,\n rel: 'stylesheet',\n href: fullHref,\n precedence: precedence,\n crossOrigin: ctx.renderOpts.crossOrigin,\n nonce: ctx.nonce,\n })\n })\n}\n"],"names":["renderCssResource","entryCssFiles","ctx","preloadCallbacks","componentMod","createElement","map","entryCssFile","index","precedence","process","env","NODE_ENV","path","fullHref","assetPrefix","encodeURIPath","getAssetQueryString","inlined","parsedRequestHeaders","isRSCRequest","key","nonce","href","content","push","preloadStyle","renderOpts","crossOrigin","rel"],"mappings":";;;;+BAWgBA;;;eAAAA;;;+BAVc;qCAEM;AAQ7B,SAASA,kBACdC,aAA4B,EAC5BC,GAAqB,EACrBC,gBAAmC;IAEnC,MAAM,EACJC,cAAc,EAAEC,aAAa,EAAE,EAChC,GAAGH;IACJ,OAAOD,cAAcK,GAAG,CAAC,CAACC,cAAcC;QACtC,gEAAgE;QAChE,oEAAoE;QACpE,2DAA2D;QAC3D,iEAAiE;QACjE,0DAA0D;QAC1D,+CAA+C;QAC/C,MAAMC,aACJC,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACrB,UAAUL,aAAaM,IAAI,GAC3B;QAEN,iEAAiE;QACjE,kDAAkD;QAClD,mDAAmD;QACnD,mEAAmE;QACnE,mEAAmE;QACnE,cAAc;QACd,MAAMC,WAAW,GAAGZ,IAAIa,WAAW,CAAC,OAAO,EAAEC,IAAAA,4BAAa,EACxDT,aAAaM,IAAI,IACfI,IAAAA,wCAAmB,EAACf,KAAK,OAAO;QAEpC,IAAIK,aAAaW,OAAO,IAAI,CAAChB,IAAIiB,oBAAoB,CAACC,YAAY,EAAE;YAClE,OAAOf,cACL,SACA;gBACEgB,KAAKb;gBACLc,OAAOpB,IAAIoB,KAAK;gBAChBb,YAAYA;gBACZc,MAAMT;YACR,GACAP,aAAaiB,OAAO;QAExB;QAEArB,oCAAAA,iBAAkBsB,IAAI,CAAC;YACrBvB,IAAIE,YAAY,CAACsB,YAAY,CAC3BZ,UACAZ,IAAIyB,UAAU,CAACC,WAAW,EAC1B1B,IAAIoB,KAAK;QAEb;QAEA,OAAOjB,cAAc,QAAQ;YAC3BgB,KAAKb;YACLqB,KAAK;YACLN,MAAMT;YACNL,YAAYA;YACZmB,aAAa1B,IAAIyB,UAAU,CAACC,WAAW;YACvCN,OAAOpB,IAAIoB,KAAK;QAClB;IACF;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,19 @@
export class AsyncCallbackSet {
add(callback) {
this.callbacks.push(callback);
}
async runAll() {
if (!this.callbacks.length) {
return;
}
const callbacks = this.callbacks;
this.callbacks = [];
await Promise.allSettled(callbacks.map(// NOTE: wrapped in an async function to protect against synchronous exceptions
async (f)=>f()));
}
constructor(){
this.callbacks = [];
}
}
//# sourceMappingURL=async-callback-set.js.map

View File

@@ -0,0 +1,8 @@
type Unscopableable = string & {
[K in keyof typeof Array.prototype]:
typeof Array.prototype[K] extends Function ? K : never
}[keyof typeof Array.prototype];
declare function shimUnscopables(method: Unscopableable): void;
export = shimUnscopables;

View File

@@ -0,0 +1,4 @@
{
"main": "../../cjs/_async_to_generator.cjs",
"module": "../../esm/_async_to_generator.js"
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/internal/mailbox.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
export declare function parserSeemsToBeTSESLint(parser: string | undefined): boolean;

View File

@@ -0,0 +1,254 @@
import type * as DateTime from "./DateTime.js";
import * as Either from "./Either.js";
import * as Equal from "./Equal.js";
import * as equivalence from "./Equivalence.js";
import { type Inspectable } from "./Inspectable.js";
import * as Option from "./Option.js";
import { type Pipeable } from "./Pipeable.js";
/**
* @since 2.0.0
* @category symbols
*/
export declare const TypeId: unique symbol;
/**
* @since 2.0.0
* @category symbol
*/
export type TypeId = typeof TypeId;
/**
* @since 2.0.0
* @category models
*/
export interface Cron extends Pipeable, Equal.Equal, Inspectable {
readonly [TypeId]: TypeId;
readonly tz: Option.Option<DateTime.TimeZone>;
readonly seconds: ReadonlySet<number>;
readonly minutes: ReadonlySet<number>;
readonly hours: ReadonlySet<number>;
readonly days: ReadonlySet<number>;
readonly months: ReadonlySet<number>;
readonly weekdays: ReadonlySet<number>;
}
/**
* Checks if a given value is a `Cron` instance.
*
* @since 2.0.0
* @category guards
*/
export declare const isCron: (u: unknown) => u is Cron;
/**
* Creates a `Cron` instance.
*
* @since 2.0.0
* @category constructors
*/
export declare const make: (values: {
readonly seconds?: Iterable<number> | undefined;
readonly minutes: Iterable<number>;
readonly hours: Iterable<number>;
readonly days: Iterable<number>;
readonly months: Iterable<number>;
readonly weekdays: Iterable<number>;
readonly tz?: DateTime.TimeZone | undefined;
}) => Cron;
/**
* @since 2.0.0
* @category symbol
*/
export declare const ParseErrorTypeId: unique symbol;
/**
* @since 2.0.0
* @category symbols
*/
export type ParseErrorTypeId = typeof ParseErrorTypeId;
declare const ParseError_base: new <A extends Record<string, any> = {}>(args: import("./Types.js").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("./Cause.js").YieldableError & {
readonly _tag: "CronParseError";
} & Readonly<A>;
/**
* Represents a checked exception which occurs when decoding fails.
*
* @since 2.0.0
* @category models
*/
export declare class ParseError extends ParseError_base<{
readonly message: string;
readonly input?: string;
}> {
/**
* @since 2.0.0
*/
readonly [ParseErrorTypeId]: symbol;
}
/**
* Returns `true` if the specified value is an `ParseError`, `false` otherwise.
*
* @since 2.0.0
* @category guards
*/
export declare const isParseError: (u: unknown) => u is ParseError;
/**
* Parses a cron expression into a `Cron` instance.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Cron, Either } from "effect"
*
* // At 04:00 on every day-of-month from 8 through 14.
* assert.deepStrictEqual(Cron.parse("0 0 4 8-14 * *"), Either.right(Cron.make({
* seconds: [0],
* minutes: [0],
* hours: [4],
* days: [8, 9, 10, 11, 12, 13, 14],
* months: [],
* weekdays: []
* })))
* ```
*
* @since 2.0.0
* @category constructors
*/
export declare const parse: (cron: string, tz?: DateTime.TimeZone | string) => Either.Either<Cron, ParseError>;
/**
* Parses a cron expression into a `Cron` instance.
*
* **Details**
*
* This function takes a cron expression as a string and attempts to parse it
* into a `Cron` instance. If the expression is valid, the resulting `Cron`
* instance will represent the schedule defined by the cron expression.
*
* If the expression is invalid, the function throws a `ParseError`.
*
* You can optionally provide a time zone (`tz`) to interpret the cron
* expression in a specific time zone. If no time zone is provided, the cron
* expression will use the default time zone.
*
* @example
* ```ts
* import { Cron } from "effect"
*
* // At 04:00 on every day-of-month from 8 through 14.
* console.log(Cron.unsafeParse("0 4 8-14 * *"))
* // Output:
* // {
* // _id: 'Cron',
* // tz: { _id: 'Option', _tag: 'None' },
* // seconds: [ 0 ],
* // minutes: [ 0 ],
* // hours: [ 4 ],
* // days: [
* // 8, 9, 10, 11,
* // 12, 13, 14
* // ],
* // months: [],
* // weekdays: []
* // }
* ```
*
* @since 2.0.0
* @category constructors
*/
export declare const unsafeParse: (cron: string, tz?: DateTime.TimeZone | string) => Cron;
/**
* Checks if a given `Date` falls within an active `Cron` time window.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Cron, Either } from "effect"
*
* const cron = Either.getOrThrow(Cron.parse("0 4 8-14 * *"))
* assert.deepStrictEqual(Cron.match(cron, new Date("2021-01-08 04:00:00")), true)
* assert.deepStrictEqual(Cron.match(cron, new Date("2021-01-08 05:00:00")), false)
* ```
*
* @throws `IllegalArgumentException` if the given `DateTime.Input` is invalid.
*
* @since 2.0.0
*/
export declare const match: (cron: Cron, date: DateTime.DateTime.Input) => boolean;
/**
* Returns the next run `Date` for the given `Cron` instance.
*
* Uses the current time as a starting point if no value is provided for `startFrom`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Cron, Either } from "effect"
*
* const after = new Date("2021-01-01 00:00:00")
* const cron = Either.getOrThrow(Cron.parse("0 4 8-14 * *"))
* assert.deepStrictEqual(Cron.next(cron, after), new Date("2021-01-08 04:00:00"))
* ```
*
* @throws `IllegalArgumentException` if the given `DateTime.Input` is invalid.
* @throws `Error` if the next run date cannot be found within 10,000 iterations.
*
* @since 2.0.0
*/
export declare const next: (cron: Cron, startFrom?: DateTime.DateTime.Input) => Date;
/**
* Returns the previous run `Date` for the given `Cron` instance.
*
* Uses the current time as a starting point if no value is provided for `startFrom`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Cron, Either } from "effect"
*
* const before = new Date("2021-01-15 00:00:00")
* const cron = Either.getOrThrow(Cron.parse("0 4 8-14 * *"))
* assert.deepStrictEqual(Cron.prev(cron, before), new Date("2021-01-14 04:00:00"))
* ```
*
* @throws `IllegalArgumentException` if the given `DateTime.Input` is invalid.
* @throws `Error` if the previous run date cannot be found within 10,000 iterations.
*
* @since 3.20.0
*/
export declare const prev: (cron: Cron, startFrom?: DateTime.DateTime.Input) => Date;
/**
* Returns an `IterableIterator` which yields the sequence of `Date`s that match the `Cron` instance.
*
* @since 2.0.0
*/
export declare const sequence: (cron: Cron, startFrom?: DateTime.DateTime.Input) => IterableIterator<Date>;
/**
* Returns an `IterableIterator` which yields the sequence of `Date`s that match the `Cron` instance,
* in reverse direction.
*
* @since 3.20.0
*/
export declare const sequenceReverse: (cron: Cron, startFrom?: DateTime.DateTime.Input) => IterableIterator<Date>;
/**
* @category instances
* @since 2.0.0
*/
export declare const Equivalence: equivalence.Equivalence<Cron>;
/**
* Checks if two `Cron`s are equal.
*
* @since 2.0.0
* @category predicates
*/
export declare const equals: {
/**
* Checks if two `Cron`s are equal.
*
* @since 2.0.0
* @category predicates
*/
(that: Cron): (self: Cron) => boolean;
/**
* Checks if two `Cron`s are equal.
*
* @since 2.0.0
* @category predicates
*/
(self: Cron, that: Cron): boolean;
};
export {};
//# sourceMappingURL=Cron.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"message-circle-code.js","sources":["../../../src/icons/message-circle-code.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M10 9.5 8 12l2 2.5', key: '3mjy60' }],\n ['path', { d: 'm14 9.5 2 2.5-2 2.5', key: '1bir2l' }],\n ['path', { d: 'M7.9 20A9 9 0 1 0 4 16.1L2 22z', key: 'k85zhp' }],\n];\n\n/**\n * @component @name MessageCircleCode\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgOS41IDggMTJsMiAyLjUiIC8+CiAgPHBhdGggZD0ibTE0IDkuNSAyIDIuNS0yIDIuNSIgLz4KICA8cGF0aCBkPSJNNy45IDIwQTkgOSAwIDEgMCA0IDE2LjFMMiAyMnoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/message-circle-code\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MessageCircleCode = createLucideIcon('message-circle-code', __iconNode);\n\nexport default MessageCircleCode;\n"],"names":[],"mappings":";;;;;;;;;AAGO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,UAAuB,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAClC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACnD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjE,CAAA,CAAA;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,iBAAA,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAuB,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}

View File

@@ -0,0 +1,235 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = applyDecs2305;
var _checkInRHS = require("./checkInRHS.js");
var _setFunctionName = require("./setFunctionName.js");
var _toPropertyKey = require("./toPropertyKey.js");
function applyDecs2305(targetClass, memberDecs, classDecs, classDecsHaveThis, instanceBrand, parentClass) {
function _bindPropCall(obj, name, before) {
return function (_this, value) {
if (before) {
before(_this);
}
return obj[name].call(_this, value);
};
}
function runInitializers(initializers, value) {
for (var i = 0; i < initializers.length; i++) {
initializers[i].call(value);
}
return value;
}
function assertCallable(fn, hint1, hint2, throwUndefined) {
if (typeof fn !== "function") {
if (throwUndefined || fn !== void 0) {
throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
}
}
return fn;
}
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, metadata, initializers, ret, isStatic, isPrivate, isField, isAccessor, hasPrivateBrand) {
function assertInstanceIfPrivate(target) {
if (!hasPrivateBrand(target)) {
throw new TypeError("Attempted to access private element on non-instance");
}
}
var decs = decInfo[0],
decVal = decInfo[3],
_,
isClass = !ret;
if (!isClass) {
if (!decoratorsHaveThis && !Array.isArray(decs)) {
decs = [decs];
}
var desc = {},
init = [],
key = kind === 3 ? "get" : kind === 4 || isAccessor ? "set" : "value";
if (isPrivate) {
if (isField || isAccessor) {
desc = {
get: (0, _setFunctionName.default)(function () {
return decVal(this);
}, name, "get"),
set: function (value) {
decInfo[4](this, value);
}
};
} else {
desc[key] = decVal;
}
if (!isField) {
(0, _setFunctionName.default)(desc[key], name, kind === 2 ? "" : key);
}
} else if (!isField) {
desc = Object.getOwnPropertyDescriptor(Class, name);
}
}
var newValue = Class;
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
var dec = decs[i],
decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
var decoratorFinishedRef = {};
var ctx = {
kind: ["field", "accessor", "method", "getter", "setter", "class"][kind],
name: name,
metadata: metadata,
addInitializer: function (decoratorFinishedRef, initializer) {
if (decoratorFinishedRef.v) {
throw new Error("attempted to call addInitializer after decoration was finished");
}
assertCallable(initializer, "An initializer", "be", true);
initializers.push(initializer);
}.bind(null, decoratorFinishedRef)
};
try {
if (isClass) {
if (_ = assertCallable(dec.call(decThis, newValue, ctx), "class decorators", "return")) {
newValue = _;
}
} else {
ctx["static"] = isStatic;
ctx["private"] = isPrivate;
var get, set;
if (!isPrivate) {
get = function (target) {
return target[name];
};
if (kind < 2 || kind === 4) {
set = function (target, v) {
target[name] = v;
};
}
} else if (kind === 2) {
get = function (_this) {
assertInstanceIfPrivate(_this);
return desc.value;
};
} else {
if (kind < 4) {
get = _bindPropCall(desc, "get", assertInstanceIfPrivate);
}
if (kind !== 3) {
set = _bindPropCall(desc, "set", assertInstanceIfPrivate);
}
}
var access = ctx.access = {
has: isPrivate ? hasPrivateBrand.bind() : function (target) {
return name in target;
}
};
if (get) access.get = get;
if (set) access.set = set;
newValue = dec.call(decThis, isAccessor ? {
get: desc.get,
set: desc.set
} : desc[key], ctx);
if (isAccessor) {
if (typeof newValue === "object" && newValue) {
if (_ = assertCallable(newValue.get, "accessor.get")) {
desc.get = _;
}
if (_ = assertCallable(newValue.set, "accessor.set")) {
desc.set = _;
}
if (_ = assertCallable(newValue.init, "accessor.init")) {
init.push(_);
}
} else if (newValue !== void 0) {
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
}
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) {
if (isField) {
init.push(newValue);
} else {
desc[key] = newValue;
}
}
}
} finally {
decoratorFinishedRef.v = true;
}
}
if (isField || isAccessor) {
ret.push(function (instance, value) {
for (var i = init.length - 1; i >= 0; i--) {
value = init[i].call(instance, value);
}
return value;
});
}
if (!isField && !isClass) {
if (isPrivate) {
if (isAccessor) {
ret.push(_bindPropCall(desc, "get"), _bindPropCall(desc, "set"));
} else {
ret.push(kind === 2 ? desc[key] : _bindPropCall.call.bind(desc[key]));
}
} else {
Object.defineProperty(Class, name, desc);
}
}
return newValue;
}
function applyMemberDecs(Class, decInfos, instanceBrand, metadata) {
var ret = [];
var protoInitializers;
var staticInitializers;
var staticBrand = function (_) {
return (0, _checkInRHS.default)(_) === Class;
};
var existingNonFields = new Map();
function pushInitializers(initializers) {
if (initializers) {
ret.push(runInitializers.bind(null, initializers));
}
}
for (var i = 0; i < decInfos.length; i++) {
var decInfo = decInfos[i];
if (!Array.isArray(decInfo)) continue;
var kind = decInfo[1];
var name = decInfo[2];
var isPrivate = decInfo.length > 3;
var decoratorsHaveThis = kind & 16;
var isStatic = !!(kind & 8);
kind &= 7;
var isField = kind === 0;
var key = name + "/" + isStatic;
if (!isField && !isPrivate) {
var existingKind = existingNonFields.get(key);
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
}
existingNonFields.set(key, kind > 2 ? kind : true);
}
applyDec(isStatic ? Class : Class.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : (0, _toPropertyKey.default)(name), kind, metadata, isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, isStatic, isPrivate, isField, kind === 1, isStatic && isPrivate ? staticBrand : instanceBrand);
}
pushInitializers(protoInitializers);
pushInitializers(staticInitializers);
return ret;
}
function defineMetadata(Class, metadata) {
return Object.defineProperty(Class, Symbol.metadata || Symbol["for"]("Symbol.metadata"), {
configurable: true,
enumerable: true,
value: metadata
});
}
if (arguments.length >= 6) {
var parentMetadata = parentClass[Symbol.metadata || Symbol["for"]("Symbol.metadata")];
}
var metadata = Object.create(parentMetadata == null ? null : parentMetadata);
var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata);
if (!classDecs.length) defineMetadata(targetClass, metadata);
return {
e: e,
get c() {
var initializers = [];
return classDecs.length && [defineMetadata(applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, metadata, initializers), metadata), runInitializers.bind(null, initializers, targetClass)];
}
};
}
//# sourceMappingURL=applyDecs2305.js.map

View File

@@ -0,0 +1,136 @@
// src/use-controllable-state.tsx
import * as React from "react";
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect;
function useControllableState({
prop,
defaultProp,
onChange = () => {
},
caller
}) {
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
defaultProp,
onChange
});
const isControlled = prop !== void 0;
const value = isControlled ? prop : uncontrolledProp;
if (true) {
const isControlledRef = React.useRef(prop !== void 0);
React.useEffect(() => {
const wasControlled = isControlledRef.current;
if (wasControlled !== isControlled) {
const from = wasControlled ? "controlled" : "uncontrolled";
const to = isControlled ? "controlled" : "uncontrolled";
console.warn(
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
);
}
isControlledRef.current = isControlled;
}, [isControlled, caller]);
}
const setValue = React.useCallback(
(nextValue) => {
if (isControlled) {
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
if (value2 !== prop) {
onChangeRef.current?.(value2);
}
} else {
setUncontrolledProp(nextValue);
}
},
[isControlled, prop, setUncontrolledProp, onChangeRef]
);
return [value, setValue];
}
function useUncontrolledState({
defaultProp,
onChange
}) {
const [value, setValue] = React.useState(defaultProp);
const prevValueRef = React.useRef(value);
const onChangeRef = React.useRef(onChange);
useInsertionEffect(() => {
onChangeRef.current = onChange;
}, [onChange]);
React.useEffect(() => {
if (prevValueRef.current !== value) {
onChangeRef.current?.(value);
prevValueRef.current = value;
}
}, [value, prevValueRef]);
return [value, setValue, onChangeRef];
}
function isFunction(value) {
return typeof value === "function";
}
// src/use-controllable-state-reducer.tsx
import * as React2 from "react";
import { useEffectEvent } from "@radix-ui/react-use-effect-event";
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
function useControllableStateReducer(reducer, userArgs, initialArg, init) {
const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;
const isControlled = controlledState !== void 0;
const onChange = useEffectEvent(onChangeProp);
if (true) {
const isControlledRef = React2.useRef(controlledState !== void 0);
React2.useEffect(() => {
const wasControlled = isControlledRef.current;
if (wasControlled !== isControlled) {
const from = wasControlled ? "controlled" : "uncontrolled";
const to = isControlled ? "controlled" : "uncontrolled";
console.warn(
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
);
}
isControlledRef.current = isControlled;
}, [isControlled, caller]);
}
const args = [{ ...initialArg, state: defaultProp }];
if (init) {
args.push(init);
}
const [internalState, dispatch] = React2.useReducer(
(state2, action) => {
if (action.type === SYNC_STATE) {
return { ...state2, state: action.state };
}
const next = reducer(state2, action);
if (isControlled && !Object.is(next.state, state2.state)) {
onChange(next.state);
}
return next;
},
...args
);
const uncontrolledState = internalState.state;
const prevValueRef = React2.useRef(uncontrolledState);
React2.useEffect(() => {
if (prevValueRef.current !== uncontrolledState) {
prevValueRef.current = uncontrolledState;
if (!isControlled) {
onChange(uncontrolledState);
}
}
}, [onChange, uncontrolledState, prevValueRef, isControlled]);
const state = React2.useMemo(() => {
const isControlled2 = controlledState !== void 0;
if (isControlled2) {
return { ...internalState, state: controlledState };
}
return internalState;
}, [internalState, controlledState]);
React2.useEffect(() => {
if (isControlled && !Object.is(controlledState, internalState.state)) {
dispatch({ type: SYNC_STATE, state: controlledState });
}
}, [controlledState, internalState.state, isControlled]);
return [state, dispatch];
}
export {
useControllableState,
useControllableStateReducer
};
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/server/route-definitions/app-page-route-definition.ts"],"sourcesContent":["import type { RouteDefinition } from './route-definition'\nimport { RouteKind } from '../route-kind'\n\nexport interface AppPageRouteDefinition\n extends RouteDefinition<RouteKind.APP_PAGE> {\n readonly appPaths: ReadonlyArray<string>\n}\n\n/**\n * Returns true if the given definition is an App Page route definition.\n */\nexport function isAppPageRouteDefinition(\n definition: RouteDefinition\n): definition is AppPageRouteDefinition {\n return definition.kind === RouteKind.APP_PAGE\n}\n"],"names":["isAppPageRouteDefinition","definition","kind","RouteKind","APP_PAGE"],"mappings":";;;;+BAWgBA;;;eAAAA;;;2BAVU;AAUnB,SAASA,yBACdC,UAA2B;IAE3B,OAAOA,WAAWC,IAAI,KAAKC,oBAAS,CAACC,QAAQ;AAC/C","ignoreList":[0]}

View File

@@ -0,0 +1,37 @@
{
"name": "@nodelib/fs.stat",
"version": "2.0.5",
"description": "Get the status of a file with some features",
"license": "MIT",
"repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat",
"keywords": [
"NodeLib",
"fs",
"FileSystem",
"file system",
"stat"
],
"engines": {
"node": ">= 8"
},
"files": [
"out/**",
"!out/**/*.map",
"!out/**/*.spec.*"
],
"main": "out/index.js",
"typings": "out/index.d.ts",
"scripts": {
"clean": "rimraf {tsconfig.tsbuildinfo,out}",
"lint": "eslint \"src/**/*.ts\" --cache",
"compile": "tsc -b .",
"compile:watch": "tsc -p . --watch --sourceMap",
"test": "mocha \"out/**/*.spec.js\" -s 0",
"build": "npm run clean && npm run compile && npm run lint && npm test",
"watch": "npm run clean && npm run compile:watch"
},
"devDependencies": {
"@nodelib/fs.macchiato": "1.0.4"
},
"gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562"
}

View File

@@ -0,0 +1,5 @@
'use strict'
module.exports.isClean = Symbol('isClean')
module.exports.my = Symbol('my')

View File

@@ -0,0 +1,9 @@
module.exports = {
y: 1 << 0,
n: 1 << 1,
a: 1 << 2,
p: 1 << 3,
u: 1 << 4,
x: 1 << 5,
d: 1 << 6
}

View File

@@ -0,0 +1,31 @@
'use strict';
var callBound = require('call-bound');
var safeRegexTest = require('safe-regex-test');
var isFnRegex = safeRegexTest(/^\s*(?:function)?\*/);
var hasToStringTag = require('has-tostringtag/shams')();
var getProto = require('get-proto');
var toStr = callBound('Object.prototype.toString');
var fnToStr = callBound('Function.prototype.toString');
var getGeneratorFunction = require('generator-function');
/** @type {import('.')} */
module.exports = function isGeneratorFunction(fn) {
if (typeof fn !== 'function') {
return false;
}
if (isFnRegex(fnToStr(fn))) {
return true;
}
if (!hasToStringTag) {
var str = toStr(fn);
return str === '[object GeneratorFunction]';
}
if (!getProto) {
return false;
}
var GeneratorFunction = getGeneratorFunction();
return GeneratorFunction && getProto(fn) === GeneratorFunction.prototype;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/build/get-babel-config-file.ts"],"sourcesContent":["import { join } from 'path'\nimport { existsSync } from 'fs'\n\nconst BABEL_CONFIG_FILES = [\n '.babelrc',\n '.babelrc.json',\n '.babelrc.js',\n '.babelrc.mjs',\n '.babelrc.cjs',\n 'babel.config.js',\n 'babel.config.json',\n 'babel.config.mjs',\n 'babel.config.cjs',\n]\n\nexport function getBabelConfigFile(dir: string): string | undefined {\n for (const filename of BABEL_CONFIG_FILES) {\n const configFilePath = join(dir, filename)\n const exists = existsSync(configFilePath)\n if (!exists) {\n continue\n }\n return configFilePath\n }\n}\n"],"names":["getBabelConfigFile","BABEL_CONFIG_FILES","dir","filename","configFilePath","join","exists","existsSync"],"mappings":";;;;+BAegBA;;;eAAAA;;;sBAfK;oBACM;AAE3B,MAAMC,qBAAqB;IACzB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAEM,SAASD,mBAAmBE,GAAW;IAC5C,KAAK,MAAMC,YAAYF,mBAAoB;QACzC,MAAMG,iBAAiBC,IAAAA,UAAI,EAACH,KAAKC;QACjC,MAAMG,SAASC,IAAAA,cAAU,EAACH;QAC1B,IAAI,CAACE,QAAQ;YACX;QACF;QACA,OAAOF;IACT;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,41 @@
{
"name": "@prisma/engines",
"version": "6.19.3",
"description": "This package is intended for Prisma's internal use",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/prisma/prisma.git",
"directory": "packages/engines"
},
"license": "Apache-2.0",
"author": "Tim Suchanek <suchanek@prisma.io>",
"devDependencies": {
"@swc/core": "1.11.5",
"@swc/jest": "0.2.37",
"@types/jest": "29.5.14",
"@types/node": "18.19.76",
"execa": "5.1.1",
"typescript": "5.4.5",
"vitest": "3.2.4"
},
"dependencies": {
"@prisma/engines-version": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
"@prisma/debug": "6.19.3",
"@prisma/fetch-engine": "6.19.3",
"@prisma/get-platform": "6.19.3"
},
"files": [
"dist",
"download",
"scripts"
],
"sideEffects": false,
"scripts": {
"dev": "DEV=true tsx helpers/build.ts",
"build": "tsx helpers/build.ts",
"test": "vitest run",
"postinstall": "node scripts/postinstall.js"
}
}

View File

@@ -0,0 +1,2 @@
import '../lib/require-instrumentation-client';
export declare function pageBootstrap(assetPrefix: string): Promise<void>;

View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/which-boxed-primitive
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -0,0 +1,32 @@
'use strict';
var $TypeError = require('es-errors/type');
var CanonicalizeKeyedCollectionKey = require('./CanonicalizeKeyedCollectionKey');
var SameValue = require('./SameValue');
var isArray = require('../helpers/IsArray');
// https://262.ecma-international.org/16.0/#sec-setdataindex
module.exports = function SetDataIndex(setData, value) {
if (!isArray(setData) && setData !== 'EMPTY') {
throw new $TypeError('Assertion failed: `setData` must be a List or ~EMPTY~');
}
var canonValue = CanonicalizeKeyedCollectionKey(value); // step 1
var size = setData.length; // step 2
var index = 0; // step 3
while (index < size) { // step 4
var e = setData[index]; // step 4.a
if (/* e !== ~EMPTY~ && */ SameValue(e, canonValue)) { // step 4.b
return index; // step 4.b.i
}
index += 1; // step 4.c
}
return 'NOT-FOUND'; // step 5
};

View File

@@ -0,0 +1,38 @@
{
"name": "intl-messageformat",
"description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.",
"version": "11.2.1",
"license": "BSD-3-Clause",
"author": "Eric Ferraiuolo <eferraiuolo@gmail.com>",
"type": "module",
"sideEffects": false,
"types": "index.d.ts",
"exports": {
".": "./index.js"
},
"dependencies": {
"@formatjs/fast-memoize": "3.1.2",
"@formatjs/icu-messageformat-parser": "3.5.4"
},
"bugs": "https://github.com/formatjs/formatjs/issues",
"contributors": [
"Anthony Pipkin <a.pipkin@yahoo.com>",
"Caridy Patino <caridy@gmail.com>",
"Drew Folta <drew@folta.net>",
"Long Ho <holevietlong@gmail.com>"
],
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
"homepage": "https://github.com/formatjs/formatjs",
"keywords": [
"globalization",
"i18n",
"icu",
"internationalization",
"intl",
"localization",
"messageformat",
"parser",
"plural"
],
"repository": "git@github.com:formatjs/formatjs.git"
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/lib/router-utils/build-prefetch-segment-data-route.ts"],"sourcesContent":["import path from '../../../shared/lib/isomorphic/path'\nimport { normalizePagePath } from '../../../shared/lib/page-path/normalize-page-path'\nimport { getNamedRouteRegex } from '../../../shared/lib/router/utils/route-regex'\nimport {\n RSC_SEGMENT_SUFFIX,\n RSC_SEGMENTS_DIR_SUFFIX,\n} from '../../../lib/constants'\n\nexport const SEGMENT_PATH_KEY = 'nextSegmentPath'\n\nexport type PrefetchSegmentDataRoute = {\n source: string\n destination: string\n routeKeys: { [key: string]: string }\n}\n\nexport function buildPrefetchSegmentDataRoute(\n page: string,\n segmentPath: string\n): PrefetchSegmentDataRoute {\n const pagePath = normalizePagePath(page)\n\n const destination = path.posix.join(\n `${pagePath}${RSC_SEGMENTS_DIR_SUFFIX}`,\n `${segmentPath}${RSC_SEGMENT_SUFFIX}`\n )\n\n const { namedRegex, routeKeys } = getNamedRouteRegex(destination, {\n prefixRouteKeys: true,\n includePrefix: true,\n includeSuffix: true,\n excludeOptionalTrailingSlash: true,\n backreferenceDuplicateKeys: true,\n })\n\n return {\n destination,\n source: namedRegex,\n routeKeys,\n }\n}\n"],"names":["path","normalizePagePath","getNamedRouteRegex","RSC_SEGMENT_SUFFIX","RSC_SEGMENTS_DIR_SUFFIX","SEGMENT_PATH_KEY","buildPrefetchSegmentDataRoute","page","segmentPath","pagePath","destination","posix","join","namedRegex","routeKeys","prefixRouteKeys","includePrefix","includeSuffix","excludeOptionalTrailingSlash","backreferenceDuplicateKeys","source"],"mappings":"AAAA,OAAOA,UAAU,sCAAqC;AACtD,SAASC,iBAAiB,QAAQ,oDAAmD;AACrF,SAASC,kBAAkB,QAAQ,+CAA8C;AACjF,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,yBAAwB;AAE/B,OAAO,MAAMC,mBAAmB,kBAAiB;AAQjD,OAAO,SAASC,8BACdC,IAAY,EACZC,WAAmB;IAEnB,MAAMC,WAAWR,kBAAkBM;IAEnC,MAAMG,cAAcV,KAAKW,KAAK,CAACC,IAAI,CACjC,GAAGH,WAAWL,yBAAyB,EACvC,GAAGI,cAAcL,oBAAoB;IAGvC,MAAM,EAAEU,UAAU,EAAEC,SAAS,EAAE,GAAGZ,mBAAmBQ,aAAa;QAChEK,iBAAiB;QACjBC,eAAe;QACfC,eAAe;QACfC,8BAA8B;QAC9BC,4BAA4B;IAC9B;IAEA,OAAO;QACLT;QACAU,QAAQP;QACRC;IACF;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,48 @@
let targetsCache = {};
/**
* Convert a version number to a single 24-bit number
*
* https://github.com/lumeland/lume/blob/4cc75599006df423a14befc06d3ed8493c645b09/plugins/lightningcss.ts#L160
*/ function version(major, minor = 0, patch = 0) {
return major << 16 | minor << 8 | patch;
}
function parseVersion(v) {
return v.split('.').reduce((acc, val)=>{
if (!acc) {
return null;
}
const parsed = parseInt(val, 10);
if (isNaN(parsed)) {
return null;
}
acc.push(parsed);
return acc;
}, []);
}
function browserslistToTargets(targets) {
return targets.reduce((acc, value)=>{
const [name, v] = value.split(' ');
const parsedVersion = parseVersion(v);
if (!parsedVersion) {
return acc;
}
const versionDigit = version(parsedVersion[0], parsedVersion[1], parsedVersion[2]);
if (name === 'and_qq' || name === 'and_uc' || name === 'baidu' || name === 'bb' || name === 'kaios' || name === 'op_mini') {
return acc;
}
if (acc[name] == null || versionDigit < acc[name]) {
acc[name] = versionDigit;
}
return acc;
}, {});
}
export const getTargets = (opts)=>{
const cache = targetsCache[opts.key];
if (cache) {
return cache;
}
const result = browserslistToTargets(opts.targets ?? []);
return targetsCache[opts.key] = result;
};
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1,68 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var MakeDay = require('./MakeDay');
var MakeTime = require('./MakeTime');
var MakeDate = require('./MakeDate');
var isInteger = require('math-intrinsics/isInteger');
var $BigInt = GetIntrinsic('%BigInt%', true);
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $TypeError = GetIntrinsic('%TypeError%');
// https://tc39.es/ecma262/#sec-getutcepochnanoseconds
// eslint-disable-next-line max-params
module.exports = function GetUTCEpochNanoseconds(
year,
month,
day,
hour,
minute,
second,
millisecond,
microsecond,
nanosecond
) {
if (!isInteger(year)) {
throw new $TypeError('Assertion failed: `year` must be an integral Number');
}
if (!isInteger(month) || month < 1 || month > 12) {
throw new $TypeError('Assertion failed: `month` must be an integral Number between 1 and 12, inclusive');
}
if (!isInteger(day) || day < 1 || day > 31) {
throw new $TypeError('Assertion failed: `day` must be an integral Number between 1 and 31, inclusive');
}
if (!isInteger(hour) || hour < 0 || hour > 23) {
throw new $TypeError('Assertion failed: `hour` must be an integral Number between 0 and 23, inclusive');
}
if (!isInteger(minute) || minute < 0 || minute > 59) {
throw new $TypeError('Assertion failed: `minute` must be an integral Number between 0 and 59, inclusive');
}
if (!isInteger(second) || second < 0 || second > 59) {
throw new $TypeError('Assertion failed: `second` must be an integral Number between 0 and 59, inclusive');
}
if (!isInteger(millisecond) || millisecond < 0 || millisecond > 999) {
throw new $TypeError('Assertion failed: `millisecond` must be an integral Number between 0 and 999, inclusive');
}
if (!isInteger(microsecond) || microsecond < 0 || microsecond > 999) {
throw new $TypeError('Assertion failed: `microsecond` must be an integral Number between 0 and 999, inclusive');
}
if (!isInteger(nanosecond) || nanosecond < 0 || nanosecond > 999) {
throw new $TypeError('Assertion failed: `nanosecond` must be an integral Number between 0 and 999, inclusive');
}
var date = MakeDay(year, month - 1, day); // step 1
var time = MakeTime(hour, minute, second, millisecond); // step 2
var ms = MakeDate(date, time); // step 3
if (!isInteger(ms)) {
throw new $TypeError('Assertion failed: `ms` from MakeDate is not an integral Number'); // step 4
}
if (!$BigInt) {
throw new $SyntaxError('BigInts are not supported in this environment');
}
return $BigInt((ms * 1e6) + (microsecond * 1e3) + nanosecond); // step 5
};

View File

@@ -0,0 +1,3 @@
declare const _exports: import('eslint').Rule.RuleModule;
export = _exports;
//# sourceMappingURL=destructuring-assignment.d.ts.map

View File

@@ -0,0 +1,135 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "karakter", verb: "legyen" },
file: { unit: "byte", verb: "legyen" },
array: { unit: "elem", verb: "legyen" },
set: { unit: "elem", verb: "legyen" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "bemenet",
email: "email cím",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO időbélyeg",
date: "ISO dátum",
time: "ISO idő",
duration: "ISO időintervallum",
ipv4: "IPv4 cím",
ipv6: "IPv6 cím",
cidrv4: "IPv4 tartomány",
cidrv6: "IPv6 tartomány",
base64: "base64-kódolt string",
base64url: "base64url-kódolt string",
json_string: "JSON string",
e164: "E.164 szám",
jwt: "JWT",
template_literal: "bemenet",
};
const TypeDictionary = {
nan: "NaN",
number: "szám",
array: "tömb",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Érvénytelen bemenet: a várt érték instanceof ${issue.expected}, a kapott érték ${received}`;
}
return `Érvénytelen bemenet: a várt érték ${expected}, a kapott érték ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Érvénytelen bemenet: a várt érték ${util.stringifyPrimitive(issue.values[0])}`;
return `Érvénytelen opció: valamelyik érték várt ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Túl nagy: ${issue.origin ?? "érték"} mérete túl nagy ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elem"}`;
return `Túl nagy: a bemeneti érték ${issue.origin ?? "érték"} túl nagy: ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Túl kicsi: a bemeneti érték ${issue.origin} mérete túl kicsi ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Túl kicsi: a bemeneti érték ${issue.origin} túl kicsi ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Érvénytelen string: "${_issue.prefix}" értékkel kell kezdődnie`;
if (_issue.format === "ends_with")
return `Érvénytelen string: "${_issue.suffix}" értékkel kell végződnie`;
if (_issue.format === "includes")
return `Érvénytelen string: "${_issue.includes}" értéket kell tartalmaznia`;
if (_issue.format === "regex")
return `Érvénytelen string: ${_issue.pattern} mintának kell megfelelnie`;
return `Érvénytelen ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Érvénytelen szám: ${issue.divisor} többszörösének kell lennie`;
case "unrecognized_keys":
return `Ismeretlen kulcs${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Érvénytelen kulcs ${issue.origin}`;
case "invalid_union":
return "Érvénytelen bemenet";
case "invalid_element":
return `Érvénytelen érték: ${issue.origin}`;
default:
return `Érvénytelen bemenet`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;

View File

@@ -0,0 +1,150 @@
import type { Inspectable } from "./Inspectable.js";
import type { Pipeable } from "./Pipeable.js";
declare const TypeId: unique symbol;
/**
* @since 2.0.0
* @category symbol
*/
export type TypeId = typeof TypeId;
/**
* @since 2.0.0
* @category model
*/
export interface MutableList<out A> extends Iterable<A>, Pipeable, Inspectable {
readonly [TypeId]: TypeId;
}
/**
* Creates an empty `MutableList`.
*
* @since 2.0.0
* @category constructors
*/
export declare const empty: <A = never>() => MutableList<A>;
/**
* Creates a new `MutableList` from an iterable collection of values.
*
* @since 2.0.0
* @category constructors
*/
export declare const fromIterable: <A>(iterable: Iterable<A>) => MutableList<A>;
/**
* Creates a new `MutableList` from the specified elements.
*
* @since 2.0.0
* @category constructors
*/
export declare const make: <A>(...elements: ReadonlyArray<A>) => MutableList<A>;
/**
* Returns `true` if the list contains zero elements, `false`, otherwise.
*
* @since 2.0.0
* @category getters
*/
export declare const isEmpty: <A>(self: MutableList<A>) => boolean;
/**
* Returns the length of the list.
*
* @since 2.0.0
* @category getters
*/
export declare const length: <A>(self: MutableList<A>) => number;
/**
* Returns the last element of the list, if it exists.
*
* @since 2.0.0
* @category getters
*/
export declare const tail: <A>(self: MutableList<A>) => A | undefined;
/**
* Returns the first element of the list, if it exists.
*
* @since 2.0.0
* @category getters
*/
export declare const head: <A>(self: MutableList<A>) => A | undefined;
/**
* Executes the specified function `f` for each element in the list.
*
* @since 2.0.0
* @category traversing
*/
export declare const forEach: {
/**
* Executes the specified function `f` for each element in the list.
*
* @since 2.0.0
* @category traversing
*/
<A>(f: (element: A) => void): (self: MutableList<A>) => void;
/**
* Executes the specified function `f` for each element in the list.
*
* @since 2.0.0
* @category traversing
*/
<A>(self: MutableList<A>, f: (element: A) => void): void;
};
/**
* Removes all elements from the doubly-linked list.
*
* @since 2.0.0
*/
export declare const reset: <A>(self: MutableList<A>) => MutableList<A>;
/**
* Appends the specified element to the end of the `MutableList`.
*
* @category concatenating
* @since 2.0.0
*/
export declare const append: {
/**
* Appends the specified element to the end of the `MutableList`.
*
* @category concatenating
* @since 2.0.0
*/
<A>(value: A): (self: MutableList<A>) => MutableList<A>;
/**
* Appends the specified element to the end of the `MutableList`.
*
* @category concatenating
* @since 2.0.0
*/
<A>(self: MutableList<A>, value: A): MutableList<A>;
};
/**
* Removes the first value from the list and returns it, if it exists.
*
* @since 0.0.1
*/
export declare const shift: <A>(self: MutableList<A>) => A | undefined;
/**
* Removes the last value from the list and returns it, if it exists.
*
* @since 0.0.1
*/
export declare const pop: <A>(self: MutableList<A>) => A | undefined;
/**
* Prepends the specified value to the beginning of the list.
*
* @category concatenating
* @since 2.0.0
*/
export declare const prepend: {
/**
* Prepends the specified value to the beginning of the list.
*
* @category concatenating
* @since 2.0.0
*/
<A>(value: A): (self: MutableList<A>) => MutableList<A>;
/**
* Prepends the specified value to the beginning of the list.
*
* @category concatenating
* @since 2.0.0
*/
<A>(self: MutableList<A>, value: A): MutableList<A>;
};
export {};
//# sourceMappingURL=MutableList.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"amphora.js","sources":["../../../src/icons/amphora.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n { d: 'M10 2v5.632c0 .424-.272.795-.653.982A6 6 0 0 0 6 14c.006 4 3 7 5 8', key: '1h8rid' },\n ],\n ['path', { d: 'M10 5H8a2 2 0 0 0 0 4h.68', key: '3ezsi6' }],\n ['path', { d: 'M14 2v5.632c0 .424.272.795.652.982A6 6 0 0 1 18 14c0 4-3 7-5 8', key: 'yt6q09' }],\n ['path', { d: 'M14 5h2a2 2 0 0 1 0 4h-.68', key: '8f95yk' }],\n ['path', { d: 'M18 22H6', key: 'mg6kv4' }],\n ['path', { d: 'M9 2h6', key: '1jrp98' }],\n];\n\n/**\n * @component @name Amphora\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMnY1LjYzMmMwIC40MjQtLjI3Mi43OTUtLjY1My45ODJBNiA2IDAgMCAwIDYgMTRjLjAwNiA0IDMgNyA1IDgiIC8+CiAgPHBhdGggZD0iTTEwIDVIOGEyIDIgMCAwIDAgMCA0aC42OCIgLz4KICA8cGF0aCBkPSJNMTQgMnY1LjYzMmMwIC40MjQuMjcyLjc5NS42NTIuOTgyQTYgNiAwIDAgMSAxOCAxNGMwIDQtMyA3LTUgOCIgLz4KICA8cGF0aCBkPSJNMTQgNWgyYTIgMiAwIDAgMSAwIDRoLS42OCIgLz4KICA8cGF0aCBkPSJNMTggMjJINiIgLz4KICA8cGF0aCBkPSJNOSAyaDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/amphora\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Amphora = createLucideIcon('amphora', __iconNode);\n\nexport default Amphora;\n"],"names":[],"mappings":";;;;;;;;;AAGO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,UAAuB,CAAA,CAAA,CAAA,CAAA;AAAA,CAClC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC3F,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzC,CAAA,CAAA;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAW,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"alarm-smoke.js","sources":["../../../src/icons/alarm-smoke.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M11 21c0-2.5 2-2.5 2-5', key: '1sicvv' }],\n ['path', { d: 'M16 21c0-2.5 2-2.5 2-5', key: '1o3eny' }],\n ['path', { d: 'm19 8-.8 3a1.25 1.25 0 0 1-1.2 1H7a1.25 1.25 0 0 1-1.2-1L5 8', key: '1bvca4' }],\n [\n 'path',\n { d: 'M21 3a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a1 1 0 0 1 1-1z', key: 'x3qr1j' },\n ],\n ['path', { d: 'M6 21c0-2.5 2-2.5 2-5', key: 'i3w1gp' }],\n];\n\n/**\n * @component @name AlarmSmoke\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMjFjMC0yLjUgMi0yLjUgMi01IiAvPgogIDxwYXRoIGQ9Ik0xNiAyMWMwLTIuNSAyLTIuNSAyLTUiIC8+CiAgPHBhdGggZD0ibTE5IDgtLjggM2ExLjI1IDEuMjUgMCAwIDEtMS4yIDFIN2ExLjI1IDEuMjUgMCAwIDEtMS4yLTFMNSA4IiAvPgogIDxwYXRoIGQ9Ik0yMSAzYTEgMSAwIDAgMSAxIDF2MmEyIDIgMCAwIDEtMiAySDRhMiAyIDAgMCAxLTItMlY0YTEgMSAwIDAgMSAxLTF6IiAvPgogIDxwYXRoIGQ9Ik02IDIxYzAtMi41IDItMi41IDItNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/alarm-smoke\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst AlarmSmoke = createLucideIcon('alarm-smoke', __iconNode);\n\nexport default AlarmSmoke;\n"],"names":[],"mappings":";;;;;;;;;AAGO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,UAAuB,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAClC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC7F,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC7F,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACxD,CAAA,CAAA;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAe,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}

View File

@@ -0,0 +1,4 @@
{
"main": "../../cjs/_set_prototype_of.cjs",
"module": "../../esm/_set_prototype_of.js"
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/server/route-modules/pages/vendored/contexts/html-context.ts"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].HtmlContext\n"],"names":["module","exports","require","vendored","HtmlContext"],"mappings":"AAAAA,OAAOC,OAAO,GAAG,AACfC,QAAQ,yBACRC,QAAQ,CAAC,WAAW,CAACC,WAAW","ignoreList":[0]}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B 5C"},B:{"1":"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB MB NB OB BB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB I","2":"C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n","516":"o"},C:{"1":"0 1 2 3 4 5 6 7 8 9 t u v w x y z AB MB NB OB BB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB I cC dC RC 7C 8C 9C","2":"6C YC J eB K D E F A B C L M G N O P fB CB DB EB FB GB HB IB JB KB LB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B ZC 9B aC AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC Q H R bC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s AD BD"},D:{"1":"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z AB MB NB OB BB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB I cC dC RC","2":"J eB K D E F A B C L M G N O P fB CB DB EB FB GB HB IB JB KB LB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B ZC 9B aC AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC Q H R S T U V W X Y Z a","194":"c d e f g h i j k l m n","450":"b","516":"o"},E:{"1":"VC iC jC kC lC mC LD WC nC oC pC qC rC MD XC sC tC uC vC wC xC yC zC 0C 1C 2C ND","2":"J eB K D E F A B C L M G CD eC DD ED FD GD fC SC TC HD ID JD gC hC UC KD"},F:{"1":"0 1 2 3 4 5 6 7 8 9 d e f g h i j k l m n o p q r s t u v w x y z AB BB","2":"F B C G N O P fB CB DB EB FB GB HB IB JB KB LB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC OD PD QD RD SC 3C SD TC","194":"Q H R bC S T U V W X Y Z","516":"a b c"},G:{"1":"VC iC jC kC lC mC oD WC nC oC pC qC rC pD XC sC tC uC vC wC xC yC zC 0C 1C 2C","2":"E eC TD 4C UD VD WD XD YD ZD aD bD cD dD eD fD gD hD iD jD kD lD mD gC hC UC nD"},H:{"2":"qD"},I:{"1":"I","2":"YC J rD sD tD uD 4C vD wD"},J:{"2":"D A"},K:{"1":"H","2":"A B C SC 3C TC"},L:{"1":"I"},M:{"1":"RC"},N:{"2":"A B"},O:{"2":"UC"},P:{"1":"CB DB EB FB GB HB IB JB KB LB","2":"J xD yD zD 0D 1D fC 2D 3D 4D 5D 6D VC WC XC 7D"},Q:{"2":"8D"},R:{"2":"9D"},S:{"2":"AE BE"}},B:5,C:"CSS Container Queries (Size)",D:true};

View File

@@ -0,0 +1,34 @@
/**
* Un-escape a string that has been escaped with {@link escape}.
*
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
* square-bracket escapes are removed, but not backslash escapes.
*
* For example, it will turn the string `'[*]'` into `*`, but it will not
* turn `'\\*'` into `'*'`, because `\` is a path separator in
* `windowsPathsNoEscape` mode.
*
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
* backslash escapes are removed.
*
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
* or unescaped.
*
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
* unescaped.
*/
export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
if (magicalBraces) {
return windowsPathsNoEscape ?
s.replace(/\[([^/\\])\]/g, '$1')
: s
.replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
.replace(/\\([^/])/g, '$1');
}
return windowsPathsNoEscape ?
s.replace(/\[([^/\\{}])\]/g, '$1')
: s
.replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
.replace(/\\([^/{}])/g, '$1');
};
//# sourceMappingURL=unescape.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNextInvalidImportError.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { formatModuleTrace, getModuleTrace } from './getModuleTrace'\nimport { SimpleWebpackError } from './simpleWebpackError'\n\nexport function getNextInvalidImportError(\n err: Error,\n module: any,\n compilation: webpack.Compilation,\n compiler: webpack.Compiler\n): SimpleWebpackError | false {\n try {\n if (\n !module.loaders.find((loader: any) =>\n loader.loader.includes('next-invalid-import-error-loader.js')\n )\n ) {\n return false\n }\n\n const { moduleTrace } = getModuleTrace(module, compilation, compiler)\n const { formattedModuleTrace, lastInternalFileName, invalidImportMessage } =\n formatModuleTrace(compiler, moduleTrace)\n\n return new SimpleWebpackError(\n lastInternalFileName,\n err.message +\n invalidImportMessage +\n '\\n\\nImport trace for requested module:\\n' +\n formattedModuleTrace\n )\n } catch {\n return false\n }\n}\n"],"names":["formatModuleTrace","getModuleTrace","SimpleWebpackError","getNextInvalidImportError","err","module","compilation","compiler","loaders","find","loader","includes","moduleTrace","formattedModuleTrace","lastInternalFileName","invalidImportMessage","message"],"mappings":"AACA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,mBAAkB;AACpE,SAASC,kBAAkB,QAAQ,uBAAsB;AAEzD,OAAO,SAASC,0BACdC,GAAU,EACVC,MAAW,EACXC,WAAgC,EAChCC,QAA0B;IAE1B,IAAI;QACF,IACE,CAACF,OAAOG,OAAO,CAACC,IAAI,CAAC,CAACC,SACpBA,OAAOA,MAAM,CAACC,QAAQ,CAAC,yCAEzB;YACA,OAAO;QACT;QAEA,MAAM,EAAEC,WAAW,EAAE,GAAGX,eAAeI,QAAQC,aAAaC;QAC5D,MAAM,EAAEM,oBAAoB,EAAEC,oBAAoB,EAAEC,oBAAoB,EAAE,GACxEf,kBAAkBO,UAAUK;QAE9B,OAAO,IAAIV,mBACTY,sBACAV,IAAIY,OAAO,GACTD,uBACA,6CACAF;IAEN,EAAE,OAAM;QACN,OAAO;IACT;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,91 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DevAppPageRouteMatcherProvider", {
enumerable: true,
get: function() {
return DevAppPageRouteMatcherProvider;
}
});
const _apppageroutematcher = require("../../route-matchers/app-page-route-matcher");
const _routekind = require("../../route-kind");
const _filecacheroutematcherprovider = require("./file-cache-route-matcher-provider");
const _app = require("../../normalizers/built/app");
const _normalizecatchallroutes = require("../../../build/normalize-catchall-routes");
const _apppaths = require("../../../shared/lib/router/utils/app-paths");
class DevAppPageRouteMatcherProvider extends _filecacheroutematcherprovider.FileCacheRouteMatcherProvider {
constructor(appDir, extensions, reader, isTurbopack){
super(appDir, reader);
this.normalizers = new _app.DevAppNormalizers(appDir, extensions, isTurbopack);
// Match any page file that ends with `/page.${extension}` or `/default.${extension}` under the app
// directory.
this.expression = new RegExp(`[/\\\\](page|default)\\.(?:${extensions.join('|')})$`);
this.isTurbopack = isTurbopack;
}
async transform(files) {
// Collect all the app paths for each page. This could include any parallel
// routes.
const cache = new Map();
const routeFilenames = new Array();
let appPaths = {};
for (const filename of files){
// If the file isn't a match for this matcher, then skip it.
if (!this.expression.test(filename)) continue;
let page = this.normalizers.page.normalize(filename);
// Validate that this is not an ignored page.
if (page.includes('/_')) continue;
// Turbopack uses the correct page name with the underscore normalized.
// TODO: Move implementation to packages/next/src/server/normalizers/built/app/app-page-normalizer.ts.
// The `includes('/_')` check above needs to be moved for that to work as otherwise `%5Fsegmentname`
// will result in `_segmentname` which hits that includes check and be skipped.
if (this.isTurbopack) {
page = page.replace(/%5F/g, '_');
}
// This is a valid file that we want to create a matcher for.
routeFilenames.push(filename);
const pathname = this.normalizers.pathname.normalize(filename);
const bundlePath = this.normalizers.bundlePath.normalize(filename);
// Save the normalization results.
cache.set(filename, {
page,
pathname,
bundlePath
});
if (pathname in appPaths) appPaths[pathname].push(page);
else appPaths[pathname] = [
page
];
}
(0, _normalizecatchallroutes.normalizeCatchAllRoutes)(appPaths);
// Make sure to sort parallel routes to make the result deterministic.
appPaths = Object.fromEntries(Object.entries(appPaths).map(([k, v])=>[
k,
v.sort(_apppaths.compareAppPaths)
]));
const matchers = [];
for (const filename of routeFilenames){
// Grab the cached values (and the appPaths).
const cached = cache.get(filename);
if (!cached) {
throw Object.defineProperty(new Error('Invariant: expected filename to exist in cache'), "__NEXT_ERROR_CODE", {
value: "E190",
enumerable: false,
configurable: true
});
}
const { pathname, page, bundlePath } = cached;
matchers.push(new _apppageroutematcher.AppPageRouteMatcher({
kind: _routekind.RouteKind.APP_PAGE,
pathname,
page,
bundlePath,
filename,
appPaths: appPaths[pathname]
}));
}
return matchers;
}
}
//# sourceMappingURL=dev-app-page-route-matcher-provider.js.map

View File

@@ -0,0 +1,89 @@
# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)
> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
Correctly stops looking after an `--` argument terminator.
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-has-flag?utm_source=npm-has-flag&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
---
## Install
```
$ npm install has-flag
```
## Usage
```js
// foo.js
const hasFlag = require('has-flag');
hasFlag('unicorn');
//=> true
hasFlag('--unicorn');
//=> true
hasFlag('f');
//=> true
hasFlag('-f');
//=> true
hasFlag('foo=bar');
//=> true
hasFlag('foo');
//=> false
hasFlag('rainbow');
//=> false
```
```
$ node foo.js -f --unicorn --foo=bar -- --rainbow
```
## API
### hasFlag(flag, [argv])
Returns a boolean for whether the flag exists.
#### flag
Type: `string`
CLI flag to look for. The `--` prefix is optional.
#### argv
Type: `string[]`<br>
Default: `process.argv`
CLI arguments.
## Security
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

View File

@@ -0,0 +1 @@
{"name":"glob-parent","version":"5.1.2","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1779140701037,"integrity":"sha512-Ca6s7X2ZfTI6fGB3faWEyIGYcJajB9jLXcw0mcKJ0htY9zs6HW2o8jDnuqZOv4yfJt5kw4rAh0tRhzlxKM6raQ==","mode":420,"size":753},"index.js":{"checkedAt":1779140701038,"integrity":"sha512-d7dN81urIl+AgVs+2rwo/aIBVYRzVrIutDMsHVgiDEojj7sprmx818+3e8IPt8QT8WZfiDHqPJvK0Yc/zsZ1LQ==","mode":420,"size":1120},"package.json":{"checkedAt":1779140701040,"integrity":"sha512-1clKscMLzwwOqg6cKj8agX7y5kyTU2w6v4vDWsQHz6sx9174OZCudhecNKUYrsSES3vaigPFd36vERycoWZjPQ==","mode":420,"size":1105},"CHANGELOG.md":{"checkedAt":1779140701042,"integrity":"sha512-dHv9RnK7Jt8LHdXB7DJnpHZdTYF8/CqeW6Q9n201h0zoVwQha4+b/1sKvlNNMjcSC3b3D/P7CQfqcgGoPrZKZg==","mode":420,"size":4510},"README.md":{"checkedAt":1779140701043,"integrity":"sha512-mj6hcRQBOumgjqcf8pAQpY3tuJKKiqPLOH3xMiRRzjRKuQ5zgmzUTV/KtbFs3+8EI9a1tasZTG/QbJPAVDWeyw==","mode":420,"size":4646}}}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/shared/lib/i18n/normalize-locale-path.ts"],"sourcesContent":["export interface PathLocale {\n detectedLocale?: string\n pathname: string\n}\n\n/**\n * A cache of lowercased locales for each list of locales. This is stored as a\n * WeakMap so if the locales are garbage collected, the cache entry will be\n * removed as well.\n */\nconst cache = new WeakMap<readonly string[], readonly string[]>()\n\n/**\n * For a pathname that may include a locale from a list of locales, it\n * removes the locale from the pathname returning it alongside with the\n * detected locale.\n *\n * @param pathname A pathname that may include a locale.\n * @param locales A list of locales.\n * @returns The detected locale and pathname without locale\n */\nexport function normalizeLocalePath(\n pathname: string,\n locales?: readonly string[]\n): PathLocale {\n // If locales is undefined, return the pathname as is.\n if (!locales) return { pathname }\n\n // Get the cached lowercased locales or create a new cache entry.\n let lowercasedLocales = cache.get(locales)\n if (!lowercasedLocales) {\n lowercasedLocales = locales.map((locale) => locale.toLowerCase())\n cache.set(locales, lowercasedLocales)\n }\n\n let detectedLocale: string | undefined\n\n // The first segment will be empty, because it has a leading `/`. If\n // there is no further segment, there is no locale (or it's the default).\n const segments = pathname.split('/', 2)\n\n // If there's no second segment (ie, the pathname is just `/`), there's no\n // locale.\n if (!segments[1]) return { pathname }\n\n // The second segment will contain the locale part if any.\n const segment = segments[1].toLowerCase()\n\n // See if the segment matches one of the locales. If it doesn't, there is\n // no locale (or it's the default).\n const index = lowercasedLocales.indexOf(segment)\n if (index < 0) return { pathname }\n\n // Return the case-sensitive locale.\n detectedLocale = locales[index]\n\n // Remove the `/${locale}` part of the pathname.\n pathname = pathname.slice(detectedLocale.length + 1) || '/'\n\n return { pathname, detectedLocale }\n}\n"],"names":["normalizeLocalePath","cache","WeakMap","pathname","locales","lowercasedLocales","get","map","locale","toLowerCase","set","detectedLocale","segments","split","segment","index","indexOf","slice","length"],"mappings":";;;;+BAqBgBA;;;eAAAA;;;AAhBhB;;;;CAIC,GACD,MAAMC,QAAQ,IAAIC;AAWX,SAASF,oBACdG,QAAgB,EAChBC,OAA2B;IAE3B,sDAAsD;IACtD,IAAI,CAACA,SAAS,OAAO;QAAED;IAAS;IAEhC,iEAAiE;IACjE,IAAIE,oBAAoBJ,MAAMK,GAAG,CAACF;IAClC,IAAI,CAACC,mBAAmB;QACtBA,oBAAoBD,QAAQG,GAAG,CAAC,CAACC,SAAWA,OAAOC,WAAW;QAC9DR,MAAMS,GAAG,CAACN,SAASC;IACrB;IAEA,IAAIM;IAEJ,oEAAoE;IACpE,yEAAyE;IACzE,MAAMC,WAAWT,SAASU,KAAK,CAAC,KAAK;IAErC,0EAA0E;IAC1E,UAAU;IACV,IAAI,CAACD,QAAQ,CAAC,EAAE,EAAE,OAAO;QAAET;IAAS;IAEpC,0DAA0D;IAC1D,MAAMW,UAAUF,QAAQ,CAAC,EAAE,CAACH,WAAW;IAEvC,yEAAyE;IACzE,mCAAmC;IACnC,MAAMM,QAAQV,kBAAkBW,OAAO,CAACF;IACxC,IAAIC,QAAQ,GAAG,OAAO;QAAEZ;IAAS;IAEjC,oCAAoC;IACpCQ,iBAAiBP,OAAO,CAACW,MAAM;IAE/B,gDAAgD;IAChDZ,WAAWA,SAASc,KAAK,CAACN,eAAeO,MAAM,GAAG,MAAM;IAExD,OAAO;QAAEf;QAAUQ;IAAe;AACpC","ignoreList":[0]}

View File

@@ -0,0 +1,289 @@
/**
* @since 2.0.0
*/
import * as Cause from "./Cause.js";
import * as Deferred from "./Deferred.js";
import * as Effect from "./Effect.js";
import * as Exit from "./Exit.js";
import * as Fiber from "./Fiber.js";
import * as FiberId from "./FiberId.js";
import { constFalse, constVoid, dual } from "./Function.js";
import * as HashSet from "./HashSet.js";
import * as Inspectable from "./Inspectable.js";
import * as Iterable from "./Iterable.js";
import { pipeArguments } from "./Pipeable.js";
import * as Predicate from "./Predicate.js";
import * as Runtime from "./Runtime.js";
/**
* @since 2.0.0
* @categories type ids
*/
export const TypeId = /*#__PURE__*/Symbol.for("effect/FiberSet");
/**
* @since 2.0.0
* @categories refinements
*/
export const isFiberSet = u => Predicate.hasProperty(u, TypeId);
const Proto = {
[TypeId]: TypeId,
[Symbol.iterator]() {
if (this.state._tag === "Closed") {
return Iterable.empty();
}
return this.state.backing[Symbol.iterator]();
},
toString() {
return Inspectable.format(this.toJSON());
},
toJSON() {
return {
_id: "FiberMap",
state: this.state
};
},
[Inspectable.NodeInspectSymbol]() {
return this.toJSON();
},
pipe() {
return pipeArguments(this, arguments);
}
};
const unsafeMake = (backing, deferred) => {
const self = Object.create(Proto);
self.state = {
_tag: "Open",
backing
};
self.deferred = deferred;
return self;
};
/**
* A FiberSet can be used to store a collection of fibers.
* When the associated Scope is closed, all fibers in the set will be interrupted.
*
* You can add fibers to the set using `FiberSet.add` or `FiberSet.run`, and the fibers will
* be automatically removed from the FiberSet when they complete.
*
* @example
* ```ts
* import { Effect, FiberSet } from "effect"
*
* Effect.gen(function*() {
* const set = yield* FiberSet.make()
*
* // run some effects and add the fibers to the set
* yield* FiberSet.run(set, Effect.never)
* yield* FiberSet.run(set, Effect.never)
*
* yield* Effect.sleep(1000)
* }).pipe(
* Effect.scoped // The fibers will be interrupted when the scope is closed
* )
* ```
*
* @since 2.0.0
* @categories constructors
*/
export const make = () => Effect.acquireRelease(Effect.map(Deferred.make(), deferred => unsafeMake(new Set(), deferred)), set => Effect.withFiberRuntime(parent => {
const state = set.state;
if (state._tag === "Closed") return Effect.void;
set.state = {
_tag: "Closed"
};
const fibers = state.backing;
return Fiber.interruptAllAs(fibers, FiberId.combine(parent.id(), internalFiberId)).pipe(Effect.intoDeferred(set.deferred));
}));
/**
* Create an Effect run function that is backed by a FiberSet.
*
* @since 2.0.0
* @categories constructors
*/
export const makeRuntime = () => Effect.flatMap(make(), self => runtime(self)());
/**
* Create an Effect run function that is backed by a FiberSet.
*
* @since 3.13.0
* @categories constructors
*/
export const makeRuntimePromise = () => Effect.flatMap(make(), self => runtimePromise(self)());
const internalFiberIdId = -1;
const internalFiberId = /*#__PURE__*/FiberId.make(internalFiberIdId, 0);
const isInternalInterruption = /*#__PURE__*/Cause.reduceWithContext(undefined, {
emptyCase: constFalse,
failCase: constFalse,
dieCase: constFalse,
interruptCase: (_, fiberId) => HashSet.has(FiberId.ids(fiberId), internalFiberIdId),
sequentialCase: (_, left, right) => left || right,
parallelCase: (_, left, right) => left || right
});
/**
* Add a fiber to the FiberSet. When the fiber completes, it will be removed.
*
* @since 2.0.0
* @categories combinators
*/
export const unsafeAdd = /*#__PURE__*/dual(args => isFiberSet(args[0]), (self, fiber, options) => {
if (self.state._tag === "Closed") {
fiber.unsafeInterruptAsFork(FiberId.combine(options?.interruptAs ?? FiberId.none, internalFiberId));
return;
} else if (self.state.backing.has(fiber)) {
return;
}
self.state.backing.add(fiber);
fiber.addObserver(exit => {
if (self.state._tag === "Closed") {
return;
}
self.state.backing.delete(fiber);
if (Exit.isFailure(exit) && (options?.propagateInterruption === true ? !isInternalInterruption(exit.cause) : !Cause.isInterruptedOnly(exit.cause))) {
Deferred.unsafeDone(self.deferred, exit);
}
});
});
/**
* Add a fiber to the FiberSet. When the fiber completes, it will be removed.
*
* @since 2.0.0
* @categories combinators
*/
export const add = /*#__PURE__*/dual(args => isFiberSet(args[0]), (self, fiber, options) => Effect.fiberIdWith(fiberId => Effect.sync(() => unsafeAdd(self, fiber, {
...options,
interruptAs: fiberId
}))));
/**
* @since 2.0.0
* @categories combinators
*/
export const clear = self => Effect.withFiberRuntime(clearFiber => {
if (self.state._tag === "Closed") {
return Effect.void;
}
return Effect.forEach(self.state.backing, fiber =>
// will be removed by the observer
Fiber.interruptAs(fiber, FiberId.combine(clearFiber.id(), internalFiberId)));
});
const constInterruptedFiber = /*#__PURE__*/function () {
let fiber = undefined;
return () => {
if (fiber === undefined) {
fiber = Effect.runFork(Effect.interrupt);
}
return fiber;
};
}();
/**
* Fork an Effect and add the forked fiber to the FiberSet.
* When the fiber completes, it will be removed from the FiberSet.
*
* @since 2.0.0
* @categories combinators
*/
export const run = function () {
const self = arguments[0];
if (!Effect.isEffect(arguments[1])) {
const options = arguments[1];
return effect => runImpl(self, effect, options);
}
return runImpl(self, arguments[1], arguments[2]);
};
const runImpl = (self, effect, options) => Effect.fiberIdWith(fiberId => {
if (self.state._tag === "Closed") {
return Effect.sync(constInterruptedFiber);
}
return Effect.tap(Effect.forkDaemon(effect), fiber => unsafeAdd(self, fiber, {
...options,
interruptAs: fiberId
}));
});
/**
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberSet.
*
* @example
* ```ts
* import { Context, Effect, FiberSet } from "effect"
*
* interface Users {
* readonly _: unique symbol
* }
* const Users = Context.GenericTag<Users, {
* getAll: Effect.Effect<Array<unknown>>
* }>("Users")
*
* Effect.gen(function*() {
* const set = yield* FiberSet.make()
* const run = yield* FiberSet.runtime(set)<Users>()
*
* // run some effects and add the fibers to the set
* run(Effect.andThen(Users, _ => _.getAll))
* }).pipe(
* Effect.scoped // The fibers will be interrupted when the scope is closed
* )
* ```
*
* @since 2.0.0
* @categories combinators
*/
export const runtime = self => () => Effect.map(Effect.runtime(), runtime => {
const runFork = Runtime.runFork(runtime);
return (effect, options) => {
if (self.state._tag === "Closed") {
return constInterruptedFiber();
}
const fiber = runFork(effect, options);
unsafeAdd(self, fiber);
return fiber;
};
});
/**
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberSet.
*
* The returned run function will return Promise's.
*
* @since 3.13.0
* @categories combinators
*/
export const runtimePromise = self => () => Effect.map(runtime(self)(), runFork => (effect, options) => new Promise((resolve, reject) => runFork(effect, options).addObserver(exit => {
if (Exit.isSuccess(exit)) {
resolve(exit.value);
} else {
reject(Cause.squash(exit.cause));
}
})));
/**
* @since 2.0.0
* @categories combinators
*/
export const size = self => Effect.sync(() => self.state._tag === "Closed" ? 0 : self.state.backing.size);
/**
* Join all fibers in the FiberSet. If any of the Fiber's in the set terminate with a failure,
* the returned Effect will terminate with the first failure that occurred.
*
* @since 2.0.0
* @categories combinators
* @example
* ```ts
* import { Effect, FiberSet } from "effect";
*
* Effect.gen(function* (_) {
* const set = yield* _(FiberSet.make());
* yield* _(FiberSet.add(set, Effect.runFork(Effect.fail("error"))));
*
* // parent fiber will fail with "error"
* yield* _(FiberSet.join(set));
* });
* ```
*/
export const join = self => Deferred.await(self.deferred);
/**
* Wait until the fiber set is empty.
*
* @since 3.13.0
* @categories combinators
*/
export const awaitEmpty = self => Effect.whileLoop({
while: () => self.state._tag === "Open" && self.state.backing.size > 0,
body: () => Fiber.await(Iterable.unsafeHead(self)),
step: constVoid
});
//# sourceMappingURL=FiberSet.js.map

View File

@@ -0,0 +1,26 @@
/**
* @license lucide-react v0.501.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const __iconNode = [
["path", { d: "M21 14h-1.343", key: "1jdnxi" }],
["path", { d: "M9.128 3.47A9 9 0 0 1 21 12v3.343", key: "6kipu2" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "M20.414 20.414A2 2 0 0 1 19 21h-1a2 2 0 0 1-2-2v-3", key: "9x50f4" }],
[
"path",
{
d: "M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 2.636-6.364",
key: "1bkxnm"
}
]
];
const HeadphoneOff = createLucideIcon("headphone-off", __iconNode);
export { __iconNode, HeadphoneOff as default };
//# sourceMappingURL=headphone-off.js.map

View File

@@ -0,0 +1,29 @@
/**
* @license lucide-react v0.501.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const __iconNode = [
["path", { d: "M10 11h.01", key: "d2at3l" }],
["path", { d: "M14 6h.01", key: "k028ub" }],
["path", { d: "M18 6h.01", key: "1v4wsw" }],
["path", { d: "M6.5 13.1h.01", key: "1748ia" }],
["path", { d: "M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3", key: "172yzv" }],
["path", { d: "M17.4 9.9c-.8.8-2 .8-2.8 0", key: "1obv0w" }],
[
"path",
{
d: "M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7",
key: "rqjl8i"
}
],
["path", { d: "M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4", key: "1mr6wy" }]
];
const Drama = createLucideIcon("drama", __iconNode);
export { __iconNode, Drama as default };
//# sourceMappingURL=drama.js.map

View File

@@ -0,0 +1,773 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
ADDED: null,
BUILDING: null,
BUILT: null,
EntryTypes: null,
findPagePathData: null,
getEntries: null,
getEntryKey: null,
getInvalidator: null,
onDemandEntryHandler: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ADDED: function() {
return ADDED;
},
BUILDING: function() {
return BUILDING;
},
BUILT: function() {
return BUILT;
},
EntryTypes: function() {
return EntryTypes;
},
findPagePathData: function() {
return findPagePathData;
},
getEntries: function() {
return getEntries;
},
getEntryKey: function() {
return getEntryKey;
},
getInvalidator: function() {
return getInvalidator;
},
onDemandEntryHandler: function() {
return onDemandEntryHandler;
}
});
const _debug = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/debug"));
const _events = require("events");
const _findpagefile = require("../lib/find-page-file");
const _entries = require("../../build/entries");
const _getstaticinfoincludinglayouts = require("../../build/get-static-info-including-layouts");
const _path = require("path");
const _normalizepathsep = require("../../shared/lib/page-path/normalize-path-sep");
const _normalizepagepath = require("../../shared/lib/page-path/normalize-page-path");
const _ensureleadingslash = require("../../shared/lib/page-path/ensure-leading-slash");
const _removepagepathtail = require("../../shared/lib/page-path/remove-page-path-tail");
const _output = require("../../build/output");
const _getroutefromentrypoint = /*#__PURE__*/ _interop_require_default(require("../get-route-from-entrypoint"));
const _utils = require("../../build/utils");
const _utils1 = require("../../shared/lib/utils");
const _constants = require("../../shared/lib/constants");
const _segment = require("../../shared/lib/segment");
const _hotreloadertypes = require("./hot-reloader-types");
const _apppageroutedefinition = require("../route-definitions/app-page-route-definition");
const _scheduler = require("../../lib/scheduler");
const _batcher = require("../../lib/batcher");
const _apppaths = require("../../shared/lib/router/utils/app-paths");
const _pagetypes = require("../../lib/page-types");
const _flightdatahelpers = require("../../client/flight-data-helpers");
const _geterrors = require("../mcp/tools/get-errors");
const _getpagemetadata = require("../mcp/tools/get-page-metadata");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const debug = (0, _debug.default)('next:on-demand-entry-handler');
/**
* Returns object keys with type inferred from the object key
*/ const keys = Object.keys;
const COMPILER_KEYS = keys(_constants.COMPILER_INDEXES);
function treePathToEntrypoint(segmentPath, parentPath) {
const [parallelRouteKey, segment] = segmentPath;
// TODO-APP: modify this path to cover parallelRouteKey convention
const path = (parentPath ? parentPath + '/' : '') + (parallelRouteKey !== 'children' && !segment.startsWith('@') ? `@${parallelRouteKey}/` : '') + (segment === '' ? 'page' : segment);
// Last segment
if (segmentPath.length === 2) {
return path;
}
const childSegmentPath = (0, _flightdatahelpers.getNextFlightSegmentPath)(segmentPath);
return treePathToEntrypoint(childSegmentPath, path);
}
function convertDynamicParamTypeToSyntax(dynamicParamTypeShort, param) {
switch(dynamicParamTypeShort){
case 'c':
case 'ci(..)(..)':
case 'ci(.)':
case 'ci(..)':
case 'ci(...)':
return `[...${param}]`;
case 'oc':
return `[[...${param}]]`;
case 'd':
case 'di(..)(..)':
case 'di(.)':
case 'di(..)':
case 'di(...)':
return `[${param}]`;
default:
throw Object.defineProperty(new Error('Unknown dynamic param type'), "__NEXT_ERROR_CODE", {
value: "E378",
enumerable: false,
configurable: true
});
}
}
function getEntryKey(compilerType, pageBundleType, page) {
// TODO: handle the /children slot better
// this is a quick hack to handle when children is provided as children/page instead of /page
const pageKey = page.replace(/(@[^/]+)\/children/g, '$1');
return `${compilerType}@${pageBundleType}@${pageKey}`;
}
function getPageBundleType(pageBundlePath) {
// Handle special case for /_error
if (pageBundlePath === '/_error') return _pagetypes.PAGE_TYPES.PAGES;
if ((0, _utils.isMiddlewareFilename)(pageBundlePath)) return _pagetypes.PAGE_TYPES.ROOT;
return pageBundlePath.startsWith('pages/') ? _pagetypes.PAGE_TYPES.PAGES : pageBundlePath.startsWith('app/') ? _pagetypes.PAGE_TYPES.APP : _pagetypes.PAGE_TYPES.ROOT;
}
function getEntrypointsFromTree(tree, isFirst, parentPath = []) {
const [segment, parallelRoutes] = tree;
const currentSegment = Array.isArray(segment) ? convertDynamicParamTypeToSyntax(segment[2], segment[0]) : segment;
const isPageSegment = currentSegment.startsWith(_segment.PAGE_SEGMENT_KEY);
const currentPath = [
...parentPath,
isPageSegment ? '' : currentSegment
];
if (!isFirst && isPageSegment) {
// TODO get rid of '' at the start of tree
return [
treePathToEntrypoint(currentPath.slice(1))
];
}
return Object.keys(parallelRoutes).reduce((paths, key)=>{
const childTree = parallelRoutes[key];
const childPages = getEntrypointsFromTree(childTree, false, [
...currentPath,
key
]);
return [
...paths,
...childPages
];
}, []);
}
const ADDED = Symbol('added');
const BUILDING = Symbol('building');
const BUILT = Symbol('built');
var EntryTypes = /*#__PURE__*/ function(EntryTypes) {
EntryTypes[EntryTypes["ENTRY"] = 0] = "ENTRY";
EntryTypes[EntryTypes["CHILD_ENTRY"] = 1] = "CHILD_ENTRY";
return EntryTypes;
}({});
const entriesMap = new Map();
// remove /server from end of output for server compiler
const normalizeOutputPath = (dir)=>dir.replace(/[/\\]server$/, '');
const getEntries = (dir)=>{
dir = normalizeOutputPath(dir);
const entries = entriesMap.get(dir) || {};
entriesMap.set(dir, entries);
return entries;
};
const invalidators = new Map();
const getInvalidator = (dir)=>{
dir = normalizeOutputPath(dir);
return invalidators.get(dir);
};
const doneCallbacks = new _events.EventEmitter();
const lastClientAccessPages = [
''
];
const lastServerAccessPagesForAppDir = [
''
];
// Make sure only one invalidation happens at a time
// Otherwise, webpack hash gets changed and it'll force the client to reload.
class Invalidator {
constructor(multiCompiler){
this.building = new Set();
this.rebuildAgain = new Set();
this.multiCompiler = multiCompiler;
}
shouldRebuildAll() {
return this.rebuildAgain.size > 0;
}
invalidate(compilerKeys = COMPILER_KEYS) {
for (const key of compilerKeys){
var _this_multiCompiler_compilers_COMPILER_INDEXES_key_watching;
// If there's a current build is processing, we won't abort it by invalidating.
// (If aborted, it'll cause a client side hard reload)
// But let it to invalidate just after the completion.
// So, it can re-build the queued pages at once.
if (this.building.has(key)) {
this.rebuildAgain.add(key);
continue;
}
this.building.add(key);
(_this_multiCompiler_compilers_COMPILER_INDEXES_key_watching = this.multiCompiler.compilers[_constants.COMPILER_INDEXES[key]].watching) == null ? void 0 : _this_multiCompiler_compilers_COMPILER_INDEXES_key_watching.invalidate();
}
}
startBuilding(compilerKey) {
this.building.add(compilerKey);
}
doneBuilding(compilerKeys = []) {
const rebuild = [];
for (const key of compilerKeys){
this.building.delete(key);
if (this.rebuildAgain.has(key)) {
rebuild.push(key);
this.rebuildAgain.delete(key);
}
}
if (rebuild.length > 0) {
this.invalidate(rebuild);
}
}
willRebuild(compilerKey) {
return this.rebuildAgain.has(compilerKey);
}
}
function disposeInactiveEntries(entries, maxInactiveAge) {
Object.keys(entries).forEach((entryKey)=>{
const entryData = entries[entryKey];
const { lastActiveTime, status, dispose, bundlePath } = entryData;
// TODO-APP: implement disposing of CHILD_ENTRY
if (entryData.type === 1) {
return;
}
// For the root middleware and the instrumentation hook files,
// we don't dispose them periodically as it's needed for every request.
if ((0, _utils.isMiddlewareFilename)(bundlePath) || (0, _utils.isInstrumentationHookFilename)(bundlePath)) {
return;
}
if (dispose) // Skip pages already scheduled for disposing
return;
// This means this entry is currently building or just added
// We don't need to dispose those entries.
if (status !== BUILT) return;
// We should not build the last accessed page even we didn't get any pings
// Sometimes, it's possible our XHR ping to wait before completing other requests.
// In that case, we should not dispose the current viewing page
if (lastClientAccessPages.includes(entryKey) || lastServerAccessPagesForAppDir.includes(entryKey)) return;
if (lastActiveTime && Date.now() - lastActiveTime > maxInactiveAge) {
entries[entryKey].dispose = true;
}
});
}
// Normalize both app paths and page paths
function tryToNormalizePagePath(page) {
try {
return (0, _normalizepagepath.normalizePagePath)(page);
} catch (err) {
console.error(err);
throw new _utils1.PageNotFoundError(page);
}
}
async function findPagePathData(rootDir, page, extensions, pagesDir, appDir, isGlobalNotFoundEnabled) {
const normalizedPagePath = tryToNormalizePagePath(page);
let pagePath = null;
const isInstrumentation = (0, _utils.isInstrumentationHookFile)(normalizedPagePath);
if ((0, _utils.isMiddlewareFile)(normalizedPagePath) || isInstrumentation) {
pagePath = await (0, _findpagefile.findPageFile)(rootDir, normalizedPagePath, extensions, false);
if (!pagePath) {
throw new _utils1.PageNotFoundError(normalizedPagePath);
}
const pageUrl = (0, _ensureleadingslash.ensureLeadingSlash)((0, _removepagepathtail.removePagePathTail)((0, _normalizepathsep.normalizePathSep)(pagePath), {
extensions
}));
let bundlePath = normalizedPagePath;
let pageKey = _path.posix.normalize(pageUrl);
if (isInstrumentation || (0, _utils.isMiddlewareFile)(normalizedPagePath)) {
bundlePath = bundlePath.replace('/src', '');
pageKey = page.replace('/src', '');
}
return {
filename: (0, _path.join)(rootDir, pagePath),
bundlePath: bundlePath.slice(1),
page: pageKey
};
}
// Check appDir first falling back to pagesDir
if (appDir) {
if (page === _constants.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY) {
// Load `global-not-found` when global-not-found is enabled.
// Prefer to load it when both `global-not-found` and root `not-found` present.
if (isGlobalNotFoundEnabled) {
const globalNotFoundPath = await (0, _findpagefile.findPageFile)(appDir, 'global-not-found', extensions, true);
if (globalNotFoundPath) {
return {
filename: (0, _path.join)(appDir, globalNotFoundPath),
bundlePath: `app${_constants.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,
page: _constants.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY
};
}
} else {
// Then if global-not-found.js doesn't exist then load not-found.js
const notFoundPath = await (0, _findpagefile.findPageFile)(appDir, 'not-found', extensions, true);
if (notFoundPath) {
return {
filename: (0, _path.join)(appDir, notFoundPath),
bundlePath: `app${_constants.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,
page: _constants.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY
};
}
}
// If they're not presented, then fallback to global-not-found
return {
filename: require.resolve('next/dist/client/components/builtin/global-not-found'),
bundlePath: `app${_constants.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,
page: _constants.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY
};
}
pagePath = await (0, _findpagefile.findPageFile)(appDir, normalizedPagePath, extensions, true);
if (pagePath) {
const pageUrl = (0, _ensureleadingslash.ensureLeadingSlash)((0, _removepagepathtail.removePagePathTail)((0, _normalizepathsep.normalizePathSep)(pagePath), {
keepIndex: true,
extensions
}));
return {
filename: (0, _path.join)(appDir, pagePath),
bundlePath: _path.posix.join('app', pageUrl),
page: _path.posix.normalize(pageUrl)
};
}
}
if (!pagePath && pagesDir) {
pagePath = await (0, _findpagefile.findPageFile)(pagesDir, normalizedPagePath, extensions, false);
}
if (pagePath !== null && pagesDir) {
const pageUrl = (0, _ensureleadingslash.ensureLeadingSlash)((0, _removepagepathtail.removePagePathTail)((0, _normalizepathsep.normalizePathSep)(pagePath), {
extensions
}));
return {
filename: (0, _path.join)(pagesDir, pagePath),
bundlePath: _path.posix.join('pages', (0, _normalizepagepath.normalizePagePath)(pageUrl)),
page: _path.posix.normalize(pageUrl)
};
}
if (page === '/_error') {
return {
filename: require.resolve('next/dist/pages/_error'),
bundlePath: page,
page: (0, _normalizepathsep.normalizePathSep)(page)
};
} else {
throw new _utils1.PageNotFoundError(normalizedPagePath);
}
}
function onDemandEntryHandler({ hotReloader, maxInactiveAge, multiCompiler, nextConfig, pagesBufferLength, pagesDir, rootDir, appDir }) {
const hasAppDir = !!appDir;
let curInvalidator = getInvalidator(multiCompiler.outputPath);
const curEntries = getEntries(multiCompiler.outputPath);
if (!curInvalidator) {
curInvalidator = new Invalidator(multiCompiler);
invalidators.set(multiCompiler.outputPath, curInvalidator);
}
// Deferred entries state management
const deferredEntriesConfig = nextConfig.experimental.deferredEntries;
const hasDeferredEntriesConfig = deferredEntriesConfig && deferredEntriesConfig.length > 0;
let onBeforeDeferredEntriesCalled = false;
let onBeforeDeferredEntriesPromise = null;
// Function to wait for all non-deferred entries to be built
async function waitForNonDeferredEntries() {
return new Promise((resolve)=>{
const checkEntries = ()=>{
// Check if there are any non-deferred entries that are still building or added
const hasNonDeferredEntriesBuilding = Object.entries(curEntries).some(([, entry])=>{
const entryData = entry;
if (entryData.type !== 0) return false;
const isDeferred = (0, _entries.isDeferredEntry)(entryData.absolutePagePath.replace(appDir || '', '').replace(pagesDir || '', '').replace(rootDir, ''), deferredEntriesConfig);
return !isDeferred && (entryData.status === ADDED || entryData.status === BUILDING);
});
if (!hasNonDeferredEntriesBuilding) {
resolve();
} else {
// Check again after a short delay
setTimeout(checkEntries, 100);
}
};
checkEntries();
});
}
// Function to handle deferred entry processing
async function processDeferredEntry() {
if (!hasDeferredEntriesConfig) return;
// Wait for all non-deferred entries to be built
await waitForNonDeferredEntries();
// Call the onBeforeDeferredEntries callback once
if (!onBeforeDeferredEntriesCalled) {
onBeforeDeferredEntriesCalled = true;
if (nextConfig.experimental.onBeforeDeferredEntries) {
debug('calling onBeforeDeferredEntries callback');
if (!onBeforeDeferredEntriesPromise) {
onBeforeDeferredEntriesPromise = nextConfig.experimental.onBeforeDeferredEntries();
}
await onBeforeDeferredEntriesPromise;
debug('onBeforeDeferredEntries callback completed');
}
} else if (onBeforeDeferredEntriesPromise) {
// Wait for any in-progress callback
await onBeforeDeferredEntriesPromise;
}
}
const startBuilding = (compilation)=>{
const compilationName = compilation.name;
curInvalidator.startBuilding(compilationName);
// Reset deferred entries state for this compilation cycle
// This ensures onBeforeDeferredEntries will be called again during HMR
onBeforeDeferredEntriesCalled = false;
onBeforeDeferredEntriesPromise = null;
};
for (const compiler of multiCompiler.compilers){
compiler.hooks.make.tap('NextJsOnDemandEntries', startBuilding);
}
function getPagePathsFromEntrypoints(type, entrypoints) {
const pagePaths = [];
for (const entrypoint of entrypoints.values()){
const page = (0, _getroutefromentrypoint.default)(entrypoint.name, hasAppDir);
if (page) {
var _entrypoint_name;
const pageBundleType = ((_entrypoint_name = entrypoint.name) == null ? void 0 : _entrypoint_name.startsWith('app/')) ? _pagetypes.PAGE_TYPES.APP : _pagetypes.PAGE_TYPES.PAGES;
pagePaths.push(getEntryKey(type, pageBundleType, page));
} else if ((0, _utils.isMiddlewareFilename)(entrypoint.name) || (0, _utils.isInstrumentationHookFilename)(entrypoint.name)) {
pagePaths.push(getEntryKey(type, _pagetypes.PAGE_TYPES.ROOT, `/${entrypoint.name}`));
}
}
return pagePaths;
}
for (const compiler of multiCompiler.compilers){
compiler.hooks.done.tap('NextJsOnDemandEntries', ()=>{
var _getInvalidator;
return (_getInvalidator = getInvalidator(compiler.outputPath)) == null ? void 0 : _getInvalidator.doneBuilding([
compiler.name
]);
});
}
multiCompiler.hooks.done.tap('NextJsOnDemandEntries', (multiStats)=>{
var _getInvalidator;
const [clientStats, serverStats, edgeServerStats] = multiStats.stats;
const entryNames = [
...getPagePathsFromEntrypoints(_constants.COMPILER_NAMES.client, clientStats.compilation.entrypoints),
...getPagePathsFromEntrypoints(_constants.COMPILER_NAMES.server, serverStats.compilation.entrypoints),
...edgeServerStats ? getPagePathsFromEntrypoints(_constants.COMPILER_NAMES.edgeServer, edgeServerStats.compilation.entrypoints) : []
];
for (const name of entryNames){
const entry = curEntries[name];
if (!entry) {
continue;
}
if (entry.status !== BUILDING) {
continue;
}
entry.status = BUILT;
doneCallbacks.emit(name);
}
(_getInvalidator = getInvalidator(multiCompiler.outputPath)) == null ? void 0 : _getInvalidator.doneBuilding([
...COMPILER_KEYS
]);
// Call onBeforeDeferredEntries after compilation completes during HMR
// This ensures the callback is invoked even when non-deferred entries change
if (hasDeferredEntriesConfig && !onBeforeDeferredEntriesCalled) {
onBeforeDeferredEntriesCalled = true;
if (nextConfig.experimental.onBeforeDeferredEntries) {
debug('calling onBeforeDeferredEntries callback after HMR');
onBeforeDeferredEntriesPromise = nextConfig.experimental.onBeforeDeferredEntries();
}
}
});
const pingIntervalTime = Math.max(1000, Math.min(5000, maxInactiveAge));
setInterval(function() {
disposeInactiveEntries(curEntries, maxInactiveAge);
}, pingIntervalTime + 1000).unref();
function handleAppDirPing(tree) {
const pages = getEntrypointsFromTree(tree, true);
for (const page of pages){
for (const compilerType of [
_constants.COMPILER_NAMES.client,
_constants.COMPILER_NAMES.server,
_constants.COMPILER_NAMES.edgeServer
]){
const entryKey = getEntryKey(compilerType, _pagetypes.PAGE_TYPES.APP, `/${page}`);
const entryInfo = curEntries[entryKey];
// If there's no entry, it may have been invalidated and needs to be re-built.
if (!entryInfo) {
continue;
}
// We don't need to maintain active state of anything other than BUILT entries
if (entryInfo.status !== BUILT) continue;
// If there's an entryInfo
if (!lastServerAccessPagesForAppDir.includes(entryKey)) {
lastServerAccessPagesForAppDir.unshift(entryKey);
// Maintain the buffer max length
// TODO: verify that the current pageKey is not at the end of the array as multiple entrypoints can exist
if (lastServerAccessPagesForAppDir.length > pagesBufferLength) {
lastServerAccessPagesForAppDir.pop();
}
}
entryInfo.lastActiveTime = Date.now();
entryInfo.dispose = false;
}
}
}
function handlePing(pg) {
const page = (0, _normalizepathsep.normalizePathSep)(pg);
for (const compilerType of [
_constants.COMPILER_NAMES.client,
_constants.COMPILER_NAMES.server,
_constants.COMPILER_NAMES.edgeServer
]){
const entryKey = getEntryKey(compilerType, _pagetypes.PAGE_TYPES.PAGES, page);
const entryInfo = curEntries[entryKey];
// If there's no entry, it may have been invalidated and needs to be re-built.
if (!entryInfo) {
// if (page !== lastEntry) client pings, but there's no entry for page
if (compilerType === _constants.COMPILER_NAMES.client) {
return;
}
continue;
}
// We don't need to maintain active state of anything other than BUILT entries
if (entryInfo.status !== BUILT) continue;
// If there's an entryInfo
if (!lastClientAccessPages.includes(entryKey)) {
lastClientAccessPages.unshift(entryKey);
// Maintain the buffer max length
if (lastClientAccessPages.length > pagesBufferLength) {
lastClientAccessPages.pop();
}
}
entryInfo.lastActiveTime = Date.now();
entryInfo.dispose = false;
}
return;
}
async function ensurePageImpl({ page, appPaths, definition, isApp, url }) {
const stalledTime = 60;
const stalledEnsureTimeout = setTimeout(()=>{
debug(`Ensuring ${page} has taken longer than ${stalledTime}s, if this continues to stall this may be a bug`);
}, stalledTime * 1000);
try {
let route;
if (definition) {
route = definition;
} else {
route = await findPagePathData(rootDir, page, nextConfig.pageExtensions, pagesDir, appDir, !!nextConfig.experimental.globalNotFound);
}
const isInsideAppDir = !!appDir && route.filename.startsWith(appDir);
// Check if this is a deferred entry and wait for non-deferred entries first
if (hasDeferredEntriesConfig) {
const isDeferred = (0, _entries.isDeferredEntry)(route.page, deferredEntriesConfig);
if (isDeferred) {
debug(`Page ${page} is a deferred entry, waiting for other entries`);
await processDeferredEntry();
debug(`Deferred entry ${page} can now be processed`);
}
}
if (typeof isApp === 'boolean' && isApp !== isInsideAppDir) {
Error.stackTraceLimit = 15;
throw Object.defineProperty(new Error(`Ensure bailed, found path "${route.page}" does not match ensure type (${isApp ? 'app' : 'pages'})`), "__NEXT_ERROR_CODE", {
value: "E419",
enumerable: false,
configurable: true
});
}
const pageBundleType = getPageBundleType(route.bundlePath);
const addEntry = (compilerType)=>{
const entryKey = getEntryKey(compilerType, pageBundleType, route.page);
if (curEntries[entryKey] && // there can be an overlap in the entryKey for the instrumentation hook file and a page named the same
// this is a quick fix to support this scenario by overwriting the instrumentation hook entry, since we only use it one time
// any changes to the instrumentation hook file will require a restart of the dev server anyway
!(0, _utils.isInstrumentationHookFilename)(curEntries[entryKey].bundlePath)) {
curEntries[entryKey].dispose = false;
curEntries[entryKey].lastActiveTime = Date.now();
if (curEntries[entryKey].status === BUILT) {
return {
entryKey,
newEntry: false,
shouldInvalidate: false
};
}
return {
entryKey,
newEntry: false,
shouldInvalidate: true
};
}
curEntries[entryKey] = {
type: 0,
appPaths,
absolutePagePath: route.filename,
request: route.filename,
bundlePath: route.bundlePath,
dispose: false,
lastActiveTime: Date.now(),
status: ADDED
};
return {
entryKey: entryKey,
newEntry: true,
shouldInvalidate: true
};
};
const staticInfo = await (0, _getstaticinfoincludinglayouts.getStaticInfoIncludingLayouts)({
page,
pageFilePath: route.filename,
isInsideAppDir,
pageExtensions: nextConfig.pageExtensions,
isDev: true,
config: nextConfig,
appDir
});
const added = new Map();
const isServerComponent = isInsideAppDir && staticInfo.rsc !== _constants.RSC_MODULE_TYPES.client;
let pageRuntime = staticInfo.runtime;
(0, _entries.runDependingOnPageType)({
page: route.page,
pageRuntime,
pageType: pageBundleType,
onClient: ()=>{
// Skip adding the client entry for app / Server Components.
if (isServerComponent || isInsideAppDir) {
return;
}
added.set(_constants.COMPILER_NAMES.client, addEntry(_constants.COMPILER_NAMES.client));
},
onServer: ()=>{
added.set(_constants.COMPILER_NAMES.server, addEntry(_constants.COMPILER_NAMES.server));
const edgeServerEntry = getEntryKey(_constants.COMPILER_NAMES.edgeServer, pageBundleType, route.page);
if (curEntries[edgeServerEntry] && !(0, _utils.isInstrumentationHookFile)(route.page)) {
// Runtime switched from edge to server
delete curEntries[edgeServerEntry];
}
},
onEdgeServer: ()=>{
added.set(_constants.COMPILER_NAMES.edgeServer, addEntry(_constants.COMPILER_NAMES.edgeServer));
const serverEntry = getEntryKey(_constants.COMPILER_NAMES.server, pageBundleType, route.page);
if (curEntries[serverEntry] && !(0, _utils.isInstrumentationHookFile)(route.page)) {
// Runtime switched from server to edge
delete curEntries[serverEntry];
}
}
});
const addedValues = [
...added.values()
];
const entriesThatShouldBeInvalidated = [
...added.entries()
].filter(([, entry])=>entry.shouldInvalidate);
const hasNewEntry = addedValues.some((entry)=>entry.newEntry);
if (hasNewEntry) {
const routePage = isApp ? route.page : (0, _apppaths.normalizeAppPath)(route.page);
// If proxy file, remove the leading slash from "/proxy" to "proxy".
(0, _output.reportTrigger)((0, _utils.isMiddlewareFile)(routePage) ? routePage.slice(1) : routePage, url);
}
if (entriesThatShouldBeInvalidated.length > 0) {
const invalidatePromise = Promise.all(entriesThatShouldBeInvalidated.map(([compilerKey, { entryKey }])=>{
return new Promise((resolve, reject)=>{
doneCallbacks.once(entryKey, (err)=>{
if (err) {
return reject(err);
}
// If the invalidation also triggers a rebuild, we need to
// wait for that additional build to prevent race conditions.
const needsRebuild = curInvalidator.willRebuild(compilerKey);
if (needsRebuild) {
doneCallbacks.once(entryKey, (rebuildErr)=>{
if (rebuildErr) {
return reject(rebuildErr);
}
resolve();
});
} else {
resolve();
}
});
});
}));
curInvalidator.invalidate([
...added.keys()
]);
await invalidatePromise;
}
} finally{
clearTimeout(stalledEnsureTimeout);
}
}
// Make sure that we won't have multiple invalidations ongoing concurrently.
const batcher = _batcher.Batcher.create({
// The cache key here is composed of the elements that affect the
// compilation, namely, the page, whether it's client only, and whether
// it's an app page. This ensures that we don't have multiple compilations
// for the same page happening concurrently.
//
// We don't include the whole match because it contains match specific
// parameters (like route params) that would just bust this cache. Any
// details that would possibly bust the cache should be listed here.
cacheKeyFn: (options)=>JSON.stringify(options),
// Schedule the invocation of the ensurePageImpl function on the next tick.
schedulerFn: _scheduler.scheduleOnNextTick
});
return {
async ensurePage ({ page, appPaths = null, definition, isApp, url }) {
// If the route is actually an app page route, then we should have access
// to the app route definition, and therefore, the appPaths from it.
if (!appPaths && definition && (0, _apppageroutedefinition.isAppPageRouteDefinition)(definition)) {
appPaths = definition.appPaths;
}
// Wrap the invocation of the ensurePageImpl function in the pending
// wrapper, which will ensure that we don't have multiple compilations
// for the same page happening concurrently.
return batcher.batch({
page,
appPaths,
definition,
isApp
}, async ()=>{
await ensurePageImpl({
page,
appPaths,
definition,
isApp,
url
});
});
},
onHMR (client, getHmrServerError) {
let bufferedHmrServerError = null;
client.addEventListener('close', ()=>{
bufferedHmrServerError = null;
});
client.addEventListener('message', ({ data })=>{
try {
const error = getHmrServerError();
// New error occurred: buffered error is flushed and new error occurred
if (!bufferedHmrServerError && error) {
hotReloader.send({
type: _hotreloadertypes.HMR_MESSAGE_SENT_TO_BROWSER.SERVER_ERROR,
errorJSON: (0, _utils1.stringifyError)(error)
});
bufferedHmrServerError = null;
}
const parsedData = JSON.parse(typeof data !== 'string' ? data.toString() : data);
if (parsedData.event === _hotreloadertypes.HMR_MESSAGE_SENT_TO_SERVER.PING) {
if (parsedData.appDirRoute) {
handleAppDirPing(parsedData.tree);
} else {
handlePing(parsedData.page);
}
} else if (parsedData.event === _hotreloadertypes.HMR_MESSAGE_SENT_TO_SERVER.MCP_ERROR_STATE_RESPONSE) {
(0, _geterrors.handleErrorStateResponse)(parsedData.requestId, parsedData.errorState, parsedData.url);
} else if (parsedData.event === _hotreloadertypes.HMR_MESSAGE_SENT_TO_SERVER.MCP_PAGE_METADATA_RESPONSE) {
(0, _getpagemetadata.handlePageMetadataResponse)(parsedData.requestId, parsedData.segmentTrieData, parsedData.url);
}
} catch {}
});
}
};
}
//# sourceMappingURL=on-demand-entry-handler.js.map

View File

@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getPathMatch", {
enumerable: true,
get: function() {
return getPathMatch;
}
});
const _pathtoregexp = require("next/dist/compiled/path-to-regexp");
function getPathMatch(path, options) {
const keys = [];
const regexp = (0, _pathtoregexp.pathToRegexp)(path, keys, {
delimiter: '/',
sensitive: typeof options?.sensitive === 'boolean' ? options.sensitive : false,
strict: options?.strict
});
const matcher = (0, _pathtoregexp.regexpToFunction)(options?.regexModifier ? new RegExp(options.regexModifier(regexp.source), regexp.flags) : regexp, keys);
/**
* A matcher function that will check if a given pathname matches the path
* given in the builder function. When the path does not match it will return
* `false` but if it does it will return an object with the matched params
* merged with the params provided in the second argument.
*/ return (pathname, params)=>{
// If no pathname is provided it's not a match.
if (typeof pathname !== 'string') return false;
const match = matcher(pathname);
// If the path did not match `false` will be returned.
if (!match) return false;
/**
* If unnamed params are not allowed they must be removed from
* the matched parameters. path-to-regexp uses "string" for named and
* "number" for unnamed parameters.
*/ if (options?.removeUnnamedParams) {
for (const key of keys){
if (typeof key.name === 'number') {
delete match.params[key.name];
}
}
}
return {
...params,
...match.params
};
};
}
//# sourceMappingURL=path-match.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/mcp/mcp-telemetry-tracker.ts"],"sourcesContent":["/**\n * Telemetry tracker for MCP tool call usage.\n * Tracks invocation counts for each MCP tool to be reported via telemetry.\n */\n\nimport type { McpToolName } from '../../telemetry/events/build'\n\nexport interface McpToolUsage {\n featureName: McpToolName\n invocationCount: number\n}\n\nclass McpTelemetryTracker {\n private usageMap = new Map<McpToolName, number>()\n\n /**\n * Record a tool call invocation\n */\n recordToolCall(toolName: McpToolName): void {\n const current = this.usageMap.get(toolName) || 0\n this.usageMap.set(toolName, current + 1)\n }\n\n /**\n * Get all tool usages as an array\n */\n getUsages(): McpToolUsage[] {\n return Array.from(this.usageMap.entries()).map(([featureName, count]) => ({\n featureName,\n invocationCount: count,\n }))\n }\n\n /**\n * Reset all usage tracking\n */\n reset(): void {\n this.usageMap.clear()\n }\n\n /**\n * Check if any tools have been called\n */\n hasUsage(): boolean {\n return this.usageMap.size > 0\n }\n}\n\n// Singleton instance\nexport const mcpTelemetryTracker = new McpTelemetryTracker()\n\n/**\n * Get MCP tool usage telemetry\n */\nexport function getMcpTelemetryUsage(): McpToolUsage[] {\n return mcpTelemetryTracker.getUsages()\n}\n\n/**\n * Reset MCP telemetry tracker\n */\nexport function resetMcpTelemetry(): void {\n mcpTelemetryTracker.reset()\n}\n\n/**\n * Record MCP telemetry usage to the telemetry instance\n */\nexport function recordMcpTelemetry(telemetry: {\n record: (event: any) => void\n}): void {\n const mcpUsages = getMcpTelemetryUsage()\n if (mcpUsages.length === 0) {\n return\n }\n\n const { eventMcpToolUsage } =\n require('../../telemetry/events/build') as typeof import('../../telemetry/events/build')\n const events = eventMcpToolUsage(mcpUsages)\n for (const event of events) {\n telemetry.record(event)\n }\n}\n"],"names":["McpTelemetryTracker","recordToolCall","toolName","current","usageMap","get","set","getUsages","Array","from","entries","map","featureName","count","invocationCount","reset","clear","hasUsage","size","Map","mcpTelemetryTracker","getMcpTelemetryUsage","resetMcpTelemetry","recordMcpTelemetry","telemetry","mcpUsages","length","eventMcpToolUsage","require","events","event","record"],"mappings":"AAAA;;;CAGC,GASD,MAAMA;IAGJ;;GAEC,GACDC,eAAeC,QAAqB,EAAQ;QAC1C,MAAMC,UAAU,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACH,aAAa;QAC/C,IAAI,CAACE,QAAQ,CAACE,GAAG,CAACJ,UAAUC,UAAU;IACxC;IAEA;;GAEC,GACDI,YAA4B;QAC1B,OAAOC,MAAMC,IAAI,CAAC,IAAI,CAACL,QAAQ,CAACM,OAAO,IAAIC,GAAG,CAAC,CAAC,CAACC,aAAaC,MAAM,GAAM,CAAA;gBACxED;gBACAE,iBAAiBD;YACnB,CAAA;IACF;IAEA;;GAEC,GACDE,QAAc;QACZ,IAAI,CAACX,QAAQ,CAACY,KAAK;IACrB;IAEA;;GAEC,GACDC,WAAoB;QAClB,OAAO,IAAI,CAACb,QAAQ,CAACc,IAAI,GAAG;IAC9B;;aAhCQd,WAAW,IAAIe;;AAiCzB;AAEA,qBAAqB;AACrB,OAAO,MAAMC,sBAAsB,IAAIpB,sBAAqB;AAE5D;;CAEC,GACD,OAAO,SAASqB;IACd,OAAOD,oBAAoBb,SAAS;AACtC;AAEA;;CAEC,GACD,OAAO,SAASe;IACdF,oBAAoBL,KAAK;AAC3B;AAEA;;CAEC,GACD,OAAO,SAASQ,mBAAmBC,SAElC;IACC,MAAMC,YAAYJ;IAClB,IAAII,UAAUC,MAAM,KAAK,GAAG;QAC1B;IACF;IAEA,MAAM,EAAEC,iBAAiB,EAAE,GACzBC,QAAQ;IACV,MAAMC,SAASF,kBAAkBF;IACjC,KAAK,MAAMK,SAASD,OAAQ;QAC1BL,UAAUO,MAAM,CAACD;IACnB;AACF","ignoreList":[0]}

View File

@@ -0,0 +1,7 @@
import type { ModuleLoader } from './module-loader';
/**
* Loads a module using `await require(id)`.
*/
export declare class NodeModuleLoader implements ModuleLoader {
load<M>(id: string): Promise<M>;
}

View File

@@ -0,0 +1,4 @@
{
"main": "../../cjs/_create_super.cjs",
"module": "../../esm/_create_super.js"
}

View File

@@ -0,0 +1,114 @@
/**
* MCP tool for retrieving error state from Next.js dev server.
*
* This tool provides comprehensive error reporting including:
* - Next.js global errors (e.g., next.config validation errors)
* - Browser runtime errors with source-mapped stack traces
* - Build errors from webpack/turbopack compilation
*
* For browser errors, it leverages the HMR infrastructure for server-to-browser communication.
*
* Flow:
* MCP client → server generates request ID → HMR message to browser →
* browser queries error overlay state → HMR response back → server performs source mapping →
* combined with global errors → formatted output.
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
handleErrorStateResponse: null,
registerGetErrorsTool: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
handleErrorStateResponse: function() {
return handleErrorStateResponse;
},
registerGetErrorsTool: function() {
return registerGetErrorsTool;
}
});
const _hotreloadertypes = require("../../dev/hot-reloader-types");
const _formaterrors = require("./utils/format-errors");
const _browsercommunication = require("./utils/browser-communication");
const _nextinstanceerrorstate = require("./next-instance-error-state");
const _mcptelemetrytracker = require("../mcp-telemetry-tracker");
function registerGetErrorsTool(server, sendHmrMessage, getActiveConnectionCount) {
server.registerTool('get_errors', {
description: 'Get the current error state from the Next.js dev server, including Next.js global errors (e.g., next.config validation), browser runtime errors, and build errors with source-mapped stack traces',
inputSchema: {}
}, async (_request)=>{
// Track telemetry
_mcptelemetrytracker.mcpTelemetryTracker.recordToolCall('mcp/get_errors');
try {
const connectionCount = getActiveConnectionCount();
if (connectionCount === 0) {
return {
content: [
{
type: 'text',
text: JSON.stringify({
error: 'No browser sessions connected. Please open your application in a browser to retrieve error state.'
})
}
]
};
}
const responses = await (0, _browsercommunication.createBrowserRequest)(_hotreloadertypes.HMR_MESSAGE_SENT_TO_BROWSER.REQUEST_CURRENT_ERROR_STATE, sendHmrMessage, getActiveConnectionCount, _browsercommunication.DEFAULT_BROWSER_REQUEST_TIMEOUT_MS);
// The error state for each route
// key is the route path, value is the error state
const routesErrorState = new Map();
for (const response of responses){
if (response.data) {
routesErrorState.set(response.url, response.data);
}
}
const hasRouteErrors = Array.from(routesErrorState.values()).some((state)=>state.errors.length > 0 || !!state.buildError);
const hasInstanceErrors = _nextinstanceerrorstate.NextInstanceErrorState.nextConfig.length > 0;
if (!hasRouteErrors && !hasInstanceErrors) {
return {
content: [
{
type: 'text',
text: JSON.stringify({
configErrors: [],
sessionErrors: []
})
}
]
};
}
const output = await (0, _formaterrors.formatErrors)(routesErrorState, _nextinstanceerrorstate.NextInstanceErrorState);
return {
content: [
{
type: 'text',
text: JSON.stringify(output)
}
]
};
} catch (error) {
return {
content: [
{
type: 'text',
text: JSON.stringify({
error: error instanceof Error ? error.message : String(error)
})
}
]
};
}
});
}
function handleErrorStateResponse(requestId, errorState, url) {
(0, _browsercommunication.handleBrowserPageResponse)(requestId, errorState, url || '');
}
//# sourceMappingURL=get-errors.js.map

View File

@@ -0,0 +1,131 @@
import * as internal from "./internal/stm/tPubSub.js";
/**
* @since 2.0.0
* @category symbols
*/
export const TPubSubTypeId = internal.TPubSubTypeId;
/**
* Waits until the `TPubSub` is shutdown. The `STM` returned by this method will
* not resume until the queue has been shutdown. If the `TPubSub` is already
* shutdown, the `STM` will resume right away.
*
* @since 2.0.0
* @category mutations
*/
export const awaitShutdown = internal.awaitShutdown;
/**
* Creates a bounded `TPubSub` with the back pressure strategy. The `TPubSub` will retain
* messages until they have been taken by all subscribers, applying back
* pressure to publishers if the `TPubSub` is at capacity.
*
* @since 2.0.0
* @category constructors
*/
export const bounded = internal.bounded;
/**
* Returns the number of elements the `TPubSub` can hold.
*
* @since 2.0.0
* @category getters
*/
export const capacity = internal.capacity;
/**
* Creates a bounded `TPubSub` with the dropping strategy. The `TPubSub` will drop new
* messages if the `TPubSub` is at capacity.
*
* @since 2.0.0
* @category constructors
*/
export const dropping = internal.dropping;
/**
* Returns `true` if the `TPubSub` contains zero elements, `false` otherwise.
*
* @since 2.0.0
* @category getters
*/
export const isEmpty = internal.isEmpty;
/**
* Returns `true` if the `TPubSub` contains at least one element, `false`
* otherwise.
*
* @since 2.0.0
* @category getters
*/
export const isFull = internal.isFull;
/**
* Interrupts any fibers that are suspended on `offer` or `take`. Future calls
* to `offer*` and `take*` will be interrupted immediately.
*
* @since 2.0.0
* @category utils
*/
export const shutdown = internal.shutdown;
/**
* Returns `true` if `shutdown` has been called, otherwise returns `false`.
*
* @since 2.0.0
* @category getters
*/
export const isShutdown = internal.isShutdown;
/**
* Publishes a message to the `TPubSub`, returning whether the message was published
* to the `TPubSub`.
*
* @since 2.0.0
* @category mutations
*/
export const publish = internal.publish;
/**
* Publishes all of the specified messages to the `TPubSub`, returning whether they
* were published to the `TPubSub`.
*
* @since 2.0.0
* @category mutations
*/
export const publishAll = internal.publishAll;
/**
* Retrieves the size of the `TPubSub`, which is equal to the number of elements
* in the `TPubSub`. This may be negative if fibers are suspended waiting for
* elements to be added to the `TPubSub`.
*
* @since 2.0.0
* @category getters
*/
export const size = internal.size;
/**
* Creates a bounded `TPubSub` with the sliding strategy. The `TPubSub` will add new
* messages and drop old messages if the `TPubSub` is at capacity.
*
* For best performance use capacities that are powers of two.
*
* @since 2.0.0
* @category constructors
*/
export const sliding = internal.sliding;
/**
* Subscribes to receive messages from the `TPubSub`. The resulting subscription can
* be evaluated multiple times to take a message from the `TPubSub` each time. The
* caller is responsible for unsubscribing from the `TPubSub` by shutting down the
* queue.
*
* @since 2.0.0
* @category mutations
*/
export const subscribe = internal.subscribe;
/**
* Subscribes to receive messages from the `TPubSub`. The resulting subscription can
* be evaluated multiple times within the scope to take a message from the `TPubSub`
* each time.
*
* @since 2.0.0
* @category mutations
*/
export const subscribeScoped = internal.subscribeScoped;
/**
* Creates an unbounded `TPubSub`.
*
* @since 2.0.0
* @category constructors
*/
export const unbounded = internal.unbounded;
//# sourceMappingURL=TPubSub.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/set-attributes-from-props.ts"],"sourcesContent":["const DOMAttributeNames: Record<string, string> = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n noModule: 'noModule',\n}\n\nconst ignoreProps = [\n 'onLoad',\n 'onReady',\n 'dangerouslySetInnerHTML',\n 'children',\n 'onError',\n 'strategy',\n 'stylesheets',\n]\n\nfunction isBooleanScriptAttribute(\n attr: string\n): attr is 'async' | 'defer' | 'noModule' {\n return ['async', 'defer', 'noModule'].includes(attr)\n}\n\nexport function setAttributesFromProps(el: HTMLElement, props: object) {\n for (const [p, value] of Object.entries(props)) {\n if (!props.hasOwnProperty(p)) continue\n if (ignoreProps.includes(p)) continue\n\n // we don't render undefined props to the DOM\n if (value === undefined) {\n continue\n }\n\n const attr = DOMAttributeNames[p] || p.toLowerCase()\n\n if (el.tagName === 'SCRIPT' && isBooleanScriptAttribute(attr)) {\n // Correctly assign boolean script attributes\n // https://github.com/vercel/next.js/pull/20748\n ;(el as HTMLScriptElement)[attr] = !!value\n } else {\n el.setAttribute(attr, String(value))\n }\n\n // Remove falsy non-zero boolean attributes so they are correctly interpreted\n // (e.g. if we set them to false, this coerces to the string \"false\", which the browser interprets as true)\n if (\n value === false ||\n (el.tagName === 'SCRIPT' &&\n isBooleanScriptAttribute(attr) &&\n (!value || value === 'false'))\n ) {\n // Call setAttribute before, as we need to set and unset the attribute to override force async:\n // https://html.spec.whatwg.org/multipage/scripting.html#script-force-async\n el.setAttribute(attr, '')\n el.removeAttribute(attr)\n }\n }\n}\n"],"names":["setAttributesFromProps","DOMAttributeNames","acceptCharset","className","htmlFor","httpEquiv","noModule","ignoreProps","isBooleanScriptAttribute","attr","includes","el","props","p","value","Object","entries","hasOwnProperty","undefined","toLowerCase","tagName","setAttribute","String","removeAttribute"],"mappings":";;;;+BAwBgBA;;;eAAAA;;;AAxBhB,MAAMC,oBAA4C;IAChDC,eAAe;IACfC,WAAW;IACXC,SAAS;IACTC,WAAW;IACXC,UAAU;AACZ;AAEA,MAAMC,cAAc;IAClB;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,SAASC,yBACPC,IAAY;IAEZ,OAAO;QAAC;QAAS;QAAS;KAAW,CAACC,QAAQ,CAACD;AACjD;AAEO,SAAST,uBAAuBW,EAAe,EAAEC,KAAa;IACnE,KAAK,MAAM,CAACC,GAAGC,MAAM,IAAIC,OAAOC,OAAO,CAACJ,OAAQ;QAC9C,IAAI,CAACA,MAAMK,cAAc,CAACJ,IAAI;QAC9B,IAAIN,YAAYG,QAAQ,CAACG,IAAI;QAE7B,6CAA6C;QAC7C,IAAIC,UAAUI,WAAW;YACvB;QACF;QAEA,MAAMT,OAAOR,iBAAiB,CAACY,EAAE,IAAIA,EAAEM,WAAW;QAElD,IAAIR,GAAGS,OAAO,KAAK,YAAYZ,yBAAyBC,OAAO;YAC7D,6CAA6C;YAC7C,+CAA+C;;YAC7CE,EAAwB,CAACF,KAAK,GAAG,CAAC,CAACK;QACvC,OAAO;YACLH,GAAGU,YAAY,CAACZ,MAAMa,OAAOR;QAC/B;QAEA,6EAA6E;QAC7E,2GAA2G;QAC3G,IACEA,UAAU,SACTH,GAAGS,OAAO,KAAK,YACdZ,yBAAyBC,SACxB,CAAA,CAACK,SAASA,UAAU,OAAM,GAC7B;YACA,+FAA+F;YAC/F,2EAA2E;YAC3EH,GAAGU,YAAY,CAACZ,MAAM;YACtBE,GAAGY,eAAe,CAACd;QACrB;IACF;AACF","ignoreList":[0]}

Some files were not shown because too many files have changed in this diff Show More