@dword-design/base-config-web-extension 3.1.5 → 3.1.7
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/dev.js +2 -2
- package/dist/get-manifest.js +2 -2
- package/dist/index.js +38 -37
- package/dist/lint.js +2 -2
- package/dist/prepublish-only.js +2 -2
- package/package.json +4 -3
package/dist/dev.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execaCommand } from 'execa';
|
|
2
2
|
import getManifest from "./get-manifest.js";
|
|
3
|
-
export default (
|
|
3
|
+
export default () => async (browser = 'chrome') => execaCommand('vite', {
|
|
4
4
|
env: {
|
|
5
5
|
MANIFEST: JSON.stringify(await getManifest({
|
|
6
6
|
browser
|
|
@@ -8,4 +8,4 @@ export default (() => async (browser = 'chrome') => execaCommand('vite', {
|
|
|
8
8
|
TARGET: browser
|
|
9
9
|
},
|
|
10
10
|
stdio: 'inherit'
|
|
11
|
-
})
|
|
11
|
+
});
|
package/dist/get-manifest.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import loadPkg from 'load-pkg';
|
|
3
3
|
import { pick } from 'lodash-es';
|
|
4
|
-
export default
|
|
4
|
+
export default async ({
|
|
5
5
|
browser
|
|
6
6
|
}) => {
|
|
7
7
|
const packageConfig = await loadPkg();
|
|
@@ -64,4 +64,4 @@ export default (async ({
|
|
|
64
64
|
web_accessible_resources: true
|
|
65
65
|
}))
|
|
66
66
|
};
|
|
67
|
-
}
|
|
67
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,12 @@ import { endent } from '@dword-design/functions';
|
|
|
3
3
|
import binName from 'depcheck-bin-name';
|
|
4
4
|
import packageName from 'depcheck-package-name';
|
|
5
5
|
import depcheckParserVue from 'depcheck-parser-vue';
|
|
6
|
+
import fs from 'fs-extra';
|
|
6
7
|
import outputFiles from 'output-files';
|
|
7
8
|
import dev from "./dev.js";
|
|
8
9
|
import lint from "./lint.js";
|
|
9
10
|
import prepublishOnly from "./prepublish-only.js";
|
|
10
|
-
export default
|
|
11
|
+
export default config => ({
|
|
11
12
|
allowedMatches: ['assets', 'components', 'public', 'background.js', 'content.js', 'config.json', 'index.spec.js', 'options.html', 'popup.html', 'popup.js', 'popup.vue', 'options.js', 'popup.js', 'model'],
|
|
12
13
|
commands: {
|
|
13
14
|
dev: {
|
|
@@ -39,19 +40,19 @@ export default (config => ({
|
|
|
39
40
|
FIREFOX_JWT_SECRET: '${{ secrets.FIREFOX_JWT_SECRET }}'
|
|
40
41
|
},
|
|
41
42
|
deployPlugins: [[packageName`@semantic-release/exec`, {
|
|
42
|
-
publishCmd: `
|
|
43
|
+
publishCmd: `pnpm ${binName`publish-extension`} --chrome-zip=dist/chrome.zip --firefox-zip=dist/firefox.zip --firefox-sources-zip=dist/firefox-sources.zip`
|
|
43
44
|
}]],
|
|
44
45
|
editorIgnore: ['.eslintrc.json', 'dist', 'userdata', 'vite.config.js'],
|
|
45
46
|
gitignore: ['/.eslintrc.json', '/dist', '/userdata', '/vite.config.js'],
|
|
46
47
|
isLockFileFixCommitType: true,
|
|
47
48
|
lint,
|
|
48
49
|
preDeploySteps: [{
|
|
49
|
-
run: '
|
|
50
|
+
run: 'pnpm prepublishOnly'
|
|
50
51
|
}, {
|
|
51
52
|
env: {
|
|
52
53
|
FIREFOX_EXTENSION_ID: '${{ secrets.FIREFOX_EXTENSION_ID }}'
|
|
53
54
|
},
|
|
54
|
-
run: '
|
|
55
|
+
run: 'pnpm prepublishOnly firefox'
|
|
55
56
|
}, {
|
|
56
57
|
run: 'zip -r ../chrome.zip .',
|
|
57
58
|
'working-directory': 'dist/chrome'
|
|
@@ -61,58 +62,58 @@ export default (config => ({
|
|
|
61
62
|
}, {
|
|
62
63
|
run: 'git archive --output=dist/firefox-sources.zip HEAD'
|
|
63
64
|
}],
|
|
64
|
-
prepare: () => outputFiles({
|
|
65
|
+
prepare: () => Promise.all([outputFiles({
|
|
65
66
|
'.eslintrc.json': `${JSON.stringify({
|
|
66
67
|
extends: packageName`@dword-design/eslint-config`
|
|
67
68
|
}, undefined, 2)}\n`,
|
|
68
69
|
'vite.config.js': endent`
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
import vue from '${packageName`@vitejs/plugin-vue`}'
|
|
71
|
+
import P from 'path'
|
|
72
|
+
import { defineConfig } from '${packageName`vite`}'
|
|
73
|
+
import vueBabel from '${packageName`@dword-design/vite-plugin-vue-babel`}'
|
|
74
|
+
import babel from '${packageName`vite-plugin-babel`}'
|
|
75
|
+
import eslint from '${packageName`vite-plugin-eslint`}'
|
|
76
|
+
import webExtension from '${packageName`vite-plugin-web-extension`}'
|
|
77
|
+
import svgLoader from '${packageName`vite-svg-loader`}'
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}),
|
|
79
|
+
export default defineConfig({
|
|
80
|
+
build: {
|
|
81
|
+
outDir: P.join('dist', process.env.TARGET),
|
|
82
|
+
},
|
|
83
|
+
plugins: [
|
|
84
|
+
vueBabel(),
|
|
85
|
+
vue(),
|
|
86
|
+
svgLoader(),
|
|
87
|
+
eslint({ fix: true }),
|
|
88
|
+
webExtension({
|
|
89
|
+
browser: process.env.TARGET,
|
|
90
|
+
manifest: () => JSON.parse(process.env.MANIFEST),
|
|
91
|
+
scriptViteConfig: { plugins: [babel(), eslint({ fix: true })] },
|
|
92
|
+
webExtConfig: { keepProfileChanges: true, chromiumProfile: 'userdata' },
|
|
93
|
+
}),
|
|
94
|
+
],
|
|
95
|
+
})\n
|
|
96
|
+
`
|
|
97
|
+
}), fs.ensureDir('userdata')]),
|
|
97
98
|
readmeInstallString: endent`
|
|
98
99
|
## Recommended setup
|
|
99
100
|
* Node.js 20.11.1
|
|
100
|
-
*
|
|
101
|
+
* pnpm 9.15.3
|
|
101
102
|
|
|
102
103
|
## Install
|
|
103
104
|
\`\`\`bash
|
|
104
|
-
$
|
|
105
|
+
$ pnpm install --frozen-lockfile
|
|
105
106
|
\`\`\`
|
|
106
107
|
|
|
107
108
|
## Running a development server
|
|
108
109
|
\`\`\`bash
|
|
109
|
-
$
|
|
110
|
+
$ pnpm dev [browser]
|
|
110
111
|
\`\`\`
|
|
111
112
|
Available browsers are \`firefox\` and \`chrome\`. Default is \`firefox\`.
|
|
112
113
|
|
|
113
114
|
## Building the extension for upload
|
|
114
115
|
\`\`\`bash
|
|
115
|
-
$
|
|
116
|
+
$ pnpm prepublishOnly [browser]
|
|
116
117
|
\`\`\`
|
|
117
118
|
`
|
|
118
|
-
})
|
|
119
|
+
});
|
package/dist/lint.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { execaCommand } from 'execa';
|
|
2
|
-
export default
|
|
2
|
+
export default async () => {
|
|
3
3
|
try {
|
|
4
4
|
await execaCommand('eslint --fix --ext .js,.json,.vue --ignore-path .gitignore .', {
|
|
5
5
|
all: true
|
|
@@ -7,4 +7,4 @@ export default (async () => {
|
|
|
7
7
|
} catch (error) {
|
|
8
8
|
throw new Error(error.all);
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
};
|
package/dist/prepublish-only.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execaCommand } from 'execa';
|
|
2
2
|
import getManifest from "./get-manifest.js";
|
|
3
|
-
export default (
|
|
3
|
+
export default () => async (browser = 'chrome') => execaCommand('vite build', {
|
|
4
4
|
env: {
|
|
5
5
|
MANIFEST: JSON.stringify(await getManifest({
|
|
6
6
|
browser
|
|
@@ -8,4 +8,4 @@ export default (() => async (browser = 'chrome') => execaCommand('vite build', {
|
|
|
8
8
|
TARGET: browser
|
|
9
9
|
},
|
|
10
10
|
stdio: 'inherit'
|
|
11
|
-
})
|
|
11
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-web-extension",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
4
4
|
"repository": "dword-design/base-config-web-extension",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"depcheck-bin-name": "^1.0.0",
|
|
33
33
|
"depcheck-package-name": "^3.0.1",
|
|
34
34
|
"depcheck-parser-vue": "^5.0.0",
|
|
35
|
-
"execa": "^
|
|
35
|
+
"execa": "^9.5.2",
|
|
36
36
|
"fs-extra": "^11.1.0",
|
|
37
37
|
"load-pkg": "^4.0.0",
|
|
38
38
|
"lodash-es": "^4.17.21",
|
|
@@ -53,9 +53,10 @@
|
|
|
53
53
|
"@mdi/svg": "^7.4.47",
|
|
54
54
|
"express": "^4.17.1",
|
|
55
55
|
"globby": "^14.0.0",
|
|
56
|
-
"webextension-polyfill": "^0.
|
|
56
|
+
"webextension-polyfill": "^0.12.0",
|
|
57
57
|
"with-local-tmp-dir": "^5.0.1"
|
|
58
58
|
},
|
|
59
|
+
"packageManager": "pnpm@9.15.3+sha256.c1da43727ccbc1ed42aff4fd6bdb4b1e91e65a818e6efff5b240fbf070ba4eaf",
|
|
59
60
|
"engines": {
|
|
60
61
|
"node": ">=18"
|
|
61
62
|
},
|