@naturalcycles/dev-lib 15.22.0 → 15.23.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,6 @@
1
1
  module.exports = {
2
2
  prettierDirs: [
3
- 'src,scripts,e2e,playwright,docs,cfg,resources,.github,public,static,components,content,layouts,pages,plugins,middleware,store,blocks',
3
+ 'src,scripts,e2e,docs,cfg,resources,.github,public,static,components,content,layouts,pages,plugins,middleware,store,blocks',
4
4
  ],
5
5
  // ts,tsx,css,scss excluded, cause they need to run in special order (overlap between >1 tool):
6
6
  prettierExtensionsExclusive: 'js,jsx,json,md,graphql,yml,yaml,html',
@@ -179,29 +179,6 @@ if (fs.existsSync(`./e2e`)) {
179
179
  })
180
180
  }
181
181
 
182
- // /playwright
183
- if (fs.existsSync(`./playwright`)) {
184
- const eslintConfigPathE2e = ['./playwright/eslint.config.js', './eslint.config.js'].find(p =>
185
- fs.existsSync(p),
186
- )
187
-
188
- Object.assign(linters, {
189
- // biome, eslint, Prettier
190
- './playwright/**/*.{ts,tsx}': match => {
191
- const filesList = getFilesList(match)
192
- if (!filesList) return []
193
- return [
194
- biomeCmd,
195
- eslintConfigPathE2e &&
196
- `${eslintCmd} --config ${eslintConfigPathE2e} --parser-options=project:./playwright/tsconfig.json`,
197
- prettierCmd,
198
- ]
199
- .filter(Boolean)
200
- .map(s => `${s} ${filesList}`)
201
- },
202
- })
203
- }
204
-
205
182
  function getFilesList(match) {
206
183
  return micromatch.not(match, lintExclude).join(' ')
207
184
  }
@@ -15,7 +15,7 @@ const commands = [
15
15
  {
16
16
  name: 'tsc',
17
17
  fn: tscAll,
18
- desc: 'Run tsc in folders (src, scripts, e2e, playwright) if there is tsconfig.json present',
18
+ desc: 'Run tsc in folders (src, scripts, e2e) if there is tsconfig.json present',
19
19
  },
20
20
  { name: 'bt', fn: bt, desc: 'Build & Test: run "tsc" and then "test".' },
21
21
  { name: 'lbt', fn: lbt, desc: 'Lint/Build/Test: run "lint", then "tsc", then "test".' },
@@ -139,8 +139,7 @@ async function bt() {
139
139
  (0, test_util_1.runJest)();
140
140
  }
141
141
  async function tscAll() {
142
- // todo: remove playwright after it fully moves to e2e
143
- await (0, build_util_1.runTSCInFolders)(['.', 'scripts', 'e2e', 'playwright'], ['--noEmit']);
142
+ await (0, build_util_1.runTSCInFolders)(['.', 'scripts', 'e2e'], ['--noEmit']);
144
143
  }
145
144
  function logEnvironment() {
146
145
  const { platform, arch, versions: { node }, env: { CPU_LIMIT, NODE_OPTIONS = 'not defined' }, } = process;
package/dist/lint.util.js CHANGED
@@ -100,10 +100,8 @@ async function eslintAll(opt) {
100
100
  './eslint.config.js',
101
101
  './eslint.config.cjs',
102
102
  ].find(p => node_fs_1.default.existsSync(p));
103
- const eslintConfigPathPlaywright = ['./playwright/eslint.config.js', './eslint.config.js'].find(p => node_fs_1.default.existsSync(p));
104
103
  const tsconfigPathScripts = [`./scripts/tsconfig.json`].find(p => node_fs_1.default.existsSync(p)) || `${paths_1.scriptsDir}/tsconfig.json`;
105
104
  const tsconfigPathE2e = `./e2e/tsconfig.json`;
106
- const tsconfigPathPlaywright = `./playwright/tsconfig.json`;
107
105
  // todo: run on other dirs too, e.g pages, components, layouts
108
106
  if (fix) {
109
107
  await Promise.all([
@@ -113,8 +111,6 @@ async function eslintAll(opt) {
113
111
  runESLint(`./scripts`, eslintConfigPathScripts, tsconfigPathScripts, extensions, fix),
114
112
  // /e2e
115
113
  runESLint(`./e2e`, eslintConfigPathE2e, tsconfigPathE2e, extensions, fix),
116
- // /playwright // todo: remove after migration to e2e folder is completed
117
- runESLint(`./playwright`, eslintConfigPathPlaywright, tsconfigPathPlaywright, extensions, fix),
118
114
  ]);
119
115
  }
120
116
  else {
@@ -125,8 +121,6 @@ async function eslintAll(opt) {
125
121
  await runESLint(`./scripts`, eslintConfigPathScripts, tsconfigPathScripts, extensions, fix);
126
122
  // /e2e
127
123
  await runESLint(`./e2e`, eslintConfigPathE2e, tsconfigPathE2e, extensions, fix);
128
- // /e2e
129
- await runESLint(`./playwright`, eslintConfigPathPlaywright, tsconfigPathPlaywright, extensions, fix);
130
124
  }
131
125
  console.log(`${(0, nodejs_lib_1.boldGrey)('eslint-all')} ${(0, nodejs_lib_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
132
126
  }
@@ -253,7 +247,7 @@ function runBiome(fix = true) {
253
247
  console.log(`biome is skipped, because ./biome.jsonc is not present`);
254
248
  return;
255
249
  }
256
- const dirs = [`src`, `scripts`, `e2e`, `playwright`].filter(d => node_fs_1.default.existsSync(d));
250
+ const dirs = [`src`, `scripts`, `e2e`].filter(d => node_fs_1.default.existsSync(d));
257
251
  nodejs_lib_1.exec2.spawn(`biome`, {
258
252
  args: [`lint`, fix && '--write', fix && '--unsafe', '--no-errors-on-unmatched', ...dirs].filter(js_lib_1._isTruthy),
259
253
  logFinish: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "15.22.0",
3
+ "version": "15.23.0",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "tsn-debug": "tsn testScript.ts",