@tachybase/module-workflow 0.23.8
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.
- package/.turbo/turbo-build.log +12 -0
- package/README.md +9 -0
- package/README.zh-CN.md +9 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/Branch.d.ts +9 -0
- package/dist/client/CanvasContent.d.ts +4 -0
- package/dist/client/CanvasContentWrapper.d.ts +4 -0
- package/dist/client/ExecutionCanvas.d.ts +2 -0
- package/dist/client/ExecutionContextProvider.d.ts +7 -0
- package/dist/client/ExecutionLink.d.ts +2 -0
- package/dist/client/ExecutionPage.d.ts +2 -0
- package/dist/client/ExecutionResourceProvider.d.ts +6 -0
- package/dist/client/FlowContext.d.ts +3 -0
- package/dist/client/Plugin.d.ts +39 -0
- package/dist/client/WorkflowCanvas.d.ts +2 -0
- package/dist/client/WorkflowLink.d.ts +2 -0
- package/dist/client/WorkflowPage.d.ts +2 -0
- package/dist/client/WorkflowPane.d.ts +2 -0
- package/dist/client/components/AddNotifiedPerson.d.ts +3 -0
- package/dist/client/components/AutoResizeInput.d.ts +4 -0
- package/dist/client/components/CheckboxGroupWithTooltip.d.ts +7 -0
- package/dist/client/components/CollectionBlockInitializer.d.ts +2 -0
- package/dist/client/components/CollectionFieldset.d.ts +3 -0
- package/dist/client/components/ColumnShowCollection.d.ts +2 -0
- package/dist/client/components/ColumnShowTitle.d.ts +2 -0
- package/dist/client/components/ConfigButtonMessage.d.ts +2 -0
- package/dist/client/components/DetailsBlockProvider.d.ts +6 -0
- package/dist/client/components/DrawerDescription.d.ts +5 -0
- package/dist/client/components/DrawerForm.d.ts +5 -0
- package/dist/client/components/ExecutionStatus.d.ts +5 -0
- package/dist/client/components/ExecutionTime.d.ts +3 -0
- package/dist/client/components/FieldsSelect.d.ts +2 -0
- package/dist/client/components/FilterDynamicComponent.d.ts +6 -0
- package/dist/client/components/GoBackButton.d.ts +2 -0
- package/dist/client/components/OpenDrawer.d.ts +7 -0
- package/dist/client/components/RadioWithTooltip.d.ts +7 -0
- package/dist/client/components/SelectNotifiedPerson.d.ts +2 -0
- package/dist/client/components/ShowNodeTypesInWorkflow.d.ts +2 -0
- package/dist/client/components/SimpleDesigner.d.ts +2 -0
- package/dist/client/components/StatusButton.d.ts +2 -0
- package/dist/client/components/ValueBlock.d.ts +5 -0
- package/dist/client/components/WorkflowLink.d.ts +2 -0
- package/dist/client/components/index.d.ts +15 -0
- package/dist/client/components/renderEngineReference.d.ts +2 -0
- package/dist/client/constants.d.ts +37 -0
- package/dist/client/features/aggregate/AggregateInstruction.d.ts +217 -0
- package/dist/client/features/aggregate/index.d.ts +4 -0
- package/dist/client/features/common/constants.d.ts +3 -0
- package/dist/client/features/delay/DelayInstruction.d.ts +48 -0
- package/dist/client/features/delay/index.d.ts +4 -0
- package/dist/client/features/dynamic-calculation/DynamicCalculation.d.ts +76 -0
- package/dist/client/features/dynamic-calculation/DynamicExpression.d.ts +6 -0
- package/dist/client/features/dynamic-calculation/expression.d.ts +35 -0
- package/dist/client/features/dynamic-calculation/index.d.ts +4 -0
- package/dist/client/features/interceptor/WorkflowTriggerInterceptor.d.ts +100 -0
- package/dist/client/features/interceptor/index.d.ts +4 -0
- package/dist/client/features/js-parse/JSParse.instruction.d.ts +123 -0
- package/dist/client/features/js-parse/index.d.ts +5 -0
- package/dist/client/features/json-parse/JSONParse.instruction.d.ts +119 -0
- package/dist/client/features/json-parse/index.d.ts +5 -0
- package/dist/client/features/loop/LoopInstruction.d.ts +33 -0
- package/dist/client/features/loop/index.d.ts +4 -0
- package/dist/client/features/manual/WorkflowTodo.d.ts +5 -0
- package/dist/client/features/manual/WorkflowTodoBlockInitializer.d.ts +2 -0
- package/dist/client/features/manual/index.d.ts +5 -0
- package/dist/client/features/manual/instruction/AssigneesSelect.d.ts +6 -0
- package/dist/client/features/manual/instruction/FormBlockInitializer.d.ts +2 -0
- package/dist/client/features/manual/instruction/FormBlockProvider.d.ts +2 -0
- package/dist/client/features/manual/instruction/ModeConfig.d.ts +5 -0
- package/dist/client/features/manual/instruction/SchemaConfig.d.ts +50 -0
- package/dist/client/features/manual/instruction/createManualFormBlockUISchema.d.ts +57 -0
- package/dist/client/features/manual/instruction/forms/create.d.ts +3 -0
- package/dist/client/features/manual/instruction/forms/custom.d.ts +5 -0
- package/dist/client/features/manual/instruction/forms/update.d.ts +3 -0
- package/dist/client/features/manual/instruction/index.d.ts +91 -0
- package/dist/client/features/manual/instruction/utils.d.ts +1 -0
- package/dist/client/features/notice/common/flowNodes.collection.d.ts +38 -0
- package/dist/client/features/notice/common/notice.collection.d.ts +127 -0
- package/dist/client/features/notice/common/workflow.collection.d.ts +30 -0
- package/dist/client/features/notice/configuration/Notice.instruction.d.ts +76 -0
- package/dist/client/features/notice/configuration/config-items/AddNotifiedPerson.view.d.ts +2 -0
- package/dist/client/features/notice/configuration/config-items/ConfigButtonNotice.view.d.ts +2 -0
- package/dist/client/features/notice/configuration/config-items/SelectNotifiedPerson.view.d.ts +2 -0
- package/dist/client/features/notice/configuration/kit.d.ts +5 -0
- package/dist/client/features/notice/configuration/show-interface/NoticeDetail.block.d.ts +2 -0
- package/dist/client/features/notice/configuration/show-interface/NoticeDetail.initializer.d.ts +2 -0
- package/dist/client/features/notice/configuration/show-interface/NoticeDetail.schema.d.ts +6 -0
- package/dist/client/features/notice/configuration/show-interface/NoticeDetailContainer.schema.d.ts +2 -0
- package/dist/client/features/notice/configuration/show-interface/style.d.ts +3 -0
- package/dist/client/features/notice/configuration/style.d.ts +5 -0
- package/dist/client/features/notice/index.d.ts +5 -0
- package/dist/client/features/notice/locale.d.ts +7 -0
- package/dist/client/features/notice/usage/NoticeBlock.initializer.d.ts +6 -0
- package/dist/client/features/notice/usage/NoticeBlock.provider.d.ts +5 -0
- package/dist/client/features/notice/usage/NoticeCenter.schema.d.ts +2 -0
- package/dist/client/features/notice/usage/column/column.action.d.ts +2 -0
- package/dist/client/features/notice/usage/column/column.node.d.ts +1 -0
- package/dist/client/features/notice/usage/column/column.status.d.ts +8 -0
- package/dist/client/features/notice/usage/column/column.user.d.ts +1 -0
- package/dist/client/features/notice/usage/column/column.workflow.d.ts +2 -0
- package/dist/client/features/notice/usage/kit.d.ts +5 -0
- package/dist/client/features/notice/usage/show-detail/NoticeDetail.provider.d.ts +5 -0
- package/dist/client/features/notice/usage/show-detail/NoticeDetail.schema.d.ts +2 -0
- package/dist/client/features/notice/usage/show-detail/contexts/MyComponent.context.d.ts +9 -0
- package/dist/client/features/notice/usage/show-detail/contexts/WorkflowNotice.context.d.ts +4 -0
- package/dist/client/features/notice/usage/show-detail/hooks/usePropsNoticeDetail.d.ts +3 -0
- package/dist/client/features/omni-trigger/OmniActionTrigger.d.ts +84 -0
- package/dist/client/features/omni-trigger/index.d.ts +5 -0
- package/dist/client/features/omni-trigger/usage/APIRegular.schema.d.ts +2 -0
- package/dist/client/features/omni-trigger/usage/APIRegular.setting.d.ts +2 -0
- package/dist/client/features/omni-trigger/usage/hooks.d.ts +3 -0
- package/dist/client/features/omni-trigger/usage/kit.d.ts +4 -0
- package/dist/client/features/omni-trigger/useFormWorkflowCustomActionProps.d.ts +3 -0
- package/dist/client/features/omni-trigger/useRecordWorkflowCustomTriggerActionProps.d.ts +3 -0
- package/dist/client/features/parallel/ParallelInstruction.d.ts +34 -0
- package/dist/client/features/parallel/index.d.ts +4 -0
- package/dist/client/features/request/RequestInstruction.d.ts +220 -0
- package/dist/client/features/request/index.d.ts +4 -0
- package/dist/client/features/response/index.d.ts +4 -0
- package/dist/client/features/script/Script.instruction.d.ts +198 -0
- package/dist/client/features/script/index.d.ts +5 -0
- package/dist/client/features/sql/SQLInstruction.d.ts +54 -0
- package/dist/client/features/sql/index.d.ts +4 -0
- package/dist/client/features/trigger-instruction/TriggerInstruction.d.ts +93 -0
- package/dist/client/features/trigger-instruction/index.d.ts +0 -0
- package/dist/client/features/trigger-instruction/plugin.d.ts +4 -0
- package/dist/client/features/variables/VariableTargetSelect.d.ts +5 -0
- package/dist/client/features/variables/VariablesInstruction.d.ts +54 -0
- package/dist/client/features/variables/index.d.ts +4 -0
- package/dist/client/features/variables/useStyles.d.ts +3 -0
- package/dist/client/hooks/index.d.ts +3 -0
- package/dist/client/hooks/useGetAriaLabelOfAddButton.d.ts +6 -0
- package/dist/client/hooks/useTriggerWorkflowActionProps.d.ts +6 -0
- package/dist/client/hooks/useWorkflowExecuted.d.ts +2 -0
- package/dist/client/index.d.ts +19 -0
- package/dist/client/index.js +876 -0
- package/dist/client/locale/index.d.ts +4 -0
- package/dist/client/nodes/calculation.d.ts +88 -0
- package/dist/client/nodes/condition.d.ts +108 -0
- package/dist/client/nodes/create.d.ts +68 -0
- package/dist/client/nodes/default-node/Node.context.d.ts +3 -0
- package/dist/client/nodes/default-node/Node.d.ts +4 -0
- package/dist/client/nodes/default-node/Node.style.d.ts +4 -0
- package/dist/client/nodes/default-node/buttons/ArrowDownButton.d.ts +2 -0
- package/dist/client/nodes/default-node/buttons/ArrowUpButton.d.ts +2 -0
- package/dist/client/nodes/default-node/buttons/DragButton.d.ts +2 -0
- package/dist/client/nodes/default-node/buttons/JobButton.d.ts +2 -0
- package/dist/client/nodes/default-node/buttons/JobButton.style.d.ts +5 -0
- package/dist/client/nodes/default-node/buttons/RemoveButton.d.ts +2 -0
- package/dist/client/nodes/default-node/components/AddButton.d.ts +11 -0
- package/dist/client/nodes/default-node/components/AddButton.props.d.ts +11 -0
- package/dist/client/nodes/default-node/components/AddButton.style.d.ts +6 -0
- package/dist/client/nodes/default-node/components/NodeConfig.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeConfig.provider.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeConfig.schema.d.ts +15 -0
- package/dist/client/nodes/default-node/components/NodeConfig.view.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeConfigTitle.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeDefaultView.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeDefaultView.style.d.ts +5 -0
- package/dist/client/nodes/default-node/components/NodePoint.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodePoint.style.d.ts +4 -0
- package/dist/client/nodes/default-node/hooks/useAvailableUpstreams.d.ts +1 -0
- package/dist/client/nodes/default-node/hooks/useFormProviderProps.d.ts +3 -0
- package/dist/client/nodes/default-node/hooks/useUpdateAction.d.ts +3 -0
- package/dist/client/nodes/default-node/hooks/useUpstreamScopes.d.ts +1 -0
- package/dist/client/nodes/default-node/index.d.ts +4 -0
- package/dist/client/nodes/default-node/interface.d.ts +49 -0
- package/dist/client/nodes/destroy.d.ts +46 -0
- package/dist/client/nodes/end.d.ts +25 -0
- package/dist/client/nodes/query.d.ts +221 -0
- package/dist/client/nodes/update.d.ts +82 -0
- package/dist/client/schemas/collection.d.ts +162 -0
- package/dist/client/schemas/executions.d.ts +380 -0
- package/dist/client/schemas/workflows.d.ts +47 -0
- package/dist/client/settings/customizeSubmitToWorkflowActionSettings.d.ts +2 -0
- package/dist/client/style.d.ts +19 -0
- package/dist/client/triggers/collection.d.ts +133 -0
- package/dist/client/triggers/index.d.ts +25 -0
- package/dist/client/triggers/schedule/EndsByField.d.ts +5 -0
- package/dist/client/triggers/schedule/OnField.d.ts +5 -0
- package/dist/client/triggers/schedule/RepeatField.d.ts +5 -0
- package/dist/client/triggers/schedule/ScheduleConfig.d.ts +2 -0
- package/dist/client/triggers/schedule/constants.d.ts +4 -0
- package/dist/client/triggers/schedule/index.d.ts +22 -0
- package/dist/client/triggers/schedule/locale/Cron.zh-CN.d.ts +34 -0
- package/dist/client/utils.d.ts +5 -0
- package/dist/client/variable.d.ts +97 -0
- package/dist/common/constants.d.ts +5 -0
- package/dist/common/constants.js +39 -0
- package/dist/externalVersion.js +25 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +319 -0
- package/dist/locale/es-ES.json +129 -0
- package/dist/locale/fr-FR.json +129 -0
- package/dist/locale/ja-JP.json +87 -0
- package/dist/locale/ko_KR.json +246 -0
- package/dist/locale/pt-BR.json +129 -0
- package/dist/locale/ru-RU.json +87 -0
- package/dist/locale/tr-TR.json +87 -0
- package/dist/locale/zh-CN.json +399 -0
- package/dist/node_modules/@babel/core/LICENSE +22 -0
- package/dist/node_modules/@babel/core/cjs-proxy.cjs +68 -0
- package/dist/node_modules/@babel/core/lib/config/cache-contexts.js +3 -0
- package/dist/node_modules/@babel/core/lib/config/caching.js +261 -0
- package/dist/node_modules/@babel/core/lib/config/config-chain.js +469 -0
- package/dist/node_modules/@babel/core/lib/config/config-descriptors.js +190 -0
- package/dist/node_modules/@babel/core/lib/config/files/configuration.js +287 -0
- package/dist/node_modules/@babel/core/lib/config/files/import.cjs +6 -0
- package/dist/node_modules/@babel/core/lib/config/files/index-browser.js +58 -0
- package/dist/node_modules/@babel/core/lib/config/files/index.js +78 -0
- package/dist/node_modules/@babel/core/lib/config/files/module-types.js +195 -0
- package/dist/node_modules/@babel/core/lib/config/files/package.js +61 -0
- package/dist/node_modules/@babel/core/lib/config/files/plugins.js +229 -0
- package/dist/node_modules/@babel/core/lib/config/files/types.js +3 -0
- package/dist/node_modules/@babel/core/lib/config/files/utils.js +36 -0
- package/dist/node_modules/@babel/core/lib/config/full.js +312 -0
- package/dist/node_modules/@babel/core/lib/config/helpers/config-api.js +84 -0
- package/dist/node_modules/@babel/core/lib/config/helpers/deep-array.js +23 -0
- package/dist/node_modules/@babel/core/lib/config/helpers/environment.js +12 -0
- package/dist/node_modules/@babel/core/lib/config/index.js +93 -0
- package/dist/node_modules/@babel/core/lib/config/item.js +67 -0
- package/dist/node_modules/@babel/core/lib/config/partial.js +158 -0
- package/dist/node_modules/@babel/core/lib/config/pattern-to-regex.js +38 -0
- package/dist/node_modules/@babel/core/lib/config/plugin.js +33 -0
- package/dist/node_modules/@babel/core/lib/config/printer.js +113 -0
- package/dist/node_modules/@babel/core/lib/config/resolve-targets-browser.js +41 -0
- package/dist/node_modules/@babel/core/lib/config/resolve-targets.js +61 -0
- package/dist/node_modules/@babel/core/lib/config/util.js +31 -0
- package/dist/node_modules/@babel/core/lib/config/validation/option-assertions.js +277 -0
- package/dist/node_modules/@babel/core/lib/config/validation/options.js +189 -0
- package/dist/node_modules/@babel/core/lib/config/validation/plugins.js +67 -0
- package/dist/node_modules/@babel/core/lib/config/validation/removed.js +68 -0
- package/dist/node_modules/@babel/core/lib/errors/config-error.js +18 -0
- package/dist/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js +98 -0
- package/dist/node_modules/@babel/core/lib/gensync-utils/async.js +90 -0
- package/dist/node_modules/@babel/core/lib/gensync-utils/fs.js +31 -0
- package/dist/node_modules/@babel/core/lib/gensync-utils/functional.js +58 -0
- package/dist/node_modules/@babel/core/lib/index.js +227 -0
- package/dist/node_modules/@babel/core/lib/parse.js +47 -0
- package/dist/node_modules/@babel/core/lib/parser/index.js +79 -0
- package/dist/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js +339 -0
- package/dist/node_modules/@babel/core/lib/tools/build-external-helpers.js +144 -0
- package/dist/node_modules/@babel/core/lib/transform-ast.js +50 -0
- package/dist/node_modules/@babel/core/lib/transform-file-browser.js +23 -0
- package/dist/node_modules/@babel/core/lib/transform-file.js +40 -0
- package/dist/node_modules/@babel/core/lib/transform.js +49 -0
- package/dist/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js +84 -0
- package/dist/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs +4 -0
- package/dist/node_modules/@babel/core/lib/transformation/file/file.js +214 -0
- package/dist/node_modules/@babel/core/lib/transformation/file/generate.js +84 -0
- package/dist/node_modules/@babel/core/lib/transformation/file/merge-map.js +37 -0
- package/dist/node_modules/@babel/core/lib/transformation/index.js +92 -0
- package/dist/node_modules/@babel/core/lib/transformation/normalize-file.js +129 -0
- package/dist/node_modules/@babel/core/lib/transformation/normalize-opts.js +59 -0
- package/dist/node_modules/@babel/core/lib/transformation/plugin-pass.js +50 -0
- package/dist/node_modules/@babel/core/lib/transformation/util/clone-deep.js +36 -0
- package/dist/node_modules/@babel/core/lib/vendor/import-meta-resolve.js +1043 -0
- package/dist/node_modules/@babel/core/node_modules/.bin/json5 +17 -0
- package/dist/node_modules/@babel/core/node_modules/.bin/parser +17 -0
- package/dist/node_modules/@babel/core/node_modules/.bin/semver +17 -0
- package/dist/node_modules/@babel/core/package.json +1 -0
- package/dist/node_modules/@babel/core/src/config/files/index-browser.ts +113 -0
- package/dist/node_modules/@babel/core/src/config/files/index.ts +29 -0
- package/dist/node_modules/@babel/core/src/config/resolve-targets-browser.ts +40 -0
- package/dist/node_modules/@babel/core/src/config/resolve-targets.ts +56 -0
- package/dist/node_modules/@babel/core/src/transform-file-browser.ts +31 -0
- package/dist/node_modules/@babel/core/src/transform-file.ts +55 -0
- package/dist/node_modules/cron-parser/LICENSE +21 -0
- package/dist/node_modules/cron-parser/lib/date.js +252 -0
- package/dist/node_modules/cron-parser/lib/expression.js +1002 -0
- package/dist/node_modules/cron-parser/lib/field_compactor.js +70 -0
- package/dist/node_modules/cron-parser/lib/field_stringify.js +58 -0
- package/dist/node_modules/cron-parser/lib/parser.js +1 -0
- package/dist/node_modules/cron-parser/package.json +1 -0
- package/dist/node_modules/cron-parser/types/common.d.ts +131 -0
- package/dist/node_modules/cron-parser/types/index.d.ts +45 -0
- package/dist/node_modules/cron-parser/types/ts3/index.d.ts +28 -0
- package/dist/node_modules/form-data/License +19 -0
- package/dist/node_modules/form-data/index.d.ts +62 -0
- package/dist/node_modules/form-data/lib/browser.js +2 -0
- package/dist/node_modules/form-data/lib/form_data.js +14 -0
- package/dist/node_modules/form-data/lib/populate.js +10 -0
- package/dist/node_modules/form-data/package.json +1 -0
- package/dist/node_modules/jsonata/LICENSE +19 -0
- package/dist/node_modules/jsonata/jsonata-es5.js +9875 -0
- package/dist/node_modules/jsonata/jsonata-es5.min.js +1 -0
- package/dist/node_modules/jsonata/jsonata.d.ts +72 -0
- package/dist/node_modules/jsonata/jsonata.js +1 -0
- package/dist/node_modules/jsonata/jsonata.min.js +1 -0
- package/dist/node_modules/jsonata/package.json +1 -0
- package/dist/node_modules/lru-cache/index-cjs.d.ts +7 -0
- package/dist/node_modules/lru-cache/index-cjs.js +1 -0
- package/dist/node_modules/lru-cache/index.d.ts +807 -0
- package/dist/node_modules/lru-cache/index.js +1334 -0
- package/dist/node_modules/lru-cache/index.min.js +2 -0
- package/dist/node_modules/lru-cache/package.json +1 -0
- package/dist/node_modules/mime-types/LICENSE +23 -0
- package/dist/node_modules/mime-types/index.js +14 -0
- package/dist/node_modules/mime-types/package.json +1 -0
- package/dist/node_modules/qrcode/bin/qrcode +159 -0
- package/dist/node_modules/qrcode/helper/to-sjis-browser.js +2 -0
- package/dist/node_modules/qrcode/helper/to-sjis.js +105 -0
- package/dist/node_modules/qrcode/lib/browser.js +76 -0
- package/dist/node_modules/qrcode/lib/can-promise.js +7 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +83 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +59 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js +37 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js +65 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js +30 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js +135 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js +50 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js +22 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js +29 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js +69 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js +54 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js +234 -0
- package/dist/node_modules/qrcode/lib/core/mode.js +167 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js +43 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js +62 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js +495 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +56 -0
- package/dist/node_modules/qrcode/lib/core/regex.js +31 -0
- package/dist/node_modules/qrcode/lib/core/segments.js +330 -0
- package/dist/node_modules/qrcode/lib/core/utils.js +63 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js +9 -0
- package/dist/node_modules/qrcode/lib/core/version.js +163 -0
- package/dist/node_modules/qrcode/lib/index.js +1 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js +63 -0
- package/dist/node_modules/qrcode/lib/renderer/png.js +78 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +81 -0
- package/dist/node_modules/qrcode/lib/renderer/svg.js +19 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +85 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal.js +49 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal.js +9 -0
- package/dist/node_modules/qrcode/lib/renderer/utf8.js +71 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js +99 -0
- package/dist/node_modules/qrcode/lib/server.js +138 -0
- package/dist/node_modules/qrcode/license +10 -0
- package/dist/node_modules/qrcode/package.json +1 -0
- package/dist/server/Plugin.d.ts +50 -0
- package/dist/server/Plugin.js +498 -0
- package/dist/server/Processor.d.ts +59 -0
- package/dist/server/Processor.js +306 -0
- package/dist/server/actions/executions.d.ts +3 -0
- package/dist/server/actions/executions.js +87 -0
- package/dist/server/actions/index.d.ts +3 -0
- package/dist/server/actions/index.js +59 -0
- package/dist/server/actions/nodes.d.ts +6 -0
- package/dist/server/actions/nodes.js +322 -0
- package/dist/server/actions/workflows.d.ts +10 -0
- package/dist/server/actions/workflows.js +347 -0
- package/dist/server/collections/1-users_jobs.d.ts +2 -0
- package/dist/server/collections/1-users_jobs.js +73 -0
- package/dist/server/collections/2-jobs.d.ts +2 -0
- package/dist/server/collections/2-jobs.js +40 -0
- package/dist/server/collections/3-users.d.ts +2 -0
- package/dist/server/collections/3-users.js +38 -0
- package/dist/server/collections/executions.d.ts +3 -0
- package/dist/server/collections/executions.js +64 -0
- package/dist/server/collections/flow_nodes.d.ts +3 -0
- package/dist/server/collections/flow_nodes.js +78 -0
- package/dist/server/collections/jobs.d.ts +3 -0
- package/dist/server/collections/jobs.js +61 -0
- package/dist/server/collections/workflows.d.ts +2 -0
- package/dist/server/collections/workflows.js +130 -0
- package/dist/server/constants.d.ts +22 -0
- package/dist/server/constants.js +52 -0
- package/dist/server/features/_deprecated-js-parse/JSParse.instruction.d.ts +10 -0
- package/dist/server/features/_deprecated-js-parse/JSParse.instruction.js +100 -0
- package/dist/server/features/_deprecated-js-parse/index.d.ts +1 -0
- package/dist/server/features/_deprecated-js-parse/index.js +33 -0
- package/dist/server/features/_deprecated-js-parse/plugin.d.ts +5 -0
- package/dist/server/features/_deprecated-js-parse/plugin.js +48 -0
- package/dist/server/features/_deprecated-json-parse/JSONParse.instruction.d.ts +11 -0
- package/dist/server/features/_deprecated-json-parse/JSONParse.instruction.js +81 -0
- package/dist/server/features/_deprecated-json-parse/index.d.ts +1 -0
- package/dist/server/features/_deprecated-json-parse/index.js +33 -0
- package/dist/server/features/_deprecated-json-parse/plugin.d.ts +5 -0
- package/dist/server/features/_deprecated-json-parse/plugin.js +48 -0
- package/dist/server/features/aggregate/AggregateInstruction.d.ts +7 -0
- package/dist/server/features/aggregate/AggregateInstruction.js +56 -0
- package/dist/server/features/aggregate/Plugin.d.ts +4 -0
- package/dist/server/features/aggregate/Plugin.js +45 -0
- package/dist/server/features/common/constants.d.ts +4 -0
- package/dist/server/features/common/constants.js +36 -0
- package/dist/server/features/delay/DelayInstruction.d.ts +12 -0
- package/dist/server/features/delay/DelayInstruction.js +106 -0
- package/dist/server/features/delay/Plugin.d.ts +4 -0
- package/dist/server/features/delay/Plugin.js +45 -0
- package/dist/server/features/dynamic-calculation/DynamicCalculation.d.ts +10 -0
- package/dist/server/features/dynamic-calculation/DynamicCalculation.js +62 -0
- package/dist/server/features/dynamic-calculation/Plugin.d.ts +4 -0
- package/dist/server/features/dynamic-calculation/Plugin.js +49 -0
- package/dist/server/features/dynamic-calculation/expression-field.d.ts +7 -0
- package/dist/server/features/dynamic-calculation/expression-field.js +32 -0
- package/dist/server/features/interception/RequestInterceptionTrigger.d.ts +11 -0
- package/dist/server/features/interception/RequestInterceptionTrigger.js +146 -0
- package/dist/server/features/interception/index.d.ts +4 -0
- package/dist/server/features/interception/index.js +35 -0
- package/dist/server/features/loop/LoopInstruction.d.ts +13 -0
- package/dist/server/features/loop/LoopInstruction.js +100 -0
- package/dist/server/features/loop/Plugin.d.ts +4 -0
- package/dist/server/features/loop/Plugin.js +45 -0
- package/dist/server/features/manual/ManualInstruction.d.ts +28 -0
- package/dist/server/features/manual/ManualInstruction.js +152 -0
- package/dist/server/features/manual/Plugin.d.ts +4 -0
- package/dist/server/features/manual/Plugin.js +70 -0
- package/dist/server/features/manual/actions.d.ts +2 -0
- package/dist/server/features/manual/actions.js +104 -0
- package/dist/server/features/manual/forms/create.d.ts +6 -0
- package/dist/server/features/manual/forms/create.js +41 -0
- package/dist/server/features/manual/forms/index.d.ts +6 -0
- package/dist/server/features/manual/forms/index.js +38 -0
- package/dist/server/features/manual/forms/update.d.ts +7 -0
- package/dist/server/features/manual/forms/update.js +41 -0
- package/dist/server/features/notice/NoticeInstruction.d.ts +9 -0
- package/dist/server/features/notice/NoticeInstruction.js +172 -0
- package/dist/server/features/notice/actions.d.ts +3 -0
- package/dist/server/features/notice/actions.js +124 -0
- package/dist/server/features/notice/collections/workflowNotice.d.ts +3 -0
- package/dist/server/features/notice/collections/workflowNotice.js +90 -0
- package/dist/server/features/notice/constants.d.ts +16 -0
- package/dist/server/features/notice/constants.js +44 -0
- package/dist/server/features/notice/index.d.ts +1 -0
- package/dist/server/features/notice/index.js +33 -0
- package/dist/server/features/notice/plugin.d.ts +12 -0
- package/dist/server/features/notice/plugin.js +83 -0
- package/dist/server/features/notice/tools.d.ts +17 -0
- package/dist/server/features/notice/tools.js +163 -0
- package/dist/server/features/omni-trigger/CustomActionTrigger.d.ts +11 -0
- package/dist/server/features/omni-trigger/CustomActionTrigger.js +270 -0
- package/dist/server/features/omni-trigger/Plugin.d.ts +4 -0
- package/dist/server/features/omni-trigger/Plugin.js +45 -0
- package/dist/server/features/omni-trigger/index.d.ts +1 -0
- package/dist/server/features/omni-trigger/index.js +21 -0
- package/dist/server/features/parallel/ParallelInstruction.d.ts +11 -0
- package/dist/server/features/parallel/ParallelInstruction.js +137 -0
- package/dist/server/features/parallel/Plugin.d.ts +4 -0
- package/dist/server/features/parallel/Plugin.js +45 -0
- package/dist/server/features/request/Plugin.d.ts +4 -0
- package/dist/server/features/request/Plugin.js +45 -0
- package/dist/server/features/request/RequestInstruction.d.ts +14 -0
- package/dist/server/features/request/RequestInstruction.js +183 -0
- package/dist/server/features/response/Plugin.d.ts +4 -0
- package/dist/server/features/response/Plugin.js +45 -0
- package/dist/server/features/response/ResponseMessageInstruction.d.ts +7 -0
- package/dist/server/features/response/ResponseMessageInstruction.js +57 -0
- package/dist/server/features/response/index.d.ts +1 -0
- package/dist/server/features/response/index.js +21 -0
- package/dist/server/features/script/index.d.ts +1 -0
- package/dist/server/features/script/index.js +33 -0
- package/dist/server/features/script/plugin.d.ts +5 -0
- package/dist/server/features/script/plugin.js +48 -0
- package/dist/server/features/script/script.instruction.d.ts +10 -0
- package/dist/server/features/script/script.instruction.js +212 -0
- package/dist/server/features/sql/Plugin.d.ts +4 -0
- package/dist/server/features/sql/Plugin.js +45 -0
- package/dist/server/features/sql/SQLInstruction.d.ts +10 -0
- package/dist/server/features/sql/SQLInstruction.js +48 -0
- package/dist/server/features/trigger-instruction/TriggerInstruction.d.ts +15 -0
- package/dist/server/features/trigger-instruction/TriggerInstruction.js +71 -0
- package/dist/server/features/trigger-instruction/flownode-check.d.ts +2 -0
- package/dist/server/features/trigger-instruction/flownode-check.js +114 -0
- package/dist/server/features/trigger-instruction/index.d.ts +0 -0
- package/dist/server/features/trigger-instruction/index.js +0 -0
- package/dist/server/features/trigger-instruction/plugin.d.ts +4 -0
- package/dist/server/features/trigger-instruction/plugin.js +37 -0
- package/dist/server/features/variables/Plugin.d.ts +4 -0
- package/dist/server/features/variables/Plugin.js +45 -0
- package/dist/server/features/variables/VariableInstruction.d.ts +7 -0
- package/dist/server/features/variables/VariableInstruction.js +61 -0
- package/dist/server/features/variables/index.d.ts +1 -0
- package/dist/server/features/variables/index.js +27 -0
- package/dist/server/features/webhook/Plugin.d.ts +4 -0
- package/dist/server/features/webhook/Plugin.js +109 -0
- package/dist/server/features/webhook/index.d.ts +1 -0
- package/dist/server/features/webhook/index.js +27 -0
- package/dist/server/features/webhook/webhooks.d.ts +9 -0
- package/dist/server/features/webhook/webhooks.js +286 -0
- package/dist/server/functions/index.d.ts +9 -0
- package/dist/server/functions/index.js +31 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.js +54 -0
- package/dist/server/instructions/CalculationInstruction.d.ts +17 -0
- package/dist/server/instructions/CalculationInstruction.js +59 -0
- package/dist/server/instructions/ConditionInstruction.d.ts +29 -0
- package/dist/server/instructions/ConditionInstruction.js +160 -0
- package/dist/server/instructions/CreateInstruction.d.ts +10 -0
- package/dist/server/instructions/CreateInstruction.js +175 -0
- package/dist/server/instructions/DestroyInstruction.d.ts +10 -0
- package/dist/server/instructions/DestroyInstruction.js +50 -0
- package/dist/server/instructions/EndInstruction.d.ts +6 -0
- package/dist/server/instructions/EndInstruction.js +47 -0
- package/dist/server/instructions/QueryInstruction.d.ts +13 -0
- package/dist/server/instructions/QueryInstruction.js +78 -0
- package/dist/server/instructions/UpdateInstruction.d.ts +10 -0
- package/dist/server/instructions/UpdateInstruction.js +159 -0
- package/dist/server/instructions/index.d.ts +23 -0
- package/dist/server/instructions/index.js +33 -0
- package/dist/server/migrations/20241118104303-add-initAt.d.ts +6 -0
- package/dist/server/migrations/20241118104303-add-initAt.js +47 -0
- package/dist/server/migrations/20241206122842-add-createdBy.d.ts +6 -0
- package/dist/server/migrations/20241206122842-add-createdBy.js +46 -0
- package/dist/server/migrations/20241220001154-bigInt.d.ts +6 -0
- package/dist/server/migrations/20241220001154-bigInt.js +39 -0
- package/dist/server/triggers/CollectionTrigger.d.ts +14 -0
- package/dist/server/triggers/CollectionTrigger.js +188 -0
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.d.ts +31 -0
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +342 -0
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.d.ts +15 -0
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +143 -0
- package/dist/server/triggers/ScheduleTrigger/index.d.ts +13 -0
- package/dist/server/triggers/ScheduleTrigger/index.js +74 -0
- package/dist/server/triggers/ScheduleTrigger/utils.d.ts +5 -0
- package/dist/server/triggers/ScheduleTrigger/utils.js +35 -0
- package/dist/server/triggers/index.d.ts +13 -0
- package/dist/server/triggers/index.js +37 -0
- package/dist/server/types/Execution.d.ts +17 -0
- package/dist/server/types/Execution.js +25 -0
- package/dist/server/types/FlowNode.d.ts +16 -0
- package/dist/server/types/FlowNode.js +25 -0
- package/dist/server/types/Job.d.ts +14 -0
- package/dist/server/types/Job.js +25 -0
- package/dist/server/types/Workflow.d.ts +27 -0
- package/dist/server/types/Workflow.js +25 -0
- package/dist/server/types/index.d.ts +4 -0
- package/dist/server/types/index.js +15 -0
- package/dist/server/utils.d.ts +1 -0
- package/dist/server/utils.js +42 -0
- package/dist/swagger/index.d.ts +754 -0
- package/dist/swagger/index.js +798 -0
- package/package.json +63 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildPresetChain = buildPresetChain;
|
|
7
|
+
exports.buildPresetChainWalker = void 0;
|
|
8
|
+
exports.buildRootChain = buildRootChain;
|
|
9
|
+
function _path() {
|
|
10
|
+
const data = require("path");
|
|
11
|
+
_path = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
function _debug() {
|
|
17
|
+
const data = require("debug");
|
|
18
|
+
_debug = function () {
|
|
19
|
+
return data;
|
|
20
|
+
};
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
var _options = require("./validation/options.js");
|
|
24
|
+
var _patternToRegex = require("./pattern-to-regex.js");
|
|
25
|
+
var _printer = require("./printer.js");
|
|
26
|
+
var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js");
|
|
27
|
+
var _configError = require("../errors/config-error.js");
|
|
28
|
+
var _index = require("./files/index.js");
|
|
29
|
+
var _caching = require("./caching.js");
|
|
30
|
+
var _configDescriptors = require("./config-descriptors.js");
|
|
31
|
+
const debug = _debug()("babel:config:config-chain");
|
|
32
|
+
function* buildPresetChain(arg, context) {
|
|
33
|
+
const chain = yield* buildPresetChainWalker(arg, context);
|
|
34
|
+
if (!chain) return null;
|
|
35
|
+
return {
|
|
36
|
+
plugins: dedupDescriptors(chain.plugins),
|
|
37
|
+
presets: dedupDescriptors(chain.presets),
|
|
38
|
+
options: chain.options.map(o => normalizeOptions(o)),
|
|
39
|
+
files: new Set()
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const buildPresetChainWalker = exports.buildPresetChainWalker = makeChainWalker({
|
|
43
|
+
root: preset => loadPresetDescriptors(preset),
|
|
44
|
+
env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
|
|
45
|
+
overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
|
|
46
|
+
overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName),
|
|
47
|
+
createLogger: () => () => {}
|
|
48
|
+
});
|
|
49
|
+
const loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors));
|
|
50
|
+
const loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName)));
|
|
51
|
+
const loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index)));
|
|
52
|
+
const loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName))));
|
|
53
|
+
function* buildRootChain(opts, context) {
|
|
54
|
+
let configReport, babelRcReport;
|
|
55
|
+
const programmaticLogger = new _printer.ConfigPrinter();
|
|
56
|
+
const programmaticChain = yield* loadProgrammaticChain({
|
|
57
|
+
options: opts,
|
|
58
|
+
dirname: context.cwd
|
|
59
|
+
}, context, undefined, programmaticLogger);
|
|
60
|
+
if (!programmaticChain) return null;
|
|
61
|
+
const programmaticReport = yield* programmaticLogger.output();
|
|
62
|
+
let configFile;
|
|
63
|
+
if (typeof opts.configFile === "string") {
|
|
64
|
+
configFile = yield* (0, _index.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller);
|
|
65
|
+
} else if (opts.configFile !== false) {
|
|
66
|
+
configFile = yield* (0, _index.findRootConfig)(context.root, context.envName, context.caller);
|
|
67
|
+
}
|
|
68
|
+
let {
|
|
69
|
+
babelrc,
|
|
70
|
+
babelrcRoots
|
|
71
|
+
} = opts;
|
|
72
|
+
let babelrcRootsDirectory = context.cwd;
|
|
73
|
+
const configFileChain = emptyChain();
|
|
74
|
+
const configFileLogger = new _printer.ConfigPrinter();
|
|
75
|
+
if (configFile) {
|
|
76
|
+
const validatedFile = validateConfigFile(configFile);
|
|
77
|
+
const result = yield* loadFileChain(validatedFile, context, undefined, configFileLogger);
|
|
78
|
+
if (!result) return null;
|
|
79
|
+
configReport = yield* configFileLogger.output();
|
|
80
|
+
if (babelrc === undefined) {
|
|
81
|
+
babelrc = validatedFile.options.babelrc;
|
|
82
|
+
}
|
|
83
|
+
if (babelrcRoots === undefined) {
|
|
84
|
+
babelrcRootsDirectory = validatedFile.dirname;
|
|
85
|
+
babelrcRoots = validatedFile.options.babelrcRoots;
|
|
86
|
+
}
|
|
87
|
+
mergeChain(configFileChain, result);
|
|
88
|
+
}
|
|
89
|
+
let ignoreFile, babelrcFile;
|
|
90
|
+
let isIgnored = false;
|
|
91
|
+
const fileChain = emptyChain();
|
|
92
|
+
if ((babelrc === true || babelrc === undefined) && typeof context.filename === "string") {
|
|
93
|
+
const pkgData = yield* (0, _index.findPackageData)(context.filename);
|
|
94
|
+
if (pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) {
|
|
95
|
+
({
|
|
96
|
+
ignore: ignoreFile,
|
|
97
|
+
config: babelrcFile
|
|
98
|
+
} = yield* (0, _index.findRelativeConfig)(pkgData, context.envName, context.caller));
|
|
99
|
+
if (ignoreFile) {
|
|
100
|
+
fileChain.files.add(ignoreFile.filepath);
|
|
101
|
+
}
|
|
102
|
+
if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) {
|
|
103
|
+
isIgnored = true;
|
|
104
|
+
}
|
|
105
|
+
if (babelrcFile && !isIgnored) {
|
|
106
|
+
const validatedFile = validateBabelrcFile(babelrcFile);
|
|
107
|
+
const babelrcLogger = new _printer.ConfigPrinter();
|
|
108
|
+
const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger);
|
|
109
|
+
if (!result) {
|
|
110
|
+
isIgnored = true;
|
|
111
|
+
} else {
|
|
112
|
+
babelRcReport = yield* babelrcLogger.output();
|
|
113
|
+
mergeChain(fileChain, result);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (babelrcFile && isIgnored) {
|
|
117
|
+
fileChain.files.add(babelrcFile.filepath);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (context.showConfig) {
|
|
122
|
+
console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----");
|
|
123
|
+
}
|
|
124
|
+
const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);
|
|
125
|
+
return {
|
|
126
|
+
plugins: isIgnored ? [] : dedupDescriptors(chain.plugins),
|
|
127
|
+
presets: isIgnored ? [] : dedupDescriptors(chain.presets),
|
|
128
|
+
options: isIgnored ? [] : chain.options.map(o => normalizeOptions(o)),
|
|
129
|
+
fileHandling: isIgnored ? "ignored" : "transpile",
|
|
130
|
+
ignore: ignoreFile || undefined,
|
|
131
|
+
babelrc: babelrcFile || undefined,
|
|
132
|
+
config: configFile || undefined,
|
|
133
|
+
files: chain.files
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) {
|
|
137
|
+
if (typeof babelrcRoots === "boolean") return babelrcRoots;
|
|
138
|
+
const absoluteRoot = context.root;
|
|
139
|
+
if (babelrcRoots === undefined) {
|
|
140
|
+
return pkgData.directories.includes(absoluteRoot);
|
|
141
|
+
}
|
|
142
|
+
let babelrcPatterns = babelrcRoots;
|
|
143
|
+
if (!Array.isArray(babelrcPatterns)) {
|
|
144
|
+
babelrcPatterns = [babelrcPatterns];
|
|
145
|
+
}
|
|
146
|
+
babelrcPatterns = babelrcPatterns.map(pat => {
|
|
147
|
+
return typeof pat === "string" ? _path().resolve(babelrcRootsDirectory, pat) : pat;
|
|
148
|
+
});
|
|
149
|
+
if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {
|
|
150
|
+
return pkgData.directories.includes(absoluteRoot);
|
|
151
|
+
}
|
|
152
|
+
return babelrcPatterns.some(pat => {
|
|
153
|
+
if (typeof pat === "string") {
|
|
154
|
+
pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory);
|
|
155
|
+
}
|
|
156
|
+
return pkgData.directories.some(directory => {
|
|
157
|
+
return matchPattern(pat, babelrcRootsDirectory, directory, context);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({
|
|
162
|
+
filepath: file.filepath,
|
|
163
|
+
dirname: file.dirname,
|
|
164
|
+
options: (0, _options.validate)("configfile", file.options, file.filepath)
|
|
165
|
+
}));
|
|
166
|
+
const validateBabelrcFile = (0, _caching.makeWeakCacheSync)(file => ({
|
|
167
|
+
filepath: file.filepath,
|
|
168
|
+
dirname: file.dirname,
|
|
169
|
+
options: (0, _options.validate)("babelrcfile", file.options, file.filepath)
|
|
170
|
+
}));
|
|
171
|
+
const validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({
|
|
172
|
+
filepath: file.filepath,
|
|
173
|
+
dirname: file.dirname,
|
|
174
|
+
options: (0, _options.validate)("extendsfile", file.options, file.filepath)
|
|
175
|
+
}));
|
|
176
|
+
const loadProgrammaticChain = makeChainWalker({
|
|
177
|
+
root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors),
|
|
178
|
+
env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName),
|
|
179
|
+
overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index),
|
|
180
|
+
overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName),
|
|
181
|
+
createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger)
|
|
182
|
+
});
|
|
183
|
+
const loadFileChainWalker = makeChainWalker({
|
|
184
|
+
root: file => loadFileDescriptors(file),
|
|
185
|
+
env: (file, envName) => loadFileEnvDescriptors(file)(envName),
|
|
186
|
+
overrides: (file, index) => loadFileOverridesDescriptors(file)(index),
|
|
187
|
+
overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName),
|
|
188
|
+
createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger)
|
|
189
|
+
});
|
|
190
|
+
function* loadFileChain(input, context, files, baseLogger) {
|
|
191
|
+
const chain = yield* loadFileChainWalker(input, context, files, baseLogger);
|
|
192
|
+
chain == null || chain.files.add(input.filepath);
|
|
193
|
+
return chain;
|
|
194
|
+
}
|
|
195
|
+
const loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors));
|
|
196
|
+
const loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName)));
|
|
197
|
+
const loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index)));
|
|
198
|
+
const loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName))));
|
|
199
|
+
function buildFileLogger(filepath, context, baseLogger) {
|
|
200
|
+
if (!baseLogger) {
|
|
201
|
+
return () => {};
|
|
202
|
+
}
|
|
203
|
+
return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, {
|
|
204
|
+
filepath
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
function buildRootDescriptors({
|
|
208
|
+
dirname,
|
|
209
|
+
options
|
|
210
|
+
}, alias, descriptors) {
|
|
211
|
+
return descriptors(dirname, options, alias);
|
|
212
|
+
}
|
|
213
|
+
function buildProgrammaticLogger(_, context, baseLogger) {
|
|
214
|
+
var _context$caller;
|
|
215
|
+
if (!baseLogger) {
|
|
216
|
+
return () => {};
|
|
217
|
+
}
|
|
218
|
+
return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, {
|
|
219
|
+
callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function buildEnvDescriptors({
|
|
223
|
+
dirname,
|
|
224
|
+
options
|
|
225
|
+
}, alias, descriptors, envName) {
|
|
226
|
+
var _options$env;
|
|
227
|
+
const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName];
|
|
228
|
+
return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null;
|
|
229
|
+
}
|
|
230
|
+
function buildOverrideDescriptors({
|
|
231
|
+
dirname,
|
|
232
|
+
options
|
|
233
|
+
}, alias, descriptors, index) {
|
|
234
|
+
var _options$overrides;
|
|
235
|
+
const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index];
|
|
236
|
+
if (!opts) throw new Error("Assertion failure - missing override");
|
|
237
|
+
return descriptors(dirname, opts, `${alias}.overrides[${index}]`);
|
|
238
|
+
}
|
|
239
|
+
function buildOverrideEnvDescriptors({
|
|
240
|
+
dirname,
|
|
241
|
+
options
|
|
242
|
+
}, alias, descriptors, index, envName) {
|
|
243
|
+
var _options$overrides2, _override$env;
|
|
244
|
+
const override = (_options$overrides2 = options.overrides) == null ? void 0 : _options$overrides2[index];
|
|
245
|
+
if (!override) throw new Error("Assertion failure - missing override");
|
|
246
|
+
const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName];
|
|
247
|
+
return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null;
|
|
248
|
+
}
|
|
249
|
+
function makeChainWalker({
|
|
250
|
+
root,
|
|
251
|
+
env,
|
|
252
|
+
overrides,
|
|
253
|
+
overridesEnv,
|
|
254
|
+
createLogger
|
|
255
|
+
}) {
|
|
256
|
+
return function* chainWalker(input, context, files = new Set(), baseLogger) {
|
|
257
|
+
const {
|
|
258
|
+
dirname
|
|
259
|
+
} = input;
|
|
260
|
+
const flattenedConfigs = [];
|
|
261
|
+
const rootOpts = root(input);
|
|
262
|
+
if (configIsApplicable(rootOpts, dirname, context, input.filepath)) {
|
|
263
|
+
flattenedConfigs.push({
|
|
264
|
+
config: rootOpts,
|
|
265
|
+
envName: undefined,
|
|
266
|
+
index: undefined
|
|
267
|
+
});
|
|
268
|
+
const envOpts = env(input, context.envName);
|
|
269
|
+
if (envOpts && configIsApplicable(envOpts, dirname, context, input.filepath)) {
|
|
270
|
+
flattenedConfigs.push({
|
|
271
|
+
config: envOpts,
|
|
272
|
+
envName: context.envName,
|
|
273
|
+
index: undefined
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
(rootOpts.options.overrides || []).forEach((_, index) => {
|
|
277
|
+
const overrideOps = overrides(input, index);
|
|
278
|
+
if (configIsApplicable(overrideOps, dirname, context, input.filepath)) {
|
|
279
|
+
flattenedConfigs.push({
|
|
280
|
+
config: overrideOps,
|
|
281
|
+
index,
|
|
282
|
+
envName: undefined
|
|
283
|
+
});
|
|
284
|
+
const overrideEnvOpts = overridesEnv(input, index, context.envName);
|
|
285
|
+
if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context, input.filepath)) {
|
|
286
|
+
flattenedConfigs.push({
|
|
287
|
+
config: overrideEnvOpts,
|
|
288
|
+
index,
|
|
289
|
+
envName: context.envName
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
if (flattenedConfigs.some(({
|
|
296
|
+
config: {
|
|
297
|
+
options: {
|
|
298
|
+
ignore,
|
|
299
|
+
only
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}) => shouldIgnore(context, ignore, only, dirname))) {
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
const chain = emptyChain();
|
|
306
|
+
const logger = createLogger(input, context, baseLogger);
|
|
307
|
+
for (const {
|
|
308
|
+
config,
|
|
309
|
+
index,
|
|
310
|
+
envName
|
|
311
|
+
} of flattenedConfigs) {
|
|
312
|
+
if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) {
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
logger(config, index, envName);
|
|
316
|
+
yield* mergeChainOpts(chain, config);
|
|
317
|
+
}
|
|
318
|
+
return chain;
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
function* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) {
|
|
322
|
+
if (opts.extends === undefined) return true;
|
|
323
|
+
const file = yield* (0, _index.loadConfig)(opts.extends, dirname, context.envName, context.caller);
|
|
324
|
+
if (files.has(file)) {
|
|
325
|
+
throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n"));
|
|
326
|
+
}
|
|
327
|
+
files.add(file);
|
|
328
|
+
const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger);
|
|
329
|
+
files.delete(file);
|
|
330
|
+
if (!fileChain) return false;
|
|
331
|
+
mergeChain(chain, fileChain);
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
334
|
+
function mergeChain(target, source) {
|
|
335
|
+
target.options.push(...source.options);
|
|
336
|
+
target.plugins.push(...source.plugins);
|
|
337
|
+
target.presets.push(...source.presets);
|
|
338
|
+
for (const file of source.files) {
|
|
339
|
+
target.files.add(file);
|
|
340
|
+
}
|
|
341
|
+
return target;
|
|
342
|
+
}
|
|
343
|
+
function* mergeChainOpts(target, {
|
|
344
|
+
options,
|
|
345
|
+
plugins,
|
|
346
|
+
presets
|
|
347
|
+
}) {
|
|
348
|
+
target.options.push(options);
|
|
349
|
+
target.plugins.push(...(yield* plugins()));
|
|
350
|
+
target.presets.push(...(yield* presets()));
|
|
351
|
+
return target;
|
|
352
|
+
}
|
|
353
|
+
function emptyChain() {
|
|
354
|
+
return {
|
|
355
|
+
options: [],
|
|
356
|
+
presets: [],
|
|
357
|
+
plugins: [],
|
|
358
|
+
files: new Set()
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function normalizeOptions(opts) {
|
|
362
|
+
const options = Object.assign({}, opts);
|
|
363
|
+
delete options.extends;
|
|
364
|
+
delete options.env;
|
|
365
|
+
delete options.overrides;
|
|
366
|
+
delete options.plugins;
|
|
367
|
+
delete options.presets;
|
|
368
|
+
delete options.passPerPreset;
|
|
369
|
+
delete options.ignore;
|
|
370
|
+
delete options.only;
|
|
371
|
+
delete options.test;
|
|
372
|
+
delete options.include;
|
|
373
|
+
delete options.exclude;
|
|
374
|
+
if (hasOwnProperty.call(options, "sourceMap")) {
|
|
375
|
+
options.sourceMaps = options.sourceMap;
|
|
376
|
+
delete options.sourceMap;
|
|
377
|
+
}
|
|
378
|
+
return options;
|
|
379
|
+
}
|
|
380
|
+
function dedupDescriptors(items) {
|
|
381
|
+
const map = new Map();
|
|
382
|
+
const descriptors = [];
|
|
383
|
+
for (const item of items) {
|
|
384
|
+
if (typeof item.value === "function") {
|
|
385
|
+
const fnKey = item.value;
|
|
386
|
+
let nameMap = map.get(fnKey);
|
|
387
|
+
if (!nameMap) {
|
|
388
|
+
nameMap = new Map();
|
|
389
|
+
map.set(fnKey, nameMap);
|
|
390
|
+
}
|
|
391
|
+
let desc = nameMap.get(item.name);
|
|
392
|
+
if (!desc) {
|
|
393
|
+
desc = {
|
|
394
|
+
value: item
|
|
395
|
+
};
|
|
396
|
+
descriptors.push(desc);
|
|
397
|
+
if (!item.ownPass) nameMap.set(item.name, desc);
|
|
398
|
+
} else {
|
|
399
|
+
desc.value = item;
|
|
400
|
+
}
|
|
401
|
+
} else {
|
|
402
|
+
descriptors.push({
|
|
403
|
+
value: item
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return descriptors.reduce((acc, desc) => {
|
|
408
|
+
acc.push(desc.value);
|
|
409
|
+
return acc;
|
|
410
|
+
}, []);
|
|
411
|
+
}
|
|
412
|
+
function configIsApplicable({
|
|
413
|
+
options
|
|
414
|
+
}, dirname, context, configName) {
|
|
415
|
+
return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname, configName)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname, configName)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname, configName));
|
|
416
|
+
}
|
|
417
|
+
function configFieldIsApplicable(context, test, dirname, configName) {
|
|
418
|
+
const patterns = Array.isArray(test) ? test : [test];
|
|
419
|
+
return matchesPatterns(context, patterns, dirname, configName);
|
|
420
|
+
}
|
|
421
|
+
function ignoreListReplacer(_key, value) {
|
|
422
|
+
if (value instanceof RegExp) {
|
|
423
|
+
return String(value);
|
|
424
|
+
}
|
|
425
|
+
return value;
|
|
426
|
+
}
|
|
427
|
+
function shouldIgnore(context, ignore, only, dirname) {
|
|
428
|
+
if (ignore && matchesPatterns(context, ignore, dirname)) {
|
|
429
|
+
var _context$filename;
|
|
430
|
+
const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname}"`;
|
|
431
|
+
debug(message);
|
|
432
|
+
if (context.showConfig) {
|
|
433
|
+
console.log(message);
|
|
434
|
+
}
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
437
|
+
if (only && !matchesPatterns(context, only, dirname)) {
|
|
438
|
+
var _context$filename2;
|
|
439
|
+
const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname}"`;
|
|
440
|
+
debug(message);
|
|
441
|
+
if (context.showConfig) {
|
|
442
|
+
console.log(message);
|
|
443
|
+
}
|
|
444
|
+
return true;
|
|
445
|
+
}
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
function matchesPatterns(context, patterns, dirname, configName) {
|
|
449
|
+
return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName));
|
|
450
|
+
}
|
|
451
|
+
function matchPattern(pattern, dirname, pathToTest, context, configName) {
|
|
452
|
+
if (typeof pattern === "function") {
|
|
453
|
+
return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, {
|
|
454
|
+
dirname,
|
|
455
|
+
envName: context.envName,
|
|
456
|
+
caller: context.caller
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
if (typeof pathToTest !== "string") {
|
|
460
|
+
throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName);
|
|
461
|
+
}
|
|
462
|
+
if (typeof pattern === "string") {
|
|
463
|
+
pattern = (0, _patternToRegex.default)(pattern, dirname);
|
|
464
|
+
}
|
|
465
|
+
return pattern.test(pathToTest);
|
|
466
|
+
}
|
|
467
|
+
0 && 0;
|
|
468
|
+
|
|
469
|
+
//# sourceMappingURL=config-chain.js.map
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createCachedDescriptors = createCachedDescriptors;
|
|
7
|
+
exports.createDescriptor = createDescriptor;
|
|
8
|
+
exports.createUncachedDescriptors = createUncachedDescriptors;
|
|
9
|
+
function _gensync() {
|
|
10
|
+
const data = require("gensync");
|
|
11
|
+
_gensync = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
var _functional = require("../gensync-utils/functional.js");
|
|
17
|
+
var _index = require("./files/index.js");
|
|
18
|
+
var _item = require("./item.js");
|
|
19
|
+
var _caching = require("./caching.js");
|
|
20
|
+
var _resolveTargets = require("./resolve-targets.js");
|
|
21
|
+
function isEqualDescriptor(a, b) {
|
|
22
|
+
var _a$file, _b$file, _a$file2, _b$file2;
|
|
23
|
+
return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved);
|
|
24
|
+
}
|
|
25
|
+
function* handlerOf(value) {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
function optionsWithResolvedBrowserslistConfigFile(options, dirname) {
|
|
29
|
+
if (typeof options.browserslistConfigFile === "string") {
|
|
30
|
+
options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname);
|
|
31
|
+
}
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
function createCachedDescriptors(dirname, options, alias) {
|
|
35
|
+
const {
|
|
36
|
+
plugins,
|
|
37
|
+
presets,
|
|
38
|
+
passPerPreset
|
|
39
|
+
} = options;
|
|
40
|
+
return {
|
|
41
|
+
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
|
|
42
|
+
plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
|
|
43
|
+
presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function createUncachedDescriptors(dirname, options, alias) {
|
|
47
|
+
return {
|
|
48
|
+
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
|
|
49
|
+
plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)),
|
|
50
|
+
presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset))
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const PRESET_DESCRIPTOR_CACHE = new WeakMap();
|
|
54
|
+
const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
|
|
55
|
+
const dirname = cache.using(dir => dir);
|
|
56
|
+
return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCache)(function* (passPerPreset) {
|
|
57
|
+
const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset);
|
|
58
|
+
return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
|
|
59
|
+
}));
|
|
60
|
+
});
|
|
61
|
+
const PLUGIN_DESCRIPTOR_CACHE = new WeakMap();
|
|
62
|
+
const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
|
|
63
|
+
const dirname = cache.using(dir => dir);
|
|
64
|
+
return (0, _caching.makeStrongCache)(function* (alias) {
|
|
65
|
+
const descriptors = yield* createPluginDescriptors(items, dirname, alias);
|
|
66
|
+
return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
const DEFAULT_OPTIONS = {};
|
|
70
|
+
function loadCachedDescriptor(cache, desc) {
|
|
71
|
+
const {
|
|
72
|
+
value,
|
|
73
|
+
options = DEFAULT_OPTIONS
|
|
74
|
+
} = desc;
|
|
75
|
+
if (options === false) return desc;
|
|
76
|
+
let cacheByOptions = cache.get(value);
|
|
77
|
+
if (!cacheByOptions) {
|
|
78
|
+
cacheByOptions = new WeakMap();
|
|
79
|
+
cache.set(value, cacheByOptions);
|
|
80
|
+
}
|
|
81
|
+
let possibilities = cacheByOptions.get(options);
|
|
82
|
+
if (!possibilities) {
|
|
83
|
+
possibilities = [];
|
|
84
|
+
cacheByOptions.set(options, possibilities);
|
|
85
|
+
}
|
|
86
|
+
if (!possibilities.includes(desc)) {
|
|
87
|
+
const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc));
|
|
88
|
+
if (matches.length > 0) {
|
|
89
|
+
return matches[0];
|
|
90
|
+
}
|
|
91
|
+
possibilities.push(desc);
|
|
92
|
+
}
|
|
93
|
+
return desc;
|
|
94
|
+
}
|
|
95
|
+
function* createPresetDescriptors(items, dirname, alias, passPerPreset) {
|
|
96
|
+
return yield* createDescriptors("preset", items, dirname, alias, passPerPreset);
|
|
97
|
+
}
|
|
98
|
+
function* createPluginDescriptors(items, dirname, alias) {
|
|
99
|
+
return yield* createDescriptors("plugin", items, dirname, alias);
|
|
100
|
+
}
|
|
101
|
+
function* createDescriptors(type, items, dirname, alias, ownPass) {
|
|
102
|
+
const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, {
|
|
103
|
+
type,
|
|
104
|
+
alias: `${alias}$${index}`,
|
|
105
|
+
ownPass: !!ownPass
|
|
106
|
+
})));
|
|
107
|
+
assertNoDuplicates(descriptors);
|
|
108
|
+
return descriptors;
|
|
109
|
+
}
|
|
110
|
+
function* createDescriptor(pair, dirname, {
|
|
111
|
+
type,
|
|
112
|
+
alias,
|
|
113
|
+
ownPass
|
|
114
|
+
}) {
|
|
115
|
+
const desc = (0, _item.getItemDescriptor)(pair);
|
|
116
|
+
if (desc) {
|
|
117
|
+
return desc;
|
|
118
|
+
}
|
|
119
|
+
let name;
|
|
120
|
+
let options;
|
|
121
|
+
let value = pair;
|
|
122
|
+
if (Array.isArray(value)) {
|
|
123
|
+
if (value.length === 3) {
|
|
124
|
+
[value, options, name] = value;
|
|
125
|
+
} else {
|
|
126
|
+
[value, options] = value;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
let file = undefined;
|
|
130
|
+
let filepath = null;
|
|
131
|
+
if (typeof value === "string") {
|
|
132
|
+
if (typeof type !== "string") {
|
|
133
|
+
throw new Error("To resolve a string-based item, the type of item must be given");
|
|
134
|
+
}
|
|
135
|
+
const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset;
|
|
136
|
+
const request = value;
|
|
137
|
+
({
|
|
138
|
+
filepath,
|
|
139
|
+
value
|
|
140
|
+
} = yield* resolver(value, dirname));
|
|
141
|
+
file = {
|
|
142
|
+
request,
|
|
143
|
+
resolved: filepath
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (!value) {
|
|
147
|
+
throw new Error(`Unexpected falsy value: ${String(value)}`);
|
|
148
|
+
}
|
|
149
|
+
if (typeof value === "object" && value.__esModule) {
|
|
150
|
+
if (value.default) {
|
|
151
|
+
value = value.default;
|
|
152
|
+
} else {
|
|
153
|
+
throw new Error("Must export a default export when using ES6 modules.");
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (typeof value !== "object" && typeof value !== "function") {
|
|
157
|
+
throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`);
|
|
158
|
+
}
|
|
159
|
+
if (filepath !== null && typeof value === "object" && value) {
|
|
160
|
+
throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
name,
|
|
164
|
+
alias: filepath || alias,
|
|
165
|
+
value,
|
|
166
|
+
options,
|
|
167
|
+
dirname,
|
|
168
|
+
ownPass,
|
|
169
|
+
file
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function assertNoDuplicates(items) {
|
|
173
|
+
const map = new Map();
|
|
174
|
+
for (const item of items) {
|
|
175
|
+
if (typeof item.value !== "function") continue;
|
|
176
|
+
let nameMap = map.get(item.value);
|
|
177
|
+
if (!nameMap) {
|
|
178
|
+
nameMap = new Set();
|
|
179
|
+
map.set(item.value, nameMap);
|
|
180
|
+
}
|
|
181
|
+
if (nameMap.has(item.name)) {
|
|
182
|
+
const conflicts = items.filter(i => i.value === item.value);
|
|
183
|
+
throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n"));
|
|
184
|
+
}
|
|
185
|
+
nameMap.add(item.name);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
0 && 0;
|
|
189
|
+
|
|
190
|
+
//# sourceMappingURL=config-descriptors.js.map
|