@powerlines/core 0.46.6 → 0.47.1
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/constants/index.cjs +1 -4
- package/dist/constants/index.d.cts +1 -2
- package/dist/constants/index.d.mts +1 -2
- package/dist/constants/index.mjs +2 -3
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.mjs +1 -1
- package/dist/lib/unplugin/module-resolution.cjs +10 -10
- 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 +10 -10
- package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
- package/dist/lib/unplugin/plugin.cjs +3 -3
- package/dist/lib/unplugin/plugin.mjs +3 -3
- package/dist/lib/unplugin/plugin.mjs.map +1 -1
- package/dist/lib/utilities/index.cjs +1 -1
- package/dist/lib/utilities/index.mjs +1 -1
- package/dist/plugin-utils/filter.cjs +13 -5
- package/dist/plugin-utils/filter.d.cts +2 -1
- package/dist/plugin-utils/filter.d.cts.map +1 -1
- package/dist/plugin-utils/filter.d.mts +2 -1
- package/dist/plugin-utils/filter.d.mts.map +1 -1
- package/dist/plugin-utils/filter.mjs +13 -6
- package/dist/plugin-utils/filter.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +9 -1
- package/dist/plugin-utils/index.d.cts +3 -2
- package/dist/plugin-utils/index.d.mts +3 -2
- package/dist/plugin-utils/index.mjs +4 -3
- package/dist/plugin-utils/logging.cjs +1 -1
- package/dist/plugin-utils/logging.mjs +1 -1
- package/dist/plugin-utils/virtual.cjs +51 -0
- package/dist/plugin-utils/virtual.d.cts +34 -0
- package/dist/plugin-utils/virtual.d.cts.map +1 -0
- package/dist/plugin-utils/virtual.d.mts +34 -0
- package/dist/plugin-utils/virtual.d.mts.map +1 -0
- package/dist/plugin-utils/virtual.mjs +45 -0
- package/dist/plugin-utils/virtual.mjs.map +1 -0
- package/package.json +6 -6
- package/dist/constants/virtual-modules.cjs +0 -11
- package/dist/constants/virtual-modules.d.cts +0 -6
- package/dist/constants/virtual-modules.d.cts.map +0 -1
- package/dist/constants/virtual-modules.d.mts +0 -6
- package/dist/constants/virtual-modules.d.mts.map +0 -1
- package/dist/constants/virtual-modules.mjs +0 -9
- package/dist/constants/virtual-modules.mjs.map +0 -1
package/dist/constants/index.cjs
CHANGED
|
@@ -3,11 +3,10 @@ const require_constants_api = require('./api.cjs');
|
|
|
3
3
|
const require_constants_commands = require('./commands.cjs');
|
|
4
4
|
const require_constants_plugin = require('./plugin.cjs');
|
|
5
5
|
const require_constants_environments = require('./environments.cjs');
|
|
6
|
+
const require_constants_log_level = require('./log-level.cjs');
|
|
6
7
|
const require_constants_fs = require('./fs.cjs');
|
|
7
8
|
const require_constants_hooks = require('./hooks.cjs');
|
|
8
|
-
const require_constants_log_level = require('./log-level.cjs');
|
|
9
9
|
const require_constants_meta = require('./meta.cjs');
|
|
10
|
-
const require_constants_virtual_modules = require('./virtual-modules.cjs');
|
|
11
10
|
|
|
12
11
|
exports.BASE_API_FUNCTIONS = require_constants_api.BASE_API_FUNCTIONS;
|
|
13
12
|
exports.BUILDER_VARIANTS = require_constants_plugin.BUILDER_VARIANTS;
|
|
@@ -35,7 +34,5 @@ exports.SSR_ENVIRONMENT = require_constants_environments.SSR_ENVIRONMENT;
|
|
|
35
34
|
exports.STORAGE_PRESETS = require_constants_fs.STORAGE_PRESETS;
|
|
36
35
|
exports.SUPPORTED_COMMANDS = require_constants_commands.SUPPORTED_COMMANDS;
|
|
37
36
|
exports.UNPLUGIN_BUILDER_VARIANTS = require_constants_plugin.UNPLUGIN_BUILDER_VARIANTS;
|
|
38
|
-
exports.VIRTUAL_MODULE_PREFIX = require_constants_virtual_modules.VIRTUAL_MODULE_PREFIX;
|
|
39
|
-
exports.VIRTUAL_MODULE_PREFIX_REGEX = require_constants_virtual_modules.VIRTUAL_MODULE_PREFIX_REGEX;
|
|
40
37
|
exports.__VFS_PATCH__ = require_constants_fs.__VFS_PATCH__;
|
|
41
38
|
exports.__VFS_REVERT__ = require_constants_fs.__VFS_REVERT__;
|
|
@@ -6,5 +6,4 @@ import { HOOKS_LIST_ORDERS } from "./hooks.cjs";
|
|
|
6
6
|
import { DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels } from "./log-level.cjs";
|
|
7
7
|
import { CACHE_HASH_LENGTH, ROOT_HASH_LENGTH } from "./meta.cjs";
|
|
8
8
|
import { BUILDER_VARIANTS, KNOWN_PLUGIN_FIELDS, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, UNPLUGIN_BUILDER_VARIANTS } from "./plugin.cjs";
|
|
9
|
-
|
|
10
|
-
export { BASE_API_FUNCTIONS, BUILDER_VARIANTS, CACHE_HASH_LENGTH, CLIENT_ENVIRONMENT, DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_ENVIRONMENT, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, GLOBAL_ENVIRONMENT, HOOKS_LIST_ORDERS, KNOWN_PLUGIN_FIELDS, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, POWERLINES_API_FUNCTIONS, ROOT_HASH_LENGTH, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT, STORAGE_PRESETS, SUPPORTED_COMMANDS, UNPLUGIN_BUILDER_VARIANTS, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, __VFS_PATCH__, __VFS_REVERT__ };
|
|
9
|
+
export { BASE_API_FUNCTIONS, BUILDER_VARIANTS, CACHE_HASH_LENGTH, CLIENT_ENVIRONMENT, DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_ENVIRONMENT, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, GLOBAL_ENVIRONMENT, HOOKS_LIST_ORDERS, KNOWN_PLUGIN_FIELDS, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, POWERLINES_API_FUNCTIONS, ROOT_HASH_LENGTH, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT, STORAGE_PRESETS, SUPPORTED_COMMANDS, UNPLUGIN_BUILDER_VARIANTS, __VFS_PATCH__, __VFS_REVERT__ };
|
|
@@ -6,5 +6,4 @@ import { HOOKS_LIST_ORDERS } from "./hooks.mjs";
|
|
|
6
6
|
import { DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels } from "./log-level.mjs";
|
|
7
7
|
import { CACHE_HASH_LENGTH, ROOT_HASH_LENGTH } from "./meta.mjs";
|
|
8
8
|
import { BUILDER_VARIANTS, KNOWN_PLUGIN_FIELDS, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, UNPLUGIN_BUILDER_VARIANTS } from "./plugin.mjs";
|
|
9
|
-
|
|
10
|
-
export { BASE_API_FUNCTIONS, BUILDER_VARIANTS, CACHE_HASH_LENGTH, CLIENT_ENVIRONMENT, DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_ENVIRONMENT, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, GLOBAL_ENVIRONMENT, HOOKS_LIST_ORDERS, KNOWN_PLUGIN_FIELDS, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, POWERLINES_API_FUNCTIONS, ROOT_HASH_LENGTH, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT, STORAGE_PRESETS, SUPPORTED_COMMANDS, UNPLUGIN_BUILDER_VARIANTS, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, __VFS_PATCH__, __VFS_REVERT__ };
|
|
9
|
+
export { BASE_API_FUNCTIONS, BUILDER_VARIANTS, CACHE_HASH_LENGTH, CLIENT_ENVIRONMENT, DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_ENVIRONMENT, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, GLOBAL_ENVIRONMENT, HOOKS_LIST_ORDERS, KNOWN_PLUGIN_FIELDS, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, POWERLINES_API_FUNCTIONS, ROOT_HASH_LENGTH, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT, STORAGE_PRESETS, SUPPORTED_COMMANDS, UNPLUGIN_BUILDER_VARIANTS, __VFS_PATCH__, __VFS_REVERT__ };
|
package/dist/constants/index.mjs
CHANGED
|
@@ -2,10 +2,9 @@ import { BASE_API_FUNCTIONS, POWERLINES_API_FUNCTIONS } from "./api.mjs";
|
|
|
2
2
|
import { SUPPORTED_COMMANDS } from "./commands.mjs";
|
|
3
3
|
import { BUILDER_VARIANTS, KNOWN_PLUGIN_FIELDS, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, UNPLUGIN_BUILDER_VARIANTS } from "./plugin.mjs";
|
|
4
4
|
import { CLIENT_ENVIRONMENT, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT } from "./environments.mjs";
|
|
5
|
+
import { DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels } from "./log-level.mjs";
|
|
5
6
|
import { STORAGE_PRESETS, __VFS_PATCH__, __VFS_REVERT__ } from "./fs.mjs";
|
|
6
7
|
import { HOOKS_LIST_ORDERS } from "./hooks.mjs";
|
|
7
|
-
import { DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels } from "./log-level.mjs";
|
|
8
8
|
import { CACHE_HASH_LENGTH, ROOT_HASH_LENGTH } from "./meta.mjs";
|
|
9
|
-
import { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX } from "./virtual-modules.mjs";
|
|
10
9
|
|
|
11
|
-
export { BASE_API_FUNCTIONS, BUILDER_VARIANTS, CACHE_HASH_LENGTH, CLIENT_ENVIRONMENT, DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_ENVIRONMENT, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, GLOBAL_ENVIRONMENT, HOOKS_LIST_ORDERS, KNOWN_PLUGIN_FIELDS, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, POWERLINES_API_FUNCTIONS, ROOT_HASH_LENGTH, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT, STORAGE_PRESETS, SUPPORTED_COMMANDS, UNPLUGIN_BUILDER_VARIANTS,
|
|
10
|
+
export { BASE_API_FUNCTIONS, BUILDER_VARIANTS, CACHE_HASH_LENGTH, CLIENT_ENVIRONMENT, DEFAULT_DEVELOPMENT_LOG_LEVEL, DEFAULT_ENVIRONMENT, DEFAULT_PRODUCTION_LOG_LEVEL, DEFAULT_TEST_LOG_LEVEL, GLOBAL_ENVIRONMENT, HOOKS_LIST_ORDERS, KNOWN_PLUGIN_FIELDS, LOG_CATEGORIES, LOG_CATEGORIES_ARRAY, LOG_LEVELS, LogCategories, LogLevels, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS, POWERLINES_API_FUNCTIONS, ROOT_HASH_LENGTH, RSC_ENVIRONMENT, SERVER_ENVIRONMENT, SSR_ENVIRONMENT, STORAGE_PRESETS, SUPPORTED_COMMANDS, UNPLUGIN_BUILDER_VARIANTS, __VFS_PATCH__, __VFS_REVERT__ };
|
package/dist/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_lib_config = require('./lib/config.cjs');
|
|
3
3
|
const require_lib_entry = require('./lib/entry.cjs');
|
|
4
4
|
const require_lib_unplugin_helpers = require('./lib/unplugin/helpers.cjs');
|
|
5
|
+
const require_lib_utilities_format = require('./lib/utilities/format.cjs');
|
|
5
6
|
const require_lib_unplugin_module_resolution = require('./lib/unplugin/module-resolution.cjs');
|
|
6
7
|
const require_lib_utilities_source_file = require('./lib/utilities/source-file.cjs');
|
|
7
8
|
const require_lib_unplugin_plugin = require('./lib/unplugin/plugin.cjs');
|
|
8
9
|
const require_lib_utilities_file_header = require('./lib/utilities/file-header.cjs');
|
|
9
|
-
const require_lib_utilities_format = require('./lib/utilities/format.cjs');
|
|
10
10
|
const require_lib_utilities_source_map = require('./lib/utilities/source-map.cjs');
|
|
11
11
|
const require_lib_utilities_write_file = require('./lib/utilities/write-file.cjs');
|
|
12
12
|
require('./lib/index.cjs');
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineConfig, loadUserConfigFile, loadWorkspaceConfig } from "./lib/config.mjs";
|
|
2
2
|
import { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./lib/entry.mjs";
|
|
3
3
|
import { combineContexts, isUnpluginBuilderVariant } from "./lib/unplugin/helpers.mjs";
|
|
4
|
+
import { format, formatFolder } from "./lib/utilities/format.mjs";
|
|
4
5
|
import { createUnpluginModuleResolutionFunctions } from "./lib/unplugin/module-resolution.mjs";
|
|
5
6
|
import { getMagicString, getSourceFile, getString } from "./lib/utilities/source-file.mjs";
|
|
6
7
|
import { createUnplugin, createUnpluginResolver } from "./lib/unplugin/plugin.mjs";
|
|
7
8
|
import { getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader } from "./lib/utilities/file-header.mjs";
|
|
8
|
-
import { format, formatFolder } from "./lib/utilities/format.mjs";
|
|
9
9
|
import { generateSourceMap } from "./lib/utilities/source-map.mjs";
|
|
10
10
|
import { writeFile } from "./lib/utilities/write-file.mjs";
|
|
11
11
|
import "./lib/index.mjs";
|
package/dist/lib/index.cjs
CHANGED
|
@@ -2,12 +2,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_lib_config = require('./config.cjs');
|
|
3
3
|
const require_lib_entry = require('./entry.cjs');
|
|
4
4
|
const require_lib_unplugin_helpers = require('./unplugin/helpers.cjs');
|
|
5
|
+
const require_lib_utilities_format = require('./utilities/format.cjs');
|
|
5
6
|
const require_lib_unplugin_module_resolution = require('./unplugin/module-resolution.cjs');
|
|
6
7
|
const require_lib_utilities_source_file = require('./utilities/source-file.cjs');
|
|
7
8
|
const require_lib_unplugin_plugin = require('./unplugin/plugin.cjs');
|
|
8
9
|
require('./unplugin/index.cjs');
|
|
9
10
|
const require_lib_utilities_file_header = require('./utilities/file-header.cjs');
|
|
10
|
-
const require_lib_utilities_format = require('./utilities/format.cjs');
|
|
11
11
|
const require_lib_utilities_source_map = require('./utilities/source-map.cjs');
|
|
12
12
|
const require_lib_utilities_write_file = require('./utilities/write-file.cjs');
|
|
13
13
|
require('./utilities/index.cjs');
|
package/dist/lib/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineConfig, loadUserConfigFile, loadWorkspaceConfig } from "./config.mjs";
|
|
2
2
|
import { getUniqueInputs, isResolvedEntryTypeDefinition, isTypeDefinition, resolveEntryOutput, resolveInput, resolveInputs, resolveInputsSync } from "./entry.mjs";
|
|
3
3
|
import { combineContexts, isUnpluginBuilderVariant } from "./unplugin/helpers.mjs";
|
|
4
|
+
import { format, formatFolder } from "./utilities/format.mjs";
|
|
4
5
|
import { createUnpluginModuleResolutionFunctions } from "./unplugin/module-resolution.mjs";
|
|
5
6
|
import { getMagicString, getSourceFile, getString } from "./utilities/source-file.mjs";
|
|
6
7
|
import { createUnplugin, createUnpluginResolver } from "./unplugin/plugin.mjs";
|
|
7
8
|
import "./unplugin/index.mjs";
|
|
8
9
|
import { getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader } from "./utilities/file-header.mjs";
|
|
9
|
-
import { format, formatFolder } from "./utilities/format.mjs";
|
|
10
10
|
import { generateSourceMap } from "./utilities/source-map.mjs";
|
|
11
11
|
import { writeFile } from "./utilities/write-file.mjs";
|
|
12
12
|
import "./utilities/index.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const
|
|
4
|
-
require('../../
|
|
3
|
+
const require_plugin_utils_virtual = require('../../plugin-utils/virtual.cjs');
|
|
4
|
+
require('../../plugin-utils/index.cjs');
|
|
5
5
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
6
6
|
let defu = require("defu");
|
|
7
7
|
defu = require_runtime.__toESM(defu, 1);
|
|
@@ -25,8 +25,8 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
25
25
|
const ctx = context;
|
|
26
26
|
return {
|
|
27
27
|
async resolveId(id, importer, opts = { isEntry: false }) {
|
|
28
|
-
const normalizedId =
|
|
29
|
-
const normalizedImporter = importer ?
|
|
28
|
+
const normalizedId = require_plugin_utils_virtual.removeVirtualPrefix(id);
|
|
29
|
+
const normalizedImporter = importer ? require_plugin_utils_virtual.removeVirtualPrefix(importer) : void 0;
|
|
30
30
|
let result = await ctx.api.callHook("resolveId", {
|
|
31
31
|
sequential: true,
|
|
32
32
|
result: "first",
|
|
@@ -35,7 +35,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
35
35
|
if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
36
36
|
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
37
37
|
...result,
|
|
38
|
-
id: result.virtual && options.prefix !== false ?
|
|
38
|
+
id: result.virtual && options.prefix !== false ? require_plugin_utils_virtual.addVirtualPrefix(result.id) : result.id
|
|
39
39
|
};
|
|
40
40
|
result = await ctx.api.callHook("resolveId", {
|
|
41
41
|
sequential: true,
|
|
@@ -45,7 +45,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
45
45
|
if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
46
46
|
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
47
47
|
...result,
|
|
48
|
-
id: result.virtual && options.prefix !== false ?
|
|
48
|
+
id: result.virtual && options.prefix !== false ? require_plugin_utils_virtual.addVirtualPrefix(result.id) : result.id
|
|
49
49
|
};
|
|
50
50
|
result = await ctx.resolve(normalizedId, normalizedImporter, (0, defu.default)(options.overrides ?? {}, {
|
|
51
51
|
isFile: true,
|
|
@@ -53,7 +53,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
53
53
|
}));
|
|
54
54
|
if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
55
55
|
...result,
|
|
56
|
-
id: result.virtual && options.prefix !== false ?
|
|
56
|
+
id: result.virtual && options.prefix !== false ? require_plugin_utils_virtual.addVirtualPrefix(result.id) : result.id
|
|
57
57
|
};
|
|
58
58
|
result = await ctx.api.callHook("resolveId", {
|
|
59
59
|
sequential: true,
|
|
@@ -63,14 +63,14 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
63
63
|
if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
64
64
|
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
65
65
|
...result,
|
|
66
|
-
id: result.virtual && options.prefix !== false ?
|
|
66
|
+
id: result.virtual && options.prefix !== false ? require_plugin_utils_virtual.addVirtualPrefix(result.id) : result.id
|
|
67
67
|
};
|
|
68
68
|
return null;
|
|
69
69
|
},
|
|
70
70
|
load: {
|
|
71
|
-
filter: options.prefix !== false ? { id:
|
|
71
|
+
filter: options.prefix !== false ? { id: require_plugin_utils_virtual.VIRTUAL_MODULE_PREFIX_REGEX } : void 0,
|
|
72
72
|
async handler(id) {
|
|
73
|
-
const normalizedId =
|
|
73
|
+
const normalizedId = require_plugin_utils_virtual.removeVirtualPrefix(id);
|
|
74
74
|
let result = await ctx.api.callHook("load", {
|
|
75
75
|
sequential: true,
|
|
76
76
|
result: "first",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-resolution.d.cts","names":[],"sources":["../../../src/lib/unplugin/module-resolution.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"module-resolution.d.cts","names":[],"sources":["../../../src/lib/unplugin/module-resolution.ts"],"mappings":";;;;;UAoCiB,8CAAA;;AAAjB;;;;;;;;EAUE,MAAA;EAQkC;AAgBpC;;;;;EAhBE,SAAA,GAAY,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;;;;;;iBAgBN,uCAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,8CAAA,GACR,IAAA,CAAK,eAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-resolution.d.mts","names":[],"sources":["../../../src/lib/unplugin/module-resolution.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"module-resolution.d.mts","names":[],"sources":["../../../src/lib/unplugin/module-resolution.ts"],"mappings":";;;;;UAoCiB,8CAAA;;AAAjB;;;;;;;;EAUE,MAAA;EAQkC;AAgBpC;;;;;EAhBE,SAAA,GAAY,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;;;;;;iBAgBN,uCAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,8CAAA,GACR,IAAA,CAAK,eAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../
|
|
1
|
+
import { VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, removeVirtualPrefix } from "../../plugin-utils/virtual.mjs";
|
|
2
|
+
import "../../plugin-utils/index.mjs";
|
|
3
3
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
4
4
|
import defu from "defu";
|
|
5
5
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
@@ -22,8 +22,8 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
22
22
|
const ctx = context;
|
|
23
23
|
return {
|
|
24
24
|
async resolveId(id, importer, opts = { isEntry: false }) {
|
|
25
|
-
const normalizedId = id
|
|
26
|
-
const normalizedImporter = importer ? importer
|
|
25
|
+
const normalizedId = removeVirtualPrefix(id);
|
|
26
|
+
const normalizedImporter = importer ? removeVirtualPrefix(importer) : void 0;
|
|
27
27
|
let result = await ctx.api.callHook("resolveId", {
|
|
28
28
|
sequential: true,
|
|
29
29
|
result: "first",
|
|
@@ -32,7 +32,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
32
32
|
if (isSetString(result)) return result;
|
|
33
33
|
else if (isSetObject(result)) return {
|
|
34
34
|
...result,
|
|
35
|
-
id: result.virtual && options.prefix !== false ?
|
|
35
|
+
id: result.virtual && options.prefix !== false ? addVirtualPrefix(result.id) : result.id
|
|
36
36
|
};
|
|
37
37
|
result = await ctx.api.callHook("resolveId", {
|
|
38
38
|
sequential: true,
|
|
@@ -42,7 +42,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
42
42
|
if (isSetString(result)) return result;
|
|
43
43
|
else if (isSetObject(result)) return {
|
|
44
44
|
...result,
|
|
45
|
-
id: result.virtual && options.prefix !== false ?
|
|
45
|
+
id: result.virtual && options.prefix !== false ? addVirtualPrefix(result.id) : result.id
|
|
46
46
|
};
|
|
47
47
|
result = await ctx.resolve(normalizedId, normalizedImporter, defu(options.overrides ?? {}, {
|
|
48
48
|
isFile: true,
|
|
@@ -50,7 +50,7 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
50
50
|
}));
|
|
51
51
|
if (isSetObject(result)) return {
|
|
52
52
|
...result,
|
|
53
|
-
id: result.virtual && options.prefix !== false ?
|
|
53
|
+
id: result.virtual && options.prefix !== false ? addVirtualPrefix(result.id) : result.id
|
|
54
54
|
};
|
|
55
55
|
result = await ctx.api.callHook("resolveId", {
|
|
56
56
|
sequential: true,
|
|
@@ -60,14 +60,14 @@ function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
|
60
60
|
if (isSetString(result)) return result;
|
|
61
61
|
else if (isSetObject(result)) return {
|
|
62
62
|
...result,
|
|
63
|
-
id: result.virtual && options.prefix !== false ?
|
|
63
|
+
id: result.virtual && options.prefix !== false ? addVirtualPrefix(result.id) : result.id
|
|
64
64
|
};
|
|
65
65
|
return null;
|
|
66
66
|
},
|
|
67
67
|
load: {
|
|
68
|
-
filter: options.prefix !== false ? { id:
|
|
68
|
+
filter: options.prefix !== false ? { id: VIRTUAL_MODULE_PREFIX_REGEX } : void 0,
|
|
69
69
|
async handler(id) {
|
|
70
|
-
const normalizedId = id
|
|
70
|
+
const normalizedId = removeVirtualPrefix(id);
|
|
71
71
|
let result = await ctx.api.callHook("load", {
|
|
72
72
|
sequential: true,
|
|
73
73
|
result: "first",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-resolution.mjs","names":[],"sources":["../../../src/lib/unplugin/module-resolution.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 { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { LoadResult } from \"rollup\";\nimport type {\n UnpluginBuildContext,\n UnpluginContext,\n UnpluginOptions\n} from \"unplugin\";\nimport {\n
|
|
1
|
+
{"version":3,"file":"module-resolution.mjs","names":[],"sources":["../../../src/lib/unplugin/module-resolution.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 { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { LoadResult } from \"rollup\";\nimport type {\n UnpluginBuildContext,\n UnpluginContext,\n UnpluginOptions\n} from \"unplugin\";\nimport {\n addVirtualPrefix,\n removeVirtualPrefix,\n VIRTUAL_MODULE_PREFIX_REGEX\n} from \"../../plugin-utils\";\nimport { Unstable_PluginContext } from \"../../types/_internal\";\nimport { PluginContext, ResolveResult } from \"../../types/context\";\nimport { ResolveOptions } from \"../../types/fs\";\n\nexport interface CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * An indicator of whether to prefix virtual module IDs with a specific string. This is useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself.\n *\n * @remarks\n * - If set to `true`, virtual module IDs will be prefixed with the string `__powerlines-virtual:`.\n * - If set to `false`, no prefix will be added to virtual module IDs.\n *\n * @defaultValue true\n */\n prefix?: boolean;\n\n /**\n * Optional overrides for the module resolution configuration.\n *\n * @remarks\n * This allows you to customize the behavior of the module resolution hooks by providing specific configuration options.\n */\n overrides?: Partial<ResolveOptions>;\n}\n\n/**\n * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.\n *\n * @remarks\n * This includes the `resolveId` and `load` hooks.\n *\n * @see https://rollupjs.org/plugin-development/#resolveid\n * @see https://rollupjs.org/plugin-development/#load\n *\n * @param context - The plugin context.\n * @param options - Options for creating the module resolution functions.\n * @returns The module resolution hooks (`resolveId` and `load`).\n */\nexport function createUnpluginModuleResolutionFunctions<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginModuleResolutionFunctionsOptions = {}\n): Pick<UnpluginOptions, \"resolveId\" | \"load\"> {\n const ctx = context as unknown as Unstable_PluginContext;\n\n return {\n async resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ): Promise<string | ResolveResult | null | undefined> {\n const normalizedId = removeVirtualPrefix(id);\n const normalizedImporter = importer\n ? removeVirtualPrefix(importer)\n : undefined;\n\n let result = await ctx.api.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await ctx.api.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await ctx.resolve(\n normalizedId,\n normalizedImporter,\n defu(options.overrides ?? {}, {\n isFile: true,\n ...opts\n })\n );\n if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await ctx.api.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n return null;\n },\n load: {\n filter:\n options.prefix !== false\n ? {\n id: VIRTUAL_MODULE_PREFIX_REGEX\n }\n : undefined,\n async handler(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult | null | undefined> {\n const normalizedId = removeVirtualPrefix(id);\n\n let result = await ctx.api.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.api.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.load(normalizedId);\n if (result) {\n return result;\n }\n\n return ctx.api.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId\n );\n }\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,wCAGd,SACA,UAA0D,EAAE,EACf;CAC7C,MAAM,MAAM;AAEZ,QAAO;EACL,MAAM,UAEJ,IACA,UACA,OAEI,EAAE,SAAS,OAAO,EAC8B;GACpD,MAAM,eAAe,oBAAoB,GAAG;GAC5C,MAAM,qBAAqB,WACvB,oBAAoB,SAAS,GAC7B;GAEJ,IAAI,SAAS,MAAM,IAAI,IAAI,SACzB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;IACR,EACD,cACA,oBACA,KACD;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;YACE,YAAY,OAAO,CAC5B,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,YAAS,MAAM,IAAI,IAAI,SACrB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;IACR,EACD,cACA,oBACA,KACD;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;YACE,YAAY,OAAO,CAC5B,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,YAAS,MAAM,IAAI,QACjB,cACA,oBACA,KAAK,QAAQ,aAAa,EAAE,EAAE;IAC5B,QAAQ;IACR,GAAG;IACJ,CAAC,CACH;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,YAAS,MAAM,IAAI,IAAI,SACrB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;IACR,EACD,cACA,oBACA,KACD;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;YACE,YAAY,OAAO,CAC5B,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,UAAO;;EAET,MAAM;GACJ,QACE,QAAQ,WAAW,QACf,EACE,IAAI,6BACL,GACD;GACN,MAAM,QAEJ,IACwC;IACxC,MAAM,eAAe,oBAAoB,GAAG;IAE5C,IAAI,SAAS,MAAM,IAAI,IAAI,SACzB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,IAAI,SACrB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,KAAK,aAAa;AACrC,QAAI,OACF,QAAO;AAGT,WAAO,IAAI,IAAI,SACb,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;;GAEJ;EACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_lib_unplugin_helpers = require('./helpers.cjs');
|
|
4
|
-
const
|
|
5
|
-
require('../../
|
|
4
|
+
const require_plugin_utils_virtual = require('../../plugin-utils/virtual.cjs');
|
|
5
|
+
require('../../plugin-utils/index.cjs');
|
|
6
6
|
const require_lib_unplugin_module_resolution = require('./module-resolution.cjs');
|
|
7
7
|
const require_lib_utilities_source_file = require('../utilities/source-file.cjs');
|
|
8
8
|
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
@@ -59,7 +59,7 @@ function createUnplugin(context, options = {}) {
|
|
|
59
59
|
async function transform(code, id) {
|
|
60
60
|
let transformed = code;
|
|
61
61
|
for (const hook of ctx.environment.selectHooks("transform")) {
|
|
62
|
-
const result = await hook.handler.apply(require_lib_unplugin_helpers.combineContexts(ctx, this), [require_lib_utilities_source_file.getString(transformed),
|
|
62
|
+
const result = await hook.handler.apply(require_lib_unplugin_helpers.combineContexts(ctx, this), [require_lib_utilities_source_file.getString(transformed), require_plugin_utils_virtual.removeVirtualPrefix(id)]);
|
|
63
63
|
if (result) transformed = result;
|
|
64
64
|
}
|
|
65
65
|
return transformed;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { combineContexts } from "./helpers.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import "../../
|
|
2
|
+
import { removeVirtualPrefix } from "../../plugin-utils/virtual.mjs";
|
|
3
|
+
import "../../plugin-utils/index.mjs";
|
|
4
4
|
import { createUnpluginModuleResolutionFunctions } from "./module-resolution.mjs";
|
|
5
5
|
import { getString } from "../utilities/source-file.mjs";
|
|
6
6
|
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
@@ -57,7 +57,7 @@ function createUnplugin(context, options = {}) {
|
|
|
57
57
|
async function transform(code, id) {
|
|
58
58
|
let transformed = code;
|
|
59
59
|
for (const hook of ctx.environment.selectHooks("transform")) {
|
|
60
|
-
const result = await hook.handler.apply(combineContexts(ctx, this), [getString(transformed), id
|
|
60
|
+
const result = await hook.handler.apply(combineContexts(ctx, this), [getString(transformed), removeVirtualPrefix(id)]);
|
|
61
61
|
if (result) transformed = result;
|
|
62
62
|
}
|
|
63
63
|
return transformed;
|
|
@@ -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 {
|
|
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 { Unstable_PluginContext } from \"../../types/_internal\";\nimport { PluginContext } from \"../../types/context\";\nimport { UnpluginFactory } 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<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext<any>;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const logger = ctx.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\"\n ? { source: name }\n : {}\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 api: ctx.$$internal.api,\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}\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): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse.bind(ctx));\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const logger = ctx.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\"\n ? { source: name }\n : {}\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 ctx.api.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 ctx.environment.selectHooks(\"transform\")) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(ctx, 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 ctx.api.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 ctx.api.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.api,\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}\n"],"mappings":";;;;;;;;;;;;;;;;AA8DA,SAAgB,uBAGd,SACA,UAAyC,EAAE,EAChB;CAC3B,MAAM,MAAM;AACZ,cAAa,IAAI,MAAM;CAEvB,MAAM,OAAO,QAAQ,QAAQ;AAE7B,cAAa;EACX,MAAM,SAAS,IAAI,aACjB,CAAC,QAAQ,sBAAsB,SAAS,eACpC,EAAE,QAAQ,MAAM,GAChB,EAAE,CACP;AACD,SAAO,MAAM,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAEtD,MAAI;GACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;AAErE,UAAO;IACL,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;IACnC,KAAK,IAAI,WAAW;IACpB;IACA;IACD;WACM,OAAO;AACd,UAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;AAEpE,SAAM;;;;;;;;;;AAaZ,SAAgB,eACd,SACA,UAAiC,EAAE,EACR;CAC3B,MAAM,MAAM;AACZ,cAAa,IAAI,MAAM,KAAK,IAAI,CAAC;CAEjC,MAAM,OAAO,QAAQ,QAAQ;AAE7B,cAAa;EACX,MAAM,SAAS,IAAI,aACjB,CAAC,QAAQ,sBAAsB,SAAS,eACpC,EAAE,QAAQ,MAAM,GAChB,EAAE,CACP;AACD,SAAO,MAAM,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAEtD,MAAI;GACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;GAErE,eAAe,aAAuC;AACpD,QAAI,CAAC,QAAQ,mBACX,QAAO,MAAM,sCAAsC;AAGrD,UAAM,IAAI,IAAI,SAAS,cAAc,EACnC,YAAY,MACb,CAAC;;GAGJ,eAAe,UAEb,MACA,IAC6C;IAC7C,IAAI,cAAwC;AAE5C,SAAK,MAAM,QAAQ,IAAI,YAAY,YAAY,YAAY,EAAE;KAC3D,MAAM,SACJ,MAAM,KAAK,QAAQ,MAAM,gBAAgB,KAAK,KAAK,EAAE,CACnD,UAAU,YAAY,EACtB,oBAAoB,GAAG,CACxB,CAA+B;AAClC,SAAI,OACF,eAAc;;AAIlB,WAAO;;GAGT,eAAe,WAAoD;AACjE,QAAI,CAAC,QAAQ,mBACX,QAAO,MAAM,uCAAuC;AAGtD,WAAO,IAAI,IAAI,SAAS,YAAY,EAClC,YAAY,MACb,CAAC;;GAGJ,eAAe,cAA6B;AAC1C,QAAI,CAAC,QAAQ,mBACX,QAAO,MAAM,0CAA0C;AAGzD,WAAO,IAAI,IAAI,SAAS,eAAe,EACrC,YAAY,MACb,CAAC;;AAGJ,UAAO;IACL,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;IACnC,KAAK,IAAI;IACT;IACA;IACA;IACA;IACA;IACA;IACA,MAAM,EACJ,mBAAmB,MACpB;IACF;WACM,OAAO;AACd,UAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;AAEpE,SAAM"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_lib_utilities_format = require('./format.cjs');
|
|
2
3
|
const require_lib_utilities_source_file = require('./source-file.cjs');
|
|
3
4
|
const require_lib_utilities_file_header = require('./file-header.cjs');
|
|
4
|
-
const require_lib_utilities_format = require('./format.cjs');
|
|
5
5
|
const require_lib_utilities_source_map = require('./source-map.cjs');
|
|
6
6
|
const require_lib_utilities_write_file = require('./write-file.cjs');
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { format, formatFolder } from "./format.mjs";
|
|
1
2
|
import { getMagicString, getSourceFile, getString } from "./source-file.mjs";
|
|
2
3
|
import { getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader } from "./file-header.mjs";
|
|
3
|
-
import { format, formatFolder } from "./format.mjs";
|
|
4
4
|
import { generateSourceMap } from "./source-map.mjs";
|
|
5
5
|
import { writeFile } from "./write-file.mjs";
|
|
6
6
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_plugin_utils_virtual = require('./virtual.cjs');
|
|
3
4
|
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
4
5
|
let _stryke_path_is_type = require("@stryke/path/is-type");
|
|
6
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
7
|
+
let _stryke_type_checks_is_regexp = require("@stryke/type-checks/is-regexp");
|
|
5
8
|
let node_path = require("node:path");
|
|
6
9
|
let picomatch = require("picomatch");
|
|
7
10
|
picomatch = require_runtime.__toESM(picomatch, 1);
|
|
@@ -9,7 +12,7 @@ picomatch = require_runtime.__toESM(picomatch, 1);
|
|
|
9
12
|
//#region src/plugin-utils/filter.ts
|
|
10
13
|
const BACKSLASH_REGEX = /\\/g;
|
|
11
14
|
function normalize(path) {
|
|
12
|
-
return path.replace(BACKSLASH_REGEX, "/");
|
|
15
|
+
return require_plugin_utils_virtual.removeVirtualPrefix(path).replace(BACKSLASH_REGEX, "/");
|
|
13
16
|
}
|
|
14
17
|
function getMatcherString(glob, cwd) {
|
|
15
18
|
if (glob.startsWith("**") || (0, _stryke_path_is_type.isAbsolutePath)(glob)) return normalize(glob);
|
|
@@ -43,12 +46,16 @@ function createFilter(exclude, include) {
|
|
|
43
46
|
return !(include && include.length > 0);
|
|
44
47
|
};
|
|
45
48
|
}
|
|
49
|
+
function normalizeSingleFilter(filter) {
|
|
50
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(filter)) return require_plugin_utils_virtual.removeVirtualPrefix(filter);
|
|
51
|
+
return filter;
|
|
52
|
+
}
|
|
46
53
|
function normalizeFilter(filter) {
|
|
47
|
-
if (
|
|
48
|
-
if (Array.isArray(filter)) return { include: filter };
|
|
54
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(filter) || (0, _stryke_type_checks_is_regexp.isRegExp)(filter)) return { include: [normalizeSingleFilter(filter)] };
|
|
55
|
+
if (Array.isArray(filter)) return { include: filter.map(normalizeSingleFilter) };
|
|
49
56
|
return {
|
|
50
|
-
exclude: filter.exclude ? (0, _stryke_convert_to_array.toArray)(filter.exclude) : void 0,
|
|
51
|
-
include: filter.include ? (0, _stryke_convert_to_array.toArray)(filter.include) : void 0
|
|
57
|
+
exclude: filter.exclude ? (0, _stryke_convert_to_array.toArray)(filter.exclude).map(normalizeSingleFilter) : void 0,
|
|
58
|
+
include: filter.include ? (0, _stryke_convert_to_array.toArray)(filter.include).map(normalizeSingleFilter) : void 0
|
|
52
59
|
};
|
|
53
60
|
}
|
|
54
61
|
function createIdFilter(filter) {
|
|
@@ -89,5 +96,6 @@ exports.createFilterForId = createFilterForId;
|
|
|
89
96
|
exports.createFilterForTransform = createFilterForTransform;
|
|
90
97
|
exports.createIdFilter = createIdFilter;
|
|
91
98
|
exports.normalizeFilter = normalizeFilter;
|
|
99
|
+
exports.normalizeSingleFilter = normalizeSingleFilter;
|
|
92
100
|
exports.patternToCodeFilter = patternToCodeFilter;
|
|
93
101
|
exports.patternToIdFilter = patternToIdFilter;
|
|
@@ -5,11 +5,12 @@ import { StringFilter, StringOrRegExp } from "unplugin";
|
|
|
5
5
|
declare function patternToIdFilter(pattern: StringOrRegExp): PluginFilter;
|
|
6
6
|
declare function patternToCodeFilter(pattern: StringOrRegExp): PluginFilter;
|
|
7
7
|
declare function createFilter(exclude: PluginFilter[] | undefined, include: PluginFilter[] | undefined): PluginFilter | undefined;
|
|
8
|
+
declare function normalizeSingleFilter(filter: string | RegExp): string | RegExp;
|
|
8
9
|
declare function normalizeFilter(filter: StringFilter): NormalizedStringFilter;
|
|
9
10
|
declare function createIdFilter(filter: StringFilter | undefined): PluginFilter | undefined;
|
|
10
11
|
declare function createCodeFilter(filter: StringFilter | undefined): PluginFilter | undefined;
|
|
11
12
|
declare function createFilterForId(filter: StringFilter | undefined): PluginFilter | undefined;
|
|
12
13
|
declare function createFilterForTransform(idFilter: StringFilter | undefined, codeFilter: StringFilter | undefined): TransformHookFilter | undefined;
|
|
13
14
|
//#endregion
|
|
14
|
-
export { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, patternToCodeFilter, patternToIdFilter };
|
|
15
|
+
export { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter };
|
|
15
16
|
//# sourceMappingURL=filter.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.cts","names":[],"sources":["../../src/plugin-utils/filter.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"filter.d.cts","names":[],"sources":["../../src/plugin-utils/filter.ts"],"mappings":";;;;iBA+CgB,iBAAA,CAAkB,OAAA,EAAS,cAAA,GAAiB,YAAA;AAAA,iBAoB5C,mBAAA,CAAoB,OAAA,EAAS,cAAA,GAAiB,YAAA;AAAA,iBAW9C,YAAA,CACd,OAAA,EAAS,YAAA,gBACT,OAAA,EAAS,YAAA,iBACR,YAAA;AAAA,iBAgBa,qBAAA,CACd,MAAA,WAAiB,MAAA,YACP,MAAA;AAAA,iBAQI,eAAA,CAAgB,MAAA,EAAQ,YAAA,GAAe,sBAAA;AAAA,iBAuBvC,cAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBASa,gBAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBASa,iBAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBAMa,wBAAA,CACd,QAAA,EAAU,YAAA,cACV,UAAA,EAAY,YAAA,eACX,mBAAA"}
|
|
@@ -5,11 +5,12 @@ import { StringFilter, StringOrRegExp } from "unplugin";
|
|
|
5
5
|
declare function patternToIdFilter(pattern: StringOrRegExp): PluginFilter;
|
|
6
6
|
declare function patternToCodeFilter(pattern: StringOrRegExp): PluginFilter;
|
|
7
7
|
declare function createFilter(exclude: PluginFilter[] | undefined, include: PluginFilter[] | undefined): PluginFilter | undefined;
|
|
8
|
+
declare function normalizeSingleFilter(filter: string | RegExp): string | RegExp;
|
|
8
9
|
declare function normalizeFilter(filter: StringFilter): NormalizedStringFilter;
|
|
9
10
|
declare function createIdFilter(filter: StringFilter | undefined): PluginFilter | undefined;
|
|
10
11
|
declare function createCodeFilter(filter: StringFilter | undefined): PluginFilter | undefined;
|
|
11
12
|
declare function createFilterForId(filter: StringFilter | undefined): PluginFilter | undefined;
|
|
12
13
|
declare function createFilterForTransform(idFilter: StringFilter | undefined, codeFilter: StringFilter | undefined): TransformHookFilter | undefined;
|
|
13
14
|
//#endregion
|
|
14
|
-
export { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, patternToCodeFilter, patternToIdFilter };
|
|
15
|
+
export { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter };
|
|
15
16
|
//# sourceMappingURL=filter.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.mts","names":[],"sources":["../../src/plugin-utils/filter.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"filter.d.mts","names":[],"sources":["../../src/plugin-utils/filter.ts"],"mappings":";;;;iBA+CgB,iBAAA,CAAkB,OAAA,EAAS,cAAA,GAAiB,YAAA;AAAA,iBAoB5C,mBAAA,CAAoB,OAAA,EAAS,cAAA,GAAiB,YAAA;AAAA,iBAW9C,YAAA,CACd,OAAA,EAAS,YAAA,gBACT,OAAA,EAAS,YAAA,iBACR,YAAA;AAAA,iBAgBa,qBAAA,CACd,MAAA,WAAiB,MAAA,YACP,MAAA;AAAA,iBAQI,eAAA,CAAgB,MAAA,EAAQ,YAAA,GAAe,sBAAA;AAAA,iBAuBvC,cAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBASa,gBAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBASa,iBAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBAMa,wBAAA,CACd,QAAA,EAAU,YAAA,cACV,UAAA,EAAY,YAAA,eACX,mBAAA"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { removeVirtualPrefix } from "./virtual.mjs";
|
|
1
2
|
import { toArray } from "@stryke/convert/to-array";
|
|
2
3
|
import { isAbsolutePath } from "@stryke/path/is-type";
|
|
4
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
5
|
+
import { isRegExp } from "@stryke/type-checks/is-regexp";
|
|
3
6
|
import { resolve } from "node:path";
|
|
4
7
|
import picomatch from "picomatch";
|
|
5
8
|
|
|
6
9
|
//#region src/plugin-utils/filter.ts
|
|
7
10
|
const BACKSLASH_REGEX = /\\/g;
|
|
8
11
|
function normalize(path) {
|
|
9
|
-
return path.replace(BACKSLASH_REGEX, "/");
|
|
12
|
+
return removeVirtualPrefix(path).replace(BACKSLASH_REGEX, "/");
|
|
10
13
|
}
|
|
11
14
|
function getMatcherString(glob, cwd) {
|
|
12
15
|
if (glob.startsWith("**") || isAbsolutePath(glob)) return normalize(glob);
|
|
@@ -40,12 +43,16 @@ function createFilter(exclude, include) {
|
|
|
40
43
|
return !(include && include.length > 0);
|
|
41
44
|
};
|
|
42
45
|
}
|
|
46
|
+
function normalizeSingleFilter(filter) {
|
|
47
|
+
if (isSetString(filter)) return removeVirtualPrefix(filter);
|
|
48
|
+
return filter;
|
|
49
|
+
}
|
|
43
50
|
function normalizeFilter(filter) {
|
|
44
|
-
if (
|
|
45
|
-
if (Array.isArray(filter)) return { include: filter };
|
|
51
|
+
if (isSetString(filter) || isRegExp(filter)) return { include: [normalizeSingleFilter(filter)] };
|
|
52
|
+
if (Array.isArray(filter)) return { include: filter.map(normalizeSingleFilter) };
|
|
46
53
|
return {
|
|
47
|
-
exclude: filter.exclude ? toArray(filter.exclude) : void 0,
|
|
48
|
-
include: filter.include ? toArray(filter.include) : void 0
|
|
54
|
+
exclude: filter.exclude ? toArray(filter.exclude).map(normalizeSingleFilter) : void 0,
|
|
55
|
+
include: filter.include ? toArray(filter.include).map(normalizeSingleFilter) : void 0
|
|
49
56
|
};
|
|
50
57
|
}
|
|
51
58
|
function createIdFilter(filter) {
|
|
@@ -80,5 +87,5 @@ function createFilterForTransform(idFilter, codeFilter) {
|
|
|
80
87
|
}
|
|
81
88
|
|
|
82
89
|
//#endregion
|
|
83
|
-
export { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, patternToCodeFilter, patternToIdFilter };
|
|
90
|
+
export { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter };
|
|
84
91
|
//# sourceMappingURL=filter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.mjs","names":[],"sources":["../../src/plugin-utils/filter.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 { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { resolve } from \"node:path\";\nimport picomatch from \"picomatch\";\nimport type { StringFilter, StringOrRegExp } from \"unplugin\";\nimport {\n NormalizedStringFilter,\n PluginFilter,\n TransformHookFilter\n} from \"../types/hooks\";\n\nconst BACKSLASH_REGEX = /\\\\/g;\nfunction normalize(path: string): string {\n return path.replace(BACKSLASH_REGEX, \"/\");\n}\n\nfunction getMatcherString(glob: string, cwd: string) {\n if (glob.startsWith(\"**\") || isAbsolutePath(glob)) {\n return normalize(glob);\n }\n\n const resolved = resolve(cwd, glob);\n\n return normalize(resolved);\n}\n\nexport function patternToIdFilter(pattern: StringOrRegExp): PluginFilter {\n if (pattern instanceof RegExp) {\n return (id: string) => {\n const normalizedId = normalize(id);\n const result = pattern.test(normalizedId);\n pattern.lastIndex = 0;\n return result;\n };\n }\n const cwd = process.cwd();\n const glob = getMatcherString(pattern, cwd);\n const matcher = picomatch(glob, { dot: true });\n\n return (id: string) => {\n const normalizedId = normalize(id);\n\n return matcher(normalizedId);\n };\n}\n\nexport function patternToCodeFilter(pattern: StringOrRegExp): PluginFilter {\n if (pattern instanceof RegExp) {\n return (code: string) => {\n const result = pattern.test(code);\n pattern.lastIndex = 0;\n return result;\n };\n }\n return (code: string) => code.includes(pattern);\n}\n\nexport function createFilter(\n exclude: PluginFilter[] | undefined,\n include: PluginFilter[] | undefined\n): PluginFilter | undefined {\n if (!exclude && !include) {\n return;\n }\n\n return input => {\n if (exclude?.some(filter => filter(input))) {\n return false;\n }\n if (include?.some(filter => filter(input))) {\n return true;\n }\n return !(include && include.length > 0);\n };\n}\n\nexport function
|
|
1
|
+
{"version":3,"file":"filter.mjs","names":[],"sources":["../../src/plugin-utils/filter.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 { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { resolve } from \"node:path\";\nimport picomatch from \"picomatch\";\nimport type { StringFilter, StringOrRegExp } from \"unplugin\";\nimport {\n NormalizedStringFilter,\n PluginFilter,\n TransformHookFilter\n} from \"../types/hooks\";\nimport { removeVirtualPrefix } from \"./virtual\";\n\nconst BACKSLASH_REGEX = /\\\\/g;\nfunction normalize(path: string): string {\n return removeVirtualPrefix(path).replace(BACKSLASH_REGEX, \"/\");\n}\n\nfunction getMatcherString(glob: string, cwd: string) {\n if (glob.startsWith(\"**\") || isAbsolutePath(glob)) {\n return normalize(glob);\n }\n\n const resolved = resolve(cwd, glob);\n\n return normalize(resolved);\n}\n\nexport function patternToIdFilter(pattern: StringOrRegExp): PluginFilter {\n if (pattern instanceof RegExp) {\n return (id: string) => {\n const normalizedId = normalize(id);\n const result = pattern.test(normalizedId);\n pattern.lastIndex = 0;\n return result;\n };\n }\n const cwd = process.cwd();\n const glob = getMatcherString(pattern, cwd);\n const matcher = picomatch(glob, { dot: true });\n\n return (id: string) => {\n const normalizedId = normalize(id);\n\n return matcher(normalizedId);\n };\n}\n\nexport function patternToCodeFilter(pattern: StringOrRegExp): PluginFilter {\n if (pattern instanceof RegExp) {\n return (code: string) => {\n const result = pattern.test(code);\n pattern.lastIndex = 0;\n return result;\n };\n }\n return (code: string) => code.includes(pattern);\n}\n\nexport function createFilter(\n exclude: PluginFilter[] | undefined,\n include: PluginFilter[] | undefined\n): PluginFilter | undefined {\n if (!exclude && !include) {\n return;\n }\n\n return input => {\n if (exclude?.some(filter => filter(input))) {\n return false;\n }\n if (include?.some(filter => filter(input))) {\n return true;\n }\n return !(include && include.length > 0);\n };\n}\n\nexport function normalizeSingleFilter(\n filter: string | RegExp\n): string | RegExp {\n if (isSetString(filter)) {\n return removeVirtualPrefix(filter);\n }\n\n return filter;\n}\n\nexport function normalizeFilter(filter: StringFilter): NormalizedStringFilter {\n if (isSetString(filter) || isRegExp(filter)) {\n return {\n include: [normalizeSingleFilter(filter)]\n };\n }\n\n if (Array.isArray(filter)) {\n return {\n include: filter.map(normalizeSingleFilter)\n };\n }\n\n return {\n exclude: filter.exclude\n ? toArray(filter.exclude).map(normalizeSingleFilter)\n : undefined,\n include: filter.include\n ? toArray(filter.include).map(normalizeSingleFilter)\n : undefined\n };\n}\n\nexport function createIdFilter(\n filter: StringFilter | undefined\n): PluginFilter | undefined {\n if (!filter) return;\n const { exclude, include } = normalizeFilter(filter);\n const excludeFilter = exclude?.map(patternToIdFilter);\n const includeFilter = include?.map(patternToIdFilter);\n\n return createFilter(excludeFilter, includeFilter);\n}\n\nexport function createCodeFilter(\n filter: StringFilter | undefined\n): PluginFilter | undefined {\n if (!filter) return;\n const { exclude, include } = normalizeFilter(filter);\n const excludeFilter = exclude?.map(patternToCodeFilter);\n const includeFilter = include?.map(patternToCodeFilter);\n\n return createFilter(excludeFilter, includeFilter);\n}\n\nexport function createFilterForId(\n filter: StringFilter | undefined\n): PluginFilter | undefined {\n const filterFunction = createIdFilter(filter);\n\n return filterFunction ? id => !!filterFunction(id) : undefined;\n}\n\nexport function createFilterForTransform(\n idFilter: StringFilter | undefined,\n codeFilter: StringFilter | undefined\n): TransformHookFilter | undefined {\n if (!idFilter && !codeFilter) return;\n const idFilterFunction = createIdFilter(idFilter);\n const codeFilterFunction = createCodeFilter(codeFilter);\n\n return (id, code) => {\n let fallback = true;\n if (idFilterFunction) {\n fallback &&= idFilterFunction(id);\n }\n if (!fallback) {\n return false;\n }\n\n if (codeFilterFunction) {\n fallback &&= codeFilterFunction(code);\n }\n return fallback;\n };\n}\n"],"mappings":";;;;;;;;;AAgCA,MAAM,kBAAkB;AACxB,SAAS,UAAU,MAAsB;AACvC,QAAO,oBAAoB,KAAK,CAAC,QAAQ,iBAAiB,IAAI;;AAGhE,SAAS,iBAAiB,MAAc,KAAa;AACnD,KAAI,KAAK,WAAW,KAAK,IAAI,eAAe,KAAK,CAC/C,QAAO,UAAU,KAAK;AAKxB,QAAO,UAFU,QAAQ,KAAK,KAEL,CAAC;;AAG5B,SAAgB,kBAAkB,SAAuC;AACvE,KAAI,mBAAmB,OACrB,SAAQ,OAAe;EACrB,MAAM,eAAe,UAAU,GAAG;EAClC,MAAM,SAAS,QAAQ,KAAK,aAAa;AACzC,UAAQ,YAAY;AACpB,SAAO;;CAKX,MAAM,UAAU,UADH,iBAAiB,SADlB,QAAQ,KACsB,CACZ,EAAE,EAAE,KAAK,MAAM,CAAC;AAE9C,SAAQ,OAAe;AAGrB,SAAO,QAFc,UAAU,GAEJ,CAAC;;;AAIhC,SAAgB,oBAAoB,SAAuC;AACzE,KAAI,mBAAmB,OACrB,SAAQ,SAAiB;EACvB,MAAM,SAAS,QAAQ,KAAK,KAAK;AACjC,UAAQ,YAAY;AACpB,SAAO;;AAGX,SAAQ,SAAiB,KAAK,SAAS,QAAQ;;AAGjD,SAAgB,aACd,SACA,SAC0B;AAC1B,KAAI,CAAC,WAAW,CAAC,QACf;AAGF,SAAO,UAAS;AACd,MAAI,SAAS,MAAK,WAAU,OAAO,MAAM,CAAC,CACxC,QAAO;AAET,MAAI,SAAS,MAAK,WAAU,OAAO,MAAM,CAAC,CACxC,QAAO;AAET,SAAO,EAAE,WAAW,QAAQ,SAAS;;;AAIzC,SAAgB,sBACd,QACiB;AACjB,KAAI,YAAY,OAAO,CACrB,QAAO,oBAAoB,OAAO;AAGpC,QAAO;;AAGT,SAAgB,gBAAgB,QAA8C;AAC5E,KAAI,YAAY,OAAO,IAAI,SAAS,OAAO,CACzC,QAAO,EACL,SAAS,CAAC,sBAAsB,OAAO,CAAC,EACzC;AAGH,KAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,EACL,SAAS,OAAO,IAAI,sBAAsB,EAC3C;AAGH,QAAO;EACL,SAAS,OAAO,UACZ,QAAQ,OAAO,QAAQ,CAAC,IAAI,sBAAsB,GAClD;EACJ,SAAS,OAAO,UACZ,QAAQ,OAAO,QAAQ,CAAC,IAAI,sBAAsB,GAClD;EACL;;AAGH,SAAgB,eACd,QAC0B;AAC1B,KAAI,CAAC,OAAQ;CACb,MAAM,EAAE,SAAS,YAAY,gBAAgB,OAAO;CACpD,MAAM,gBAAgB,SAAS,IAAI,kBAAkB;CACrD,MAAM,gBAAgB,SAAS,IAAI,kBAAkB;AAErD,QAAO,aAAa,eAAe,cAAc;;AAGnD,SAAgB,iBACd,QAC0B;AAC1B,KAAI,CAAC,OAAQ;CACb,MAAM,EAAE,SAAS,YAAY,gBAAgB,OAAO;CACpD,MAAM,gBAAgB,SAAS,IAAI,oBAAoB;CACvD,MAAM,gBAAgB,SAAS,IAAI,oBAAoB;AAEvD,QAAO,aAAa,eAAe,cAAc;;AAGnD,SAAgB,kBACd,QAC0B;CAC1B,MAAM,iBAAiB,eAAe,OAAO;AAE7C,QAAO,kBAAiB,OAAM,CAAC,CAAC,eAAe,GAAG,GAAG;;AAGvD,SAAgB,yBACd,UACA,YACiC;AACjC,KAAI,CAAC,YAAY,CAAC,WAAY;CAC9B,MAAM,mBAAmB,eAAe,SAAS;CACjD,MAAM,qBAAqB,iBAAiB,WAAW;AAEvD,SAAQ,IAAI,SAAS;EACnB,IAAI,WAAW;AACf,MAAI,iBACF,cAAa,iBAAiB,GAAG;AAEnC,MAAI,CAAC,SACH,QAAO;AAGT,MAAI,mBACF,cAAa,mBAAmB,KAAK;AAEvC,SAAO"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_plugin_utils_paths = require('./paths.cjs');
|
|
3
|
-
const require_plugin_utils_format_package_json = require('./format-package-json.cjs');
|
|
4
3
|
const require_plugin_utils_build_helpers = require('./build-helpers.cjs');
|
|
5
4
|
const require_plugin_utils_helpers = require('./helpers.cjs');
|
|
6
5
|
const require_plugin_utils_merge = require('./merge.cjs');
|
|
@@ -8,13 +7,18 @@ const require_plugin_utils_combine_plugins = require('./combine-plugins.cjs');
|
|
|
8
7
|
const require_plugin_utils_context_helpers = require('./context-helpers.cjs');
|
|
9
8
|
const require_plugin_utils_docs_helper = require('./docs-helper.cjs');
|
|
10
9
|
const require_plugin_utils_extend = require('./extend.cjs');
|
|
10
|
+
const require_plugin_utils_virtual = require('./virtual.cjs');
|
|
11
11
|
const require_plugin_utils_filter = require('./filter.cjs');
|
|
12
12
|
const require_plugin_utils_format = require('./format.cjs');
|
|
13
|
+
const require_plugin_utils_format_package_json = require('./format-package-json.cjs');
|
|
13
14
|
const require_plugin_utils_get_config_path = require('./get-config-path.cjs');
|
|
14
15
|
const require_plugin_utils_logging = require('./logging.cjs');
|
|
15
16
|
const require_plugin_utils_modules = require('./modules.cjs');
|
|
16
17
|
|
|
18
|
+
exports.VIRTUAL_MODULE_PREFIX = require_plugin_utils_virtual.VIRTUAL_MODULE_PREFIX;
|
|
19
|
+
exports.VIRTUAL_MODULE_PREFIX_REGEX = require_plugin_utils_virtual.VIRTUAL_MODULE_PREFIX_REGEX;
|
|
17
20
|
exports.addPluginHook = require_plugin_utils_helpers.addPluginHook;
|
|
21
|
+
exports.addVirtualPrefix = require_plugin_utils_virtual.addVirtualPrefix;
|
|
18
22
|
exports.colorBackground = require_plugin_utils_logging.colorBackground;
|
|
19
23
|
exports.colorText = require_plugin_utils_logging.colorText;
|
|
20
24
|
exports.combinePluginOptions = require_plugin_utils_combine_plugins.combinePluginOptions;
|
|
@@ -28,6 +32,7 @@ exports.createFilterForTransform = require_plugin_utils_filter.createFilterForTr
|
|
|
28
32
|
exports.createIdFilter = require_plugin_utils_filter.createIdFilter;
|
|
29
33
|
exports.createLogFn = require_plugin_utils_logging.createLogFn;
|
|
30
34
|
exports.createLogger = require_plugin_utils_logging.createLogger;
|
|
35
|
+
exports.createVirtualPrefixRegex = require_plugin_utils_virtual.createVirtualPrefixRegex;
|
|
31
36
|
exports.dedupeHooklist = require_plugin_utils_helpers.dedupeHooklist;
|
|
32
37
|
exports.extend = require_plugin_utils_extend.extend;
|
|
33
38
|
exports.extendLogFn = require_plugin_utils_logging.extendLogFn;
|
|
@@ -59,11 +64,14 @@ exports.isUnpluginHookKey = require_plugin_utils_helpers.isUnpluginHookKey;
|
|
|
59
64
|
exports.isValidLogLevel = require_plugin_utils_logging.isValidLogLevel;
|
|
60
65
|
exports.isValidLogLevelConfig = require_plugin_utils_logging.isValidLogLevelConfig;
|
|
61
66
|
exports.isVerbose = require_plugin_utils_logging.isVerbose;
|
|
67
|
+
exports.isVirtualModule = require_plugin_utils_virtual.isVirtualModule;
|
|
62
68
|
exports.merge = require_plugin_utils_merge.merge;
|
|
63
69
|
exports.mergeConfig = require_plugin_utils_merge.mergeConfig;
|
|
64
70
|
exports.normalizeFilter = require_plugin_utils_filter.normalizeFilter;
|
|
71
|
+
exports.normalizeSingleFilter = require_plugin_utils_filter.normalizeSingleFilter;
|
|
65
72
|
exports.patternToCodeFilter = require_plugin_utils_filter.patternToCodeFilter;
|
|
66
73
|
exports.patternToIdFilter = require_plugin_utils_filter.patternToIdFilter;
|
|
74
|
+
exports.removeVirtualPrefix = require_plugin_utils_virtual.removeVirtualPrefix;
|
|
67
75
|
exports.replacePathTokens = require_plugin_utils_paths.replacePathTokens;
|
|
68
76
|
exports.resolveLogLevel = require_plugin_utils_logging.resolveLogLevel;
|
|
69
77
|
exports.withCustomLogger = require_plugin_utils_logging.withCustomLogger;
|
|
@@ -3,7 +3,7 @@ import { CombinePluginsOptions, __ΩCombinePluginsOptions, combinePluginOptions,
|
|
|
3
3
|
import { getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.cjs";
|
|
4
4
|
import { getDocsOutputPath } from "./docs-helper.cjs";
|
|
5
5
|
import { extend } from "./extend.cjs";
|
|
6
|
-
import { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, patternToCodeFilter, patternToIdFilter } from "./filter.cjs";
|
|
6
|
+
import { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter } from "./filter.cjs";
|
|
7
7
|
import { formatPackageJson } from "./format-package-json.cjs";
|
|
8
8
|
import { formatConfig } from "./format.cjs";
|
|
9
9
|
import { getConfigPath } from "./get-config-path.cjs";
|
|
@@ -12,4 +12,5 @@ import { colorBackground, colorText, consoleLog, consoleLogger, createLogFn, cre
|
|
|
12
12
|
import { MergeResult, __ΩMergeResult, merge, mergeConfig } from "./merge.cjs";
|
|
13
13
|
import { isBuiltinModule } from "./modules.cjs";
|
|
14
14
|
import { replacePathTokens } from "./paths.cjs";
|
|
15
|
-
|
|
15
|
+
import { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, createVirtualPrefixRegex, isVirtualModule, removeVirtualPrefix } from "./virtual.cjs";
|
|
16
|
+
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, addVirtualPrefix, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, createVirtualPrefixRegex, dedupeHooklist, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, isVirtualModule, merge, mergeConfig, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter, removeVirtualPrefix, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
@@ -3,7 +3,7 @@ import { CombinePluginsOptions, __ΩCombinePluginsOptions, combinePluginOptions,
|
|
|
3
3
|
import { getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.mjs";
|
|
4
4
|
import { getDocsOutputPath } from "./docs-helper.mjs";
|
|
5
5
|
import { extend } from "./extend.mjs";
|
|
6
|
-
import { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, patternToCodeFilter, patternToIdFilter } from "./filter.mjs";
|
|
6
|
+
import { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter } from "./filter.mjs";
|
|
7
7
|
import { formatPackageJson } from "./format-package-json.mjs";
|
|
8
8
|
import { formatConfig } from "./format.mjs";
|
|
9
9
|
import { getConfigPath } from "./get-config-path.mjs";
|
|
@@ -12,4 +12,5 @@ import { colorBackground, colorText, consoleLog, consoleLogger, createLogFn, cre
|
|
|
12
12
|
import { MergeResult, __ΩMergeResult, merge, mergeConfig } from "./merge.mjs";
|
|
13
13
|
import { isBuiltinModule } from "./modules.mjs";
|
|
14
14
|
import { replacePathTokens } from "./paths.mjs";
|
|
15
|
-
|
|
15
|
+
import { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, createVirtualPrefixRegex, isVirtualModule, removeVirtualPrefix } from "./virtual.mjs";
|
|
16
|
+
export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, addVirtualPrefix, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, createVirtualPrefixRegex, dedupeHooklist, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, isVirtualModule, merge, mergeConfig, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter, removeVirtualPrefix, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { replacePathTokens } from "./paths.mjs";
|
|
2
|
-
import { formatPackageJson } from "./format-package-json.mjs";
|
|
3
2
|
import { getDependencyConfig } from "./build-helpers.mjs";
|
|
4
3
|
import { addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
|
|
5
4
|
import { merge, mergeConfig } from "./merge.mjs";
|
|
@@ -7,10 +6,12 @@ import { combinePluginOptions, combinePlugins } from "./combine-plugins.mjs";
|
|
|
7
6
|
import { getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.mjs";
|
|
8
7
|
import { getDocsOutputPath } from "./docs-helper.mjs";
|
|
9
8
|
import { extend } from "./extend.mjs";
|
|
10
|
-
import {
|
|
9
|
+
import { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, createVirtualPrefixRegex, isVirtualModule, removeVirtualPrefix } from "./virtual.mjs";
|
|
10
|
+
import { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter } from "./filter.mjs";
|
|
11
11
|
import { formatConfig } from "./format.mjs";
|
|
12
|
+
import { formatPackageJson } from "./format-package-json.mjs";
|
|
12
13
|
import { getConfigPath } from "./get-config-path.mjs";
|
|
13
14
|
import { colorBackground, colorText, consoleLog, consoleLogger, createLogFn, createLogger, extendLogFn, extendLogger, getTextColor, isValidLogLevel, isValidLogLevelConfig, isVerbose, resolveLogLevel, withCustomLogger, withLogFn, withLogger } from "./logging.mjs";
|
|
14
15
|
import { isBuiltinModule } from "./modules.mjs";
|
|
15
16
|
|
|
16
|
-
export { addPluginHook, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, dedupeHooklist, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, merge, mergeConfig, normalizeFilter, patternToCodeFilter, patternToIdFilter, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
17
|
+
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, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, isVirtualModule, merge, mergeConfig, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter, removeVirtualPrefix, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
|
|
@@ -7,9 +7,9 @@ let defu = require("defu");
|
|
|
7
7
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
8
8
|
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
9
9
|
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
10
|
-
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
11
10
|
let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
|
|
12
11
|
let _storm_software_config_tools_utilities_colors = require("@storm-software/config-tools/utilities/colors");
|
|
12
|
+
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
13
13
|
let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
|
|
14
14
|
let chalk = require("chalk");
|
|
15
15
|
chalk = require_runtime.__toESM(chalk, 1);
|
|
@@ -5,9 +5,9 @@ import { defu as defu$1 } from "defu";
|
|
|
5
5
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
6
6
|
import { isString } from "@stryke/type-checks/is-string";
|
|
7
7
|
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
8
|
-
import { titleCase } from "@stryke/string-format/title-case";
|
|
9
8
|
import { getLogFn, getLogLevel } from "@storm-software/config-tools/logger";
|
|
10
9
|
import { getColor } from "@storm-software/config-tools/utilities/colors";
|
|
10
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
11
11
|
import { uuid } from "@stryke/unique-id/uuid";
|
|
12
12
|
import chalk from "chalk";
|
|
13
13
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _rolldown_pluginutils = require("@rolldown/pluginutils");
|
|
4
|
+
|
|
5
|
+
//#region src/plugin-utils/virtual.ts
|
|
6
|
+
const VIRTUAL_MODULE_PREFIX = "\0";
|
|
7
|
+
const VIRTUAL_MODULE_PREFIX_REGEX = (0, _rolldown_pluginutils.prefixRegex)("\0");
|
|
8
|
+
/**
|
|
9
|
+
* Adds the virtual module prefix to the given ID.
|
|
10
|
+
*
|
|
11
|
+
* @param id - The ID to add the virtual module prefix to.
|
|
12
|
+
* @returns The ID with the virtual module prefix added.
|
|
13
|
+
*/
|
|
14
|
+
function addVirtualPrefix(id) {
|
|
15
|
+
return `${"\0"}${id}`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Removes the virtual module prefix from the given ID, if it exists.
|
|
19
|
+
*
|
|
20
|
+
* @param id - The ID to remove the virtual module prefix from.
|
|
21
|
+
* @returns The ID without the virtual module prefix.
|
|
22
|
+
*/
|
|
23
|
+
function removeVirtualPrefix(id) {
|
|
24
|
+
return id.replace(VIRTUAL_MODULE_PREFIX_REGEX, "");
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the given ID is a virtual module by checking if it starts with the virtual module prefix.
|
|
28
|
+
*
|
|
29
|
+
* @param id - The ID to check.
|
|
30
|
+
* @returns True if the ID is a virtual module, false otherwise.
|
|
31
|
+
*/
|
|
32
|
+
function isVirtualModule(id) {
|
|
33
|
+
return id.startsWith("\0");
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Creates a regular expression that matches the given ID with the virtual module prefix.
|
|
37
|
+
*
|
|
38
|
+
* @param id - The ID to create a regular expression for.
|
|
39
|
+
* @returns A regular expression that matches the given ID with the virtual module prefix.
|
|
40
|
+
*/
|
|
41
|
+
function createVirtualPrefixRegex(id) {
|
|
42
|
+
return (0, _rolldown_pluginutils.prefixRegex)(addVirtualPrefix(removeVirtualPrefix(id)));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
exports.VIRTUAL_MODULE_PREFIX = VIRTUAL_MODULE_PREFIX;
|
|
47
|
+
exports.VIRTUAL_MODULE_PREFIX_REGEX = VIRTUAL_MODULE_PREFIX_REGEX;
|
|
48
|
+
exports.addVirtualPrefix = addVirtualPrefix;
|
|
49
|
+
exports.createVirtualPrefixRegex = createVirtualPrefixRegex;
|
|
50
|
+
exports.isVirtualModule = isVirtualModule;
|
|
51
|
+
exports.removeVirtualPrefix = removeVirtualPrefix;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/plugin-utils/virtual.d.ts
|
|
2
|
+
declare const VIRTUAL_MODULE_PREFIX = "\0";
|
|
3
|
+
declare const VIRTUAL_MODULE_PREFIX_REGEX: RegExp;
|
|
4
|
+
/**
|
|
5
|
+
* Adds the virtual module prefix to the given ID.
|
|
6
|
+
*
|
|
7
|
+
* @param id - The ID to add the virtual module prefix to.
|
|
8
|
+
* @returns The ID with the virtual module prefix added.
|
|
9
|
+
*/
|
|
10
|
+
declare function addVirtualPrefix(id: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Removes the virtual module prefix from the given ID, if it exists.
|
|
13
|
+
*
|
|
14
|
+
* @param id - The ID to remove the virtual module prefix from.
|
|
15
|
+
* @returns The ID without the virtual module prefix.
|
|
16
|
+
*/
|
|
17
|
+
declare function removeVirtualPrefix(id: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if the given ID is a virtual module by checking if it starts with the virtual module prefix.
|
|
20
|
+
*
|
|
21
|
+
* @param id - The ID to check.
|
|
22
|
+
* @returns True if the ID is a virtual module, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
declare function isVirtualModule(id: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a regular expression that matches the given ID with the virtual module prefix.
|
|
27
|
+
*
|
|
28
|
+
* @param id - The ID to create a regular expression for.
|
|
29
|
+
* @returns A regular expression that matches the given ID with the virtual module prefix.
|
|
30
|
+
*/
|
|
31
|
+
declare function createVirtualPrefixRegex(id: string): RegExp;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, createVirtualPrefixRegex, isVirtualModule, removeVirtualPrefix };
|
|
34
|
+
//# sourceMappingURL=virtual.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual.d.cts","names":[],"sources":["../../src/plugin-utils/virtual.ts"],"mappings":";cAoBa,qBAAA;AAAA,cACA,2BAAA,EAA2B,MAAA;;;;;AAAxC;;iBAQgB,gBAAA,CAAiB,EAAA;;;AAAjC;;;;iBAUgB,mBAAA,CAAoB,EAAA;AAApC;;;;;AAUA;AAVA,iBAUgB,eAAA,CAAgB,EAAA;;;;AAUhC;;;iBAAgB,wBAAA,CAAyB,EAAA,WAAa,MAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/plugin-utils/virtual.d.ts
|
|
2
|
+
declare const VIRTUAL_MODULE_PREFIX = "\0";
|
|
3
|
+
declare const VIRTUAL_MODULE_PREFIX_REGEX: RegExp;
|
|
4
|
+
/**
|
|
5
|
+
* Adds the virtual module prefix to the given ID.
|
|
6
|
+
*
|
|
7
|
+
* @param id - The ID to add the virtual module prefix to.
|
|
8
|
+
* @returns The ID with the virtual module prefix added.
|
|
9
|
+
*/
|
|
10
|
+
declare function addVirtualPrefix(id: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Removes the virtual module prefix from the given ID, if it exists.
|
|
13
|
+
*
|
|
14
|
+
* @param id - The ID to remove the virtual module prefix from.
|
|
15
|
+
* @returns The ID without the virtual module prefix.
|
|
16
|
+
*/
|
|
17
|
+
declare function removeVirtualPrefix(id: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if the given ID is a virtual module by checking if it starts with the virtual module prefix.
|
|
20
|
+
*
|
|
21
|
+
* @param id - The ID to check.
|
|
22
|
+
* @returns True if the ID is a virtual module, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
declare function isVirtualModule(id: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a regular expression that matches the given ID with the virtual module prefix.
|
|
27
|
+
*
|
|
28
|
+
* @param id - The ID to create a regular expression for.
|
|
29
|
+
* @returns A regular expression that matches the given ID with the virtual module prefix.
|
|
30
|
+
*/
|
|
31
|
+
declare function createVirtualPrefixRegex(id: string): RegExp;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, createVirtualPrefixRegex, isVirtualModule, removeVirtualPrefix };
|
|
34
|
+
//# sourceMappingURL=virtual.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual.d.mts","names":[],"sources":["../../src/plugin-utils/virtual.ts"],"mappings":";cAoBa,qBAAA;AAAA,cACA,2BAAA,EAA2B,MAAA;;;;;AAAxC;;iBAQgB,gBAAA,CAAiB,EAAA;;;AAAjC;;;;iBAUgB,mBAAA,CAAoB,EAAA;AAApC;;;;;AAUA;AAVA,iBAUgB,eAAA,CAAgB,EAAA;;;;AAUhC;;;iBAAgB,wBAAA,CAAyB,EAAA,WAAa,MAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { prefixRegex } from "@rolldown/pluginutils";
|
|
2
|
+
|
|
3
|
+
//#region src/plugin-utils/virtual.ts
|
|
4
|
+
const VIRTUAL_MODULE_PREFIX = "\0";
|
|
5
|
+
const VIRTUAL_MODULE_PREFIX_REGEX = prefixRegex("\0");
|
|
6
|
+
/**
|
|
7
|
+
* Adds the virtual module prefix to the given ID.
|
|
8
|
+
*
|
|
9
|
+
* @param id - The ID to add the virtual module prefix to.
|
|
10
|
+
* @returns The ID with the virtual module prefix added.
|
|
11
|
+
*/
|
|
12
|
+
function addVirtualPrefix(id) {
|
|
13
|
+
return `${"\0"}${id}`;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Removes the virtual module prefix from the given ID, if it exists.
|
|
17
|
+
*
|
|
18
|
+
* @param id - The ID to remove the virtual module prefix from.
|
|
19
|
+
* @returns The ID without the virtual module prefix.
|
|
20
|
+
*/
|
|
21
|
+
function removeVirtualPrefix(id) {
|
|
22
|
+
return id.replace(VIRTUAL_MODULE_PREFIX_REGEX, "");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Checks if the given ID is a virtual module by checking if it starts with the virtual module prefix.
|
|
26
|
+
*
|
|
27
|
+
* @param id - The ID to check.
|
|
28
|
+
* @returns True if the ID is a virtual module, false otherwise.
|
|
29
|
+
*/
|
|
30
|
+
function isVirtualModule(id) {
|
|
31
|
+
return id.startsWith("\0");
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a regular expression that matches the given ID with the virtual module prefix.
|
|
35
|
+
*
|
|
36
|
+
* @param id - The ID to create a regular expression for.
|
|
37
|
+
* @returns A regular expression that matches the given ID with the virtual module prefix.
|
|
38
|
+
*/
|
|
39
|
+
function createVirtualPrefixRegex(id) {
|
|
40
|
+
return prefixRegex(addVirtualPrefix(removeVirtualPrefix(id)));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX, addVirtualPrefix, createVirtualPrefixRegex, isVirtualModule, removeVirtualPrefix };
|
|
45
|
+
//# sourceMappingURL=virtual.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual.mjs","names":[],"sources":["../../src/plugin-utils/virtual.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 { prefixRegex } from \"@rolldown/pluginutils\";\n\nexport const VIRTUAL_MODULE_PREFIX = \"\\0\";\nexport const VIRTUAL_MODULE_PREFIX_REGEX = prefixRegex(\"\\0\");\n\n/**\n * Adds the virtual module prefix to the given ID.\n *\n * @param id - The ID to add the virtual module prefix to.\n * @returns The ID with the virtual module prefix added.\n */\nexport function addVirtualPrefix(id: string): string {\n return `${VIRTUAL_MODULE_PREFIX}${id}`;\n}\n\n/**\n * Removes the virtual module prefix from the given ID, if it exists.\n *\n * @param id - The ID to remove the virtual module prefix from.\n * @returns The ID without the virtual module prefix.\n */\nexport function removeVirtualPrefix(id: string): string {\n return id.replace(VIRTUAL_MODULE_PREFIX_REGEX, \"\");\n}\n\n/**\n * Checks if the given ID is a virtual module by checking if it starts with the virtual module prefix.\n *\n * @param id - The ID to check.\n * @returns True if the ID is a virtual module, false otherwise.\n */\nexport function isVirtualModule(id: string): boolean {\n return id.startsWith(VIRTUAL_MODULE_PREFIX);\n}\n\n/**\n * Creates a regular expression that matches the given ID with the virtual module prefix.\n *\n * @param id - The ID to create a regular expression for.\n * @returns A regular expression that matches the given ID with the virtual module prefix.\n */\nexport function createVirtualPrefixRegex(id: string): RegExp {\n return prefixRegex(addVirtualPrefix(removeVirtualPrefix(id)));\n}\n"],"mappings":";;;AAoBA,MAAa,wBAAwB;AACrC,MAAa,8BAA8B,YAAY,KAAK;;;;;;;AAQ5D,SAAgB,iBAAiB,IAAoB;AACnD,QAAO,UAA2B;;;;;;;;AASpC,SAAgB,oBAAoB,IAAoB;AACtD,QAAO,GAAG,QAAQ,6BAA6B,GAAG;;;;;;;;AASpD,SAAgB,gBAAgB,IAAqB;AACnD,QAAO,GAAG,gBAAiC;;;;;;;;AAS7C,SAAgB,yBAAyB,IAAoB;AAC3D,QAAO,YAAY,iBAAiB,oBAAoB,GAAG,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "An internal core package for Powerlines - please use the `powerlines` package for public usage.",
|
|
6
6
|
"homepage": "https://stormsoftware.com",
|
|
@@ -76,10 +76,6 @@
|
|
|
76
76
|
"import": "./dist/constants/plugin.mjs",
|
|
77
77
|
"require": "./dist/constants/plugin.cjs"
|
|
78
78
|
},
|
|
79
|
-
"./constants/virtual-modules": {
|
|
80
|
-
"import": "./dist/constants/virtual-modules.mjs",
|
|
81
|
-
"require": "./dist/constants/virtual-modules.cjs"
|
|
82
|
-
},
|
|
83
79
|
"./lib": {
|
|
84
80
|
"import": "./dist/lib/index.mjs",
|
|
85
81
|
"require": "./dist/lib/index.cjs"
|
|
@@ -196,6 +192,10 @@
|
|
|
196
192
|
"import": "./dist/plugin-utils/paths.mjs",
|
|
197
193
|
"require": "./dist/plugin-utils/paths.cjs"
|
|
198
194
|
},
|
|
195
|
+
"./plugin-utils/virtual": {
|
|
196
|
+
"import": "./dist/plugin-utils/virtual.mjs",
|
|
197
|
+
"require": "./dist/plugin-utils/virtual.cjs"
|
|
198
|
+
},
|
|
199
199
|
"./types/_internal": {
|
|
200
200
|
"import": "./dist/types/_internal.mjs",
|
|
201
201
|
"require": "./dist/types/_internal.cjs"
|
|
@@ -242,5 +242,5 @@
|
|
|
242
242
|
"typescript": "^6.0.3"
|
|
243
243
|
},
|
|
244
244
|
"publishConfig": { "access": "public" },
|
|
245
|
-
"gitHead": "
|
|
245
|
+
"gitHead": "3d2c2a8ebb3941045a9aaeb5218c96368847c371"
|
|
246
246
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _rolldown_pluginutils = require("@rolldown/pluginutils");
|
|
4
|
-
|
|
5
|
-
//#region src/constants/virtual-modules.ts
|
|
6
|
-
const VIRTUAL_MODULE_PREFIX = "\0";
|
|
7
|
-
const VIRTUAL_MODULE_PREFIX_REGEX = (0, _rolldown_pluginutils.prefixRegex)("\0");
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
exports.VIRTUAL_MODULE_PREFIX = VIRTUAL_MODULE_PREFIX;
|
|
11
|
-
exports.VIRTUAL_MODULE_PREFIX_REGEX = VIRTUAL_MODULE_PREFIX_REGEX;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
//#region src/constants/virtual-modules.d.ts
|
|
2
|
-
declare const VIRTUAL_MODULE_PREFIX = "\0";
|
|
3
|
-
declare const VIRTUAL_MODULE_PREFIX_REGEX: RegExp;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX };
|
|
6
|
-
//# sourceMappingURL=virtual-modules.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-modules.d.cts","names":[],"sources":["../../src/constants/virtual-modules.ts"],"mappings":";cAoBa,qBAAA;AAAA,cACA,2BAAA,EAA2B,MAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
//#region src/constants/virtual-modules.d.ts
|
|
2
|
-
declare const VIRTUAL_MODULE_PREFIX = "\0";
|
|
3
|
-
declare const VIRTUAL_MODULE_PREFIX_REGEX: RegExp;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX };
|
|
6
|
-
//# sourceMappingURL=virtual-modules.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-modules.d.mts","names":[],"sources":["../../src/constants/virtual-modules.ts"],"mappings":";cAoBa,qBAAA;AAAA,cACA,2BAAA,EAA2B,MAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { prefixRegex } from "@rolldown/pluginutils";
|
|
2
|
-
|
|
3
|
-
//#region src/constants/virtual-modules.ts
|
|
4
|
-
const VIRTUAL_MODULE_PREFIX = "\0";
|
|
5
|
-
const VIRTUAL_MODULE_PREFIX_REGEX = prefixRegex("\0");
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { VIRTUAL_MODULE_PREFIX, VIRTUAL_MODULE_PREFIX_REGEX };
|
|
9
|
-
//# sourceMappingURL=virtual-modules.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-modules.mjs","names":[],"sources":["../../src/constants/virtual-modules.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 { prefixRegex } from \"@rolldown/pluginutils\";\n\nexport const VIRTUAL_MODULE_PREFIX = \"\\0\";\nexport const VIRTUAL_MODULE_PREFIX_REGEX = prefixRegex(\"\\0\");\n"],"mappings":";;;AAoBA,MAAa,wBAAwB;AACrC,MAAa,8BAA8B,YAAY,KAAK"}
|