@baic/yolk-cli 2.1.0-alpha.234 → 2.1.0-alpha.235

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/es/_util.js CHANGED
@@ -10,12 +10,12 @@ var m = /* @__PURE__ */ ((t) => typeof require < "u" ? require : typeof Proxy <
10
10
  import { spawn as k } from "node:child_process";
11
11
  import r from "node:fs";
12
12
  import a from "node:path";
13
+ import c from "chalk";
14
+ import { globSync as x } from "glob";
13
15
  import {
14
16
  rimrafSync as u,
15
17
  windowsSync as d
16
- } from "@baic/yolk-prebundle/compiled/rimraf";
17
- import c from "chalk";
18
- import { globSync as x } from "glob";
18
+ } from "rimraf";
19
19
  import { program as h } from "../compiled/commander";
20
20
  var i = process.cwd(), l = console, p = "utf-8", C = (t) => t && l.log(c.yellow("warn -"), t), P = (t) => t && l.log(c.red("error -"), t), j = (t) => t && l.log(c.green("ready -"), t), _ = (t) => t && l.log(c.blue("info -"), t), S = () => process.platform === "win32", N = (t) => S() ? `${t}.cmd` : t, $ = (t) => S() ? d(t) : u(t), b = () => {
21
21
  j("yolk complete!"), process.exit(0);
@@ -0,0 +1,61 @@
1
+ var i = /* @__PURE__ */ ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, {
2
+ get: (e, p) => (typeof require < "u" ? require : e)[p]
3
+ }) : t)(function(t) {
4
+ if (typeof require < "u")
5
+ return require.apply(this, arguments);
6
+ throw new Error('Dynamic require of "' + t + '" is not supported');
7
+ });
8
+ var u = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
9
+
10
+ // src/lintstagedrc.js
11
+ var b = u((P, h) => {
12
+ var { join: n } = i("node:path"), {
13
+ getYolkConfig: m,
14
+ getEsLintConfigPath: f,
15
+ getStyleLintConfigPath: $,
16
+ getPrettierConfigPath: d,
17
+ getBiomeConfigPath: y
18
+ } = i("./_util"), l = [
19
+ "**/node_modules/**",
20
+ "**/build/**",
21
+ "**/dist/**",
22
+ "**/lib/**",
23
+ "**/es/**",
24
+ "**/mock/**",
25
+ "**/test/**",
26
+ "**/public/**",
27
+ "**/assets/**",
28
+ "**/.umi/**",
29
+ "**/.umi-production/**",
30
+ "**/h5+app/**",
31
+ "**/*uni*/**",
32
+ "**/android/**",
33
+ "**/ios/**",
34
+ "**/*.ignore/**"
35
+ ], j = m(), g = j.strict !== !1, c = n(process.cwd(), "node_modules", ".cache"), s = `prettier --write --cache --cache-strategy=content --cache-location=${n(
36
+ c,
37
+ ".prettiercache"
38
+ )} --config ${d()} --no-error-on-unmatched-pattern`, r = `eslint --fix ${g ? "--no-inline-config" : ""} --no-error-on-unmatched-pattern --cache --cache-strategy=content --cache-location=${n(
39
+ c,
40
+ ".eslintcache"
41
+ )} --config ${f()} ${l.map((t) => `--ignore-pattern ${t}`).join(" ")}`, o = `stylelint --fix ${g ? "--ignore-disables" : ""} --allow-empty-input --cache --cache-strategy=content --cache-location=${n(
42
+ c,
43
+ ".stylelintcache"
44
+ )} --config ${$()} ${l.map((t) => `--ignore-pattern ${t}`).join(" ")}`, C = `biome check --write --unsafe --no-errors-on-unmatched --log-level=error --files-ignore-unknown=true --config-path=${y()}`, a = {
45
+ "*.{md,json,jsonc}": [s],
46
+ // '*.{png,jpeg,jpg,gif,svg}': ['imagemin-lint-staged'],
47
+ "*.css": [s, `${o} --custom-syntax postcss`],
48
+ "*.less": [s, `${o} --custom-syntax postcss-less`],
49
+ "*.{sass,scss}": [
50
+ s,
51
+ `${o} --custom-syntax postcss-scss`
52
+ ],
53
+ "*.{js,jsx,cjs,mjs}": [s, r],
54
+ "*.{ts,tsx,cts,mts}": [`${s} --parser=typescript`, r]
55
+ }, x = {
56
+ ...a,
57
+ [`!(${Object.keys(a).join("|")})`]: [C]
58
+ };
59
+ h.exports = x;
60
+ });
61
+ export default b();
package/es/yolk.js CHANGED
@@ -223,7 +223,7 @@ var d = process.cwd(), S = "##### CREATED BY YOLK #####", z = (e, o, t) => {
223
223
  let e = pe(), o = e.strict !== !1, t = e.eslintIgnore, i = e.stylelintIgnore;
224
224
  w("统一代码规范,进行严格的语法检查。"), o && (w("git commit 禁止 lint 的 ignore 行为"), i && w(`通过 .yolkrc 配置 stylelintIgnore: ${i}。`), t && w(`通过 .yolkrc 配置 eslintIgnore: ${t}。`)), n({
225
225
  command: "lint-staged",
226
- args: ["-c", C.resolve("./.lintstagedrc")]
226
+ args: ["-c", C.resolve("./lintstagedrc")]
227
227
  });
228
228
  }, V = ({
229
229
  mAppid: e,
package/lib/_util.js CHANGED
@@ -43,7 +43,7 @@ R(A, {
43
43
  warn: () => C
44
44
  });
45
45
  module.exports = L(A);
46
- var d = require("node:child_process"), s = m(require("node:fs")), a = m(require("node:path")), p = require("@baic/yolk-prebundle/compiled/rimraf"), c = m(require("chalk")), x = require("glob"), h = require("../compiled/commander"), i = process.cwd(), f = console, y = "utf-8", C = (t) => t && f.log(c.default.yellow("warn -"), t), P = (t) => t && f.log(c.default.red("error -"), t), j = (t) => t && f.log(c.default.green("ready -"), t), Y = (t) => t && f.log(c.default.blue("info -"), t), N = () => process.platform === "win32", _ = (t) => N() ? `${t}.cmd` : t, $ = (t) => N() ? (0, p.windowsSync)(t) : (0, p.rimrafSync)(t), b = () => {
46
+ var d = require("node:child_process"), s = m(require("node:fs")), a = m(require("node:path")), c = m(require("chalk")), x = require("glob"), p = require("rimraf"), h = require("../compiled/commander"), i = process.cwd(), f = console, y = "utf-8", C = (t) => t && f.log(c.default.yellow("warn -"), t), P = (t) => t && f.log(c.default.red("error -"), t), j = (t) => t && f.log(c.default.green("ready -"), t), Y = (t) => t && f.log(c.default.blue("info -"), t), N = () => process.platform === "win32", _ = (t) => N() ? `${t}.cmd` : t, $ = (t) => N() ? (0, p.windowsSync)(t) : (0, p.rimrafSync)(t), b = () => {
47
47
  j("yolk complete!"), process.exit(0);
48
48
  }, w = () => {
49
49
  C("yolk break!"), process.exit(0);
@@ -0,0 +1,49 @@
1
+ // src/lintstagedrc.js
2
+ var { join: e } = require("node:path"), {
3
+ getYolkConfig: l,
4
+ getEsLintConfigPath: g,
5
+ getStyleLintConfigPath: h,
6
+ getPrettierConfigPath: p,
7
+ getBiomeConfigPath: u
8
+ } = require("./_util"), r = [
9
+ "**/node_modules/**",
10
+ "**/build/**",
11
+ "**/dist/**",
12
+ "**/lib/**",
13
+ "**/es/**",
14
+ "**/mock/**",
15
+ "**/test/**",
16
+ "**/public/**",
17
+ "**/assets/**",
18
+ "**/.umi/**",
19
+ "**/.umi-production/**",
20
+ "**/h5+app/**",
21
+ "**/*uni*/**",
22
+ "**/android/**",
23
+ "**/ios/**",
24
+ "**/*.ignore/**"
25
+ ], m = l(), a = m.strict !== !1, o = e(process.cwd(), "node_modules", ".cache"), t = `prettier --write --cache --cache-strategy=content --cache-location=${e(
26
+ o,
27
+ ".prettiercache"
28
+ )} --config ${p()} --no-error-on-unmatched-pattern`, c = `eslint --fix ${a ? "--no-inline-config" : ""} --no-error-on-unmatched-pattern --cache --cache-strategy=content --cache-location=${e(
29
+ o,
30
+ ".eslintcache"
31
+ )} --config ${g()} ${r.map((s) => `--ignore-pattern ${s}`).join(" ")}`, n = `stylelint --fix ${a ? "--ignore-disables" : ""} --allow-empty-input --cache --cache-strategy=content --cache-location=${e(
32
+ o,
33
+ ".stylelintcache"
34
+ )} --config ${h()} ${r.map((s) => `--ignore-pattern ${s}`).join(" ")}`, f = `biome check --write --unsafe --no-errors-on-unmatched --log-level=error --files-ignore-unknown=true --config-path=${u()}`, i = {
35
+ "*.{md,json,jsonc}": [t],
36
+ // '*.{png,jpeg,jpg,gif,svg}': ['imagemin-lint-staged'],
37
+ "*.css": [t, `${n} --custom-syntax postcss`],
38
+ "*.less": [t, `${n} --custom-syntax postcss-less`],
39
+ "*.{sass,scss}": [
40
+ t,
41
+ `${n} --custom-syntax postcss-scss`
42
+ ],
43
+ "*.{js,jsx,cjs,mjs}": [t, c],
44
+ "*.{ts,tsx,cts,mts}": [`${t} --parser=typescript`, c]
45
+ }, $ = {
46
+ ...i,
47
+ [`!(${Object.keys(i).join("|")})`]: [f]
48
+ };
49
+ module.exports = $;
package/lib/yolk.js CHANGED
@@ -202,7 +202,7 @@ var E = require("node:child_process"), n = require("node:fs"), $ = h(require("no
202
202
  let t = (0, e.getYolkConfig)(), i = t.strict !== !1, o = t.eslintIgnore, s = t.stylelintIgnore;
203
203
  (0, e.warn)("统一代码规范,进行严格的语法检查。"), i && ((0, e.warn)("git commit 禁止 lint 的 ignore 行为"), s && (0, e.warn)(`通过 .yolkrc 配置 stylelintIgnore: ${s}。`), o && (0, e.warn)(`通过 .yolkrc 配置 eslintIgnore: ${o}。`)), (0, e.execCommand)({
204
204
  command: "lint-staged",
205
- args: ["-c", require.resolve("./.lintstagedrc")]
205
+ args: ["-c", require.resolve("./lintstagedrc")]
206
206
  });
207
207
  }, F = ({
208
208
  mAppid: t,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baic/yolk-cli",
3
- "version": "2.1.0-alpha.234",
3
+ "version": "2.1.0-alpha.235",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/303394539/yolk.git"
@@ -25,11 +25,11 @@
25
25
  "prebundle": "father prebundle"
26
26
  },
27
27
  "dependencies": {
28
- "@baic/biome-config-yolk": "^2.1.0-alpha.234",
29
- "@baic/eslint-config-yolk": "^2.1.0-alpha.234",
30
- "@baic/prettier-config-yolk": "^2.1.0-alpha.234",
31
- "@baic/stylelint-config-yolk": "^2.1.0-alpha.234",
32
- "@baic/yolk-prebundle": "^2.1.0-alpha.234",
28
+ "@baic/biome-config-yolk": "^2.1.0-alpha.235",
29
+ "@baic/eslint-config-yolk": "^2.1.0-alpha.235",
30
+ "@baic/prettier-config-yolk": "^2.1.0-alpha.235",
31
+ "@baic/stylelint-config-yolk": "^2.1.0-alpha.235",
32
+ "@baic/yolk-prebundle": "^2.1.0-alpha.235",
33
33
  "@biomejs/biome": "1.8.x",
34
34
  "@democrance/imagemin-lint-staged": "2.x",
35
35
  "@types/inquirer": "8.x",
@@ -48,6 +48,7 @@
48
48
  "postcss-less": "6.0.x",
49
49
  "postcss-scss": "4.0.x",
50
50
  "prettier": "2.x",
51
+ "rimraf": "5.0.x",
51
52
  "stylelint": "14.x",
52
53
  "tsx": "3.x"
53
54
  },
@@ -63,5 +64,5 @@
63
64
  "publishConfig": {
64
65
  "access": "public"
65
66
  },
66
- "gitHead": "d9c36105d61a48a677c0b56910f415244e292a2a"
67
+ "gitHead": "400820e1ecfd4c3bb42eb289b334bba92b2ce8ca"
67
68
  }