extension-create 4.1.31 → 4.1.32
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/__spec__/offline-registry-fixture.d.ts +1 -0
- package/dist/lib/corepack-registry.d.ts +3 -0
- package/dist/lib/messaging.d.ts +12 -4
- package/dist/module.cjs +51 -5
- package/dist/steps/import-external-template.d.ts +1 -1
- package/dist/test-template-javascript/.extension-create.json +2 -2
- package/dist/test-template-javascript/package.json +1 -1
- package/package.json +1 -1
- package/templates/javascript/STORE.md +0 -4
|
@@ -6,3 +6,4 @@ export interface OfflineRegistryFixture {
|
|
|
6
6
|
export declare function serveOfflineRegistry(): Promise<OfflineRegistryFixture>;
|
|
7
7
|
export declare function offlineRegistryFiles(url: string): Record<string, string>;
|
|
8
8
|
export declare function offlineRegistryEnv(url: string): Record<string, string>;
|
|
9
|
+
export declare function withoutInheritedRegistry(inherited?: Record<string, string | undefined>): NodeJS.ProcessEnv;
|
package/dist/lib/messaging.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare function isMachineOutput(): boolean;
|
|
|
7
7
|
export declare function humanLine(...parts: unknown[]): void;
|
|
8
8
|
export declare function humanWarn(...parts: unknown[]): void;
|
|
9
9
|
export declare function humanError(...parts: unknown[]): void;
|
|
10
|
+
export declare function debugLine(...parts: unknown[]): void;
|
|
10
11
|
export declare const fmt: {
|
|
11
12
|
heading: (title: string) => string;
|
|
12
13
|
label: (key: string) => string;
|
|
@@ -91,7 +92,6 @@ export declare const CODES: {
|
|
|
91
92
|
readonly E_CONFIG_LOAD: 'E_CONFIG_LOAD';
|
|
92
93
|
readonly E_MANAGED_DEP_CONFLICT: 'E_MANAGED_DEP_CONFLICT';
|
|
93
94
|
readonly E_TYPES_EMIT: 'E_TYPES_EMIT';
|
|
94
|
-
readonly E_TSCONFIG_MISSING: 'E_TSCONFIG_MISSING';
|
|
95
95
|
readonly E_OPTIONAL_DEP_UNRESOLVED: 'E_OPTIONAL_DEP_UNRESOLVED';
|
|
96
96
|
readonly E_OPTIONAL_DEP_LOAD: 'E_OPTIONAL_DEP_LOAD';
|
|
97
97
|
readonly E_OPTIONAL_DEP_UNKNOWN: 'E_OPTIONAL_DEP_UNKNOWN';
|
|
@@ -107,11 +107,9 @@ export declare const CODES: {
|
|
|
107
107
|
readonly E_CSS_PARSE: 'E_CSS_PARSE';
|
|
108
108
|
readonly E_CSS_PREPROCESSOR_MISSING: 'E_CSS_PREPROCESSOR_MISSING';
|
|
109
109
|
readonly E_CSS_DEAD_REF: 'E_CSS_DEAD_REF';
|
|
110
|
-
readonly E_INTEGRATION_INSTALL: 'E_INTEGRATION_INSTALL';
|
|
111
110
|
readonly E_POLYFILL_NOT_FOUND: 'E_POLYFILL_NOT_FOUND';
|
|
112
111
|
readonly E_LOCALES_LAYOUT: 'E_LOCALES_LAYOUT';
|
|
113
112
|
readonly E_WAR_INVALID: 'E_WAR_INVALID';
|
|
114
|
-
readonly E_MATCH_PATTERN_INVALID: 'E_MATCH_PATTERN_INVALID';
|
|
115
113
|
readonly E_BACKGROUND_REQUIRED: 'E_BACKGROUND_REQUIRED';
|
|
116
114
|
readonly E_CONTENT_SCRIPT_SYNTAX: 'E_CONTENT_SCRIPT_SYNTAX';
|
|
117
115
|
readonly E_NO_ENTRYPOINTS: 'E_NO_ENTRYPOINTS';
|
|
@@ -130,7 +128,6 @@ export declare const CODES: {
|
|
|
130
128
|
readonly E_BROWSER_START_TIMEOUT: 'E_BROWSER_START_TIMEOUT';
|
|
131
129
|
readonly E_LAUNCH_SKIPPED_COMPILE_ERRORS: 'E_LAUNCH_SKIPPED_COMPILE_ERRORS';
|
|
132
130
|
readonly E_INSTANCE_AMBIGUOUS: 'E_INSTANCE_AMBIGUOUS';
|
|
133
|
-
readonly E_WSL_INTEROP: 'E_WSL_INTEROP';
|
|
134
131
|
readonly E_EXTENSION_LOAD_REFUSED: 'E_EXTENSION_LOAD_REFUSED';
|
|
135
132
|
readonly E_ADDON_INSTALL: 'E_ADDON_INSTALL';
|
|
136
133
|
readonly E_BROWSER_CONNECT: 'E_BROWSER_CONNECT';
|
|
@@ -142,6 +139,7 @@ export declare const CODES: {
|
|
|
142
139
|
readonly E_RDP_PROTOCOL: 'E_RDP_PROTOCOL';
|
|
143
140
|
readonly E_PORT_IN_USE: 'E_PORT_IN_USE';
|
|
144
141
|
readonly E_SESSION_STOPPED: 'E_SESSION_STOPPED';
|
|
142
|
+
readonly E_SESSION_EXISTS: 'E_SESSION_EXISTS';
|
|
145
143
|
readonly E_LOGS_STREAM_GAP: 'E_LOGS_STREAM_GAP';
|
|
146
144
|
readonly E_BROWSER_INSTALL_PRIVILEGE: 'E_BROWSER_INSTALL_PRIVILEGE';
|
|
147
145
|
readonly E_UNINSTALL_NOOP: 'E_UNINSTALL_NOOP';
|
|
@@ -153,6 +151,15 @@ export interface EnvelopeErrorRefs {
|
|
|
153
151
|
path?: string;
|
|
154
152
|
version?: string;
|
|
155
153
|
}
|
|
154
|
+
export interface Diagnostic {
|
|
155
|
+
code?: ErrorCode;
|
|
156
|
+
message: string;
|
|
157
|
+
file?: string;
|
|
158
|
+
line?: number;
|
|
159
|
+
column?: number;
|
|
160
|
+
severity: 'error' | 'warning';
|
|
161
|
+
name?: string;
|
|
162
|
+
}
|
|
156
163
|
export interface EnvelopeError {
|
|
157
164
|
code: ErrorCode;
|
|
158
165
|
message: string;
|
|
@@ -160,6 +167,7 @@ export interface EnvelopeError {
|
|
|
160
167
|
engine?: string;
|
|
161
168
|
hint?: string;
|
|
162
169
|
refs?: EnvelopeErrorRefs;
|
|
170
|
+
details?: Diagnostic[];
|
|
163
171
|
}
|
|
164
172
|
export interface Envelope<T = unknown> {
|
|
165
173
|
schema: typeof ENVELOPE_SCHEMA;
|
package/dist/module.cjs
CHANGED
|
@@ -48,6 +48,7 @@ const external_node_fs_namespaceObject = require("node:fs");
|
|
|
48
48
|
const external_node_path_namespaceObject = require("node:path");
|
|
49
49
|
const external_pintor_namespaceObject = require("pintor");
|
|
50
50
|
var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_namespaceObject);
|
|
51
|
+
require("node:util");
|
|
51
52
|
const GLYPH = '⏵⏵⏵';
|
|
52
53
|
const DEBUG_GLYPH = '···';
|
|
53
54
|
const DEBUG_VALUES = new Set([
|
|
@@ -127,6 +128,44 @@ new Set([
|
|
|
127
128
|
]);
|
|
128
129
|
const external_cross_spawn_namespaceObject = require("cross-spawn");
|
|
129
130
|
const external_prefers_yarn_namespaceObject = require("prefers-yarn");
|
|
131
|
+
const NPMRC_REGISTRY = /^\s*registry\s*=\s*(.*?)\s*$/;
|
|
132
|
+
const PUBLIC_REGISTRY_HOSTS = [
|
|
133
|
+
'registry.npmjs.org',
|
|
134
|
+
'registry.yarnpkg.com'
|
|
135
|
+
];
|
|
136
|
+
function readEnv(source, name) {
|
|
137
|
+
const key = Object.keys(source).find((candidate)=>candidate.toLowerCase() === name.toLowerCase() && source[candidate]);
|
|
138
|
+
return void 0 === key ? void 0 : source[key];
|
|
139
|
+
}
|
|
140
|
+
function readNpmrcRegistry(projectDir) {
|
|
141
|
+
let registry;
|
|
142
|
+
try {
|
|
143
|
+
for (const line of external_node_fs_namespaceObject.readFileSync(external_node_path_namespaceObject.join(projectDir, '.npmrc'), 'utf8').split(/\r?\n/)){
|
|
144
|
+
const match = NPMRC_REGISTRY.exec(line);
|
|
145
|
+
if (match) registry = match[1].replace(/^(['"])(.*)\1$/, '$2');
|
|
146
|
+
}
|
|
147
|
+
} catch {}
|
|
148
|
+
return registry;
|
|
149
|
+
}
|
|
150
|
+
function privateRegistry(value) {
|
|
151
|
+
const raw = String(value || '').trim();
|
|
152
|
+
if (!raw || raw.includes('${')) return;
|
|
153
|
+
try {
|
|
154
|
+
const url = new URL(raw);
|
|
155
|
+
if ('http:' !== url.protocol && 'https:' !== url.protocol) return;
|
|
156
|
+
if (PUBLIC_REGISTRY_HOSTS.includes(url.hostname)) return;
|
|
157
|
+
return url.href.replace(/\/+$/, '');
|
|
158
|
+
} catch {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function corepackRegistryEnv(source, projectDir) {
|
|
163
|
+
if (readEnv(source, 'COREPACK_NPM_REGISTRY')) return {};
|
|
164
|
+
const registry = privateRegistry(readEnv(source, 'npm_config_registry') || readNpmrcRegistry(projectDir));
|
|
165
|
+
return registry ? {
|
|
166
|
+
COREPACK_NPM_REGISTRY: registry
|
|
167
|
+
} : {};
|
|
168
|
+
}
|
|
130
169
|
const NODE_PACKAGE_MANAGERS = [
|
|
131
170
|
'pnpm',
|
|
132
171
|
'yarn',
|
|
@@ -188,7 +227,11 @@ function resolvePackageManagerSpec(projectPath, manager) {
|
|
|
188
227
|
'pipe',
|
|
189
228
|
'ignore'
|
|
190
229
|
],
|
|
191
|
-
timeout: 5000
|
|
230
|
+
timeout: 5000,
|
|
231
|
+
env: {
|
|
232
|
+
...process.env,
|
|
233
|
+
...corepackRegistryEnv(process.env, projectPath)
|
|
234
|
+
}
|
|
192
235
|
});
|
|
193
236
|
const version = 0 === probe.status ? String(probe.stdout || '').trim().replace(/^v/, '') : '';
|
|
194
237
|
if (/^\d+\.\d+\.\d+/.test(version)) return `${manager}@${version}`;
|
|
@@ -740,7 +783,7 @@ const NETWORK_TIMEOUT_MS = (()=>{
|
|
|
740
783
|
return Number.isFinite(raw) && raw > 0 ? raw : 60000;
|
|
741
784
|
})();
|
|
742
785
|
const CODELOAD_BASE = 'https://codeload.github.com/extension-js/examples/zip';
|
|
743
|
-
const DEFAULT_TEMPLATES_REF = '
|
|
786
|
+
const DEFAULT_TEMPLATES_REF = '2a8c4bae43ba6e883bf9ce7f6d108963ed162516';
|
|
744
787
|
const BUNDLED_TEMPLATES = [
|
|
745
788
|
"javascript"
|
|
746
789
|
];
|
|
@@ -1536,8 +1579,11 @@ function withoutInheritedReleaseAge(source, npmrcReleaseAge = invokingNpmrcRelea
|
|
|
1536
1579
|
for (const key of Object.keys(env))if (INHERITED_RELEASE_AGE_RULE.test(key)) Reflect.deleteProperty(env, key);
|
|
1537
1580
|
return env;
|
|
1538
1581
|
}
|
|
1539
|
-
function buildExecEnv() {
|
|
1540
|
-
const env =
|
|
1582
|
+
function buildExecEnv(cwd) {
|
|
1583
|
+
const env = {
|
|
1584
|
+
...withoutInheritedReleaseAge(process.env),
|
|
1585
|
+
...corepackRegistryEnv(process.env, cwd)
|
|
1586
|
+
};
|
|
1541
1587
|
if ('win32' !== process.platform) return env;
|
|
1542
1588
|
const nodeDir = external_node_path_namespaceObject.dirname(process.execPath);
|
|
1543
1589
|
const pathSep = external_node_path_namespaceObject.delimiter;
|
|
@@ -1553,7 +1599,7 @@ async function runInstall(command, args, opts) {
|
|
|
1553
1599
|
const child = (0, external_cross_spawn_namespaceObject.spawn)(command, args, {
|
|
1554
1600
|
stdio: opts.stdio,
|
|
1555
1601
|
cwd: opts.cwd,
|
|
1556
|
-
env: buildExecEnv()
|
|
1602
|
+
env: buildExecEnv(opts.cwd)
|
|
1557
1603
|
});
|
|
1558
1604
|
let stdout = '';
|
|
1559
1605
|
let stderr = '';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DEFAULT_TEMPLATES_REF = "
|
|
1
|
+
export declare const DEFAULT_TEMPLATES_REF = "2a8c4bae43ba6e883bf9ce7f6d108963ed162516";
|
|
2
2
|
export declare const BUNDLED_TEMPLATES: readonly string[];
|
|
3
3
|
export declare const DEFAULT_TEMPLATE_NAME = "typescript";
|
|
4
4
|
export declare const OFFLINE_FALLBACK_TEMPLATE = "javascript";
|
package/package.json
CHANGED
|
@@ -5,10 +5,6 @@ for this material at submission time; keep it current as the code
|
|
|
5
5
|
changes instead of rewriting it at the end. Replace the placeholder
|
|
6
6
|
lines marked TODO before you submit.
|
|
7
7
|
|
|
8
|
-
Packaging your extension is local and free. Submitting the result to a
|
|
9
|
-
store is what [extension.dev](https://docs.extension.dev/publish/overview?utm_source=store-md)
|
|
10
|
-
does, and it sponsors Extension.js.
|
|
11
|
-
|
|
12
8
|
Last updated: 2026-07-30
|
|
13
9
|
|
|
14
10
|
## Listing
|