Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mdn-confluence

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdn-confluence - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

lib/CompatConfluenceJsonGenerator.es6.js

151

main/generate.es6.js

@@ -10,84 +10,81 @@ // Copyright 2017 The Chromium Authors. All rights reserved.

const {
CompatConfluenceJsonGenerator,
} = require('../lib/CompatConfluenceJsonGenerator.es6.js');
const argv = require('yargs')
.help('help').alias('help', 'h')
.option('fill-only', {
type: 'boolean',
alias: 'fo',
desc: `Whether or not to only add missing version information`,
default: false,
})
.option('remove', {
type: 'boolean',
alias: 'rm',
desc: `Whether or not to remove supported versions based on absence of support in Confluence`,
default: false,
})
.option('interfaces', {
alias: 'i',
desc: `Comma-separated list of interfaces to generate JSON for; omit to include all interfaces`,
default: '',
coerce: iStr => iStr.split(',').filter(str => !!str),
})
.option('browsers', {
alias: 'b',
desc: `Comma-separated list of browser names to generate JSON for; omit to include all browsers`,
default: '',
coerce: bStr => bStr.split(',').filter(str => !!str).map(str => str.toLowerCase()),
})
.option('confluence-release-url', {
alias: 'cru',
desc: `Absolute https: or file: URL to JSON for Confluence release metadata for GridRows`,
default: `https://storage.googleapis.com/web-api-confluence-data-cache/latest/json/org.chromium.apis.web.Release.json`,
coerce: cru => {
if (!/^(https|file):[/][/]/i.test(cru)) {
throw new Error('Invalid confluence-release-url: ${cru}');
}
return cru;
},
})
.option('confluence-data-url', {
alias: 'cdu',
desc: `Absolute https: or file: URL to JSON for Confluence GridRows`,
default: `https://storage.googleapis.com/web-api-confluence-data-cache/latest/json/org.chromium.apis.web.GridRow.json`,
coerce: cdu => {
if (!/^(https|file):[/][/]/i.test(cdu)) {
throw new Error('Invalid confluence-data-url: ${cdu}');
}
return cdu;
},
})
.option('output-dir', {
alias: 'od',
desc: `Directory where modified browser-compat-data JSON files will be stored`,
default: path.resolve(`${__dirname}/../data/browser-compat-data`),
coerce: od => {
if (!fs.existsSync(od)) {
throw new Error(`Output directory "${od}" does not exist`);
}
return path.resolve(od);
},
})
.option('bcd-module', {
alias: 'bm',
desc: `Custom path to browser-compat-data module`,
default: 'mdn-browser-compat-data',
})
.argv;
.help('help')
.alias('help', 'h')
.option('fill-only', {
type: 'boolean',
alias: 'fo',
desc: `Whether or not to only add missing version information`,
default: false,
})
.option('remove', {
type: 'boolean',
alias: 'rm',
desc: `Whether or not to remove supported versions based on absence of support in Confluence`,
default: false,
})
.option('interfaces', {
alias: 'i',
desc: `Comma-separated list of interfaces to generate JSON for; omit to include all interfaces`,
default: '',
coerce: (iStr) => iStr.split(',').filter((str) => !!str),
})
.option('browsers', {
alias: 'b',
desc: `Comma-separated list of browser names to generate JSON for; omit to include all browsers`,
default: '',
coerce: (bStr) =>
bStr
.split(',')
.filter((str) => !!str)
.map((str) => str.toLowerCase()),
})
.option('confluence-release-url', {
alias: 'cru',
desc: `Absolute https: or file: URL to JSON for Confluence release metadata for GridRows`,
default: `https://storage.googleapis.com/web-api-confluence-data-cache/latest/json/org.chromium.apis.web.Release.json`,
coerce: (cru) => {
if (!/^(https|file):[/][/]/i.test(cru)) {
throw new Error('Invalid confluence-release-url: ${cru}');
}
return cru;
},
})
.option('confluence-data-url', {
alias: 'cdu',
desc: `Absolute https: or file: URL to JSON for Confluence GridRows`,
default: `https://storage.googleapis.com/web-api-confluence-data-cache/latest/json/org.chromium.apis.web.GridRow.json`,
coerce: (cdu) => {
if (!/^(https|file):[/][/]/i.test(cdu)) {
throw new Error('Invalid confluence-data-url: ${cdu}');
}
return cdu;
},
})
.option('output-dir', {
alias: 'od',
desc: `Directory where modified browser-compat-data JSON files will be stored`,
default: path.resolve(`${__dirname}/../data/browser-compat-data`),
coerce: (od) => {
if (!fs.existsSync(od)) {
throw new Error(`Output directory "${od}" does not exist`);
}
return path.resolve(od);
},
})
.option('bcd-module', {
alias: 'bm',
desc: `Custom path to browser-compat-data module`,
default: 'mdn-browser-compat-data',
}).argv;
require('../boot.es6.js');
const generator = new CompatConfluenceJsonGenerator(argv);
(async function() {
await mdn.CompatConfluenceJsonGenerator.create({
bcdModule: argv.bcdModule,
confluenceReleaseUrl: argv.confluenceReleaseUrl,
confluenceDataUrl: argv.confluenceDataUrl,
fillOnly: argv.fillOnly,
remove: argv.remove,
outputDir: argv.outputDir,
interfaces: argv.interfaces,
browsers: argv.browsers,
}).generateJson();
})().catch(error => {
generator.generateJson().catch((error) => {
console.error(error);
process.exit(1);
});
{
"name": "mdn-confluence",
"version": "2.1.1",
"version": "2.1.2",
"description": "User support tool for maintaining MDN compatibility data using Web API Confluence data.",
"scripts": {
"generate": "node ./main/generate.es6.js"
"generate": "node ./main/generate.es6.js",
"lint": "eslint .",
"lint-fix": "eslint --fix ."
},
"author": "Mark Dittmer",
"contributors": [
"Philip Jägenstedt"
],
"dependencies": {
"compare-versions": "^3.6.0",
"foam2": "git://github.com/foam-framework/foam2.git#mdn-confluence",
"yargs": "^15.4.1"
},
"devDependencies": {
"eslint": "^7.8.1",
"eslint-config-google": "^0.14.0"
},
"eslintConfig": {
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"google"
],
"parserOptions": {
"ecmaVersion": 2017
},
"rules": {
"curly": [
"error",
"all"
],
"max-len": [
"error",
{
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreUrls": true
}
],
"require-jsdoc": "off"
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc