extension-create 4.2.0 → 4.3.0
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 +528 -96
- package/dist/module.d.ts +1 -0
- package/dist/steps/import-external-template.d.ts +11 -2
- package/dist/steps/write-package-json.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
export type ParsedJsonc =
|
|
2
|
-
export
|
|
1
|
+
export type ParsedJsonc = unknown;
|
|
2
|
+
export interface DenoConfig {
|
|
3
|
+
imports?: Record<string, string>;
|
|
4
|
+
nodeModulesDir?: unknown;
|
|
5
|
+
tasks?: Record<string, unknown>;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare function parseJsoncSafe<T = ParsedJsonc>(text: string): T;
|
|
3
9
|
export declare function parseNpmSpecifier(specifier: unknown): {
|
|
4
10
|
name: string;
|
|
5
11
|
version: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatDuration(ms: number): string;
|
|
@@ -4,13 +4,25 @@ export declare function withoutInheritedReleaseAge(source: Record<string, string
|
|
|
4
4
|
export declare function buildExecEnv(source: Record<string, string | undefined>, cwd: string, platform?: NodeJS.Platform, execPath?: string): Record<string, string | undefined>;
|
|
5
5
|
export declare function installTimeoutMs(source?: Record<string, string | undefined>): number;
|
|
6
6
|
export declare function installTimedOutReason(ms: number): string;
|
|
7
|
+
export declare function isMissingCommand(error: unknown, command: string): boolean;
|
|
7
8
|
export type SpawnProcess = (command: string, args: string[], options: SpawnOptions) => ChildProcess;
|
|
8
9
|
export type InstallResult = {
|
|
9
10
|
code: number | null;
|
|
10
11
|
stderr: string;
|
|
11
12
|
stdout: string;
|
|
13
|
+
signal?: NodeJS.Signals;
|
|
12
14
|
reason?: string;
|
|
13
15
|
};
|
|
16
|
+
export declare function installExit(run: InstallResult): number | string;
|
|
17
|
+
export declare class InstallExitError extends Error {
|
|
18
|
+
readonly command: string;
|
|
19
|
+
readonly args: string[];
|
|
20
|
+
readonly exitCode: number | null;
|
|
21
|
+
readonly signal?: NodeJS.Signals;
|
|
22
|
+
readonly stdout: string;
|
|
23
|
+
readonly stderr: string;
|
|
24
|
+
constructor(command: string, args: string[], run: InstallResult);
|
|
25
|
+
}
|
|
14
26
|
export interface RunInstallOptions {
|
|
15
27
|
cwd: string;
|
|
16
28
|
stdio: 'inherit' | 'ignore' | 'pipe' | 'tee';
|
|
@@ -23,6 +35,7 @@ export type SignalGroup = (pid: number, signal: NodeJS.Signals) => void;
|
|
|
23
35
|
export declare const signalProcessGroup: SignalGroup;
|
|
24
36
|
export declare const KILL_GRACE_MS = 2000;
|
|
25
37
|
export type InstallRunner = (command: string, args: string[], opts: RunInstallOptions) => Promise<InstallResult>;
|
|
38
|
+
export declare function windowsTaskkillPath(env?: Record<string, string | undefined>): string;
|
|
26
39
|
export declare function endProcessTree(child: ChildProcess, spawnProcess: SpawnProcess, platform: NodeJS.Platform, signalGroup?: SignalGroup): void;
|
|
27
40
|
export declare function forwardEndingSignals(pid: number, signalGroup: SignalGroup): () => void;
|
|
28
41
|
export declare function runInstall(command: string, args: string[], opts: RunInstallOptions): Promise<InstallResult>;
|
package/dist/lib/messages.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { type ScaffoldPackageManager, type UndeclaredReason } from './package-ma
|
|
|
2
2
|
export declare function destinationNotWriteable(workingDir: string, error?: unknown): string;
|
|
3
3
|
export declare function directoryHasConflicts(projectPath: string, conflictingFiles: string[]): Promise<string>;
|
|
4
4
|
export declare function noProjectName(): string;
|
|
5
|
+
export declare function projectFolderReserved(projectName: string): string;
|
|
6
|
+
export declare function packageNameDerived(projectName: string, packageName: string): string;
|
|
5
7
|
export declare function noUrlAllowed(): string;
|
|
6
8
|
export declare function scaffoldReady(projectPath: string, projectName: string, depsInstalled: boolean, packageManager?: ScaffoldPackageManager): Promise<string>;
|
|
7
9
|
export declare function startingNewExtension(projectName: string): string;
|
|
@@ -12,7 +14,6 @@ export declare function installingFromTemplate(templateName: string): string;
|
|
|
12
14
|
export declare function usingTemplate(templateName: string, source: string): string;
|
|
13
15
|
export declare function installingFromTemplateError(template: string, error: unknown): string;
|
|
14
16
|
export declare function templateUrlNotHttps(url: string): string;
|
|
15
|
-
export declare function templateFetchTimedOut(templateName: string, ms: number): string;
|
|
16
17
|
export declare function templateNotFoundInCatalog(templateName: string, error?: unknown): string;
|
|
17
18
|
export declare function templatePathNotFound(requested: string): string;
|
|
18
19
|
export declare function templateDirectoryIsDestination(templateDir: string, projectPath: string): string;
|
|
@@ -36,17 +37,19 @@ export interface ScaffoldRetry {
|
|
|
36
37
|
template?: string;
|
|
37
38
|
}
|
|
38
39
|
export declare function withIncompleteCleanup(frame: string, leftBehind: string[], notRestored: string[]): string;
|
|
39
|
-
export declare function installingDependenciesFailed(pmCommand: string, pmArgs: string[],
|
|
40
|
+
export declare function installingDependenciesFailed(pmCommand: string, pmArgs: string[], exit: number | string, output?: string, retry?: ScaffoldRetry): string;
|
|
40
41
|
export declare function installingDependenciesProcessError(projectName: string, error: unknown, retry?: ScaffoldRetry): string;
|
|
42
|
+
export declare function packageManagerNotInstalled(projectName: string, pmCommand: string, pmArgs: string[], retry?: ScaffoldRetry): string;
|
|
41
43
|
export declare function manifestNotFound(projectPath: string, searchDepth: number): string;
|
|
42
44
|
export declare function manifestNotParseable(manifestPath: string, error: unknown): string;
|
|
45
|
+
export declare function templateFileNotReadable(filePath: string, error: unknown): string;
|
|
43
46
|
export declare function templatePackageJsonNotParseable(packageJsonPath: string, error: unknown): string;
|
|
44
47
|
export declare function writingPackageJsonMetadata(): string;
|
|
45
48
|
export declare function writingPackageJsonMetadataError(error: unknown): string;
|
|
46
49
|
export declare function packageManagerAskedAgain(manager: Exclude<ScaffoldPackageManager, 'deno'>, waitedSeconds: number, limitSeconds: number): string;
|
|
47
50
|
export declare function packageManagerUndeclared(manager: Exclude<ScaffoldPackageManager, 'deno'>, reason: UndeclaredReason): string;
|
|
48
51
|
export declare function writingDenoJsonc(): string;
|
|
49
|
-
export declare function writingDenoJsoncError(error: unknown): string;
|
|
52
|
+
export declare function writingDenoJsoncError(error: unknown, fileName?: string): string;
|
|
50
53
|
export declare function writingTemplateProvenance(): string;
|
|
51
54
|
export declare function writingTemplateProvenanceError(error: unknown): string;
|
|
52
55
|
export declare function writingManifestJsonMetadata(): string;
|
package/dist/lib/messaging.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export declare function browserDisplayName(browser: string): string;
|
|
|
33
33
|
export declare function browserRowValue(browser: string, versionLine?: string): string;
|
|
34
34
|
export declare function isCardKeyClaimed(key: string): boolean;
|
|
35
35
|
export declare function claimCardKey(key: string): boolean;
|
|
36
|
+
export declare function holdCardKey(key: string): (() => void) | undefined;
|
|
37
|
+
export declare function releaseCardKeysOf(outputPath: string): void;
|
|
36
38
|
export declare function artifactNoun(browser: string): 'Add-on' | 'Extension';
|
|
37
39
|
export declare const ENVELOPE_SCHEMA = 1;
|
|
38
40
|
export declare const CODES: {
|
|
@@ -40,6 +42,7 @@ export declare const CODES: {
|
|
|
40
42
|
readonly E_PROJECT_NOT_FOUND: 'E_PROJECT_NOT_FOUND';
|
|
41
43
|
readonly E_MANIFEST_NOT_FOUND: 'E_MANIFEST_NOT_FOUND';
|
|
42
44
|
readonly E_MANIFEST_INVALID: 'E_MANIFEST_INVALID';
|
|
45
|
+
readonly E_PACKAGE_JSON_INVALID: 'E_PACKAGE_JSON_INVALID';
|
|
43
46
|
readonly E_FIRST_COMPILE: 'E_FIRST_COMPILE';
|
|
44
47
|
readonly E_COMPILE: 'E_COMPILE';
|
|
45
48
|
readonly E_BROWSER_NOT_FOUND: 'E_BROWSER_NOT_FOUND';
|
|
@@ -99,6 +102,7 @@ export declare const CODES: {
|
|
|
99
102
|
readonly E_OPTIONAL_DEP_UNKNOWN: 'E_OPTIONAL_DEP_UNKNOWN';
|
|
100
103
|
readonly E_COMPANION_EXTENSION_PATH: 'E_COMPANION_EXTENSION_PATH';
|
|
101
104
|
readonly E_MANIFEST_IN_PUBLIC: 'E_MANIFEST_IN_PUBLIC';
|
|
105
|
+
readonly E_FOLDER_UNREADABLE: 'E_FOLDER_UNREADABLE';
|
|
102
106
|
readonly E_RUNTIME_NOT_FOUND: 'E_RUNTIME_NOT_FOUND';
|
|
103
107
|
readonly E_COMPILE_FATAL: 'E_COMPILE_FATAL';
|
|
104
108
|
readonly E_MODULE_NOT_FOUND: 'E_MODULE_NOT_FOUND';
|
|
@@ -151,6 +155,7 @@ export declare const CODES: {
|
|
|
151
155
|
readonly E_PROJECT_LAYOUT: 'E_PROJECT_LAYOUT';
|
|
152
156
|
readonly E_ASSET_IMPORT_SHAPE: 'E_ASSET_IMPORT_SHAPE';
|
|
153
157
|
readonly E_ENV_FILE_UNREADABLE: 'E_ENV_FILE_UNREADABLE';
|
|
158
|
+
readonly E_INLINE_SCRIPT_SYNTAX: 'E_INLINE_SCRIPT_SYNTAX';
|
|
154
159
|
readonly W_MANAGED_DEP_CONFLICT: 'W_MANAGED_DEP_CONFLICT';
|
|
155
160
|
readonly W_TYPES_EMIT: 'W_TYPES_EMIT';
|
|
156
161
|
readonly W_MODULE_NOT_FOUND: 'W_MODULE_NOT_FOUND';
|
|
@@ -195,6 +200,13 @@ export declare const CODES: {
|
|
|
195
200
|
readonly W_ENV_NAME_RESERVED: 'W_ENV_NAME_RESERVED';
|
|
196
201
|
readonly W_COMPANION_EXTENSION_PATH: 'W_COMPANION_EXTENSION_PATH';
|
|
197
202
|
readonly W_ENV_DEFINE_WRITTEN: 'W_ENV_DEFINE_WRITTEN';
|
|
203
|
+
readonly W_ENV_ASSET_NOT_UTF8: 'W_ENV_ASSET_NOT_UTF8';
|
|
204
|
+
readonly W_HTML_NOT_UTF8: 'W_HTML_NOT_UTF8';
|
|
205
|
+
readonly W_RELOAD_NOT_APPLIED: 'W_RELOAD_NOT_APPLIED';
|
|
206
|
+
readonly W_CONTENT_SCRIPT_NOT_INJECTED: 'W_CONTENT_SCRIPT_NOT_INJECTED';
|
|
207
|
+
readonly W_CONTENT_SCRIPT_CLEANUP: 'W_CONTENT_SCRIPT_CLEANUP';
|
|
208
|
+
readonly W_CONTENT_SCRIPT_MOUNT: 'W_CONTENT_SCRIPT_MOUNT';
|
|
209
|
+
readonly W_DEV_SERVER_SOCKET: 'W_DEV_SERVER_SOCKET';
|
|
198
210
|
};
|
|
199
211
|
export type ErrorCode = (typeof CODES)[keyof typeof CODES];
|
|
200
212
|
export declare const CDP_FAULT_STEMS: readonly ['CDP_NOT_CONNECTED', 'CDP_TIMEOUT', 'CDP_OP_FAILED', 'BROWSER_CONNECTION_CLOSED', 'EXTENSION_ID_UNKNOWN'];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function npmNameProblem(name: string): string | null;
|
|
2
|
+
export type PackageNameAnswer = {
|
|
3
|
+
name: string;
|
|
4
|
+
derived: boolean;
|
|
5
|
+
} | {
|
|
6
|
+
reserved: true;
|
|
7
|
+
};
|
|
8
|
+
export declare const FALLBACK_PACKAGE_NAME = "my-extension";
|
|
9
|
+
export declare function packageNameFor(folderName: string): PackageNameAnswer;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ErrorCode } from './messaging.js';
|
|
2
|
+
export declare class CreateError extends Error {
|
|
3
|
+
readonly code: ErrorCode;
|
|
4
|
+
constructor(frame: string, code: ErrorCode, cause?: unknown);
|
|
5
|
+
}
|
|
6
|
+
export declare function withCode<T extends Error>(error: T, code: ErrorCode): T;
|
|
7
|
+
export declare function failStep(frame: string, cause: unknown, code: ErrorCode): Error;
|
|
2
8
|
export declare function isEnvFlagOn(name: string): boolean;
|
|
3
9
|
export declare const NEVER_SCAFFOLDED_DIRS: string[];
|
|
4
10
|
export declare function copyDirectoryWithSymlinks(source: string, destination: string, root?: string): Promise<string[]>;
|