extension-create 4.2.0 → 4.2.1-canary.472.df3e2e9
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/lib/deno-manifest.d.ts +8 -2
- package/dist/lib/format-duration.d.ts +1 -0
- package/dist/lib/install-runner.d.ts +13 -0
- package/dist/lib/messages.d.ts +6 -3
- package/dist/lib/messaging.d.ts +12 -0
- package/dist/lib/package-name.d.ts +9 -0
- package/dist/lib/utils.d.ts +7 -1
- package/dist/module.cjs +527 -95
- package/dist/module.d.ts +1 -0
- package/dist/steps/import-external-template.d.ts +10 -1
- package/dist/steps/write-package-json.d.ts +1 -0
- package/package.json +4 -4
package/dist/module.d.ts
CHANGED
|
@@ -12,10 +12,12 @@ export interface TemplateProvenance {
|
|
|
12
12
|
export declare const TEMPLATE_ALIASES: Readonly<Record<string, string>>;
|
|
13
13
|
export declare function resolveTemplateAlias(name: string): string;
|
|
14
14
|
export declare class TemplateNotFoundError extends Error {
|
|
15
|
+
readonly code: "E_TEMPLATE_NOT_FOUND";
|
|
15
16
|
readonly templateName: string;
|
|
16
17
|
constructor(templateName: string, cause?: unknown);
|
|
17
18
|
}
|
|
18
19
|
export declare class InsecureTemplateUrlError extends Error {
|
|
20
|
+
readonly code: "E_INVALID_OPTION";
|
|
19
21
|
readonly url: string;
|
|
20
22
|
constructor(url: string);
|
|
21
23
|
}
|
|
@@ -25,20 +27,24 @@ export declare function refuseHttpRedirect(options: {
|
|
|
25
27
|
href?: string;
|
|
26
28
|
}): void;
|
|
27
29
|
export declare class TemplateDownloadError extends Error {
|
|
30
|
+
readonly code: "E_NETWORK";
|
|
28
31
|
readonly templateName: string;
|
|
29
32
|
constructor(templateName: string, cause: unknown);
|
|
30
33
|
}
|
|
31
34
|
export declare class TemplateNotZipError extends Error {
|
|
35
|
+
readonly code: "E_REMOTE_ZIP_INVALID";
|
|
32
36
|
readonly url: string;
|
|
33
37
|
readonly got: string;
|
|
34
38
|
constructor(url: string, got: string);
|
|
35
39
|
}
|
|
36
40
|
export declare class TemplateArchiveDamagedError extends Error {
|
|
41
|
+
readonly code: "E_REMOTE_ZIP_INVALID";
|
|
37
42
|
readonly url: string;
|
|
38
43
|
readonly reason: string;
|
|
39
44
|
constructor(url: string, cause: unknown);
|
|
40
45
|
}
|
|
41
46
|
export declare class TemplateArchiveEntryOutsideError extends Error {
|
|
47
|
+
readonly code: "E_REMOTE_ZIP_INVALID";
|
|
42
48
|
readonly url: string;
|
|
43
49
|
readonly entry: string;
|
|
44
50
|
constructor(url: string, entry: string);
|
|
@@ -50,6 +56,7 @@ export interface DownloadRetryOptions {
|
|
|
50
56
|
}
|
|
51
57
|
export type TemplateFetch = (url: string, config: AxiosRequestConfig) => Promise<Pick<AxiosResponse, 'data' | 'headers'>>;
|
|
52
58
|
export type TemplateClone = (url: string, destination: string, message: string, signal?: AbortSignal) => Promise<unknown>;
|
|
59
|
+
export declare function templateArchiveCacheDir(env?: Record<string, string | undefined>, platform?: NodeJS.Platform, home?: string): string;
|
|
53
60
|
export declare function extractExamplesTemplateFromZip(zipBuffer: Buffer, templateName: string, projectPath: string, sourceUrl?: string): Promise<number>;
|
|
54
61
|
export declare const TEMPLATE_SCAFFOLDING_FILES: string[];
|
|
55
62
|
export declare function removeTemplateScaffoldingFiles(projectPath: string): Promise<void>;
|
|
@@ -61,6 +68,7 @@ export interface ImportExternalTemplateOptions {
|
|
|
61
68
|
downloadRetry?: DownloadRetryOptions;
|
|
62
69
|
fetch?: TemplateFetch;
|
|
63
70
|
clone?: TemplateClone;
|
|
71
|
+
archiveCacheDir?: string;
|
|
64
72
|
remove?: RemovePath;
|
|
65
73
|
}
|
|
66
74
|
export type RemovePath = (target: string) => Promise<void>;
|
|
@@ -69,12 +77,13 @@ export interface CleanupLeftovers {
|
|
|
69
77
|
leftBehind: string[];
|
|
70
78
|
notRestored: string[];
|
|
71
79
|
}
|
|
72
|
-
export declare function noteIncompleteCleanup(error: unknown, { leftBehind, notRestored }: CleanupLeftovers):
|
|
80
|
+
export declare function noteIncompleteCleanup(error: unknown, { leftBehind, notRestored }: CleanupLeftovers): unknown;
|
|
73
81
|
export interface OwnerHiddenFiles {
|
|
74
82
|
gitignore: string | null;
|
|
75
83
|
mcpConfig: Buffer | null;
|
|
76
84
|
}
|
|
77
85
|
export declare function putBackOwnerHiddenFiles(projectPath: string, ownerFiles: OwnerHiddenFiles): Promise<string[]>;
|
|
86
|
+
export declare function putBackFile(target: string, contents: string | Buffer): Promise<boolean>;
|
|
78
87
|
export declare function importExternalTemplate(projectPath: string, projectName: string, template: string, logger: {
|
|
79
88
|
log(...args: unknown[]): void;
|
|
80
89
|
error(...args: unknown[]): void;
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"templates"
|
|
25
25
|
],
|
|
26
26
|
"name": "extension-create",
|
|
27
|
-
"version": "4.2.
|
|
27
|
+
"version": "4.2.1-canary.472.df3e2e9",
|
|
28
28
|
"description": "The standalone extension creation engine for Extension.js",
|
|
29
29
|
"author": {
|
|
30
30
|
"name": "Cezar Augusto",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"lint": "biome lint . && eslint .",
|
|
49
49
|
"pretest:create": "pnpm compile",
|
|
50
50
|
"pretest": "pnpm compile",
|
|
51
|
-
"test": "
|
|
52
|
-
"test:create": "
|
|
51
|
+
"test": "node ../../scripts/run-vitest.mjs",
|
|
52
|
+
"test:create": "node ../../scripts/run-vitest.mjs",
|
|
53
53
|
"pretest:coverage": "pnpm compile",
|
|
54
|
-
"test:coverage": "
|
|
54
|
+
"test:coverage": "node ../../scripts/run-vitest.mjs --coverage"
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"webextension",
|