Bug 1690742 - [devtools] - Remove flow plugin and stop running flow on try r=nchevobbe,bomsy

Remove references to flow in build files.
This effectively stop stipping flow from debugger modules.
So any leftover would now start being kept in production file and do an error.

Differential Revision: https://phabricator.services.mozilla.com/D105330
This commit is contained in:
Alexandre Poirot 2021-02-22 10:48:53 +00:00
parent 0eb9a9859f
commit 1d1e362316
5 changed files with 4 additions and 43 deletions

View File

@ -31,7 +31,6 @@ module.exports = {
],
],
plugins: [
"@babel/plugin-transform-flow-strip-types",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",

View File

@ -10,7 +10,6 @@
const { execFileSync } = require("child_process");
const { chdir } = require("process");
const path = require("path");
const flow = require("flow-bin");
const dbgPath = path.join(__dirname, "..");
@ -37,28 +36,6 @@ function logStart(name) {
console.log(`TEST START | ${name}`);
}
function runFlowJson() {
const { out } = execOut(flow, ["check", "--json"]);
const results = JSON.parse(out);
if (!results.passed) {
for (const error of results.errors) {
for (const message of error.message) {
console.log(`TEST-UNEXPECTED-FAIL flow | ${message.descr}`);
}
}
}
return results.passed;
}
function runFlow() {
logStart("Flow");
const { out } = execOut(flow, ["check"]);
console.log(out);
return runFlowJson();
}
function jest() {
logStart("Jest");
const { out } = execOut("yarn", ["test-ci"]);
@ -95,19 +72,16 @@ function lintMd() {
}
chdir(dbgPath);
const flowPassed = runFlow();
const jestPassed = jest();
const styleLintPassed = stylelint();
const remarkPassed = lintMd();
const success =
flowPassed &&
jestPassed &&
styleLintPassed &&
remarkPassed;
console.log({
flowPassed,
jestPassed,
styleLintPassed,
remarkPassed,

View File

@ -12,19 +12,14 @@
"homepage": "https://github.com/firefox-devtools/debugger#readme",
"engineStrict": true,
"scripts": {
"flow": "flow",
"license-check": "devtools-license-check",
"links": "ls -l node_modules/ | grep ^l || echo 'no linked packages'",
"test": "TZ=Africa/Nairobi jest",
"test-ci": "TZ=Africa/Nairobi jest --json",
"test:watch": "jest --watch",
"test:coverage": "yarn test --coverage",
"test:all": "yarn test; yarn flow",
"watch": "node bin/watch",
"flow-coverage": "flow-coverage-report --threshold 50 -i 'src/actions/*.js' -i 'src/reducers/*.js' -i 'src/utils/*.js' -i 'src/components/*.js' -i 'src/components/**/*.js' -t html -t text",
"flow-utils": "flow-coverage-report -i 'src/utils/*.js' -i 'src/utils/**/*.js' -t text",
"flow-redux": "flow-coverage-report -i 'src/reducers/*.js' -i 'src/actions/*.js' -t text",
"flow-react": "flow-coverage-report -i 'src/components/**/*.js' -t text"
"test:all": "yarn test",
"watch": "node bin/watch"
},
"dependencies": {
"codemirror": "^5.28.0",
@ -64,7 +59,6 @@
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
"@babel/plugin-transform-modules-commonjs": "^7.5.0",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
@ -82,7 +76,6 @@
"enzyme-adapter-react-16": "^1.14.0",
"enzyme-to-json": "3.3.5",
"extract-text-webpack-plugin": "^3.0.2",
"flow-bin": "0.97.0",
"immutable": "^3.8.2",
"jest": "^23.0.0",
"jest-environment-jsdom": "^23.0.0",
@ -94,4 +87,4 @@
"webpack": "^3.5.5",
"workerjs": "github:jasonLaster/workerjs#1944c8b753cc9e84b6ed0cb2fbcaa25600706446"
}
}
}

View File

@ -208,7 +208,6 @@ Babel.registerPlugin("transform-mc", transformMC);
module.exports = function(filePath) {
return [
"transform-flow-strip-types",
"proposal-optional-chaining",
"proposal-class-properties",
"transform-modules-commonjs",

View File

@ -14,11 +14,7 @@ const Babel = require("./babel");
const fs = require("fs");
const _path = require("path");
const defaultPlugins = [
"transform-flow-strip-types",
"proposal-class-properties",
"transform-react-jsx",
];
const defaultPlugins = ["proposal-class-properties", "transform-react-jsx"];
function transform(filePath) {
// Use the extra plugins only for the debugger