extension-create 3.11.1 → 3.12.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/README.md +3 -5
- package/dist/module.cjs +8 -6
- package/dist/module.d.ts +1 -1
- package/dist/steps/write-package-json.d.ts +2 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -25,10 +25,8 @@ Create a new extension with a single function call:
|
|
|
25
25
|
```javascript
|
|
26
26
|
import {extensionCreate} from 'extension-create'
|
|
27
27
|
|
|
28
|
-
// Create a basic extension
|
|
29
|
-
await extensionCreate('my-extension', {
|
|
30
|
-
template: 'init'
|
|
31
|
-
})
|
|
28
|
+
// Create a basic extension (default template: javascript)
|
|
29
|
+
await extensionCreate('my-extension', {})
|
|
32
30
|
|
|
33
31
|
// Create a React extension and install its dependencies
|
|
34
32
|
await extensionCreate('my-react-extension', {
|
|
@@ -47,7 +45,7 @@ Creates a new extension project with the specified configuration.
|
|
|
47
45
|
|
|
48
46
|
- `projectName` (string, required) - The name of your extension project
|
|
49
47
|
- `options` (object) - Configuration options
|
|
50
|
-
- `template` (string, optional) - Template name or URL. Defaults to `'
|
|
48
|
+
- `template` (string, optional) - Template name or URL. Defaults to `'javascript'` (`init` is an alias)
|
|
51
49
|
- `install` (boolean, optional) - Whether to install dependencies. Defaults to `true`
|
|
52
50
|
- `cliVersion` (string, optional) - CLI version for package.json
|
|
53
51
|
|
package/dist/module.cjs
CHANGED
|
@@ -63,7 +63,7 @@ function getPackageManagerSpecFromEnv() {
|
|
|
63
63
|
if (!name || !version) return null;
|
|
64
64
|
return `${name}@${version}`;
|
|
65
65
|
}
|
|
66
|
-
const statusPrefix = external_pintor_default().brightBlue('
|
|
66
|
+
const statusPrefix = external_pintor_default().brightBlue('⏵⏵⏵');
|
|
67
67
|
function destinationNotWriteable(workingDir) {
|
|
68
68
|
const workingDirFolder = external_path_namespaceObject.basename(workingDir);
|
|
69
69
|
return `${external_pintor_default().red('Error')} Couldn't write to the destination directory.\n${external_pintor_default().red('Next step: choose a writable path or update folder permissions.')}\n${external_pintor_default().red('Path')} ${external_pintor_default().underline(workingDirFolder)}`;
|
|
@@ -125,7 +125,7 @@ function writingTypeDefinitionsError(error) {
|
|
|
125
125
|
return `${external_pintor_default().red('Error')} Couldn't write the extension type definitions.\n${external_pintor_default().red(String(error))}\n${external_pintor_default().red('Next step: check file permissions, then try again.')}`;
|
|
126
126
|
}
|
|
127
127
|
function installingFromTemplate(projectName, templateName) {
|
|
128
|
-
if ('init' === templateName) return `${statusPrefix} Installing ${external_pintor_default().blue(projectName)}...`;
|
|
128
|
+
if ('init' === templateName || "javascript" === templateName) return `${statusPrefix} Installing ${external_pintor_default().blue(projectName)}...`;
|
|
129
129
|
return `${statusPrefix} Installing ${external_pintor_default().blue(projectName)} from template ${external_pintor_default().yellow(templateName)}...`;
|
|
130
130
|
}
|
|
131
131
|
function installingFromTemplateError(projectName, template, error) {
|
|
@@ -422,7 +422,7 @@ function resolveExtensionDevDependencyVersion(cliVersion) {
|
|
|
422
422
|
if (!cliVersion) return 'latest';
|
|
423
423
|
return cliVersion.includes('-') ? cliVersion : `^${cliVersion}`;
|
|
424
424
|
}
|
|
425
|
-
async function overridePackageJson(projectPath, projectName, { template, cliVersion }) {
|
|
425
|
+
async function overridePackageJson(projectPath, projectName, { template = "javascript", cliVersion }) {
|
|
426
426
|
const extensionBinary = await resolveExtensionBinary();
|
|
427
427
|
const candidatePath = external_path_namespaceObject.join(projectPath, 'package.json');
|
|
428
428
|
let packageJson = {};
|
|
@@ -655,11 +655,13 @@ This project was created with Extension.js. Use the commands below to run and bu
|
|
|
655
655
|
## Installation
|
|
656
656
|
|
|
657
657
|
\`\`\`bash
|
|
658
|
-
[runCommand] create <project-name>
|
|
658
|
+
[runCommand] create <project-name>
|
|
659
659
|
cd <project-name>
|
|
660
660
|
npm install
|
|
661
661
|
\`\`\`
|
|
662
662
|
|
|
663
|
+
For a different starter, add \`--template=<slug>\` (see the [templates](https://extension.js.org/docs/getting-started/templates) docs).
|
|
664
|
+
|
|
663
665
|
## Commands
|
|
664
666
|
|
|
665
667
|
### dev
|
|
@@ -1107,7 +1109,7 @@ async function installOptionalDependencies(developRoot, projectPath, plan) {
|
|
|
1107
1109
|
const baseMessage = installingProjectIntegrations([
|
|
1108
1110
|
integration
|
|
1109
1111
|
]);
|
|
1110
|
-
const installMessage = baseMessage.replace('
|
|
1112
|
+
const installMessage = baseMessage.replace('⏵⏵⏵ ', `⏵⏵⏵ [${index + 1}/${plan.integrations.length}] `);
|
|
1111
1113
|
console.log(installMessage);
|
|
1112
1114
|
if (0 === missingDeps.length) continue;
|
|
1113
1115
|
const args = buildOptionalInstallArgs(pm, missingDeps, developRoot);
|
|
@@ -1127,7 +1129,7 @@ async function installInternalDependencies(projectPath) {
|
|
|
1127
1129
|
const optionalPlan = resolveMissingOptionalDeps(developRoot, projectPath);
|
|
1128
1130
|
if (optionalPlan.dependencies.length > 0) await installOptionalDependencies(developRoot, projectPath, optionalPlan);
|
|
1129
1131
|
}
|
|
1130
|
-
async function extensionCreate(projectNameInput, { cliVersion, template =
|
|
1132
|
+
async function extensionCreate(projectNameInput, { cliVersion, template = "javascript", install = false }) {
|
|
1131
1133
|
if (!projectNameInput) throw new Error(noProjectName());
|
|
1132
1134
|
if (projectNameInput.startsWith('http')) throw new Error(noUrlAllowed());
|
|
1133
1135
|
const projectPath = external_path_namespaceObject.isAbsolute(projectNameInput) ? projectNameInput : external_path_namespaceObject.join(process.cwd(), projectNameInput);
|
package/dist/module.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface OverridePackageJsonOptions {
|
|
2
|
-
|
|
2
|
+
/** Defaults to `javascript` when omitted (same as `extensionCreate`). */
|
|
3
|
+
template?: string;
|
|
3
4
|
cliVersion?: string;
|
|
4
5
|
}
|
|
5
6
|
export declare function overridePackageJson(projectPath: string, projectName: string, { template, cliVersion }: OverridePackageJsonOptions): Promise<void>;
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"name": "extension-create",
|
|
27
|
-
"version": "3.
|
|
27
|
+
"version": "3.12.0",
|
|
28
28
|
"description": "The standalone extension creation engine for Extension.js",
|
|
29
29
|
"author": {
|
|
30
30
|
"name": "Cezar Augusto",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"adm-zip": "^0.5.16",
|
|
76
76
|
"axios": "^1.13.5",
|
|
77
77
|
"cross-spawn": "^7.0.6",
|
|
78
|
-
"go-git-it": "^5.1.
|
|
78
|
+
"go-git-it": "^5.1.5",
|
|
79
79
|
"pintor": "0.3.0",
|
|
80
80
|
"tiny-glob": "^0.2.9"
|
|
81
81
|
},
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
"@types/cross-spawn": "^6.0.6",
|
|
89
89
|
"@types/node": "^25.2.0",
|
|
90
90
|
"@types/webextension-polyfill": "0.12.4",
|
|
91
|
-
"@vitest/coverage-v8": "^4.
|
|
91
|
+
"@vitest/coverage-v8": "^4.1.3",
|
|
92
92
|
"tsconfig": "*",
|
|
93
93
|
"typescript": "6.0.2",
|
|
94
|
-
"vitest": "^4.
|
|
94
|
+
"vitest": "^4.1.3",
|
|
95
95
|
"webextension-polyfill": "^0.12.0"
|
|
96
96
|
}
|
|
97
97
|
}
|