@powerlines/core 0.48.24 → 0.48.26
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/dist/_virtual/_rolldown/runtime.cjs +8 -0
- package/dist/constants/api.cjs +8 -0
- package/dist/constants/api.d.mts +2 -0
- package/dist/constants/api.d.mts.map +1 -1
- package/dist/constants/api.mjs +8 -0
- package/dist/constants/api.mjs.map +1 -1
- package/dist/constants/commands.cjs +8 -0
- package/dist/constants/commands.d.mts +2 -0
- package/dist/constants/commands.d.mts.map +1 -1
- package/dist/constants/commands.mjs +8 -0
- package/dist/constants/commands.mjs.map +1 -1
- package/dist/constants/devtools.cjs +8 -0
- package/dist/constants/devtools.d.mts +2 -0
- package/dist/constants/devtools.d.mts.map +1 -1
- package/dist/constants/devtools.mjs +8 -0
- package/dist/constants/devtools.mjs.map +1 -1
- package/dist/constants/environments.cjs +8 -0
- package/dist/constants/environments.d.mts +2 -0
- package/dist/constants/environments.d.mts.map +1 -1
- package/dist/constants/environments.mjs +8 -0
- package/dist/constants/environments.mjs.map +1 -1
- package/dist/constants/extensions.cjs +8 -0
- package/dist/constants/extensions.d.mts +2 -0
- package/dist/constants/extensions.d.mts.map +1 -1
- package/dist/constants/extensions.mjs +8 -0
- package/dist/constants/extensions.mjs.map +1 -1
- package/dist/constants/fs.cjs +8 -0
- package/dist/constants/fs.d.mts +2 -0
- package/dist/constants/fs.d.mts.map +1 -1
- package/dist/constants/fs.mjs +8 -0
- package/dist/constants/fs.mjs.map +1 -1
- package/dist/constants/hooks.cjs +8 -0
- package/dist/constants/hooks.d.mts +2 -0
- package/dist/constants/hooks.d.mts.map +1 -1
- package/dist/constants/hooks.mjs +8 -0
- package/dist/constants/hooks.mjs.map +1 -1
- package/dist/constants/index.cjs +8 -0
- package/dist/constants/index.d.mts +2 -0
- package/dist/constants/index.mjs +8 -0
- package/dist/constants/log-level.cjs +8 -0
- package/dist/constants/log-level.d.mts +2 -0
- package/dist/constants/log-level.d.mts.map +1 -1
- package/dist/constants/log-level.mjs +8 -0
- package/dist/constants/log-level.mjs.map +1 -1
- package/dist/constants/meta.cjs +8 -0
- package/dist/constants/meta.d.mts +2 -0
- package/dist/constants/meta.d.mts.map +1 -1
- package/dist/constants/meta.mjs +8 -0
- package/dist/constants/meta.mjs.map +1 -1
- package/dist/constants/plugin.cjs +8 -0
- package/dist/constants/plugin.d.mts +2 -0
- package/dist/constants/plugin.d.mts.map +1 -1
- package/dist/constants/plugin.mjs +8 -0
- package/dist/constants/plugin.mjs.map +1 -1
- package/dist/context/base-context.cjs +8 -0
- package/dist/context/base-context.d.mts +2 -0
- package/dist/context/base-context.d.mts.map +1 -1
- package/dist/context/base-context.mjs +8 -0
- package/dist/context/base-context.mjs.map +1 -1
- package/dist/context/context.cjs +18 -2
- package/dist/context/context.d.cts +4 -0
- package/dist/context/context.d.cts.map +1 -1
- package/dist/context/context.d.mts +6 -0
- package/dist/context/context.d.mts.map +1 -1
- package/dist/context/context.mjs +19 -3
- package/dist/context/context.mjs.map +1 -1
- package/dist/context/environment-context.cjs +8 -0
- package/dist/context/environment-context.d.cts.map +1 -1
- package/dist/context/environment-context.d.mts +2 -0
- package/dist/context/environment-context.d.mts.map +1 -1
- package/dist/context/environment-context.mjs +8 -0
- package/dist/context/environment-context.mjs.map +1 -1
- package/dist/context/execution-context.cjs +9 -1
- package/dist/context/execution-context.d.mts +2 -0
- package/dist/context/execution-context.d.mts.map +1 -1
- package/dist/context/execution-context.mjs +9 -1
- package/dist/context/execution-context.mjs.map +1 -1
- package/dist/context/index.cjs +8 -0
- package/dist/context/index.d.mts +2 -0
- package/dist/context/index.mjs +8 -0
- package/dist/context/plugin-context.cjs +8 -0
- package/dist/context/plugin-context.d.mts +2 -0
- package/dist/context/plugin-context.d.mts.map +1 -1
- package/dist/context/plugin-context.mjs +8 -0
- package/dist/context/plugin-context.mjs.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +8 -0
- package/dist/lib/config.cjs +8 -0
- package/dist/lib/config.d.mts +2 -0
- package/dist/lib/config.d.mts.map +1 -1
- package/dist/lib/config.mjs +8 -0
- package/dist/lib/config.mjs.map +1 -1
- package/dist/lib/context-helpers.cjs +8 -0
- package/dist/lib/context-helpers.d.cts +4 -4
- package/dist/lib/context-helpers.d.mts +6 -4
- package/dist/lib/context-helpers.d.mts.map +1 -1
- package/dist/lib/context-helpers.mjs +8 -0
- package/dist/lib/context-helpers.mjs.map +1 -1
- package/dist/lib/entry.cjs +8 -0
- package/dist/lib/entry.d.mts +2 -0
- package/dist/lib/entry.d.mts.map +1 -1
- package/dist/lib/entry.mjs +8 -0
- package/dist/lib/entry.mjs.map +1 -1
- package/dist/lib/environment.cjs +8 -0
- package/dist/lib/environment.d.mts +2 -0
- package/dist/lib/environment.d.mts.map +1 -1
- package/dist/lib/environment.mjs +8 -0
- package/dist/lib/environment.mjs.map +1 -1
- package/dist/lib/events.cjs +8 -0
- package/dist/lib/events.d.mts +2 -0
- package/dist/lib/events.d.mts.map +1 -1
- package/dist/lib/events.mjs +8 -0
- package/dist/lib/events.mjs.map +1 -1
- package/dist/lib/generate-types.cjs +8 -0
- package/dist/lib/generate-types.d.mts +2 -0
- package/dist/lib/generate-types.d.mts.map +1 -1
- package/dist/lib/generate-types.mjs +8 -0
- package/dist/lib/generate-types.mjs.map +1 -1
- package/dist/lib/hooks.cjs +8 -0
- package/dist/lib/hooks.d.mts +2 -0
- package/dist/lib/hooks.d.mts.map +1 -1
- package/dist/lib/hooks.mjs +8 -0
- package/dist/lib/hooks.mjs.map +1 -1
- package/dist/lib/index.cjs +8 -0
- package/dist/lib/index.d.mts +2 -0
- package/dist/lib/index.mjs +8 -0
- package/dist/lib/install-dependencies.cjs +8 -0
- package/dist/lib/install-dependencies.d.mts +2 -0
- package/dist/lib/install-dependencies.d.mts.map +1 -1
- package/dist/lib/install-dependencies.mjs +8 -0
- package/dist/lib/install-dependencies.mjs.map +1 -1
- package/dist/lib/meta.cjs +8 -0
- package/dist/lib/meta.d.mts +2 -0
- package/dist/lib/meta.d.mts.map +1 -1
- package/dist/lib/meta.mjs +8 -0
- package/dist/lib/meta.mjs.map +1 -1
- package/dist/lib/plugins.cjs +8 -0
- package/dist/lib/plugins.d.mts +2 -0
- package/dist/lib/plugins.d.mts.map +1 -1
- package/dist/lib/plugins.mjs +8 -0
- package/dist/lib/plugins.mjs.map +1 -1
- package/dist/lib/resolver.cjs +8 -0
- package/dist/lib/resolver.d.mts +2 -0
- package/dist/lib/resolver.d.mts.map +1 -1
- package/dist/lib/resolver.mjs +8 -0
- package/dist/lib/resolver.mjs.map +1 -1
- package/dist/lib/schemas.cjs +8 -0
- package/dist/lib/schemas.d.mts +2 -0
- package/dist/lib/schemas.mjs +8 -0
- package/dist/lib/streaming-channel.cjs +8 -0
- package/dist/lib/streaming-channel.d.mts +2 -0
- package/dist/lib/streaming-channel.d.mts.map +1 -1
- package/dist/lib/streaming-channel.mjs +8 -0
- package/dist/lib/streaming-channel.mjs.map +1 -1
- package/dist/lib/typescript/index.cjs +8 -0
- package/dist/lib/typescript/index.d.mts +2 -0
- package/dist/lib/typescript/index.mjs +8 -0
- package/dist/lib/typescript/ts-morph.cjs +8 -0
- package/dist/lib/typescript/ts-morph.d.mts +2 -0
- package/dist/lib/typescript/ts-morph.d.mts.map +1 -1
- package/dist/lib/typescript/ts-morph.mjs +8 -0
- package/dist/lib/typescript/ts-morph.mjs.map +1 -1
- package/dist/lib/typescript/tsconfig.cjs +8 -0
- package/dist/lib/typescript/tsconfig.d.mts +2 -0
- package/dist/lib/typescript/tsconfig.d.mts.map +1 -1
- package/dist/lib/typescript/tsconfig.mjs +8 -0
- package/dist/lib/typescript/tsconfig.mjs.map +1 -1
- package/dist/lib/unplugin/helpers.cjs +8 -0
- package/dist/lib/unplugin/helpers.d.mts +2 -0
- package/dist/lib/unplugin/helpers.d.mts.map +1 -1
- package/dist/lib/unplugin/helpers.mjs +8 -0
- package/dist/lib/unplugin/helpers.mjs.map +1 -1
- package/dist/lib/unplugin/index.cjs +8 -0
- package/dist/lib/unplugin/index.d.mts +2 -0
- package/dist/lib/unplugin/index.mjs +8 -0
- package/dist/lib/unplugin/module-resolution.cjs +8 -0
- package/dist/lib/unplugin/module-resolution.d.mts +2 -0
- package/dist/lib/unplugin/module-resolution.d.mts.map +1 -1
- package/dist/lib/unplugin/module-resolution.mjs +8 -0
- package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.cjs +8 -0
- package/dist/lib/unplugin/plugin.d.mts +2 -0
- package/dist/lib/unplugin/plugin.d.mts.map +1 -1
- package/dist/lib/unplugin/plugin.mjs +8 -0
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/lib/utilities/file-header.cjs +8 -0
- package/dist/lib/utilities/file-header.d.mts +2 -0
- package/dist/lib/utilities/file-header.d.mts.map +1 -1
- package/dist/lib/utilities/file-header.mjs +8 -0
- package/dist/lib/utilities/file-header.mjs.map +1 -1
- package/dist/lib/utilities/format.cjs +8 -0
- package/dist/lib/utilities/format.d.mts +2 -0
- package/dist/lib/utilities/format.d.mts.map +1 -1
- package/dist/lib/utilities/format.mjs +8 -0
- package/dist/lib/utilities/format.mjs.map +1 -1
- package/dist/lib/utilities/index.cjs +8 -0
- package/dist/lib/utilities/index.d.mts +2 -0
- package/dist/lib/utilities/index.mjs +8 -0
- package/dist/lib/utilities/source-file.cjs +8 -0
- package/dist/lib/utilities/source-file.d.mts +2 -0
- package/dist/lib/utilities/source-file.d.mts.map +1 -1
- package/dist/lib/utilities/source-file.mjs +8 -0
- package/dist/lib/utilities/source-file.mjs.map +1 -1
- package/dist/lib/utilities/source-map.cjs +8 -0
- package/dist/lib/utilities/source-map.d.mts +2 -0
- package/dist/lib/utilities/source-map.d.mts.map +1 -1
- package/dist/lib/utilities/source-map.mjs +8 -0
- package/dist/lib/utilities/source-map.mjs.map +1 -1
- package/dist/lib/utilities/write-file.cjs +8 -0
- package/dist/lib/utilities/write-file.d.mts +2 -0
- package/dist/lib/utilities/write-file.d.mts.map +1 -1
- package/dist/lib/utilities/write-file.mjs +8 -0
- package/dist/lib/utilities/write-file.mjs.map +1 -1
- package/dist/lib/vfs.cjs +8 -0
- package/dist/lib/vfs.d.mts +2 -0
- package/dist/lib/vfs.d.mts.map +1 -1
- package/dist/lib/vfs.mjs +8 -0
- package/dist/lib/vfs.mjs.map +1 -1
- package/dist/plugin-base.cjs +8 -0
- package/dist/plugin-base.d.mts +2 -0
- package/dist/plugin-base.d.mts.map +1 -1
- package/dist/plugin-base.mjs +8 -0
- package/dist/plugin-base.mjs.map +1 -1
- package/dist/plugin-utils/build-helpers.cjs +8 -0
- package/dist/plugin-utils/build-helpers.d.mts +2 -0
- package/dist/plugin-utils/build-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/build-helpers.mjs +8 -0
- package/dist/plugin-utils/build-helpers.mjs.map +1 -1
- package/dist/plugin-utils/combine-plugins.cjs +8 -0
- package/dist/plugin-utils/combine-plugins.d.mts +2 -0
- package/dist/plugin-utils/combine-plugins.d.mts.map +1 -1
- package/dist/plugin-utils/combine-plugins.mjs +8 -0
- package/dist/plugin-utils/combine-plugins.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +35 -0
- package/dist/plugin-utils/context-helpers.d.cts +25 -1
- package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +27 -1
- package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +35 -1
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/docs-helper.cjs +8 -0
- package/dist/plugin-utils/docs-helper.d.mts +2 -0
- package/dist/plugin-utils/docs-helper.d.mts.map +1 -1
- package/dist/plugin-utils/docs-helper.mjs +8 -0
- package/dist/plugin-utils/docs-helper.mjs.map +1 -1
- package/dist/plugin-utils/enable-plugin.cjs +8 -0
- package/dist/plugin-utils/enable-plugin.d.mts +2 -0
- package/dist/plugin-utils/enable-plugin.d.mts.map +1 -1
- package/dist/plugin-utils/enable-plugin.mjs +8 -0
- package/dist/plugin-utils/enable-plugin.mjs.map +1 -1
- package/dist/plugin-utils/extend.cjs +8 -0
- package/dist/plugin-utils/extend.d.mts +2 -0
- package/dist/plugin-utils/extend.d.mts.map +1 -1
- package/dist/plugin-utils/extend.mjs +8 -0
- package/dist/plugin-utils/extend.mjs.map +1 -1
- package/dist/plugin-utils/filter.cjs +8 -0
- package/dist/plugin-utils/filter.d.mts +2 -0
- package/dist/plugin-utils/filter.d.mts.map +1 -1
- package/dist/plugin-utils/filter.mjs +8 -0
- package/dist/plugin-utils/filter.mjs.map +1 -1
- package/dist/plugin-utils/format-package-json.cjs +8 -0
- package/dist/plugin-utils/format-package-json.d.mts +2 -0
- package/dist/plugin-utils/format-package-json.d.mts.map +1 -1
- package/dist/plugin-utils/format-package-json.mjs +8 -0
- package/dist/plugin-utils/format-package-json.mjs.map +1 -1
- package/dist/plugin-utils/format.cjs +8 -0
- package/dist/plugin-utils/format.d.mts +2 -0
- package/dist/plugin-utils/format.d.mts.map +1 -1
- package/dist/plugin-utils/format.mjs +8 -0
- package/dist/plugin-utils/format.mjs.map +1 -1
- package/dist/plugin-utils/get-config-path.cjs +8 -0
- package/dist/plugin-utils/get-config-path.d.mts +2 -0
- package/dist/plugin-utils/get-config-path.d.mts.map +1 -1
- package/dist/plugin-utils/get-config-path.mjs +8 -0
- package/dist/plugin-utils/get-config-path.mjs.map +1 -1
- package/dist/plugin-utils/helpers.cjs +8 -0
- package/dist/plugin-utils/helpers.d.mts +2 -0
- package/dist/plugin-utils/helpers.d.mts.map +1 -1
- package/dist/plugin-utils/helpers.mjs +8 -0
- package/dist/plugin-utils/helpers.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +9 -0
- package/dist/plugin-utils/index.d.cts +2 -2
- package/dist/plugin-utils/index.d.mts +4 -2
- package/dist/plugin-utils/index.mjs +10 -2
- package/dist/plugin-utils/install.cjs +8 -0
- package/dist/plugin-utils/install.d.mts +2 -0
- package/dist/plugin-utils/install.d.mts.map +1 -1
- package/dist/plugin-utils/install.mjs +8 -0
- package/dist/plugin-utils/install.mjs.map +1 -1
- package/dist/plugin-utils/logging.cjs +8 -0
- package/dist/plugin-utils/logging.d.mts +2 -0
- package/dist/plugin-utils/logging.d.mts.map +1 -1
- package/dist/plugin-utils/logging.mjs +8 -0
- package/dist/plugin-utils/logging.mjs.map +1 -1
- package/dist/plugin-utils/merge.cjs +8 -0
- package/dist/plugin-utils/merge.d.mts +2 -0
- package/dist/plugin-utils/merge.d.mts.map +1 -1
- package/dist/plugin-utils/merge.mjs +8 -0
- package/dist/plugin-utils/merge.mjs.map +1 -1
- package/dist/plugin-utils/modules.cjs +8 -0
- package/dist/plugin-utils/modules.d.mts +2 -0
- package/dist/plugin-utils/modules.d.mts.map +1 -1
- package/dist/plugin-utils/modules.mjs +8 -0
- package/dist/plugin-utils/modules.mjs.map +1 -1
- package/dist/plugin-utils/paths.cjs +8 -0
- package/dist/plugin-utils/paths.d.mts +2 -0
- package/dist/plugin-utils/paths.d.mts.map +1 -1
- package/dist/plugin-utils/paths.mjs +8 -0
- package/dist/plugin-utils/paths.mjs.map +1 -1
- package/dist/plugin-utils/virtual.cjs +8 -0
- package/dist/plugin-utils/virtual.d.mts +2 -0
- package/dist/plugin-utils/virtual.d.mts.map +1 -1
- package/dist/plugin-utils/virtual.mjs +8 -0
- package/dist/plugin-utils/virtual.mjs.map +1 -1
- package/dist/schemas/fs.cjs +8 -0
- package/dist/schemas/fs.d.mts +2 -0
- package/dist/schemas/fs.d.mts.map +1 -1
- package/dist/schemas/fs.mjs +8 -0
- package/dist/schemas/fs.mjs.map +1 -1
- package/dist/storage/base.cjs +8 -0
- package/dist/storage/base.d.mts +2 -0
- package/dist/storage/base.d.mts.map +1 -1
- package/dist/storage/base.mjs +8 -0
- package/dist/storage/base.mjs.map +1 -1
- package/dist/storage/file-system.cjs +8 -0
- package/dist/storage/file-system.d.mts +2 -0
- package/dist/storage/file-system.d.mts.map +1 -1
- package/dist/storage/file-system.mjs +8 -0
- package/dist/storage/file-system.mjs.map +1 -1
- package/dist/storage/helpers.cjs +8 -0
- package/dist/storage/helpers.d.mts +2 -0
- package/dist/storage/helpers.d.mts.map +1 -1
- package/dist/storage/helpers.mjs +8 -0
- package/dist/storage/helpers.mjs.map +1 -1
- package/dist/storage/index.cjs +8 -0
- package/dist/storage/index.d.mts +2 -0
- package/dist/storage/index.mjs +8 -0
- package/dist/storage/virtual.cjs +8 -0
- package/dist/storage/virtual.d.mts +2 -0
- package/dist/storage/virtual.d.mts.map +1 -1
- package/dist/storage/virtual.mjs +8 -0
- package/dist/storage/virtual.mjs.map +1 -1
- package/dist/types/api.d.cts +3 -3
- package/dist/types/api.d.cts.map +1 -1
- package/dist/types/api.d.mts +5 -3
- package/dist/types/api.d.mts.map +1 -1
- package/dist/types/config.d.cts +2 -2
- package/dist/types/config.d.mts +4 -2
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/context.d.cts +7 -3
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +9 -3
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/fs.d.mts +2 -0
- package/dist/types/fs.d.mts.map +1 -1
- package/dist/types/hooks.d.mts +2 -0
- package/dist/types/hooks.d.mts.map +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.mts +3 -1
- package/dist/types/logging.d.mts +2 -0
- package/dist/types/logging.d.mts.map +1 -1
- package/dist/types/plugin.d.mts +2 -0
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/tsconfig.d.mts +2 -0
- package/dist/types/tsconfig.d.mts.map +1 -1
- package/dist/types/unplugin.d.mts +2 -0
- package/dist/types/unplugin.d.mts.map +1 -1
- package/package.json +7 -7
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
10
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
3
11
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
1
3
|
//#region src/plugin-utils/format.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.mts","names":[],"sources":["../../src/plugin-utils/format.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.d.mts","names":[],"sources":["../../src/plugin-utils/format.ts"],"mappings":";;;;;;;;;iBAgCgB,YAAA,CAAa,MAA2B,EAAnB,MAAM"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
2
10
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
3
11
|
import { toArray } from "@stryke/convert/to-array";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.mjs","names":[],"sources":["../../src/plugin-utils/format.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetArray } from \"@stryke/type-checks/is-set-array\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { ResolveConfig, ResolvedConfig } from \"../types/config\";\n\n/**\n * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.\n *\n * @param config - The configuration object to format.\n * @returns A formatted string representation of the configuration.\n */\nexport function formatConfig(config: Record<string, any>): string {\n return JSON.stringify(\n Object.fromEntries(\n Object.entries({\n ...omit(config, [\n \"deps\",\n \"resolve\",\n \"plugins\",\n \"initialConfig\",\n \"userConfig\",\n \"inlineConfig\",\n \"pluginConfig\",\n \"environmentConfig\"\n ]),\n deps: isSetObject(config.deps)\n ? {\n alwaysBundle: isSetArray(\n (config.deps as { alwaysBundle?: unknown[] })?.alwaysBundle\n )\n ? (\n (config.deps as { alwaysBundle?: unknown[] })\n ?.alwaysBundle ?? []\n )\n .filter(Boolean)\n .map(alwaysBundle =>\n isSetString(alwaysBundle)\n ? alwaysBundle\n : isRegExp(alwaysBundle)\n ? alwaysBundle.source\n : \"<unknown-bundle>\"\n )\n : undefined,\n onlyBundle: isSetArray(\n (config.deps as { onlyBundle?: unknown[] })?.onlyBundle\n )\n ? (\n (config.deps as { onlyBundle?: unknown[] })?.onlyBundle ??\n []\n )\n .filter(Boolean)\n .map(onlyBundle =>\n isSetString(onlyBundle)\n ? onlyBundle\n : isRegExp(onlyBundle)\n ? onlyBundle.source\n : \"<unknown-bundle>\"\n )\n : undefined,\n neverBundle: isSetArray(\n (config.deps as { neverBundle?: unknown[] })?.neverBundle\n )\n ? (\n (config.deps as { neverBundle?: unknown[] })?.neverBundle ??\n []\n )\n .filter(Boolean)\n .map(neverBundle =>\n isSetString(neverBundle)\n ? neverBundle\n : isRegExp(neverBundle)\n ? neverBundle.source\n : \"<unknown-bundle>\"\n )\n : undefined\n }\n : undefined,\n\n resolve: isSetObject(config.resolve)\n ? {\n ...config.resolve,\n external: isSetArray((config.resolve as ResolveConfig)?.external)\n ? ((config.resolve as ResolveConfig)?.external ?? [])\n .filter(Boolean)\n .map(external =>\n isSetString(external)\n ? external\n : isRegExp(external)\n ? external.source\n : \"<unknown-bundle>\"\n )\n : undefined,\n noExternal: isSetArray(\n (config.resolve as ResolveConfig)?.noExternal\n )\n ? ((config.resolve as ResolveConfig)?.noExternal ?? [])\n .filter(Boolean)\n .map(noExternal =>\n isSetString(noExternal)\n ? noExternal\n : isRegExp(noExternal)\n ? noExternal.source\n : \"<unknown-bundle>\"\n )\n : undefined\n }\n : undefined,\n plugins: isSetArray(config.plugins)\n ? (toArray(config.plugins) as ResolvedConfig[\"plugins\"])\n ?.flatMap(plugin => toArray(plugin))\n ?.map(plugin =>\n String(\n isSetString(plugin)\n ? plugin\n : isSetObject(plugin) &&\n isSetString((plugin as { name: string }).name)\n ? (plugin as { name: string }).name\n : Array.isArray(plugin) && isSetString(plugin[0])\n ? plugin[0]\n : \"<function-plugin>\"\n )\n )\n : undefined\n }).sort(([key1], [key2]) => key1.localeCompare(key2))\n ),\n null,\n 4\n )\n .replace(/\"([^\"]+)\":/g, \"$1:\")\n .replace(/,\\s*$/g, \"\");\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.mjs","names":[],"sources":["../../src/plugin-utils/format.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetArray } from \"@stryke/type-checks/is-set-array\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { ResolveConfig, ResolvedConfig } from \"../types/config\";\n\n/**\n * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.\n *\n * @param config - The configuration object to format.\n * @returns A formatted string representation of the configuration.\n */\nexport function formatConfig(config: Record<string, any>): string {\n return JSON.stringify(\n Object.fromEntries(\n Object.entries({\n ...omit(config, [\n \"deps\",\n \"resolve\",\n \"plugins\",\n \"initialConfig\",\n \"userConfig\",\n \"inlineConfig\",\n \"pluginConfig\",\n \"environmentConfig\"\n ]),\n deps: isSetObject(config.deps)\n ? {\n alwaysBundle: isSetArray(\n (config.deps as { alwaysBundle?: unknown[] })?.alwaysBundle\n )\n ? (\n (config.deps as { alwaysBundle?: unknown[] })\n ?.alwaysBundle ?? []\n )\n .filter(Boolean)\n .map(alwaysBundle =>\n isSetString(alwaysBundle)\n ? alwaysBundle\n : isRegExp(alwaysBundle)\n ? alwaysBundle.source\n : \"<unknown-bundle>\"\n )\n : undefined,\n onlyBundle: isSetArray(\n (config.deps as { onlyBundle?: unknown[] })?.onlyBundle\n )\n ? (\n (config.deps as { onlyBundle?: unknown[] })?.onlyBundle ??\n []\n )\n .filter(Boolean)\n .map(onlyBundle =>\n isSetString(onlyBundle)\n ? onlyBundle\n : isRegExp(onlyBundle)\n ? onlyBundle.source\n : \"<unknown-bundle>\"\n )\n : undefined,\n neverBundle: isSetArray(\n (config.deps as { neverBundle?: unknown[] })?.neverBundle\n )\n ? (\n (config.deps as { neverBundle?: unknown[] })?.neverBundle ??\n []\n )\n .filter(Boolean)\n .map(neverBundle =>\n isSetString(neverBundle)\n ? neverBundle\n : isRegExp(neverBundle)\n ? neverBundle.source\n : \"<unknown-bundle>\"\n )\n : undefined\n }\n : undefined,\n\n resolve: isSetObject(config.resolve)\n ? {\n ...config.resolve,\n external: isSetArray((config.resolve as ResolveConfig)?.external)\n ? ((config.resolve as ResolveConfig)?.external ?? [])\n .filter(Boolean)\n .map(external =>\n isSetString(external)\n ? external\n : isRegExp(external)\n ? external.source\n : \"<unknown-bundle>\"\n )\n : undefined,\n noExternal: isSetArray(\n (config.resolve as ResolveConfig)?.noExternal\n )\n ? ((config.resolve as ResolveConfig)?.noExternal ?? [])\n .filter(Boolean)\n .map(noExternal =>\n isSetString(noExternal)\n ? noExternal\n : isRegExp(noExternal)\n ? noExternal.source\n : \"<unknown-bundle>\"\n )\n : undefined\n }\n : undefined,\n plugins: isSetArray(config.plugins)\n ? (toArray(config.plugins) as ResolvedConfig[\"plugins\"])\n ?.flatMap(plugin => toArray(plugin))\n ?.map(plugin =>\n String(\n isSetString(plugin)\n ? plugin\n : isSetObject(plugin) &&\n isSetString((plugin as { name: string }).name)\n ? (plugin as { name: string }).name\n : Array.isArray(plugin) && isSetString(plugin[0])\n ? plugin[0]\n : \"<function-plugin>\"\n )\n )\n : undefined\n }).sort(([key1], [key2]) => key1.localeCompare(key2))\n ),\n null,\n 4\n )\n .replace(/\"([^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nB,SAAQ,WAAU,QAAQ,MAAM,CAAC,GACjC,KAAI,WACJ,OACE,YAAY,MAAM,IACd,SACA,YAAY,MAAM,KAChB,YAAa,OAA4B,IAAI,IAC5C,OAA4B,OAC7B,MAAM,QAAQ,MAAM,KAAK,YAAY,OAAO,EAAE,IAC5C,OAAO,KACP,mBACV,CACF,IACF;CACN,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,KAAK,cAAc,IAAI,CAAC,CACtD,GACA,MACA,CACF,EACG,QAAQ,eAAe,KAAK,EAC5B,QAAQ,UAAU,EAAE;AACzB"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
10
|
let _stryke_path_join = require("@stryke/path/join");
|
|
3
11
|
let node_fs = require("node:fs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-config-path.d.mts","names":[],"sources":["../../src/plugin-utils/get-config-path.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-config-path.d.mts","names":[],"sources":["../../src/plugin-utils/get-config-path.ts"],"mappings":";;;;;;;;;;;;iBA6BgB,aAAA,CACd,OAAA,EAAS,iBAAiB;EAAK,GAAA;EAAc,IAAA;AAAA,GAC7C,IAAA"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
import { joinPaths } from "@stryke/path/join";
|
|
2
10
|
import { existsSync } from "node:fs";
|
|
3
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-config-path.mjs","names":[],"sources":["../../src/plugin-utils/get-config-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { existsSync } from \"node:fs\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Get the configuration file path for a given name.\n *\n * @param context - The Powerlines context.\n * @param name - The name of the configuration file (without extension).\n * @returns The absolute path to the configuration file, or undefined if not found.\n */\nexport function getConfigPath(\n context: UnresolvedContext | { cwd?: string; root: string },\n name: string\n): string | undefined {\n const cwd =\n ((context as UnresolvedContext).config\n ? (context as UnresolvedContext).config.cwd\n : (context as { cwd?: string; root: string }).cwd) || process.cwd();\n const root = (context as UnresolvedContext).config\n ? (context as UnresolvedContext).config.root\n : (context as { cwd?: string; root: string }).root;\n\n if (existsSync(joinPaths(cwd, root, `${name}.yml`))) {\n return joinPaths(cwd, root, `${name}.yml`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.yaml`))) {\n return joinPaths(cwd, root, `${name}.yaml`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.json`))) {\n return joinPaths(cwd, root, `${name}.json`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.jsonc`))) {\n return joinPaths(cwd, root, `${name}.jsonc`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.ts`))) {\n return joinPaths(cwd, root, `${name}.ts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.cts`))) {\n return joinPaths(cwd, root, `${name}.cts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.mts`))) {\n return joinPaths(cwd, root, `${name}.mts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.js`))) {\n return joinPaths(cwd, root, `${name}.js`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.cjs`))) {\n return joinPaths(cwd, root, `${name}.cjs`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.mjs`))) {\n return joinPaths(cwd, root, `${name}.mjs`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.ts`))) {\n return joinPaths(cwd, root, `${name}.config.ts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.cts`))) {\n return joinPaths(cwd, root, `${name}.config.cts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.mts`))) {\n return joinPaths(cwd, root, `${name}.config.mts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.js`))) {\n return joinPaths(cwd, root, `${name}.config.js`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.cjs`))) {\n return joinPaths(cwd, root, `${name}.config.cjs`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.mjs`))) {\n return joinPaths(cwd, root, `${name}.config.mjs`);\n } else if (existsSync(joinPaths(cwd, `${name}.yml`))) {\n return joinPaths(cwd, `${name}.yml`);\n } else if (existsSync(joinPaths(cwd, `${name}.yaml`))) {\n return joinPaths(cwd, `${name}.yaml`);\n } else if (existsSync(joinPaths(cwd, `${name}.json`))) {\n return joinPaths(cwd, `${name}.json`);\n } else if (existsSync(joinPaths(cwd, `${name}.jsonc`))) {\n return joinPaths(cwd, `${name}.jsonc`);\n } else if (existsSync(joinPaths(cwd, `${name}.ts`))) {\n return joinPaths(cwd, `${name}.ts`);\n } else if (existsSync(joinPaths(cwd, `${name}.cts`))) {\n return joinPaths(cwd, `${name}.cts`);\n } else if (existsSync(joinPaths(cwd, `${name}.mts`))) {\n return joinPaths(cwd, `${name}.mts`);\n } else if (existsSync(joinPaths(cwd, `${name}.js`))) {\n return joinPaths(cwd, `${name}.js`);\n } else if (existsSync(joinPaths(cwd, `${name}.cjs`))) {\n return joinPaths(cwd, `${name}.cjs`);\n } else if (existsSync(joinPaths(cwd, `${name}.mjs`))) {\n return joinPaths(cwd, `${name}.mjs`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.ts`))) {\n return joinPaths(cwd, `${name}.config.ts`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.cts`))) {\n return joinPaths(cwd, `${name}.config.cts`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.mts`))) {\n return joinPaths(cwd, `${name}.config.mts`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.js`))) {\n return joinPaths(cwd, `${name}.config.js`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.cjs`))) {\n return joinPaths(cwd, `${name}.config.cjs`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.mjs`))) {\n return joinPaths(cwd, `${name}.config.mjs`);\n }\n\n return undefined;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-config-path.mjs","names":[],"sources":["../../src/plugin-utils/get-config-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { existsSync } from \"node:fs\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Get the configuration file path for a given name.\n *\n * @param context - The Powerlines context.\n * @param name - The name of the configuration file (without extension).\n * @returns The absolute path to the configuration file, or undefined if not found.\n */\nexport function getConfigPath(\n context: UnresolvedContext | { cwd?: string; root: string },\n name: string\n): string | undefined {\n const cwd =\n ((context as UnresolvedContext).config\n ? (context as UnresolvedContext).config.cwd\n : (context as { cwd?: string; root: string }).cwd) || process.cwd();\n const root = (context as UnresolvedContext).config\n ? (context as UnresolvedContext).config.root\n : (context as { cwd?: string; root: string }).root;\n\n if (existsSync(joinPaths(cwd, root, `${name}.yml`))) {\n return joinPaths(cwd, root, `${name}.yml`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.yaml`))) {\n return joinPaths(cwd, root, `${name}.yaml`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.json`))) {\n return joinPaths(cwd, root, `${name}.json`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.jsonc`))) {\n return joinPaths(cwd, root, `${name}.jsonc`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.ts`))) {\n return joinPaths(cwd, root, `${name}.ts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.cts`))) {\n return joinPaths(cwd, root, `${name}.cts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.mts`))) {\n return joinPaths(cwd, root, `${name}.mts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.js`))) {\n return joinPaths(cwd, root, `${name}.js`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.cjs`))) {\n return joinPaths(cwd, root, `${name}.cjs`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.mjs`))) {\n return joinPaths(cwd, root, `${name}.mjs`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.ts`))) {\n return joinPaths(cwd, root, `${name}.config.ts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.cts`))) {\n return joinPaths(cwd, root, `${name}.config.cts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.mts`))) {\n return joinPaths(cwd, root, `${name}.config.mts`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.js`))) {\n return joinPaths(cwd, root, `${name}.config.js`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.cjs`))) {\n return joinPaths(cwd, root, `${name}.config.cjs`);\n } else if (existsSync(joinPaths(cwd, root, `${name}.config.mjs`))) {\n return joinPaths(cwd, root, `${name}.config.mjs`);\n } else if (existsSync(joinPaths(cwd, `${name}.yml`))) {\n return joinPaths(cwd, `${name}.yml`);\n } else if (existsSync(joinPaths(cwd, `${name}.yaml`))) {\n return joinPaths(cwd, `${name}.yaml`);\n } else if (existsSync(joinPaths(cwd, `${name}.json`))) {\n return joinPaths(cwd, `${name}.json`);\n } else if (existsSync(joinPaths(cwd, `${name}.jsonc`))) {\n return joinPaths(cwd, `${name}.jsonc`);\n } else if (existsSync(joinPaths(cwd, `${name}.ts`))) {\n return joinPaths(cwd, `${name}.ts`);\n } else if (existsSync(joinPaths(cwd, `${name}.cts`))) {\n return joinPaths(cwd, `${name}.cts`);\n } else if (existsSync(joinPaths(cwd, `${name}.mts`))) {\n return joinPaths(cwd, `${name}.mts`);\n } else if (existsSync(joinPaths(cwd, `${name}.js`))) {\n return joinPaths(cwd, `${name}.js`);\n } else if (existsSync(joinPaths(cwd, `${name}.cjs`))) {\n return joinPaths(cwd, `${name}.cjs`);\n } else if (existsSync(joinPaths(cwd, `${name}.mjs`))) {\n return joinPaths(cwd, `${name}.mjs`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.ts`))) {\n return joinPaths(cwd, `${name}.config.ts`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.cts`))) {\n return joinPaths(cwd, `${name}.config.cts`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.mts`))) {\n return joinPaths(cwd, `${name}.config.mts`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.js`))) {\n return joinPaths(cwd, `${name}.config.js`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.cjs`))) {\n return joinPaths(cwd, `${name}.config.cjs`);\n } else if (existsSync(joinPaths(cwd, `${name}.config.mjs`))) {\n return joinPaths(cwd, `${name}.config.mjs`);\n }\n\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA6BA,SAAgB,cACd,SACA,MACoB;CACpB,MAAM,OACF,QAA8B,SAC3B,QAA8B,OAAO,MACrC,QAA2C,QAAQ,QAAQ,IAAI;CACtE,MAAM,OAAQ,QAA8B,SACvC,QAA8B,OAAO,OACrC,QAA2C;CAEhD,IAAI,WAAW,UAAU,KAAK,MAAM,GAAG,KAAK,KAAK,CAAC,GAChD,OAAO,UAAU,KAAK,MAAM,GAAG,KAAK,KAAK;MACpC,IAAI,WAAW,UAAU,KAAK,MAAM,GAAG,KAAK,MAAM,CAAC,GACxD,OAAO,UAAU,KAAK,MAAM,GAAG,KAAK,MAAM;MACrC,IAAI,WAAW,UAAU,KAAK,MAAM,GAAG,KAAK,MAAM,CAAC,GACxD,OAAO,UAAU,KAAK,MAAM,GAAG,KAAK,MAAM;MACrC,IAAI,WAAW,UAAU,KAAK,MAAM,GAAG,KAAK,OAAO,CAAC,GACzD,OAAO,UAAU,KAAK,MAAM,GAAG,KAAK,OAAO;MACtC,IAAI,WAAW,UAAU,KAAK,MAAM,GAAG,KAAK,IAAI,CAAC,GACtD,OAAO,UAAU,KAAK,MAAM,GAAG,KAAK,IAAI;MACnC,IAAI,WAAW,UAAU,KAAK,MAAM,GAAG,KAAK,KAAK,CAAC,GACvD,OAAO,UAAU,KAAK,MAAM,GAAG,KAAK,KAAK;MACpC,IAAI,WAAW,UAAU,KAAK,MAAM,GAAG,KAAK,KAAK,CAAC,GACvD,OAAO,UAAU,KAAK,MAAM,GAAG,KAAK,KAAK;MACpC,IAAI,WAAW,UAA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YAAY,CAAC,GACxD,OAAO,UAAU,KAAK,GAAG,KAAK,YAAY;AAI9C"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
10
|
const require_constants_plugin = require('../constants/plugin.cjs');
|
|
3
11
|
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
1
3
|
import { UnpluginBuilderVariant, UnpluginOptions } from "../types/unplugin.mjs";
|
|
2
4
|
import { Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, TypesResult } from "../types/plugin.mjs";
|
|
3
5
|
import { HooksListItem } from "../types/hooks.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"mappings":";;;;;;;;;;;;;;;;iBAsDgB,QAAA,kBAA0B,aAAA,GAAgB,aAAA,CAAA,CACxD,KAAA,YACC,KAAA,IAAS,MAAA,CAAO,QAAA;;;;;AAFnB;;iBA+BgB,oBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CACjC,KAAA,YAAiB,KAAA,IAAS,kBAAA,CAAmB,QAAA;;;;;;;iBAiB/B,mBA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AA,iCACkB,sBAAA,GAC9B,sBAAA,CAAA,CACF,KAAA,WAAgB,KAAA,IAAS,uBAAA;;;;;;;;iBAcX,WAAA,kBAA6B,aAAA,GAAgB,aAAA,CAAA,CAC3D,MAAA,EAAQ,MAAA,CAAO,QAAA,GACf,OAAA,EAAS,MAAA,CAAO,QAAA;AAxGlB;;;;;;AAAA,iBA2HgB,cAAA,kBACG,aAAA,GAAgB,aAAA,iBAClB,gBAAA,CAAiB,QAAA,IAAY,gBAAA,CAAiB,QAAA,iBAC/C,aAAA,CAAc,QAAA,EAAU,MAAA,IAAU,aAAA,CAC9C,QAAA,EACA,MAAA,EAAA,CAEF,SAAA,EAAW,KAAA,KAAU,KAAA;;;;;;;;;iBAsBP,aAAA,kBACG,aAAA,GAAgB,aAAA,iBAClB,gBAAA,CAAiB,QAAA,IAAY,gBAAA,CAAiB,QAAA,iBAC/C,aAAA,CAAc,QAAA,EAAU,MAAA,IAAU,aAAA,CAC9C,QAAA,EACA,MAAA,EAAA,CAGF,OAAA,EAAS,QAAA,EACT,MAAA,EAAQ,MAAA,CAAO,QAAA,GACf,UAAA,EAAY,UAAA,CAAW,WAAA,GACvB,SAAA,EAAW,KAAA,KACV,KAAA;;;AAjK+B;AAQlC;;;iBAsLgB,uBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CACjC,MAAA,EAAQ,YAAA,CAAa,QAAA"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
import { PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, UNPLUGIN_BUILDER_VARIANTS } from "../constants/plugin.mjs";
|
|
2
10
|
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
3
11
|
import { isFunction } from "@stryke/type-checks/is-function";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.mjs","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport {\n PLUGIN_HOOKS_FIELDS,\n PLUGIN_NON_HOOK_FIELDS,\n UNPLUGIN_BUILDER_VARIANTS\n} from \"../constants/plugin\";\nimport type {\n PluginConfig,\n PluginConfigObject,\n PluginConfigTuple\n} from \"../types/config\";\nimport type { PluginContext, WithUnpluginBuildContext } from \"../types/context\";\nimport type { HooksListItem } from \"../types/hooks\";\nimport type {\n Plugin,\n PluginHook,\n PluginHookFields,\n PluginHookObject,\n PluginHooks\n} from \"../types/plugin\";\nimport type {\n UnpluginBuilderVariant,\n UnpluginOptions\n} from \"../types/unplugin\";\n\n/**\n * Type guard to check if an object is a {@link Plugin}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link Plugin}, false otherwise\n */\nexport function isPlugin<TContext extends PluginContext = PluginContext>(\n value: unknown\n): value is Plugin<TContext> {\n return (\n isSetObject(value) &&\n \"name\" in value &&\n isSetString(value.name) &&\n (isUndefined((value as Plugin<TContext>).api) ||\n (\"api\" in value && isSetObject(value.api))) &&\n (isUndefined((value as Plugin<TContext>).applyToEnvironment) ||\n (\"applyToEnvironment\" in value &&\n isFunction(value.applyToEnvironment))) &&\n (isUndefined((value as Plugin<TContext>).dedupe) ||\n (\"dedupe\" in value && isFunction(value.dedupe))) &&\n PLUGIN_HOOKS_FIELDS.every(\n hook =>\n isUndefined((value as Record<string, unknown>)[hook]) ||\n (hook in value &&\n (isPluginHookFunction((value as Record<string, unknown>)[hook]) ||\n (hook === \"config\" &&\n isSetObject((value as Plugin<TContext>)[hook]))))\n )\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigObject}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigObject}, false otherwise\n */\nexport function isPluginConfigObject<\n TContext extends PluginContext = PluginContext\n>(value: unknown): value is PluginConfigObject<TContext> {\n return (\n isSetObject(value) &&\n \"plugin\" in value &&\n (((isSetString(value.plugin) || isFunction(value.plugin)) &&\n \"options\" in value &&\n isSetObject(value.options)) ||\n isPlugin(value.plugin))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigTuple}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigTuple}, false otherwise\n */\nexport function isPluginConfigTuple<\n TContext extends PluginContext = PluginContext\n>(value: unknown): value is PluginConfigTuple<TContext> {\n return (\n Array.isArray(value) &&\n (value.length === 1 || value.length === 2) &&\n (((isSetString(value[0]) || isFunction(value[0])) &&\n value.length > 1 &&\n isSetObject(value[1])) ||\n isPlugin(value[0]))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfig}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfig}, false otherwise\n */\nexport function isPluginConfig<TContext extends PluginContext = PluginContext>(\n value: unknown\n): value is PluginConfig<TContext> {\n return (\n isSetString(value) ||\n isFunction(value) ||\n isPlugin(value) ||\n isPluginConfigObject(value) ||\n isPluginConfigTuple(value) ||\n (Array.isArray(value) && value.every(item => isPluginConfig(item)))\n );\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookObject(\n value: unknown\n): value is PluginHookObject<AnyFunction> {\n return isSetObject(value) && \"handler\" in value && isFunction(value.handler);\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookFunction(value: unknown): value is AnyFunction {\n return isFunction(value) || isPluginHookObject(value);\n}\n\n/**\n * Type guard to check if an object is a {@link PluginHook}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginHook}, false otherwise\n */\nexport function isPluginHook(value: unknown): value is PluginHook<AnyFunction> {\n return isPluginHookFunction(value) || isPluginHookObject(value);\n}\n\nexport type GetHookHandlerReturnType<\n TContext extends PluginContext = PluginContext,\n TField extends string = string\n> = HooksListItem<TContext, TField>[\"handler\"];\n\n/**\n * Extract the hook handler function from a plugin hook\n *\n * @param pluginHook - The plugin hook to extract the handler function from\n * @returns The hook handler function\n */\nexport function getHookHandler<\n TContext extends PluginContext = PluginContext,\n TKey extends string = string\n>(\n pluginHook: PluginHook<AnyFunction>\n): GetHookHandlerReturnType<TContext, TKey> {\n return (\n isFunction(pluginHook) ? pluginHook : pluginHook.handler\n ) as GetHookHandlerReturnType<TContext, TKey>;\n}\n\n/**\n * Extract a plugin hook from a plugin\n *\n * @param context - The build context\n * @param plugin - The plugin to extract the hook from\n * @param hook - The name of the hook to extract\n * @returns The extracted hook, or undefined if the hook does not exist\n */\nexport function extractPluginHook<\n TContext extends PluginContext = PluginContext,\n TPlugin extends Plugin<TContext> = Plugin<TContext>\n>(context: TContext, plugin: TPlugin, hook: keyof PluginHooks<TContext>) {\n const pluginHook = plugin[hook];\n if (!isPluginHook(pluginHook)) {\n return undefined;\n }\n\n return isFunction(pluginHook)\n ? {\n normal: pluginHook.bind(context)\n }\n : {\n [pluginHook.order ? pluginHook.order : \"normal\"]:\n pluginHook.handler.bind(context)\n };\n}\n\n/**\n * Check if a hook is external.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookKey<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant,\n TContext extends PluginContext = PluginContext\n>(\n keys: string\n): keys is `${TUnpluginBuilderVariant}:${keyof UnpluginOptions<TContext>[TUnpluginBuilderVariant] & string}` {\n return UNPLUGIN_BUILDER_VARIANTS.some(variant =>\n keys.startsWith(`${variant}:`)\n );\n}\n\n/**\n * Check if a hook is internal.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isPluginHookField<TContext extends PluginContext>(\n keys: string\n) {\n return !PLUGIN_NON_HOOK_FIELDS.includes(keys as PluginHookFields<TContext>);\n}\n\n/**\n * Check if a hook is external.\n *\n * @param field - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookField<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(field: string): field is TUnpluginBuilderVariant {\n return (\n !isPluginHookField(field) &&\n UNPLUGIN_BUILDER_VARIANTS.includes(field as UnpluginBuilderVariant)\n );\n}\n\n/**\n * Check if a plugin should be deduplicated.\n *\n * @param plugin - The plugin to check\n * @param plugins - The list of plugins to check against\n * @returns True if the plugin should be deduplicated, false otherwise\n */\nexport function isDuplicate<TContext extends PluginContext = PluginContext>(\n plugin: Plugin<TContext>,\n plugins: Plugin<TContext>[]\n) {\n return (\n plugin.dedupe !== false &&\n plugins.some(\n p =>\n p.dedupe !== false &&\n ((isFunction(p.dedupe) && p.dedupe(plugin)) ||\n kebabCase(p.name) === kebabCase(plugin.name))\n )\n );\n}\n\n/**\n * Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.\n *\n * @param hooksList - The list of hooks to deduplicate.\n * @returns A new list of hooks with duplicates removed.\n */\nexport function dedupeHooklist<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(hooksList: TList[]): TList[] {\n return hooksList.reduce((ret, hook) => {\n if (\n !isDuplicate(\n hook.plugin,\n ret.map(h => h.plugin)\n )\n ) {\n ret.push(hook);\n }\n return ret;\n }, [] as TList[]);\n}\n\n/**\n * Add a plugin hook to the hooks list.\n *\n * @param context - The plugin context\n * @param plugin - The plugin to add the hook from\n * @param pluginHook - The plugin hook to add\n * @param hooksList - The list of hooks to add to\n */\nexport function addPluginHook<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(\n context: TContext,\n plugin: Plugin<TContext>,\n pluginHook: PluginHook<AnyFunction>,\n hooksList: TList[]\n): TList[] {\n if (\n !isDuplicate(plugin, hooksList.map(hook => hook.plugin).filter(Boolean))\n ) {\n const handler = ((...args: unknown[]) =>\n (\n getHookHandler<WithUnpluginBuildContext<TContext>, TField>(\n pluginHook\n ) as unknown as (...args: unknown[]) => unknown\n ).apply(context, args)) as GetHookHandlerReturnType<TContext, TField>;\n if (!handler) {\n return hooksList;\n }\n\n hooksList.push({\n plugin,\n handler\n } as any);\n }\n\n return hooksList;\n}\n\n/**\n * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.\n *\n * @param config - The plugin configuration to check\n * @returns Null if the configuration is valid, otherwise an array of stringified invalid configurations\n */\nexport function findInvalidPluginConfig<\n TContext extends PluginContext = PluginContext\n>(config: PluginConfig<TContext>): string[] | null {\n if (isPluginConfig<TContext>(config)) {\n return null;\n }\n\n if (Array.isArray(config as PluginConfig<TContext>[])) {\n const invalidItems: string[] = [];\n (config as PluginConfig<TContext>[]).forEach(item => {\n const invalid = findInvalidPluginConfig<TContext>(item);\n if (invalid) {\n invalidItems.push(...invalid.map(i => JSON.stringify(i, null, 2)));\n }\n });\n\n return invalidItems.length > 0 ? invalidItems : null;\n }\n\n return [JSON.stringify(config, null, 2)];\n}\n"],"mappings":";;;;;;;;;;;;;;AAsDA,SAAgB,SACd,OAC2B;CAC3B,OACE,YAAY,KAAK,KACjB,UAAU,SACV,YAAY,MAAM,IAAI,MACrB,YAAa,MAA2B,GAAG,KACzC,SAAS,SAAS,YAAY,MAAM,GAAG,OACzC,YAAa,MAA2B,kBAAkB,KACxD,wBAAwB,SACvB,WAAW,MAAM,kBAAkB,OACtC,YAAa,MAA2B,MAAM,KAC5C,YAAY,SAAS,WAAW,MAAM,MAAM,MAC/C,oBAAoB,OAClB,SACE,YAAa,MAAkC,KAAK,KACnD,QAAQ,UACN,qBAAsB,MAAkC,KAAK,KAC3D,SAAS,YACR,YAAa,MAA2B,KAAK,EACvD;AAEJ;;;;;;;AAQA,SAAgB,qBAEd,OAAuD;CACvD,OACE,YAAY,KAAK,KACjB,YAAY,WACT,YAAY,MAAM,MAAM,KAAK,WAAW,MAAM,MAAM,MACrD,aAAa,SACb,YAAY,MAAM,OAAO,KACzB,SAAS,MAAM,MAAM;AAE3B;;;;;;;AAQA,SAAgB,oBAEd,OAAsD;CACtD,OACE,MAAM,QAAQ,KAAK,MAClB,MAAM,WAAW,KAAK,MAAM,WAAW,QACrC,YAAY,MAAM,EAAE,KAAK,WAAW,MAAM,EAAE,MAC7C,MAAM,SAAS,KACf,YAAY,MAAM,EAAE,KACpB,SAAS,MAAM,EAAE;AAEvB;;;;;;;AAQA,SAAgB,eACd,OACiC;CACjC,OACE,YAAY,KAAK,KACjB,WAAW,KAAK,KAChB,SAAS,KAAK,KACd,qBAAqB,KAAK,KAC1B,oBAAoB,KAAK,KACxB,MAAM,QAAQ,KAA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,IACE,CAAC,YACC,KAAK,QACL,IAAI,KAAI,MAAK,EAAE,MAAM,CACvB,GAEA,IAAI,KAAK,IAAI;EAEf,OAAO;CACT,GAAG,CAAC,CAAY;AAClB;;;;;;;;;AAUA,SAAgB,cAQd,SACA,QACA,YACA,WACS;CACT,IACE,CAAC,YAAY,QAAQ,UAAU,KAAI,SAAQ,KAAK,MAAM,EAAE,OAAO,OAAO,CAAC,GACvE;EACA,MAAM,YAAY,GAAG,SAEjB,eACE,UACF,EACA,MAAM,SAAS,IAAI;EACvB,IAAI,CAAC,SACH,OAAO;EAGT,UAAU,KAAK;GACb;GACA;EACF,CAAQ;CACV;CAEA,OAAO;AACT;;;;;;;AAQA,SAAgB,wBAEd,QAAiD;CACjD,IAAI,eAAyB,MAAM,GACjC,OAAO;CAGT,IAAI,MAAM,QAAQ,MAAkC,GAAG;EACrD,MAAM,eAAyB,CAAC;EAChC,AAAC,OAAoC,SAAQ,SAAQ;GACnD,MAAM,UAAU,wBAAkC,IAAI;GACtD,IAAI,SACF,aAAa,KAAK,GAAG,QAAQ,KAAI,MAAK,KAAK,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC;EAErE,CAAC;EAED,OAAO,aAAa,SAAS,IAAI,eAAe;CAClD;CAEA,OAAO,CAAC,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AACzC"}
|
|
1
|
+
{"version":3,"file":"helpers.mjs","names":[],"sources":["../../src/plugin-utils/helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport {\n PLUGIN_HOOKS_FIELDS,\n PLUGIN_NON_HOOK_FIELDS,\n UNPLUGIN_BUILDER_VARIANTS\n} from \"../constants/plugin\";\nimport type {\n PluginConfig,\n PluginConfigObject,\n PluginConfigTuple\n} from \"../types/config\";\nimport type { PluginContext, WithUnpluginBuildContext } from \"../types/context\";\nimport type { HooksListItem } from \"../types/hooks\";\nimport type {\n Plugin,\n PluginHook,\n PluginHookFields,\n PluginHookObject,\n PluginHooks\n} from \"../types/plugin\";\nimport type {\n UnpluginBuilderVariant,\n UnpluginOptions\n} from \"../types/unplugin\";\n\n/**\n * Type guard to check if an object is a {@link Plugin}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link Plugin}, false otherwise\n */\nexport function isPlugin<TContext extends PluginContext = PluginContext>(\n value: unknown\n): value is Plugin<TContext> {\n return (\n isSetObject(value) &&\n \"name\" in value &&\n isSetString(value.name) &&\n (isUndefined((value as Plugin<TContext>).api) ||\n (\"api\" in value && isSetObject(value.api))) &&\n (isUndefined((value as Plugin<TContext>).applyToEnvironment) ||\n (\"applyToEnvironment\" in value &&\n isFunction(value.applyToEnvironment))) &&\n (isUndefined((value as Plugin<TContext>).dedupe) ||\n (\"dedupe\" in value && isFunction(value.dedupe))) &&\n PLUGIN_HOOKS_FIELDS.every(\n hook =>\n isUndefined((value as Record<string, unknown>)[hook]) ||\n (hook in value &&\n (isPluginHookFunction((value as Record<string, unknown>)[hook]) ||\n (hook === \"config\" &&\n isSetObject((value as Plugin<TContext>)[hook]))))\n )\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigObject}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigObject}, false otherwise\n */\nexport function isPluginConfigObject<\n TContext extends PluginContext = PluginContext\n>(value: unknown): value is PluginConfigObject<TContext> {\n return (\n isSetObject(value) &&\n \"plugin\" in value &&\n (((isSetString(value.plugin) || isFunction(value.plugin)) &&\n \"options\" in value &&\n isSetObject(value.options)) ||\n isPlugin(value.plugin))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfigTuple}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfigTuple}, false otherwise\n */\nexport function isPluginConfigTuple<\n TContext extends PluginContext = PluginContext\n>(value: unknown): value is PluginConfigTuple<TContext> {\n return (\n Array.isArray(value) &&\n (value.length === 1 || value.length === 2) &&\n (((isSetString(value[0]) || isFunction(value[0])) &&\n value.length > 1 &&\n isSetObject(value[1])) ||\n isPlugin(value[0]))\n );\n}\n\n/**\n * Type guard to check if an object is a {@link PluginConfig}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginConfig}, false otherwise\n */\nexport function isPluginConfig<TContext extends PluginContext = PluginContext>(\n value: unknown\n): value is PluginConfig<TContext> {\n return (\n isSetString(value) ||\n isFunction(value) ||\n isPlugin(value) ||\n isPluginConfigObject(value) ||\n isPluginConfigTuple(value) ||\n (Array.isArray(value) && value.every(item => isPluginConfig(item)))\n );\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookObject(\n value: unknown\n): value is PluginHookObject<AnyFunction> {\n return isSetObject(value) && \"handler\" in value && isFunction(value.handler);\n}\n\n/**\n * Type guard to check if an value is a {@link PluginHook} function\n *\n * @param value - The value to check\n * @returns True if the value is a {@link PluginHook} function, false otherwise\n */\nexport function isPluginHookFunction(value: unknown): value is AnyFunction {\n return isFunction(value) || isPluginHookObject(value);\n}\n\n/**\n * Type guard to check if an object is a {@link PluginHook}\n *\n * @param value - The object to check\n * @returns True if the object is a {@link PluginHook}, false otherwise\n */\nexport function isPluginHook(value: unknown): value is PluginHook<AnyFunction> {\n return isPluginHookFunction(value) || isPluginHookObject(value);\n}\n\nexport type GetHookHandlerReturnType<\n TContext extends PluginContext = PluginContext,\n TField extends string = string\n> = HooksListItem<TContext, TField>[\"handler\"];\n\n/**\n * Extract the hook handler function from a plugin hook\n *\n * @param pluginHook - The plugin hook to extract the handler function from\n * @returns The hook handler function\n */\nexport function getHookHandler<\n TContext extends PluginContext = PluginContext,\n TKey extends string = string\n>(\n pluginHook: PluginHook<AnyFunction>\n): GetHookHandlerReturnType<TContext, TKey> {\n return (\n isFunction(pluginHook) ? pluginHook : pluginHook.handler\n ) as GetHookHandlerReturnType<TContext, TKey>;\n}\n\n/**\n * Extract a plugin hook from a plugin\n *\n * @param context - The build context\n * @param plugin - The plugin to extract the hook from\n * @param hook - The name of the hook to extract\n * @returns The extracted hook, or undefined if the hook does not exist\n */\nexport function extractPluginHook<\n TContext extends PluginContext = PluginContext,\n TPlugin extends Plugin<TContext> = Plugin<TContext>\n>(context: TContext, plugin: TPlugin, hook: keyof PluginHooks<TContext>) {\n const pluginHook = plugin[hook];\n if (!isPluginHook(pluginHook)) {\n return undefined;\n }\n\n return isFunction(pluginHook)\n ? {\n normal: pluginHook.bind(context)\n }\n : {\n [pluginHook.order ? pluginHook.order : \"normal\"]:\n pluginHook.handler.bind(context)\n };\n}\n\n/**\n * Check if a hook is external.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookKey<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant,\n TContext extends PluginContext = PluginContext\n>(\n keys: string\n): keys is `${TUnpluginBuilderVariant}:${keyof UnpluginOptions<TContext>[TUnpluginBuilderVariant] & string}` {\n return UNPLUGIN_BUILDER_VARIANTS.some(variant =>\n keys.startsWith(`${variant}:`)\n );\n}\n\n/**\n * Check if a hook is internal.\n *\n * @param keys - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isPluginHookField<TContext extends PluginContext>(\n keys: string\n) {\n return !PLUGIN_NON_HOOK_FIELDS.includes(keys as PluginHookFields<TContext>);\n}\n\n/**\n * Check if a hook is external.\n *\n * @param field - The name of the hook to check.\n * @returns True if the hook is external, false otherwise.\n */\nexport function isUnpluginHookField<\n TUnpluginBuilderVariant extends UnpluginBuilderVariant =\n UnpluginBuilderVariant\n>(field: string): field is TUnpluginBuilderVariant {\n return (\n !isPluginHookField(field) &&\n UNPLUGIN_BUILDER_VARIANTS.includes(field as UnpluginBuilderVariant)\n );\n}\n\n/**\n * Check if a plugin should be deduplicated.\n *\n * @param plugin - The plugin to check\n * @param plugins - The list of plugins to check against\n * @returns True if the plugin should be deduplicated, false otherwise\n */\nexport function isDuplicate<TContext extends PluginContext = PluginContext>(\n plugin: Plugin<TContext>,\n plugins: Plugin<TContext>[]\n) {\n return (\n plugin.dedupe !== false &&\n plugins.some(\n p =>\n p.dedupe !== false &&\n ((isFunction(p.dedupe) && p.dedupe(plugin)) ||\n kebabCase(p.name) === kebabCase(plugin.name))\n )\n );\n}\n\n/**\n * Remove duplicate hooks from a list of hooks, keeping the first occurrence of each plugin.\n *\n * @param hooksList - The list of hooks to deduplicate.\n * @returns A new list of hooks with duplicates removed.\n */\nexport function dedupeHooklist<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(hooksList: TList[]): TList[] {\n return hooksList.reduce((ret, hook) => {\n if (\n !isDuplicate(\n hook.plugin,\n ret.map(h => h.plugin)\n )\n ) {\n ret.push(hook);\n }\n return ret;\n }, [] as TList[]);\n}\n\n/**\n * Add a plugin hook to the hooks list.\n *\n * @param context - The plugin context\n * @param plugin - The plugin to add the hook from\n * @param pluginHook - The plugin hook to add\n * @param hooksList - The list of hooks to add to\n */\nexport function addPluginHook<\n TContext extends PluginContext = PluginContext,\n TField extends PluginHookFields<TContext> = PluginHookFields<TContext>,\n TList extends HooksListItem<TContext, TField> = HooksListItem<\n TContext,\n TField\n >\n>(\n context: TContext,\n plugin: Plugin<TContext>,\n pluginHook: PluginHook<AnyFunction>,\n hooksList: TList[]\n): TList[] {\n if (\n !isDuplicate(plugin, hooksList.map(hook => hook.plugin).filter(Boolean))\n ) {\n const handler = ((...args: unknown[]) =>\n (\n getHookHandler<WithUnpluginBuildContext<TContext>, TField>(\n pluginHook\n ) as unknown as (...args: unknown[]) => unknown\n ).apply(context, args)) as GetHookHandlerReturnType<TContext, TField>;\n if (!handler) {\n return hooksList;\n }\n\n hooksList.push({\n plugin,\n handler\n } as any);\n }\n\n return hooksList;\n}\n\n/**\n * Check the provided {@link PluginConfig}, and return a stringified version of the invalid configuration. If an array is provided, check each item in the array.\n *\n * @param config - The plugin configuration to check\n * @returns Null if the configuration is valid, otherwise an array of stringified invalid configurations\n */\nexport function findInvalidPluginConfig<\n TContext extends PluginContext = PluginContext\n>(config: PluginConfig<TContext>): string[] | null {\n if (isPluginConfig<TContext>(config)) {\n return null;\n }\n\n if (Array.isArray(config as PluginConfig<TContext>[])) {\n const invalidItems: string[] = [];\n (config as PluginConfig<TContext>[]).forEach(item => {\n const invalid = findInvalidPluginConfig<TContext>(item);\n if (invalid) {\n invalidItems.push(...invalid.map(i => JSON.stringify(i, null, 2)));\n }\n });\n\n return invalidItems.length > 0 ? invalidItems : null;\n }\n\n return [JSON.stringify(config, null, 2)];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,SACd,OAC2B;CAC3B,OACE,YAAY,KAAK,KACjB,UAAU,SACV,YAAY,MAAM,IAAI,MACrB,YAAa,MAA2B,GAAG,KACzC,SAAS,SAAS,YAAY,MAAM,GAAG,OACzC,YAAa,MAA2B,kBAAkB,KACxD,wBAAwB,SACvB,WAAW,MAAM,kBAAkB,OACtC,YAAa,MAA2B,MAAM,KAC5C,YAAY,SAAS,WAAW,MAAM,MAAM,MAC/C,oBAAoB,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AC;EAChC,AAAC,OAAoC,SAAQ,SAAQ;GACnD,MAAM,UAAU,wBAAkC,IAAI;GACtD,IAAI,SACF,aAAa,KAAK,GAAG,QAAQ,KAAI,MAAK,KAAK,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC;EAErE,CAAC;EAED,OAAO,aAAa,SAAS,IAAI,eAAe;CAClD;CAEA,OAAO,CAAC,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AACzC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
10
|
const require_plugin_utils_logging = require('./logging.cjs');
|
|
3
11
|
const require_plugin_utils_build_helpers = require('./build-helpers.cjs');
|
|
@@ -43,6 +51,7 @@ exports.extendLogger = require_plugin_utils_logging.extendLogger;
|
|
|
43
51
|
exports.extractPluginHook = require_plugin_utils_helpers.extractPluginHook;
|
|
44
52
|
exports.findInvalidPluginConfig = require_plugin_utils_helpers.findInvalidPluginConfig;
|
|
45
53
|
exports.formatConfig = require_plugin_utils_format.formatConfig;
|
|
54
|
+
exports.formatExecutionId = require_plugin_utils_context_helpers.formatExecutionId;
|
|
46
55
|
exports.formatPackageJson = require_plugin_utils_format_package_json.formatPackageJson;
|
|
47
56
|
exports.getConfigPath = require_plugin_utils_get_config_path.getConfigPath;
|
|
48
57
|
exports.getDependencyConfig = require_plugin_utils_build_helpers.getDependencyConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetDependencyConfigResult, getDependencyConfig } from "./build-helpers.cjs";
|
|
2
2
|
import { CombinePluginsOptions, combinePluginOptions, combinePlugins } from "./combine-plugins.cjs";
|
|
3
|
-
import { getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.cjs";
|
|
3
|
+
import { formatExecutionId, getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.cjs";
|
|
4
4
|
import { getDocsOutputPath } from "./docs-helper.cjs";
|
|
5
5
|
import { enable } from "./enable-plugin.cjs";
|
|
6
6
|
import { extend } from "./extend.cjs";
|
|
@@ -15,4 +15,4 @@ import { MergeResult, merge, mergeConfig } from "./merge.cjs";
|
|
|
15
15
|
import { isBuiltinModule } from "./modules.cjs";
|
|
16
16
|
import { replacePathTokens } from "./paths.cjs";
|
|
17
17
|
import { PrefixRegexOptions, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, createVirtualPrefixRegex, isVirtualModule, prefixRegex, removeVirtualPrefix } from "./virtual.cjs";
|
|
18
|
-
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, PrefixRegexOptions, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addPluginHook, addVirtualPrefix, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, createVirtualPrefixRegex, dedupeHooklist, enable, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, installPackage, installPackages, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, isVirtualModule, merge, mergeConfig, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter, prefixRegex, removeVirtualPrefix, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
18
|
+
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, PrefixRegexOptions, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addPluginHook, addVirtualPrefix, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, createVirtualPrefixRegex, dedupeHooklist, enable, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatExecutionId, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, installPackage, installPackages, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, isVirtualModule, merge, mergeConfig, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter, prefixRegex, removeVirtualPrefix, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
1
3
|
import { GetDependencyConfigResult, getDependencyConfig } from "./build-helpers.mjs";
|
|
2
4
|
import { CombinePluginsOptions, combinePluginOptions, combinePlugins } from "./combine-plugins.mjs";
|
|
3
|
-
import { getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.mjs";
|
|
5
|
+
import { formatExecutionId, getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.mjs";
|
|
4
6
|
import { getDocsOutputPath } from "./docs-helper.mjs";
|
|
5
7
|
import { enable } from "./enable-plugin.mjs";
|
|
6
8
|
import { extend } from "./extend.mjs";
|
|
@@ -15,4 +17,4 @@ import { MergeResult, merge, mergeConfig } from "./merge.mjs";
|
|
|
15
17
|
import { isBuiltinModule } from "./modules.mjs";
|
|
16
18
|
import { replacePathTokens } from "./paths.mjs";
|
|
17
19
|
import { PrefixRegexOptions, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, createVirtualPrefixRegex, isVirtualModule, prefixRegex, removeVirtualPrefix } from "./virtual.mjs";
|
|
18
|
-
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, PrefixRegexOptions, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addPluginHook, addVirtualPrefix, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, createVirtualPrefixRegex, dedupeHooklist, enable, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, installPackage, installPackages, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, isVirtualModule, merge, mergeConfig, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter, prefixRegex, removeVirtualPrefix, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
20
|
+
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, PrefixRegexOptions, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addPluginHook, addVirtualPrefix, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, createVirtualPrefixRegex, dedupeHooklist, enable, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatExecutionId, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, installPackage, installPackages, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, isVirtualModule, merge, mergeConfig, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter, prefixRegex, removeVirtualPrefix, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
import { colorBackground, colorText, consoleLog, consoleLogger, createLogFn, createLogger, extendLogFn, extendLogger, getTextColor, isValidLogLevel, isValidLogLevelConfig, isVerbose, resolveLogLevel, withCustomLogger, withLogFn, withLogger } from "./logging.mjs";
|
|
2
10
|
import { getDependencyConfig } from "./build-helpers.mjs";
|
|
3
11
|
import { addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
|
|
4
12
|
import { merge, mergeConfig } from "./merge.mjs";
|
|
5
13
|
import { combinePluginOptions, combinePlugins } from "./combine-plugins.mjs";
|
|
6
|
-
import { getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.mjs";
|
|
14
|
+
import { formatExecutionId, getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.mjs";
|
|
7
15
|
import { getDocsOutputPath } from "./docs-helper.mjs";
|
|
8
16
|
import { enable } from "./enable-plugin.mjs";
|
|
9
17
|
import { extend } from "./extend.mjs";
|
|
@@ -16,4 +24,4 @@ import { installPackage, installPackages } from "./install.mjs";
|
|
|
16
24
|
import { isBuiltinModule } from "./modules.mjs";
|
|
17
25
|
import { replacePathTokens } from "./paths.mjs";
|
|
18
26
|
|
|
19
|
-
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addPluginHook, addVirtualPrefix, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, createVirtualPrefixRegex, dedupeHooklist, enable, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, installPackage, installPackages, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, isVirtualModule, merge, mergeConfig, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter, prefixRegex, removeVirtualPrefix, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
27
|
+
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addPluginHook, addVirtualPrefix, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, createVirtualPrefixRegex, dedupeHooklist, enable, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatExecutionId, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, installPackage, installPackages, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, isVirtualModule, merge, mergeConfig, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter, prefixRegex, removeVirtualPrefix, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
10
|
let _stryke_fs_install = require("@stryke/fs/install");
|
|
3
11
|
let _stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.mts","names":[],"sources":["../../src/plugin-utils/install.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.mts","names":[],"sources":["../../src/plugin-utils/install.ts"],"mappings":";;;;;;;;;;;iBAuCsB,cAAA,CACpB,OAAA,EAAS,OAAA,EACT,WAAA,UACA,GAAA,aAAW,OAAA;;;;AAHb;;;iBAkEsB,eAAA,CACpB,OAAA,EAAS,OAAA,EACT,QAAA,EAAU,KAAA;EAAQ,IAAA;EAAc,GAAA;AAAA,KAAgB,OAAA"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
import { install } from "@stryke/fs/install";
|
|
2
10
|
import { doesPackageMatch, getPackageListing, isPackageListed } from "@stryke/fs/package-fns";
|
|
3
11
|
import { getPackageName, getPackageVersion, hasPackageVersion } from "@stryke/string-format/package";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.mjs","names":[],"sources":["../../src/plugin-utils/install.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Context } from \"@powerlines/core\";\nimport { install } from \"@stryke/fs/install\";\nimport {\n doesPackageMatch,\n getPackageListing,\n isPackageListed\n} from \"@stryke/fs/package-fns\";\nimport {\n getPackageName,\n getPackageVersion,\n hasPackageVersion\n} from \"@stryke/string-format/package\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\n\n/**\n * Installs a package if it is not already installed.\n *\n * @param context - The resolved options\n * @param packageName - The name of the package to install\n * @param dev - Whether to install the package as a dev dependency\n */\nexport async function installPackage(\n context: Context,\n packageName: string,\n dev = false\n) {\n if (\n !(await isPackageListed(getPackageName(packageName), {\n cwd: context.config.root\n }))\n ) {\n if (context.config.autoInstall) {\n context.warn(\n `The package \"${packageName}\" is not installed. It will be installed automatically.`\n );\n\n const result = await install(packageName, {\n cwd: context.config.root,\n dev\n });\n if (isNumber(result.exitCode) && result.exitCode > 0) {\n context.error(result.stderr);\n throw new Error(\n `An error occurred while installing the package \"${packageName}\"`\n );\n }\n } else {\n context.warn(\n `The package \"${packageName}\" is not installed. Since the \"autoInstall\" option is set to false, it will not be installed automatically.`\n );\n }\n } else if (\n hasPackageVersion(packageName) &&\n !process.env.POWERLINES_SKIP_VERSION_CHECK\n ) {\n const isMatching = await doesPackageMatch(\n getPackageName(packageName),\n getPackageVersion(packageName)!,\n context.config.root\n );\n if (!isMatching) {\n const packageListing = await getPackageListing(\n getPackageName(packageName),\n {\n cwd: context.config.root\n }\n );\n if (\n !packageListing?.version.startsWith(\"catalog:\") &&\n !packageListing?.version.startsWith(\"workspace:\")\n ) {\n context.warn(\n `The package \"${getPackageName(packageName)}\" is installed but does not match the expected version ${getPackageVersion(\n packageName\n )} (installed version: ${packageListing?.version || \"<Unknown>\"}). Please ensure this is intentional before proceeding. Note: You can skip this validation with the \"STORM_STACK_SKIP_VERSION_CHECK\" environment variable.`\n );\n }\n }\n }\n}\n\n/**\n * Installs a package if it is not already installed.\n *\n * @param context - The resolved options\n * @param packages - The list of packages to install\n */\nexport async function installPackages(\n context: Context,\n packages: Array<{ name: string; dev?: boolean }>\n) {\n return Promise.all(\n packages.map(async pkg => installPackage(context, pkg.name, pkg.dev))\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.mjs","names":[],"sources":["../../src/plugin-utils/install.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Context } from \"@powerlines/core\";\nimport { install } from \"@stryke/fs/install\";\nimport {\n doesPackageMatch,\n getPackageListing,\n isPackageListed\n} from \"@stryke/fs/package-fns\";\nimport {\n getPackageName,\n getPackageVersion,\n hasPackageVersion\n} from \"@stryke/string-format/package\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\n\n/**\n * Installs a package if it is not already installed.\n *\n * @param context - The resolved options\n * @param packageName - The name of the package to install\n * @param dev - Whether to install the package as a dev dependency\n */\nexport async function installPackage(\n context: Context,\n packageName: string,\n dev = false\n) {\n if (\n !(await isPackageListed(getPackageName(packageName), {\n cwd: context.config.root\n }))\n ) {\n if (context.config.autoInstall) {\n context.warn(\n `The package \"${packageName}\" is not installed. It will be installed automatically.`\n );\n\n const result = await install(packageName, {\n cwd: context.config.root,\n dev\n });\n if (isNumber(result.exitCode) && result.exitCode > 0) {\n context.error(result.stderr);\n throw new Error(\n `An error occurred while installing the package \"${packageName}\"`\n );\n }\n } else {\n context.warn(\n `The package \"${packageName}\" is not installed. Since the \"autoInstall\" option is set to false, it will not be installed automatically.`\n );\n }\n } else if (\n hasPackageVersion(packageName) &&\n !process.env.POWERLINES_SKIP_VERSION_CHECK\n ) {\n const isMatching = await doesPackageMatch(\n getPackageName(packageName),\n getPackageVersion(packageName)!,\n context.config.root\n );\n if (!isMatching) {\n const packageListing = await getPackageListing(\n getPackageName(packageName),\n {\n cwd: context.config.root\n }\n );\n if (\n !packageListing?.version.startsWith(\"catalog:\") &&\n !packageListing?.version.startsWith(\"workspace:\")\n ) {\n context.warn(\n `The package \"${getPackageName(packageName)}\" is installed but does not match the expected version ${getPackageVersion(\n packageName\n )} (installed version: ${packageListing?.version || \"<Unknown>\"}). Please ensure this is intentional before proceeding. Note: You can skip this validation with the \"STORM_STACK_SKIP_VERSION_CHECK\" environment variable.`\n );\n }\n }\n }\n}\n\n/**\n * Installs a package if it is not already installed.\n *\n * @param context - The resolved options\n * @param packages - The list of packages to install\n */\nexport async function installPackages(\n context: Context,\n packages: Array<{ name: string; dev?: boolean }>\n) {\n return Promise.all(\n packages.map(async pkg => installPackage(context, pkg.name, pkg.dev))\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCA,eAAsB,eACpB,SACA,aACA,MAAM,OACN;CACA,IACE,CAAE,MAAM,gBAAgB,eAAe,WAAW,GAAG,EACnD,KAAK,QAAQ,OAAO,KACtB,CAAC,GAED,IAAI,QAAQ,OAAO,aAAa;EAC9B,QAAQ,KACN,gBAAgB,YAAY,wDAC9B;EAEA,MAAM,SAAS,MAAM,QAAQ,aAAa;GACxC,KAAK,QAAQ,OAAO;GACpB;EACF,CAAC;EACD,IAAI,SAAS,OAAO,QAAQ,KAAK,OAAO,WAAW,GAAG;GACpD,QAAQ,MAAM,OAAO,MAAM;GAC3B,MAAM,IAAI,MACR,mDAAmD,YAAY,EACjE;EACF;CACF,OACE,QAAQ,KACN,gBAAgB,YAAY,4GAC9B;MAEG,IACL,kBAAkB,WAAW,KAC7B,CAAC,QAAQ,IAAI,+BAOb;MAAI,CAAC,MALoB,iBACvB,eAAe,WAAW,GAC1B,kBAAkB,WAAW,GAC7B,QAAQ,OAAO,IACjB,GACiB;GACf,MAAM,iBAAiB,MAAM,kBAC3B,eAAe,WAAW,GAC1B,EACE,KAAK,QAAQ,OAAO,KACtB,CACF;GACA,IACE,CAAC,gBAAgB,QAAQ,WAAW,UAAU,KAC9C,CAAC,gBAAgB,QAAQ,WAAW,YAAY,GAEhD,QAAQ,KACN,gBAAgB,eAAe,WAAW,EAAE,yDAAyD,kBACnG,WACF,EAAE,uBAAuB,gBAAgB,WAAW,YAAY,2JAClE;EAEJ;;AAEJ;;;;;;;AAQA,eAAsB,gBACpB,SACA,UACA;CACA,OAAO,QAAQ,IACb,SAAS,IAAI,OAAM,QAAO,eAAe,SAAS,IAAI,MAAM,IAAI,GAAG,CAAC,CACtE;AACF"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
10
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
11
|
const require_constants_environments = require('../constants/environments.cjs');
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
1
3
|
import { CustomLogger, LogCategory, LogFn, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogMeta, Logger, LoggerOptions } from "../types/logging.mjs";
|
|
2
4
|
import { UnresolvedContext } from "../types/context.mjs";
|
|
3
5
|
import { Mode } from "../types/config.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.mts","names":[],"sources":["../../src/plugin-utils/logging.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"logging.d.mts","names":[],"sources":["../../src/plugin-utils/logging.ts"],"mappings":";;;;;;;;;;;;;;iBA+DgB,SAAA,CAAU,QAAgB;;;;AAA1C;;;iBAQgB,SAAA,CAAU,OAA0B,EAAjB,iBAAiB;AARV;AAQ1C;;;;AAAoD;AAyBpD;AAjC0C,iBAiC1B,eAAA,CACd,QAAA,GAAW,kBAAA,EACX,IAAA,GAAO,IAAA,GACN,sBAAA;;;;;;;cAsFU,YAAA,GAAgB,IAAA,aAAe,aAO3C;;;;;;AA7FwB;cAqGZ,SAAA,GAAa,IAAY;;;;AARrC;AAQD;;cAYa,eAAA,GAAmB,IAAY;AAAA,cAM/B,UAAA,GAAc,IAAA,EAAM,OAAO,KAAK,IAAA;AAAA,iBAwC7B,eAAA,CAAgB,QAAA,EAAU,QAAA,EAAU,IAAA,EAAM,QAAQ;AAAA,iBAQlD,qBAAA,CACd,IAAA,EAAM,QAAA,EACN,QAAA,EAAU,sBAAA,EACV,QAAA,GAAU,WAAA;;;;AAzDgC;AAM5C;;;cA+Da,WAAA,GAAe,IAAA,UAAc,OAAA,EAAS,YAAA,KAAe,KAiCjE;;;;;AAhG4C;AAwC7C;;cAkMa,UAAA,GAAc,MAAA,EAAQ,MAAA,EAAQ,eAAA,EAAiB,MAAA,KAAS,MAAA;;;;;;;AAlMH;cAyRrD,SAAA,GAAa,MAAA,EAAQ,MAAA,EAAQ,KAAA,EAAO,KAAA,KAAQ,MAAA;;;;;;;;cAuI5C,gBAAA,GACX,MAAA,EAAQ,MAAA,EACR,YAAA,EAAc,YAAA,KACb,MAAA;AAAA,cAoEU,aAAA,EAAe,KAUzB;;;;;;AAte4C;AAY/C;cAmea,YAAA,GACX,IAAA,sBACA,OAAA,EAAS,aAAA,EACT,QAAA,GAAU,KAAA,KACT,MAAA;;;;;;;;cAuDU,WAAA,GAAe,KAAA,EAAO,KAAA,EAAO,OAAA,EAAS,YAAA,KAAe,KAAA;AAnXlE;;;;;;;AAAA,cAyYa,YAAA,GACX,MAAA,EAAQ,MAAA,EACR,OAAA,EAAS,aAAA,KACR,MAAA"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
1
9
|
import { DEFAULT_ENVIRONMENT } from "../constants/environments.mjs";
|
|
2
10
|
import { DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels } from "../constants/log-level.mjs";
|
|
3
11
|
import { kebabCase } from "@stryke/string-format/kebab-case";
|