@dword-design/base-config-web-extension 3.1.8 → 3.1.10

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -3
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import dedent from 'dedent';
4
4
  import binName from 'depcheck-bin-name';
5
5
  import packageName from 'depcheck-package-name';
6
6
  import depcheckParserVue from 'depcheck-parser-vue';
7
+ import { execaCommand } from 'execa';
7
8
  import fs from 'fs-extra';
8
9
  import dev from "./dev.js";
9
10
  import prepublishOnly from "./prepublish-only.js";
@@ -15,6 +16,15 @@ export default function () {
15
16
  arguments: '[browser]',
16
17
  handler: (...args) => dev.call(this, ...args)
17
18
  },
19
+ postinstall: async () => {
20
+ const {
21
+ stdout
22
+ } = await execaCommand(`browsers install chrome@116.0.5793.0`);
23
+ const path = stdout.split(' ').slice(1).join(' ');
24
+ await fs.outputFile('.webextrc', `${JSON.stringify({
25
+ chromiumBinary: path
26
+ })}\n`);
27
+ },
18
28
  prepublishOnly: {
19
29
  arguments: '[browser]',
20
30
  handler: (...args) => prepublishOnly.call(this, ...args)
@@ -42,8 +52,8 @@ export default function () {
42
52
  deployPlugins: [[packageName`@semantic-release/exec`, {
43
53
  publishCmd: `pnpm ${binName`publish-extension`} --chrome-zip=dist/chrome.zip --firefox-zip=dist/firefox.zip --firefox-sources-zip=dist/firefox-sources.zip`
44
54
  }]],
45
- editorIgnore: ['dist', 'userdata', 'vite.config.js'],
46
- gitignore: ['/dist', '/userdata', '/vite.config.js'],
55
+ editorIgnore: ['.webextrc', 'chrome', 'dist', 'userdata', 'vite.config.js'],
56
+ gitignore: ['/.webextrc', '/chrome', '/dist', '/userdata', '/vite.config.js'],
47
57
  isLockFileFixCommitType: true,
48
58
  preDeploySteps: [{
49
59
  run: 'pnpm prepublishOnly'
@@ -61,7 +71,7 @@ export default function () {
61
71
  }, {
62
72
  run: 'git archive --output=dist/firefox-sources.zip HEAD'
63
73
  }],
64
- prepare: () => Promise.all([fs.outputFile(pathLib.join(this.cwd, 'vite.config.js'), dedent`
74
+ prepare: () => Promise.all([fs.outputFile(pathLib.join(this.cwd, 'vite.config.js'), dedent` // TODO: resolve.alias shouldn't be necessary with existing babel config
65
75
  import vue from '${packageName`@vitejs/plugin-vue`}'
66
76
  import P from 'path'
67
77
  import { defineConfig } from '${packageName`vite`}'
@@ -75,6 +85,9 @@ export default function () {
75
85
  build: {
76
86
  outDir: P.join('dist', process.env.TARGET),
77
87
  },
88
+ resolve: {
89
+ alias: { '@': '.' },
90
+ },
78
91
  plugins: [
79
92
  vueBabel(),
80
93
  vue(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base-config-web-extension",
3
- "version": "3.1.8",
3
+ "version": "3.1.10",
4
4
  "repository": "dword-design/base-config-web-extension",
5
5
  "funding": "https://github.com/sponsors/dword-design",
6
6
  "license": "MIT",
@@ -24,6 +24,7 @@
24
24
  "dependencies": {
25
25
  "@dword-design/depcheck-parser-sass": "^4.0.4",
26
26
  "@dword-design/vite-plugin-vue-babel": "^1.0.2",
27
+ "@puppeteer/browsers": "^2.10.5",
27
28
  "@semantic-release/exec": "^6.0.3",
28
29
  "@vitejs/plugin-vue": "^5.2.4",
29
30
  "dedent": "^1.6.0",
@@ -35,7 +36,7 @@
35
36
  "load-pkg": "^4.0.0",
36
37
  "lodash-es": "^4.17.21",
37
38
  "publish-browser-extension": "^2.3.1",
38
- "vite": "^5.4.19",
39
+ "vite": "^6.0.0",
39
40
  "vite-plugin-babel": "^1.3.1",
40
41
  "vite-plugin-eslint": "^1.8.1",
41
42
  "vite-plugin-web-extension": "^4.4.3",