extension-create 2.0.0-rc.29 → 2.0.0-rc.31

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.
@@ -4,5 +4,4 @@ export declare function moveDirectoryContents(source: string, destination: strin
4
4
  export declare function getInstallCommand(): Promise<string>;
5
5
  export declare function getTemplatePath(workingDir: string): string;
6
6
  export declare function isDirectoryWriteable(directory: string, projectName: string): Promise<boolean>;
7
- export declare function isExternalTemplate(templateName: string): boolean;
8
7
  export declare function isTypeScriptTemplate(templateName: string): boolean;
package/dist/module.d.ts CHANGED
@@ -3,4 +3,8 @@ export interface CreateOptions {
3
3
  install?: boolean;
4
4
  cliVersion?: string;
5
5
  }
6
- export declare function extensionCreate(projectNameInput: string | undefined, { cliVersion, template, install }: CreateOptions): Promise<void>;
6
+ export declare function extensionCreate(projectNameInput: string | undefined, { cliVersion, template, install }: {
7
+ cliVersion?: string;
8
+ template?: string;
9
+ install?: boolean;
10
+ }): Promise<void>;
package/dist/module.js CHANGED
@@ -237,9 +237,6 @@ async function isDirectoryWriteable(directory, projectName) {
237
237
  return false;
238
238
  }
239
239
  }
240
- function isExternalTemplate(templateName) {
241
- return 'init' !== templateName;
242
- }
243
240
  function isTypeScriptTemplate(templateName) {
244
241
  return templateName.includes("typescript") || templateName.includes('react') || templateName.includes('preact') || templateName.includes('svelte') || templateName.includes('solid');
245
242
  }
@@ -271,18 +268,6 @@ async function createDirectory(projectPath, projectName) {
271
268
  process.exit(1);
272
269
  }
273
270
  }
274
- const import_local_template_filename = (0, external_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__);
275
- const import_local_template_dirname = external_path_namespaceObject.dirname(import_local_template_filename);
276
- async function importLocalTemplate(projectPath, projectName, template) {
277
- const localTemplatePath = external_path_namespaceObject.resolve(import_local_template_dirname, 'dist', 'template');
278
- try {
279
- console.log(installingFromTemplate(projectName, template));
280
- await copyDirectoryWithSymlinks(localTemplatePath, projectPath);
281
- } catch (error) {
282
- console.error(installingFromTemplateError(projectName, template, error));
283
- process.exit(1);
284
- }
285
- }
286
271
  const external_go_git_it_namespaceObject = require("go-git-it");
287
272
  var external_go_git_it_default = /*#__PURE__*/ __webpack_require__.n(external_go_git_it_namespaceObject);
288
273
  const import_external_template_filename = (0, external_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__);
@@ -323,9 +308,9 @@ const extensionJsPackageJsonScripts = {
323
308
  start: 'development' === process.env.EXTENSION_ENV ? 'node node_modules/extension start' : 'extension start',
324
309
  build: 'development' === process.env.EXTENSION_ENV ? 'node node_modules/extension build' : 'extension build'
325
310
  };
326
- async function overridePackageJson(projectPath, projectName, { template, cliVersion }) {
311
+ async function overridePackageJson(projectPath, projectName, { cliVersion }) {
327
312
  const templatePath = getTemplatePath(process.cwd());
328
- const packageJsonPath = isExternalTemplate(template) ? external_path_namespaceObject.join(projectPath, 'package.json') : external_path_namespaceObject.join(templatePath, 'package.json');
313
+ const packageJsonPath = external_path_namespaceObject.join(templatePath, 'package.json');
329
314
  const packageJsonContent = await promises_namespaceObject.readFile(packageJsonPath);
330
315
  const packageJson = JSON.parse(packageJsonContent.toString());
331
316
  packageJson.scripts = packageJson.scripts || {};
@@ -570,8 +555,7 @@ async function extensionCreate(projectNameInput, { cliVersion, template = 'init'
570
555
  const projectName = external_path_namespaceObject.basename(projectPath);
571
556
  try {
572
557
  await createDirectory(projectPath, projectName);
573
- if ('init' === template) await importLocalTemplate(projectPath, projectName, template);
574
- else await importExternalTemplate(projectPath, projectName, template);
558
+ await importExternalTemplate(projectPath, projectName, template);
575
559
  await overridePackageJson(projectPath, projectName, {
576
560
  template,
577
561
  cliVersion
@@ -2,5 +2,5 @@ interface OverridePackageJsonOptions {
2
2
  template: string;
3
3
  cliVersion?: string;
4
4
  }
5
- export declare function overridePackageJson(projectPath: string, projectName: string, { template, cliVersion }: OverridePackageJsonOptions): Promise<void>;
5
+ export declare function overridePackageJson(projectPath: string, projectName: string, { cliVersion }: OverridePackageJsonOptions): Promise<void>;
6
6
  export {};
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "dist"
22
22
  ],
23
23
  "name": "extension-create",
24
- "version": "2.0.0-rc.29",
24
+ "version": "2.0.0-rc.31",
25
25
  "description": "The create step of Extension.js",
26
26
  "author": {
27
27
  "name": "Cezar Augusto",
@@ -50,7 +50,7 @@
50
50
  "scripts": {
51
51
  "clean": "rm -rf dist",
52
52
  "watch": "rslib build --watch",
53
- "compile": "rslib build && bash install_scripts.sh",
53
+ "compile": "rslib build",
54
54
  "test:create": "vitest run",
55
55
  "test:coverage": "vitest run --coverage"
56
56
  }
@@ -1 +0,0 @@
1
- export declare function importLocalTemplate(projectPath: string, projectName: string, template: string): Promise<void>;
@@ -1,35 +0,0 @@
1
- # [projectName]
2
-
3
- > [templateDescription]
4
-
5
- ## Available Scripts
6
-
7
- In the project directory, you can run the following scripts:
8
-
9
- ### [runCommand] dev
10
-
11
- **Development Mode**: This command runs your extension in development mode. It will launch a new browser instance with your extension loaded. The page will automatically reload whenever you make changes to your code, allowing for a smooth development experience.
12
-
13
- ```bash
14
- [runCommand] dev
15
- ```
16
-
17
- ### [runCommand] start
18
-
19
- **Production Preview**: This command runs your extension in production mode. It will launch a new browser instance with your extension loaded, simulating the environment and behavior of your extension as it will appear once published.
20
-
21
- ```bash
22
- [runCommand] start
23
- ```
24
-
25
- ### [runCommand] build
26
-
27
- **Build for Production**: This command builds your extension for production. It optimizes and bundles your extension, preparing it for deployment to the target browser's store.
28
-
29
- ```bash
30
- [runCommand] build
31
- ```
32
-
33
- ## Learn More
34
-
35
- To learn more about creating cross-browser extensions with Extension.js, visit the [official documentation](https://extension.js.org).
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/chrome-manifest.json",
3
- "manifest_version": 3,
4
- "version": "1.0",
5
- "name": "Default Extension",
6
- "description": "A minimum extension template. This template includes a manifest file."
7
- }
@@ -1,18 +0,0 @@
1
- {
2
- "license": "MIT",
3
- "repository": {
4
- "type": "git",
5
- "url": "https://github.com/extension-js/extension.git",
6
- "directory": "examples/init"
7
- },
8
- "type": "module",
9
- "name": "init",
10
- "description": "An Extension.js example.",
11
- "version": "0.0.1",
12
- "keywords": [
13
- "extension",
14
- "browser-extension",
15
- "web-extension",
16
- "template"
17
- ]
18
- }