immosquare-cleaner 0.1.65 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/immosquare-cleaner +4 -0
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/lib/immosquare-cleaner.rb +21 -20
- data/linters/eslint.config.mjs +14 -0
- data/linters/rubocop-3.3.6.yml +93 -0
- data/linters/rubocop-3.4.1.yml +0 -3
- data/node_modules/.bin/jscodeshift +1 -0
- data/node_modules/@babel/compat-data/data/plugins.json +7 -6
- data/node_modules/@babel/compat-data/package.json +2 -2
- data/node_modules/@babel/core/lib/config/files/configuration.js +0 -3
- data/node_modules/@babel/core/lib/config/files/configuration.js.map +1 -1
- data/node_modules/@babel/core/lib/config/files/module-types.js +63 -74
- data/node_modules/@babel/core/lib/config/files/module-types.js.map +1 -1
- data/node_modules/@babel/core/lib/config/files/plugins.js +0 -1
- data/node_modules/@babel/core/lib/config/files/plugins.js.map +1 -1
- data/node_modules/@babel/core/lib/config/partial.js +1 -1
- data/node_modules/@babel/core/lib/config/partial.js.map +1 -1
- data/node_modules/@babel/core/lib/index.js +2 -1
- data/node_modules/@babel/core/lib/index.js.map +1 -1
- data/node_modules/@babel/core/lib/parser/index.js.map +1 -1
- data/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs +1 -3
- data/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs.map +1 -1
- data/node_modules/@babel/core/lib/transformation/file/file.js +4 -2
- data/node_modules/@babel/core/lib/transformation/file/file.js.map +1 -1
- data/node_modules/@babel/core/lib/transformation/normalize-file.js.map +1 -1
- data/node_modules/@babel/core/lib/transformation/util/clone-deep.js +7 -27
- data/node_modules/@babel/core/lib/transformation/util/clone-deep.js.map +1 -1
- data/node_modules/@babel/core/package.json +14 -13
- data/node_modules/@babel/generator/lib/generators/classes.js +4 -7
- data/node_modules/@babel/generator/lib/generators/classes.js.map +1 -1
- data/node_modules/@babel/generator/lib/generators/expressions.js +3 -9
- data/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -1
- data/node_modules/@babel/generator/lib/generators/jsx.js +1 -6
- data/node_modules/@babel/generator/lib/generators/jsx.js.map +1 -1
- data/node_modules/@babel/generator/lib/generators/template-literals.js +11 -16
- data/node_modules/@babel/generator/lib/generators/template-literals.js.map +1 -1
- data/node_modules/@babel/generator/lib/generators/types.js +9 -0
- data/node_modules/@babel/generator/lib/generators/types.js.map +1 -1
- data/node_modules/@babel/generator/lib/generators/typescript.js +18 -36
- data/node_modules/@babel/generator/lib/generators/typescript.js.map +1 -1
- data/node_modules/@babel/generator/lib/node/parentheses.js +3 -40
- data/node_modules/@babel/generator/lib/node/parentheses.js.map +1 -1
- data/node_modules/@babel/generator/lib/printer.js +3 -4
- data/node_modules/@babel/generator/lib/printer.js.map +1 -1
- data/node_modules/@babel/generator/package.json +5 -5
- data/node_modules/@babel/helper-compilation-targets/lib/index.js +1 -1
- data/node_modules/@babel/helper-compilation-targets/lib/index.js.map +1 -1
- data/node_modules/@babel/helper-compilation-targets/package.json +2 -2
- data/node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js +9 -1
- data/node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js.map +1 -1
- data/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js +0 -9
- data/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js.map +1 -1
- data/node_modules/@babel/helper-create-class-features-plugin/lib/features.js +1 -1
- data/node_modules/@babel/helper-create-class-features-plugin/lib/features.js.map +1 -1
- data/node_modules/@babel/helper-create-class-features-plugin/lib/index.js +8 -8
- data/node_modules/@babel/helper-create-class-features-plugin/lib/index.js.map +1 -1
- data/node_modules/@babel/helper-create-class-features-plugin/package.json +5 -5
- data/node_modules/@babel/helper-plugin-utils/lib/index.js.map +1 -1
- data/node_modules/@babel/helper-plugin-utils/package.json +2 -2
- data/node_modules/@babel/helper-replace-supers/lib/index.js.map +1 -1
- data/node_modules/@babel/helper-replace-supers/package.json +3 -3
- data/node_modules/@babel/helpers/lib/helpers/asyncIterator.js.map +1 -1
- data/node_modules/@babel/helpers/lib/helpers/isNativeFunction.js.map +1 -1
- data/node_modules/@babel/helpers/lib/helpers/objectWithoutProperties.js +1 -1
- data/node_modules/@babel/helpers/lib/helpers/objectWithoutProperties.js.map +1 -1
- data/node_modules/@babel/helpers/lib/helpers/objectWithoutPropertiesLoose.js +1 -1
- data/node_modules/@babel/helpers/lib/helpers/objectWithoutPropertiesLoose.js.map +1 -1
- data/node_modules/@babel/helpers/lib/helpers/wrapRegExp.js +3 -7
- data/node_modules/@babel/helpers/lib/helpers/wrapRegExp.js.map +1 -1
- data/node_modules/@babel/helpers/lib/helpers-generated.js +3 -3
- data/node_modules/@babel/helpers/lib/helpers-generated.js.map +1 -1
- data/node_modules/@babel/helpers/package.json +5 -5
- data/node_modules/@babel/parser/lib/index.js +236 -426
- data/node_modules/@babel/parser/lib/index.js.map +1 -1
- data/node_modules/@babel/parser/package.json +2 -2
- data/node_modules/@babel/parser/typings/babel-parser.d.ts +164 -127
- data/node_modules/@babel/plugin-transform-flow-strip-types/lib/index.js +0 -6
- data/node_modules/@babel/plugin-transform-flow-strip-types/lib/index.js.map +1 -1
- data/node_modules/@babel/plugin-transform-flow-strip-types/package.json +4 -4
- data/node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js +2 -3
- data/node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js.map +1 -1
- data/node_modules/@babel/plugin-transform-nullish-coalescing-operator/package.json +3 -3
- data/node_modules/@babel/plugin-transform-typescript/lib/const-enum.js +1 -3
- data/node_modules/@babel/plugin-transform-typescript/lib/const-enum.js.map +1 -1
- data/node_modules/@babel/plugin-transform-typescript/lib/enum.js +11 -24
- data/node_modules/@babel/plugin-transform-typescript/lib/enum.js.map +1 -1
- data/node_modules/@babel/plugin-transform-typescript/lib/index.js +9 -38
- data/node_modules/@babel/plugin-transform-typescript/lib/index.js.map +1 -1
- data/node_modules/@babel/plugin-transform-typescript/lib/namespace.js +0 -2
- data/node_modules/@babel/plugin-transform-typescript/lib/namespace.js.map +1 -1
- data/node_modules/@babel/plugin-transform-typescript/package.json +5 -5
- data/node_modules/@babel/template/lib/options.js.map +1 -1
- data/node_modules/@babel/template/lib/parse.js.map +1 -1
- data/node_modules/@babel/template/package.json +4 -4
- data/node_modules/@babel/traverse/lib/cache.js +5 -4
- data/node_modules/@babel/traverse/lib/cache.js.map +1 -1
- data/node_modules/@babel/traverse/lib/path/conversion.js +2 -1
- data/node_modules/@babel/traverse/lib/path/conversion.js.map +1 -1
- data/node_modules/@babel/traverse/lib/path/evaluation.js +0 -17
- data/node_modules/@babel/traverse/lib/path/evaluation.js.map +1 -1
- data/node_modules/@babel/traverse/lib/path/lib/hoister.js.map +1 -1
- data/node_modules/@babel/traverse/lib/path/modification.js +1 -1
- data/node_modules/@babel/traverse/lib/path/modification.js.map +1 -1
- data/node_modules/@babel/traverse/lib/path/replacement.js.map +1 -1
- data/node_modules/@babel/traverse/lib/scope/index.js +2 -9
- data/node_modules/@babel/traverse/lib/scope/index.js.map +1 -1
- data/node_modules/@babel/traverse/lib/visitors.js +1 -1
- data/node_modules/@babel/traverse/lib/visitors.js.map +1 -1
- data/node_modules/@babel/traverse/package.json +6 -6
- data/node_modules/@babel/types/lib/asserts/generated/index.js +0 -8
- data/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -1
- data/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -1
- data/node_modules/@babel/types/lib/builders/generated/index.js +2858 -22
- data/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -1
- data/node_modules/@babel/types/lib/builders/generated/uppercase.js +255 -267
- data/node_modules/@babel/types/lib/builders/generated/uppercase.js.map +1 -1
- data/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -1
- data/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -1
- data/node_modules/@babel/types/lib/definitions/core.js +17 -26
- data/node_modules/@babel/types/lib/definitions/core.js.map +1 -1
- data/node_modules/@babel/types/lib/definitions/flow.js +3 -6
- data/node_modules/@babel/types/lib/definitions/flow.js.map +1 -1
- data/node_modules/@babel/types/lib/definitions/jsx.js +4 -9
- data/node_modules/@babel/types/lib/definitions/jsx.js.map +1 -1
- data/node_modules/@babel/types/lib/definitions/typescript.js +26 -51
- data/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -1
- data/node_modules/@babel/types/lib/definitions/utils.js +2 -2
- data/node_modules/@babel/types/lib/definitions/utils.js.map +1 -1
- data/node_modules/@babel/types/lib/index-legacy.d.ts +7 -27
- data/node_modules/@babel/types/lib/index.d.ts +1876 -1898
- data/node_modules/@babel/types/lib/index.js +21 -10
- data/node_modules/@babel/types/lib/index.js.flow +6 -26
- data/node_modules/@babel/types/lib/index.js.map +1 -1
- data/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +8 -9
- data/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -1
- data/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +0 -1
- data/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -1
- data/node_modules/@babel/types/lib/validators/generated/index.js +0 -17
- data/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -1
- data/node_modules/@babel/types/package.json +12 -12
- data/node_modules/@eslint-community/eslint-utils/index.js +1 -21
- data/node_modules/@eslint-community/eslint-utils/index.js.map +1 -1
- data/node_modules/@eslint-community/eslint-utils/index.mjs +1 -21
- data/node_modules/@eslint-community/eslint-utils/index.mjs.map +1 -1
- data/node_modules/@eslint-community/eslint-utils/package.json +1 -1
- data/node_modules/acorn/CHANGELOG.md +0 -12
- data/node_modules/acorn/dist/acorn.js +24 -33
- data/node_modules/acorn/dist/acorn.mjs +24 -33
- data/node_modules/acorn/package.json +1 -1
- data/node_modules/browserslist/index.js +4 -23
- data/node_modules/browserslist/node.js +60 -69
- data/node_modules/browserslist/package.json +1 -1
- data/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -7
- data/node_modules/call-bind-apply-helpers/index.d.ts +20 -38
- data/node_modules/call-bind-apply-helpers/index.js +1 -1
- data/node_modules/call-bind-apply-helpers/package.json +8 -8
- data/node_modules/call-bind-apply-helpers/test/index.js +4 -4
- data/node_modules/call-bound/CHANGELOG.md +0 -8
- data/node_modules/call-bound/index.d.ts +10 -91
- data/node_modules/call-bound/index.js +3 -4
- data/node_modules/call-bound/package.json +10 -10
- data/node_modules/call-bound/test/index.js +4 -11
- data/node_modules/call-bound/tsconfig.json +1 -2
- data/node_modules/caniuse-lite/data/agents.js +1 -1
- data/node_modules/caniuse-lite/data/browserVersions.js +1 -1
- data/node_modules/caniuse-lite/data/features/aac.js +1 -1
- data/node_modules/caniuse-lite/data/features/abortcontroller.js +1 -1
- data/node_modules/caniuse-lite/data/features/ac3-ec3.js +1 -1
- data/node_modules/caniuse-lite/data/features/accelerometer.js +1 -1
- data/node_modules/caniuse-lite/data/features/addeventlistener.js +1 -1
- data/node_modules/caniuse-lite/data/features/alternate-stylesheet.js +1 -1
- data/node_modules/caniuse-lite/data/features/ambient-light.js +1 -1
- data/node_modules/caniuse-lite/data/features/apng.js +1 -1
- data/node_modules/caniuse-lite/data/features/array-find-index.js +1 -1
- data/node_modules/caniuse-lite/data/features/array-find.js +1 -1
- data/node_modules/caniuse-lite/data/features/array-flat.js +1 -1
- data/node_modules/caniuse-lite/data/features/array-includes.js +1 -1
- data/node_modules/caniuse-lite/data/features/arrow-functions.js +1 -1
- data/node_modules/caniuse-lite/data/features/asmjs.js +1 -1
- data/node_modules/caniuse-lite/data/features/async-clipboard.js +1 -1
- data/node_modules/caniuse-lite/data/features/async-functions.js +1 -1
- data/node_modules/caniuse-lite/data/features/atob-btoa.js +1 -1
- data/node_modules/caniuse-lite/data/features/audio-api.js +1 -1
- data/node_modules/caniuse-lite/data/features/audio.js +1 -1
- data/node_modules/caniuse-lite/data/features/audiotracks.js +1 -1
- data/node_modules/caniuse-lite/data/features/autofocus.js +1 -1
- data/node_modules/caniuse-lite/data/features/auxclick.js +1 -1
- data/node_modules/caniuse-lite/data/features/av1.js +1 -1
- data/node_modules/caniuse-lite/data/features/avif.js +1 -1
- data/node_modules/caniuse-lite/data/features/background-attachment.js +1 -1
- data/node_modules/caniuse-lite/data/features/background-clip-text.js +1 -1
- data/node_modules/caniuse-lite/data/features/background-img-opts.js +1 -1
- data/node_modules/caniuse-lite/data/features/background-position-x-y.js +1 -1
- data/node_modules/caniuse-lite/data/features/background-repeat-round-space.js +1 -1
- data/node_modules/caniuse-lite/data/features/background-sync.js +1 -1
- data/node_modules/caniuse-lite/data/features/battery-status.js +1 -1
- data/node_modules/caniuse-lite/data/features/beacon.js +1 -1
- data/node_modules/caniuse-lite/data/features/beforeafterprint.js +1 -1
- data/node_modules/caniuse-lite/data/features/bigint.js +1 -1
- data/node_modules/caniuse-lite/data/features/blobbuilder.js +1 -1
- data/node_modules/caniuse-lite/data/features/bloburls.js +1 -1
- data/node_modules/caniuse-lite/data/features/border-image.js +1 -1
- data/node_modules/caniuse-lite/data/features/border-radius.js +1 -1
- data/node_modules/caniuse-lite/data/features/broadcastchannel.js +1 -1
- data/node_modules/caniuse-lite/data/features/brotli.js +1 -1
- data/node_modules/caniuse-lite/data/features/calc.js +1 -1
- data/node_modules/caniuse-lite/data/features/canvas-blending.js +1 -1
- data/node_modules/caniuse-lite/data/features/canvas-text.js +1 -1
- data/node_modules/caniuse-lite/data/features/canvas.js +1 -1
- data/node_modules/caniuse-lite/data/features/ch-unit.js +1 -1
- data/node_modules/caniuse-lite/data/features/chacha20-poly1305.js +1 -1
- data/node_modules/caniuse-lite/data/features/channel-messaging.js +1 -1
- data/node_modules/caniuse-lite/data/features/childnode-remove.js +1 -1
- data/node_modules/caniuse-lite/data/features/classlist.js +1 -1
- data/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js +1 -1
- data/node_modules/caniuse-lite/data/features/clipboard.js +1 -1
- data/node_modules/caniuse-lite/data/features/colr-v1.js +1 -1
- data/node_modules/caniuse-lite/data/features/colr.js +1 -1
- data/node_modules/caniuse-lite/data/features/comparedocumentposition.js +1 -1
- data/node_modules/caniuse-lite/data/features/console-basic.js +1 -1
- data/node_modules/caniuse-lite/data/features/console-time.js +1 -1
- data/node_modules/caniuse-lite/data/features/const.js +1 -1
- data/node_modules/caniuse-lite/data/features/constraint-validation.js +1 -1
- data/node_modules/caniuse-lite/data/features/contenteditable.js +1 -1
- data/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js +1 -1
- data/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js +1 -1
- data/node_modules/caniuse-lite/data/features/cookie-store-api.js +1 -1
- data/node_modules/caniuse-lite/data/features/cors.js +1 -1
- data/node_modules/caniuse-lite/data/features/createimagebitmap.js +1 -1
- data/node_modules/caniuse-lite/data/features/credential-management.js +1 -1
- data/node_modules/caniuse-lite/data/features/cryptography.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-all.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-anchor-positioning.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-animation.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-any-link.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-appearance.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-at-counter-style.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-autofill.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-backdrop-filter.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-background-offsets.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-boxshadow.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-canvas.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-caret-color.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-cascade-layers.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-cascade-scope.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-case-insensitive.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-clip-path.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-color-adjust.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-color-function.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-conic-gradients.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-container-queries-style.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-container-queries.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-container-query-units.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-containment.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-content-visibility.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-counters.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-crisp-edges.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-cross-fade.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-default-pseudo.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-deviceadaptation.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-dir-pseudo.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-display-contents.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-element-function.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-env-function.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-exclusions.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-featurequeries.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-file-selector-button.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-filter-function.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-filters.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-first-letter.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-first-line.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-fixed.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-focus-visible.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-focus-within.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-font-palette.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-font-stretch.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-gencontent.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-gradients.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-grid-animation.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-grid.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-has.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-hyphens.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-image-orientation.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-image-set.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-in-out-of-range.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-initial-letter.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-initial-value.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-lch-lab.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-letter-spacing.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-line-clamp.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-logical-props.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-marker-pseudo.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-masks.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-matches-pseudo.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-math-functions.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-media-interaction.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-media-range-syntax.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-media-resolution.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-media-scripting.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-mediaqueries.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-mixblendmode.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-module-scripts.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-motion-paths.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-namespaces.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-nesting.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-not-sel-list.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-nth-child-of.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-opacity.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-optional-pseudo.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-overflow-anchor.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-overflow-overlay.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-overflow.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-page-break.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-paged-media.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-paint-api.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-placeholder-shown.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-placeholder.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-print-color-adjust.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-read-only-write.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-rebeccapurple.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-reflections.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-regions.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-relative-colors.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-repeating-gradients.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-resize.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-revert-value.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-rrggbbaa.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-scroll-behavior.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-scrollbar.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-sel2.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-sel3.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-selection.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-shapes.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-snappoints.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-sticky.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-subgrid.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-supports-api.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-table.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-text-align-last.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-text-box-trim.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-text-indent.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-text-justify.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-text-orientation.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-text-spacing.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-text-wrap-balance.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-textshadow.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-touch-action.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-transitions.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-unicode-bidi.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-unset-value.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-variables.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-when-else.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-widows-orphans.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-width-stretch.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-writing-mode.js +1 -1
- data/node_modules/caniuse-lite/data/features/css-zoom.js +1 -1
- data/node_modules/caniuse-lite/data/features/css3-attr.js +1 -1
- data/node_modules/caniuse-lite/data/features/css3-boxsizing.js +1 -1
- data/node_modules/caniuse-lite/data/features/css3-colors.js +1 -1
- data/node_modules/caniuse-lite/data/features/css3-cursors-grab.js +1 -1
- data/node_modules/caniuse-lite/data/features/css3-cursors-newer.js +1 -1
- data/node_modules/caniuse-lite/data/features/css3-cursors.js +1 -1
- data/node_modules/caniuse-lite/data/features/css3-tabsize.js +1 -1
- data/node_modules/caniuse-lite/data/features/currentcolor.js +1 -1
- data/node_modules/caniuse-lite/data/features/custom-elements.js +1 -1
- data/node_modules/caniuse-lite/data/features/custom-elementsv1.js +1 -1
- data/node_modules/caniuse-lite/data/features/customevent.js +1 -1
- data/node_modules/caniuse-lite/data/features/datalist.js +1 -1
- data/node_modules/caniuse-lite/data/features/dataset.js +1 -1
- data/node_modules/caniuse-lite/data/features/datauri.js +1 -1
- data/node_modules/caniuse-lite/data/features/date-tolocaledatestring.js +1 -1
- data/node_modules/caniuse-lite/data/features/declarative-shadow-dom.js +1 -1
- data/node_modules/caniuse-lite/data/features/decorators.js +1 -1
- data/node_modules/caniuse-lite/data/features/details.js +1 -1
- data/node_modules/caniuse-lite/data/features/deviceorientation.js +1 -1
- data/node_modules/caniuse-lite/data/features/devicepixelratio.js +1 -1
- data/node_modules/caniuse-lite/data/features/dialog.js +1 -1
- data/node_modules/caniuse-lite/data/features/dispatchevent.js +1 -1
- data/node_modules/caniuse-lite/data/features/dnssec.js +1 -1
- data/node_modules/caniuse-lite/data/features/do-not-track.js +1 -1
- data/node_modules/caniuse-lite/data/features/document-currentscript.js +1 -1
- data/node_modules/caniuse-lite/data/features/document-evaluate-xpath.js +1 -1
- data/node_modules/caniuse-lite/data/features/document-execcommand.js +1 -1
- data/node_modules/caniuse-lite/data/features/document-policy.js +1 -1
- data/node_modules/caniuse-lite/data/features/document-scrollingelement.js +1 -1
- data/node_modules/caniuse-lite/data/features/documenthead.js +1 -1
- data/node_modules/caniuse-lite/data/features/dom-manip-convenience.js +1 -1
- data/node_modules/caniuse-lite/data/features/dom-range.js +1 -1
- data/node_modules/caniuse-lite/data/features/domcontentloaded.js +1 -1
- data/node_modules/caniuse-lite/data/features/dommatrix.js +1 -1
- data/node_modules/caniuse-lite/data/features/download.js +1 -1
- data/node_modules/caniuse-lite/data/features/dragndrop.js +1 -1
- data/node_modules/caniuse-lite/data/features/element-closest.js +1 -1
- data/node_modules/caniuse-lite/data/features/element-from-point.js +1 -1
- data/node_modules/caniuse-lite/data/features/element-scroll-methods.js +1 -1
- data/node_modules/caniuse-lite/data/features/eme.js +1 -1
- data/node_modules/caniuse-lite/data/features/eot.js +1 -1
- data/node_modules/caniuse-lite/data/features/es5.js +1 -1
- data/node_modules/caniuse-lite/data/features/es6-class.js +1 -1
- data/node_modules/caniuse-lite/data/features/es6-generators.js +1 -1
- data/node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js +1 -1
- data/node_modules/caniuse-lite/data/features/es6-module.js +1 -1
- data/node_modules/caniuse-lite/data/features/es6-number.js +1 -1
- data/node_modules/caniuse-lite/data/features/es6-string-includes.js +1 -1
- data/node_modules/caniuse-lite/data/features/es6.js +1 -1
- data/node_modules/caniuse-lite/data/features/eventsource.js +1 -1
- data/node_modules/caniuse-lite/data/features/extended-system-fonts.js +1 -1
- data/node_modules/caniuse-lite/data/features/feature-policy.js +1 -1
- data/node_modules/caniuse-lite/data/features/fetch.js +1 -1
- data/node_modules/caniuse-lite/data/features/fieldset-disabled.js +1 -1
- data/node_modules/caniuse-lite/data/features/fileapi.js +1 -1
- data/node_modules/caniuse-lite/data/features/filereader.js +1 -1
- data/node_modules/caniuse-lite/data/features/filereadersync.js +1 -1
- data/node_modules/caniuse-lite/data/features/filesystem.js +1 -1
- data/node_modules/caniuse-lite/data/features/flac.js +1 -1
- data/node_modules/caniuse-lite/data/features/flexbox-gap.js +1 -1
- data/node_modules/caniuse-lite/data/features/flexbox.js +1 -1
- data/node_modules/caniuse-lite/data/features/flow-root.js +1 -1
- data/node_modules/caniuse-lite/data/features/focusin-focusout-events.js +1 -1
- data/node_modules/caniuse-lite/data/features/font-family-system-ui.js +1 -1
- data/node_modules/caniuse-lite/data/features/font-feature.js +1 -1
- data/node_modules/caniuse-lite/data/features/font-kerning.js +1 -1
- data/node_modules/caniuse-lite/data/features/font-loading.js +1 -1
- data/node_modules/caniuse-lite/data/features/font-size-adjust.js +1 -1
- data/node_modules/caniuse-lite/data/features/font-smooth.js +1 -1
- data/node_modules/caniuse-lite/data/features/font-unicode-range.js +1 -1
- data/node_modules/caniuse-lite/data/features/font-variant-alternates.js +1 -1
- data/node_modules/caniuse-lite/data/features/font-variant-numeric.js +1 -1
- data/node_modules/caniuse-lite/data/features/fontface.js +1 -1
- data/node_modules/caniuse-lite/data/features/form-attribute.js +1 -1
- data/node_modules/caniuse-lite/data/features/form-submit-attributes.js +1 -1
- data/node_modules/caniuse-lite/data/features/form-validation.js +1 -1
- data/node_modules/caniuse-lite/data/features/forms.js +1 -1
- data/node_modules/caniuse-lite/data/features/fullscreen.js +1 -1
- data/node_modules/caniuse-lite/data/features/gamepad.js +1 -1
- data/node_modules/caniuse-lite/data/features/geolocation.js +1 -1
- data/node_modules/caniuse-lite/data/features/getboundingclientrect.js +1 -1
- data/node_modules/caniuse-lite/data/features/getcomputedstyle.js +1 -1
- data/node_modules/caniuse-lite/data/features/getelementsbyclassname.js +1 -1
- data/node_modules/caniuse-lite/data/features/getrandomvalues.js +1 -1
- data/node_modules/caniuse-lite/data/features/gyroscope.js +1 -1
- data/node_modules/caniuse-lite/data/features/hardwareconcurrency.js +1 -1
- data/node_modules/caniuse-lite/data/features/hashchange.js +1 -1
- data/node_modules/caniuse-lite/data/features/heif.js +1 -1
- data/node_modules/caniuse-lite/data/features/hevc.js +1 -1
- data/node_modules/caniuse-lite/data/features/hidden.js +1 -1
- data/node_modules/caniuse-lite/data/features/high-resolution-time.js +1 -1
- data/node_modules/caniuse-lite/data/features/history.js +1 -1
- data/node_modules/caniuse-lite/data/features/html-media-capture.js +1 -1
- data/node_modules/caniuse-lite/data/features/html5semantic.js +1 -1
- data/node_modules/caniuse-lite/data/features/http-live-streaming.js +1 -1
- data/node_modules/caniuse-lite/data/features/http2.js +1 -1
- data/node_modules/caniuse-lite/data/features/http3.js +1 -1
- data/node_modules/caniuse-lite/data/features/iframe-sandbox.js +1 -1
- data/node_modules/caniuse-lite/data/features/iframe-seamless.js +1 -1
- data/node_modules/caniuse-lite/data/features/iframe-srcdoc.js +1 -1
- data/node_modules/caniuse-lite/data/features/imagecapture.js +1 -1
- data/node_modules/caniuse-lite/data/features/ime.js +1 -1
- data/node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js +1 -1
- data/node_modules/caniuse-lite/data/features/import-maps.js +1 -1
- data/node_modules/caniuse-lite/data/features/imports.js +1 -1
- data/node_modules/caniuse-lite/data/features/indeterminate-checkbox.js +1 -1
- data/node_modules/caniuse-lite/data/features/indexeddb.js +1 -1
- data/node_modules/caniuse-lite/data/features/indexeddb2.js +1 -1
- data/node_modules/caniuse-lite/data/features/inline-block.js +1 -1
- data/node_modules/caniuse-lite/data/features/innertext.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-color.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-datetime.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-email-tel-url.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-event.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-file-accept.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-file-directory.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-file-multiple.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-inputmode.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-minlength.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-number.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-pattern.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-placeholder.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-range.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-search.js +1 -1
- data/node_modules/caniuse-lite/data/features/input-selection.js +1 -1
- data/node_modules/caniuse-lite/data/features/insert-adjacent.js +1 -1
- data/node_modules/caniuse-lite/data/features/insertadjacenthtml.js +1 -1
- data/node_modules/caniuse-lite/data/features/internationalization.js +1 -1
- data/node_modules/caniuse-lite/data/features/intersectionobserver-v2.js +1 -1
- data/node_modules/caniuse-lite/data/features/intersectionobserver.js +1 -1
- data/node_modules/caniuse-lite/data/features/intl-pluralrules.js +1 -1
- data/node_modules/caniuse-lite/data/features/intrinsic-width.js +1 -1
- data/node_modules/caniuse-lite/data/features/jpeg2000.js +1 -1
- data/node_modules/caniuse-lite/data/features/jpegxl.js +1 -1
- data/node_modules/caniuse-lite/data/features/jpegxr.js +1 -1
- data/node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js +1 -1
- data/node_modules/caniuse-lite/data/features/json.js +1 -1
- data/node_modules/caniuse-lite/data/features/justify-content-space-evenly.js +1 -1
- data/node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js +1 -1
- data/node_modules/caniuse-lite/data/features/keyboardevent-charcode.js +1 -1
- data/node_modules/caniuse-lite/data/features/keyboardevent-code.js +1 -1
- data/node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js +1 -1
- data/node_modules/caniuse-lite/data/features/keyboardevent-key.js +1 -1
- data/node_modules/caniuse-lite/data/features/keyboardevent-location.js +1 -1
- data/node_modules/caniuse-lite/data/features/keyboardevent-which.js +1 -1
- data/node_modules/caniuse-lite/data/features/lazyload.js +1 -1
- data/node_modules/caniuse-lite/data/features/let.js +1 -1
- data/node_modules/caniuse-lite/data/features/link-icon-png.js +1 -1
- data/node_modules/caniuse-lite/data/features/link-icon-svg.js +1 -1
- data/node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js +1 -1
- data/node_modules/caniuse-lite/data/features/link-rel-modulepreload.js +1 -1
- data/node_modules/caniuse-lite/data/features/link-rel-preconnect.js +1 -1
- data/node_modules/caniuse-lite/data/features/link-rel-prefetch.js +1 -1
- data/node_modules/caniuse-lite/data/features/link-rel-preload.js +1 -1
- data/node_modules/caniuse-lite/data/features/link-rel-prerender.js +1 -1
- data/node_modules/caniuse-lite/data/features/loading-lazy-attr.js +1 -1
- data/node_modules/caniuse-lite/data/features/localecompare.js +1 -1
- data/node_modules/caniuse-lite/data/features/magnetometer.js +1 -1
- data/node_modules/caniuse-lite/data/features/matchesselector.js +1 -1
- data/node_modules/caniuse-lite/data/features/matchmedia.js +1 -1
- data/node_modules/caniuse-lite/data/features/mathml.js +1 -1
- data/node_modules/caniuse-lite/data/features/maxlength.js +1 -1
- data/node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js +1 -1
- data/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js +1 -1
- data/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js +1 -1
- data/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js +1 -1
- data/node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js +1 -1
- data/node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js +1 -1
- data/node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js +1 -1
- data/node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js +1 -1
- data/node_modules/caniuse-lite/data/features/media-fragments.js +1 -1
- data/node_modules/caniuse-lite/data/features/mediacapture-fromelement.js +1 -1
- data/node_modules/caniuse-lite/data/features/mediarecorder.js +1 -1
- data/node_modules/caniuse-lite/data/features/mediasource.js +1 -1
- data/node_modules/caniuse-lite/data/features/menu.js +1 -1
- data/node_modules/caniuse-lite/data/features/meta-theme-color.js +1 -1
- data/node_modules/caniuse-lite/data/features/meter.js +1 -1
- data/node_modules/caniuse-lite/data/features/midi.js +1 -1
- data/node_modules/caniuse-lite/data/features/minmaxwh.js +1 -1
- data/node_modules/caniuse-lite/data/features/mp3.js +1 -1
- data/node_modules/caniuse-lite/data/features/mpeg-dash.js +1 -1
- data/node_modules/caniuse-lite/data/features/mpeg4.js +1 -1
- data/node_modules/caniuse-lite/data/features/multibackgrounds.js +1 -1
- data/node_modules/caniuse-lite/data/features/multicolumn.js +1 -1
- data/node_modules/caniuse-lite/data/features/mutation-events.js +1 -1
- data/node_modules/caniuse-lite/data/features/mutationobserver.js +1 -1
- data/node_modules/caniuse-lite/data/features/namevalue-storage.js +1 -1
- data/node_modules/caniuse-lite/data/features/native-filesystem-api.js +1 -1
- data/node_modules/caniuse-lite/data/features/nav-timing.js +1 -1
- data/node_modules/caniuse-lite/data/features/netinfo.js +1 -1
- data/node_modules/caniuse-lite/data/features/notifications.js +1 -1
- data/node_modules/caniuse-lite/data/features/object-entries.js +1 -1
- data/node_modules/caniuse-lite/data/features/object-fit.js +1 -1
- data/node_modules/caniuse-lite/data/features/object-observe.js +1 -1
- data/node_modules/caniuse-lite/data/features/object-values.js +1 -1
- data/node_modules/caniuse-lite/data/features/objectrtc.js +1 -1
- data/node_modules/caniuse-lite/data/features/offline-apps.js +1 -1
- data/node_modules/caniuse-lite/data/features/offscreencanvas.js +1 -1
- data/node_modules/caniuse-lite/data/features/ogg-vorbis.js +1 -1
- data/node_modules/caniuse-lite/data/features/ogv.js +1 -1
- data/node_modules/caniuse-lite/data/features/ol-reversed.js +1 -1
- data/node_modules/caniuse-lite/data/features/once-event-listener.js +1 -1
- data/node_modules/caniuse-lite/data/features/online-status.js +1 -1
- data/node_modules/caniuse-lite/data/features/opus.js +1 -1
- data/node_modules/caniuse-lite/data/features/orientation-sensor.js +1 -1
- data/node_modules/caniuse-lite/data/features/outline.js +1 -1
- data/node_modules/caniuse-lite/data/features/pad-start-end.js +1 -1
- data/node_modules/caniuse-lite/data/features/page-transition-events.js +1 -1
- data/node_modules/caniuse-lite/data/features/pagevisibility.js +1 -1
- data/node_modules/caniuse-lite/data/features/passive-event-listener.js +1 -1
- data/node_modules/caniuse-lite/data/features/passkeys.js +1 -1
- data/node_modules/caniuse-lite/data/features/passwordrules.js +1 -1
- data/node_modules/caniuse-lite/data/features/path2d.js +1 -1
- data/node_modules/caniuse-lite/data/features/payment-request.js +1 -1
- data/node_modules/caniuse-lite/data/features/pdf-viewer.js +1 -1
- data/node_modules/caniuse-lite/data/features/permissions-api.js +1 -1
- data/node_modules/caniuse-lite/data/features/permissions-policy.js +1 -1
- data/node_modules/caniuse-lite/data/features/picture-in-picture.js +1 -1
- data/node_modules/caniuse-lite/data/features/picture.js +1 -1
- data/node_modules/caniuse-lite/data/features/ping.js +1 -1
- data/node_modules/caniuse-lite/data/features/png-alpha.js +1 -1
- data/node_modules/caniuse-lite/data/features/pointer-events.js +1 -1
- data/node_modules/caniuse-lite/data/features/pointer.js +1 -1
- data/node_modules/caniuse-lite/data/features/pointerlock.js +1 -1
- data/node_modules/caniuse-lite/data/features/portals.js +1 -1
- data/node_modules/caniuse-lite/data/features/prefers-color-scheme.js +1 -1
- data/node_modules/caniuse-lite/data/features/prefers-reduced-motion.js +1 -1
- data/node_modules/caniuse-lite/data/features/progress.js +1 -1
- data/node_modules/caniuse-lite/data/features/promise-finally.js +1 -1
- data/node_modules/caniuse-lite/data/features/promises.js +1 -1
- data/node_modules/caniuse-lite/data/features/proximity.js +1 -1
- data/node_modules/caniuse-lite/data/features/proxy.js +1 -1
- data/node_modules/caniuse-lite/data/features/publickeypinning.js +1 -1
- data/node_modules/caniuse-lite/data/features/push-api.js +1 -1
- data/node_modules/caniuse-lite/data/features/queryselector.js +1 -1
- data/node_modules/caniuse-lite/data/features/readonly-attr.js +1 -1
- data/node_modules/caniuse-lite/data/features/referrer-policy.js +1 -1
- data/node_modules/caniuse-lite/data/features/registerprotocolhandler.js +1 -1
- data/node_modules/caniuse-lite/data/features/rel-noopener.js +1 -1
- data/node_modules/caniuse-lite/data/features/rel-noreferrer.js +1 -1
- data/node_modules/caniuse-lite/data/features/rellist.js +1 -1
- data/node_modules/caniuse-lite/data/features/rem.js +1 -1
- data/node_modules/caniuse-lite/data/features/requestanimationframe.js +1 -1
- data/node_modules/caniuse-lite/data/features/requestidlecallback.js +1 -1
- data/node_modules/caniuse-lite/data/features/resizeobserver.js +1 -1
- data/node_modules/caniuse-lite/data/features/resource-timing.js +1 -1
- data/node_modules/caniuse-lite/data/features/rest-parameters.js +1 -1
- data/node_modules/caniuse-lite/data/features/rtcpeerconnection.js +1 -1
- data/node_modules/caniuse-lite/data/features/ruby.js +1 -1
- data/node_modules/caniuse-lite/data/features/run-in.js +1 -1
- data/node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js +1 -1
- data/node_modules/caniuse-lite/data/features/screen-orientation.js +1 -1
- data/node_modules/caniuse-lite/data/features/script-async.js +1 -1
- data/node_modules/caniuse-lite/data/features/script-defer.js +1 -1
- data/node_modules/caniuse-lite/data/features/scrollintoview.js +1 -1
- data/node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js +1 -1
- data/node_modules/caniuse-lite/data/features/sdch.js +1 -1
- data/node_modules/caniuse-lite/data/features/selection-api.js +1 -1
- data/node_modules/caniuse-lite/data/features/selectlist.js +1 -1
- data/node_modules/caniuse-lite/data/features/server-timing.js +1 -1
- data/node_modules/caniuse-lite/data/features/serviceworkers.js +1 -1
- data/node_modules/caniuse-lite/data/features/setimmediate.js +1 -1
- data/node_modules/caniuse-lite/data/features/shadowdom.js +1 -1
- data/node_modules/caniuse-lite/data/features/shadowdomv1.js +1 -1
- data/node_modules/caniuse-lite/data/features/sharedarraybuffer.js +1 -1
- data/node_modules/caniuse-lite/data/features/sharedworkers.js +1 -1
- data/node_modules/caniuse-lite/data/features/sni.js +1 -1
- data/node_modules/caniuse-lite/data/features/spdy.js +1 -1
- data/node_modules/caniuse-lite/data/features/speech-recognition.js +1 -1
- data/node_modules/caniuse-lite/data/features/speech-synthesis.js +1 -1
- data/node_modules/caniuse-lite/data/features/spellcheck-attribute.js +1 -1
- data/node_modules/caniuse-lite/data/features/sql-storage.js +1 -1
- data/node_modules/caniuse-lite/data/features/srcset.js +1 -1
- data/node_modules/caniuse-lite/data/features/stream.js +1 -1
- data/node_modules/caniuse-lite/data/features/streams.js +1 -1
- data/node_modules/caniuse-lite/data/features/stricttransportsecurity.js +1 -1
- data/node_modules/caniuse-lite/data/features/style-scoped.js +1 -1
- data/node_modules/caniuse-lite/data/features/subresource-bundling.js +1 -1
- data/node_modules/caniuse-lite/data/features/subresource-integrity.js +1 -1
- data/node_modules/caniuse-lite/data/features/svg-css.js +1 -1
- data/node_modules/caniuse-lite/data/features/svg-filters.js +1 -1
- data/node_modules/caniuse-lite/data/features/svg-fonts.js +1 -1
- data/node_modules/caniuse-lite/data/features/svg-fragment.js +1 -1
- data/node_modules/caniuse-lite/data/features/svg-html.js +1 -1
- data/node_modules/caniuse-lite/data/features/svg-html5.js +1 -1
- data/node_modules/caniuse-lite/data/features/svg-img.js +1 -1
- data/node_modules/caniuse-lite/data/features/svg-smil.js +1 -1
- data/node_modules/caniuse-lite/data/features/svg.js +1 -1
- data/node_modules/caniuse-lite/data/features/sxg.js +1 -1
- data/node_modules/caniuse-lite/data/features/tabindex-attr.js +1 -1
- data/node_modules/caniuse-lite/data/features/template-literals.js +1 -1
- data/node_modules/caniuse-lite/data/features/template.js +1 -1
- data/node_modules/caniuse-lite/data/features/temporal.js +1 -1
- data/node_modules/caniuse-lite/data/features/testfeat.js +1 -1
- data/node_modules/caniuse-lite/data/features/text-decoration.js +1 -1
- data/node_modules/caniuse-lite/data/features/text-emphasis.js +1 -1
- data/node_modules/caniuse-lite/data/features/text-overflow.js +1 -1
- data/node_modules/caniuse-lite/data/features/text-size-adjust.js +1 -1
- data/node_modules/caniuse-lite/data/features/text-stroke.js +1 -1
- data/node_modules/caniuse-lite/data/features/textcontent.js +1 -1
- data/node_modules/caniuse-lite/data/features/textencoder.js +1 -1
- data/node_modules/caniuse-lite/data/features/tls1-1.js +1 -1
- data/node_modules/caniuse-lite/data/features/tls1-2.js +1 -1
- data/node_modules/caniuse-lite/data/features/tls1-3.js +1 -1
- data/node_modules/caniuse-lite/data/features/touch.js +1 -1
- data/node_modules/caniuse-lite/data/features/transforms2d.js +1 -1
- data/node_modules/caniuse-lite/data/features/transforms3d.js +1 -1
- data/node_modules/caniuse-lite/data/features/trusted-types.js +1 -1
- data/node_modules/caniuse-lite/data/features/ttf.js +1 -1
- data/node_modules/caniuse-lite/data/features/typedarrays.js +1 -1
- data/node_modules/caniuse-lite/data/features/u2f.js +1 -1
- data/node_modules/caniuse-lite/data/features/unhandledrejection.js +1 -1
- data/node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js +1 -1
- data/node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js +1 -1
- data/node_modules/caniuse-lite/data/features/url.js +1 -1
- data/node_modules/caniuse-lite/data/features/urlsearchparams.js +1 -1
- data/node_modules/caniuse-lite/data/features/use-strict.js +1 -1
- data/node_modules/caniuse-lite/data/features/user-select-none.js +1 -1
- data/node_modules/caniuse-lite/data/features/user-timing.js +1 -1
- data/node_modules/caniuse-lite/data/features/variable-fonts.js +1 -1
- data/node_modules/caniuse-lite/data/features/vector-effect.js +1 -1
- data/node_modules/caniuse-lite/data/features/vibration.js +1 -1
- data/node_modules/caniuse-lite/data/features/video.js +1 -1
- data/node_modules/caniuse-lite/data/features/videotracks.js +1 -1
- data/node_modules/caniuse-lite/data/features/view-transitions.js +1 -1
- data/node_modules/caniuse-lite/data/features/viewport-unit-variants.js +1 -1
- data/node_modules/caniuse-lite/data/features/viewport-units.js +1 -1
- data/node_modules/caniuse-lite/data/features/wai-aria.js +1 -1
- data/node_modules/caniuse-lite/data/features/wake-lock.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-bigint.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-bulk-memory.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-extended-const.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-gc.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-multi-memory.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-multi-value.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-mutable-globals.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-nontrapping-fptoint.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-reference-types.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-relaxed-simd.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-signext.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-simd.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-tail-calls.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm-threads.js +1 -1
- data/node_modules/caniuse-lite/data/features/wasm.js +1 -1
- data/node_modules/caniuse-lite/data/features/wav.js +1 -1
- data/node_modules/caniuse-lite/data/features/wbr-element.js +1 -1
- data/node_modules/caniuse-lite/data/features/web-animation.js +1 -1
- data/node_modules/caniuse-lite/data/features/web-app-manifest.js +1 -1
- data/node_modules/caniuse-lite/data/features/web-bluetooth.js +1 -1
- data/node_modules/caniuse-lite/data/features/web-serial.js +1 -1
- data/node_modules/caniuse-lite/data/features/web-share.js +1 -1
- data/node_modules/caniuse-lite/data/features/webauthn.js +1 -1
- data/node_modules/caniuse-lite/data/features/webcodecs.js +1 -1
- data/node_modules/caniuse-lite/data/features/webgl.js +1 -1
- data/node_modules/caniuse-lite/data/features/webgl2.js +1 -1
- data/node_modules/caniuse-lite/data/features/webgpu.js +1 -1
- data/node_modules/caniuse-lite/data/features/webhid.js +1 -1
- data/node_modules/caniuse-lite/data/features/webkit-user-drag.js +1 -1
- data/node_modules/caniuse-lite/data/features/webm.js +1 -1
- data/node_modules/caniuse-lite/data/features/webnfc.js +1 -1
- data/node_modules/caniuse-lite/data/features/webp.js +1 -1
- data/node_modules/caniuse-lite/data/features/websockets.js +1 -1
- data/node_modules/caniuse-lite/data/features/webtransport.js +1 -1
- data/node_modules/caniuse-lite/data/features/webusb.js +1 -1
- data/node_modules/caniuse-lite/data/features/webvr.js +1 -1
- data/node_modules/caniuse-lite/data/features/webvtt.js +1 -1
- data/node_modules/caniuse-lite/data/features/webworkers.js +1 -1
- data/node_modules/caniuse-lite/data/features/webxr.js +1 -1
- data/node_modules/caniuse-lite/data/features/will-change.js +1 -1
- data/node_modules/caniuse-lite/data/features/woff.js +1 -1
- data/node_modules/caniuse-lite/data/features/woff2.js +1 -1
- data/node_modules/caniuse-lite/data/features/word-break.js +1 -1
- data/node_modules/caniuse-lite/data/features/wordwrap.js +1 -1
- data/node_modules/caniuse-lite/data/features/x-doc-messaging.js +1 -1
- data/node_modules/caniuse-lite/data/features/x-frame-options.js +1 -1
- data/node_modules/caniuse-lite/data/features/xhr2.js +1 -1
- data/node_modules/caniuse-lite/data/features/xhtml.js +1 -1
- data/node_modules/caniuse-lite/data/features/xhtmlsmil.js +1 -1
- data/node_modules/caniuse-lite/data/features/xml-serializer.js +1 -1
- data/node_modules/caniuse-lite/data/features/zstd.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AD.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AF.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AL.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AS.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AU.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AW.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AX.js +1 -1
- data/node_modules/caniuse-lite/data/regions/AZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BB.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BD.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BF.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BH.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BJ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BS.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BW.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BY.js +1 -1
- data/node_modules/caniuse-lite/data/regions/BZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CD.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CF.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CH.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CK.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CL.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CU.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CV.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CX.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CY.js +1 -1
- data/node_modules/caniuse-lite/data/regions/CZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/DE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/DJ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/DK.js +1 -1
- data/node_modules/caniuse-lite/data/regions/DM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/DO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/DZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/EC.js +1 -1
- data/node_modules/caniuse-lite/data/regions/EE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/EG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ER.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ES.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ET.js +1 -1
- data/node_modules/caniuse-lite/data/regions/FI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/FJ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/FK.js +1 -1
- data/node_modules/caniuse-lite/data/regions/FM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/FO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/FR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GB.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GD.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GF.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GH.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GL.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GP.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GQ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GU.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GW.js +1 -1
- data/node_modules/caniuse-lite/data/regions/GY.js +1 -1
- data/node_modules/caniuse-lite/data/regions/HK.js +1 -1
- data/node_modules/caniuse-lite/data/regions/HN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/HR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/HT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/HU.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ID.js +1 -1
- data/node_modules/caniuse-lite/data/regions/IE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/IL.js +1 -1
- data/node_modules/caniuse-lite/data/regions/IM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/IN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/IQ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/IR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/IS.js +1 -1
- data/node_modules/caniuse-lite/data/regions/IT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/JE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/JM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/JO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/JP.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KH.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KP.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KW.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KY.js +1 -1
- data/node_modules/caniuse-lite/data/regions/KZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LB.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LC.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LK.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LS.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LU.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LV.js +1 -1
- data/node_modules/caniuse-lite/data/regions/LY.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MC.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MD.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ME.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MH.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MK.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ML.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MP.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MQ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MS.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MU.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MV.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MW.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MX.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MY.js +1 -1
- data/node_modules/caniuse-lite/data/regions/MZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NC.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NF.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NL.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NP.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NU.js +1 -1
- data/node_modules/caniuse-lite/data/regions/NZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/OM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PF.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PH.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PK.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PL.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PS.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PW.js +1 -1
- data/node_modules/caniuse-lite/data/regions/PY.js +1 -1
- data/node_modules/caniuse-lite/data/regions/QA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/RE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/RO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/RS.js +1 -1
- data/node_modules/caniuse-lite/data/regions/RU.js +1 -1
- data/node_modules/caniuse-lite/data/regions/RW.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SB.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SC.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SD.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SH.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SK.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SL.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ST.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SV.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SY.js +1 -1
- data/node_modules/caniuse-lite/data/regions/SZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TC.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TD.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TH.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TJ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TL.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TO.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TR.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TV.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TW.js +1 -1
- data/node_modules/caniuse-lite/data/regions/TZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/UA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/UG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/US.js +1 -1
- data/node_modules/caniuse-lite/data/regions/UY.js +1 -1
- data/node_modules/caniuse-lite/data/regions/UZ.js +1 -1
- data/node_modules/caniuse-lite/data/regions/VA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/VC.js +1 -1
- data/node_modules/caniuse-lite/data/regions/VE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/VG.js +1 -1
- data/node_modules/caniuse-lite/data/regions/VI.js +1 -1
- data/node_modules/caniuse-lite/data/regions/VN.js +1 -1
- data/node_modules/caniuse-lite/data/regions/VU.js +1 -1
- data/node_modules/caniuse-lite/data/regions/WF.js +1 -1
- data/node_modules/caniuse-lite/data/regions/WS.js +1 -1
- data/node_modules/caniuse-lite/data/regions/YE.js +1 -1
- data/node_modules/caniuse-lite/data/regions/YT.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ZA.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ZM.js +1 -1
- data/node_modules/caniuse-lite/data/regions/ZW.js +1 -1
- data/node_modules/caniuse-lite/data/regions/alt-af.js +1 -1
- data/node_modules/caniuse-lite/data/regions/alt-an.js +1 -1
- data/node_modules/caniuse-lite/data/regions/alt-as.js +1 -1
- data/node_modules/caniuse-lite/data/regions/alt-eu.js +1 -1
- data/node_modules/caniuse-lite/data/regions/alt-na.js +1 -1
- data/node_modules/caniuse-lite/data/regions/alt-oc.js +1 -1
- data/node_modules/caniuse-lite/data/regions/alt-sa.js +1 -1
- data/node_modules/caniuse-lite/data/regions/alt-ww.js +1 -1
- data/node_modules/caniuse-lite/package.json +1 -1
- data/node_modules/electron-to-chromium/chromium-versions.js +1 -4
- data/node_modules/electron-to-chromium/chromium-versions.json +1 -1
- data/node_modules/electron-to-chromium/full-chromium-versions.js +3 -75
- data/node_modules/electron-to-chromium/full-chromium-versions.json +1 -1
- data/node_modules/electron-to-chromium/full-versions.js +1 -45
- data/node_modules/electron-to-chromium/full-versions.json +1 -1
- data/node_modules/electron-to-chromium/package.json +1 -1
- data/node_modules/electron-to-chromium/versions.js +1 -8
- data/node_modules/electron-to-chromium/versions.json +1 -1
- data/node_modules/es-object-atoms/CHANGELOG.md +0 -21
- data/node_modules/es-object-atoms/README.md +0 -7
- data/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +2 -2
- data/node_modules/es-object-atoms/ToObject.d.ts +2 -6
- data/node_modules/es-object-atoms/package.json +8 -9
- data/node_modules/es-object-atoms/test/index.js +1 -11
- data/node_modules/es-shim-unscopables/CHANGELOG.md +0 -8
- data/node_modules/es-shim-unscopables/index.js +1 -2
- data/node_modules/es-shim-unscopables/package.json +11 -20
- data/node_modules/es-shim-unscopables/test/index.js +1 -4
- data/node_modules/es-shim-unscopables/test/with.js +0 -8
- data/node_modules/flatted/index.js +3 -3
- data/node_modules/flatted/min.js +1 -1
- data/node_modules/flatted/package.json +8 -21
- data/node_modules/flatted/python/flatted.py +4 -4
- data/node_modules/flatted/python/test.py +63 -0
- data/node_modules/flow-parser/flow_parser.js +5530 -5550
- data/node_modules/flow-parser/package.json +1 -1
- data/node_modules/for-each/README.md +4 -0
- data/node_modules/for-each/index.js +4 -11
- data/node_modules/for-each/package.json +36 -47
- data/node_modules/for-each/test/test.js +12 -54
- data/node_modules/get-intrinsic/CHANGELOG.md +0 -8
- data/node_modules/get-intrinsic/index.js +0 -1
- data/node_modules/get-intrinsic/package.json +8 -8
- data/node_modules/import-fresh/index.js +1 -2
- data/node_modules/import-fresh/package.json +1 -6
- data/node_modules/import-fresh/readme.md +8 -14
- data/node_modules/is-async-function/CHANGELOG.md +0 -13
- data/node_modules/is-async-function/index.d.ts +2 -4
- data/node_modules/is-async-function/index.js +18 -3
- data/node_modules/is-async-function/package.json +3 -8
- data/node_modules/is-boolean-object/CHANGELOG.md +0 -11
- data/node_modules/is-boolean-object/index.js +1 -1
- data/node_modules/is-boolean-object/package.json +6 -8
- data/node_modules/is-boolean-object/test/index.js +1 -24
- data/node_modules/is-weakref/CHANGELOG.md +0 -8
- data/node_modules/is-weakref/index.d.ts +1 -1
- data/node_modules/is-weakref/index.js +1 -3
- data/node_modules/is-weakref/package.json +6 -6
- data/node_modules/jscodeshift/CHANGELOG.md +226 -0
- data/node_modules/jscodeshift/CODE_OF_CONDUCT.md +3 -0
- data/node_modules/jscodeshift/CONTRIBUTING.md +48 -0
- data/node_modules/{async-function → jscodeshift}/LICENSE +1 -1
- data/node_modules/jscodeshift/README.md +671 -0
- data/node_modules/jscodeshift/bin/jscodeshift.js +182 -0
- data/node_modules/jscodeshift/bin/jscodeshift.sh +12 -0
- data/node_modules/jscodeshift/dist/Collection.js +472 -0
- data/node_modules/jscodeshift/dist/Runner.js +322 -0
- data/node_modules/jscodeshift/dist/Worker.js +210 -0
- data/node_modules/jscodeshift/dist/__testfixtures__/test-async-transform.input.js +1 -0
- data/node_modules/jscodeshift/dist/__testfixtures__/test-async-transform.js +11 -0
- data/node_modules/jscodeshift/dist/__testfixtures__/test-async-transform.output.js +1 -0
- data/node_modules/jscodeshift/dist/__testfixtures__/test-sync-transform.input.js +1 -0
- data/node_modules/jscodeshift/dist/__testfixtures__/test-sync-transform.js +7 -0
- data/node_modules/jscodeshift/dist/__testfixtures__/test-sync-transform.output.js +1 -0
- data/node_modules/jscodeshift/dist/argsParser.js +273 -0
- data/node_modules/jscodeshift/dist/collections/ImportDeclaration.js +113 -0
- data/node_modules/jscodeshift/dist/collections/JSXElement.js +221 -0
- data/node_modules/jscodeshift/dist/collections/Node.js +187 -0
- data/node_modules/jscodeshift/dist/collections/VariableDeclarator.js +210 -0
- data/node_modules/jscodeshift/dist/collections/index.js +14 -0
- data/node_modules/jscodeshift/dist/core.js +183 -0
- data/node_modules/jscodeshift/dist/getParser.js +25 -0
- data/node_modules/jscodeshift/dist/ignoreFiles.js +68 -0
- data/node_modules/jscodeshift/dist/matchNode.js +40 -0
- data/node_modules/jscodeshift/dist/template.js +173 -0
- data/node_modules/jscodeshift/dist/testUtils.js +173 -0
- data/node_modules/jscodeshift/dist/utils/intersection.js +27 -0
- data/node_modules/jscodeshift/dist/utils/once.js +21 -0
- data/node_modules/jscodeshift/dist/utils/union.js +20 -0
- data/node_modules/jscodeshift/index.js +9 -0
- data/node_modules/jscodeshift/package.json +74 -0
- data/node_modules/jscodeshift/parser/babel5Compat.js +50 -0
- data/node_modules/jscodeshift/parser/babylon.js +57 -0
- data/node_modules/jscodeshift/parser/flow.js +34 -0
- data/node_modules/jscodeshift/parser/ts.js +24 -0
- data/node_modules/jscodeshift/parser/tsOptions.js +46 -0
- data/node_modules/jscodeshift/parser/tsx.js +27 -0
- data/node_modules/jscodeshift/src/Collection.js +472 -0
- data/node_modules/jscodeshift/src/Runner.js +322 -0
- data/node_modules/jscodeshift/src/Worker.js +210 -0
- data/node_modules/jscodeshift/src/__testfixtures__/test-async-transform.input.js +1 -0
- data/node_modules/jscodeshift/src/__testfixtures__/test-async-transform.js +11 -0
- data/node_modules/jscodeshift/src/__testfixtures__/test-async-transform.output.js +1 -0
- data/node_modules/jscodeshift/src/__testfixtures__/test-sync-transform.input.js +1 -0
- data/node_modules/jscodeshift/src/__testfixtures__/test-sync-transform.js +7 -0
- data/node_modules/jscodeshift/src/__testfixtures__/test-sync-transform.output.js +1 -0
- data/node_modules/jscodeshift/src/argsParser.js +273 -0
- data/node_modules/jscodeshift/src/collections/ImportDeclaration.js +113 -0
- data/node_modules/jscodeshift/src/collections/JSXElement.js +221 -0
- data/node_modules/jscodeshift/src/collections/Node.js +187 -0
- data/node_modules/jscodeshift/src/collections/VariableDeclarator.js +210 -0
- data/node_modules/jscodeshift/src/collections/index.js +14 -0
- data/node_modules/jscodeshift/src/core.js +183 -0
- data/node_modules/jscodeshift/src/getParser.js +25 -0
- data/node_modules/jscodeshift/src/ignoreFiles.js +68 -0
- data/node_modules/jscodeshift/src/matchNode.js +40 -0
- data/node_modules/jscodeshift/src/template.js +173 -0
- data/node_modules/jscodeshift/src/testUtils.js +173 -0
- data/node_modules/jscodeshift/src/utils/intersection.js +27 -0
- data/node_modules/jscodeshift/src/utils/once.js +21 -0
- data/node_modules/jscodeshift/src/utils/union.js +20 -0
- data/node_modules/jscodeshift/utils/requirePackage.js +24 -0
- data/node_modules/jscodeshift/utils/testUtils.js +49 -0
- data/node_modules/jscodeshift/website/README.md +44 -0
- data/node_modules/jscodeshift/website/astro.config.mjs +36 -0
- data/node_modules/jscodeshift/website/package.json +17 -0
- data/node_modules/jscodeshift/website/public/favicon.svg +1 -0
- data/node_modules/jscodeshift/website/src/assets/houston.webp +0 -0
- data/node_modules/jscodeshift/website/src/content/config.ts +6 -0
- data/node_modules/jscodeshift/website/src/content/docs/build/api-reference.mdx +406 -0
- data/node_modules/jscodeshift/website/src/content/docs/build/ast-grammar.mdx +3086 -0
- data/node_modules/jscodeshift/website/src/content/docs/index.mdx +15 -0
- data/node_modules/jscodeshift/website/src/content/docs/overview/introduction.mdx +45 -0
- data/node_modules/jscodeshift/website/src/content/docs/run/cli.mdx +161 -0
- data/node_modules/jscodeshift/website/src/env.d.ts +2 -0
- data/node_modules/jscodeshift/website/tsconfig.json +3 -0
- data/node_modules/object-inspect/CHANGELOG.md +0 -8
- data/node_modules/object-inspect/index.js +7 -10
- data/node_modules/object-inspect/package.json +4 -5
- data/node_modules/object-inspect/test/values.js +0 -50
- data/node_modules/possible-typed-array-names/CHANGELOG.md +0 -14
- data/node_modules/possible-typed-array-names/README.md +2 -4
- data/node_modules/possible-typed-array-names/index.d.ts +0 -1
- data/node_modules/possible-typed-array-names/index.js +0 -1
- data/node_modules/possible-typed-array-names/package.json +9 -10
- data/node_modules/possible-typed-array-names/test/index.js +3 -6
- data/node_modules/possible-typed-array-names/tsconfig.json +42 -2
- data/node_modules/recast/lib/lines.d.ts +2 -2
- data/node_modules/recast/lib/printer.js +5 -17
- data/node_modules/recast/package.json +1 -1
- data/node_modules/typescript/README.md +1 -1
- data/node_modules/typescript/lib/_tsc.js +500 -931
- data/node_modules/typescript/lib/_tsserver.js +7 -43
- data/node_modules/typescript/lib/cancellationToken.js +90 -0
- data/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/de/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/es/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/it/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/lib.dom.d.ts +142 -769
- data/node_modules/typescript/lib/lib.dom.iterable.d.ts +7 -9
- data/node_modules/typescript/lib/lib.es2015.iterable.d.ts +54 -69
- data/node_modules/typescript/lib/lib.es2020.bigint.d.ts +7 -41
- data/node_modules/typescript/lib/lib.es2023.array.d.ts +24 -24
- data/node_modules/typescript/lib/lib.es5.d.ts +51 -60
- data/node_modules/typescript/lib/lib.esnext.d.ts +0 -2
- data/node_modules/typescript/lib/lib.esnext.iterator.d.ts +1 -1
- data/node_modules/typescript/lib/lib.webworker.d.ts +55 -262
- data/node_modules/typescript/lib/lib.webworker.iterable.d.ts +7 -6
- data/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/typescript.d.ts +3 -14
- data/node_modules/typescript/lib/typescript.js +570 -1035
- data/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +8 -14
- data/node_modules/typescript/package.json +22 -22
- data/node_modules/update-browserslist-db/index.js +7 -5
- data/node_modules/update-browserslist-db/package.json +2 -2
- data/node_modules/which-typed-array/CHANGELOG.md +0 -10
- data/node_modules/which-typed-array/index.js +20 -21
- data/node_modules/which-typed-array/package.json +7 -9
- data/node_modules/which-typed-array/tsconfig.json +1 -1
- data/package.json +1 -0
- metadata +85 -28
- data/node_modules/@babel/generator/lib/generators/deprecated.js +0 -28
- data/node_modules/@babel/generator/lib/generators/deprecated.js.map +0 -1
- data/node_modules/@babel/types/lib/builders/generated/lowercase.js +0 -2886
- data/node_modules/@babel/types/lib/builders/generated/lowercase.js.map +0 -1
- data/node_modules/async-function/CHANGELOG.md +0 -16
- data/node_modules/async-function/README.md +0 -51
- data/node_modules/async-function/index.d.mts +0 -3
- data/node_modules/async-function/index.d.ts +0 -13
- data/node_modules/async-function/index.js +0 -8
- data/node_modules/async-function/index.mjs +0 -4
- data/node_modules/async-function/legacy.js +0 -18
- data/node_modules/async-function/package.json +0 -86
- data/node_modules/async-function/require.mjs +0 -5
- data/node_modules/async-function/test/index.js +0 -40
- data/node_modules/async-function/tsconfig.json +0 -9
- data/node_modules/es-object-atoms/isObject.d.ts +0 -3
- data/node_modules/es-object-atoms/isObject.js +0 -6
- data/node_modules/es-shim-unscopables/index.d.ts +0 -8
- data/node_modules/es-shim-unscopables/tsconfig.json +0 -10
- data/node_modules/for-each/CHANGELOG.md +0 -107
- data/node_modules/for-each/index.d.ts +0 -35
- data/node_modules/for-each/tsconfig.json +0 -8
- data/node_modules/typescript/lib/lib.esnext.float16.d.ts +0 -443
- data/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -34
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_async","require","_path","data","_url","_semver","_debug","_rewriteStackTrace","_configError","_transformFile","asyncGeneratorStep","n","t","e","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","debug","buildDebug","import_","_unused","supportsESM","exports","semver","satisfies","process","versions","node","LOADING_CJS_FILES","Set","loadCjsDefault","filepath","has","module","add","endHiddenCallStack","delete","__esModule","Symbol","toStringTag","default","undefined","loadMjsFromPath","_loadMjsFromPath","url","pathToFileURL","toString","ConfigError","_x","SUPPORTED_EXTENSIONS","asyncModules","loadCodeDefault","loader","esmError","tlaError","async","ext","path","extname","isTS","type","hasOwnProperty","call","pattern","ensureTsSupport","code","isAsync","promise","waitFor","Error","callback","extensions","opts","babelrc","configFile","sourceType","sourceMaps","sourceFileName","basename","presets","getTSPreset","Object","assign","onlyRemoveTypeImports","optimizeConstEnums","allowDeclareFields","handler","m","filename","endsWith","_compile","transformFileSync","error","packageJson","lt","version","console","message","pnp"],"sources":["../../../src/config/files/module-types.ts"],"sourcesContent":["import { isAsync, waitFor } from \"../../gensync-utils/async.ts\";\nimport type { Handler } from \"gensync\";\nimport path from \"path\";\nimport { pathToFileURL } from \"url\";\nimport { createRequire } from \"module\";\nimport semver from \"semver\";\nimport buildDebug from \"debug\";\n\nimport { endHiddenCallStack } from \"../../errors/rewrite-stack-trace.ts\";\nimport ConfigError from \"../../errors/config-error.ts\";\n\nimport type { InputOptions } from \"../index.ts\";\nimport { transformFileSync } from \"../../transform-file.ts\";\n\nconst debug = buildDebug(\"babel:config:loading:files:module-types\");\n\nconst require = createRequire(import.meta.url);\n\nif (!process.env.BABEL_8_BREAKING) {\n try {\n // Old Node.js versions don't support import() syntax.\n // eslint-disable-next-line no-var\n var import_:\n | ((specifier: string | URL) => any)\n | undefined = require(\"./import.cjs\");\n } catch {}\n}\n\nexport const supportsESM = semver.satisfies(\n process.versions.node,\n // older versions, starting from 10, support the dynamic\n // import syntax but always return a rejected promise.\n \"^12.17 || >=13.2\",\n);\n\nconst LOADING_CJS_FILES = new Set();\n\nfunction loadCjsDefault(filepath: string) {\n // The `require()` call below can make this code reentrant if a require hook\n // like @babel/register has been loaded into the system. That would cause\n // Babel to attempt to compile the `.babelrc.js` file as it loads below. To\n // cover this case, we auto-ignore re-entrant config processing. ESM loaders\n // do not have this problem, because loaders do not apply to themselves.\n if (LOADING_CJS_FILES.has(filepath)) {\n debug(\"Auto-ignoring usage of config %o.\", filepath);\n return {};\n }\n\n let module;\n try {\n LOADING_CJS_FILES.add(filepath);\n module = endHiddenCallStack(require)(filepath);\n } finally {\n LOADING_CJS_FILES.delete(filepath);\n }\n\n if (process.env.BABEL_8_BREAKING) {\n return module != null &&\n (module.__esModule || module[Symbol.toStringTag] === \"Module\")\n ? module.default\n : module;\n } else {\n return module != null &&\n (module.__esModule || module[Symbol.toStringTag] === \"Module\")\n ? module.default ||\n /* fallbackToTranspiledModule */ (arguments[1] ? module : undefined)\n : module;\n }\n}\n\nconst loadMjsFromPath = endHiddenCallStack(async function loadMjsFromPath(\n filepath: string,\n) {\n // Add ?import as a workaround for https://github.com/nodejs/node/issues/55500\n const url = pathToFileURL(filepath).toString() + \"?import\";\n\n if (process.env.BABEL_8_BREAKING) {\n return await import(url);\n } else {\n if (!import_) {\n throw new ConfigError(\n \"Internal error: Native ECMAScript modules aren't supported by this platform.\\n\",\n filepath,\n );\n }\n\n return await import_(url);\n }\n});\n\nconst SUPPORTED_EXTENSIONS = {\n \".js\": \"unknown\",\n \".mjs\": \"esm\",\n \".cjs\": \"cjs\",\n \".ts\": \"unknown\",\n \".mts\": \"esm\",\n \".cts\": \"cjs\",\n} as const;\n\nconst asyncModules = new Set();\n\nexport default function* loadCodeDefault(\n filepath: string,\n loader: \"require\" | \"auto\",\n esmError: string,\n tlaError: string,\n): Handler<unknown> {\n let async;\n\n const ext = path.extname(filepath);\n const isTS = ext === \".ts\" || ext === \".cts\" || ext === \".mts\";\n\n const type =\n SUPPORTED_EXTENSIONS[\n Object.hasOwn(SUPPORTED_EXTENSIONS, ext)\n ? (ext as keyof typeof SUPPORTED_EXTENSIONS)\n : (\".js\" as const)\n ];\n\n const pattern = `${loader} ${type}` as const;\n switch (pattern) {\n case \"require cjs\":\n case \"auto cjs\":\n if (isTS) {\n return ensureTsSupport(filepath, ext, () => loadCjsDefault(filepath));\n } else if (process.env.BABEL_8_BREAKING) {\n return loadCjsDefault(filepath);\n } else {\n return loadCjsDefault(\n filepath,\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n /* fallbackToTranspiledModule */ arguments[2],\n );\n }\n case \"auto unknown\":\n case \"require unknown\":\n case \"require esm\":\n try {\n if (isTS) {\n return ensureTsSupport(filepath, ext, () => loadCjsDefault(filepath));\n } else if (process.env.BABEL_8_BREAKING) {\n return loadCjsDefault(filepath);\n } else {\n return loadCjsDefault(\n filepath,\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n /* fallbackToTranspiledModule */ arguments[2],\n );\n }\n } catch (e) {\n if (\n e.code === \"ERR_REQUIRE_ASYNC_MODULE\" ||\n // Node.js 13.0.0 throws ERR_REQUIRE_CYCLE_MODULE instead of\n // ERR_REQUIRE_ASYNC_MODULE when requiring a module a second time\n // https://github.com/nodejs/node/issues/55516\n // This `asyncModules` won't catch all of such cases, but it will\n // at least catch those caused by Babel trying to load a module twice.\n (e.code === \"ERR_REQUIRE_CYCLE_MODULE\" && asyncModules.has(filepath))\n ) {\n asyncModules.add(filepath);\n if (!(async ??= yield* isAsync())) {\n throw new ConfigError(tlaError, filepath);\n }\n // fall through: require() failed due to TLA\n } else if (\n e.code === \"ERR_REQUIRE_ESM\" ||\n (!process.env.BABEL_8_BREAKING && type === \"esm\")\n ) {\n // fall through: require() failed due to ESM\n } else {\n throw e;\n }\n }\n // fall through: require() failed due to ESM or TLA, try import()\n case \"auto esm\":\n if ((async ??= yield* isAsync())) {\n const promise = isTS\n ? ensureTsSupport(filepath, ext, () => loadMjsFromPath(filepath))\n : loadMjsFromPath(filepath);\n\n return (yield* waitFor(promise)).default;\n }\n throw new ConfigError(esmError, filepath);\n default:\n throw new Error(\"Internal Babel error: unreachable code.\");\n }\n}\n\nfunction ensureTsSupport<T>(\n filepath: string,\n ext: string,\n callback: () => T,\n): T {\n if (\n require.extensions[\".ts\"] ||\n require.extensions[\".cts\"] ||\n require.extensions[\".mts\"]\n ) {\n return callback();\n }\n\n if (ext !== \".cts\") {\n throw new ConfigError(\n `\\\nYou are using a ${ext} config file, but Babel only supports transpiling .cts configs. Either:\n- Use a .cts config file\n- Update to Node.js 23.6.0, which has native TypeScript support\n- Install ts-node to transpile ${ext} files on the fly\\\n`,\n filepath,\n );\n }\n\n const opts: InputOptions = {\n babelrc: false,\n configFile: false,\n sourceType: \"unambiguous\",\n sourceMaps: \"inline\",\n sourceFileName: path.basename(filepath),\n presets: [\n [\n getTSPreset(filepath),\n {\n onlyRemoveTypeImports: true,\n optimizeConstEnums: true,\n ...(process.env.BABEL_8_BREAKING ? {} : { allowDeclareFields: true }),\n },\n ],\n ],\n };\n\n let handler: NodeJS.RequireExtensions[\"\"] = function (m, filename) {\n // If we want to support `.ts`, `.d.ts` must be handled specially.\n if (handler && filename.endsWith(\".cts\")) {\n try {\n // @ts-expect-error Undocumented API\n return m._compile(\n transformFileSync(filename, {\n ...opts,\n filename,\n }).code,\n filename,\n );\n } catch (error) {\n // TODO(Babel 8): Add this as an optional peer dependency\n // eslint-disable-next-line import/no-extraneous-dependencies\n const packageJson = require(\"@babel/preset-typescript/package.json\");\n if (semver.lt(packageJson.version, \"7.21.4\")) {\n console.error(\n \"`.cts` configuration file failed to load, please try to update `@babel/preset-typescript`.\",\n );\n }\n throw error;\n }\n }\n return require.extensions[\".js\"](m, filename);\n };\n require.extensions[ext] = handler;\n\n try {\n return callback();\n } finally {\n if (require.extensions[ext] === handler) delete require.extensions[ext];\n handler = undefined;\n }\n}\n\nfunction getTSPreset(filepath: string) {\n try {\n // eslint-disable-next-line import/no-extraneous-dependencies\n return require(\"@babel/preset-typescript\");\n } catch (error) {\n if (error.code !== \"MODULE_NOT_FOUND\") throw error;\n\n let message =\n \"You appear to be using a .cts file as Babel configuration, but the `@babel/preset-typescript` package was not found: please install it!\";\n\n if (!process.env.BABEL_8_BREAKING) {\n if (process.versions.pnp) {\n // Using Yarn PnP, which doesn't allow requiring packages that are not\n // explicitly specified as dependencies.\n message += `\nIf you are using Yarn Plug'n'Play, you may also need to add the following configuration to your .yarnrc.yml file:\n\npackageExtensions:\n\\t\"@babel/core@*\":\n\\t\\tpeerDepend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;MACK;IACF;IAEA,MAAM,IAAIlD,oBAAW,CAACkD,OAAO,EAAElE,QAAQ,CAAC;EAC1C;AACF;AAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_async3","require","_path","data","_url","_semver","_debug","_rewriteStackTrace","_configError","_transformFile","asyncGeneratorStep","n","t","e","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","debug","buildDebug","import_","_unused","supportsESM","exports","semver","satisfies","process","versions","node","LOADING_CJS_FILES","Set","loadCjsDefault","filepath","has","module","add","endHiddenCallStack","delete","__esModule","Symbol","toStringTag","default","undefined","loadMjsFromPath","_loadMjsFromPath","url","pathToFileURL","toString","ConfigError","_x","SUPPORTED_EXTENSIONS","asyncModules","loadCodeDefault","loader","esmError","tlaError","_async2","async","ext","path","extname","pattern","loadCtsDefault","code","_async","isAsync","waitFor","Error","hasTsSupport","extensions","handler","opts","babelrc","configFile","sourceType","sourceMaps","sourceFileName","basename","presets","getTSPreset","Object","assign","onlyRemoveTypeImports","optimizeConstEnums","allowDeclareFields","m","filename","endsWith","_compile","transformFileSync","error","packageJson","lt","version","console","message","pnp"],"sources":["../../../src/config/files/module-types.ts"],"sourcesContent":["import { isAsync, waitFor } from \"../../gensync-utils/async.ts\";\nimport type { Handler } from \"gensync\";\nimport path from \"path\";\nimport { pathToFileURL } from \"url\";\nimport { createRequire } from \"module\";\nimport semver from \"semver\";\nimport buildDebug from \"debug\";\n\nimport { endHiddenCallStack } from \"../../errors/rewrite-stack-trace.ts\";\nimport ConfigError from \"../../errors/config-error.ts\";\n\nimport type { InputOptions } from \"../index.ts\";\nimport { transformFileSync } from \"../../transform-file.ts\";\n\nconst debug = buildDebug(\"babel:config:loading:files:module-types\");\n\nconst require = createRequire(import.meta.url);\n\nif (!process.env.BABEL_8_BREAKING) {\n try {\n // Old Node.js versions don't support import() syntax.\n // eslint-disable-next-line no-var\n var import_:\n | ((specifier: string | URL) => any)\n | undefined = require(\"./import.cjs\");\n } catch {}\n}\n\nexport const supportsESM = semver.satisfies(\n process.versions.node,\n // older versions, starting from 10, support the dynamic\n // import syntax but always return a rejected promise.\n \"^12.17 || >=13.2\",\n);\n\nconst LOADING_CJS_FILES = new Set();\n\nfunction loadCjsDefault(filepath: string) {\n // The `require()` call below can make this code reentrant if a require hook\n // like @babel/register has been loaded into the system. That would cause\n // Babel to attempt to compile the `.babelrc.js` file as it loads below. To\n // cover this case, we auto-ignore re-entrant config processing. ESM loaders\n // do not have this problem, because loaders do not apply to themselves.\n if (LOADING_CJS_FILES.has(filepath)) {\n debug(\"Auto-ignoring usage of config %o.\", filepath);\n return {};\n }\n\n let module;\n try {\n LOADING_CJS_FILES.add(filepath);\n module = endHiddenCallStack(require)(filepath);\n } finally {\n LOADING_CJS_FILES.delete(filepath);\n }\n\n if (process.env.BABEL_8_BREAKING) {\n return module != null &&\n (module.__esModule || module[Symbol.toStringTag] === \"Module\")\n ? module.default\n : module;\n } else {\n return module != null &&\n (module.__esModule || module[Symbol.toStringTag] === \"Module\")\n ? module.default ||\n /* fallbackToTranspiledModule */ (arguments[1] ? module : undefined)\n : module;\n }\n}\n\nconst loadMjsFromPath = endHiddenCallStack(async function loadMjsFromPath(\n filepath: string,\n) {\n // Add ?import as a workaround for https://github.com/nodejs/node/issues/55500\n const url = pathToFileURL(filepath).toString() + \"?import\";\n\n if (process.env.BABEL_8_BREAKING) {\n return await import(url);\n } else {\n if (!import_) {\n throw new ConfigError(\n \"Internal error: Native ECMAScript modules aren't supported by this platform.\\n\",\n filepath,\n );\n }\n\n return await import_(url);\n }\n});\n\nconst SUPPORTED_EXTENSIONS = new Set([\".js\", \".mjs\", \".cjs\", \".cts\"] as const);\ntype SetValue<T extends Set<unknown>> = T extends Set<infer U> ? U : never;\n\nconst asyncModules = new Set();\n\nexport default function* loadCodeDefault(\n filepath: string,\n loader: \"require\" | \"auto\",\n esmError: string,\n tlaError: string,\n): Handler<unknown> {\n let async;\n\n let ext = path.extname(filepath);\n if (!SUPPORTED_EXTENSIONS.has(ext as any)) ext = \".js\";\n\n const pattern =\n `${loader} ${ext}` as `${typeof loader} ${SetValue<typeof SUPPORTED_EXTENSIONS>}`;\n switch (pattern) {\n case \"require .cjs\":\n case \"auto .cjs\":\n if (process.env.BABEL_8_BREAKING) {\n return loadCjsDefault(filepath);\n } else {\n return loadCjsDefault(\n filepath,\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n /* fallbackToTranspiledModule */ arguments[2],\n );\n }\n case \"require .cts\":\n case \"auto .cts\":\n return loadCtsDefault(filepath);\n case \"auto .js\":\n case \"require .js\":\n case \"require .mjs\": // Some versions of Node.js support require(esm):\n try {\n if (process.env.BABEL_8_BREAKING) {\n return loadCjsDefault(filepath);\n } else {\n return loadCjsDefault(\n filepath,\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n /* fallbackToTranspiledModule */ arguments[2],\n );\n }\n } catch (e) {\n if (\n e.code === \"ERR_REQUIRE_ASYNC_MODULE\" ||\n // Node.js 13.0.0 throws ERR_REQUIRE_CYCLE_MODULE instead of\n // ERR_REQUIRE_ASYNC_MODULE when requiring a module a second time\n // https://github.com/nodejs/node/issues/55516\n // This `asyncModules` won't catch all of such cases, but it will\n // at least catch those caused by Babel trying to load a module twice.\n (e.code === \"ERR_REQUIRE_CYCLE_MODULE\" && asyncModules.has(filepath))\n ) {\n asyncModules.add(filepath);\n if (!(async ??= yield* isAsync())) {\n throw new ConfigError(tlaError, filepath);\n }\n // fall through: require() failed due to TLA\n } else if (\n e.code === \"ERR_REQUIRE_ESM\" ||\n (!process.env.BABEL_8_BREAKING && ext === \".mjs\")\n ) {\n // fall through: require() failed due to ESM\n } else {\n throw e;\n }\n }\n // fall through: require() failed due to ESM or TLA, try import()\n case \"auto .mjs\":\n if ((async ??= yield* isAsync())) {\n return (yield* waitFor(loadMjsFromPath(filepath))).default;\n }\n throw new ConfigError(esmError, filepath);\n default:\n throw new Error(\"Internal Babel error: unreachable code.\");\n }\n}\n\nfunction loadCtsDefault(filepath: string) {\n const ext = \".cts\";\n const hasTsSupport = !!(\n require.extensions[\".ts\"] ||\n require.extensions[\".cts\"] ||\n require.extensions[\".mts\"]\n );\n\n let handler: NodeJS.RequireExtensions[\"\"];\n\n if (!hasTsSupport) {\n const opts: InputOptions = {\n babelrc: false,\n configFile: false,\n sourceType: \"unambiguous\",\n sourceMaps: \"inline\",\n sourceFileName: path.basename(filepath),\n presets: [\n [\n getTSPreset(filepath),\n {\n onlyRemoveTypeImports: true,\n optimizeConstEnums: true,\n ...(process.env.BABEL_8_BREAKING\n ? {}\n : { allowDeclareFields: true }),\n },\n ],\n ],\n };\n\n handler = function (m, filename) {\n // If we want to support `.ts`, `.d.ts` must be handled specially.\n if (handler && filename.endsWith(ext)) {\n try {\n // @ts-expect-error Undocumented API\n return m._compile(\n transformFileSync(filename, {\n ...opts,\n filename,\n }).code,\n filename,\n );\n } catch (error) {\n if (!hasTsSupport) {\n // TODO(Babel 8): Add this as an optional peer dependency\n // eslint-disable-next-line import/no-extraneous-dependencies\n const packageJson = require(\"@babel/preset-typescript/package.json\");\n if (semver.lt(packageJson.version, \"7.21.4\")) {\n console.error(\n \"`.cts` configuration file failed to load, please try to update `@babel/preset-typescript`.\",\n );\n }\n }\n throw error;\n }\n }\n return require.extensions[\".js\"](m, filename);\n };\n require.extensions[ext] = handler;\n }\n try {\n return loadCjsDefault(filepath);\n } finally {\n if (!hasTsSupport) {\n if (require.extensions[ext] === handler) delete require.extensions[ext];\n handler = undefined;\n }\n }\n}\n\nfunction getTSPreset(filepath: string) {\n try {\n // eslint-disable-next-line import/no-extraneous-dependencies\n return require(\"@babel/preset-typescript\");\n } catch (error) {\n if (error.code !== \"MODULE_NOT_FOUND\") throw error;\n\n let message =\n \"You appear to be using a .cts file as Babel configuration, but the `@babel/preset-typescript` package was not found: please install it!\";\n\n if (!process.env.BABEL_8_BREAKING) {\n if (process.versions.pnp) {\n // Using Yarn PnP, which doesn't allow requiring packages that are not\n // explicitly specified as dependencies.\n message += `\nIf you are using Yarn Plug'n'Play, you may also need to add the following configuration to your .yarnrc.yml file:\n\npackageExtensions:\n\\t\"@babel/core@*\":\n\\t\\tpeerDependencies:\n\\t\\t\\t\"@babel/preset-typescript\": \"*\"\n`;\n }\n }\n\n throw new ConfigError(message, filepath);\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,SAAAC,MAAA;EAAA,MAAAC,IAAA,GAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAC,KAAA;EAAA,MAAAD,IAAA,GAAAF,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAD,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAF,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAF,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAI,kBAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAGA,IAAAQ,cAAA,GAAAR,OAAA;AAA4D,SAAAS,mBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,cAAAC,CAAA,GAAAP,CAAA,CAAAK,CAAA,EAAAC,CAAA,GAAAE,CAAA,GAAAD,CAAA,CAAAE,KAAA,WAAAT,CAAA,gBAAAE,CAAA,CAAAF,CAAA,KAAAO,CAAA,CAAAG,IAAA,GAAAT,CAAA,CAAAO,CAAA,IAAAG,OAAA,CAAAC,OAAA,CAAAJ,CAAA,EAAAK,IAAA,CAAAV,CAAA,EAAAC,C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C,EAAE;cAC5CC,OAAO,CAACJ,KAAK,CACX,4FACF,CAAC;YACH;UACF;UACA,MAAMA,KAAK;QACb;MACF;MACA,OAAOrG,OAAO,CAACgF,UAAU,CAAC,KAAK,CAAC,CAACgB,CAAC,EAAEC,QAAQ,CAAC;IAC/C,CAAC;IACDjG,OAAO,CAACgF,UAAU,CAACX,GAAG,CAAC,GAAGY,OAAO;EACnC;EACA,IAAI;IACF,OAAOvC,cAAc,CAACC,QAAQ,CAAC;EACjC,CAAC,SAAS;IACR,IAAI,CAACoC,YAAY,EAAE;MACjB,IAAI/E,OAAO,CAACgF,UAAU,CAACX,GAAG,CAAC,KAAKY,OAAO,EAAE,OAAOjF,OAAO,CAACgF,UAAU,CAACX,GAAG,CAAC;MACvEY,OAAO,GAAG5B,SAAS;IACrB;EACF;AACF;AAEA,SAASqC,WAAWA,CAAC/C,QAAgB,EAAE;EACrC,IAAI;IAEF,OAAO3C,OAAO,CAAC,0BAA0B,CAAC;EAC5C,CAAC,CAAC,OAAOqG,KAAK,EAAE;IACd,IAAIA,KAAK,CAAC3B,IAAI,KAAK,kBAAkB,EAAE,MAAM2B,KAAK;IAElD,IAAIK,OAAO,GACT,yIAAyI;IAExG;MACjC,IAAIrE,OAAO,CAACC,QAAQ,CAACqE,GAAG,EAAE;QAGxBD,OAAO,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;MACK;IACF;IAEA,MAAM,IAAI/C,oBAAW,CAAC+C,OAAO,EAAE/D,QAAQ,CAAC;EAC1C;AACF;AAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_debug","data","require","_path","_async","_moduleTypes","_url","_importMetaResolve","_fs","debug","buildDebug","EXACT_RE","BABEL_PLUGIN_PREFIX_RE","BABEL_PRESET_PREFIX_RE","BABEL_PLUGIN_ORG_RE","BABEL_PRESET_ORG_RE","OTHER_PLUGIN_ORG_RE","OTHER_PRESET_ORG_RE","OTHER_ORG_DEFAULT_RE","resolvePlugin","exports","resolveStandardizedName","bind","resolvePreset","loadPlugin","name","dirname","filepath","loader","isAsync","value","requireModule","loadPreset","standardizeName","type","path","isAbsolute","isPreset","replace","resolveAlternativesHelper","standardizedName","error","code","message","oppositeType","transformName","tryRequireResolve","id","v","w","split","process","versions","node","resolve","r","paths","b","M","f","_findPath","_nodeModulePaths","concat","Error","tryImportMetaResolve","options","importMetaResolve","resolveStandardizedNameForRequire","it","res","next","done","resolveStandardizedNameForImport","parentUrl","pathToFileURL","join","href","fileURLToPath","allowAsync","supportsESM","resolved","existsSync","Object","assign","e","e2","LOADING_MODULES","Set","has","add","loadCodeDefault","err","delete"],"sources":["../../../src/config/files/plugins.ts"],"sourcesContent":["/**\n * This file handles all logic for converting string-based configuration references into loaded objects.\n */\n\nimport buildDebug from \"debug\";\nimport path from \"path\";\nimport type { Handler } from \"gensync\";\nimport { isAsync } from \"../../gensync-utils/async.ts\";\nimport loadCodeDefault, { supportsESM } from \"./module-types.ts\";\nimport { fileURLToPath, pathToFileURL } from \"url\";\n\nimport { resolve as importMetaResolve } from \"../../vendor/import-meta-resolve.js\";\n\nimport { createRequire } from \"module\";\nimport { existsSync } from \"fs\";\nconst require = createRequire(import.meta.url);\n\nconst debug = buildDebug(\"babel:config:loading:files:plugins\");\n\nconst EXACT_RE = /^module:/;\nconst BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\\/|babel-plugin-)/;\nconst BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\\/|babel-preset-)/;\nconst BABEL_PLUGIN_ORG_RE = /^(@babel\\/)(?!plugin-|[^/]+\\/)/;\nconst BABEL_PRESET_ORG_RE = /^(@babel\\/)(?!preset-|[^/]+\\/)/;\nconst OTHER_PLUGIN_ORG_RE =\n /^(@(?!babel\\/)[^/]+\\/)(?![^/]*babel-plugin(?:-|\\/|$)|[^/]+\\/)/;\nconst OTHER_PRESET_ORG_RE =\n /^(@(?!babel\\/)[^/]+\\/)(?![^/]*babel-preset(?:-|\\/|$)|[^/]+\\/)/;\nconst OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;\n\nexport const resolvePlugin = resolveStandardizedName.bind(null, \"plugin\");\nexport const resolvePreset = resolveStandardizedName.bind(null, \"preset\");\n\nexport function* loadPlugin(\n name: string,\n dirname: string,\n): Handler<{ filepath: string; value: unknown }> {\n const { filepath, loader } = resolvePlugin(name, dirname, yield* isAsync());\n\n const value = yield* requireModule(\"plugin\", loader, filepath);\n debug(\"Loaded plugin %o from %o.\", name, dirname);\n\n return { filepath, value };\n}\n\nexport function* loadPreset(\n name: string,\n dirname: string,\n): Handler<{ filepath: string; value: unknown }> {\n const { filepath, loader } = resolvePreset(name, dirname, yield* isAsync());\n\n const value = yield* requireModule(\"preset\", loader, filepath);\n\n debug(\"Loaded preset %o from %o.\", name, dirname);\n\n return { filepath, value };\n}\n\nfunction standardizeName(type: \"plugin\" | \"preset\", name: string) {\n // Let absolute and relative paths through.\n if (path.isAbsolute(name)) return name;\n\n const isPreset = type === \"preset\";\n\n return (\n name\n // foo -> babel-preset-foo\n .replace(\n isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE,\n `babel-${type}-`,\n )\n // @babel/es2015 -> @babel/preset-es2015\n .replace(\n isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE,\n `$1${type}-`,\n )\n // @foo/mypreset -> @foo/babel-preset-mypreset\n .replace(\n isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE,\n `$1babel-${type}-`,\n )\n // @foo -> @foo/babel-preset\n .replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`)\n // module:mypreset -> mypreset\n .replace(EXACT_RE, \"\")\n );\n}\n\ntype Result<T> = { error: Error; value: null } | { error: null; value: T };\n\nfunction* resolveAlternativesHelper(\n type: \"plugin\" | \"preset\",\n name: string,\n): Iterator<string, string, Result<string>> {\n const standardizedName = standardizeName(type, name);\n const { error, value } = yield standardizedName;\n if (!error) return value;\n\n // @ts-expect-error code may not index error\n if (error.code !== \"MODULE_NOT_FOUND\") throw error;\n\n if (standardizedName !== name && !(yield name).error) {\n error.message += `\\n- If you want to resolve \"${name}\", use \"module:${name}\"`;\n }\n\n if (!(yield standardizeName(type, \"@babel/\" + name)).error) {\n error.message += `\\n- Did you mean \"@babel/${name}\"?`;\n }\n\n const oppositeType = type === \"preset\" ? \"plugin\" : \"preset\";\n if (!(yield standardizeName(oppositeType, name)).error) {\n error.message += `\\n- Did you accidentally pass a ${oppositeType} as a ${type}?`;\n }\n\n if (type === \"plugin\") {\n const transformName = standardizedName.replace(\"-proposal-\", \"-transform-\");\n if (transformName !== standardizedName && !(yield transformName).error) {\n error.message += `\\n- Did you mean \"${transformName}\"?`;\n }\n }\n\n error.message += `\\n\nMake sure that all the Babel plugins and presets you are using\nare defined as dependencies or devDependencies in your package.json\nfile. It's possible that the missing plugin is loaded by a preset\nyou are using that forgot to add the plugin to its dependencies: you\ncan workaround this problem by explicitly adding the missing package\nto your top-level package.json.\n`;\n\n throw error;\n}\n\nfunction tryRequireResolve(\n id: string,\n dirname: string | undefined,\n): Result<string> {\n try {\n if (dirname) {\n return { error: null, value: require.resolve(id, { paths: [dirname] }) };\n } else {\n return { error: null, value: require.resolve(id) };\n }\n } catch (error) {\n return { error, value: null };\n }\n}\n\nfunction tryImportMetaResolve(\n id: Parameters<typeof importMetaResolve>[0],\n options: Parameters<typeof importMetaResolve>[1],\n): Result<string> {\n try {\n return { error: null, value: importMetaResolve(id, options) };\n } catch (error) {\n return { error, value: null };\n }\n}\n\nfunction resolveStandardizedNameForRequire(\n type: \"plugin\" | \"preset\",\n name: string,\n dirname: string,\n) {\n const it = resolveAlternativesHelper(type, name);\n let res = it.next();\n while (!res.done) {\n res = it.next(tryRequireResolve(res.value, dirname));\n }\n return { loader: \"require\" as const, filepath: res.value };\n}\nfunction resolveStandardizedNameForImport(\n type: \"plugin\" | \"preset\",\n name: string,\n dirname: string,\n) {\n const parentUrl = pathToFileURL(\n path.join(dirname, \"./babel-virtual-resolve-base.js\"),\n ).href;\n\n const it = resolveAlternativesHelper(type, name);\n let res = it.next();\n while (!res.done) {\n res = it.next(tryImportMetaResolve(res.value, parentUrl));\n }\n return { loader: \"auto\" as const, filepath: fileURLToPath(res.value) };\n}\n\nfunction resolveStandardizedName(\n type: \"plugin\" | \"preset\",\n name: string,\n dirname: string,\n allowAsync: boolean,\n) {\n if (!supportsESM || !allowAsync) {\n return resolveStandardizedNameForRequire(type, name, dirname);\n }\n\n try {\n const resolved = resolveStandardizedNameForImport(type, name, dirname);\n // import-meta-resolve 4.0 does not throw if the module is not found.\n if (!existsSync(resolved.filepath)) {\n throw Object.assign(\n new Error(`Could not resolve \"${name}\" in file ${dirname}.`),\n { type: \"MODULE_NOT_FOUND\" },\n );\n }\n return resolved;\n } catch (e) {\n try {\n return resolveStandardizedNameForRequire(type, name, dirname);\n } catch (e2) {\n if (e.type === \"MODULE_NOT_FOUND\") throw e;\n if (e2.type === \"MODULE_NOT_FOUND\") throw e2;\n throw e;\n }\n }\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var LOADING_MODULES = new Set();\n}\nfunction* requireModule(\n type: string,\n loader: \"require\" | \"auto\",\n name: string,\n): Handler<unknown> {\n if (!process.env.BABEL_8_BREAKING) {\n if (!(yield* isAsync()) && LOADING_MODULES.has(name)) {\n throw new Error(\n `Reentrant ${type} detected trying to load \"${name}\". This module is not ignored ` +\n \"and is trying to load itself while compiling itself, leading to a dependency cycle. \" +\n 'We recommend adding it to your \"ignore\" list in your babelrc, or to a .babelignore.',\n );\n }\n }\n\n try {\n if (!process.env.BABEL_8_BREAKING) {\n LOADING_MODULES.add(name);\n }\n\n if (process.env.BABEL_8_BREAKING) {\n return yield* loadCodeDefault(\n name,\n loader,\n `You appear to be using a native ECMAScript module ${type}, ` +\n \"which is only supported when running Babel asynchronously \" +\n \"or when using the Node.js `--experimental-require-module` flag.\",\n `You appear to be using a ${type} that contains top-level await, ` +\n \"which is only supported when running Babel asynchronously.\",\n );\n } else {\n return yield* loadCodeDefault(\n name,\n loader,\n `You appear to be using a native ECMAScript module ${type}, ` +\n \"which is only supported when running Babel asynchronously \" +\n \"or when using the Node.js `--experimental-require-module` flag.\",\n `You appear to be using a ${type} that contains top-level await, ` +\n \"which is only supported when running Babel asynchronously.\",\n // For backward compatibility, we need to support malformed presets\n // defined as separate named exports rather than a single default\n // export.\n // See packages/babel-core/test/fixtures/option-manager/presets/es2015_named.js\n // @ts-ignore(Babel 7 vs Babel 8) This param has been removed\n true,\n );\n }\n } catch (err) {\n err.message = `[BABEL]: ${err.message} (While processing: ${name})`;\n throw err;\n } finally {\n if (!process.env.BABEL_8_BREAKING) {\n LOADING_MODULES.delete(name);\n }\n }\n}\n"],"mappings":";;;;;;;;AAIA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAG,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,SAAAI,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAM,kBAAA,GAAAL,OAAA;AAEAA,OAAA;AACA,SAAAM,IAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,GAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,MAAMQ,KAAK,GAAGC,OAASA,CAAC,CAAC,oCAAoC,CAAC;AAE9D,MAAMC,QAAQ,GA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AAE,MAAMkD,CAAC;MAC1C,IAAIC,EAAE,CAACnD,IAAI,KAAK,kBAAkB,EAAE,MAAMmD,EAAE;MAC5C,MAAMD,CAAC;IACT;EACF;AACF;AAEmC;EAEjC,IAAIE,eAAe,GAAG,IAAIC,GAAG,CAAC,CAAC;AACjC;AACA,UAAUxD,aAAaA,CACrBG,IAAY,EACZN,MAA0B,EAC1BH,IAAY,EACM;EACiB;IACjC,IAAI,EAAE,OAAO,IAAAI,cAAO,EAAC,CAAC,CAAC,IAAIyD,eAAe,CAACE,GAAG,CAAC/D,IAAI,CAAC,EAAE;MACpD,MAAM,IAAIsC,KAAK,CACb,aAAa7B,IAAI,6BAA6BT,IAAI,gCAAgC,GAChF,sFAAsF,GACtF,qFACJ,CAAC;IACH;EACF;EAEA,IAAI;IACiC;MACjC6D,eAAe,CAACG,GAAG,CAAChE,IAAI,CAAC;IAC3B;IAYO;MACL,OAAO,OAAO,IAAAiE,oBAAe,EAC3BjE,IAAI,EACJG,MAAM,EACN,qDAAqDM,IAAI,IAAI,GAC3D,4DAA4D,GAC5D,iEAAiE,EACnE,4BAA4BA,IAAI,kCAAkC,GAChE,4DAA4D,EAM9D,IACF,CAAC;IACH;EACF,CAAC,CAAC,OAAOyD,GAAG,EAAE;IACZA,GAAG,CAAChD,OAAO,GAAG,YAAYgD,GAAG,CAAChD,OAAO,uBAAuBlB,IAAI,GAAG;IACnE,MAAMkE,GAAG;EACX,CAAC,SAAS;IAC2B;MACjCL,eAAe,CAACM,MAAM,CAACnE,IAAI,CAAC;IAC9B;EACF;AACF;AAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_debug","data","require","_path","_async","_moduleTypes","_url","_importMetaResolve","_fs","debug","buildDebug","EXACT_RE","BABEL_PLUGIN_PREFIX_RE","BABEL_PRESET_PREFIX_RE","BABEL_PLUGIN_ORG_RE","BABEL_PRESET_ORG_RE","OTHER_PLUGIN_ORG_RE","OTHER_PRESET_ORG_RE","OTHER_ORG_DEFAULT_RE","resolvePlugin","exports","resolveStandardizedName","bind","resolvePreset","loadPlugin","name","dirname","filepath","loader","isAsync","value","requireModule","loadPreset","standardizeName","type","path","isAbsolute","isPreset","replace","resolveAlternativesHelper","standardizedName","error","code","message","oppositeType","transformName","tryRequireResolve","id","v","w","split","process","versions","node","resolve","r","paths","b","M","f","_findPath","_nodeModulePaths","concat","Error","tryImportMetaResolve","options","importMetaResolve","resolveStandardizedNameForRequire","it","res","next","done","resolveStandardizedNameForImport","parentUrl","pathToFileURL","join","href","fileURLToPath","allowAsync","supportsESM","resolved","existsSync","Object","assign","e","e2","LOADING_MODULES","Set","has","add","loadCodeDefault","err","delete"],"sources":["../../../src/config/files/plugins.ts"],"sourcesContent":["/**\n * This file handles all logic for converting string-based configuration references into loaded objects.\n */\n\nimport buildDebug from \"debug\";\nimport path from \"path\";\nimport type { Handler } from \"gensync\";\nimport { isAsync } from \"../../gensync-utils/async.ts\";\nimport loadCodeDefault, { supportsESM } from \"./module-types.ts\";\nimport { fileURLToPath, pathToFileURL } from \"url\";\n\nimport { resolve as importMetaResolve } from \"../../vendor/import-meta-resolve.js\";\n\nimport { createRequire } from \"module\";\nimport { existsSync } from \"fs\";\nconst require = createRequire(import.meta.url);\n\nconst debug = buildDebug(\"babel:config:loading:files:plugins\");\n\nconst EXACT_RE = /^module:/;\nconst BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\\/|babel-plugin-)/;\nconst BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\\/|babel-preset-)/;\nconst BABEL_PLUGIN_ORG_RE = /^(@babel\\/)(?!plugin-|[^/]+\\/)/;\nconst BABEL_PRESET_ORG_RE = /^(@babel\\/)(?!preset-|[^/]+\\/)/;\nconst OTHER_PLUGIN_ORG_RE =\n /^(@(?!babel\\/)[^/]+\\/)(?![^/]*babel-plugin(?:-|\\/|$)|[^/]+\\/)/;\nconst OTHER_PRESET_ORG_RE =\n /^(@(?!babel\\/)[^/]+\\/)(?![^/]*babel-preset(?:-|\\/|$)|[^/]+\\/)/;\nconst OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;\n\nexport const resolvePlugin = resolveStandardizedName.bind(null, \"plugin\");\nexport const resolvePreset = resolveStandardizedName.bind(null, \"preset\");\n\nexport function* loadPlugin(\n name: string,\n dirname: string,\n): Handler<{ filepath: string; value: unknown }> {\n const { filepath, loader } = resolvePlugin(name, dirname, yield* isAsync());\n\n const value = yield* requireModule(\"plugin\", loader, filepath);\n debug(\"Loaded plugin %o from %o.\", name, dirname);\n\n return { filepath, value };\n}\n\nexport function* loadPreset(\n name: string,\n dirname: string,\n): Handler<{ filepath: string; value: unknown }> {\n const { filepath, loader } = resolvePreset(name, dirname, yield* isAsync());\n\n const value = yield* requireModule(\"preset\", loader, filepath);\n\n debug(\"Loaded preset %o from %o.\", name, dirname);\n\n return { filepath, value };\n}\n\nfunction standardizeName(type: \"plugin\" | \"preset\", name: string) {\n // Let absolute and relative paths through.\n if (path.isAbsolute(name)) return name;\n\n const isPreset = type === \"preset\";\n\n return (\n name\n // foo -> babel-preset-foo\n .replace(\n isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE,\n `babel-${type}-`,\n )\n // @babel/es2015 -> @babel/preset-es2015\n .replace(\n isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE,\n `$1${type}-`,\n )\n // @foo/mypreset -> @foo/babel-preset-mypreset\n .replace(\n isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE,\n `$1babel-${type}-`,\n )\n // @foo -> @foo/babel-preset\n .replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`)\n // module:mypreset -> mypreset\n .replace(EXACT_RE, \"\")\n );\n}\n\ntype Result<T> = { error: Error; value: null } | { error: null; value: T };\n\nfunction* resolveAlternativesHelper(\n type: \"plugin\" | \"preset\",\n name: string,\n): Iterator<string, string, Result<string>> {\n const standardizedName = standardizeName(type, name);\n const { error, value } = yield standardizedName;\n if (!error) return value;\n\n // @ts-expect-error code may not index error\n if (error.code !== \"MODULE_NOT_FOUND\") throw error;\n\n if (standardizedName !== name && !(yield name).error) {\n error.message += `\\n- If you want to resolve \"${name}\", use \"module:${name}\"`;\n }\n\n if (!(yield standardizeName(type, \"@babel/\" + name)).error) {\n error.message += `\\n- Did you mean \"@babel/${name}\"?`;\n }\n\n const oppositeType = type === \"preset\" ? \"plugin\" : \"preset\";\n if (!(yield standardizeName(oppositeType, name)).error) {\n error.message += `\\n- Did you accidentally pass a ${oppositeType} as a ${type}?`;\n }\n\n if (type === \"plugin\") {\n const transformName = standardizedName.replace(\"-proposal-\", \"-transform-\");\n if (transformName !== standardizedName && !(yield transformName).error) {\n error.message += `\\n- Did you mean \"${transformName}\"?`;\n }\n }\n\n error.message += `\\n\nMake sure that all the Babel plugins and presets you are using\nare defined as dependencies or devDependencies in your package.json\nfile. It's possible that the missing plugin is loaded by a preset\nyou are using that forgot to add the plugin to its dependencies: you\ncan workaround this problem by explicitly adding the missing package\nto your top-level package.json.\n`;\n\n throw error;\n}\n\nfunction tryRequireResolve(\n id: string,\n dirname: string | undefined,\n): Result<string> {\n try {\n if (dirname) {\n return { error: null, value: require.resolve(id, { paths: [dirname] }) };\n } else {\n return { error: null, value: require.resolve(id) };\n }\n } catch (error) {\n return { error, value: null };\n }\n}\n\nfunction tryImportMetaResolve(\n id: Parameters<typeof importMetaResolve>[0],\n options: Parameters<typeof importMetaResolve>[1],\n): Result<string> {\n try {\n return { error: null, value: importMetaResolve(id, options) };\n } catch (error) {\n return { error, value: null };\n }\n}\n\nfunction resolveStandardizedNameForRequire(\n type: \"plugin\" | \"preset\",\n name: string,\n dirname: string,\n) {\n const it = resolveAlternativesHelper(type, name);\n let res = it.next();\n while (!res.done) {\n res = it.next(tryRequireResolve(res.value, dirname));\n }\n return { loader: \"require\" as const, filepath: res.value };\n}\nfunction resolveStandardizedNameForImport(\n type: \"plugin\" | \"preset\",\n name: string,\n dirname: string,\n) {\n const parentUrl = pathToFileURL(\n path.join(dirname, \"./babel-virtual-resolve-base.js\"),\n ).href;\n\n const it = resolveAlternativesHelper(type, name);\n let res = it.next();\n while (!res.done) {\n res = it.next(tryImportMetaResolve(res.value, parentUrl));\n }\n return { loader: \"auto\" as const, filepath: fileURLToPath(res.value) };\n}\n\nfunction resolveStandardizedName(\n type: \"plugin\" | \"preset\",\n name: string,\n dirname: string,\n allowAsync: boolean,\n) {\n if (!supportsESM || !allowAsync) {\n return resolveStandardizedNameForRequire(type, name, dirname);\n }\n\n try {\n const resolved = resolveStandardizedNameForImport(type, name, dirname);\n // import-meta-resolve 4.0 does not throw if the module is not found.\n if (!existsSync(resolved.filepath)) {\n throw Object.assign(\n new Error(`Could not resolve \"${name}\" in file ${dirname}.`),\n { type: \"MODULE_NOT_FOUND\" },\n );\n }\n return resolved;\n } catch (e) {\n try {\n return resolveStandardizedNameForRequire(type, name, dirname);\n } catch (e2) {\n if (e.type === \"MODULE_NOT_FOUND\") throw e;\n if (e2.type === \"MODULE_NOT_FOUND\") throw e2;\n throw e;\n }\n }\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var LOADING_MODULES = new Set();\n}\nfunction* requireModule(\n type: string,\n loader: \"require\" | \"auto\",\n name: string,\n): Handler<unknown> {\n if (!process.env.BABEL_8_BREAKING) {\n if (!(yield* isAsync()) && LOADING_MODULES.has(name)) {\n throw new Error(\n `Reentrant ${type} detected trying to load \"${name}\". This module is not ignored ` +\n \"and is trying to load itself while compiling itself, leading to a dependency cycle. \" +\n 'We recommend adding it to your \"ignore\" list in your babelrc, or to a .babelignore.',\n );\n }\n }\n\n try {\n if (!process.env.BABEL_8_BREAKING) {\n LOADING_MODULES.add(name);\n }\n\n if (process.env.BABEL_8_BREAKING) {\n return yield* loadCodeDefault(\n name,\n loader,\n `You appear to be using a native ECMAScript module ${type}, ` +\n \"which is only supported when running Babel asynchronously \" +\n \"or when using the Node.js `--experimental-require-module` flag.\",\n `You appear to be using a ${type} that contains top-level await, ` +\n \"which is only supported when running Babel asynchronously.\",\n );\n } else {\n return yield* loadCodeDefault(\n name,\n loader,\n `You appear to be using a native ECMAScript module ${type}, ` +\n \"which is only supported when running Babel asynchronously \" +\n \"or when using the Node.js `--experimental-require-module` flag.\",\n `You appear to be using a ${type} that contains top-level await, ` +\n \"which is only supported when running Babel asynchronously.\",\n // For backward compatibility, we need to support malformed presets\n // defined as separate named exports rather than a single default\n // export.\n // See packages/babel-core/test/fixtures/option-manager/presets/es2015_named.js\n // @ts-ignore(Babel 7 vs Babel 8) This param has been removed\n true,\n );\n }\n } catch (err) {\n err.message = `[BABEL]: ${err.message} (While processing: ${name})`;\n throw err;\n } finally {\n if (!process.env.BABEL_8_BREAKING) {\n LOADING_MODULES.delete(name);\n }\n }\n}\n"],"mappings":";;;;;;;;AAIA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAG,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,SAAAI,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAM,kBAAA,GAAAL,OAAA;AAGA,SAAAM,IAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,GAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,MAAMQ,KAAK,GAAGC,OAASA,CAAC,CAAC,oCAAoC,CAAC;AAE9D,MAAMC,QAAQ,GAAG,UAAU;AA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,CAAC;MAC1C,IAAIC,EAAE,CAACnD,IAAI,KAAK,kBAAkB,EAAE,MAAMmD,EAAE;MAC5C,MAAMD,CAAC;IACT;EACF;AACF;AAEmC;EAEjC,IAAIE,eAAe,GAAG,IAAIC,GAAG,CAAC,CAAC;AACjC;AACA,UAAUxD,aAAaA,CACrBG,IAAY,EACZN,MAA0B,EAC1BH,IAAY,EACM;EACiB;IACjC,IAAI,EAAE,OAAO,IAAAI,cAAO,EAAC,CAAC,CAAC,IAAIyD,eAAe,CAACE,GAAG,CAAC/D,IAAI,CAAC,EAAE;MACpD,MAAM,IAAIsC,KAAK,CACb,aAAa7B,IAAI,6BAA6BT,IAAI,gCAAgC,GAChF,sFAAsF,GACtF,qFACJ,CAAC;IACH;EACF;EAEA,IAAI;IACiC;MACjC6D,eAAe,CAACG,GAAG,CAAChE,IAAI,CAAC;IAC3B;IAYO;MACL,OAAO,OAAO,IAAAiE,oBAAe,EAC3BjE,IAAI,EACJG,MAAM,EACN,qDAAqDM,IAAI,IAAI,GAC3D,4DAA4D,GAC5D,iEAAiE,EACnE,4BAA4BA,IAAI,kCAAkC,GAChE,4DAA4D,EAM9D,IACF,CAAC;IACH;EACF,CAAC,CAAC,OAAOyD,GAAG,EAAE;IACZA,GAAG,CAAChD,OAAO,GAAG,YAAYgD,GAAG,CAAChD,OAAO,uBAAuBlB,IAAI,GAAG;IACnE,MAAMkE,GAAG;EACX,CAAC,SAAS;IAC2B;MACjCL,eAAe,CAACM,MAAM,CAACnE,IAAI,CAAC;IAC9B;EACF;AACF;AAAC","ignoreList":[]}
|
@@ -21,7 +21,7 @@ var _options = require("./validation/options.js");
|
|
21
21
|
var _index = require("./files/index.js");
|
22
22
|
var _resolveTargets = require("./resolve-targets.js");
|
23
23
|
const _excluded = ["showIgnoredFiles"];
|
24
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (
|
24
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
25
25
|
function resolveRootMode(rootDir, rootMode) {
|
26
26
|
switch (rootMode) {
|
27
27
|
case "root":
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","require","_plugin","_util","_item","_configChain","_environment","_options","_index","_resolveTargets","_excluded","_objectWithoutPropertiesLoose","r","e","t","n","hasOwnProperty","call","indexOf","resolveRootMode","rootDir","rootMode","upwardRootDir","findConfigUpwards","Object","assign","Error","ROOT_CONFIG_FILENAMES","join","code","dirname","loadPrivatePartialConfig","inputOpts","Array","isArray","args","validate","envName","getEnv","cwd","root","caller","cloneInputAst","absoluteCwd","path","resolve","absoluteRootDir","filename","undefined","showConfigPath","resolveShowConfigPath","context","showConfig","configChain","buildRootChain","merged","assumptions","options","forEach","opts","mergeOptions","targets","resolveTargets","babelrc","configFile","browserslistConfigFile","passPerPreset","plugins","map","descriptor","createItemFromDescriptor","presets","fileHandling","ignore","config","files","loadPartialConfig","showIgnoredFiles","_opts","result","item","value","Plugin","PartialConfig","filepath","constructor","babelignore","freeze","hasFilesystemConfig","prototype"],"sources":["../../src/config/partial.ts"],"sourcesContent":["import path from \"path\";\nimport type { Handler } from \"gensync\";\nimport Plugin from \"./plugin.ts\";\nimport { mergeOptions } from \"./util.ts\";\nimport { createItemFromDescriptor } from \"./item.ts\";\nimport { buildRootChain } from \"./config-chain.ts\";\nimport type { ConfigContext, FileHandling } from \"./config-chain.ts\";\nimport { getEnv } from \"./helpers/environment.ts\";\nimport { validate } from \"./validation/options.ts\";\n\nimport type {\n ValidatedOptions,\n NormalizedOptions,\n RootMode,\n InputOptions,\n} from \"./validation/options.ts\";\n\nimport {\n findConfigUpwards,\n resolveShowConfigPath,\n ROOT_CONFIG_FILENAMES,\n} from \"./files/index.ts\";\nimport type { ConfigFile, IgnoreFile } from \"./files/index.ts\";\nimport { resolveTargets } from \"./resolve-targets.ts\";\n\nfunction resolveRootMode(rootDir: string, rootMode: RootMode): string {\n switch (rootMode) {\n case \"root\":\n return rootDir;\n\n case \"upward-optional\": {\n const upwardRootDir = findConfigUpwards(rootDir);\n return upwardRootDir === null ? rootDir : upwardRootDir;\n }\n\n case \"upward\": {\n const upwardRootDir = findConfigUpwards(rootDir);\n if (upwardRootDir !== null) return upwardRootDir;\n\n throw Object.assign(\n new Error(\n `Babel was run with rootMode:\"upward\" but a root could not ` +\n `be found when searching upward from \"${rootDir}\".\\n` +\n `One of the following config files must be in the directory tree: ` +\n `\"${ROOT_CONFIG_FILENAMES.join(\", \")}\".`,\n ) as any,\n {\n code: \"BABEL_ROOT_NOT_FOUND\",\n dirname: rootDir,\n },\n );\n }\n default:\n throw new Error(`Assertion failure - unknown rootMode value.`);\n }\n}\n\nexport type PrivPartialConfig = {\n showIgnoredFiles?: boolean;\n options: NormalizedOptions;\n context: ConfigContext;\n babelrc: ConfigFile | void;\n config: ConfigFile | void;\n ignore: IgnoreFile | void;\n fileHandling: FileHandling;\n files: Set<string>;\n};\n\nexport default function* loadPrivatePartialConfig(\n inputOpts: InputOptions,\n): Handler<PrivPartialConfig | null> {\n if (\n inputOpts != null &&\n (typeof inputOpts !== \"object\" || Array.isArray(inputOpts))\n ) {\n throw new Error(\"Babel options must be an object, null, or undefined\");\n }\n\n const args = inputOpts ? validate(\"arguments\", inputOpts) : {};\n\n const {\n envName = getEnv(),\n cwd = \".\",\n root: rootDir = \".\",\n rootMode = \"root\",\n caller,\n cloneInputAst = true,\n } = args;\n const absoluteCwd = path.resolve(cwd);\n const absoluteRootDir = resolveRootMode(\n path.resolve(absoluteCwd, rootDir),\n rootMode,\n );\n\n const filename =\n typeof args.filename === \"string\"\n ? path.resolve(cwd, args.filename)\n : undefined;\n\n const showConfigPath = yield* resolveShowConfigPath(absoluteCwd);\n\n const context: ConfigContext = {\n filename,\n cwd: absoluteCwd,\n root: absoluteRootDir,\n envName,\n caller,\n showConfig: showConfigPath === filename,\n };\n\n const configChain = yield* buildRootChain(args, context);\n if (!configChain) return null;\n\n const merged: ValidatedOptions = {\n assumptions: {},\n };\n configChain.options.forEach(opts => {\n mergeOptions(merged as any, opts);\n });\n\n const options: NormalizedOptions = {\n ...merged,\n targets: resolveTargets(merged, absoluteRootDir),\n\n // Tack the passes onto the object itself so that, if this object is\n // passed back to Babel a second time, it will be in the right structure\n // to not change behavior.\n cloneInputAst,\n babelrc: false,\n configFile: false,\n browserslistConfigFile: false,\n passPerPreset: false,\n envName: context.envName,\n cwd: context.cwd,\n root: context.root,\n rootMode: \"root\",\n filename:\n typeof context.filename === \"string\" ? context.filename : undefined,\n\n plugins: configChain.plugins.map(descriptor =>\n createItemFromDescriptor(descriptor),\n ),\n presets: configChain.presets.map(descriptor =>\n createItemFromDescriptor(descriptor),\n ),\n };\n\n return {\n options,\n context,\n fileHandling: configChain.fileHandling,\n ignore: configChain.ignore,\n babelrc: configChain.babelrc,\n config: configChain.config,\n files: configChain.files,\n };\n}\n\nexport function* loadPartialConfig(\n opts?: InputOptions,\n): Handler<PartialConfig | null> {\n let showIgnoredFiles = false;\n // We only extract showIgnoredFiles if opts is an object, so that\n // loadPrivatePartialConfig can throw the appropriate error if it's not.\n if (typeof opts === \"object\" && opts !== null && !Array.isArray(opts)) {\n ({ showIgnoredFiles, ...opts } = opts);\n }\n\n const result: PrivPartialConfig | undefined | null =\n yield* loadPrivatePartialConfig(opts);\n if (!result) return null;\n\n const { options, babelrc, ignore, config, fileHandling, files } = result;\n\n if (fileHandling === \"ignored\" && !showIgnoredFiles) {\n return null;\n }\n\n (options.plugins || []).forEach(item => {\n // @ts-expect-error todo(flow->ts): better type annotation for `item.value`\n if (item.value instanceof Plugin) {\n throw new Error(\n \"Passing cached plugin instances is not supported in \" +\n \"babel.loadPartialConfig()\",\n );\n }\n });\n\n return new PartialConfig(\n options,\n babelrc ? babelrc.filepath : undefined,\n ignore ? ignore.filepath : undefined,\n config ? config.filepath : undefined,\n fileHandling,\n files,\n );\n}\n\nexport type { PartialConfig };\n\nclass PartialConfig {\n /**\n * These properties are public, so any changes to them should be considered\n * a breaking change to Babel's API.\n */\n options: NormalizedOptions;\n babelrc: string | void;\n babelignore: string | void;\n config: string | void;\n fileHandling: FileHandling;\n files: Set<string>;\n\n constructor(\n options: NormalizedOptions,\n babelrc: string | void,\n ignore: string | void,\n config: string | void,\n fileHandling: FileHandling,\n files: Set<string>,\n ) {\n this.options = options;\n this.babelignore = ignore;\n this.babelrc = babelrc;\n this.config = config;\n this.fileHandling = fileHandling;\n this.files = files;\n\n // Freeze since this is a public API and it should be extremely obvious that\n // reassigning properties on here does nothing.\n Object.freeze(this);\n }\n\n /**\n * Returns true if there is a config file in the filesystem for this config.\n */\n hasFilesystemConfig(): boolean {\n return this.babelrc !== undefined || this.config !== undefined;\n }\n}\nObject.freeze(PartialConfig.prototype);\n"],"mappings":";;;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AASA,IAAAO,MAAA,GAAAP,OAAA;AAMA,IAAAQ,eAAA,GAAAR,OAAA;AAAsD,MAAAS,SAAA;AAAA,SAAAC,8BAAAC,CAAA,EAAAC,CAAA,gBAAAD,CAAA,iBAAAE,CAAA,gBAAAC,CAAA,IAAAH,CAAA,SAAAI,cAAA,CAAAC,IAAA,CAAAL,CAAA,EAAAG,CAAA,gBAAAF,CAAA,CAAAK,OAAA,CAAAH,CAAA,aAAAD,CAAA,CAAAC,CAAA,IAAAH,CAAA,CAAAG,CAAA,YAAAD,CAAA;AAEtD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":3,"names":["_path","data","require","_plugin","_util","_item","_configChain","_environment","_options","_index","_resolveTargets","_excluded","_objectWithoutPropertiesLoose","r","e","t","n","hasOwnProperty","call","includes","resolveRootMode","rootDir","rootMode","upwardRootDir","findConfigUpwards","Object","assign","Error","ROOT_CONFIG_FILENAMES","join","code","dirname","loadPrivatePartialConfig","inputOpts","Array","isArray","args","validate","envName","getEnv","cwd","root","caller","cloneInputAst","absoluteCwd","path","resolve","absoluteRootDir","filename","undefined","showConfigPath","resolveShowConfigPath","context","showConfig","configChain","buildRootChain","merged","assumptions","options","forEach","opts","mergeOptions","targets","resolveTargets","babelrc","configFile","browserslistConfigFile","passPerPreset","plugins","map","descriptor","createItemFromDescriptor","presets","fileHandling","ignore","config","files","loadPartialConfig","showIgnoredFiles","_opts","result","item","value","Plugin","PartialConfig","filepath","constructor","babelignore","freeze","hasFilesystemConfig","prototype"],"sources":["../../src/config/partial.ts"],"sourcesContent":["import path from \"path\";\nimport type { Handler } from \"gensync\";\nimport Plugin from \"./plugin.ts\";\nimport { mergeOptions } from \"./util.ts\";\nimport { createItemFromDescriptor } from \"./item.ts\";\nimport { buildRootChain } from \"./config-chain.ts\";\nimport type { ConfigContext, FileHandling } from \"./config-chain.ts\";\nimport { getEnv } from \"./helpers/environment.ts\";\nimport { validate } from \"./validation/options.ts\";\n\nimport type {\n ValidatedOptions,\n NormalizedOptions,\n RootMode,\n InputOptions,\n} from \"./validation/options.ts\";\n\nimport {\n findConfigUpwards,\n resolveShowConfigPath,\n ROOT_CONFIG_FILENAMES,\n} from \"./files/index.ts\";\nimport type { ConfigFile, IgnoreFile } from \"./files/index.ts\";\nimport { resolveTargets } from \"./resolve-targets.ts\";\n\nfunction resolveRootMode(rootDir: string, rootMode: RootMode): string {\n switch (rootMode) {\n case \"root\":\n return rootDir;\n\n case \"upward-optional\": {\n const upwardRootDir = findConfigUpwards(rootDir);\n return upwardRootDir === null ? rootDir : upwardRootDir;\n }\n\n case \"upward\": {\n const upwardRootDir = findConfigUpwards(rootDir);\n if (upwardRootDir !== null) return upwardRootDir;\n\n throw Object.assign(\n new Error(\n `Babel was run with rootMode:\"upward\" but a root could not ` +\n `be found when searching upward from \"${rootDir}\".\\n` +\n `One of the following config files must be in the directory tree: ` +\n `\"${ROOT_CONFIG_FILENAMES.join(\", \")}\".`,\n ) as any,\n {\n code: \"BABEL_ROOT_NOT_FOUND\",\n dirname: rootDir,\n },\n );\n }\n default:\n throw new Error(`Assertion failure - unknown rootMode value.`);\n }\n}\n\nexport type PrivPartialConfig = {\n showIgnoredFiles?: boolean;\n options: NormalizedOptions;\n context: ConfigContext;\n babelrc: ConfigFile | void;\n config: ConfigFile | void;\n ignore: IgnoreFile | void;\n fileHandling: FileHandling;\n files: Set<string>;\n};\n\nexport default function* loadPrivatePartialConfig(\n inputOpts: InputOptions,\n): Handler<PrivPartialConfig | null> {\n if (\n inputOpts != null &&\n (typeof inputOpts !== \"object\" || Array.isArray(inputOpts))\n ) {\n throw new Error(\"Babel options must be an object, null, or undefined\");\n }\n\n const args = inputOpts ? validate(\"arguments\", inputOpts) : {};\n\n const {\n envName = getEnv(),\n cwd = \".\",\n root: rootDir = \".\",\n rootMode = \"root\",\n caller,\n cloneInputAst = true,\n } = args;\n const absoluteCwd = path.resolve(cwd);\n const absoluteRootDir = resolveRootMode(\n path.resolve(absoluteCwd, rootDir),\n rootMode,\n );\n\n const filename =\n typeof args.filename === \"string\"\n ? path.resolve(cwd, args.filename)\n : undefined;\n\n const showConfigPath = yield* resolveShowConfigPath(absoluteCwd);\n\n const context: ConfigContext = {\n filename,\n cwd: absoluteCwd,\n root: absoluteRootDir,\n envName,\n caller,\n showConfig: showConfigPath === filename,\n };\n\n const configChain = yield* buildRootChain(args, context);\n if (!configChain) return null;\n\n const merged: ValidatedOptions = {\n assumptions: {},\n };\n configChain.options.forEach(opts => {\n mergeOptions(merged as any, opts);\n });\n\n const options: NormalizedOptions = {\n ...merged,\n targets: resolveTargets(merged, absoluteRootDir),\n\n // Tack the passes onto the object itself so that, if this object is\n // passed back to Babel a second time, it will be in the right structure\n // to not change behavior.\n cloneInputAst,\n babelrc: false,\n configFile: false,\n browserslistConfigFile: false,\n passPerPreset: false,\n envName: context.envName,\n cwd: context.cwd,\n root: context.root,\n rootMode: \"root\",\n filename:\n typeof context.filename === \"string\" ? context.filename : undefined,\n\n plugins: configChain.plugins.map(descriptor =>\n createItemFromDescriptor(descriptor),\n ),\n presets: configChain.presets.map(descriptor =>\n createItemFromDescriptor(descriptor),\n ),\n };\n\n return {\n options,\n context,\n fileHandling: configChain.fileHandling,\n ignore: configChain.ignore,\n babelrc: configChain.babelrc,\n config: configChain.config,\n files: configChain.files,\n };\n}\n\nexport function* loadPartialConfig(\n opts?: InputOptions,\n): Handler<PartialConfig | null> {\n let showIgnoredFiles = false;\n // We only extract showIgnoredFiles if opts is an object, so that\n // loadPrivatePartialConfig can throw the appropriate error if it's not.\n if (typeof opts === \"object\" && opts !== null && !Array.isArray(opts)) {\n ({ showIgnoredFiles, ...opts } = opts);\n }\n\n const result: PrivPartialConfig | undefined | null =\n yield* loadPrivatePartialConfig(opts);\n if (!result) return null;\n\n const { options, babelrc, ignore, config, fileHandling, files } = result;\n\n if (fileHandling === \"ignored\" && !showIgnoredFiles) {\n return null;\n }\n\n (options.plugins || []).forEach(item => {\n // @ts-expect-error todo(flow->ts): better type annotation for `item.value`\n if (item.value instanceof Plugin) {\n throw new Error(\n \"Passing cached plugin instances is not supported in \" +\n \"babel.loadPartialConfig()\",\n );\n }\n });\n\n return new PartialConfig(\n options,\n babelrc ? babelrc.filepath : undefined,\n ignore ? ignore.filepath : undefined,\n config ? config.filepath : undefined,\n fileHandling,\n files,\n );\n}\n\nexport type { PartialConfig };\n\nclass PartialConfig {\n /**\n * These properties are public, so any changes to them should be considered\n * a breaking change to Babel's API.\n */\n options: NormalizedOptions;\n babelrc: string | void;\n babelignore: string | void;\n config: string | void;\n fileHandling: FileHandling;\n files: Set<string>;\n\n constructor(\n options: NormalizedOptions,\n babelrc: string | void,\n ignore: string | void,\n config: string | void,\n fileHandling: FileHandling,\n files: Set<string>,\n ) {\n this.options = options;\n this.babelignore = ignore;\n this.babelrc = babelrc;\n this.config = config;\n this.fileHandling = fileHandling;\n this.files = files;\n\n // Freeze since this is a public API and it should be extremely obvious that\n // reassigning properties on here does nothing.\n Object.freeze(this);\n }\n\n /**\n * Returns true if there is a config file in the filesystem for this config.\n */\n hasFilesystemConfig(): boolean {\n return this.babelrc !== undefined || this.config !== undefined;\n }\n}\nObject.freeze(PartialConfig.prototype);\n"],"mappings":";;;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AASA,IAAAO,MAAA,GAAAP,OAAA;AAMA,IAAAQ,eAAA,GAAAR,OAAA;AAAsD,MAAAS,SAAA;AAAA,SAAAC,8BAAAC,CAAA,EAAAC,CAAA,gBAAAD,CAAA,iBAAAE,CAAA,gBAAAC,CAAA,IAAAH,CAAA,SAAAI,cAAA,CAAAC,IAAA,CAAAL,CAAA,EAAAG,CAAA,SAAAF,CAAA,CAAAK,QAAA,CAAAH,CAAA,aAAAD,CAAA,CAAAC,CAAA,IAAAH,CAAA,CAAAG,CAAA,YAAAD,CAAA;AAEtD,SAASK,eAAeA,CAACC,OAAe,EAAEC,QAAkB,EAAU;EACpE,QAAQA,QAAQ;IACd,KAAK,MAAM;MACT,OAAOD,OAAO;IAEhB,KAAK,iBAAiB;MAAE;QACtB,MAAME,aAAa,GAAG,IAAAC,wBAAiB,EAACH,OAAO,CAAC;QAChD,OAAOE,aAAa,K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BACJ,CAAC;IACH;EACF,CAAC,CAAC;EAEF,OAAO,IAAIyD,aAAa,CACtB1B,OAAO,EACPM,OAAO,GAAGA,OAAO,CAACqB,QAAQ,GAAGpC,SAAS,EACtCyB,MAAM,GAAGA,MAAM,CAACW,QAAQ,GAAGpC,SAAS,EACpC0B,MAAM,GAAGA,MAAM,CAACU,QAAQ,GAAGpC,SAAS,EACpCwB,YAAY,EACZG,KACF,CAAC;AACH;AAIA,MAAMQ,aAAa,CAAC;EAYlBE,WAAWA,CACT5B,OAA0B,EAC1BM,OAAsB,EACtBU,MAAqB,EACrBC,MAAqB,EACrBF,YAA0B,EAC1BG,KAAkB,EAClB;IAAA,KAdFlB,OAAO;IAAA,KACPM,OAAO;IAAA,KACPuB,WAAW;IAAA,KACXZ,MAAM;IAAA,KACNF,YAAY;IAAA,KACZG,KAAK;IAUH,IAAI,CAAClB,OAAO,GAAGA,OAAO;IACtB,IAAI,CAAC6B,WAAW,GAAGb,MAAM;IACzB,IAAI,CAACV,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACW,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACF,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACG,KAAK,GAAGA,KAAK;IAIlBnD,MAAM,CAAC+D,MAAM,CAAC,IAAI,CAAC;EACrB;EAKAC,mBAAmBA,CAAA,EAAY;IAC7B,OAAO,IAAI,CAACzB,OAAO,KAAKf,SAAS,IAAI,IAAI,CAAC0B,MAAM,KAAK1B,SAAS;EAChE;AACF;AACAxB,MAAM,CAAC+D,MAAM,CAACJ,aAAa,CAACM,SAAS,CAAC;AAAC","ignoreList":[]}
|
@@ -211,8 +211,9 @@ var _transform = require("./transform.js");
|
|
211
211
|
var _transformFile = require("./transform-file.js");
|
212
212
|
var _transformAst = require("./transform-ast.js");
|
213
213
|
var _parse = require("./parse.js");
|
214
|
+
var thisFile = require("./index.js");
|
214
215
|
;
|
215
|
-
const version = exports.version = "7.26.
|
216
|
+
const version = exports.version = "7.26.0";
|
216
217
|
const resolvePlugin = (name, dirname) => resolvers.resolvePlugin(name, dirname, false).filepath;
|
217
218
|
exports.resolvePlugin = resolvePlugin;
|
218
219
|
const resolvePreset = (name, dirname) => resolvers.resolvePreset(name, dirname, false).filepath;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_file","require","_buildExternalHelpers","resolvers","_environment","_types","data","Object","defineProperty","exports","enumerable","get","_parser","_traverse","_template","_index2","_transform","_transformFile","_transformAst","_parse","version","resolvePlugin","name","dirname","filepath","resolvePreset","DEFAULT_EXTENSIONS","freeze","OptionManager","init","opts","loadOptionsSync","Plugin","alias","Error","types","traverse","tokTypes","template"],"sources":["../src/index.ts"],"sourcesContent":["if (!process.env.IS_PUBLISH && !USE_ESM && process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"BABEL_8_BREAKING is only supported in ESM. Please run `make use-esm`.\",\n );\n}\n\nexport const version = PACKAGE_JSON.version;\n\nexport { default as File } from \"./transformation/file/file.ts\";\nexport type { default as PluginPass } from \"./transformation/plugin-pass.ts\";\nexport { default as buildExternalHelpers } from \"./tools/build-external-helpers.ts\";\n\nimport * as resolvers from \"./config/files/index.ts\";\n// For backwards-compatibility, we expose the resolvers\n// with the old API.\nexport const resolvePlugin = (name: string, dirname: string) =>\n resolvers.resolvePlugin(name, dirname, false).filepath;\nexport const resolvePreset = (name: string, dirname: string) =>\n resolvers.resolvePreset(name, dirname, false).filepath;\n\nexport { getEnv } from \"./config/helpers/environment.ts\";\n\n// NOTE: Lazy re-exports aren't detected by the Node.js CJS-ESM interop.\n// These are handled by pluginInjectNodeReexportsHints in our babel.config.js\n// so that they can work well.\nexport * as types from \"@babel/types\";\nexport { tokTypes } from \"@babel/parser\";\nexport { default as traverse } from \"@babel/traverse\";\nexport { default as template } from \"@babel/template\";\n\n// rollup-plugin-dts assumes that all re-exported types are also valid values\n// Visitor is only a type, so we need to use this workaround to prevent\n// rollup-plugin-dts from breaking it.\n// TODO: Figure out how to fix this upstream.\nexport type { NodePath, Scope } from \"@babel/traverse\";\nexport type Visitor<S = unknown> = import(\"@babel/traverse\").Visitor<S>;\n\nexport {\n createConfigItem,\n createConfigItemAsync,\n createConfigItemSync,\n} from \"./config/index.ts\";\n\nexport {\n loadOptions,\n loadOptionsAsync,\n loadPartialConfig,\n loadPartialConfigAsync,\n loadPartialConfigSync,\n} from \"./config/index.ts\";\nimport { loadOptionsSync } from \"./config/index.ts\";\nexport { loadOptionsSync };\n\nexport type {\n CallerMetadata,\n ConfigItem,\n InputOptions,\n PluginAPI,\n PluginObject,\n PresetAPI,\n PresetObject,\n} from \"./config/index.ts\";\n\nexport {\n type FileResult,\n transform,\n transformAsync,\n transformSync,\n} from \"./transform.ts\";\nexport {\n transformFile,\n transformFileAsync,\n transformFileSync,\n} from \"./transform-file.ts\";\nexport {\n transformFromAst,\n transformFromAstAsync,\n transformFromAstSync,\n} from \"./transform-ast.ts\";\nexport { parse, parseAsync, parseSync } from \"./parse.ts\";\n\n/**\n * Recommended set of compilable extensions. Not used in @babel/core directly, but meant as\n * as an easy source for tooling making use of @babel/core.\n */\nexport const DEFAULT_EXTENSIONS = Object.freeze([\n \".js\",\n \".jsx\",\n \".es6\",\n \".es\",\n \".mjs\",\n \".cjs\",\n] as const);\n\nimport Module from \"module\"
|
1
|
+
{"version":3,"names":["_file","require","_buildExternalHelpers","resolvers","_environment","_types","data","Object","defineProperty","exports","enumerable","get","_parser","_traverse","_template","_index2","_transform","_transformFile","_transformAst","_parse","thisFile","version","resolvePlugin","name","dirname","filepath","resolvePreset","DEFAULT_EXTENSIONS","freeze","OptionManager","init","opts","loadOptionsSync","Plugin","alias","Error","types","traverse","tokTypes","template"],"sources":["../src/index.ts"],"sourcesContent":["if (!process.env.IS_PUBLISH && !USE_ESM && process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"BABEL_8_BREAKING is only supported in ESM. Please run `make use-esm`.\",\n );\n}\n\nexport const version = PACKAGE_JSON.version;\n\nexport { default as File } from \"./transformation/file/file.ts\";\nexport type { default as PluginPass } from \"./transformation/plugin-pass.ts\";\nexport { default as buildExternalHelpers } from \"./tools/build-external-helpers.ts\";\n\nimport * as resolvers from \"./config/files/index.ts\";\n// For backwards-compatibility, we expose the resolvers\n// with the old API.\nexport const resolvePlugin = (name: string, dirname: string) =>\n resolvers.resolvePlugin(name, dirname, false).filepath;\nexport const resolvePreset = (name: string, dirname: string) =>\n resolvers.resolvePreset(name, dirname, false).filepath;\n\nexport { getEnv } from \"./config/helpers/environment.ts\";\n\n// NOTE: Lazy re-exports aren't detected by the Node.js CJS-ESM interop.\n// These are handled by pluginInjectNodeReexportsHints in our babel.config.js\n// so that they can work well.\nexport * as types from \"@babel/types\";\nexport { tokTypes } from \"@babel/parser\";\nexport { default as traverse } from \"@babel/traverse\";\nexport { default as template } from \"@babel/template\";\n\n// rollup-plugin-dts assumes that all re-exported types are also valid values\n// Visitor is only a type, so we need to use this workaround to prevent\n// rollup-plugin-dts from breaking it.\n// TODO: Figure out how to fix this upstream.\nexport type { NodePath, Scope } from \"@babel/traverse\";\nexport type Visitor<S = unknown> = import(\"@babel/traverse\").Visitor<S>;\n\nexport {\n createConfigItem,\n createConfigItemAsync,\n createConfigItemSync,\n} from \"./config/index.ts\";\n\nexport {\n loadOptions,\n loadOptionsAsync,\n loadPartialConfig,\n loadPartialConfigAsync,\n loadPartialConfigSync,\n} from \"./config/index.ts\";\nimport { loadOptionsSync } from \"./config/index.ts\";\nexport { loadOptionsSync };\n\nexport type {\n CallerMetadata,\n ConfigItem,\n InputOptions,\n PluginAPI,\n PluginObject,\n PresetAPI,\n PresetObject,\n} from \"./config/index.ts\";\n\nexport {\n type FileResult,\n transform,\n transformAsync,\n transformSync,\n} from \"./transform.ts\";\nexport {\n transformFile,\n transformFileAsync,\n transformFileSync,\n} from \"./transform-file.ts\";\nexport {\n transformFromAst,\n transformFromAstAsync,\n transformFromAstSync,\n} from \"./transform-ast.ts\";\nexport { parse, parseAsync, parseSync } from \"./parse.ts\";\n\n/**\n * Recommended set of compilable extensions. Not used in @babel/core directly, but meant as\n * as an easy source for tooling making use of @babel/core.\n */\nexport const DEFAULT_EXTENSIONS = Object.freeze([\n \".js\",\n \".jsx\",\n \".es6\",\n \".es\",\n \".mjs\",\n \".cjs\",\n] as const);\n\nimport Module from \"module\";\nimport * as thisFile from \"./index.ts\";\nif (USE_ESM && !IS_STANDALONE) {\n // Pass this module to the CJS proxy, so that it can be synchronously accessed.\n const cjsProxy = Module.createRequire(import.meta.url)(\"../cjs-proxy.cjs\");\n cjsProxy[\"__ initialize @babel/core cjs proxy __\"] = thisFile;\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n // For easier backward-compatibility, provide an API like the one we exposed in Babel 6.\n // eslint-disable-next-line no-restricted-globals\n exports.OptionManager = class OptionManager {\n init(opts: any) {\n return loadOptionsSync(opts);\n }\n };\n\n // eslint-disable-next-line no-restricted-globals\n exports.Plugin = function Plugin(alias: string) {\n throw new Error(\n `The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`,\n );\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAQA,IAAAG,YAAA,GAAAH,OAAA;AAAyD,SAAAI,OAAA;EAAA,MAAAC,IAAA,GAAAL,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAAC,MAAA,CAAAC,cAAA,KAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,MAAA;EAAA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AMA,aAAa,CAAC;IAC1CC,IAAIA,CAACC,IAAS,EAAE;MACd,OAAO,IAAAC,uBAAe,EAACD,IAAI,CAAC;IAC9B;EACF,CAAC;EAGDtB,OAAO,CAACwB,MAAM,GAAG,SAASA,MAAMA,CAACC,KAAa,EAAE;IAC9C,MAAM,IAAIC,KAAK,CACb,QAAQD,KAAK,kEACf,CAAC;EACH,CAAC;AACH;AAAC,MAAAzB,OAAA,CAAA2B,KAAA,GAAA3B,OAAA,CAAA4B,QAAA,GAAA5B,OAAA,CAAA6B,QAAA,GAAA7B,OAAA,CAAA8B,QAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_parser","data","require","_codeFrame","_missingPluginHelper","parser","pluginPasses","parserOpts","highlightCode","filename","code","results","plugins","plugin","parserOverride","ast","parse","undefined","push","length","then","Error","err","message","loc","missingPlugin","codeFrame","codeFrameColumns","start","line","column","generateMissingPluginMessage"],"sources":["../../src/parser/index.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\nimport { parse, type ParseResult } from \"@babel/parser\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport generateMissingPluginMessage from \"./util/missing-plugin-helper.ts\";\nimport type { PluginPasses } from \"../config/index.ts\";\n\nexport type { ParseResult };\n\nexport default function* parser(\n pluginPasses: PluginPasses,\n { parserOpts, highlightCode = true, filename = \"unknown\" }: any,\n code: string,\n): Handler<ParseResult> {\n try {\n const results = [];\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const { parserOverride } = plugin;\n if (parserOverride) {\n const ast = parserOverride(code, parserOpts, parse);\n\n if (ast !== undefined) results.push(ast);\n }\n }\n }\n\n if (results.length === 0) {\n return parse(code, parserOpts);\n } else if (results.length === 1) {\n // If we want to allow async parsers\n yield* [];\n if (typeof results[0].then === \"function\") {\n throw new Error(\n `You appear to be using an async parser plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n return results[0];\n }\n // TODO: Add an error code\n throw new Error(\"More than one plugin attempted to override parsing.\");\n } catch (err) {\n if (err.code === \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\") {\n err.message +=\n \"\\nConsider renaming the file to '.mjs', or setting sourceType:module \" +\n \"or sourceType:unambiguous in your Babel config for this file.\";\n // err.code will be changed to BABEL_PARSE_ERROR later.\n }\n\n const { loc, missingPlugin } = err;\n if (loc) {\n const codeFrame = codeFrameColumns(\n code,\n {\n start: {\n line: loc.line,\n column: loc.column + 1,\n },\n },\n {\n highlightCode,\n },\n );\n if (missingPlugin) {\n err.message =\n `${filename}: ` +\n generateMissingPluginMessage(\n missingPlugin[0],\n loc,\n codeFrame,\n filename,\n );\n } else {\n err.message = `${filename}: ${err.message}\\n\\n` + codeFrame;\n }\n err.code = \"BABEL_PARSE_ERROR\";\n }\n throw err;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,IAAAG,oBAAA,GAAAF,OAAA;AAKe,UAAUG,MAAMA,CAC7BC,YAA0B,EAC1B;EAAEC,UAAU;EAAEC,aAAa,GAAG,IAAI;EAAEC,QAAQ,GAAG;AAAe,CAAC,EAC/DC,IAAY,EACU;EACtB,IAAI;IACF,MAAMC,OAAO,GAAG,EAAE;IAClB,KAAK,MAAMC,OAAO,IAAIN,YAAY,EAAE;MAClC,KAAK,MAAMO,MAAM,IAAID,OAAO,EAAE;QAC5B,MAAM;UAAEE;QAAe,CAAC,GAAGD,MAAM;QACjC,IAAIC,cAAc,EAAE;UAClB,MAAMC,GAAG,GAAGD,cAAc,CAACJ,IAA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d,QAAQ,KAAKa,GAAG,CAACC,OAAO,MAAM,GAAGG,SAAS;MAC7D;MACAJ,GAAG,CAACZ,IAAI,GAAG,mBAAmB;IAChC;IACA,MAAMY,GAAG;EACX;AACF;AAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_parser","data","require","_codeFrame","_missingPluginHelper","parser","pluginPasses","parserOpts","highlightCode","filename","code","results","plugins","plugin","parserOverride","ast","parse","undefined","push","length","then","Error","err","message","loc","missingPlugin","codeFrame","codeFrameColumns","start","line","column","generateMissingPluginMessage"],"sources":["../../src/parser/index.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\nimport { parse, type File as ParseResult } from \"@babel/parser\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport generateMissingPluginMessage from \"./util/missing-plugin-helper.ts\";\nimport type { PluginPasses } from \"../config/index.ts\";\n\nexport type { ParseResult };\n\nexport default function* parser(\n pluginPasses: PluginPasses,\n { parserOpts, highlightCode = true, filename = \"unknown\" }: any,\n code: string,\n): Handler<ParseResult> {\n try {\n const results = [];\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const { parserOverride } = plugin;\n if (parserOverride) {\n const ast = parserOverride(code, parserOpts, parse);\n\n if (ast !== undefined) results.push(ast);\n }\n }\n }\n\n if (results.length === 0) {\n return parse(code, parserOpts);\n } else if (results.length === 1) {\n // If we want to allow async parsers\n yield* [];\n if (typeof results[0].then === \"function\") {\n throw new Error(\n `You appear to be using an async parser plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n return results[0];\n }\n // TODO: Add an error code\n throw new Error(\"More than one plugin attempted to override parsing.\");\n } catch (err) {\n if (err.code === \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\") {\n err.message +=\n \"\\nConsider renaming the file to '.mjs', or setting sourceType:module \" +\n \"or sourceType:unambiguous in your Babel config for this file.\";\n // err.code will be changed to BABEL_PARSE_ERROR later.\n }\n\n const { loc, missingPlugin } = err;\n if (loc) {\n const codeFrame = codeFrameColumns(\n code,\n {\n start: {\n line: loc.line,\n column: loc.column + 1,\n },\n },\n {\n highlightCode,\n },\n );\n if (missingPlugin) {\n err.message =\n `${filename}: ` +\n generateMissingPluginMessage(\n missingPlugin[0],\n loc,\n codeFrame,\n filename,\n );\n } else {\n err.message = `${filename}: ${err.message}\\n\\n` + codeFrame;\n }\n err.code = \"BABEL_PARSE_ERROR\";\n }\n throw err;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,IAAAG,oBAAA,GAAAF,OAAA;AAKe,UAAUG,MAAMA,CAC7BC,YAA0B,EAC1B;EAAEC,UAAU;EAAEC,aAAa,GAAG,IAAI;EAAEC,QAAQ,GAAG;AAAe,CAAC,EAC/DC,IAAY,EACU;EACtB,IAAI;IACF,MAAMC,OAAO,GAAG,EAAE;IAClB,KAAK,MAAMC,OAAO,IAAIN,YAAY,EAAE;MAClC,KAAK,MAAMO,MAAM,IAAID,OAAO,EAAE;QAC5B,MAAM;UAAEE;QAAe,CAAC,GAAGD,MAAM;QACjC,IAAIC,cAAc,EAAE;UAClB,MAAMC,GAAG,GAAGD,cAAc,CAACJ,IAAI,EAAEH,UAAU,EAAES,eAAK,CAAC;UAEnD,IAAID,GAAG,KAAKE,SAAS,EAAEN,OAAO,CAACO,IAAI,CAACH,GAAG,CAAC;QAC1C;MACF;IACF;IAEA,IAAIJ,OAAO,CAACQ,MAAM,KAAK,CAAC,EAAE;MACxB,OAAO,IAAAH,eAAK,EAACN,IAAI,EAAEH,UAAU,CAAC;IAChC,CAAC,MAAM,IAAII,OAAO,CAACQ,MAAM,KAAK,CAAC,EAAE;MAE/B,OAAO,EAAE;MACT,IAAI,OAAOR,OAAO,CAAC,CAAC,CAAC,CAACS,IAAI,KAAK,UAAU,EAAE;QACzC,MAAM,IAAIC,KAAK,CACb,iDAAiD,GAC/C,wDAAwD,GACxD,8DAA8D,GAC9D,2BACJ,CAAC;MACH;MACA,OAAOV,OAAO,CAAC,CAAC,CAAC;IACnB;IAEA,MAAM,IAAIU,KAAK,CAAC,qDAAqD,CAAC;EACxE,CAAC,CAAC,OAAOC,GAAG,EAAE;IACZ,IAAIA,GAAG,CAACZ,IAAI,KAAK,yCAAyC,EAAE;MAC1DY,GAAG,CAACC,OAAO,IACT,uEAAuE,GACvE,+DAA+D;IAEnE;IAEA,MAAM;MAAEC,GAAG;MAAEC;IAAc,CAAC,GAAGH,GAAG;IAClC,IAAIE,GAAG,EAAE;MACP,MAAME,SAAS,GAAG,IAAAC,6BAAgB,EAChCjB,IAAI,EACJ;QACEkB,KAAK,EAAE;UACLC,IAAI,EAAEL,GAAG,CAACK,IAAI;UACdC,MAAM,EAAEN,GAAG,CAACM,MAAM,GAAG;QACvB;MACF,CAAC,EACD;QACEtB;MACF,CACF,CAAC;MACD,IAAIiB,aAAa,EAAE;QACjBH,GAAG,CAACC,OAAO,GACT,GAAGd,QAAQ,IAAI,GACf,IAAAsB,4BAA4B,EAC1BN,aAAa,CAAC,CAAC,CAAC,EAChBD,GAAG,EACHE,SAAS,EACTjB,QACF,CAAC;MACL,CAAC,MAAM;QACLa,GAAG,CAACC,OAAO,GAAG,GAAGd,QAAQ,KAAKa,GAAG,CAACC,OAAO,MAAM,GAAGG,SAAS;MAC7D;MACAJ,GAAG,CAACZ,IAAI,GAAG,mBAAmB;IAChC;IACA,MAAMY,GAAG;EACX;AACF;AAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["exports","getModuleName","require"],"sources":["../../../src/transformation/file/babel-7-helpers.cjs"],"sourcesContent":["// TODO(Babel 8): Remove this file\n\
|
1
|
+
{"version":3,"names":["exports","getModuleName","require"],"sources":["../../../src/transformation/file/babel-7-helpers.cjs"],"sourcesContent":["// TODO(Babel 8): Remove this file\n\nexports.getModuleName = () =>\n require(\"@babel/helper-module-transforms\").getModuleName;\n"],"mappings":"AAEAA,OAAO,CAACC,aAAa,GAAG,MACtBC,OAAO,CAAC,iCAAiC,CAAC,CAACD,aAAa;AAAC","ignoreList":[]}
|
@@ -39,7 +39,9 @@ function _semver() {
|
|
39
39
|
};
|
40
40
|
return data;
|
41
41
|
}
|
42
|
-
var
|
42
|
+
var babel7 = _interopRequireWildcard(require("./babel-7-helpers.cjs"), true);
|
43
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
44
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
43
45
|
const {
|
44
46
|
cloneNode,
|
45
47
|
interpreterDirective
|
@@ -203,7 +205,7 @@ exports.default = File;
|
|
203
205
|
};
|
204
206
|
{
|
205
207
|
File.prototype.getModuleName = function getModuleName() {
|
206
|
-
return
|
208
|
+
return babel7.getModuleName()(this.opts, this.opts);
|
207
209
|
};
|
208
210
|
}
|
209
211
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["helpers","data","require","_traverse","_codeFrame","_t","_semver","_babel7Helpers","cloneNode","interpreterDirective","errorVisitor","enter","path","state","loc","node","stop","File","constructor","options","code","ast","inputMap","_map","Map","opts","declarations","scope","metadata","hub","file","getCode","getScope","addHelper","bind","buildError","buildCodeFrameError","NodePath","get","parentPath","parent","container","key","setContext","shebang","interpreter","value","replaceWith","remove","set","val","Error","has","availableHelper","name","versionRange","minVersion","err","semver","valid","intersects","declar","generator","res","uid","generateUidIdentifier","dependencies","dep","getDependencies","nodes","globals","Object","keys","getAllBindings","forEach","hasBinding","rename","_compact","added","unshiftContainer","isVariableDeclaration","registerDeclaration","msg","_Error","SyntaxError","traverse","txt","highlightCode","codeFrameColumns","start","line","column","end","undefined","exports","default","prototype","addImport","addTemplateObject","getModuleName","babel7"],"sources":["../../../src/transformation/file/file.ts"],"sourcesContent":["import * as helpers from \"@babel/helpers\";\nimport { NodePath } from \"@babel/traverse\";\nimport type { HubInterface, Visitor, Scope } from \"@babel/traverse\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport traverse from \"@babel/traverse\";\nimport { cloneNode, interpreterDirective } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport semver from \"semver\";\n\nimport type { NormalizedFile } from \"../normalize-file.ts\";\n\n// @ts-expect-error This file is `any`\nimport babel7 from \"./babel-7-helpers.cjs\" with { if: \"!process.env.BABEL_8_BREAKING && (!USE_ESM || IS_STANDALONE)\" };\n\nconst errorVisitor: Visitor<{ loc: t.SourceLocation | null }> = {\n enter(path, state) {\n const loc = path.node.loc;\n if (loc) {\n state.loc = loc;\n path.stop();\n }\n },\n};\n\nexport default class File {\n _map: Map<unknown, unknown> = new Map();\n opts: { [key: string]: any };\n declarations: { [key: string]: t.Identifier } = {};\n path: NodePath<t.Program>;\n ast: t.File;\n scope: Scope;\n metadata: { [key: string]: any } = {};\n code: string = \"\";\n inputMap: any;\n\n hub: HubInterface & { file: File } = {\n // keep it for the usage in babel-core, ex: path.hub.file.opts.filename\n file: this,\n getCode: () => this.code,\n getScope: () => this.scope,\n addHelper: this.addHelper.bind(this),\n buildError: this.buildCodeFrameError.bind(this),\n };\n\n constructor(options: any, { code, ast, inputMap }: NormalizedFile) {\n this.opts = options;\n this.code = code;\n this.ast = ast;\n this.inputMap = inputMap;\n\n this.path = NodePath.get({\n hub: this.hub,\n parentPath: null,\n parent: this.ast,\n container: this.ast,\n key: \"program\",\n }).setContext() as NodePath<t.Program>;\n this.scope = this.path.scope;\n }\n\n /**\n * Provide backward-compatible access to the interpreter directive handling\n * in Babel 6.x. If you are writing a plugin for Babel 7.x, it would be\n * best to use 'program.interpreter' directly.\n */\n get shebang(): string {\n const { interpreter } = this.path.node;\n return interpreter ? interpreter.value : \"\";\n }\n set shebang(value: string) {\n if (value) {\n this.path.get(\"interpreter\").replaceWith(interpreterDirective(value));\n } else {\n this.path.get(\"interpreter\").remove();\n }\n }\n\n set(key: unknown, val: unknown) {\n if (!process.env.BABEL_8_BREAKING) {\n if (key === \"helpersNamespace\") {\n throw new Error(\n \"Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.\" +\n \"If you are using @babel/plugin-external-helpers you will need to use a newer \" +\n \"version than the one you currently have installed. \" +\n \"If you have your own implementation, you'll want to explore using 'helperGenerator' \" +\n \"alongside 'file.availableHelper()'.\",\n );\n }\n }\n\n this._map.set(key, val);\n }\n\n get(key: unknown): any {\n return this._map.get(key);\n }\n\n has(key: unknown): boolean {\n return this._map.has(key);\n }\n\n /**\n * Check if a given helper is available in @babel/core's helper list.\n *\n * This _also_ allows you to pass a Babel version specifically. If the\n * helper exists, but was not available for the full given range, it will be\n * considered unavailable.\n */\n availableHelper(name: string, versionRange?: string | null): boolean {\n let minVersion;\n try {\n minVersion = helpers.minVersion(name);\n } catch (err) {\n if (err.code !== \"BABEL_HELPER_UNKNOWN\") throw err;\n\n return false;\n }\n\n if (typeof versionRange !== \"string\") return true;\n\n // semver.intersects() has some surprising behavior with comparing ranges\n // with pre-release versions. We add '^' to ensure that we are always\n // comparing ranges with ranges, which sidesteps this logic.\n // For example:\n //\n // semver.intersects(`<7.0.1`, \"7.0.0-beta.0\") // false - surprising\n // semver.intersects(`<7.0.1`, \"^7.0.0-beta.0\") // true - expected\n //\n // This is because the first falls back to\n //\n // semver.satisfies(\"7.0.0-beta.0\", `<7.0.1`) // false - surprising\n //\n // and this fails because a prerelease version can only satisfy a range\n // if it is a prerelease within the same major/minor/patch range.\n //\n // Note: If this is found to have issues, please also revisit the logic in\n // transform-runtime's definitions.js file.\n if (semver.valid(versionRange)) versionRange = `^${versionRange}`;\n\n if (process.env.BABEL_8_BREAKING) {\n return (\n !semver.intersects(`<${minVersion}`, versionRange) &&\n !semver.intersects(`>=9.0.0`, versionRange)\n );\n } else {\n return (\n !semver.intersects(`<${minVersion}`, versionRange) &&\n !semver.intersects(`>=8.0.0`, versionRange)\n );\n }\n }\n\n addHelper(name: string): t.Identifier {\n const declar = this.declarations[name];\n if (declar) return cloneNode(declar);\n\n const generator = this.get(\"helperGenerator\");\n if (generator) {\n const res = generator(name);\n if (res) return res;\n }\n\n // make sure that the helper exists\n helpers.minVersion(name);\n\n const uid = (this.declarations[name] =\n this.scope.generateUidIdentifier(name));\n\n const dependencies: { [key: string]: t.Identifier } = {};\n for (const dep of helpers.getDependencies(name)) {\n dependencies[dep] = this.addHelper(dep);\n }\n\n const { nodes, globals } = helpers.get(\n name,\n dep => dependencies[dep],\n uid.name,\n Object.keys(this.scope.getAllBindings()),\n );\n\n globals.forEach(name => {\n if (this.path.scope.hasBinding(name, true /* noGlobals */)) {\n this.path.scope.rename(name);\n }\n });\n\n nodes.forEach(node => {\n // @ts-expect-error Fixme: document _compact node property\n node._compact = true;\n });\n\n const added = this.path.unshiftContainer(\"body\", nodes);\n // TODO: NodePath#unshiftContainer should automatically register new\n // bindings.\n for (const path of added) {\n if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);\n }\n\n return uid;\n }\n\n buildCodeFrameError(\n node: t.Node | undefined | null,\n msg: string,\n _Error: typeof Error = SyntaxError,\n ): Error {\n let loc = node?.loc;\n\n if (!loc && node) {\n const state: { loc?: t.SourceLocation | null } = {\n loc: null,\n };\n traverse(node, errorVisitor, this.scope, state);\n loc = state.loc;\n\n let txt =\n \"This is an error on an internal node. Probably an internal error.\";\n if (loc) txt += \" Location has been estimated.\";\n\n msg += ` (${txt})`;\n }\n\n if (loc) {\n const { highlightCode = true } = this.opts;\n\n msg +=\n \"\\n\" +\n codeFrameColumns(\n this.code,\n {\n start: {\n line: loc.start.line,\n column: loc.start.column + 1,\n },\n end:\n loc.end && loc.start.line === loc.end.line\n ? {\n line: loc.end.line,\n column: loc.end.column + 1,\n }\n : undefined,\n },\n { highlightCode },\n );\n }\n\n return new _Error(msg);\n }\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // @ts-expect-error Babel 7\n File.prototype.addImport = function addImport() {\n throw new Error(\n \"This API has been removed. If you're looking for this \" +\n \"functionality in Babel 7, you should import the \" +\n \"'@babel/helper-module-imports' module and use the functions exposed \" +\n \" from that module, such as 'addNamed' or 'addDefault'.\",\n );\n };\n // @ts-expect-error Babel 7\n File.prototype.addTemplateObject = function addTemplateObject() {\n throw new Error(\n \"This function has been moved into the template literal transform itself.\",\n );\n };\n\n if (!USE_ESM || IS_STANDALONE) {\n // @ts-expect-error Babel 7\n File.prototype.getModuleName = function getModuleName() {\n return babel7.getModuleName()(this.opts, this.opts);\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,GAAA;EAAA,M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SAASA,CAAA,EAAG;IAC9C,MAAM,IAAI9C,KAAK,CACb,wDAAwD,GACtD,kDAAkD,GAClD,sEAAsE,GACtE,wDACJ,CAAC;EACH,CAAC;EAEDlC,IAAI,CAAC+E,SAAS,CAACE,iBAAiB,GAAG,SAASA,iBAAiBA,CAAA,EAAG;IAC9D,MAAM,IAAI/C,KAAK,CACb,0EACF,CAAC;EACH,CAAC;EAE8B;IAE7BlC,IAAI,CAAC+E,SAAS,CAACG,aAAa,GAAG,SAASA,aAAaA,CAAA,EAAG;MACtD,OAAOC,cAAM,CAACD,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC1E,IAAI,EAAE,IAAI,CAACA,IAAI,CAAC;IACrD,CAAC;EACH;AACF;AAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["helpers","data","require","_traverse","_codeFrame","_t","_semver","babel7","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","cloneNode","interpreterDirective","errorVisitor","enter","path","state","loc","node","stop","File","constructor","options","code","ast","inputMap","_map","Map","opts","declarations","scope","metadata","hub","file","getCode","getScope","addHelper","bind","buildError","buildCodeFrameError","NodePath","parentPath","parent","container","key","setContext","shebang","interpreter","value","replaceWith","remove","val","Error","availableHelper","name","versionRange","minVersion","err","semver","valid","intersects","declar","generator","res","uid","generateUidIdentifier","dependencies","dep","getDependencies","nodes","globals","keys","getAllBindings","forEach","hasBinding","rename","_compact","added","unshiftContainer","isVariableDeclaration","registerDeclaration","msg","_Error","SyntaxError","traverse","txt","highlightCode","codeFrameColumns","start","line","column","end","undefined","exports","prototype","addImport","addTemplateObject","getModuleName"],"sources":["../../../src/transformation/file/file.ts"],"sourcesContent":["import * as helpers from \"@babel/helpers\";\nimport { NodePath } from \"@babel/traverse\";\nimport type { HubInterface, Visitor, Scope } from \"@babel/traverse\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport traverse from \"@babel/traverse\";\nimport { cloneNode, interpreterDirective } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport semver from \"semver\";\n\nimport type { NormalizedFile } from \"../normalize-file.ts\";\n\n// @ts-expect-error This file is `any`\nimport * as babel7 from \"./babel-7-helpers.cjs\";\n\nconst errorVisitor: Visitor<{ loc: t.SourceLocation | null }> = {\n enter(path, state) {\n const loc = path.node.loc;\n if (loc) {\n state.loc = loc;\n path.stop();\n }\n },\n};\n\nexport default class File {\n _map: Map<unknown, unknown> = new Map();\n opts: { [key: string]: any };\n declarations: { [key: string]: t.Identifier } = {};\n path: NodePath<t.Program>;\n ast: t.File;\n scope: Scope;\n metadata: { [key: string]: any } = {};\n code: string = \"\";\n inputMap: any;\n\n hub: HubInterface & { file: File } = {\n // keep it for the usage in babel-core, ex: path.hub.file.opts.filename\n file: this,\n getCode: () => this.code,\n getScope: () => this.scope,\n addHelper: this.addHelper.bind(this),\n buildError: this.buildCodeFrameError.bind(this),\n };\n\n constructor(options: any, { code, ast, inputMap }: NormalizedFile) {\n this.opts = options;\n this.code = code;\n this.ast = ast;\n this.inputMap = inputMap;\n\n this.path = NodePath.get({\n hub: this.hub,\n parentPath: null,\n parent: this.ast,\n container: this.ast,\n key: \"program\",\n }).setContext() as NodePath<t.Program>;\n this.scope = this.path.scope;\n }\n\n /**\n * Provide backward-compatible access to the interpreter directive handling\n * in Babel 6.x. If you are writing a plugin for Babel 7.x, it would be\n * best to use 'program.interpreter' directly.\n */\n get shebang(): string {\n const { interpreter } = this.path.node;\n return interpreter ? interpreter.value : \"\";\n }\n set shebang(value: string) {\n if (value) {\n this.path.get(\"interpreter\").replaceWith(interpreterDirective(value));\n } else {\n this.path.get(\"interpreter\").remove();\n }\n }\n\n set(key: unknown, val: unknown) {\n if (!process.env.BABEL_8_BREAKING) {\n if (key === \"helpersNamespace\") {\n throw new Error(\n \"Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.\" +\n \"If you are using @babel/plugin-external-helpers you will need to use a newer \" +\n \"version than the one you currently have installed. \" +\n \"If you have your own implementation, you'll want to explore using 'helperGenerator' \" +\n \"alongside 'file.availableHelper()'.\",\n );\n }\n }\n\n this._map.set(key, val);\n }\n\n get(key: unknown): any {\n return this._map.get(key);\n }\n\n has(key: unknown): boolean {\n return this._map.has(key);\n }\n\n /**\n * Check if a given helper is available in @babel/core's helper list.\n *\n * This _also_ allows you to pass a Babel version specifically. If the\n * helper exists, but was not available for the full given range, it will be\n * considered unavailable.\n */\n availableHelper(name: string, versionRange?: string | null): boolean {\n let minVersion;\n try {\n minVersion = helpers.minVersion(name);\n } catch (err) {\n if (err.code !== \"BABEL_HELPER_UNKNOWN\") throw err;\n\n return false;\n }\n\n if (typeof versionRange !== \"string\") return true;\n\n // semver.intersects() has some surprising behavior with comparing ranges\n // with pre-release versions. We add '^' to ensure that we are always\n // comparing ranges with ranges, which sidesteps this logic.\n // For example:\n //\n // semver.intersects(`<7.0.1`, \"7.0.0-beta.0\") // false - surprising\n // semver.intersects(`<7.0.1`, \"^7.0.0-beta.0\") // true - expected\n //\n // This is because the first falls back to\n //\n // semver.satisfies(\"7.0.0-beta.0\", `<7.0.1`) // false - surprising\n //\n // and this fails because a prerelease version can only satisfy a range\n // if it is a prerelease within the same major/minor/patch range.\n //\n // Note: If this is found to have issues, please also revisit the logic in\n // transform-runtime's definitions.js file.\n if (semver.valid(versionRange)) versionRange = `^${versionRange}`;\n\n if (process.env.BABEL_8_BREAKING) {\n return (\n !semver.intersects(`<${minVersion}`, versionRange) &&\n !semver.intersects(`>=9.0.0`, versionRange)\n );\n } else {\n return (\n !semver.intersects(`<${minVersion}`, versionRange) &&\n !semver.intersects(`>=8.0.0`, versionRange)\n );\n }\n }\n\n addHelper(name: string): t.Identifier {\n const declar = this.declarations[name];\n if (declar) return cloneNode(declar);\n\n const generator = this.get(\"helperGenerator\");\n if (generator) {\n const res = generator(name);\n if (res) return res;\n }\n\n // make sure that the helper exists\n helpers.minVersion(name);\n\n const uid = (this.declarations[name] =\n this.scope.generateUidIdentifier(name));\n\n const dependencies: { [key: string]: t.Identifier } = {};\n for (const dep of helpers.getDependencies(name)) {\n dependencies[dep] = this.addHelper(dep);\n }\n\n const { nodes, globals } = helpers.get(\n name,\n dep => dependencies[dep],\n uid.name,\n Object.keys(this.scope.getAllBindings()),\n );\n\n globals.forEach(name => {\n if (this.path.scope.hasBinding(name, true /* noGlobals */)) {\n this.path.scope.rename(name);\n }\n });\n\n nodes.forEach(node => {\n // @ts-expect-error Fixme: document _compact node property\n node._compact = true;\n });\n\n const added = this.path.unshiftContainer(\"body\", nodes);\n // TODO: NodePath#unshiftContainer should automatically register new\n // bindings.\n for (const path of added) {\n if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);\n }\n\n return uid;\n }\n\n buildCodeFrameError(\n node: t.Node | undefined | null,\n msg: string,\n _Error: typeof Error = SyntaxError,\n ): Error {\n let loc = node?.loc;\n\n if (!loc && node) {\n const state: { loc?: t.SourceLocation | null } = {\n loc: null,\n };\n traverse(node, errorVisitor, this.scope, state);\n loc = state.loc;\n\n let txt =\n \"This is an error on an internal node. Probably an internal error.\";\n if (loc) txt += \" Location has been estimated.\";\n\n msg += ` (${txt})`;\n }\n\n if (loc) {\n const { highlightCode = true } = this.opts;\n\n msg +=\n \"\\n\" +\n codeFrameColumns(\n this.code,\n {\n start: {\n line: loc.start.line,\n column: loc.start.column + 1,\n },\n end:\n loc.end && loc.start.line === loc.end.line\n ? {\n line: loc.end.line,\n column: loc.end.column + 1,\n }\n : undefined,\n },\n { highlightCode },\n );\n }\n\n return new _Error(msg);\n }\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // @ts-expect-error Babel 7\n File.prototype.addImport = function addImport() {\n throw new Error(\n \"This API has been removed. If you're looking for this \" +\n \"functionality in Babel 7, you should import the \" +\n \"'@babel/helper-module-imports' module and use the functions exposed \" +\n \" from that module, such as 'addNamed' or 'addDefault'.\",\n );\n };\n // @ts-expect-error Babel 7\n File.prototype.addTemplateObject = function addTemplateObject() {\n throw new Error(\n \"This function has been moved into the template literal transform itself.\",\n );\n };\n\n if (!USE_ESM || IS_STANDALONE) {\n // @ts-expect-error Babel 7\n File.prototype.getModuleName = function getModuleName() {\n return babel7.getModuleName()(this.opts, this.opts);\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,GAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,EAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,IAAAM,MAAA,GAAAC,uBAAA,CAAAN,OAAA;AAAgD,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WA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,MAAM,GAAG;QAC7B,CAAC;QACDC,GAAG,EACD1E,GAAG,CAAC0E,GAAG,IAAI1E,GAAG,CAACuE,KAAK,CAACC,IAAI,KAAKxE,GAAG,CAAC0E,GAAG,CAACF,IAAI,GACtC;UACEA,IAAI,EAAExE,GAAG,CAAC0E,GAAG,CAACF,IAAI;UAClBC,MAAM,EAAEzE,GAAG,CAAC0E,GAAG,CAACD,MAAM,GAAG;QAC3B,CAAC,GACDE;MACR,CAAC,EACD;QAAEN;MAAc,CAClB,CAAC;IACL;IAEA,OAAO,IAAIJ,MAAM,CAACD,GAAG,CAAC;EACxB;AACF;AAACY,OAAA,CAAAhG,OAAA,GAAAuB,IAAA;AAEkC;EAEjCA,IAAI,CAAC0E,SAAS,CAACC,SAAS,GAAG,SAASA,SAASA,CAAA,EAAG;IAC9C,MAAM,IAAI3C,KAAK,CACb,wDAAwD,GACtD,kDAAkD,GAClD,sEAAsE,GACtE,wDACJ,CAAC;EACH,CAAC;EAEDhC,IAAI,CAAC0E,SAAS,CAACE,iBAAiB,GAAG,SAASA,iBAAiBA,CAAA,EAAG;IAC9D,MAAM,IAAI5C,KAAK,CACb,0EACF,CAAC;EACH,CAAC;EAE8B;IAE7BhC,IAAI,CAAC0E,SAAS,CAACG,aAAa,GAAG,SAASA,aAAaA,CAAA,EAAG;MACtD,OAAO5G,MAAM,CAAC4G,aAAa,CAAC,CAAC,CAAC,IAAI,CAACrE,IAAI,EAAE,IAAI,CAACA,IAAI,CAAC;IACrD,CAAC;EACH;AACF;AAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_fs","data","require","_path","_debug","_t","_convertSourceMap","_file","_index","_cloneDeep","file","traverseFast","debug","buildDebug","INLINE_SOURCEMAP_REGEX","EXTERNAL_SOURCEMAP_REGEX","normalizeFile","pluginPasses","options","code","ast","type","Error","cloneInputAst","cloneDeep","parser","inputMap","inputSourceMap","convertSourceMap","fromObject","lastComment","extractComments","fromComment","err","filename","match","exec","inputMapContent","fs","readFileSync","path","resolve","dirname","fromJSON","File","extractCommentsFromList","regex","comments","filter","value","test","node","leadingComments","innerComments","trailingComments"],"sources":["../../src/transformation/normalize-file.ts"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport buildDebug from \"debug\";\nimport type { Handler } from \"gensync\";\nimport { file, traverseFast } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { PluginPasses } from \"../config/index.ts\";\nimport convertSourceMap from \"convert-source-map\";\nimport type { SourceMapConverter as Converter } from \"convert-source-map\";\nimport File from \"./file/file.ts\";\nimport parser from \"../parser/index.ts\";\nimport cloneDeep from \"./util/clone-deep.ts\";\n\nconst debug = buildDebug(\"babel:transform:file\");\n\n// These regexps are copied from the convert-source-map package,\n// but without // or /* at the beginning of the comment.\n\nconst INLINE_SOURCEMAP_REGEX =\n /^[@#]\\s+sourceMappingURL=data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,.*$/;\nconst EXTERNAL_SOURCEMAP_REGEX =\n /^[@#][ \\t]+sourceMappingURL=([^\\s'\"`]+)[ \\t]*$/;\n\nexport type NormalizedFile = {\n code: string;\n ast: t.File;\n inputMap: Converter | null;\n};\n\nexport default function* normalizeFile(\n pluginPasses: PluginPasses,\n options: { [key: string]: any },\n code: string,\n ast?: t.File | t.Program | null,\n): Handler<File> {\n code = `${code || \"\"}`;\n\n if (ast) {\n if (ast.type === \"Program\") {\n ast = file(ast, [], []);\n } else if (ast.type !== \"File\") {\n throw new Error(\"AST root must be a Program or File node\");\n }\n\n if (options.cloneInputAst) {\n ast = cloneDeep(ast);\n }\n } else {\n ast = yield* parser(pluginPasses, options, code);\n }\n\n let inputMap = null;\n if (options.inputSourceMap !== false) {\n // If an explicit object is passed in, it overrides the processing of\n // source maps that may be in the file itself.\n if (typeof options.inputSourceMap === \"object\") {\n inputMap = convertSourceMap.fromObject(options.inputSourceMap);\n }\n\n if (!inputMap) {\n const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);\n if (lastComment) {\n try {\n inputMap = convertSourceMap.fromComment(\"//\" + lastComment);\n } catch (err) {\n if (process.env.BABEL_8_BREAKING) {\n console.warn(\n \"discarding unknown inline input sourcemap\",\n options.filename,\n err,\n );\n } else {\n debug(\"discarding unknown inline input sourcemap\");\n }\n }\n }\n }\n\n if (!inputMap) {\n const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);\n if (typeof options.filename === \"string\" && lastComment) {\n try {\n // when `lastComment` is non-null, EXTERNAL_SOURCEMAP_REGEX must have matches\n const match: [string, string] = EXTERNAL_SOURCEMAP_REGEX.exec(\n lastComment,\n ) as any;\n const inputMapContent = fs.readFileSync(\n path.resolve(path.dirname(options.filename), match[1]),\n \"utf8\",\n );\n inputMap = convertSourceMap.fromJSON(inputMapContent);\n } catch (err) {\n debug(\"discarding unknown file input sourcemap\", err);\n }\n } else if (lastComment) {\n debug(\"discarding un-loadable file input sourcemap\");\n }\n }\n }\n\n return new File(options, {\n code,\n ast: ast,\n inputMap,\n });\n}\n\nfunction extractCommentsFromList(\n regex: RegExp,\n comments: t.Comment[],\n lastComment: string | null,\n): [t.Comment[], string | null] {\n if (comments) {\n comments = comments.filter(({ value }) => {\n if (regex.test(value)) {\n lastComment = value;\n return false;\n }\n return true;\n });\n }\n return [comments, lastComment];\n}\n\nfunction extractComments(regex: RegExp, ast: t.Node) {\n let lastComment: string = null;\n traverseFast(ast, node => {\n [node.leadingComments, lastComment] = extractCommentsFromList(\n regex,\n node.leadingComments,\n lastComment,\n );\n [node.innerComments, lastComment] = extractCommentsFromList(\n regex,\n node.innerComments,\n lastComment,\n );\n [node.trailingComments, lastComment] = extractCommentsFromList(\n regex,\n node.trailingComments,\n lastComment,\n );\n });\n return lastComment;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;A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ACzBH,GAAG,GAAG,IAAAI,kBAAS,EAACJ,GAAG,CAAC;IACtB;EACF,CAAC,MAAM;
|
1
|
+
{"version":3,"names":["_fs","data","require","_path","_debug","_t","_convertSourceMap","_file","_index","_cloneDeep","file","traverseFast","debug","buildDebug","INLINE_SOURCEMAP_REGEX","EXTERNAL_SOURCEMAP_REGEX","normalizeFile","pluginPasses","options","code","ast","type","Error","cloneInputAst","cloneDeep","parser","inputMap","inputSourceMap","convertSourceMap","fromObject","lastComment","extractComments","fromComment","err","filename","match","exec","inputMapContent","fs","readFileSync","path","resolve","dirname","fromJSON","File","extractCommentsFromList","regex","comments","filter","value","test","node","leadingComments","innerComments","trailingComments"],"sources":["../../src/transformation/normalize-file.ts"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport buildDebug from \"debug\";\nimport type { Handler } from \"gensync\";\nimport { file, traverseFast } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { PluginPasses } from \"../config/index.ts\";\nimport convertSourceMap from \"convert-source-map\";\nimport type { SourceMapConverter as Converter } from \"convert-source-map\";\nimport File from \"./file/file.ts\";\nimport parser from \"../parser/index.ts\";\nimport cloneDeep from \"./util/clone-deep.ts\";\n\nconst debug = buildDebug(\"babel:transform:file\");\n\n// These regexps are copied from the convert-source-map package,\n// but without // or /* at the beginning of the comment.\n\nconst INLINE_SOURCEMAP_REGEX =\n /^[@#]\\s+sourceMappingURL=data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,.*$/;\nconst EXTERNAL_SOURCEMAP_REGEX =\n /^[@#][ \\t]+sourceMappingURL=([^\\s'\"`]+)[ \\t]*$/;\n\nexport type NormalizedFile = {\n code: string;\n ast: t.File;\n inputMap: Converter | null;\n};\n\nexport default function* normalizeFile(\n pluginPasses: PluginPasses,\n options: { [key: string]: any },\n code: string,\n ast?: t.File | t.Program | null,\n): Handler<File> {\n code = `${code || \"\"}`;\n\n if (ast) {\n if (ast.type === \"Program\") {\n ast = file(ast, [], []);\n } else if (ast.type !== \"File\") {\n throw new Error(\"AST root must be a Program or File node\");\n }\n\n if (options.cloneInputAst) {\n ast = cloneDeep(ast);\n }\n } else {\n // @ts-expect-error todo: use babel-types ast typings in Babel parser\n ast = yield* parser(pluginPasses, options, code);\n }\n\n let inputMap = null;\n if (options.inputSourceMap !== false) {\n // If an explicit object is passed in, it overrides the processing of\n // source maps that may be in the file itself.\n if (typeof options.inputSourceMap === \"object\") {\n inputMap = convertSourceMap.fromObject(options.inputSourceMap);\n }\n\n if (!inputMap) {\n const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);\n if (lastComment) {\n try {\n inputMap = convertSourceMap.fromComment(\"//\" + lastComment);\n } catch (err) {\n if (process.env.BABEL_8_BREAKING) {\n console.warn(\n \"discarding unknown inline input sourcemap\",\n options.filename,\n err,\n );\n } else {\n debug(\"discarding unknown inline input sourcemap\");\n }\n }\n }\n }\n\n if (!inputMap) {\n const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);\n if (typeof options.filename === \"string\" && lastComment) {\n try {\n // when `lastComment` is non-null, EXTERNAL_SOURCEMAP_REGEX must have matches\n const match: [string, string] = EXTERNAL_SOURCEMAP_REGEX.exec(\n lastComment,\n ) as any;\n const inputMapContent = fs.readFileSync(\n path.resolve(path.dirname(options.filename), match[1]),\n \"utf8\",\n );\n inputMap = convertSourceMap.fromJSON(inputMapContent);\n } catch (err) {\n debug(\"discarding unknown file input sourcemap\", err);\n }\n } else if (lastComment) {\n debug(\"discarding un-loadable file input sourcemap\");\n }\n }\n }\n\n return new File(options, {\n code,\n ast: ast as t.File,\n inputMap,\n });\n}\n\nfunction extractCommentsFromList(\n regex: RegExp,\n comments: t.Comment[],\n lastComment: string | null,\n): [t.Comment[], string | null] {\n if (comments) {\n comments = comments.filter(({ value }) => {\n if (regex.test(value)) {\n lastComment = value;\n return false;\n }\n return true;\n });\n }\n return [comments, lastComment];\n}\n\nfunction extractComments(regex: RegExp, ast: t.Node) {\n let lastComment: string = null;\n traverseFast(ast, node => {\n [node.leadingComments, lastComment] = extractCommentsFromList(\n regex,\n node.leadingComments,\n lastComment,\n );\n [node.innerComments, lastComment] = extractCommentsFromList(\n regex,\n node.innerComments,\n lastComment,\n );\n [node.trailingComments, lastComment] = extractCommentsFromList(\n regex,\n node.trailingComments,\n lastComment,\n );\n });\n return lastComment;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,GAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,EAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,kBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,iBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAM,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAA6C;EAPpCQ,IAAI;EAAEC;AAAY,IAAAN,EAAA;AAS3B,MAAMO,KAAK,GAAGC,OAASA,CAAC,CAAC,sBAAsB,CAAC;AAKhD,MAAMC,sBAAsB,GAC1B,0FAA0F;AAC5F,MAAMC,wBAAwB,GAC5B,gDAAgD;AAQnC,UAAUC,aAAaA,CACpCC,YAA0B,EAC1BC,OAA+B,EAC/BC,IAAY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,KAAK,EACLK,IAAI,CAACC,eAAe,EACpBtB,WACF,CAAC;IACD,CAACqB,IAAI,CAACE,aAAa,EAAEvB,WAAW,CAAC,GAAGe,uBAAuB,CACzDC,KAAK,EACLK,IAAI,CAACE,aAAa,EAClBvB,WACF,CAAC;IACD,CAACqB,IAAI,CAACG,gBAAgB,EAAExB,WAAW,CAAC,GAAGe,uBAAuB,CAC5DC,KAAK,EACLK,IAAI,CAACG,gBAAgB,EACrBxB,WACF,CAAC;EACH,CAAC,CAAC;EACF,OAAOA,WAAW;AACpB;AAAC","ignoreList":[]}
|
@@ -4,52 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = _default;
|
7
|
-
|
8
|
-
let depth = 0;
|
9
|
-
function deepClone(value, cache, allowCircle) {
|
7
|
+
function deepClone(value, cache) {
|
10
8
|
if (value !== null) {
|
11
|
-
if (
|
12
|
-
if (cache.has(value)) return cache.get(value);
|
13
|
-
} else if (++depth > 250) {
|
14
|
-
if (circleSet.has(value)) {
|
15
|
-
depth = 0;
|
16
|
-
circleSet.clear();
|
17
|
-
throw new Error("Babel-deepClone: Cycles are not allowed in AST");
|
18
|
-
}
|
19
|
-
circleSet.add(value);
|
20
|
-
}
|
9
|
+
if (cache.has(value)) return cache.get(value);
|
21
10
|
let cloned;
|
22
11
|
if (Array.isArray(value)) {
|
23
12
|
cloned = new Array(value.length);
|
24
|
-
|
13
|
+
cache.set(value, cloned);
|
25
14
|
for (let i = 0; i < value.length; i++) {
|
26
|
-
cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache
|
15
|
+
cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache);
|
27
16
|
}
|
28
17
|
} else {
|
29
18
|
cloned = {};
|
30
|
-
|
19
|
+
cache.set(value, cloned);
|
31
20
|
const keys = Object.keys(value);
|
32
21
|
for (let i = 0; i < keys.length; i++) {
|
33
22
|
const key = keys[i];
|
34
|
-
cloned[key] = typeof value[key] !== "object" ? value[key] : deepClone(value[key], cache
|
23
|
+
cloned[key] = typeof value[key] !== "object" ? value[key] : deepClone(value[key], cache);
|
35
24
|
}
|
36
25
|
}
|
37
|
-
if (!allowCircle) {
|
38
|
-
if (depth-- > 250) circleSet.delete(value);
|
39
|
-
}
|
40
26
|
return cloned;
|
41
27
|
}
|
42
28
|
return value;
|
43
29
|
}
|
44
30
|
function _default(value) {
|
45
31
|
if (typeof value !== "object") return value;
|
46
|
-
|
47
|
-
try {
|
48
|
-
return deepClone(value, new Map(), true);
|
49
|
-
} catch (_) {
|
50
|
-
return structuredClone(value);
|
51
|
-
}
|
52
|
-
}
|
32
|
+
return deepClone(value, new Map());
|
53
33
|
}
|
54
34
|
0 && 0;
|
55
35
|
|