@naturalcycles/dev-lib 19.18.0 → 19.20.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/cfg/_cnst.js CHANGED
@@ -1,6 +1,4 @@
1
- const prettierDirs = [
2
- 'src,scripts,e2e,docs,cfg,resources,.github,public,static,components,content,layouts,pages,plugins,middleware,store,blocks',
3
- ]
1
+ const prettierDirs = ['src,scripts,e2e,docs,cfg,resources,.github,public,static']
4
2
  // ts,tsx,css,scss excluded, cause they need to run in special order (overlap between >1 tool):
5
3
  const prettierExtensionsExclusive = 'js,jsx,json,md,graphql,yml,yaml,html'
6
4
  // everything that prettier supports:
package/cfg/tsconfig.json CHANGED
@@ -58,8 +58,8 @@
58
58
  // Other
59
59
  "pretty": true,
60
60
  "newLine": "lf",
61
- "experimentalDecorators": true,
62
- },
61
+ "experimentalDecorators": true
62
+ }
63
63
  // Need to be specified in the project tsconfig
64
64
  // "include": ["src"],
65
65
  // "exclude": ["**/__exclude"]
@@ -11,7 +11,7 @@ interface EslintAllOptions {
11
11
  * Runs `eslint` command for all predefined paths (e.g /src, /scripts, etc).
12
12
  */
13
13
  export declare function eslintAll(opt?: EslintAllOptions): Promise<void>;
14
- export declare function runPrettier(): void;
14
+ export declare function runPrettier(experimentalCli?: boolean): void;
15
15
  export declare function stylelintAll(): void;
16
16
  export declare function lintStagedCommand(): Promise<void>;
17
17
  export declare function runCommitlintCommand(): void;
package/dist/lint.util.js CHANGED
@@ -144,14 +144,23 @@ const prettierPaths = [
144
144
  // Exclude
145
145
  ...lintExclude.map((s) => `!${s}`),
146
146
  ];
147
- export function runPrettier() {
147
+ export function runPrettier(experimentalCli = true) {
148
148
  const prettierConfigPath = [`./prettier.config.js`].find(f => existsSync(f));
149
149
  if (!prettierConfigPath)
150
150
  return;
151
151
  const prettierPath = findPackageBinPath('prettier', 'prettier');
152
152
  // prettier --write 'src/**/*.{js,ts,css,scss,graphql}'
153
153
  exec2.spawn(prettierPath, {
154
- args: [`--write`, `--log-level=warn`, `--config`, prettierConfigPath, ...prettierPaths],
154
+ args: [
155
+ `--write`,
156
+ `--log-level=warn`,
157
+ // '--cache-location',
158
+ // `${process.cwd()}/node_modules/.cache/prettier`,
159
+ experimentalCli && `--experimental-cli`,
160
+ experimentalCli ? '--config-path' : `--config`,
161
+ prettierConfigPath,
162
+ ...prettierPaths,
163
+ ].filter(_isTruthy),
155
164
  shell: false,
156
165
  });
157
166
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
3
  "type": "module",
4
- "version": "19.18.0",
4
+ "version": "19.20.0",
5
5
  "dependencies": {
6
6
  "@biomejs/biome": "^2",
7
7
  "@commitlint/cli": "^19",
@@ -31,7 +31,6 @@
31
31
  "@biomejs/biome": "^2",
32
32
  "eslint": "^9",
33
33
  "husky": "^9",
34
- "prettier": "^3",
35
34
  "stylelint": "^16",
36
35
  "stylelint-config-standard-scss": "^15",
37
36
  "typescript": "^5"
@@ -5,7 +5,7 @@
5
5
  "extends": "../cfg/tsconfig.json",
6
6
  "compilerOptions": {
7
7
  "rootDir": "${configDir}/..",
8
- "outDir": "${configDir}/../dist",
8
+ "outDir": "${configDir}/../dist"
9
9
  },
10
- "exclude": ["**/__exclude"],
10
+ "exclude": ["**/__exclude"]
11
11
  }