web-ext 6.7.0 → 7.1.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 +17 -8
- package/bin/web-ext.js +13 -0
- package/index.js +12 -0
- package/lib/cmd/build.js +226 -0
- package/lib/cmd/build.js.map +1 -0
- package/lib/cmd/docs.js +16 -0
- package/lib/cmd/docs.js.map +1 -0
- package/lib/cmd/index.js +47 -0
- package/lib/cmd/index.js.map +1 -0
- package/lib/cmd/lint.js +50 -0
- package/lib/cmd/lint.js.map +1 -0
- package/lib/cmd/run.js +199 -0
- package/lib/cmd/run.js.map +1 -0
- package/lib/cmd/sign.js +140 -0
- package/lib/cmd/sign.js.map +1 -0
- package/lib/config.js +144 -0
- package/lib/config.js.map +1 -0
- package/{src → lib}/errors.js +26 -35
- package/lib/errors.js.map +1 -0
- package/lib/extension-runners/base.js +2 -0
- package/lib/extension-runners/base.js.map +1 -0
- package/{src → lib}/extension-runners/chromium.js +121 -178
- package/lib/extension-runners/chromium.js.map +1 -0
- package/{src → lib}/extension-runners/firefox-android.js +168 -326
- package/lib/extension-runners/firefox-android.js.map +1 -0
- package/{src → lib}/extension-runners/firefox-desktop.js +73 -114
- package/lib/extension-runners/firefox-desktop.js.map +1 -0
- package/lib/extension-runners/index.js +311 -0
- package/lib/extension-runners/index.js.map +1 -0
- package/lib/firefox/index.js +362 -0
- package/lib/firefox/index.js.map +1 -0
- package/lib/firefox/package-identifiers.js +5 -0
- package/lib/firefox/package-identifiers.js.map +1 -0
- package/{src → lib}/firefox/preferences.js +27 -70
- package/lib/firefox/preferences.js.map +1 -0
- package/{src → lib}/firefox/rdp-client.js +98 -105
- package/lib/firefox/rdp-client.js.map +1 -0
- package/{src → lib}/firefox/remote.js +55 -129
- package/lib/firefox/remote.js.map +1 -0
- package/lib/main.js +9 -0
- package/lib/main.js.map +1 -0
- package/lib/program.js +663 -0
- package/lib/program.js.map +1 -0
- package/lib/util/adb.js +322 -0
- package/lib/util/adb.js.map +1 -0
- package/lib/util/artifacts.js +52 -0
- package/lib/util/artifacts.js.map +1 -0
- package/lib/util/desktop-notifier.js +27 -0
- package/lib/util/desktop-notifier.js.map +1 -0
- package/{src → lib}/util/file-exists.js +7 -14
- package/lib/util/file-exists.js.map +1 -0
- package/{src → lib}/util/file-filter.js +31 -59
- package/lib/util/file-filter.js.map +1 -0
- package/lib/util/is-directory.js +20 -0
- package/lib/util/is-directory.js.map +1 -0
- package/lib/util/logger.js +79 -0
- package/lib/util/logger.js.map +1 -0
- package/{src → lib}/util/manifest.js +18 -50
- package/lib/util/manifest.js.map +1 -0
- package/{src → lib}/util/promisify.js +6 -9
- package/lib/util/promisify.js.map +1 -0
- package/{src → lib}/util/stdin.js +3 -7
- package/lib/util/stdin.js.map +1 -0
- package/{src → lib}/util/temp-dir.js +47 -52
- package/lib/util/temp-dir.js.map +1 -0
- package/lib/util/updates.js +16 -0
- package/lib/util/updates.js.map +1 -0
- package/lib/watcher.js +78 -0
- package/lib/watcher.js.map +1 -0
- package/package.json +50 -52
- package/CODE_OF_CONDUCT.md +0 -10
- package/bin/web-ext +0 -7
- package/dist/web-ext.js +0 -2
- package/index.mjs +0 -13
- package/src/cmd/build.js +0 -319
- package/src/cmd/docs.js +0 -33
- package/src/cmd/index.js +0 -57
- package/src/cmd/lint.js +0 -102
- package/src/cmd/run.js +0 -266
- package/src/cmd/sign.js +0 -198
- package/src/config.js +0 -187
- package/src/extension-runners/base.js +0 -40
- package/src/extension-runners/index.js +0 -381
- package/src/firefox/index.js +0 -541
- package/src/firefox/package-identifiers.js +0 -14
- package/src/main.js +0 -19
- package/src/program.js +0 -765
- package/src/util/adb.js +0 -433
- package/src/util/artifacts.js +0 -69
- package/src/util/desktop-notifier.js +0 -41
- package/src/util/is-directory.js +0 -23
- package/src/util/logger.js +0 -131
- package/src/util/updates.js +0 -21
- package/src/watcher.js +0 -114
package/src/util/updates.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
import defaultUpdateNotifier from 'update-notifier';
|
|
3
|
-
|
|
4
|
-
type CheckForUpdatesParams = {|
|
|
5
|
-
version: string,
|
|
6
|
-
updateNotifier?: typeof defaultUpdateNotifier,
|
|
7
|
-
|};
|
|
8
|
-
|
|
9
|
-
export function checkForUpdates(
|
|
10
|
-
{
|
|
11
|
-
version,
|
|
12
|
-
updateNotifier = defaultUpdateNotifier,
|
|
13
|
-
}: CheckForUpdatesParams
|
|
14
|
-
) {
|
|
15
|
-
const pkg = {name: 'web-ext', version};
|
|
16
|
-
|
|
17
|
-
updateNotifier({
|
|
18
|
-
pkg,
|
|
19
|
-
updateCheckInterval: 1000 * 60 * 60 * 24 * 3, // 3 days,
|
|
20
|
-
}).notify();
|
|
21
|
-
}
|
package/src/watcher.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
import {fs} from 'mz';
|
|
3
|
-
import Watchpack from 'watchpack';
|
|
4
|
-
import debounce from 'debounce';
|
|
5
|
-
|
|
6
|
-
import { UsageError } from './errors';
|
|
7
|
-
import {createLogger} from './util/logger';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const log = createLogger(__filename);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// onSourceChange types and implementation
|
|
14
|
-
|
|
15
|
-
export type ShouldWatchFn = (filePath: string) => boolean;
|
|
16
|
-
|
|
17
|
-
export type OnChangeFn = () => any;
|
|
18
|
-
|
|
19
|
-
export type OnSourceChangeParams = {|
|
|
20
|
-
sourceDir: string,
|
|
21
|
-
watchFile?: Array<string>,
|
|
22
|
-
watchIgnored?: Array<string>,
|
|
23
|
-
artifactsDir: string,
|
|
24
|
-
onChange: OnChangeFn,
|
|
25
|
-
shouldWatchFile: ShouldWatchFn,
|
|
26
|
-
debounceTime?: number,
|
|
27
|
-
|};
|
|
28
|
-
|
|
29
|
-
export type OnSourceChangeFn = (params: OnSourceChangeParams) => Watchpack;
|
|
30
|
-
|
|
31
|
-
export default function onSourceChange(
|
|
32
|
-
{
|
|
33
|
-
sourceDir,
|
|
34
|
-
watchFile,
|
|
35
|
-
watchIgnored,
|
|
36
|
-
artifactsDir,
|
|
37
|
-
onChange,
|
|
38
|
-
shouldWatchFile,
|
|
39
|
-
debounceTime = 1000,
|
|
40
|
-
}: OnSourceChangeParams
|
|
41
|
-
): Watchpack {
|
|
42
|
-
// When running on Windows, transform the ignored paths and globs
|
|
43
|
-
// as Watchpack does translate the changed files path internally
|
|
44
|
-
// (See https://github.com/webpack/watchpack/blob/v2.1.1/lib/DirectoryWatcher.js#L99-L103).
|
|
45
|
-
const ignored = (watchIgnored && process.platform === 'win32')
|
|
46
|
-
? watchIgnored.map((it) => it.replace(/\\/g, '/'))
|
|
47
|
-
: watchIgnored;
|
|
48
|
-
|
|
49
|
-
// TODO: For network disks, we would need to add {poll: true}.
|
|
50
|
-
const watcher = ignored ?
|
|
51
|
-
new Watchpack({ignored}) :
|
|
52
|
-
new Watchpack();
|
|
53
|
-
|
|
54
|
-
const executeImmediately = true;
|
|
55
|
-
onChange = debounce(onChange, debounceTime, executeImmediately);
|
|
56
|
-
|
|
57
|
-
watcher.on('change', (filePath) => {
|
|
58
|
-
proxyFileChanges({artifactsDir, onChange, filePath, shouldWatchFile});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
log.debug(
|
|
62
|
-
`Watching ${watchFile ? watchFile.join(',') : sourceDir} for changes`
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const watchedDirs = [];
|
|
66
|
-
const watchedFiles = [];
|
|
67
|
-
|
|
68
|
-
if (watchFile) {
|
|
69
|
-
for (const filePath of watchFile) {
|
|
70
|
-
if (fs.existsSync(filePath) && !fs.lstatSync(filePath).isFile()) {
|
|
71
|
-
throw new UsageError('Invalid --watch-file value: ' +
|
|
72
|
-
`"${filePath}" is not a file.`);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
watchedFiles.push(filePath);
|
|
76
|
-
}
|
|
77
|
-
} else {
|
|
78
|
-
watchedDirs.push(sourceDir);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
watcher.watch({
|
|
82
|
-
files: watchedFiles,
|
|
83
|
-
directories: watchedDirs,
|
|
84
|
-
missing: [],
|
|
85
|
-
startTime: Date.now(),
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// TODO: support interrupting the watcher on Windows.
|
|
89
|
-
// https://github.com/mozilla/web-ext/issues/225
|
|
90
|
-
process.on('SIGINT', () => watcher.close());
|
|
91
|
-
return watcher;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// proxyFileChanges types and implementation.
|
|
96
|
-
|
|
97
|
-
export type ProxyFileChangesParams = {|
|
|
98
|
-
artifactsDir: string,
|
|
99
|
-
onChange: OnChangeFn,
|
|
100
|
-
filePath: string,
|
|
101
|
-
shouldWatchFile: ShouldWatchFn,
|
|
102
|
-
|};
|
|
103
|
-
|
|
104
|
-
export function proxyFileChanges(
|
|
105
|
-
{artifactsDir, onChange, filePath, shouldWatchFile}: ProxyFileChangesParams
|
|
106
|
-
): void {
|
|
107
|
-
if (filePath.indexOf(artifactsDir) === 0 || !shouldWatchFile(filePath)) {
|
|
108
|
-
log.debug(`Ignoring change to: ${filePath}`);
|
|
109
|
-
} else {
|
|
110
|
-
log.debug(`Changed: ${filePath}`);
|
|
111
|
-
log.debug(`Last change detection: ${(new Date()).toTimeString()}`);
|
|
112
|
-
onChange();
|
|
113
|
-
}
|
|
114
|
-
}
|