Add please-upgrade-node back to CLI (#12448)
This commit is contained in:
1 parent
3c0ab7ce10
commit
3cbee742a7
6 files changed
+60
-38
No files matched your search
+10
-10
@@ -333,15 +333,15 @@ module.exports = {
|
||||
"import/no-extraneous-dependencies": "error",
|
||||
},
|
||||
},
|
||||
// TODO[@fisker]: Fix this
|
||||
// {
|
||||
// files: ["bin/prettier.js"],
|
||||
// parserOptions: {
|
||||
// ecmaVersion: 5,
|
||||
// },
|
||||
// rules: {
|
||||
// "no-var": "off",
|
||||
// },
|
||||
// },
|
||||
{
|
||||
files: ["bin/prettier.cjs"],
|
||||
parserOptions: {
|
||||
ecmaVersion: 5,
|
||||
},
|
||||
rules: {
|
||||
"no-var": "off",
|
||||
"prefer-arrow-callback": "off",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -137,28 +137,27 @@ jobs:
|
||||
NODE_ENV: production
|
||||
PRETTIER_FALLBACK_RESOLVE: true
|
||||
|
||||
# TODO[@fisker]: Fix this
|
||||
# cli:
|
||||
# name: CLI
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: [build]
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v2.4.0
|
||||
cli:
|
||||
name: CLI
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.4.0
|
||||
|
||||
# - name: Setup Node.js
|
||||
# uses: actions/setup-node@v2.5.1
|
||||
# with:
|
||||
# node-version: "0.10.48"
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2.5.1
|
||||
with:
|
||||
node-version: "0.10.48"
|
||||
|
||||
# - name: Download Artifact
|
||||
# uses: actions/download-artifact@v2
|
||||
# with:
|
||||
# name: dist
|
||||
# path: dist
|
||||
- name: Download Artifact
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
|
||||
# - name: Validate Node.js Version
|
||||
# run: node -v | grep "v0.10.48" || exit 1
|
||||
- name: Validate Node.js Version
|
||||
run: node -v | grep "v0.10.48" || exit 1
|
||||
|
||||
# - name: Run CLI on Node.js v0.10.48
|
||||
# run: node dist/bin-prettier --version 2>&1 >/dev/null | grep "prettier requires at least version 10.13.0 of Node, please upgrade" || exit 1
|
||||
- name: Run CLI on Node.js v0.10.48
|
||||
run: node dist/bin-prettier --version 2>&1 >/dev/null | grep "prettier requires at least version 12.17.0 of Node, please upgrade" || exit 1
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
var pleaseUpgradeNode = require("please-upgrade-node");
|
||||
var packageJson = require("../package.json");
|
||||
|
||||
pleaseUpgradeNode(packageJson);
|
||||
|
||||
function runCli(cli) {
|
||||
return cli.run(process.argv.slice(2));
|
||||
}
|
||||
|
||||
module.exports.promise = (function () {
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
var dynamicImport = new Function("module", "return import(module)");
|
||||
|
||||
return dynamicImport("../src/cli/index.js").then(runCli);
|
||||
}
|
||||
|
||||
var cli = require("../src/cli/index.js");
|
||||
|
||||
return runCli(cli);
|
||||
})();
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import * as cli from "../src/cli/index.js";
|
||||
// Add this file so we can use `node bin/prettier` or `node bin/prettier.js`
|
||||
// instead of `node bin/prettier.cjs`.
|
||||
|
||||
export const promise = cli.run(process.argv.slice(2));
|
||||
import "./prettier.cjs";
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "prettier",
|
||||
"version": "2.7.0-dev",
|
||||
"description": "Prettier is an opinionated code formatter",
|
||||
"bin": "./bin/prettier.js",
|
||||
"bin": "./bin/prettier.cjs",
|
||||
"repository": "prettier/prettier",
|
||||
"funding": "https://github.com/prettier/prettier?sponsor=1",
|
||||
"homepage": "https://prettier.io",
|
||||
|
||||
@@ -312,11 +312,9 @@ const coreBundles = [
|
||||
],
|
||||
},
|
||||
{
|
||||
input: "bin/prettier.js",
|
||||
input: "bin/prettier.cjs",
|
||||
output: "bin-prettier.js",
|
||||
// TODO[@fisker]: Fix this
|
||||
// esbuildTarget: ["node0.10"],
|
||||
interopDefault: false,
|
||||
esbuildTarget: ["node0.10"],
|
||||
},
|
||||
{
|
||||
input: "src/cli/index.js",
|
||||
|
||||
Reference in new issue
Block a user