@visulima/packem-share 1.0.0-alpha.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/CHANGELOG.md +15 -0
- package/LICENSE.md +644 -0
- package/README.md +259 -0
- package/dist/constants/index.d.mts +38 -0
- package/dist/constants/index.d.ts +38 -0
- package/dist/constants/index.mjs +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +1 -0
- package/dist/packem_shared/FileCache-DdOdmeil.mjs +1 -0
- package/dist/packem_shared/arrayIncludes-Car4Lj1a.mjs +1 -0
- package/dist/packem_shared/arrayify-CJp87iG7.mjs +1 -0
- package/dist/packem_shared/createRollupLogger-DyOYcur8.mjs +1 -0
- package/dist/packem_shared/enhanceRollupError-DmItfx-U.mjs +7 -0
- package/dist/packem_shared/getChunkFilename-C1wUJsM7.mjs +1 -0
- package/dist/packem_shared/getEntryFileNames-DF1zHqbH.mjs +1 -0
- package/dist/packem_shared/getHash-C4PDVNN_.mjs +1 -0
- package/dist/packem_shared/getPackageName-CwjDzCnN.mjs +1 -0
- package/dist/packem_shared/getRegexMatches-CIyZXB3k.mjs +1 -0
- package/dist/packem_shared/memoize-BTaub_3L.mjs +1 -0
- package/dist/packem_shared/replaceContentWithinMarker-DqHE825x.mjs +3 -0
- package/dist/packem_shared/sortUserPlugins-BeSpxWa9.mjs +1 -0
- package/dist/packem_shared/svgEncoder-BHLRmBWl.mjs +1 -0
- package/dist/packem_shared/warn-B6AJDQdJ.mjs +1 -0
- package/dist/types/index.d.mts +2605 -0
- package/dist/types/index.d.ts +2605 -0
- package/dist/types/index.mjs +0 -0
- package/dist/utils/index.d.mts +87 -0
- package/dist/utils/index.d.ts +87 -0
- package/dist/utils/index.mjs +1 -0
- package/package.json +75 -0
|
File without changes
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { RollupError, PreRenderedChunk, PreRenderedAsset, Plugin } from 'rollup';
|
|
2
|
+
|
|
3
|
+
declare const arrayIncludes: (array: (RegExp | string)[], searchElement: string) => boolean;
|
|
4
|
+
|
|
5
|
+
declare const arrayify: <T>(x: T | T[]) => T[];
|
|
6
|
+
|
|
7
|
+
interface RollupLogger {
|
|
8
|
+
debug: (log: {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
message: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
error: (log: {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
message: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
info: (log: {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
message: string;
|
|
19
|
+
}) => void;
|
|
20
|
+
warn: (log: {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
message: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
}
|
|
25
|
+
declare const createRollupLogger: (context: {
|
|
26
|
+
debug: (log: {
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
message: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
error: (log: {
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
message: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
info: (log: {
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
message: string;
|
|
37
|
+
}) => void;
|
|
38
|
+
warn: (log: {
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
message: string;
|
|
41
|
+
}) => void;
|
|
42
|
+
}, pluginName: string) => RollupLogger;
|
|
43
|
+
|
|
44
|
+
declare const enhanceRollupError: (error: RollupError) => void;
|
|
45
|
+
|
|
46
|
+
declare class FileCache {
|
|
47
|
+
#private;
|
|
48
|
+
constructor(cwd: string, cachePath: string | undefined, hashKey: string, logger: RollupLogger);
|
|
49
|
+
set isEnabled(value: boolean);
|
|
50
|
+
get isEnabled(): boolean;
|
|
51
|
+
has(name: string, subDirectory?: string): boolean;
|
|
52
|
+
get<R>(name: string, subDirectory?: string): R | undefined;
|
|
53
|
+
set(name: string, data: ArrayBuffer | ArrayBufferView | boolean | number | object | string | null | undefined, subDirectory?: string): void;
|
|
54
|
+
private getFilePath;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare const getChunkFilename: (chunk: PreRenderedChunk, extension: string) => string;
|
|
58
|
+
|
|
59
|
+
declare const getEntryFileNames: (chunkInfo: PreRenderedAsset, extension: string) => string;
|
|
60
|
+
|
|
61
|
+
declare const getHash: (data: NodeJS.ArrayBufferView | string) => string;
|
|
62
|
+
|
|
63
|
+
declare const getPackageName: (id?: string) => string;
|
|
64
|
+
|
|
65
|
+
declare const getRegexMatches: (regex: RegExp, source: string) => string[];
|
|
66
|
+
|
|
67
|
+
type CacheKeyResolver = string | ((...arguments_: any[]) => string);
|
|
68
|
+
declare const memoize: <T extends (...arguments_: any[]) => any>(function_: T, cacheKey?: CacheKeyResolver, cacheArgument?: Map<string, ReturnType<T>>) => T;
|
|
69
|
+
declare const memoizeByKey: <T extends (...arguments_: any[]) => any>(function_: T) => ((cacheKey?: CacheKeyResolver) => T);
|
|
70
|
+
|
|
71
|
+
declare const replaceContentWithinMarker: (content: string, marker: string, replacement: string) => string | undefined;
|
|
72
|
+
|
|
73
|
+
declare const sortUserPlugins: <T extends {
|
|
74
|
+
enforce?: "pre" | "post";
|
|
75
|
+
plugin: Plugin;
|
|
76
|
+
type?: string;
|
|
77
|
+
}>(plugins: T[] | undefined, type: "build" | "dts") => [Plugin[], Plugin[], Plugin[]];
|
|
78
|
+
|
|
79
|
+
declare const svgEncoder: (buffer: Buffer) => string;
|
|
80
|
+
|
|
81
|
+
interface WarningContext {
|
|
82
|
+
warnings: Set<string>;
|
|
83
|
+
}
|
|
84
|
+
declare const warn: (context: WarningContext, message: string) => void;
|
|
85
|
+
|
|
86
|
+
export { FileCache, arrayIncludes, arrayify, createRollupLogger, enhanceRollupError, getChunkFilename, getEntryFileNames, getHash, getPackageName, getRegexMatches, memoize, memoizeByKey, replaceContentWithinMarker, sortUserPlugins, svgEncoder, warn };
|
|
87
|
+
export type { RollupLogger };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { RollupError, PreRenderedChunk, PreRenderedAsset, Plugin } from 'rollup';
|
|
2
|
+
|
|
3
|
+
declare const arrayIncludes: (array: (RegExp | string)[], searchElement: string) => boolean;
|
|
4
|
+
|
|
5
|
+
declare const arrayify: <T>(x: T | T[]) => T[];
|
|
6
|
+
|
|
7
|
+
interface RollupLogger {
|
|
8
|
+
debug: (log: {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
message: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
error: (log: {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
message: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
info: (log: {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
message: string;
|
|
19
|
+
}) => void;
|
|
20
|
+
warn: (log: {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
message: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
}
|
|
25
|
+
declare const createRollupLogger: (context: {
|
|
26
|
+
debug: (log: {
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
message: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
error: (log: {
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
message: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
info: (log: {
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
message: string;
|
|
37
|
+
}) => void;
|
|
38
|
+
warn: (log: {
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
message: string;
|
|
41
|
+
}) => void;
|
|
42
|
+
}, pluginName: string) => RollupLogger;
|
|
43
|
+
|
|
44
|
+
declare const enhanceRollupError: (error: RollupError) => void;
|
|
45
|
+
|
|
46
|
+
declare class FileCache {
|
|
47
|
+
#private;
|
|
48
|
+
constructor(cwd: string, cachePath: string | undefined, hashKey: string, logger: RollupLogger);
|
|
49
|
+
set isEnabled(value: boolean);
|
|
50
|
+
get isEnabled(): boolean;
|
|
51
|
+
has(name: string, subDirectory?: string): boolean;
|
|
52
|
+
get<R>(name: string, subDirectory?: string): R | undefined;
|
|
53
|
+
set(name: string, data: ArrayBuffer | ArrayBufferView | boolean | number | object | string | null | undefined, subDirectory?: string): void;
|
|
54
|
+
private getFilePath;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare const getChunkFilename: (chunk: PreRenderedChunk, extension: string) => string;
|
|
58
|
+
|
|
59
|
+
declare const getEntryFileNames: (chunkInfo: PreRenderedAsset, extension: string) => string;
|
|
60
|
+
|
|
61
|
+
declare const getHash: (data: NodeJS.ArrayBufferView | string) => string;
|
|
62
|
+
|
|
63
|
+
declare const getPackageName: (id?: string) => string;
|
|
64
|
+
|
|
65
|
+
declare const getRegexMatches: (regex: RegExp, source: string) => string[];
|
|
66
|
+
|
|
67
|
+
type CacheKeyResolver = string | ((...arguments_: any[]) => string);
|
|
68
|
+
declare const memoize: <T extends (...arguments_: any[]) => any>(function_: T, cacheKey?: CacheKeyResolver, cacheArgument?: Map<string, ReturnType<T>>) => T;
|
|
69
|
+
declare const memoizeByKey: <T extends (...arguments_: any[]) => any>(function_: T) => ((cacheKey?: CacheKeyResolver) => T);
|
|
70
|
+
|
|
71
|
+
declare const replaceContentWithinMarker: (content: string, marker: string, replacement: string) => string | undefined;
|
|
72
|
+
|
|
73
|
+
declare const sortUserPlugins: <T extends {
|
|
74
|
+
enforce?: "pre" | "post";
|
|
75
|
+
plugin: Plugin;
|
|
76
|
+
type?: string;
|
|
77
|
+
}>(plugins: T[] | undefined, type: "build" | "dts") => [Plugin[], Plugin[], Plugin[]];
|
|
78
|
+
|
|
79
|
+
declare const svgEncoder: (buffer: Buffer) => string;
|
|
80
|
+
|
|
81
|
+
interface WarningContext {
|
|
82
|
+
warnings: Set<string>;
|
|
83
|
+
}
|
|
84
|
+
declare const warn: (context: WarningContext, message: string) => void;
|
|
85
|
+
|
|
86
|
+
export { FileCache, arrayIncludes, arrayify, createRollupLogger, enhanceRollupError, getChunkFilename, getEntryFileNames, getHash, getPackageName, getRegexMatches, memoize, memoizeByKey, replaceContentWithinMarker, sortUserPlugins, svgEncoder, warn };
|
|
87
|
+
export type { RollupLogger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as a}from"../packem_shared/arrayIncludes-Car4Lj1a.mjs";import{default as o}from"../packem_shared/arrayify-CJp87iG7.mjs";import{createRollupLogger as l}from"../packem_shared/createRollupLogger-DyOYcur8.mjs";import{default as s}from"../packem_shared/enhanceRollupError-DmItfx-U.mjs";import{default as u}from"../packem_shared/FileCache-DdOdmeil.mjs";import{default as d}from"../packem_shared/getChunkFilename-C1wUJsM7.mjs";import{default as g}from"../packem_shared/getEntryFileNames-DF1zHqbH.mjs";import{default as c}from"../packem_shared/getHash-C4PDVNN_.mjs";import{default as y}from"../packem_shared/getPackageName-CwjDzCnN.mjs";import{default as C}from"../packem_shared/getRegexMatches-CIyZXB3k.mjs";import{memoize as F,memoizeByKey as R}from"../packem_shared/memoize-BTaub_3L.mjs";import{default as M}from"../packem_shared/replaceContentWithinMarker-DqHE825x.mjs";import{default as P}from"../packem_shared/sortUserPlugins-BeSpxWa9.mjs";import{default as w}from"../packem_shared/svgEncoder-BHLRmBWl.mjs";import{default as H}from"../packem_shared/warn-B6AJDQdJ.mjs";export{u as FileCache,a as arrayIncludes,o as arrayify,l as createRollupLogger,s as enhanceRollupError,d as getChunkFilename,g as getEntryFileNames,c as getHash,y as getPackageName,C as getRegexMatches,F as memoize,R as memoizeByKey,M as replaceContentWithinMarker,P as sortUserPlugins,w as svgEncoder,H as warn};
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@visulima/packem-share",
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
|
+
"description": "Shared types and helpers for packem.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"visulima",
|
|
7
|
+
"packem-share"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/visulima/packem/tree/main/packages/packem-share",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/visulima/packem/issues"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/visulima/packem.git",
|
|
16
|
+
"directory": "packages/packem-share"
|
|
17
|
+
},
|
|
18
|
+
"funding": [
|
|
19
|
+
{
|
|
20
|
+
"type": "github",
|
|
21
|
+
"url": "https://github.com/sponsors/prisis"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "consulting",
|
|
25
|
+
"url": "https://anolilab.com/support"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"author": {
|
|
30
|
+
"name": "Daniel Bannert",
|
|
31
|
+
"email": "d.bannert@anolilab.de"
|
|
32
|
+
},
|
|
33
|
+
"sideEffects": false,
|
|
34
|
+
"type": "module",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.mts",
|
|
38
|
+
"default": "./dist/index.mjs"
|
|
39
|
+
},
|
|
40
|
+
"./utils": {
|
|
41
|
+
"types": "./dist/utils/index.d.mts",
|
|
42
|
+
"default": "./dist/utils/index.mjs"
|
|
43
|
+
},
|
|
44
|
+
"./types": {
|
|
45
|
+
"types": "./dist/types/index.d.mts",
|
|
46
|
+
"default": "./dist/types/index.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./constants": {
|
|
49
|
+
"types": "./dist/constants/index.d.mts",
|
|
50
|
+
"default": "./dist/constants/index.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./package.json": "./package.json"
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"./dist",
|
|
56
|
+
"CHANGELOG.md",
|
|
57
|
+
"README.md"
|
|
58
|
+
],
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@visulima/colorize": "1.4.23",
|
|
61
|
+
"@visulima/fs": "3.1.5",
|
|
62
|
+
"@visulima/package": "3.5.8",
|
|
63
|
+
"@visulima/path": "1.4.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"rollup": "^4"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=20.* <=24.*"
|
|
70
|
+
},
|
|
71
|
+
"publishConfig": {
|
|
72
|
+
"access": "public",
|
|
73
|
+
"provenance": true
|
|
74
|
+
}
|
|
75
|
+
}
|