@visulima/packem 2.0.0-alpha.4 → 2.0.0-alpha.43

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.
Files changed (85) hide show
  1. package/CHANGELOG.md +480 -1
  2. package/LICENSE.md +6393 -1445
  3. package/README.md +16 -12
  4. package/dist/builder/typedoc/index.d.ts +3 -26
  5. package/dist/builder/typedoc/index.js +160 -3
  6. package/dist/cli/index.d.ts +1 -0
  7. package/dist/cli/index.js +1379 -43
  8. package/dist/config/index.d.ts +48 -28
  9. package/dist/config/index.js +4 -1
  10. package/dist/config/preset/react.d.ts +59 -0
  11. package/dist/config/preset/react.js +43 -0
  12. package/dist/config/preset/solid.d.ts +101 -0
  13. package/dist/config/preset/solid.js +72 -0
  14. package/dist/config/preset/svelte.d.ts +71 -0
  15. package/dist/config/preset/svelte.js +44 -0
  16. package/dist/config/preset/vue.d.ts +53 -0
  17. package/dist/config/preset/vue.js +33 -0
  18. package/dist/index.d.ts +45 -32
  19. package/dist/index.js +30 -1
  20. package/dist/packem/node10-compatibility.d.ts +7 -0
  21. package/dist/packem_shared/create-or-update-key-storage-Dd7b8-t1.js +36 -0
  22. package/dist/packem_shared/default-79SPobLI.js +12 -0
  23. package/dist/packem_shared/default-DWBYeUSC.js +210 -0
  24. package/dist/packem_shared/default-DaU6CQEi.js +28 -0
  25. package/dist/packem_shared/default-DavaZMwC.js +32 -0
  26. package/dist/packem_shared/default-DeYZ934H.js +32 -0
  27. package/dist/packem_shared/default-tUOOZ8w7.js +42 -0
  28. package/dist/packem_shared/default-wScAfTaq.js +27 -0
  29. package/dist/packem_shared/index-CTIRxV2x.js +63 -0
  30. package/dist/packem_shared/index-DzTDn4ad.js +9521 -0
  31. package/dist/rollup/plugins/css/loaders/less.d.ts +1 -1
  32. package/dist/rollup/plugins/css/loaders/less.js +1 -1
  33. package/dist/rollup/plugins/css/loaders/lightningcss.d.ts +1 -1
  34. package/dist/rollup/plugins/css/loaders/lightningcss.js +1 -1
  35. package/dist/rollup/plugins/css/loaders/postcss.d.ts +1 -1
  36. package/dist/rollup/plugins/css/loaders/postcss.js +1 -1
  37. package/dist/rollup/plugins/css/loaders/sass.d.ts +1 -1
  38. package/dist/rollup/plugins/css/loaders/sass.js +1 -1
  39. package/dist/rollup/plugins/css/loaders/sourcemap.d.ts +1 -8
  40. package/dist/rollup/plugins/css/loaders/sourcemap.js +1 -1
  41. package/dist/rollup/plugins/css/loaders/stylus.d.ts +1 -1
  42. package/dist/rollup/plugins/css/loaders/stylus.js +1 -1
  43. package/dist/rollup/plugins/css/loaders/tailwindcss.d.ts +1 -0
  44. package/dist/rollup/plugins/css/loaders/tailwindcss.js +1 -0
  45. package/dist/rollup/plugins/css/minifiers/cssnano.d.ts +1 -1
  46. package/dist/rollup/plugins/css/minifiers/cssnano.js +1 -1
  47. package/dist/rollup/plugins/css/minifiers/lightningcss.d.ts +1 -1
  48. package/dist/rollup/plugins/css/minifiers/lightningcss.js +1 -1
  49. package/dist/rollup/plugins/esbuild/index.d.ts +2 -24
  50. package/dist/rollup/plugins/esbuild/index.js +1 -1
  51. package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.ts +1 -25
  52. package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.js +1 -1
  53. package/dist/rollup/plugins/oxc/oxc-transformer.d.ts +2 -20
  54. package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
  55. package/dist/rollup/plugins/resolve-externals-plugin.d.ts +60 -0
  56. package/dist/rollup/plugins/sucrase/index.d.ts +2 -19
  57. package/dist/rollup/plugins/sucrase/index.js +1 -1
  58. package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts +1 -20
  59. package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.js +1 -1
  60. package/dist/rollup/plugins/swc/swc-plugin.d.ts +2 -26
  61. package/dist/rollup/plugins/swc/swc-plugin.js +1 -1
  62. package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts +1 -24
  63. package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.js +1 -1
  64. package/dist/types.d.ts +329 -0
  65. package/files.d.ts +37 -0
  66. package/package.json +190 -29
  67. package/dist/packem_shared/browserslistToEsbuild-C0IWmbNe-C6xPL1oW.js +0 -1
  68. package/dist/packem_shared/create-or-update-key-storage-GwAIWW7R.js +0 -3
  69. package/dist/packem_shared/default-B6X7-Lx3.js +0 -1
  70. package/dist/packem_shared/default-B_dUKZ_J.js +0 -1
  71. package/dist/packem_shared/default-C3sdXf4G.js +0 -1
  72. package/dist/packem_shared/default-DR5Fia_R.js +0 -1
  73. package/dist/packem_shared/default-DqRcOUe1.js +0 -1
  74. package/dist/packem_shared/esbuildPlugin-BAwyhG6L-yty60jMl.js +0 -3
  75. package/dist/packem_shared/index-CUp9WuCG.js +0 -1
  76. package/dist/packem_shared/index-DySckW0r.d.ts +0 -5227
  77. package/dist/packem_shared/index-VKZ7e6tb.js +0 -138
  78. package/dist/packem_shared/isolatedDeclarationsOxcTransformer-WbfE6cGu-NeZOx2Y7.js +0 -1
  79. package/dist/packem_shared/isolatedDeclarationsSwcTransformer-Ch2AgtWC-B-0lOgFf.js +0 -1
  80. package/dist/packem_shared/isolatedDeclarationsTypescriptTransformer-DkuEkofo-Cwe3ODMG.js +0 -3
  81. package/dist/packem_shared/oxcResolvePlugin-BJpi-eSG-BsYx9cDO.js +0 -1
  82. package/dist/packem_shared/oxcTransformPlugin-DfVQouIB-Cpfv95eA.js +0 -4
  83. package/dist/packem_shared/resolveTypescriptMjsCtsPlugin-DcZrZTmM-BEkYWTsH.js +0 -6
  84. package/dist/packem_shared/swcPlugin-Boip4lWG-CwJ-HVJc.js +0 -1
  85. package/dist/packem_shared/types-CaBbG-vU.d.ts +0 -163
@@ -0,0 +1,7 @@
1
+ import type { BuildContext } from "@visulima/packem-share/types";
2
+ import type { InternalBuildOptions } from "../types.d.ts";
3
+ export type Node10CompatibilityOptions = {
4
+ typeScriptVersion?: string;
5
+ writeToPackageJson?: boolean;
6
+ };
7
+ export declare const node10Compatibility: (logger: BuildContext<InternalBuildOptions>["logger"], entries: BuildContext<InternalBuildOptions>["options"]["entries"], outDirectory: string, rootDirectory: string, mode: "console" | "file", typeScriptVersion: string) => Promise<void>;
@@ -0,0 +1,36 @@
1
+ import { writeJsonSync, isAccessibleSync, readJsonSync } from '@visulima/fs';
2
+ import { join } from '@visulima/path';
3
+
4
+ const replaceContentWithinMarker = (content, marker, replacement) => {
5
+ const regex = new RegExp(`(<!-- ${marker} -->)[\\s\\S]*?(<!-- /${marker} -->)`, "g");
6
+ if (!regex.test(content)) {
7
+ return void 0;
8
+ }
9
+ return content.replace(regex, `$1
10
+ ${replacement}
11
+ $2`);
12
+ };
13
+
14
+ const createOrUpdateKeyStorage = (hashKey, storePath, logger, shouldUpdate) => {
15
+ try {
16
+ let keyStore = {};
17
+ const keyStorePath = join(storePath, "keystore.json");
18
+ if (shouldUpdate && isAccessibleSync(keyStorePath)) {
19
+ keyStore = readJsonSync(keyStorePath);
20
+ }
21
+ if (keyStore[hashKey] === void 0) {
22
+ keyStore[hashKey] = (/* @__PURE__ */ new Date()).toISOString();
23
+ }
24
+ writeJsonSync(keyStorePath, keyStore, {
25
+ overwrite: true
26
+ });
27
+ } catch (error) {
28
+ logger.debug({
29
+ context: [error],
30
+ message: error.message,
31
+ prefix: "cache-key-store"
32
+ });
33
+ }
34
+ };
35
+
36
+ export { createOrUpdateKeyStorage as c, replaceContentWithinMarker as r };
@@ -0,0 +1,12 @@
1
+ import { isolatedDeclaration } from 'oxc-transform';
2
+
3
+ const isolatedDeclarationsOxcTransformer = (id, code, sourceMap, transformOptions) => {
4
+ const result = isolatedDeclaration(id, code, { ...transformOptions, sourcemap: sourceMap });
5
+ return {
6
+ errors: result.errors.map((error) => error.message),
7
+ map: result.map?.mappings,
8
+ sourceText: result.code
9
+ };
10
+ };
11
+
12
+ export { isolatedDeclarationsOxcTransformer as default };
@@ -0,0 +1,210 @@
1
+ import { createFilter } from '@rollup/pluginutils';
2
+ import { a as DEFAULT_LOADERS } from './index-CTIRxV2x.js';
3
+ import { extname, join } from '@visulima/path';
4
+ import { transform, formatMessages, build } from 'esbuild';
5
+ import { findCacheDirSync } from '@visulima/find-cache-dir';
6
+ import { readFileSync } from '@visulima/fs';
7
+ import * as rsModuleLexer from 'rs-module-lexer';
8
+
9
+ import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
10
+ const require = __cjs_mod__.createRequire(import.meta.url);
11
+ const warn = async (pluginContext, messages) => {
12
+ if (messages.length > 0) {
13
+ const warnings = await formatMessages(messages, {
14
+ color: true,
15
+ kind: "warning"
16
+ });
17
+ warnings.forEach((warning) => pluginContext.warn(warning));
18
+ }
19
+ };
20
+ const getEsbuildFormat = (rollupFormat) => {
21
+ if (rollupFormat === "es") {
22
+ return "esm";
23
+ }
24
+ if (rollupFormat === "cjs") {
25
+ return rollupFormat;
26
+ }
27
+ return void 0;
28
+ };
29
+ const getRenderChunk = ({ sourceMap = true, ...options }) => (
30
+ // eslint-disable-next-line func-names
31
+ (async function(code, _, rollupOptions) {
32
+ if (options.minify || options.minifyWhitespace || options.minifyIdentifiers || options.minifySyntax) {
33
+ const format = getEsbuildFormat(rollupOptions.format);
34
+ const result = await transform(code, {
35
+ format,
36
+ loader: "js",
37
+ sourcemap: sourceMap,
38
+ ...options
39
+ });
40
+ await warn(this, result.warnings);
41
+ if (result.code) {
42
+ return {
43
+ code: result.code,
44
+ map: result.map || void 0
45
+ };
46
+ }
47
+ }
48
+ return void 0;
49
+ })
50
+ );
51
+ const slash = (p) => p.replaceAll("\\", "/");
52
+ const { parseAsync } = rsModuleLexer;
53
+ const optimizeDeps = async (options) => {
54
+ const cacheDir = findCacheDirSync("@visulima/packem/optimize-deps", {
55
+ create: true,
56
+ cwd: options.cwd
57
+ });
58
+ if (!cacheDir) {
59
+ throw new Error('[packem:optimize-deps]: failed to find or create cache directory "node_modules/.cache/packem/optimize_deps".');
60
+ }
61
+ await build({
62
+ absWorkingDir: options.cwd,
63
+ bundle: true,
64
+ entryPoints: options.include,
65
+ format: "esm",
66
+ ignoreAnnotations: true,
67
+ metafile: true,
68
+ outdir: cacheDir,
69
+ sourcemap: options.sourceMap,
70
+ splitting: true,
71
+ ...options.esbuildOptions,
72
+ plugins: [
73
+ {
74
+ name: "optimize-deps",
75
+ async setup(build2) {
76
+ build2.onResolve({ filter: /.*/ }, async (arguments_) => {
77
+ if (options.exclude?.includes(arguments_.path)) {
78
+ return {
79
+ external: true
80
+ };
81
+ }
82
+ if (arguments_.pluginData?.__resolving_dep_path__) {
83
+ return void 0;
84
+ }
85
+ if (options.include.includes(arguments_.path)) {
86
+ const resolved = await build2.resolve(arguments_.path, {
87
+ kind: "import-statement",
88
+ pluginData: { __resolving_dep_path__: true },
89
+ resolveDir: arguments_.resolveDir
90
+ });
91
+ if (resolved.errors.length > 0 || resolved.warnings.length > 0) {
92
+ return resolved;
93
+ }
94
+ return {
95
+ namespace: "optimize-deps",
96
+ path: arguments_.path,
97
+ pluginData: {
98
+ absolute: resolved.path,
99
+ resolveDir: arguments_.resolveDir
100
+ }
101
+ };
102
+ }
103
+ return void 0;
104
+ });
105
+ build2.onLoad({ filter: /.*/, namespace: "optimize-deps" }, async (arguments_) => {
106
+ const { absolute, resolveDir } = arguments_.pluginData;
107
+ const sourceCode = readFileSync(absolute);
108
+ const { output } = await parseAsync({ input: [{ code: sourceCode, filename: absolute }] });
109
+ const exported = output[0]?.exports ?? [];
110
+ return {
111
+ contents: exported.length > 0 ? `export * from '${slash(absolute)}'` : `module.exports = require('${slash(absolute)}')`,
112
+ resolveDir
113
+ };
114
+ });
115
+ }
116
+ },
117
+ ...options.esbuildOptions?.plugins ?? []
118
+ ]
119
+ });
120
+ const optimized = /* @__PURE__ */ new Map();
121
+ for (const id of options.include) {
122
+ optimized.set(id, { file: join(cacheDir, `${id}.js`) });
123
+ }
124
+ return {
125
+ cacheDir,
126
+ optimized
127
+ };
128
+ };
129
+ const esbuildTransformer = ({ exclude, include, loaders: _loaders, logger, optimizeDeps: optimizeDeps$1, sourceMap, ...esbuildOptions }) => {
130
+ const loaders = DEFAULT_LOADERS;
131
+ if (_loaders !== void 0) {
132
+ for (let [key, value] of Object.entries(_loaders)) {
133
+ const newKey = key.startsWith(".") ? key : `.${key}`;
134
+ if (typeof value === "string") {
135
+ loaders[newKey] = value;
136
+ } else if (!value) {
137
+ delete loaders[newKey];
138
+ }
139
+ }
140
+ }
141
+ const extensions = Object.keys(loaders);
142
+ const INCLUDE_REGEXP = new RegExp(String.raw`\.(${extensions.map((extension) => extension.slice(1)).join("|")})$`);
143
+ const filter = createFilter(include ?? INCLUDE_REGEXP, exclude);
144
+ let optimizeDepsResult;
145
+ let cwd = process.cwd();
146
+ return {
147
+ async buildStart() {
148
+ if (!optimizeDeps$1 || optimizeDepsResult) {
149
+ return;
150
+ }
151
+ optimizeDepsResult = await optimizeDeps({
152
+ cwd,
153
+ sourceMap: sourceMap ?? false,
154
+ ...optimizeDeps$1
155
+ });
156
+ logger.debug("optimized %O", optimizeDepsResult.optimized);
157
+ },
158
+ name: "packem:esbuild",
159
+ options({ context }) {
160
+ if (context) {
161
+ cwd = context;
162
+ }
163
+ return void 0;
164
+ },
165
+ renderChunk: getRenderChunk({
166
+ ...esbuildOptions,
167
+ sourceMap
168
+ }),
169
+ async resolveId(id) {
170
+ if (optimizeDepsResult?.optimized.has(id)) {
171
+ const m = optimizeDepsResult.optimized.get(id);
172
+ if (m) {
173
+ logger.debug("resolved %s to %s", id, m.file);
174
+ return m.file;
175
+ }
176
+ }
177
+ return void 0;
178
+ },
179
+ async transform(code, id) {
180
+ if (!filter(id) || optimizeDepsResult?.optimized.has(id)) {
181
+ return void 0;
182
+ }
183
+ const extension = extname(id);
184
+ const loader = loaders[extension];
185
+ logger.debug("transforming %s with %s loader", id, loader);
186
+ if (!loader) {
187
+ return void 0;
188
+ }
189
+ const result = await transform(code, {
190
+ format: ["base64", "binary", "dataurl", "text", "json"].includes(loader) ? "esm" : void 0,
191
+ loader,
192
+ // @see https://github.com/evanw/esbuild/issues/1932#issuecomment-1013380565
193
+ sourcefile: id.replace(/\.[cm]ts/, ".ts"),
194
+ sourcemap: sourceMap,
195
+ ...esbuildOptions
196
+ });
197
+ await warn(this, result.warnings);
198
+ if (result.code) {
199
+ return {
200
+ code: result.code,
201
+ map: result.map || void 0
202
+ };
203
+ }
204
+ return void 0;
205
+ }
206
+ };
207
+ };
208
+ esbuildTransformer.NAME = "esbuild";
209
+
210
+ export { esbuildTransformer as default };
@@ -0,0 +1,28 @@
1
+ import { createFilter } from '@rollup/pluginutils';
2
+ import { transform } from '@swc/core';
3
+ import { E as EXCLUDE_REGEXP } from './index-CTIRxV2x.js';
4
+
5
+ const swcPlugin = ({ exclude, include, ...transformOptions }) => {
6
+ const filter = createFilter(include, exclude ?? EXCLUDE_REGEXP);
7
+ return {
8
+ name: "packem:swc",
9
+ async transform(sourcecode, id) {
10
+ if (!filter(id)) {
11
+ return void 0;
12
+ }
13
+ const { code, map } = await transform(sourcecode, {
14
+ ...transformOptions,
15
+ configFile: false,
16
+ filename: id,
17
+ swcrc: false
18
+ });
19
+ return {
20
+ code,
21
+ map
22
+ };
23
+ }
24
+ };
25
+ };
26
+ swcPlugin.NAME = "swc";
27
+
28
+ export { swcPlugin as default };
@@ -0,0 +1,32 @@
1
+ import { transform } from '@swc/core';
2
+
3
+ const isolatedDeclarationsSwcTransformer = async (id, code, sourceMap) => {
4
+ try {
5
+ const result = await transform(code, {
6
+ filename: id,
7
+ jsc: {
8
+ experimental: {
9
+ emitIsolatedDts: true
10
+ },
11
+ parser: {
12
+ syntax: "typescript",
13
+ tsx: false
14
+ }
15
+ },
16
+ sourceMaps: sourceMap
17
+ });
18
+ const output = JSON.parse(result.output);
19
+ return {
20
+ errors: [],
21
+ map: result.map ? JSON.parse(result.map).mappings : void 0,
22
+ sourceText: output.__swc_isolated_declarations__
23
+ };
24
+ } catch (error) {
25
+ return {
26
+ errors: [error.toString()],
27
+ sourceText: ""
28
+ };
29
+ }
30
+ };
31
+
32
+ export { isolatedDeclarationsSwcTransformer as default };
@@ -0,0 +1,32 @@
1
+ import { createFilter } from '@rollup/pluginutils';
2
+ import { E as EXCLUDE_REGEXP } from './index-CTIRxV2x.js';
3
+ import { transform } from 'oxc-transform';
4
+
5
+ const oxcTransformPlugin = ({ exclude, include, ...transformOptions }) => {
6
+ const filter = createFilter(include, exclude ?? EXCLUDE_REGEXP);
7
+ return {
8
+ name: "packem:oxc-transform",
9
+ async transform(sourcecode, id) {
10
+ if (!filter(id)) {
11
+ return void 0;
12
+ }
13
+ const { code, errors, map } = transform(id, sourcecode, {
14
+ ...transformOptions,
15
+ sourcemap: true
16
+ });
17
+ if (errors.length > 0) {
18
+ return this.error({
19
+ message: ["\ntransform errors:", ...errors].join("\n\n"),
20
+ pluginCode: "ERR_TRANSFORM"
21
+ });
22
+ }
23
+ return {
24
+ code,
25
+ map
26
+ };
27
+ }
28
+ };
29
+ };
30
+ oxcTransformPlugin.NAME = "oxc";
31
+
32
+ export { oxcTransformPlugin as default };
@@ -0,0 +1,42 @@
1
+ import { transpileDeclaration, formatDiagnostics, sys } from 'typescript';
2
+
3
+ const stripMapUrl = (code) => {
4
+ const lines = code.split("\n");
5
+ const lastLine = lines.at(-1);
6
+ if (lastLine?.startsWith("//# sourceMappingURL=")) {
7
+ return lines.slice(0, -1).join("\n");
8
+ }
9
+ return code;
10
+ };
11
+ const isolatedDeclarationsTypescriptTransformer = async (id, code, sourceMap, transformOptions) => {
12
+ const compilerOptions = {
13
+ declarationMap: sourceMap,
14
+ ...transformOptions?.compilerOptions
15
+ };
16
+ let { diagnostics, outputText, sourceMapText } = transpileDeclaration(code, {
17
+ fileName: id,
18
+ reportDiagnostics: true,
19
+ ...transformOptions,
20
+ compilerOptions
21
+ });
22
+ if (compilerOptions.declarationMap) {
23
+ outputText = stripMapUrl(outputText);
24
+ }
25
+ const errors = diagnostics?.length ? [
26
+ formatDiagnostics(diagnostics, {
27
+ getCanonicalFileName: (fileName) => sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(),
28
+ getCurrentDirectory: () => sys.getCurrentDirectory(),
29
+ getNewLine: () => sys.newLine
30
+ })
31
+ ] : [];
32
+ if (sourceMapText) {
33
+ sourceMapText = JSON.parse(sourceMapText).mappings;
34
+ }
35
+ return {
36
+ errors,
37
+ map: sourceMapText,
38
+ sourceText: outputText
39
+ };
40
+ };
41
+
42
+ export { isolatedDeclarationsTypescriptTransformer as default };
@@ -0,0 +1,27 @@
1
+ import { createFilter } from '@rollup/pluginutils';
2
+ import { E as EXCLUDE_REGEXP } from './index-CTIRxV2x.js';
3
+ import { transform } from 'sucrase';
4
+
5
+ const sucraseTransformPlugin = ({ exclude, include, ...transformOptions }) => {
6
+ const filter = createFilter(include, exclude ?? EXCLUDE_REGEXP);
7
+ return {
8
+ name: "packem:sucrase",
9
+ async transform(sourcecode, id) {
10
+ if (!filter(id)) {
11
+ return void 0;
12
+ }
13
+ const { code, sourceMap: map } = transform(sourcecode, {
14
+ ...transformOptions,
15
+ filePath: id,
16
+ sourceMapOptions: {
17
+ compiledFilename: id
18
+ }
19
+ });
20
+ return { code, map };
21
+ }
22
+ };
23
+ };
24
+ sucraseTransformPlugin.NAME = "sucrase";
25
+ const sucrasePlugin = sucraseTransformPlugin;
26
+
27
+ export { sucrasePlugin };
@@ -0,0 +1,63 @@
1
+ const VALID_EXPORT_EXTENSIONS = [
2
+ ".js",
3
+ ".mjs",
4
+ ".cjs",
5
+ // JavaScript modules
6
+ ".ts",
7
+ ".mts",
8
+ ".cts",
9
+ // TypeScript modules
10
+ ".d.ts",
11
+ ".d.mts",
12
+ ".d.cts",
13
+ // TypeScript declarations
14
+ ".jsx",
15
+ ".tsx",
16
+ // JSX/TSX files
17
+ ".json",
18
+ // JSON modules
19
+ ".node"
20
+ // Native Node.js modules (compiled C++ addons)
21
+ ];
22
+ const DEFAULT_EXTENSIONS = [
23
+ ...VALID_EXPORT_EXTENSIONS,
24
+ // Base extensions for all module types
25
+ ".ctsx",
26
+ ".mtsx"
27
+ // Additional JSX/TSX variants (not standard for exports but processable)
28
+ ];
29
+ const DEFAULT_LOADERS = {
30
+ ".aac": "file",
31
+ ".cjs": "js",
32
+ ".cts": "ts",
33
+ ".ctsx": "tsx",
34
+ ".eot": "file",
35
+ ".flac": "file",
36
+ ".js": "js",
37
+ ".jsx": "jsx",
38
+ ".mjs": "js",
39
+ ".mp3": "file",
40
+ ".mp4": "file",
41
+ ".mts": "ts",
42
+ ".mtsx": "tsx",
43
+ ".ogg": "file",
44
+ ".otf": "file",
45
+ ".ts": "ts",
46
+ ".tsx": "tsx",
47
+ ".ttf": "file",
48
+ ".wav": "file",
49
+ ".webm": "file",
50
+ ".woff": "file",
51
+ ".woff2": "file"
52
+ };
53
+ const PRODUCTION_ENV = "production";
54
+ const DEVELOPMENT_ENV = "development";
55
+ const RUNTIME_EXPORT_CONVENTIONS = /* @__PURE__ */ new Set(["edge-light", "react-native", "react-server"]);
56
+ const SPECIAL_EXPORT_CONVENTIONS = /* @__PURE__ */ new Set([DEVELOPMENT_ENV, PRODUCTION_ENV, ...RUNTIME_EXPORT_CONVENTIONS]);
57
+ const EXCLUDE_REGEXP = /node_modules/;
58
+ const ENDING_REGEX = /(?:\.d\.[mc]?tsx?|\.\w+)$/;
59
+ const CHUNKS_PACKEM_FOLDER = "packem_chunks";
60
+ const SHARED_PACKEM_FOLDER = "packem_shared";
61
+ const ALLOWED_TRANSFORM_EXTENSIONS_REGEX = /\.(?:m|c)?(?:j|t)sx?$/;
62
+
63
+ export { ALLOWED_TRANSFORM_EXTENSIONS_REGEX as A, CHUNKS_PACKEM_FOLDER as C, DEFAULT_EXTENSIONS as D, EXCLUDE_REGEXP as E, PRODUCTION_ENV as P, RUNTIME_EXPORT_CONVENTIONS as R, SHARED_PACKEM_FOLDER as S, VALID_EXPORT_EXTENSIONS as V, DEFAULT_LOADERS as a, DEVELOPMENT_ENV as b, SPECIAL_EXPORT_CONVENTIONS as c, ENDING_REGEX as d };