@toptal/davinci-syntax 20.0.3 → 20.0.4-alpha-test-rome-8a5bb56e.5

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{print as t,runSync as e,loadCommands as o,bootstrap as n}from"@toptal/davinci-cli-shared";import i from"path";const a=(o,n)=>{t.header("Running code checks");const{check:i,ext:a,color:r}=n;e("eslint",[`--ext=${a}`,`--color=${r}`,!i&&"--fix",...o].filter(Boolean))},r=o=>{t.header("Running styles checks",o);const n=i.extname(o);e("yarn",["stylelint","--allow-empty-input",n?o:`${o}/**/styles.(js|jsx|ts|tsx)`].filter(Boolean))},s=async e=>{const{default:o}=await import("@toptal/davinci-dir-lint");t.header("Running dirs check");const n=o(e).filter(t=>Boolean(null==t?void 0:t.error));n.length>0&&(t.red("Dirs check failed."),t.red("Report:"),n.forEach(e=>{t.red(`${e.error}`)}),process.exit(1)),t.success("Done!")};o([t=>t.createCommand("lint").addCommand((t=>t.createCommand("code").allowUnknownOption().description("Lint the code").argument("[paths...]","List of test pathnames",[]).option("--check","Check only, without fixing the code",!1).option("--ext <extensions>","File extensions",".js,.jsx,.ts,.tsx").option("--color","enable colorized output",!0).option("--no-color","disable colorized output",!1).action(a))(t)).addCommand((t=>t.createCommand("styles").description("Lint styles").argument("<dir>","Directory to validate").action(r))(t)).addCommand((t=>t.createCommand("dirs").description("Lint the folder structure and naming").argument("[paths...]","Directories to validate",[]).action(s))(t))],"davinci-syntax"),n();
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ var e=require("@toptal/davinci-cli-shared");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var o=/*#__PURE__*/t(require("path"));const r=(t,n)=>{e.print.header("Running code checks");const{check:o,ext:r,color:i}=n;e.runSync("eslint",[`--ext=${r}`,`--color=${i}`,!o&&"--fix",...t].filter(Boolean))},i=t=>{e.print.header("Running styles checks",t);const n=o.default.extname(t);e.runSync("yarn",["stylelint","--allow-empty-input",n?t:`${t}/**/styles.(js|jsx|ts|tsx)`].filter(Boolean))},a=async t=>{const{default:o}=await Promise.resolve().then(function(){/*#__PURE__*/return n(require("@toptal/davinci-dir-lint"))});e.print.header("Running dirs check");const r=o(t).filter(e=>Boolean(null==e?void 0:e.error));r.length>0&&(e.print.red("Dirs check failed."),e.print.red("Report:"),r.forEach(t=>{e.print.red(`${t.error}`)}),process.exit(1)),e.print.success("Done!")},c=e=>e.createCommand("lint").addCommand((e=>e.createCommand("code").allowUnknownOption().description("Lint the code").argument("[paths...]","List of test pathnames",[]).option("--check","Check only, without fixing the code",!1).option("--ext <extensions>","File extensions",".js,.jsx,.ts,.tsx").option("--color","enable colorized output",!0).option("--no-color","disable colorized output",!1).action(r))(e)).addCommand((e=>e.createCommand("styles").description("Lint styles").argument("<dir>","Directory to validate").action(i))(e)).addCommand((e=>e.createCommand("dirs").description("Lint the folder structure and naming").argument("[paths...]","Directories to validate",[]).action(a))(e));exports.default={lintCommandFactory:c},exports.lintCommandFactory=c;
@@ -0,0 +1 @@
1
+ import{print as t,runSync as e}from"@toptal/davinci-cli-shared";import o from"path";const n=(o,n)=>{t.header("Running code checks");const{check:i,ext:a,color:r}=n;e("eslint",[`--ext=${a}`,`--color=${r}`,!i&&"--fix",...o].filter(Boolean))},i=n=>{t.header("Running styles checks",n);const i=o.extname(n);e("yarn",["stylelint","--allow-empty-input",i?n:`${n}/**/styles.(js|jsx|ts|tsx)`].filter(Boolean))},a=async e=>{const{default:o}=await import("@toptal/davinci-dir-lint");t.header("Running dirs check");const n=o(e).filter(t=>Boolean(null==t?void 0:t.error));n.length>0&&(t.red("Dirs check failed."),t.red("Report:"),n.forEach(e=>{t.red(`${e.error}`)}),process.exit(1)),t.success("Done!")},r=t=>t.createCommand("lint").addCommand((t=>t.createCommand("code").allowUnknownOption().description("Lint the code").argument("[paths...]","List of test pathnames",[]).option("--check","Check only, without fixing the code",!1).option("--ext <extensions>","File extensions",".js,.jsx,.ts,.tsx").option("--color","enable colorized output",!0).option("--no-color","disable colorized output",!1).action(n))(t)).addCommand((t=>t.createCommand("styles").description("Lint styles").argument("<dir>","Directory to validate").action(i))(t)).addCommand((t=>t.createCommand("dirs").description("Lint the folder structure and naming").argument("[paths...]","Directories to validate",[]).action(a))(t));var s={lintCommandFactory:r};export{s as default,r as lintCommandFactory};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-syntax",
3
- "version": "20.0.3",
3
+ "version": "20.0.4-alpha-test-rome-8a5bb56e.5+8a5bb56e",
4
4
  "description": "Lint and prettier support",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -12,25 +12,35 @@
12
12
  "homepage": "https://github.com/toptal/davinci/tree/master/packages/syntax#readme",
13
13
  "license": "ISC",
14
14
  "type": "module",
15
+ "source": "src/index.js",
16
+ "main": "dist/index.cjs.cjs",
17
+ "module": "dist/index.esm.js",
15
18
  "exports": {
16
- ".": "./src/index.js",
17
- "./src/configs/.prettierrc.cjs": "./src/configs/.prettierrc.cjs",
18
- "./src/configs/.eslintrc.cjs": "./src/configs/.eslintrc.cjs"
19
+ ".": {
20
+ "import": "./dist/index.esm.js",
21
+ "require": "./dist/index.cjs.cjs"
22
+ },
23
+ "./src/configs/.prettierrc.cjs": "./dist/configs/.prettierrc.cjs",
24
+ "./src/configs/.eslintrc.cjs": "./dist/configs/.eslintrc.cjs"
19
25
  },
20
26
  "files": [
21
- "src",
27
+ "dist",
22
28
  "bin",
23
29
  "docs",
24
30
  "CHANGELOG.md"
25
31
  ],
26
32
  "bin": {
27
- "davinci-syntax": "bin/davinci-syntax.js"
33
+ "davinci-syntax": "dist/bin.esm.js"
28
34
  },
29
35
  "repository": {
30
36
  "type": "git",
31
37
  "url": "git+https://github.com/toptal/davinci.git"
32
38
  },
33
39
  "scripts": {
40
+ "build:package": "yarn build:package:configs & yarn build:package:bin & yarn build:package:export",
41
+ "build:package:export": "microbundle -f esm,cjs --raw --no-generateTypes --compress --target node --no-sourcemap",
42
+ "build:package:configs": "microbundle ./src/configs/{.prettierrc,.eslintrc}.cjs -f cjs --raw --no-generateTypes --compress --target node --no-sourcemap",
43
+ "build:package:bin": "microbundle ./src/bin.js -o ./dist/bin.js -f modern --raw --no-generateTypes --compress --target node --no-sourcemap",
34
44
  "lint:path": "eslint --ext=.js,.jsx,.ts,.tsx --color --fix",
35
45
  "lint": "yarn run lint:path .",
36
46
  "test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' yarn jest"
@@ -40,9 +50,9 @@
40
50
  },
41
51
  "dependencies": {
42
52
  "@stylelint/postcss-css-in-js": "^0.38.0",
43
- "@toptal/davinci-cli-shared": "2.2.3",
44
- "@toptal/davinci-dir-lint": "^1.0.0",
45
- "@toptal/eslint-plugin-davinci": "5.4.2",
53
+ "@toptal/davinci-cli-shared": "2.2.4-alpha-test-rome-8a5bb56e.5+8a5bb56e",
54
+ "@toptal/davinci-dir-lint": "1.0.1-alpha-test-rome-8a5bb56e.75+8a5bb56e",
55
+ "@toptal/eslint-plugin-davinci": "5.4.3-alpha-test-rome-8a5bb56e.120+8a5bb56e",
46
56
  "@typescript-eslint/eslint-plugin": "^5.38.0",
47
57
  "@typescript-eslint/parser": "^5.42.1",
48
58
  "eslint": "^8.34.0",
@@ -71,10 +81,12 @@
71
81
  "stylelint-processor-styled-components": "^1.10.0"
72
82
  },
73
83
  "devDependencies": {
84
+ "@jest/globals": "^29.4.2",
74
85
  "json5": "^2.2.3",
75
- "@jest/globals": "^29.4.2"
86
+ "microbundle": "0.15.1"
76
87
  },
77
88
  "peerDependencies": {
78
89
  "typescript": "^4"
79
- }
90
+ },
91
+ "gitHead": "8a5bb56ec93d9869b07981680b9c3335df876443"
80
92
  }
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import cliEngine from '@toptal/davinci-cli-shared'
3
-
4
- import { lintCommandFactory } from '../src/index.js'
5
-
6
- cliEngine.loadCommands([lintCommandFactory], 'davinci-syntax')
7
- cliEngine.bootstrap()