webext-schema 5.5.5 → 5.6.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/modules/update.js CHANGED
@@ -14,7 +14,7 @@ import { createFile } from './file-util.js';
14
14
  import { CHAR, INDENT } from './constant.js';
15
15
  const DIR_CWD = process.cwd();
16
16
  const PERM_FILE = 0o644;
17
- export const ESR_VER = 128;
17
+ export const ESR_VER = 115;
18
18
 
19
19
  /**
20
20
  * fetch text
@@ -116,8 +116,8 @@ export const getAllSchemaData = async (baseUrl, info) => {
116
116
  if (!isString(baseUrl)) {
117
117
  throw new TypeError(`Expected String but got ${getType(baseUrl)}.`);
118
118
  }
119
- const schemas = [];
120
119
  const items = await getFileList(baseUrl);
120
+ const schemas = [];
121
121
  for (const item of items) {
122
122
  if (info) {
123
123
  console.info(`Fetching ${item}`);
@@ -191,35 +191,47 @@ export const getMailExtSchemaData = async (baseUrl, info) => {
191
191
  export const createUnifiedSchema = async (channel, info) => {
192
192
  const channelUrl = getChannelUrl(channel);
193
193
  const schema = {};
194
- let arr;
195
194
  if (channel === 'mail') {
196
195
  const browserItems = [
197
196
  'commands.json',
198
197
  'pkcs11.json'
199
198
  ];
199
+ const browserUrl =
200
+ `${getChannelUrl('central')}browser/components/extensions/schemas/`;
201
+ const browserSchemas =
202
+ await getListedSchemaData(browserUrl, browserItems, info);
203
+ for (const item of browserSchemas) {
204
+ const { file, schema: itemSchema } = item;
205
+ schema[file] = itemSchema;
206
+ }
200
207
  const toolkitItems = [
201
208
  'content_scripts.json', 'experiments.json', 'extension.json', 'i18n.json',
202
209
  'management.json', 'permissions.json', 'runtime.json', 'theme.json'
203
210
  ];
204
- const browserBaseUrl =
205
- `${getChannelUrl('central')}browser/components/extensions/schemas/`;
206
- const toolkitBaseUrl =
211
+ const toolkitUrl =
207
212
  `${getChannelUrl('central')}toolkit/components/extensions/schemas/`;
208
- arr = await Promise.all([
209
- getListedSchemaData(browserBaseUrl, browserItems, info),
210
- getListedSchemaData(toolkitBaseUrl, toolkitItems, info),
211
- getMailExtSchemaData(`${channelUrl}mail/components/extensions/`, info)
212
- ]);
213
+ const toolkitSchemas =
214
+ await getListedSchemaData(toolkitUrl, toolkitItems, info);
215
+ for (const item of toolkitSchemas) {
216
+ const { file, schema: itemSchema } = item;
217
+ schema[file] = itemSchema;
218
+ }
219
+ const mailUrl = `${channelUrl}mail/components/extensions/`;
220
+ const mailSchemas = await getMailExtSchemaData(mailUrl, info);
221
+ for (const item of mailSchemas) {
222
+ const { file, schema: itemSchema } = item;
223
+ schema[file] = itemSchema;
224
+ }
213
225
  } else {
214
- arr = await Promise.all([
215
- getAllSchemaData(`${channelUrl}browser/components/extensions/schemas/`,
216
- info),
217
- getAllSchemaData(`${channelUrl}toolkit/components/extensions/schemas/`,
218
- info)
219
- ]);
220
- }
221
- for (const items of arr) {
222
- for (const item of items) {
226
+ const browserUrl = `${channelUrl}browser/components/extensions/schemas/`;
227
+ const browserSchemas = await getAllSchemaData(browserUrl, info);
228
+ for (const item of browserSchemas) {
229
+ const { file, schema: itemSchema } = item;
230
+ schema[file] = itemSchema;
231
+ }
232
+ const toolkitUrl = `${channelUrl}toolkit/components/extensions/schemas/`;
233
+ const toolkitSchemas = await getAllSchemaData(toolkitUrl, info);
234
+ for (const item of toolkitSchemas) {
223
235
  const { file, schema: itemSchema } = item;
224
236
  schema[file] = itemSchema;
225
237
  }
package/package.json CHANGED
@@ -19,44 +19,44 @@
19
19
  "types": "types/index.d.ts",
20
20
  "dependencies": {
21
21
  "camelize": "^1.0.1",
22
- "commander": "^13.1.0",
22
+ "commander": "^14.0.0",
23
23
  "decamelize": "^6.0.0",
24
24
  "json5": "^2.2.3",
25
25
  "sinon": "^20.0.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/firefox-webext-browser": "^120.0.4",
29
- "@types/node": "^22.14.0",
29
+ "@types/node": "^22.15.21",
30
30
  "@types/sinon": "^17.0.4",
31
31
  "c8": "^10.1.3",
32
- "eslint": "^9.24.0",
33
- "eslint-plugin-jsdoc": "^50.6.9",
32
+ "eslint": "^9.27.0",
33
+ "eslint-plugin-jsdoc": "^50.6.17",
34
34
  "eslint-plugin-regexp": "^2.7.0",
35
- "eslint-plugin-unicorn": "^58.0.0",
36
- "globals": "^16.0.0",
37
- "mocha": "^11.1.0",
35
+ "eslint-plugin-unicorn": "^59.0.1",
36
+ "globals": "^16.2.0",
37
+ "mocha": "^11.5.0",
38
38
  "neostandard": "^0.12.1",
39
- "npm-run-all2": "^7.0.2",
39
+ "npm-run-all2": "^8.0.4",
40
40
  "typescript": "^5.8.3",
41
- "undici": "^7.7.0"
41
+ "undici": "^7.10.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "npm run tsc && npm run lint && npm run test",
45
45
  "lint": "eslint . --fix",
46
46
  "start": "node index",
47
- "test": "npm run test-central",
48
- "test-beta": "c8 mocha --require=test/mocha/setup.js --channel=beta --exit test/*.test.js",
49
- "test-central": "c8 mocha --require=test/mocha/setup.js --channel=central --exit test/*.test.js",
50
- "test-esr": "c8 mocha --require=test/mocha/setup.js --channel=esr --exit test/*.test.js",
51
- "test-release": "c8 mocha --require=test/mocha/setup.js --channel=release --exit test/*.test.js",
52
- "test_all": "npm-run-all -s test-*",
47
+ "test": "npm run test:central",
48
+ "test:beta": "c8 mocha --require=test/mocha/setup.js --channel=beta --exit test/*.test.js",
49
+ "test:central": "c8 mocha --require=test/mocha/setup.js --channel=central --exit test/*.test.js",
50
+ "test:esr": "c8 mocha --require=test/mocha/setup.js --channel=esr --exit test/*.test.js",
51
+ "test:release": "c8 mocha --require=test/mocha/setup.js --channel=release --exit test/*.test.js",
52
+ "testall": "npm-run-all -s test:*",
53
53
  "tsc": "node index clean --dir=types -i && npx tsc",
54
54
  "update": "node index update -i",
55
- "update-beta": "node index update --channel=beta -i",
56
- "update-central": "node index update --channel=central -i",
57
- "update-esr": "node index update --channel=esr -i",
58
- "update-mail": "node index update --channel=mail -i",
59
- "update-release": "node index update --channel=release -i"
55
+ "update:beta": "node index update --channel=beta -i",
56
+ "update:central": "node index update --channel=central -i",
57
+ "update:esr": "node index update --channel=esr -i",
58
+ "update:mail": "node index update --channel=mail -i",
59
+ "update:release": "node index update --channel=release -i"
60
60
  },
61
- "version": "5.5.5"
61
+ "version": "5.6.0"
62
62
  }