@rpcbase/cli 0.67.0 → 0.69.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/bin.js +14 -1
- package/package.json +15 -4
- package/src/lint-staged.js +17 -0
- package/src/lint.js +17 -0
- package/src/stylelint.js +25 -0
- package/stylelint/index.js +15 -0
package/bin.js
CHANGED
|
@@ -9,9 +9,12 @@ const yargs = require("yargs/yargs")
|
|
|
9
9
|
const {hideBin} = require("yargs/helpers")
|
|
10
10
|
|
|
11
11
|
const increment_pkg = require("./src/versions/increment-pkg")
|
|
12
|
+
const lint = require("./src/lint")
|
|
13
|
+
const lint_staged = require("./src/lint-staged")
|
|
12
14
|
const print_versions = require("./src/print_versions")
|
|
13
|
-
const start_command = require("./src/start_command")
|
|
14
15
|
const run_agent = require("./src/run_agent")
|
|
16
|
+
const start_command = require("./src/start_command")
|
|
17
|
+
const stylelint = require("./src/stylelint")
|
|
15
18
|
const sync_dotenv = require("./src/sync-dotenv")
|
|
16
19
|
const update = require("./src/update")
|
|
17
20
|
const wait_for = require("./src/wait-for")
|
|
@@ -40,6 +43,16 @@ yargs(hideBin(process.argv))
|
|
|
40
43
|
if (argv.version) return print_versions()
|
|
41
44
|
start_command(argv)
|
|
42
45
|
})
|
|
46
|
+
.command(["lint"], "Run eslint", (yargs) => {}, (argv) => {
|
|
47
|
+
lint(argv)
|
|
48
|
+
})
|
|
49
|
+
.command(["stylelint"], "Run stylelint", (yargs) => {}, (argv) => {
|
|
50
|
+
stylelint(argv)
|
|
51
|
+
})
|
|
52
|
+
.command(["lint-staged"], "Run lint-staged", (yargs) => {}, (argv) => {
|
|
53
|
+
lint_staged(argv)
|
|
54
|
+
})
|
|
55
|
+
// TODO: rm this
|
|
43
56
|
.command(["agent"], "Run the agent", (yargs) => {
|
|
44
57
|
// yargs
|
|
45
58
|
// .option("option1", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpcbase/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.69.0",
|
|
4
4
|
"license": "SSPL-1.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"rb": "./bin.js"
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"src/",
|
|
13
|
+
"eslint/",
|
|
14
|
+
"stylelint/",
|
|
13
15
|
"!src/**/*.test.js"
|
|
14
16
|
],
|
|
15
17
|
"scripts": {
|
|
@@ -38,16 +40,25 @@
|
|
|
38
40
|
}
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
43
|
+
"@babel/core": "7.24.9",
|
|
44
|
+
"@babel/eslint-parser": "7.25.0",
|
|
45
|
+
"@babel/plugin-syntax-flow": "7.24.7",
|
|
46
|
+
"@babel/plugin-transform-react-jsx": "7.24.7",
|
|
41
47
|
"@rpcbase/agent": "0.42.0",
|
|
42
48
|
"bluebird": "3.7.2",
|
|
43
49
|
"concurrently": "8.2.2",
|
|
44
|
-
"debug": "4.3.
|
|
50
|
+
"debug": "4.3.6",
|
|
45
51
|
"dotenv": "16.4.5",
|
|
52
|
+
"eslint": "8.57.0",
|
|
53
|
+
"lint-staged": "15.2.7",
|
|
46
54
|
"octokit": "3.1.2",
|
|
47
55
|
"parse-dotenv": "2.1.0",
|
|
48
|
-
"picocolors": "1.0.
|
|
56
|
+
"picocolors": "1.0.1",
|
|
49
57
|
"semver": "7.6.0",
|
|
50
|
-
"
|
|
58
|
+
"stylelint": "16.7.0",
|
|
59
|
+
"stylelint-config-standard": "36.0.0",
|
|
60
|
+
"stylelint-config-standard-scss": "13.1.0",
|
|
61
|
+
"validator": "13.12.0",
|
|
51
62
|
"yargs": "17.7.2"
|
|
52
63
|
},
|
|
53
64
|
"devDependencies": {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const path = require("path")
|
|
2
|
+
const {spawn} = require("child_process")
|
|
3
|
+
|
|
4
|
+
const {hideBin} = require("yargs/helpers")
|
|
5
|
+
|
|
6
|
+
module.exports = () => {
|
|
7
|
+
const args = hideBin(process.argv).slice(1) // remove first arg
|
|
8
|
+
|
|
9
|
+
const package_dir = path.dirname(require.resolve("lint-staged/package.json"))
|
|
10
|
+
const bin_path = path.join(package_dir, "./bin/lint-staged.js")
|
|
11
|
+
|
|
12
|
+
const ps = spawn(bin_path, args, { stdio: "inherit" })
|
|
13
|
+
|
|
14
|
+
ps.on("close", (code) => {
|
|
15
|
+
process.exit(code)
|
|
16
|
+
})
|
|
17
|
+
}
|
package/src/lint.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const path = require("path")
|
|
2
|
+
const {spawn} = require("child_process")
|
|
3
|
+
|
|
4
|
+
const {hideBin} = require("yargs/helpers")
|
|
5
|
+
|
|
6
|
+
module.exports = () => {
|
|
7
|
+
const args = hideBin(process.argv).slice(1) //remove first arg (our rb command 'lint')
|
|
8
|
+
|
|
9
|
+
const eslint_path = path.dirname(require.resolve("eslint/package.json"))
|
|
10
|
+
const bin_path = path.join(eslint_path, "./bin/eslint.js")
|
|
11
|
+
|
|
12
|
+
const ps = spawn(bin_path, args, { stdio: "inherit" })
|
|
13
|
+
|
|
14
|
+
ps.on("close", (code) => {
|
|
15
|
+
process.exit(code)
|
|
16
|
+
})
|
|
17
|
+
}
|
package/src/stylelint.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const path = require("path")
|
|
2
|
+
const fs = require("fs")
|
|
3
|
+
const {spawn} = require("child_process")
|
|
4
|
+
|
|
5
|
+
const {hideBin} = require("yargs/helpers")
|
|
6
|
+
|
|
7
|
+
module.exports = () => {
|
|
8
|
+
const args = hideBin(process.argv).slice(1) //remove first arg
|
|
9
|
+
|
|
10
|
+
const config_path = path.join(process.cwd(), "./.stylelintrc.js")
|
|
11
|
+
const has_config = fs.existsSync(config_path)
|
|
12
|
+
|
|
13
|
+
if (!has_config) {
|
|
14
|
+
throw new Error("cannot find .stylelintrc.js config file")
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const stylelint_path = path.dirname(require.resolve("stylelint/package.json"))
|
|
18
|
+
const bin_path = path.join(stylelint_path, "./bin/stylelint.mjs")
|
|
19
|
+
|
|
20
|
+
const ps = spawn(bin_path, ["--config", config_path, ...args], { stdio: "inherit" })
|
|
21
|
+
|
|
22
|
+
ps.on("close", (code) => {
|
|
23
|
+
process.exit(code)
|
|
24
|
+
})
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"extends": [
|
|
3
|
+
"stylelint-config-standard-scss"
|
|
4
|
+
],
|
|
5
|
+
"rules": {
|
|
6
|
+
"color-named": ["never", {severity: "warning"}],
|
|
7
|
+
"color-no-hex": [true, {severity: "warning"}],
|
|
8
|
+
"declaration-block-no-redundant-longhand-properties": null,
|
|
9
|
+
"declaration-empty-line-before": null,
|
|
10
|
+
"no-descending-specificity": [true, {severity: "warning"}],
|
|
11
|
+
"scss/comment-no-empty": null,
|
|
12
|
+
"scss/no-global-function-names": [true, {severity: "warning"}],
|
|
13
|
+
"selector-class-pattern": null,
|
|
14
|
+
}
|
|
15
|
+
}
|