extension-create 4.1.10 → 4.1.12
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/module.cjs
CHANGED
|
@@ -716,8 +716,8 @@ async function importExternalTemplate(projectPath, projectName, template, logger
|
|
|
716
716
|
const resolvedTemplate = template;
|
|
717
717
|
const isHttp = /^https?:\/\//i.test(template);
|
|
718
718
|
const isGithub = /^https?:\/\/github\.com\//i.test(template);
|
|
719
|
-
const
|
|
720
|
-
const resolvedTemplateName =
|
|
719
|
+
const namesCatalogEntry = !isHttp;
|
|
720
|
+
const resolvedTemplateName = namesCatalogEntry ? resolveTemplateAlias(templateName) : templateName;
|
|
721
721
|
const dirExistedBeforeImport = (0, external_node_fs_namespaceObject.existsSync)(projectPath);
|
|
722
722
|
const ownsProjectDir = options?.ownsProjectDir ?? !dirExistedBeforeImport;
|
|
723
723
|
let preExistingEntries = [];
|
|
@@ -1825,6 +1825,14 @@ async function write_readme_file_pathExists(target) {
|
|
|
1825
1825
|
return false;
|
|
1826
1826
|
}
|
|
1827
1827
|
}
|
|
1828
|
+
function platformDocsUrl() {
|
|
1829
|
+
return String(process.env.EXTENSION_DEV_DOCS_URL || '').trim().replace(/\/+$/, '');
|
|
1830
|
+
}
|
|
1831
|
+
function shipItSection() {
|
|
1832
|
+
const docs = platformDocsUrl();
|
|
1833
|
+
if (!docs) return '';
|
|
1834
|
+
return `\n## Ship it\n\nBuilding and running your extension is local and free. When you are ready to share a build or submit it to the stores, see the [publish overview](${docs}/publish/overview?utm_source=create-readme).\n`;
|
|
1835
|
+
}
|
|
1828
1836
|
async function writeReadmeFile(projectPath, projectName, logger) {
|
|
1829
1837
|
const installCommand = await getInstallCommand();
|
|
1830
1838
|
const deno = isDenoRuntime();
|
|
@@ -1838,7 +1846,7 @@ async function writeReadmeFile(projectPath, projectName, logger) {
|
|
|
1838
1846
|
const screenshotHref = hasPublicScreenshot ? './public/screenshot.png' : hasRootScreenshot ? './screenshot.png' : null;
|
|
1839
1847
|
const screenshotEmbed = screenshotHref ? `\n\n` : '';
|
|
1840
1848
|
const blockquote = description ? `> ${description}\n\n` : '';
|
|
1841
|
-
const readme = `<a href="https://extension.js.org" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/Powered%20by%20%7C%20Extension.js-0971fe" alt="Powered by Extension.js" align="right" /></a>\n\n# ${projectName}\n\n` + blockquote + `${screenshotEmbed}` + `## Commands\n` + `\n` + `### dev\n` + `\n` + "Run the extension in development mode. Target a browser with `--browser`:\n" + `\n` + "```bash\n" + `${runPrefix} dev\n` + `${runPrefix} dev${argSeparator} --browser=firefox\n` + `${runPrefix} dev${argSeparator} --browser=edge\n` + "```\n" + `\n` + `### build\n` + `\n` + `Build for production. Convenience scripts target each browser:\n` + `\n` + "```bash\n" + `${runPrefix} build # Chromium (default)\n` + `${runPrefix} build:firefox\n` + `${runPrefix} build:edge\n` + "```\n" + `\n` + `### preview\n` + `\n` + `Preview the production build in the browser:\n` + `\n` + "```bash\n" + `${runPrefix} preview\n` + "```\n" + `\n` + `## Learn more\n` + `\n` + `[Extension.js docs](https://extension.js.org).\n` +
|
|
1849
|
+
const readme = `<a href="https://extension.js.org" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/Powered%20by%20%7C%20Extension.js-0971fe" alt="Powered by Extension.js" align="right" /></a>\n\n# ${projectName}\n\n` + blockquote + `${screenshotEmbed}` + `## Commands\n` + `\n` + `### dev\n` + `\n` + "Run the extension in development mode. Target a browser with `--browser`:\n" + `\n` + "```bash\n" + `${runPrefix} dev\n` + `${runPrefix} dev${argSeparator} --browser=firefox\n` + `${runPrefix} dev${argSeparator} --browser=edge\n` + "```\n" + `\n` + `### build\n` + `\n` + `Build for production. Convenience scripts target each browser:\n` + `\n` + "```bash\n" + `${runPrefix} build # Chromium (default)\n` + `${runPrefix} build:firefox\n` + `${runPrefix} build:edge\n` + "```\n" + `\n` + `### preview\n` + `\n` + `Preview the production build in the browser:\n` + `\n` + "```bash\n" + `${runPrefix} preview\n` + "```\n" + `\n` + `## Learn more\n` + `\n` + `[Extension.js docs](https://extension.js.org).\n` + shipItSection();
|
|
1842
1850
|
try {
|
|
1843
1851
|
if (isDebug()) logger.log(writingReadmeMetaData());
|
|
1844
1852
|
await promises_namespaceObject.mkdir(projectPath, {
|
|
@@ -1977,7 +1985,7 @@ async function extensionCreate(projectNameInput, { cliVersion, template = "javas
|
|
|
1977
1985
|
return {
|
|
1978
1986
|
projectPath,
|
|
1979
1987
|
projectName,
|
|
1980
|
-
template,
|
|
1988
|
+
template: templateProvenance?.template ?? template,
|
|
1981
1989
|
depsInstalled: install,
|
|
1982
1990
|
packageManager: resolveScaffoldPackageManager(),
|
|
1983
1991
|
templateProvenance
|
|
@@ -37,7 +37,3 @@ pnpm run preview
|
|
|
37
37
|
## Learn more
|
|
38
38
|
|
|
39
39
|
[Extension.js docs](https://extension.js.org).
|
|
40
|
-
|
|
41
|
-
## Ship it
|
|
42
|
-
|
|
43
|
-
Building and running your extension is local and free. When you are ready to share a build or submit it to the stores, [extension.dev](https://docs.extension.dev/publish/overview?utm_source=create-readme) does that side and sponsors Extension.js.
|
|
@@ -9,7 +9,7 @@ Packaging your extension is local and free. Submitting the result to a
|
|
|
9
9
|
store is what [extension.dev](https://docs.extension.dev/publish/overview?utm_source=store-md)
|
|
10
10
|
does, and it sponsors Extension.js.
|
|
11
11
|
|
|
12
|
-
Last updated: 2026-
|
|
12
|
+
Last updated: 2026-09-04
|
|
13
13
|
|
|
14
14
|
## Listing
|
|
15
15
|
|