@powerlines/core 0.48.27 → 0.48.28
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 +14 -0
- package/dist/_virtual/_rolldown/runtime.mjs +26 -0
- package/dist/constants/api.test.cjs +42 -0
- package/dist/constants/api.test.d.cts +1 -0
- package/dist/constants/api.test.d.mts +2 -0
- package/dist/constants/api.test.mjs +44 -0
- package/dist/constants/api.test.mjs.map +1 -0
- package/dist/constants/commands.test.cjs +29 -0
- package/dist/constants/commands.test.d.cts +1 -0
- package/dist/constants/commands.test.d.mts +2 -0
- package/dist/constants/commands.test.mjs +31 -0
- package/dist/constants/commands.test.mjs.map +1 -0
- package/dist/constants/devtools.test.cjs +46 -0
- package/dist/constants/devtools.test.d.cts +1 -0
- package/dist/constants/devtools.test.d.mts +2 -0
- package/dist/constants/devtools.test.mjs +48 -0
- package/dist/constants/devtools.test.mjs.map +1 -0
- package/dist/constants/environments.test.cjs +34 -0
- package/dist/constants/environments.test.d.cts +1 -0
- package/dist/constants/environments.test.d.mts +2 -0
- package/dist/constants/environments.test.mjs +36 -0
- package/dist/constants/environments.test.mjs.map +1 -0
- package/dist/constants/extensions.test.cjs +35 -0
- package/dist/constants/extensions.test.d.cts +1 -0
- package/dist/constants/extensions.test.d.mts +2 -0
- package/dist/constants/extensions.test.mjs +37 -0
- package/dist/constants/extensions.test.mjs.map +1 -0
- package/dist/constants/fs.test.cjs +34 -0
- package/dist/constants/fs.test.d.cts +1 -0
- package/dist/constants/fs.test.d.mts +2 -0
- package/dist/constants/fs.test.mjs +36 -0
- package/dist/constants/fs.test.mjs.map +1 -0
- package/dist/constants/hooks.test.cjs +29 -0
- package/dist/constants/hooks.test.d.cts +1 -0
- package/dist/constants/hooks.test.d.mts +2 -0
- package/dist/constants/hooks.test.mjs +31 -0
- package/dist/constants/hooks.test.mjs.map +1 -0
- package/dist/constants/log-level.test.cjs +76 -0
- package/dist/constants/log-level.test.d.cts +1 -0
- package/dist/constants/log-level.test.d.mts +2 -0
- package/dist/constants/log-level.test.mjs +78 -0
- package/dist/constants/log-level.test.mjs.map +1 -0
- package/dist/constants/meta.test.cjs +33 -0
- package/dist/constants/meta.test.d.cts +1 -0
- package/dist/constants/meta.test.d.mts +2 -0
- package/dist/constants/meta.test.mjs +35 -0
- package/dist/constants/meta.test.mjs.map +1 -0
- package/dist/constants/plugin.test.cjs +59 -0
- package/dist/constants/plugin.test.d.cts +1 -0
- package/dist/constants/plugin.test.d.mts +2 -0
- package/dist/constants/plugin.test.mjs +61 -0
- package/dist/constants/plugin.test.mjs.map +1 -0
- package/dist/context/base-context.cjs +8 -1
- package/dist/context/base-context.d.cts.map +1 -1
- package/dist/context/base-context.d.mts.map +1 -1
- package/dist/context/base-context.mjs +3 -1
- package/dist/context/base-context.mjs.map +1 -1
- package/dist/context/base-context.test.cjs +23 -0
- package/dist/context/base-context.test.d.cts +1 -0
- package/dist/context/base-context.test.d.mts +2 -0
- package/dist/context/base-context.test.mjs +25 -0
- package/dist/context/base-context.test.mjs.map +1 -0
- package/dist/context/context.cjs +8 -1
- package/dist/context/context.d.cts.map +1 -1
- package/dist/context/context.d.mts.map +1 -1
- package/dist/context/context.mjs +3 -1
- package/dist/context/context.mjs.map +1 -1
- package/dist/context/context.test.cjs +23 -0
- package/dist/context/context.test.d.cts +1 -0
- package/dist/context/context.test.d.mts +2 -0
- package/dist/context/context.test.mjs +25 -0
- package/dist/context/context.test.mjs.map +1 -0
- package/dist/context/environment-context.cjs +9 -1
- package/dist/context/environment-context.d.cts.map +1 -1
- package/dist/context/environment-context.d.mts.map +1 -1
- package/dist/context/environment-context.mjs +3 -1
- package/dist/context/environment-context.mjs.map +1 -1
- package/dist/context/environment-context.test.cjs +23 -0
- package/dist/context/environment-context.test.d.cts +1 -0
- package/dist/context/environment-context.test.d.mts +2 -0
- package/dist/context/environment-context.test.mjs +25 -0
- package/dist/context/environment-context.test.mjs.map +1 -0
- package/dist/context/execution-context.cjs +8 -1
- package/dist/context/execution-context.d.cts.map +1 -1
- package/dist/context/execution-context.d.mts.map +1 -1
- package/dist/context/execution-context.mjs +3 -1
- package/dist/context/execution-context.mjs.map +1 -1
- package/dist/context/execution-context.test.cjs +23 -0
- package/dist/context/execution-context.test.d.cts +1 -0
- package/dist/context/execution-context.test.d.mts +2 -0
- package/dist/context/execution-context.test.mjs +25 -0
- package/dist/context/execution-context.test.mjs.map +1 -0
- package/dist/context/plugin-context.cjs +9 -1
- package/dist/context/plugin-context.d.cts.map +1 -1
- package/dist/context/plugin-context.d.mts.map +1 -1
- package/dist/context/plugin-context.mjs +3 -1
- package/dist/context/plugin-context.mjs.map +1 -1
- package/dist/context/plugin-context.test.cjs +23 -0
- package/dist/context/plugin-context.test.d.cts +1 -0
- package/dist/context/plugin-context.test.d.mts +2 -0
- package/dist/context/plugin-context.test.mjs +25 -0
- package/dist/context/plugin-context.test.mjs.map +1 -0
- package/dist/lib/config.cjs +18 -0
- package/dist/lib/config.mjs +14 -1
- package/dist/lib/config.mjs.map +1 -1
- package/dist/lib/config.test.cjs +23 -0
- package/dist/lib/config.test.d.cts +1 -0
- package/dist/lib/config.test.d.mts +2 -0
- package/dist/lib/config.test.mjs +25 -0
- package/dist/lib/config.test.mjs.map +1 -0
- package/dist/lib/context-helpers.cjs +11 -0
- package/dist/lib/context-helpers.d.cts.map +1 -1
- package/dist/lib/context-helpers.d.mts.map +1 -1
- package/dist/lib/context-helpers.mjs +6 -1
- package/dist/lib/context-helpers.mjs.map +1 -1
- package/dist/lib/context-helpers.test.cjs +23 -0
- package/dist/lib/context-helpers.test.d.cts +1 -0
- package/dist/lib/context-helpers.test.d.mts +2 -0
- package/dist/lib/context-helpers.test.mjs +25 -0
- package/dist/lib/context-helpers.test.mjs.map +1 -0
- package/dist/lib/entry.cjs +16 -0
- package/dist/lib/entry.d.cts.map +1 -1
- package/dist/lib/entry.d.mts.map +1 -1
- package/dist/lib/entry.mjs +11 -1
- package/dist/lib/entry.mjs.map +1 -1
- package/dist/lib/entry.test.cjs +23 -0
- package/dist/lib/entry.test.d.cts +1 -0
- package/dist/lib/entry.test.d.mts +2 -0
- package/dist/lib/entry.test.mjs +25 -0
- package/dist/lib/entry.test.mjs.map +1 -0
- package/dist/lib/environment.cjs +12 -0
- package/dist/lib/environment.d.cts.map +1 -1
- package/dist/lib/environment.d.mts.map +1 -1
- package/dist/lib/environment.mjs +8 -1
- package/dist/lib/environment.mjs.map +1 -1
- package/dist/lib/environment.test.cjs +23 -0
- package/dist/lib/environment.test.d.cts +1 -0
- package/dist/lib/environment.test.d.mts +2 -0
- package/dist/lib/environment.test.mjs +25 -0
- package/dist/lib/environment.test.mjs.map +1 -0
- package/dist/lib/events.cjs +9 -1
- package/dist/lib/events.d.cts.map +1 -1
- package/dist/lib/events.d.mts.map +1 -1
- package/dist/lib/events.mjs +4 -1
- package/dist/lib/events.mjs.map +1 -1
- package/dist/lib/events.test.cjs +23 -0
- package/dist/lib/events.test.d.cts +1 -0
- package/dist/lib/events.test.d.mts +2 -0
- package/dist/lib/events.test.mjs +25 -0
- package/dist/lib/events.test.mjs.map +1 -0
- package/dist/lib/generate-types.cjs +12 -0
- package/dist/lib/generate-types.d.cts.map +1 -1
- package/dist/lib/generate-types.d.mts.map +1 -1
- package/dist/lib/generate-types.mjs +7 -1
- package/dist/lib/generate-types.mjs.map +1 -1
- package/dist/lib/generate-types.test.cjs +23 -0
- package/dist/lib/generate-types.test.d.cts +1 -0
- package/dist/lib/generate-types.test.d.mts +2 -0
- package/dist/lib/generate-types.test.mjs +25 -0
- package/dist/lib/generate-types.test.mjs.map +1 -0
- package/dist/lib/hooks.cjs +12 -0
- package/dist/lib/hooks.d.cts.map +1 -1
- package/dist/lib/hooks.d.mts.map +1 -1
- package/dist/lib/hooks.mjs +8 -1
- package/dist/lib/hooks.mjs.map +1 -1
- package/dist/lib/hooks.test.cjs +23 -0
- package/dist/lib/hooks.test.d.cts +1 -0
- package/dist/lib/hooks.test.d.mts +2 -0
- package/dist/lib/hooks.test.mjs +25 -0
- package/dist/lib/hooks.test.mjs.map +1 -0
- package/dist/lib/install-dependencies.cjs +9 -1
- package/dist/lib/install-dependencies.d.cts.map +1 -1
- package/dist/lib/install-dependencies.d.mts.map +1 -1
- package/dist/lib/install-dependencies.mjs +3 -1
- package/dist/lib/install-dependencies.mjs.map +1 -1
- package/dist/lib/install-dependencies.test.cjs +23 -0
- package/dist/lib/install-dependencies.test.d.cts +1 -0
- package/dist/lib/install-dependencies.test.d.mts +2 -0
- package/dist/lib/install-dependencies.test.mjs +25 -0
- package/dist/lib/install-dependencies.test.mjs.map +1 -0
- package/dist/lib/meta.test.cjs +35 -0
- package/dist/lib/meta.test.d.cts +1 -0
- package/dist/lib/meta.test.d.mts +2 -0
- package/dist/lib/meta.test.mjs +37 -0
- package/dist/lib/meta.test.mjs.map +1 -0
- package/dist/lib/plugins.cjs +11 -0
- package/dist/lib/plugins.d.cts.map +1 -1
- package/dist/lib/plugins.d.mts.map +1 -1
- package/dist/lib/plugins.mjs +7 -1
- package/dist/lib/plugins.mjs.map +1 -1
- package/dist/lib/plugins.test.cjs +23 -0
- package/dist/lib/plugins.test.d.cts +1 -0
- package/dist/lib/plugins.test.d.mts +2 -0
- package/dist/lib/plugins.test.mjs +25 -0
- package/dist/lib/plugins.test.mjs.map +1 -0
- package/dist/lib/resolver.cjs +8 -1
- package/dist/lib/resolver.mjs +3 -1
- package/dist/lib/resolver.mjs.map +1 -1
- package/dist/lib/resolver.test.cjs +23 -0
- package/dist/lib/resolver.test.d.cts +1 -0
- package/dist/lib/resolver.test.d.mts +2 -0
- package/dist/lib/resolver.test.mjs +25 -0
- package/dist/lib/resolver.test.mjs.map +1 -0
- package/dist/lib/streaming-channel.cjs +12 -1
- package/dist/lib/streaming-channel.d.cts.map +1 -1
- package/dist/lib/streaming-channel.d.mts.map +1 -1
- package/dist/lib/streaming-channel.mjs +6 -1
- package/dist/lib/streaming-channel.mjs.map +1 -1
- package/dist/lib/streaming-channel.test.cjs +23 -0
- package/dist/lib/streaming-channel.test.d.cts +1 -0
- package/dist/lib/streaming-channel.test.d.mts +2 -0
- package/dist/lib/streaming-channel.test.mjs +25 -0
- package/dist/lib/streaming-channel.test.mjs.map +1 -0
- package/dist/lib/typescript/ts-morph.cjs +11 -1
- package/dist/lib/typescript/ts-morph.d.cts.map +1 -1
- package/dist/lib/typescript/ts-morph.d.mts.map +1 -1
- package/dist/lib/typescript/ts-morph.mjs +6 -1
- package/dist/lib/typescript/ts-morph.mjs.map +1 -1
- package/dist/lib/typescript/ts-morph.test.cjs +23 -0
- package/dist/lib/typescript/ts-morph.test.d.cts +1 -0
- package/dist/lib/typescript/ts-morph.test.d.mts +2 -0
- package/dist/lib/typescript/ts-morph.test.mjs +25 -0
- package/dist/lib/typescript/ts-morph.test.mjs.map +1 -0
- package/dist/lib/typescript/tsconfig.cjs +19 -1
- package/dist/lib/typescript/tsconfig.d.cts.map +1 -1
- package/dist/lib/typescript/tsconfig.d.mts.map +1 -1
- package/dist/lib/typescript/tsconfig.mjs +14 -1
- package/dist/lib/typescript/tsconfig.mjs.map +1 -1
- package/dist/lib/typescript/tsconfig.test.cjs +23 -0
- package/dist/lib/typescript/tsconfig.test.d.cts +1 -0
- package/dist/lib/typescript/tsconfig.test.d.mts +2 -0
- package/dist/lib/typescript/tsconfig.test.mjs +25 -0
- package/dist/lib/typescript/tsconfig.test.mjs.map +1 -0
- package/dist/lib/unplugin/helpers.cjs +11 -0
- package/dist/lib/unplugin/helpers.d.cts.map +1 -1
- package/dist/lib/unplugin/helpers.d.mts.map +1 -1
- package/dist/lib/unplugin/helpers.mjs +6 -1
- package/dist/lib/unplugin/helpers.mjs.map +1 -1
- package/dist/lib/unplugin/helpers.test.cjs +23 -0
- package/dist/lib/unplugin/helpers.test.d.cts +1 -0
- package/dist/lib/unplugin/helpers.test.d.mts +2 -0
- package/dist/lib/unplugin/helpers.test.mjs +25 -0
- package/dist/lib/unplugin/helpers.test.mjs.map +1 -0
- package/dist/lib/unplugin/module-resolution.cjs +8 -1
- package/dist/lib/unplugin/module-resolution.d.cts.map +1 -1
- package/dist/lib/unplugin/module-resolution.d.mts.map +1 -1
- package/dist/lib/unplugin/module-resolution.mjs +3 -1
- package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
- package/dist/lib/unplugin/module-resolution.test.cjs +23 -0
- package/dist/lib/unplugin/module-resolution.test.d.cts +1 -0
- package/dist/lib/unplugin/module-resolution.test.d.mts +2 -0
- package/dist/lib/unplugin/module-resolution.test.mjs +25 -0
- package/dist/lib/unplugin/module-resolution.test.mjs.map +1 -0
- package/dist/lib/unplugin/plugin.cjs +12 -1
- package/dist/lib/unplugin/plugin.d.cts.map +1 -1
- package/dist/lib/unplugin/plugin.d.mts.map +1 -1
- package/dist/lib/unplugin/plugin.mjs +6 -1
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.test.cjs +23 -0
- package/dist/lib/unplugin/plugin.test.d.cts +1 -0
- package/dist/lib/unplugin/plugin.test.d.mts +2 -0
- package/dist/lib/unplugin/plugin.test.mjs +25 -0
- package/dist/lib/unplugin/plugin.test.mjs.map +1 -0
- package/dist/lib/utilities/file-header.cjs +13 -0
- package/dist/lib/utilities/file-header.mjs +8 -1
- package/dist/lib/utilities/file-header.mjs.map +1 -1
- package/dist/lib/utilities/file-header.test.cjs +23 -0
- package/dist/lib/utilities/file-header.test.d.cts +1 -0
- package/dist/lib/utilities/file-header.test.d.mts +2 -0
- package/dist/lib/utilities/file-header.test.mjs +25 -0
- package/dist/lib/utilities/file-header.test.mjs.map +1 -0
- package/dist/lib/utilities/format.cjs +11 -1
- package/dist/lib/utilities/format.mjs +6 -1
- package/dist/lib/utilities/format.mjs.map +1 -1
- package/dist/lib/utilities/format.test.cjs +23 -0
- package/dist/lib/utilities/format.test.d.cts +1 -0
- package/dist/lib/utilities/format.test.d.mts +2 -0
- package/dist/lib/utilities/format.test.mjs +25 -0
- package/dist/lib/utilities/format.test.mjs.map +1 -0
- package/dist/lib/utilities/source-file.cjs +12 -1
- package/dist/lib/utilities/source-file.mjs +7 -1
- package/dist/lib/utilities/source-file.mjs.map +1 -1
- package/dist/lib/utilities/source-file.test.cjs +23 -0
- package/dist/lib/utilities/source-file.test.d.cts +1 -0
- package/dist/lib/utilities/source-file.test.d.mts +2 -0
- package/dist/lib/utilities/source-file.test.mjs +25 -0
- package/dist/lib/utilities/source-file.test.mjs.map +1 -0
- package/dist/lib/utilities/source-map.cjs +8 -1
- package/dist/lib/utilities/source-map.mjs +3 -1
- package/dist/lib/utilities/source-map.mjs.map +1 -1
- package/dist/lib/utilities/source-map.test.cjs +23 -0
- package/dist/lib/utilities/source-map.test.d.cts +1 -0
- package/dist/lib/utilities/source-map.test.d.mts +2 -0
- package/dist/lib/utilities/source-map.test.mjs +25 -0
- package/dist/lib/utilities/source-map.test.mjs.map +1 -0
- package/dist/lib/utilities/write-file.cjs +9 -1
- package/dist/lib/utilities/write-file.mjs +3 -1
- package/dist/lib/utilities/write-file.mjs.map +1 -1
- package/dist/lib/utilities/write-file.test.cjs +23 -0
- package/dist/lib/utilities/write-file.test.d.cts +1 -0
- package/dist/lib/utilities/write-file.test.d.mts +2 -0
- package/dist/lib/utilities/write-file.test.mjs +25 -0
- package/dist/lib/utilities/write-file.test.mjs.map +1 -0
- package/dist/lib/vfs.cjs +8 -1
- package/dist/lib/vfs.d.cts.map +1 -1
- package/dist/lib/vfs.d.mts.map +1 -1
- package/dist/lib/vfs.mjs +3 -1
- package/dist/lib/vfs.mjs.map +1 -1
- package/dist/lib/vfs.test.cjs +23 -0
- package/dist/lib/vfs.test.d.cts +1 -0
- package/dist/lib/vfs.test.d.mts +2 -0
- package/dist/lib/vfs.test.mjs +25 -0
- package/dist/lib/vfs.test.mjs.map +1 -0
- package/dist/plugin-base.cjs +12 -1
- package/dist/plugin-base.mjs +6 -1
- package/dist/plugin-base.mjs.map +1 -1
- package/dist/plugin-base.test.cjs +23 -0
- package/dist/plugin-base.test.d.cts +1 -0
- package/dist/plugin-base.test.d.mts +2 -0
- package/dist/plugin-base.test.mjs +25 -0
- package/dist/plugin-base.test.mjs.map +1 -0
- package/dist/plugin-utils/build-helpers.cjs +8 -0
- package/dist/plugin-utils/build-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/build-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/build-helpers.mjs +3 -1
- package/dist/plugin-utils/build-helpers.mjs.map +1 -1
- package/dist/plugin-utils/build-helpers.test.cjs +23 -0
- package/dist/plugin-utils/build-helpers.test.d.cts +1 -0
- package/dist/plugin-utils/build-helpers.test.d.mts +2 -0
- package/dist/plugin-utils/build-helpers.test.mjs +25 -0
- package/dist/plugin-utils/build-helpers.test.mjs.map +1 -0
- package/dist/plugin-utils/combine-plugins.cjs +12 -1
- package/dist/plugin-utils/combine-plugins.mjs +6 -1
- package/dist/plugin-utils/combine-plugins.mjs.map +1 -1
- package/dist/plugin-utils/combine-plugins.test.cjs +23 -0
- package/dist/plugin-utils/combine-plugins.test.d.cts +1 -0
- package/dist/plugin-utils/combine-plugins.test.d.mts +2 -0
- package/dist/plugin-utils/combine-plugins.test.mjs +25 -0
- package/dist/plugin-utils/combine-plugins.test.mjs.map +1 -0
- package/dist/plugin-utils/context-helpers.cjs +13 -0
- package/dist/plugin-utils/context-helpers.mjs +8 -1
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.test.cjs +23 -0
- package/dist/plugin-utils/context-helpers.test.d.cts +1 -0
- package/dist/plugin-utils/context-helpers.test.d.mts +2 -0
- package/dist/plugin-utils/context-helpers.test.mjs +25 -0
- package/dist/plugin-utils/context-helpers.test.mjs.map +1 -0
- package/dist/plugin-utils/docs-helper.cjs +8 -0
- package/dist/plugin-utils/docs-helper.mjs +3 -1
- package/dist/plugin-utils/docs-helper.mjs.map +1 -1
- package/dist/plugin-utils/docs-helper.test.cjs +23 -0
- package/dist/plugin-utils/docs-helper.test.d.cts +1 -0
- package/dist/plugin-utils/docs-helper.test.d.mts +2 -0
- package/dist/plugin-utils/docs-helper.test.mjs +25 -0
- package/dist/plugin-utils/docs-helper.test.mjs.map +1 -0
- package/dist/plugin-utils/enable-plugin.cjs +9 -1
- package/dist/plugin-utils/enable-plugin.d.cts.map +1 -1
- package/dist/plugin-utils/enable-plugin.d.mts.map +1 -1
- package/dist/plugin-utils/enable-plugin.mjs +3 -1
- package/dist/plugin-utils/enable-plugin.mjs.map +1 -1
- package/dist/plugin-utils/enable-plugin.test.cjs +23 -0
- package/dist/plugin-utils/enable-plugin.test.d.cts +1 -0
- package/dist/plugin-utils/enable-plugin.test.d.mts +2 -0
- package/dist/plugin-utils/enable-plugin.test.mjs +25 -0
- package/dist/plugin-utils/enable-plugin.test.mjs.map +1 -0
- package/dist/plugin-utils/extend.cjs +9 -1
- package/dist/plugin-utils/extend.d.cts.map +1 -1
- package/dist/plugin-utils/extend.d.mts.map +1 -1
- package/dist/plugin-utils/extend.mjs +3 -1
- package/dist/plugin-utils/extend.mjs.map +1 -1
- package/dist/plugin-utils/extend.test.cjs +23 -0
- package/dist/plugin-utils/extend.test.d.cts +1 -0
- package/dist/plugin-utils/extend.test.d.mts +2 -0
- package/dist/plugin-utils/extend.test.mjs +25 -0
- package/dist/plugin-utils/extend.test.mjs.map +1 -0
- package/dist/plugin-utils/filter.cjs +17 -0
- package/dist/plugin-utils/filter.mjs +13 -1
- package/dist/plugin-utils/filter.mjs.map +1 -1
- package/dist/plugin-utils/filter.test.cjs +23 -0
- package/dist/plugin-utils/filter.test.d.cts +1 -0
- package/dist/plugin-utils/filter.test.d.mts +2 -0
- package/dist/plugin-utils/filter.test.mjs +25 -0
- package/dist/plugin-utils/filter.test.mjs.map +1 -0
- package/dist/plugin-utils/format-package-json.cjs +9 -1
- package/dist/plugin-utils/format-package-json.mjs +3 -1
- package/dist/plugin-utils/format-package-json.mjs.map +1 -1
- package/dist/plugin-utils/format-package-json.test.cjs +23 -0
- package/dist/plugin-utils/format-package-json.test.d.cts +1 -0
- package/dist/plugin-utils/format-package-json.test.d.mts +2 -0
- package/dist/plugin-utils/format-package-json.test.mjs +25 -0
- package/dist/plugin-utils/format-package-json.test.mjs.map +1 -0
- package/dist/plugin-utils/format.cjs +9 -1
- package/dist/plugin-utils/format.mjs +3 -1
- package/dist/plugin-utils/format.mjs.map +1 -1
- package/dist/plugin-utils/format.test.cjs +23 -0
- package/dist/plugin-utils/format.test.d.cts +1 -0
- package/dist/plugin-utils/format.test.d.mts +2 -0
- package/dist/plugin-utils/format.test.mjs +25 -0
- package/dist/plugin-utils/format.test.mjs.map +1 -0
- package/dist/plugin-utils/get-config-path.cjs +9 -1
- package/dist/plugin-utils/get-config-path.mjs +3 -1
- package/dist/plugin-utils/get-config-path.mjs.map +1 -1
- package/dist/plugin-utils/get-config-path.test.cjs +23 -0
- package/dist/plugin-utils/get-config-path.test.d.cts +1 -0
- package/dist/plugin-utils/get-config-path.test.d.mts +2 -0
- package/dist/plugin-utils/get-config-path.test.mjs +25 -0
- package/dist/plugin-utils/get-config-path.test.mjs.map +1 -0
- package/dist/plugin-utils/helpers.cjs +25 -0
- package/dist/plugin-utils/helpers.d.cts.map +1 -1
- package/dist/plugin-utils/helpers.d.mts.map +1 -1
- package/dist/plugin-utils/helpers.mjs +20 -1
- package/dist/plugin-utils/helpers.mjs.map +1 -1
- package/dist/plugin-utils/helpers.test.cjs +23 -0
- package/dist/plugin-utils/helpers.test.d.cts +1 -0
- package/dist/plugin-utils/helpers.test.d.mts +2 -0
- package/dist/plugin-utils/helpers.test.mjs +25 -0
- package/dist/plugin-utils/helpers.test.mjs.map +1 -0
- package/dist/plugin-utils/install.cjs +12 -1
- package/dist/plugin-utils/install.mjs +6 -1
- package/dist/plugin-utils/install.mjs.map +1 -1
- package/dist/plugin-utils/install.test.cjs +23 -0
- package/dist/plugin-utils/install.test.d.cts +1 -0
- package/dist/plugin-utils/install.test.d.mts +2 -0
- package/dist/plugin-utils/install.test.mjs +25 -0
- package/dist/plugin-utils/install.test.mjs.map +1 -0
- package/dist/plugin-utils/logging.cjs +24 -0
- package/dist/plugin-utils/logging.mjs +20 -1
- package/dist/plugin-utils/logging.mjs.map +1 -1
- package/dist/plugin-utils/logging.test.cjs +23 -0
- package/dist/plugin-utils/logging.test.d.cts +1 -0
- package/dist/plugin-utils/logging.test.d.mts +2 -0
- package/dist/plugin-utils/logging.test.mjs +25 -0
- package/dist/plugin-utils/logging.test.mjs.map +1 -0
- package/dist/plugin-utils/merge.cjs +11 -1
- package/dist/plugin-utils/merge.d.cts.map +1 -1
- package/dist/plugin-utils/merge.d.mts.map +1 -1
- package/dist/plugin-utils/merge.mjs +6 -1
- package/dist/plugin-utils/merge.mjs.map +1 -1
- package/dist/plugin-utils/merge.test.cjs +23 -0
- package/dist/plugin-utils/merge.test.d.cts +1 -0
- package/dist/plugin-utils/merge.test.d.mts +2 -0
- package/dist/plugin-utils/merge.test.mjs +25 -0
- package/dist/plugin-utils/merge.test.mjs.map +1 -0
- package/dist/plugin-utils/modules.cjs +9 -1
- package/dist/plugin-utils/modules.mjs +4 -1
- package/dist/plugin-utils/modules.mjs.map +1 -1
- package/dist/plugin-utils/modules.test.cjs +23 -0
- package/dist/plugin-utils/modules.test.d.cts +1 -0
- package/dist/plugin-utils/modules.test.d.mts +2 -0
- package/dist/plugin-utils/modules.test.mjs +25 -0
- package/dist/plugin-utils/modules.test.mjs.map +1 -0
- package/dist/plugin-utils/paths.cjs +8 -0
- package/dist/plugin-utils/paths.mjs +3 -1
- package/dist/plugin-utils/paths.mjs.map +1 -1
- package/dist/plugin-utils/paths.test.cjs +23 -0
- package/dist/plugin-utils/paths.test.d.cts +1 -0
- package/dist/plugin-utils/paths.test.d.mts +2 -0
- package/dist/plugin-utils/paths.test.mjs +25 -0
- package/dist/plugin-utils/paths.test.mjs.map +1 -0
- package/dist/plugin-utils/virtual.cjs +17 -1
- package/dist/plugin-utils/virtual.mjs +12 -1
- package/dist/plugin-utils/virtual.mjs.map +1 -1
- package/dist/plugin-utils/virtual.test.cjs +23 -0
- package/dist/plugin-utils/virtual.test.d.cts +1 -0
- package/dist/plugin-utils/virtual.test.d.mts +2 -0
- package/dist/plugin-utils/virtual.test.mjs +25 -0
- package/dist/plugin-utils/virtual.test.mjs.map +1 -0
- package/dist/schemas/fs.d.cts.map +1 -1
- package/dist/schemas/fs.d.mts.map +1 -1
- package/dist/storage/base.cjs +9 -1
- package/dist/storage/base.d.cts.map +1 -1
- package/dist/storage/base.d.mts.map +1 -1
- package/dist/storage/base.mjs +3 -1
- package/dist/storage/base.mjs.map +1 -1
- package/dist/storage/base.test.cjs +23 -0
- package/dist/storage/base.test.d.cts +1 -0
- package/dist/storage/base.test.d.mts +2 -0
- package/dist/storage/base.test.mjs +25 -0
- package/dist/storage/base.test.mjs.map +1 -0
- package/dist/storage/file-system.cjs +9 -1
- package/dist/storage/file-system.mjs +3 -1
- package/dist/storage/file-system.mjs.map +1 -1
- package/dist/storage/file-system.test.cjs +23 -0
- package/dist/storage/file-system.test.d.cts +1 -0
- package/dist/storage/file-system.test.d.mts +2 -0
- package/dist/storage/file-system.test.mjs +25 -0
- package/dist/storage/file-system.test.mjs.map +1 -0
- package/dist/storage/helpers.cjs +12 -0
- package/dist/storage/helpers.mjs +7 -1
- package/dist/storage/helpers.mjs.map +1 -1
- package/dist/storage/helpers.test.cjs +23 -0
- package/dist/storage/helpers.test.d.cts +1 -0
- package/dist/storage/helpers.test.d.mts +2 -0
- package/dist/storage/helpers.test.mjs +25 -0
- package/dist/storage/helpers.test.mjs.map +1 -0
- package/dist/storage/virtual.cjs +9 -1
- package/dist/storage/virtual.d.cts.map +1 -1
- package/dist/storage/virtual.d.mts.map +1 -1
- package/dist/storage/virtual.mjs +3 -1
- package/dist/storage/virtual.mjs.map +1 -1
- package/dist/storage/virtual.test.cjs +23 -0
- package/dist/storage/virtual.test.d.cts +1 -0
- package/dist/storage/virtual.test.d.mts +2 -0
- package/dist/storage/virtual.test.mjs +25 -0
- package/dist/storage/virtual.test.mjs.map +1 -0
- package/package.json +257 -17
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
|
|
9
|
+
import { module_resolution_exports } from "./module-resolution.mjs";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
|
|
12
|
+
//#region src/lib/unplugin/module-resolution.test.ts
|
|
13
|
+
describe("base/core/src/lib/unplugin/module-resolution.ts", () => {
|
|
14
|
+
it("loads module exports", () => {
|
|
15
|
+
expect(module_resolution_exports).toBeDefined();
|
|
16
|
+
expect(typeof module_resolution_exports).toBe("object");
|
|
17
|
+
});
|
|
18
|
+
it("has at least one runtime export", () => {
|
|
19
|
+
expect(Object.keys(module_resolution_exports).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { };
|
|
25
|
+
//# sourceMappingURL=module-resolution.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-resolution.test.mjs","names":["moduleExports"],"sources":["../../../src/lib/unplugin/module-resolution.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./module-resolution\";\n\ndescribe(\"base/core/src/lib/unplugin/module-resolution.ts\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,yDAAyD;CAChE,GAAG,8BAA8B;EAC/B,OAAOA,yBAAa,EAAE,YAAY;EAClC,OAAO,OAAOA,yBAAa,EAAE,KAAK,QAAQ;CAC5C,CAAC;CAED,GAAG,yCAAyC;EAC1C,OAAO,OAAO,KAAKA,yBAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC;CAC7D,CAAC;AACH,CAAC"}
|
|
@@ -7,6 +7,7 @@ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPat
|
|
|
7
7
|
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
10
11
|
const require_plugin_utils_virtual = require('../../plugin-utils/virtual.cjs');
|
|
11
12
|
require('../../plugin-utils/index.cjs');
|
|
12
13
|
const require_lib_unplugin_helpers = require('./helpers.cjs');
|
|
@@ -17,6 +18,10 @@ let _stryke_string_format_title_case = require("@stryke/string-format/title-case
|
|
|
17
18
|
let unplugin = require("unplugin");
|
|
18
19
|
|
|
19
20
|
//#region src/lib/unplugin/plugin.ts
|
|
21
|
+
var plugin_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
22
|
+
createUnplugin: () => createUnplugin,
|
|
23
|
+
createUnpluginResolver: () => createUnpluginResolver
|
|
24
|
+
});
|
|
20
25
|
/**
|
|
21
26
|
* Creates a Powerlines unplugin instance.
|
|
22
27
|
*
|
|
@@ -93,4 +98,10 @@ function createUnplugin(context, options = {}) {
|
|
|
93
98
|
|
|
94
99
|
//#endregion
|
|
95
100
|
exports.createUnplugin = createUnplugin;
|
|
96
|
-
exports.createUnpluginResolver = createUnpluginResolver;
|
|
101
|
+
exports.createUnpluginResolver = createUnpluginResolver;
|
|
102
|
+
Object.defineProperty(exports, 'plugin_exports', {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return plugin_exports;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAoCiB,6BAAA,SAAsC,8CAA8C;;AAArG;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,kBAAwC,iBAAA,
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAoCiB,6BAAA,SAAsC,8CAA8C;;AAArG;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,kBAAwC,iBAAA,EACtD,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,SACF,eAAA,CAAgB,QAAA;AAAA,UA8BR,qBAAA,SAA8B,6BAA6B;;;;;AA9B3C;AA8BjC;iBAQgB,cAAA,kBAAgC,aAAA,GAAgB,aAAA,EAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,SACF,eAAA,CAAgB,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;;;UAoCiB,6BAAA,SAAsC,8CAA8C;;;;;;;;;EASnG,IAAA;EATe;;;;;EAgBf,kBAAA;AAAA;;AAAkB;AASpB;;;;iBAAgB,sBAAA,kBAAwC,iBAAA,
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;;;UAoCiB,6BAAA,SAAsC,8CAA8C;;;;;;;;;EASnG,IAAA;EATe;;;;;EAgBf,kBAAA;AAAA;;AAAkB;AASpB;;;;iBAAgB,sBAAA,kBAAwC,iBAAA,EACtD,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,SACF,eAAA,CAAgB,QAAA;AAAA,UA8BR,qBAAA,SAA8B,6BAA6B;;;;;;;iBAQ5D,cAAA,kBAAgC,aAAA,GAAgB,aAAA,EAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,SACF,eAAA,CAAgB,QAAA"}
|
|
@@ -6,6 +6,7 @@ import __tsdown_shims_url from 'node:url'
|
|
|
6
6
|
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
7
|
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
8
|
|
|
9
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
9
10
|
import { removeVirtualPrefix } from "../../plugin-utils/virtual.mjs";
|
|
10
11
|
import "../../plugin-utils/index.mjs";
|
|
11
12
|
import { combineContexts } from "./helpers.mjs";
|
|
@@ -16,6 +17,10 @@ import { titleCase } from "@stryke/string-format/title-case";
|
|
|
16
17
|
import { setParseImpl } from "unplugin";
|
|
17
18
|
|
|
18
19
|
//#region src/lib/unplugin/plugin.ts
|
|
20
|
+
var plugin_exports = /* @__PURE__ */ __exportAll({
|
|
21
|
+
createUnplugin: () => createUnplugin,
|
|
22
|
+
createUnpluginResolver: () => createUnpluginResolver
|
|
23
|
+
});
|
|
19
24
|
/**
|
|
20
25
|
* Creates a Powerlines unplugin instance.
|
|
21
26
|
*
|
|
@@ -91,5 +96,5 @@ function createUnplugin(context, options = {}) {
|
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
//#endregion
|
|
94
|
-
export { createUnplugin, createUnpluginResolver };
|
|
99
|
+
export { createUnplugin, createUnpluginResolver, plugin_exports };
|
|
95
100
|
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../../src/lib/unplugin/plugin.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 { titleCase } from \"@stryke/string-format/title-case\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { setParseImpl } from \"unplugin\";\nimport { removeVirtualPrefix } from \"../../plugin-utils\";\nimport type { PluginContext, UnresolvedContext } from \"../../types/context\";\nimport type { UnpluginOptions } from \"../../types/unplugin\";\nimport { getString } from \"../utilities/source-file\";\nimport { combineContexts } from \"./helpers\";\nimport {\n createUnpluginModuleResolutionFunctions,\n CreateUnpluginModuleResolutionFunctionsOptions\n} from \"./module-resolution\";\n\nexport interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * A name to use for the unplugin instance. This is used for logging and to generate the plugin name. It does not affect the functionality of the plugin.\n *\n * @remarks\n * If not provided, the plugin will be named \"powerlines\". If provided, the plugin will be named `${name} - Powerlines` (e.g., \"MyPlugin - Powerlines\").\n *\n * @defaultValue \"powerlines\"\n */\n name?: string;\n\n /**\n * Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.\n *\n * @defaultValue false\n */\n silenceHookLogging?: boolean;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnpluginResolver<TContext extends UnresolvedContext>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): () => UnpluginOptions<TContext> {\n setParseImpl(context.parse);\n\n const name = options.name || \"powerlines\";\n\n const logger = context.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\" ? { source: name } : {}\n );\n logger.debug(`Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n return () => ({\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n context,\n resolveId,\n load\n });\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\n }\n}\n\nexport interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnplugin<TContext extends PluginContext = PluginContext>(\n context: TContext,\n options: CreateUnpluginOptions = {}\n): () => UnpluginOptions<TContext> {\n setParseImpl(context.parse.bind(context));\n\n const name = options.name || \"powerlines\";\n\n const logger = context.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\" ? { source: name } : {}\n );\n logger.debug(`Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n async function buildStart(this: UnpluginBuildContext) {\n if (!options.silenceHookLogging) {\n logger.debug(\"Powerlines build plugin starting...\");\n }\n\n await context.callHook(\"buildStart\", {\n sequential: true\n });\n }\n\n async function transform(\n this: UnpluginBuildContext & UnpluginContext,\n code: string,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let transformed: TransformResult | string = code;\n\n for (const hook of context.environment.selectHooks(\"transform\")) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(context, this), [\n getString(transformed),\n removeVirtualPrefix(id)\n ] as [code: string, id: string]);\n if (result) {\n transformed = result;\n }\n }\n\n return transformed;\n }\n\n async function buildEnd(this: UnpluginBuildContext): Promise<void> {\n if (!options.silenceHookLogging) {\n logger.debug(\"Powerlines build plugin finishing...\");\n }\n\n return context.callHook(\"buildEnd\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n if (!options.silenceHookLogging) {\n logger.debug(\"Finalizing Powerlines project output...\");\n }\n\n return context.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return () => ({\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n context,\n resolveId,\n load,\n transform,\n buildStart,\n buildEnd,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n });\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../../src/lib/unplugin/plugin.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 { titleCase } from \"@stryke/string-format/title-case\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { setParseImpl } from \"unplugin\";\nimport { removeVirtualPrefix } from \"../../plugin-utils\";\nimport type { PluginContext, UnresolvedContext } from \"../../types/context\";\nimport type { UnpluginOptions } from \"../../types/unplugin\";\nimport { getString } from \"../utilities/source-file\";\nimport { combineContexts } from \"./helpers\";\nimport {\n createUnpluginModuleResolutionFunctions,\n CreateUnpluginModuleResolutionFunctionsOptions\n} from \"./module-resolution\";\n\nexport interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * A name to use for the unplugin instance. This is used for logging and to generate the plugin name. It does not affect the functionality of the plugin.\n *\n * @remarks\n * If not provided, the plugin will be named \"powerlines\". If provided, the plugin will be named `${name} - Powerlines` (e.g., \"MyPlugin - Powerlines\").\n *\n * @defaultValue \"powerlines\"\n */\n name?: string;\n\n /**\n * Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.\n *\n * @defaultValue false\n */\n silenceHookLogging?: boolean;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnpluginResolver<TContext extends UnresolvedContext>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): () => UnpluginOptions<TContext> {\n setParseImpl(context.parse);\n\n const name = options.name || \"powerlines\";\n\n const logger = context.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\" ? { source: name } : {}\n );\n logger.debug(`Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n return () => ({\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n context,\n resolveId,\n load\n });\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\n }\n}\n\nexport interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnplugin<TContext extends PluginContext = PluginContext>(\n context: TContext,\n options: CreateUnpluginOptions = {}\n): () => UnpluginOptions<TContext> {\n setParseImpl(context.parse.bind(context));\n\n const name = options.name || \"powerlines\";\n\n const logger = context.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\" ? { source: name } : {}\n );\n logger.debug(`Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n async function buildStart(this: UnpluginBuildContext) {\n if (!options.silenceHookLogging) {\n logger.debug(\"Powerlines build plugin starting...\");\n }\n\n await context.callHook(\"buildStart\", {\n sequential: true\n });\n }\n\n async function transform(\n this: UnpluginBuildContext & UnpluginContext,\n code: string,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let transformed: TransformResult | string = code;\n\n for (const hook of context.environment.selectHooks(\"transform\")) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(context, this), [\n getString(transformed),\n removeVirtualPrefix(id)\n ] as [code: string, id: string]);\n if (result) {\n transformed = result;\n }\n }\n\n return transformed;\n }\n\n async function buildEnd(this: UnpluginBuildContext): Promise<void> {\n if (!options.silenceHookLogging) {\n logger.debug(\"Powerlines build plugin finishing...\");\n }\n\n return context.callHook(\"buildEnd\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n if (!options.silenceHookLogging) {\n logger.debug(\"Finalizing Powerlines project output...\");\n }\n\n return context.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return () => ({\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n context,\n resolveId,\n load,\n transform,\n buildStart,\n buildEnd,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n });\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,SAAgB,uBACd,SACA,UAAyC,CAAC,GACT;CACjC,aAAa,QAAQ,KAAK;CAE1B,MAAM,OAAO,QAAQ,QAAQ;CAE7B,MAAM,SAAS,QAAQ,aACrB,CAAC,QAAQ,sBAAsB,SAAS,eAAe,EAAE,QAAQ,KAAK,IAAI,CAAC,CAC7E;CACA,OAAO,MAAM,gBAAgB,UAAU,IAAI,EAAE,QAAQ;CAErD,IAAI;EACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,OAAO;EAEpE,cAAc;GACZ,MACE,KAAK,YAAY,MAAM,eACnB,eACA,cAAc,UAAU,IAAI;GAClC;GACA;GACA;EACF;CACF,SAAS,OAAO;EACd,OAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;EAEnE,MAAM;CACR;AACF;;;;;;;AAUA,SAAgB,eACd,SACA,UAAiC,CAAC,GACD;CACjC,aAAa,QAAQ,MAAM,KAAK,OAAO,CAAC;CAExC,MAAM,OAAO,QAAQ,QAAQ;CAE7B,MAAM,SAAS,QAAQ,aACrB,CAAC,QAAQ,sBAAsB,SAAS,eAAe,EAAE,QAAQ,KAAK,IAAI,CAAC,CAC7E;CACA,OAAO,MAAM,gBAAgB,UAAU,IAAI,EAAE,QAAQ;CAErD,IAAI;EACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,OAAO;EAEpE,eAAe,aAAuC;GACpD,IAAI,CAAC,QAAQ,oBACX,OAAO,MAAM,qCAAqC;GAGpD,MAAM,QAAQ,SAAS,cAAc,EACnC,YAAY,KACd,CAAC;EACH;EAEA,eAAe,UAEb,MACA,IAC6C;GAC7C,IAAI,cAAwC;GAE5C,KAAK,MAAM,QAAQ,QAAQ,YAAY,YAAY,WAAW,GAAG;IAC/D,MAAM,SACJ,MAAM,KAAK,QAAQ,MAAM,gBAAgB,SAAS,IAAI,GAAG,CACvD,UAAU,WAAW,GACrB,oBAAoB,EAAE,CACxB,CAA+B;IACjC,IAAI,QACF,cAAc;GAElB;GAEA,OAAO;EACT;EAEA,eAAe,WAAoD;GACjE,IAAI,CAAC,QAAQ,oBACX,OAAO,MAAM,sCAAsC;GAGrD,OAAO,QAAQ,SAAS,YAAY,EAClC,YAAY,KACd,CAAC;EACH;EAEA,eAAe,cAA6B;GAC1C,IAAI,CAAC,QAAQ,oBACX,OAAO,MAAM,yCAAyC;GAGxD,OAAO,QAAQ,SAAS,eAAe,EACrC,YAAY,KACd,CAAC;EACH;EAEA,cAAc;GACZ,MACE,KAAK,YAAY,MAAM,eACnB,eACA,cAAc,UAAU,IAAI;GAClC;GACA;GACA;GACA;GACA;GACA;GACA;GACA,MAAM,EACJ,mBAAmB,KACrB;EACF;CACF,SAAS,OAAO;EACd,OAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;EAEnE,MAAM;CACR;AACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
9
|
+
const require_lib_unplugin_plugin = require('./plugin.cjs');
|
|
10
|
+
let vitest = require("vitest");
|
|
11
|
+
|
|
12
|
+
//#region src/lib/unplugin/plugin.test.ts
|
|
13
|
+
(0, vitest.describe)("base/core/src/lib/unplugin/plugin.ts", () => {
|
|
14
|
+
(0, vitest.it)("loads module exports", () => {
|
|
15
|
+
(0, vitest.expect)(require_lib_unplugin_plugin.plugin_exports).toBeDefined();
|
|
16
|
+
(0, vitest.expect)(typeof require_lib_unplugin_plugin.plugin_exports).toBe("object");
|
|
17
|
+
});
|
|
18
|
+
(0, vitest.it)("has at least one runtime export", () => {
|
|
19
|
+
(0, vitest.expect)(Object.keys(require_lib_unplugin_plugin.plugin_exports).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
|
|
9
|
+
import { plugin_exports } from "./plugin.mjs";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
|
|
12
|
+
//#region src/lib/unplugin/plugin.test.ts
|
|
13
|
+
describe("base/core/src/lib/unplugin/plugin.ts", () => {
|
|
14
|
+
it("loads module exports", () => {
|
|
15
|
+
expect(plugin_exports).toBeDefined();
|
|
16
|
+
expect(typeof plugin_exports).toBe("object");
|
|
17
|
+
});
|
|
18
|
+
it("has at least one runtime export", () => {
|
|
19
|
+
expect(Object.keys(plugin_exports).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { };
|
|
25
|
+
//# sourceMappingURL=plugin.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.test.mjs","names":["moduleExports"],"sources":["../../../src/lib/unplugin/plugin.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./plugin\";\n\ndescribe(\"base/core/src/lib/unplugin/plugin.ts\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,8CAA8C;CACrD,GAAG,8BAA8B;EAC/B,OAAOA,cAAa,EAAE,YAAY;EAClC,OAAO,OAAOA,cAAa,EAAE,KAAK,QAAQ;CAC5C,CAAC;CAED,GAAG,yCAAyC;EAC1C,OAAO,OAAO,KAAKA,cAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC;CAC7D,CAAC;AACH,CAAC"}
|
|
@@ -7,9 +7,16 @@ const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPat
|
|
|
7
7
|
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
10
11
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
11
12
|
|
|
12
13
|
//#region src/lib/utilities/file-header.ts
|
|
14
|
+
var file_header_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
15
|
+
getFileHeader: () => getFileHeader,
|
|
16
|
+
getFileHeaderWarning: () => getFileHeaderWarning,
|
|
17
|
+
getFileHeaderWarningText: () => getFileHeaderWarningText,
|
|
18
|
+
getTypescriptFileHeader: () => getTypescriptFileHeader
|
|
19
|
+
});
|
|
13
20
|
/**
|
|
14
21
|
* Generates a file header comment with a warning about automatic overwriting.
|
|
15
22
|
*
|
|
@@ -60,6 +67,12 @@ ${getFileHeader(context)}
|
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
//#endregion
|
|
70
|
+
Object.defineProperty(exports, 'file_header_exports', {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () {
|
|
73
|
+
return file_header_exports;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
63
76
|
exports.getFileHeader = getFileHeader;
|
|
64
77
|
exports.getFileHeaderWarning = getFileHeaderWarning;
|
|
65
78
|
exports.getFileHeaderWarningText = getFileHeaderWarningText;
|
|
@@ -6,9 +6,16 @@ import __tsdown_shims_url from 'node:url'
|
|
|
6
6
|
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
7
|
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
8
|
|
|
9
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
9
10
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
10
11
|
|
|
11
12
|
//#region src/lib/utilities/file-header.ts
|
|
13
|
+
var file_header_exports = /* @__PURE__ */ __exportAll({
|
|
14
|
+
getFileHeader: () => getFileHeader,
|
|
15
|
+
getFileHeaderWarning: () => getFileHeaderWarning,
|
|
16
|
+
getFileHeaderWarningText: () => getFileHeaderWarningText,
|
|
17
|
+
getTypescriptFileHeader: () => getTypescriptFileHeader
|
|
18
|
+
});
|
|
12
19
|
/**
|
|
13
20
|
* Generates a file header comment with a warning about automatic overwriting.
|
|
14
21
|
*
|
|
@@ -59,5 +66,5 @@ ${getFileHeader(context)}
|
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
//#endregion
|
|
62
|
-
export { getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader };
|
|
69
|
+
export { file_header_exports, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader };
|
|
63
70
|
//# sourceMappingURL=file-header.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-header.mjs","names":[],"sources":["../../../src/lib/utilities/file-header.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 { titleCase } from \"@stryke/string-format/title-case\";\nimport { Context } from \"../../types/context\";\n\nexport interface FileHeaderOptions {\n directive?: string | null;\n prettierIgnore?: boolean;\n}\n\n/**\n * Generates a file header comment with a warning about automatic overwriting.\n *\n * @param overwrite - Whether the file will be automatically overwritten. If `false`, the warning will indicate that the file will not be overwritten. If `true` or omitted, the warning will indicate that the file will be overwritten.\n * @param framework - The name of the framework to include in the warning message. Defaults to \"powerlines\".\n * @returns A string containing the file header warning message.\n */\nexport function getFileHeaderWarningText(\n overwrite = true,\n framework = \"powerlines\"\n): string {\n return overwrite !== false\n ? `Do not edit this file manually - it will be overwritten automatically. Automatic overwrites can be disabled by using the \\`output.overwrite\\` option.`\n : `This file was generated on ${new Date().toLocaleString()} - it will not be overwritten by ${titleCase(framework)} while the \\`output.overwrite\\` option is set to \\`true\\`.`;\n}\n\n/**\n * Generates a file header warning message based on the provided context.\n *\n * @param context - The Powerlines context.\n * @returns A string containing the file header warning message.\n */\nexport function getFileHeaderWarning(context: Context): string {\n return getFileHeaderWarningText(\n context.config.output?.overwrite,\n context.config.framework?.name\n );\n}\n\n/**\n * Generates a file header comment for a generated source file, including a warning about automatic overwriting.\n *\n * @param context - The Powerlines context.\n * @param comment - The comment syntax to use for the header (e.g., `//` for JavaScript/TypeScript, `#` for Python). Defaults to `//`.\n * @returns A string containing the file header comment.\n */\nexport function getFileHeader(context: Context, comment = \"//\"): string {\n return `\n${comment} Generated by ${titleCase(context.config.framework?.name) || \"Powerlines\"}\n${comment} ${getFileHeaderWarning(context)}\n`;\n}\n\n/**\n * Generates a file header comment for a generated TypeScript source file, including a warning about automatic overwriting.\n *\n * @param context - The Powerlines context.\n * @param options - Additional options for generating the file header, such as a directive to include and whether to add a Prettier ignore comment.\n * @returns A string containing the file header comment for a TypeScript file.\n */\nexport function getTypescriptFileHeader(\n context: Context,\n options: FileHeaderOptions = {}\n): string {\n const { directive = null, prettierIgnore = false } = options;\n\n return `/* eslint-disable */\n// biome-ignore lint: disable\n${prettierIgnore ? `// prettier-ignore` : \"\"}${directive ? `\\n\\n${directive}\\n` : \"\\n\"}\n${getFileHeader(context)}\n\n`;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-header.mjs","names":[],"sources":["../../../src/lib/utilities/file-header.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 { titleCase } from \"@stryke/string-format/title-case\";\nimport { Context } from \"../../types/context\";\n\nexport interface FileHeaderOptions {\n directive?: string | null;\n prettierIgnore?: boolean;\n}\n\n/**\n * Generates a file header comment with a warning about automatic overwriting.\n *\n * @param overwrite - Whether the file will be automatically overwritten. If `false`, the warning will indicate that the file will not be overwritten. If `true` or omitted, the warning will indicate that the file will be overwritten.\n * @param framework - The name of the framework to include in the warning message. Defaults to \"powerlines\".\n * @returns A string containing the file header warning message.\n */\nexport function getFileHeaderWarningText(\n overwrite = true,\n framework = \"powerlines\"\n): string {\n return overwrite !== false\n ? `Do not edit this file manually - it will be overwritten automatically. Automatic overwrites can be disabled by using the \\`output.overwrite\\` option.`\n : `This file was generated on ${new Date().toLocaleString()} - it will not be overwritten by ${titleCase(framework)} while the \\`output.overwrite\\` option is set to \\`true\\`.`;\n}\n\n/**\n * Generates a file header warning message based on the provided context.\n *\n * @param context - The Powerlines context.\n * @returns A string containing the file header warning message.\n */\nexport function getFileHeaderWarning(context: Context): string {\n return getFileHeaderWarningText(\n context.config.output?.overwrite,\n context.config.framework?.name\n );\n}\n\n/**\n * Generates a file header comment for a generated source file, including a warning about automatic overwriting.\n *\n * @param context - The Powerlines context.\n * @param comment - The comment syntax to use for the header (e.g., `//` for JavaScript/TypeScript, `#` for Python). Defaults to `//`.\n * @returns A string containing the file header comment.\n */\nexport function getFileHeader(context: Context, comment = \"//\"): string {\n return `\n${comment} Generated by ${titleCase(context.config.framework?.name) || \"Powerlines\"}\n${comment} ${getFileHeaderWarning(context)}\n`;\n}\n\n/**\n * Generates a file header comment for a generated TypeScript source file, including a warning about automatic overwriting.\n *\n * @param context - The Powerlines context.\n * @param options - Additional options for generating the file header, such as a directive to include and whether to add a Prettier ignore comment.\n * @returns A string containing the file header comment for a TypeScript file.\n */\nexport function getTypescriptFileHeader(\n context: Context,\n options: FileHeaderOptions = {}\n): string {\n const { directive = null, prettierIgnore = false } = options;\n\n return `/* eslint-disable */\n// biome-ignore lint: disable\n${prettierIgnore ? `// prettier-ignore` : \"\"}${directive ? `\\n\\n${directive}\\n` : \"\\n\"}\n${getFileHeader(context)}\n\n`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,yBACd,YAAY,MACZ,YAAY,cACJ;CACR,OAAO,cAAc,QACjB,0JACA,+CAA8B,IAAI,KAAK,GAAE,eAAe,EAAE,mCAAmC,UAAU,SAAS,EAAE;AACxH;;;;;;;AAQA,SAAgB,qBAAqB,SAA0B;CAC7D,OAAO,yBACL,QAAQ,OAAO,QAAQ,WACvB,QAAQ,OAAO,WAAW,IAC5B;AACF;;;;;;;;AASA,SAAgB,cAAc,SAAkB,UAAU,MAAc;CACtE,OAAO;EACP,QAAQ,gBAAgB,UAAU,QAAQ,OAAO,WAAW,IAAI,KAAK,aAAa;EAClF,QAAQ,GAAG,qBAAqB,OAAO,EAAE;;AAE3C;;;;;;;;AASA,SAAgB,wBACd,SACA,UAA6B,CAAC,GACtB;CACR,MAAM,EAAE,YAAY,MAAM,iBAAiB,UAAU;CAErD,OAAO;;EAEP,iBAAiB,uBAAuB,KAAK,YAAY,OAAO,UAAU,MAAM,KAAK;EACrF,cAAc,OAAO,EAAE;;;AAGzB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
9
|
+
const require_lib_utilities_file_header = require('./file-header.cjs');
|
|
10
|
+
let vitest = require("vitest");
|
|
11
|
+
|
|
12
|
+
//#region src/lib/utilities/file-header.test.ts
|
|
13
|
+
(0, vitest.describe)("base/core/src/lib/utilities/file-header.ts", () => {
|
|
14
|
+
(0, vitest.it)("loads module exports", () => {
|
|
15
|
+
(0, vitest.expect)(require_lib_utilities_file_header.file_header_exports).toBeDefined();
|
|
16
|
+
(0, vitest.expect)(typeof require_lib_utilities_file_header.file_header_exports).toBe("object");
|
|
17
|
+
});
|
|
18
|
+
(0, vitest.it)("has at least one runtime export", () => {
|
|
19
|
+
(0, vitest.expect)(Object.keys(require_lib_utilities_file_header.file_header_exports).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
|
|
9
|
+
import { file_header_exports } from "./file-header.mjs";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
|
|
12
|
+
//#region src/lib/utilities/file-header.test.ts
|
|
13
|
+
describe("base/core/src/lib/utilities/file-header.ts", () => {
|
|
14
|
+
it("loads module exports", () => {
|
|
15
|
+
expect(file_header_exports).toBeDefined();
|
|
16
|
+
expect(typeof file_header_exports).toBe("object");
|
|
17
|
+
});
|
|
18
|
+
it("has at least one runtime export", () => {
|
|
19
|
+
expect(Object.keys(file_header_exports).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { };
|
|
25
|
+
//# sourceMappingURL=file-header.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-header.test.mjs","names":["moduleExports"],"sources":["../../../src/lib/utilities/file-header.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./file-header\";\n\ndescribe(\"base/core/src/lib/utilities/file-header.ts\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,oDAAoD;CAC3D,GAAG,8BAA8B;EAC/B,OAAOA,mBAAa,EAAE,YAAY;EAClC,OAAO,OAAOA,mBAAa,EAAE,KAAK,QAAQ;CAC5C,CAAC;CAED,GAAG,yCAAyC;EAC1C,OAAO,OAAO,KAAKA,mBAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC;CAC7D,CAAC;AACH,CAAC"}
|
|
@@ -18,6 +18,10 @@ let prettier_plugin_organize_imports = require("prettier-plugin-organize-imports
|
|
|
18
18
|
prettier_plugin_organize_imports = require_runtime.__toESM(prettier_plugin_organize_imports, 1);
|
|
19
19
|
|
|
20
20
|
//#region src/lib/utilities/format.ts
|
|
21
|
+
var format_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
22
|
+
format: () => format,
|
|
23
|
+
formatFolder: () => formatFolder
|
|
24
|
+
});
|
|
21
25
|
/**
|
|
22
26
|
* Formats code using Prettier based on the file path.
|
|
23
27
|
*
|
|
@@ -62,4 +66,10 @@ async function formatFolder(context, path) {
|
|
|
62
66
|
|
|
63
67
|
//#endregion
|
|
64
68
|
exports.format = format;
|
|
65
|
-
exports.formatFolder = formatFolder;
|
|
69
|
+
exports.formatFolder = formatFolder;
|
|
70
|
+
Object.defineProperty(exports, 'format_exports', {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () {
|
|
73
|
+
return format_exports;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
@@ -6,6 +6,7 @@ import __tsdown_shims_url from 'node:url'
|
|
|
6
6
|
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
7
|
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
8
|
|
|
9
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
9
10
|
import { appendPath } from "@stryke/path/append";
|
|
10
11
|
import { findFileExtension } from "@stryke/path/file-path-fns";
|
|
11
12
|
import { defu as defu$1 } from "defu";
|
|
@@ -15,6 +16,10 @@ import { format as format$1, resolveConfig } from "prettier";
|
|
|
15
16
|
import importsPlugin from "prettier-plugin-organize-imports";
|
|
16
17
|
|
|
17
18
|
//#region src/lib/utilities/format.ts
|
|
19
|
+
var format_exports = /* @__PURE__ */ __exportAll({
|
|
20
|
+
format: () => format,
|
|
21
|
+
formatFolder: () => formatFolder
|
|
22
|
+
});
|
|
18
23
|
/**
|
|
19
24
|
* Formats code using Prettier based on the file path.
|
|
20
25
|
*
|
|
@@ -58,5 +63,5 @@ async function formatFolder(context, path) {
|
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
//#endregion
|
|
61
|
-
export { format, formatFolder };
|
|
66
|
+
export { format, formatFolder, format_exports };
|
|
62
67
|
//# sourceMappingURL=format.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.mjs","names":["prettier","defu"],"sources":["../../../src/lib/utilities/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 { listFiles } from \"@stryke/fs/list-files\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { defu } from \"defu\";\nimport { format as prettier, resolveConfig } from \"prettier\";\nimport importsPlugin from \"prettier-plugin-organize-imports\";\nimport { Context } from \"../../types/context\";\n\n/**\n * Formats code using Prettier based on the file path.\n *\n * @param context - The Powerlines context.\n * @param path - The file path to use for resolving Prettier configuration.\n * @param data - The code string to format.\n * @param force - Whether to force formatting even for output/build paths.\n * @returns A promise that resolves to the formatted code string.\n */\nexport async function format(\n context: Context,\n path: string,\n data: string,\n force = false\n): Promise<string> {\n if (\n !force &&\n ((context.config.output.copy &&\n isParentPath(\n path,\n appendPath(context.config.output.copy.path, context.config.cwd)\n )) ||\n isParentPath(\n path,\n appendPath(context.config.output.path, context.config.cwd)\n ))\n ) {\n return data;\n }\n\n let code = data;\n try {\n const resolvedConfig = await resolveConfig(path);\n if (resolvedConfig) {\n code = await prettier(\n data,\n defu(\n {\n absolutePath: path,\n ...resolvedConfig\n },\n findFileExtension(path) === \"ts\" || findFileExtension(path) === \"tsx\"\n ? { plugins: [importsPlugin] }\n : {}\n )\n );\n }\n } catch (error) {\n throw new Error(\n `Failed to format file at ${path} with Prettier: ${\n (error as Error).message\n }`,\n { cause: error }\n );\n }\n\n return code;\n}\n\n/**\n * Formats all files in a folder using Prettier based on their file paths.\n *\n * @param context - The Powerlines context.\n * @param path - The folder path containing files to format.\n * @returns A promise that resolves when all files have been formatted.\n */\nexport async function formatFolder(context: Context, path: string) {\n if (\n !context.config.output.copy ||\n (!isParentPath(\n path,\n appendPath(context.config.output.copy.path, context.config.cwd)\n ) &&\n !isParentPath(\n path,\n appendPath(context.config.output.path, context.config.cwd)\n ))\n ) {\n await Promise.allSettled(\n (await listFiles(path)).map(async file => {\n if (\n (!context.config.output.copy ||\n !isParentPath(\n file,\n appendPath(context.config.output.copy.path, context.config.cwd)\n )) &&\n !isParentPath(\n file,\n appendPath(context.config.output.path, context.config.cwd)\n )\n ) {\n const data = await context.fs.read(file);\n if (data) {\n const formatted = await format(context, file, data);\n\n return context.fs.write(file, formatted);\n }\n }\n })\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.mjs","names":["prettier","defu"],"sources":["../../../src/lib/utilities/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 { listFiles } from \"@stryke/fs/list-files\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { defu } from \"defu\";\nimport { format as prettier, resolveConfig } from \"prettier\";\nimport importsPlugin from \"prettier-plugin-organize-imports\";\nimport { Context } from \"../../types/context\";\n\n/**\n * Formats code using Prettier based on the file path.\n *\n * @param context - The Powerlines context.\n * @param path - The file path to use for resolving Prettier configuration.\n * @param data - The code string to format.\n * @param force - Whether to force formatting even for output/build paths.\n * @returns A promise that resolves to the formatted code string.\n */\nexport async function format(\n context: Context,\n path: string,\n data: string,\n force = false\n): Promise<string> {\n if (\n !force &&\n ((context.config.output.copy &&\n isParentPath(\n path,\n appendPath(context.config.output.copy.path, context.config.cwd)\n )) ||\n isParentPath(\n path,\n appendPath(context.config.output.path, context.config.cwd)\n ))\n ) {\n return data;\n }\n\n let code = data;\n try {\n const resolvedConfig = await resolveConfig(path);\n if (resolvedConfig) {\n code = await prettier(\n data,\n defu(\n {\n absolutePath: path,\n ...resolvedConfig\n },\n findFileExtension(path) === \"ts\" || findFileExtension(path) === \"tsx\"\n ? { plugins: [importsPlugin] }\n : {}\n )\n );\n }\n } catch (error) {\n throw new Error(\n `Failed to format file at ${path} with Prettier: ${\n (error as Error).message\n }`,\n { cause: error }\n );\n }\n\n return code;\n}\n\n/**\n * Formats all files in a folder using Prettier based on their file paths.\n *\n * @param context - The Powerlines context.\n * @param path - The folder path containing files to format.\n * @returns A promise that resolves when all files have been formatted.\n */\nexport async function formatFolder(context: Context, path: string) {\n if (\n !context.config.output.copy ||\n (!isParentPath(\n path,\n appendPath(context.config.output.copy.path, context.config.cwd)\n ) &&\n !isParentPath(\n path,\n appendPath(context.config.output.path, context.config.cwd)\n ))\n ) {\n await Promise.allSettled(\n (await listFiles(path)).map(async file => {\n if (\n (!context.config.output.copy ||\n !isParentPath(\n file,\n appendPath(context.config.output.copy.path, context.config.cwd)\n )) &&\n !isParentPath(\n file,\n appendPath(context.config.output.path, context.config.cwd)\n )\n ) {\n const data = await context.fs.read(file);\n if (data) {\n const formatted = await format(context, file, data);\n\n return context.fs.write(file, formatted);\n }\n }\n })\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,eAAsB,OACpB,SACA,MACA,MACA,QAAQ,OACS;CACjB,IACE,CAAC,UACC,QAAQ,OAAO,OAAO,QACtB,aACE,MACA,WAAW,QAAQ,OAAO,OAAO,KAAK,MAAM,QAAQ,OAAO,GAAG,CAChE,KACA,aACE,MACA,WAAW,QAAQ,OAAO,OAAO,MAAM,QAAQ,OAAO,GAAG,CAC3D,IAEF,OAAO;CAGT,IAAI,OAAO;CACX,IAAI;EACF,MAAM,iBAAiB,MAAM,cAAc,IAAI;EAC/C,IAAI,gBACF,OAAO,MAAMA,SACX,MACAC,OACE;GACE,cAAc;GACd,GAAG;EACL,GACA,kBAAkB,IAAI,MAAM,QAAQ,kBAAkB,IAAI,MAAM,QAC5D,EAAE,SAAS,CAAC,aAAa,EAAE,IAC3B,CAAC,CACP,CACF;CAEJ,SAAS,OAAO;EACd,MAAM,IAAI,MACR,4BAA4B,KAAK,kBAC9B,MAAgB,WAEnB,EAAE,OAAO,MAAM,CACjB;CACF;CAEA,OAAO;AACT;;;;;;;;AASA,eAAsB,aAAa,SAAkB,MAAc;CACjE,IACE,CAAC,QAAQ,OAAO,OAAO,QACtB,CAAC,aACA,MACA,WAAW,QAAQ,OAAO,OAAO,KAAK,MAAM,QAAQ,OAAO,GAAG,CAChE,KACE,CAAC,aACC,MACA,WAAW,QAAQ,OAAO,OAAO,MAAM,QAAQ,OAAO,GAAG,CAC3D,GAEF,MAAM,QAAQ,YACX,MAAM,UAAU,IAAI,GAAG,IAAI,OAAM,SAAQ;EACxC,KACG,CAAC,QAAQ,OAAO,OAAO,QACtB,CAAC,aACC,MACA,WAAW,QAAQ,OAAO,OAAO,KAAK,MAAM,QAAQ,OAAO,GAAG,CAChE,MACF,CAAC,aACC,MACA,WAAW,QAAQ,OAAO,OAAO,MAAM,QAAQ,OAAO,GAAG,CAC3D,GACA;GACA,MAAM,OAAO,MAAM,QAAQ,GAAG,KAAK,IAAI;GACvC,IAAI,MAAM;IACR,MAAM,YAAY,MAAM,OAAO,SAAS,MAAM,IAAI;IAElD,OAAO,QAAQ,GAAG,MAAM,MAAM,SAAS;GACzC;EACF;CACF,CAAC,CACH;AAEJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
9
|
+
const require_lib_utilities_format = require('./format.cjs');
|
|
10
|
+
let vitest = require("vitest");
|
|
11
|
+
|
|
12
|
+
//#region src/lib/utilities/format.test.ts
|
|
13
|
+
(0, vitest.describe)("base/core/src/lib/utilities/format.ts", () => {
|
|
14
|
+
(0, vitest.it)("loads module exports", () => {
|
|
15
|
+
(0, vitest.expect)(require_lib_utilities_format.format_exports).toBeDefined();
|
|
16
|
+
(0, vitest.expect)(typeof require_lib_utilities_format.format_exports).toBe("object");
|
|
17
|
+
});
|
|
18
|
+
(0, vitest.it)("has at least one runtime export", () => {
|
|
19
|
+
(0, vitest.expect)(Object.keys(require_lib_utilities_format.format_exports).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
|
|
9
|
+
import { format_exports } from "./format.mjs";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
|
|
12
|
+
//#region src/lib/utilities/format.test.ts
|
|
13
|
+
describe("base/core/src/lib/utilities/format.ts", () => {
|
|
14
|
+
it("loads module exports", () => {
|
|
15
|
+
expect(format_exports).toBeDefined();
|
|
16
|
+
expect(typeof format_exports).toBe("object");
|
|
17
|
+
});
|
|
18
|
+
it("has at least one runtime export", () => {
|
|
19
|
+
expect(Object.keys(format_exports).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { };
|
|
25
|
+
//# sourceMappingURL=format.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.test.mjs","names":["moduleExports"],"sources":["../../../src/lib/utilities/format.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./format\";\n\ndescribe(\"base/core/src/lib/utilities/format.ts\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,+CAA+C;CACtD,GAAG,8BAA8B;EAC/B,OAAOA,cAAa,EAAE,YAAY;EAClC,OAAO,OAAOA,cAAa,EAAE,KAAK,QAAQ;CAC5C,CAAC;CAED,GAAG,yCAAyC;EAC1C,OAAO,OAAO,KAAKA,cAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC;CAC7D,CAAC;AACH,CAAC"}
|
|
@@ -15,6 +15,11 @@ let magic_string = require("magic-string");
|
|
|
15
15
|
magic_string = require_runtime.__toESM(magic_string, 1);
|
|
16
16
|
|
|
17
17
|
//#region src/lib/utilities/source-file.ts
|
|
18
|
+
var source_file_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
19
|
+
getMagicString: () => getMagicString,
|
|
20
|
+
getSourceFile: () => getSourceFile,
|
|
21
|
+
getString: () => getString
|
|
22
|
+
});
|
|
18
23
|
/**
|
|
19
24
|
* Get the string from the source.
|
|
20
25
|
*
|
|
@@ -55,4 +60,10 @@ function getSourceFile(code, id) {
|
|
|
55
60
|
//#endregion
|
|
56
61
|
exports.getMagicString = getMagicString;
|
|
57
62
|
exports.getSourceFile = getSourceFile;
|
|
58
|
-
exports.getString = getString;
|
|
63
|
+
exports.getString = getString;
|
|
64
|
+
Object.defineProperty(exports, 'source_file_exports', {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return source_file_exports;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
@@ -6,12 +6,18 @@ import __tsdown_shims_url from 'node:url'
|
|
|
6
6
|
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
7
|
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
8
|
|
|
9
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
9
10
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
10
11
|
import { isString } from "@stryke/type-checks/is-string";
|
|
11
12
|
import { readFileIfExistingSync } from "@stryke/fs/read-file";
|
|
12
13
|
import MagicString from "magic-string";
|
|
13
14
|
|
|
14
15
|
//#region src/lib/utilities/source-file.ts
|
|
16
|
+
var source_file_exports = /* @__PURE__ */ __exportAll({
|
|
17
|
+
getMagicString: () => getMagicString,
|
|
18
|
+
getSourceFile: () => getSourceFile,
|
|
19
|
+
getString: () => getString
|
|
20
|
+
});
|
|
15
21
|
/**
|
|
16
22
|
* Get the string from the source.
|
|
17
23
|
*
|
|
@@ -50,5 +56,5 @@ function getSourceFile(code, id) {
|
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
//#endregion
|
|
53
|
-
export { getMagicString, getSourceFile, getString };
|
|
59
|
+
export { getMagicString, getSourceFile, getString, source_file_exports };
|
|
54
60
|
//# sourceMappingURL=source-file.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file.mjs","names":[],"sources":["../../../src/lib/utilities/source-file.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 { readFileIfExistingSync } from \"@stryke/fs/read-file\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport MagicString from \"magic-string\";\nimport { TransformResult } from \"unplugin\";\nimport { SourceFile } from \"../../types/context\";\n\n/**\n * Get the string from the source.\n *\n * @param code - The source string or magic string.\n * @returns The source string.\n */\nexport function getString(\n code: string | MagicString | TransformResult\n): string {\n if (!code) {\n return \"\";\n }\n\n if (isString(code)) {\n return code;\n }\n\n if (isSetObject(code) && \"code\" in code) {\n return code.code;\n }\n\n return code.toString();\n}\n\n/**\n * Get the magic string.\n *\n * @param code - The source string or magic string.\n * @returns The magic string.\n */\nexport function getMagicString(code: string | MagicString): MagicString {\n if (isString(code)) {\n return new MagicString(code);\n }\n\n return code;\n}\n\n/**\n * Get the source file.\n *\n * @param code - The source code.\n * @param id - The name of the file.\n * @returns The source file.\n */\nexport function getSourceFile(\n code: string | MagicString,\n id: string\n): SourceFile {\n const content = code ?? readFileIfExistingSync(id);\n\n return {\n id,\n code: getMagicString(content),\n env: []\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-file.mjs","names":[],"sources":["../../../src/lib/utilities/source-file.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 { readFileIfExistingSync } from \"@stryke/fs/read-file\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport MagicString from \"magic-string\";\nimport { TransformResult } from \"unplugin\";\nimport { SourceFile } from \"../../types/context\";\n\n/**\n * Get the string from the source.\n *\n * @param code - The source string or magic string.\n * @returns The source string.\n */\nexport function getString(\n code: string | MagicString | TransformResult\n): string {\n if (!code) {\n return \"\";\n }\n\n if (isString(code)) {\n return code;\n }\n\n if (isSetObject(code) && \"code\" in code) {\n return code.code;\n }\n\n return code.toString();\n}\n\n/**\n * Get the magic string.\n *\n * @param code - The source string or magic string.\n * @returns The magic string.\n */\nexport function getMagicString(code: string | MagicString): MagicString {\n if (isString(code)) {\n return new MagicString(code);\n }\n\n return code;\n}\n\n/**\n * Get the source file.\n *\n * @param code - The source code.\n * @param id - The name of the file.\n * @returns The source file.\n */\nexport function getSourceFile(\n code: string | MagicString,\n id: string\n): SourceFile {\n const content = code ?? readFileIfExistingSync(id);\n\n return {\n id,\n code: getMagicString(content),\n env: []\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,UACd,MACQ;CACR,IAAI,CAAC,MACH,OAAO;CAGT,IAAI,SAAS,IAAI,GACf,OAAO;CAGT,IAAI,YAAY,IAAI,KAAK,UAAU,MACjC,OAAO,KAAK;CAGd,OAAO,KAAK,SAAS;AACvB;;;;;;;AAQA,SAAgB,eAAe,MAAyC;CACtE,IAAI,SAAS,IAAI,GACf,OAAO,IAAI,YAAY,IAAI;CAG7B,OAAO;AACT;;;;;;;;AASA,SAAgB,cACd,MACA,IACY;CAGZ,OAAO;EACL;EACA,MAAM,eAJQ,QAAQ,uBAAuB,EAAE,CAInB;EAC5B,KAAK,CAAC;CACR;AACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
9
|
+
const require_lib_utilities_source_file = require('./source-file.cjs');
|
|
10
|
+
let vitest = require("vitest");
|
|
11
|
+
|
|
12
|
+
//#region src/lib/utilities/source-file.test.ts
|
|
13
|
+
(0, vitest.describe)("base/core/src/lib/utilities/source-file.ts", () => {
|
|
14
|
+
(0, vitest.it)("loads module exports", () => {
|
|
15
|
+
(0, vitest.expect)(require_lib_utilities_source_file.source_file_exports).toBeDefined();
|
|
16
|
+
(0, vitest.expect)(typeof require_lib_utilities_source_file.source_file_exports).toBe("object");
|
|
17
|
+
});
|
|
18
|
+
(0, vitest.it)("has at least one runtime export", () => {
|
|
19
|
+
(0, vitest.expect)(Object.keys(require_lib_utilities_source_file.source_file_exports).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
|
|
9
|
+
import { source_file_exports } from "./source-file.mjs";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
|
|
12
|
+
//#region src/lib/utilities/source-file.test.ts
|
|
13
|
+
describe("base/core/src/lib/utilities/source-file.ts", () => {
|
|
14
|
+
it("loads module exports", () => {
|
|
15
|
+
expect(source_file_exports).toBeDefined();
|
|
16
|
+
expect(typeof source_file_exports).toBe("object");
|
|
17
|
+
});
|
|
18
|
+
it("has at least one runtime export", () => {
|
|
19
|
+
expect(Object.keys(source_file_exports).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { };
|
|
25
|
+
//# sourceMappingURL=source-file.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-file.test.mjs","names":["moduleExports"],"sources":["../../../src/lib/utilities/source-file.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./source-file\";\n\ndescribe(\"base/core/src/lib/utilities/source-file.ts\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,oDAAoD;CAC3D,GAAG,8BAA8B;EAC/B,OAAOA,mBAAa,EAAE,YAAY;EAClC,OAAO,OAAOA,mBAAa,EAAE,KAAK,QAAQ;CAC5C,CAAC;CAED,GAAG,yCAAyC;EAC1C,OAAO,OAAO,KAAKA,mBAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC;CAC7D,CAAC;AACH,CAAC"}
|