web-ext 6.6.0 → 7.0.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.
Files changed (94) hide show
  1. package/README.md +17 -8
  2. package/bin/web-ext.js +13 -0
  3. package/index.js +12 -0
  4. package/lib/cmd/build.js +226 -0
  5. package/lib/cmd/build.js.map +1 -0
  6. package/lib/cmd/docs.js +16 -0
  7. package/lib/cmd/docs.js.map +1 -0
  8. package/lib/cmd/index.js +47 -0
  9. package/lib/cmd/index.js.map +1 -0
  10. package/lib/cmd/lint.js +50 -0
  11. package/lib/cmd/lint.js.map +1 -0
  12. package/lib/cmd/run.js +191 -0
  13. package/lib/cmd/run.js.map +1 -0
  14. package/lib/cmd/sign.js +140 -0
  15. package/lib/cmd/sign.js.map +1 -0
  16. package/lib/config.js +144 -0
  17. package/lib/config.js.map +1 -0
  18. package/{src → lib}/errors.js +26 -35
  19. package/lib/errors.js.map +1 -0
  20. package/lib/extension-runners/base.js +2 -0
  21. package/lib/extension-runners/base.js.map +1 -0
  22. package/{src → lib}/extension-runners/chromium.js +123 -179
  23. package/lib/extension-runners/chromium.js.map +1 -0
  24. package/{src → lib}/extension-runners/firefox-android.js +168 -326
  25. package/lib/extension-runners/firefox-android.js.map +1 -0
  26. package/{src → lib}/extension-runners/firefox-desktop.js +73 -114
  27. package/lib/extension-runners/firefox-desktop.js.map +1 -0
  28. package/lib/extension-runners/index.js +311 -0
  29. package/lib/extension-runners/index.js.map +1 -0
  30. package/lib/firefox/index.js +362 -0
  31. package/lib/firefox/index.js.map +1 -0
  32. package/lib/firefox/package-identifiers.js +5 -0
  33. package/lib/firefox/package-identifiers.js.map +1 -0
  34. package/{src → lib}/firefox/preferences.js +27 -70
  35. package/lib/firefox/preferences.js.map +1 -0
  36. package/{src → lib}/firefox/rdp-client.js +98 -105
  37. package/lib/firefox/rdp-client.js.map +1 -0
  38. package/{src → lib}/firefox/remote.js +55 -129
  39. package/lib/firefox/remote.js.map +1 -0
  40. package/lib/main.js +9 -0
  41. package/lib/main.js.map +1 -0
  42. package/lib/program.js +657 -0
  43. package/lib/program.js.map +1 -0
  44. package/lib/util/adb.js +322 -0
  45. package/lib/util/adb.js.map +1 -0
  46. package/lib/util/artifacts.js +52 -0
  47. package/lib/util/artifacts.js.map +1 -0
  48. package/lib/util/desktop-notifier.js +27 -0
  49. package/lib/util/desktop-notifier.js.map +1 -0
  50. package/{src → lib}/util/file-exists.js +7 -14
  51. package/lib/util/file-exists.js.map +1 -0
  52. package/{src → lib}/util/file-filter.js +31 -59
  53. package/lib/util/file-filter.js.map +1 -0
  54. package/lib/util/is-directory.js +20 -0
  55. package/lib/util/is-directory.js.map +1 -0
  56. package/lib/util/logger.js +79 -0
  57. package/lib/util/logger.js.map +1 -0
  58. package/{src → lib}/util/manifest.js +18 -50
  59. package/lib/util/manifest.js.map +1 -0
  60. package/{src → lib}/util/promisify.js +6 -9
  61. package/lib/util/promisify.js.map +1 -0
  62. package/{src → lib}/util/stdin.js +3 -7
  63. package/lib/util/stdin.js.map +1 -0
  64. package/{src → lib}/util/temp-dir.js +47 -52
  65. package/lib/util/temp-dir.js.map +1 -0
  66. package/lib/util/updates.js +16 -0
  67. package/lib/util/updates.js.map +1 -0
  68. package/lib/watcher.js +78 -0
  69. package/lib/watcher.js.map +1 -0
  70. package/package.json +52 -54
  71. package/CODE_OF_CONDUCT.md +0 -10
  72. package/bin/web-ext +0 -7
  73. package/dist/web-ext.js +0 -2
  74. package/index.mjs +0 -13
  75. package/src/cmd/build.js +0 -319
  76. package/src/cmd/docs.js +0 -33
  77. package/src/cmd/index.js +0 -57
  78. package/src/cmd/lint.js +0 -102
  79. package/src/cmd/run.js +0 -266
  80. package/src/cmd/sign.js +0 -198
  81. package/src/config.js +0 -187
  82. package/src/extension-runners/base.js +0 -40
  83. package/src/extension-runners/index.js +0 -381
  84. package/src/firefox/index.js +0 -541
  85. package/src/firefox/package-identifiers.js +0 -14
  86. package/src/main.js +0 -19
  87. package/src/program.js +0 -765
  88. package/src/util/adb.js +0 -433
  89. package/src/util/artifacts.js +0 -69
  90. package/src/util/desktop-notifier.js +0 -41
  91. package/src/util/is-directory.js +0 -23
  92. package/src/util/logger.js +0 -131
  93. package/src/util/updates.js +0 -21
  94. package/src/watcher.js +0 -114
@@ -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
- }