extension 4.0.30 → 4.0.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/cli.cjs +105 -9
- package/dist/extension/__spec__/setup/env.d.ts +0 -0
- package/dist/extension/helpers/messages.d.ts +4 -0
- package/dist/extension/helpers/template-catalog.d.ts +4 -1
- package/dist/extension/helpers/template-corpus.generated.d.ts +3 -0
- package/package.json +4 -4
- package/types/index.d.ts +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -6185,7 +6185,7 @@ var __webpack_modules__ = {
|
|
|
6185
6185
|
const DEFAULT_SAMPLE_RATE = Number(process.env.EXTENSION_TELEMETRY_SAMPLE_RATE || 0.2);
|
|
6186
6186
|
const DEFAULT_MAX_EVENTS = Number(process.env.EXTENSION_TELEMETRY_MAX_EVENTS || 3);
|
|
6187
6187
|
const DEFAULT_DEBOUNCE_MS = Number(process.env.EXTENSION_TELEMETRY_DEBOUNCE_MS || 60000);
|
|
6188
|
-
const DEFAULT_TIMEOUT_MS = Number(process.env.EXTENSION_TELEMETRY_TIMEOUT_MS ||
|
|
6188
|
+
const DEFAULT_TIMEOUT_MS = Number(process.env.EXTENSION_TELEMETRY_TIMEOUT_MS || 2000);
|
|
6189
6189
|
const DEFAULT_AUDIT_MAX_BYTES = 1048576;
|
|
6190
6190
|
function auditMaxBytes() {
|
|
6191
6191
|
const raw = Number(process.env.EXTENSION_TELEMETRY_AUDIT_MAX_BYTES);
|
|
@@ -6762,9 +6762,68 @@ var __webpack_modules__ = {
|
|
|
6762
6762
|
return await import(bridgeSpecifier);
|
|
6763
6763
|
}
|
|
6764
6764
|
var messaging = __webpack_require__("./helpers/messaging.ts");
|
|
6765
|
+
const TEMPLATE_CORPUS_REPO = 'extension-js/examples';
|
|
6766
|
+
const TEMPLATE_CORPUS_REF = 'f7f4e6efb56a7e5ae08d58dbff3972d94af7d021';
|
|
6767
|
+
const TEMPLATE_CORPUS_SLUGS = [
|
|
6768
|
+
'action',
|
|
6769
|
+
'action-locales',
|
|
6770
|
+
'ai-chatgpt',
|
|
6771
|
+
'ai-claude',
|
|
6772
|
+
'ai-gemini',
|
|
6773
|
+
'ai-perplexity',
|
|
6774
|
+
'content',
|
|
6775
|
+
'content-css-modules',
|
|
6776
|
+
'content-custom-font',
|
|
6777
|
+
'content-env',
|
|
6778
|
+
'content-less',
|
|
6779
|
+
'content-less-modules',
|
|
6780
|
+
'content-main-world',
|
|
6781
|
+
'content-multi-one-entry',
|
|
6782
|
+
'content-multi-three-entries',
|
|
6783
|
+
'content-preact',
|
|
6784
|
+
'content-react',
|
|
6785
|
+
'content-sass',
|
|
6786
|
+
'content-sass-modules',
|
|
6787
|
+
'content-svelte',
|
|
6788
|
+
"content-typescript",
|
|
6789
|
+
'content-vue',
|
|
6790
|
+
'init',
|
|
6791
|
+
"javascript",
|
|
6792
|
+
'new',
|
|
6793
|
+
'new-browser-flags',
|
|
6794
|
+
'new-config-eslint',
|
|
6795
|
+
'new-config-prettier',
|
|
6796
|
+
'new-config-stylelint',
|
|
6797
|
+
'new-crypto',
|
|
6798
|
+
'new-env',
|
|
6799
|
+
'new-less',
|
|
6800
|
+
'new-preact',
|
|
6801
|
+
'new-react',
|
|
6802
|
+
'new-react-router',
|
|
6803
|
+
'new-sass',
|
|
6804
|
+
'new-svelte',
|
|
6805
|
+
"new-typescript",
|
|
6806
|
+
'new-vue',
|
|
6807
|
+
'playwright',
|
|
6808
|
+
'preact',
|
|
6809
|
+
'react',
|
|
6810
|
+
'sidebar',
|
|
6811
|
+
'sidebar-antd',
|
|
6812
|
+
'sidebar-monorepo-turborepo',
|
|
6813
|
+
'sidebar-shadcn',
|
|
6814
|
+
'special-folders-pages',
|
|
6815
|
+
"special-folders-scripts",
|
|
6816
|
+
'svelte',
|
|
6817
|
+
'transformers-js',
|
|
6818
|
+
"typescript",
|
|
6819
|
+
'vue'
|
|
6820
|
+
];
|
|
6765
6821
|
const DEFAULT_TEMPLATE = "javascript";
|
|
6766
|
-
const
|
|
6767
|
-
|
|
6822
|
+
const BUNDLED_TEMPLATES = [
|
|
6823
|
+
"javascript"
|
|
6824
|
+
];
|
|
6825
|
+
const TEMPLATE_CATALOG_URL = `https://github.com/${TEMPLATE_CORPUS_REPO}/tree/${TEMPLATE_CORPUS_REF}/examples`;
|
|
6826
|
+
const CURATED_GROUPS = [
|
|
6768
6827
|
{
|
|
6769
6828
|
title: 'Starters',
|
|
6770
6829
|
summary: 'a bare manifest, or one language or framework with sidebar UI',
|
|
@@ -6854,6 +6913,33 @@ var __webpack_modules__ = {
|
|
|
6854
6913
|
]
|
|
6855
6914
|
}
|
|
6856
6915
|
];
|
|
6916
|
+
const UNCURATED_GROUP_TITLE = 'More templates';
|
|
6917
|
+
function buildTemplateGroups() {
|
|
6918
|
+
const published = new Set(TEMPLATE_CORPUS_SLUGS);
|
|
6919
|
+
const claimed = new Set();
|
|
6920
|
+
const groups = [];
|
|
6921
|
+
for (const group of CURATED_GROUPS){
|
|
6922
|
+
const templates = group.templates.filter((name)=>{
|
|
6923
|
+
if (!published.has(name) || claimed.has(name)) return false;
|
|
6924
|
+
claimed.add(name);
|
|
6925
|
+
return true;
|
|
6926
|
+
});
|
|
6927
|
+
if (templates.length) groups.push({
|
|
6928
|
+
...group,
|
|
6929
|
+
templates
|
|
6930
|
+
});
|
|
6931
|
+
}
|
|
6932
|
+
const uncurated = TEMPLATE_CORPUS_SLUGS.filter((name)=>!claimed.has(name));
|
|
6933
|
+
if (uncurated.length) groups.push({
|
|
6934
|
+
title: UNCURATED_GROUP_TITLE,
|
|
6935
|
+
summary: 'published in the catalog, not yet grouped',
|
|
6936
|
+
templates: [
|
|
6937
|
+
...uncurated
|
|
6938
|
+
]
|
|
6939
|
+
});
|
|
6940
|
+
return groups;
|
|
6941
|
+
}
|
|
6942
|
+
const TEMPLATE_GROUPS = buildTemplateGroups();
|
|
6857
6943
|
const TEMPLATE_ALIASES = [];
|
|
6858
6944
|
function listTemplates() {
|
|
6859
6945
|
return TEMPLATE_GROUPS.flatMap((group)=>group.templates);
|
|
@@ -6897,14 +6983,19 @@ var __webpack_modules__ = {
|
|
|
6897
6983
|
function renderCreateTemplateHelp() {
|
|
6898
6984
|
const total = listTemplates().length;
|
|
6899
6985
|
const dim = (text)=>external_pintor_default().gray(text);
|
|
6986
|
+
const defaultIsBundled = BUNDLED_TEMPLATES.includes(DEFAULT_TEMPLATE);
|
|
6900
6987
|
return [
|
|
6901
6988
|
'',
|
|
6902
6989
|
external_pintor_default().underline(external_pintor_default().blue(`Templates (${total})`)),
|
|
6903
6990
|
renderTemplateList(),
|
|
6904
6991
|
'',
|
|
6905
6992
|
` ${external_pintor_default().green('Default')}`,
|
|
6906
|
-
` ${external_pintor_default().blue(DEFAULT_TEMPLATE)} ${dim('is used when --template is omitted.
|
|
6907
|
-
|
|
6993
|
+
` ${external_pintor_default().blue(DEFAULT_TEMPLATE)} ${dim('is used when --template is omitted.')}`,
|
|
6994
|
+
...defaultIsBundled ? [
|
|
6995
|
+
dim(' It ships inside the CLI, so it scaffolds with no network.')
|
|
6996
|
+
] : [
|
|
6997
|
+
dim(' It downloads the catalog archive like every other name.')
|
|
6998
|
+
],
|
|
6908
6999
|
'',
|
|
6909
7000
|
` ${external_pintor_default().green('Everything else')}`,
|
|
6910
7001
|
dim(' downloads the catalog archive at create time, so it needs the'),
|
|
@@ -7330,7 +7421,7 @@ Environment variables
|
|
|
7330
7421
|
|
|
7331
7422
|
Available templates
|
|
7332
7423
|
${TEMPLATE_GROUPS.map((group)=>`- ${external_pintor_default().green(group.title)} ${messages_arg(`(${group.summary})`)}: ${group.templates.map((template)=>messages_code(template)).join(', ')}`).join('\n')}${TEMPLATE_ALIASES.length > 0 ? `\n- ${external_pintor_default().green('Alias')}: ${TEMPLATE_ALIASES.map((alias)=>`${messages_code(alias.name)} ${messages_arg(alias.note)}`).join(', ')}` : ''}
|
|
7333
|
-
- ${messages_code(DEFAULT_TEMPLATE)} is the default when ${messages_code('--template')} is omitted. It ships inside the CLI and needs no network.
|
|
7424
|
+
- ${messages_code(DEFAULT_TEMPLATE)} is the default when ${messages_code('--template')} is omitted.${BUNDLED_TEMPLATES.includes(DEFAULT_TEMPLATE) ? ' It ships inside the CLI and needs no network.' : ''}
|
|
7334
7425
|
- Every other name is downloaded from ${messages_code(TEMPLATE_CATALOG_URL)} at create time. A GitHub or ZIP URL works in place of a name.
|
|
7335
7426
|
- A name that is not on this list fails with ${messages_code('TemplateNotFoundError')}. Run ${messages_code('extension create --help')} for the same list.
|
|
7336
7427
|
|
|
@@ -7467,9 +7558,13 @@ Cross-browser compatibility
|
|
|
7467
7558
|
templates: {
|
|
7468
7559
|
default: DEFAULT_TEMPLATE,
|
|
7469
7560
|
bundled: [
|
|
7470
|
-
|
|
7561
|
+
...BUNDLED_TEMPLATES
|
|
7471
7562
|
],
|
|
7472
7563
|
catalogUrl: TEMPLATE_CATALOG_URL,
|
|
7564
|
+
corpus: {
|
|
7565
|
+
repo: TEMPLATE_CORPUS_REPO,
|
|
7566
|
+
ref: TEMPLATE_CORPUS_REF
|
|
7567
|
+
},
|
|
7473
7568
|
names: listTemplates(),
|
|
7474
7569
|
groups: TEMPLATE_GROUPS.map((group)=>({
|
|
7475
7570
|
title: group.title,
|
|
@@ -7485,10 +7580,10 @@ Cross-browser compatibility
|
|
|
7485
7580
|
},
|
|
7486
7581
|
notes: [
|
|
7487
7582
|
`extension create <name> with no --template scaffolds ${DEFAULT_TEMPLATE}`,
|
|
7488
|
-
|
|
7583
|
+
'every name in bundled[] ships inside the CLI package and scaffolds offline. Every other name downloads the examples archive at create time',
|
|
7489
7584
|
'a GitHub URL or a ZIP URL is accepted in place of a catalog name',
|
|
7490
7585
|
'a name outside names[] fails with TemplateNotFoundError and creates nothing',
|
|
7491
|
-
|
|
7586
|
+
`names[] is generated from ${TEMPLATE_CORPUS_REPO} at corpus.ref, the exact commit this CLI version downloads, so it is what this version can scaffold and not the current contents of the catalog repository`
|
|
7492
7587
|
]
|
|
7493
7588
|
},
|
|
7494
7589
|
capabilities: {
|
|
@@ -7676,6 +7771,7 @@ Cross-browser compatibility
|
|
|
7676
7771
|
const browser = options.browser || 'chromium';
|
|
7677
7772
|
const format = resolveFormat(options);
|
|
7678
7773
|
const matches = makeFilter(options);
|
|
7774
|
+
if (options.signalsOnly) console.error("extension logs --signals-only: no signals emitter ships in this build, so dev sessions record no dx.signal events and this filter will print nothing.");
|
|
7679
7775
|
if (options.follow) return void await followLogs(projectPath, browser, format, matches);
|
|
7680
7776
|
const file = logsFilePath(projectPath, browser);
|
|
7681
7777
|
if (!external_node_fs_default().existsSync(file)) {
|
|
File without changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const DEFAULT_TEMPLATE = "javascript";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const BUNDLED_TEMPLATES: readonly string[];
|
|
3
|
+
export declare const TEMPLATE_CATALOG_URL = "https://github.com/extension-js/examples/tree/f7f4e6efb56a7e5ae08d58dbff3972d94af7d021/examples";
|
|
3
4
|
export interface TemplateGroup {
|
|
4
5
|
title: string;
|
|
5
6
|
summary: string;
|
|
@@ -10,6 +11,8 @@ export interface TemplateAlias {
|
|
|
10
11
|
resolvesTo: string;
|
|
11
12
|
note: string;
|
|
12
13
|
}
|
|
14
|
+
export declare const CURATED_GROUPS: readonly TemplateGroup[];
|
|
15
|
+
export declare const UNCURATED_GROUP_TITLE = "More templates";
|
|
13
16
|
export declare const TEMPLATE_GROUPS: readonly TemplateGroup[];
|
|
14
17
|
export declare const TEMPLATE_ALIASES: readonly TemplateAlias[];
|
|
15
18
|
export declare function listTemplates(): string[];
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"extension": "./bin/extension.cjs"
|
|
39
39
|
},
|
|
40
40
|
"name": "extension",
|
|
41
|
-
"version": "4.0.
|
|
41
|
+
"version": "4.0.32",
|
|
42
42
|
"description": "The cross-browser extension framework. Build Chrome, Edge, Firefox, and Safari extensions with no build configuration.",
|
|
43
43
|
"homepage": "https://extension.js.org/",
|
|
44
44
|
"bugs": {
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
"vivaldi-location2": "2.1.1",
|
|
107
107
|
"waterfox-location": "2.1.1",
|
|
108
108
|
"yandex-location": "2.1.1",
|
|
109
|
-
"extension-create": "4.0.
|
|
110
|
-
"extension-develop": "4.0.
|
|
111
|
-
"extension-install": "4.0.
|
|
109
|
+
"extension-create": "4.0.32",
|
|
110
|
+
"extension-develop": "4.0.32",
|
|
111
|
+
"extension-install": "4.0.32",
|
|
112
112
|
"commander": "^15.0.0",
|
|
113
113
|
"pintor": "0.3.0",
|
|
114
114
|
"semver": "^7.7.3",
|
package/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
declare global {
|
|
7
7
|
// Align types with Extension.js runtime: we provide the browser global via
|
|
8
|
-
// webextension-polyfill in Chromium
|
|
8
|
+
// webextension-polyfill in Chromium; Firefox and Safari ship it natively.
|
|
9
9
|
const browser: typeof import('webextension-polyfill')
|
|
10
10
|
|
|
11
11
|
type ExtensionBrowser =
|