Skip to content

Commit e243fa1

Browse files
authored
reduce npm run invocations (#893)
* reduce npm run invocations * remove more invocations * run eslint once for the entire repo * fix * fix
1 parent 9c9faa6 commit e243fa1

File tree

113 files changed

+305
-661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+305
-661
lines changed

.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"ecmaVersion": 2022,
99
"sourceType": "module"
1010
},
11+
"ignorePatterns": ["**/dist/*"],
1112
"rules": {
1213
"quotes": ["error", "single"],
1314
"comma-dangle": ["error", "always-multiline"],
@@ -21,7 +22,9 @@
2122
"overrides": [
2223
{
2324
"files": [
24-
"**/*.ts"
25+
"**/*.ts",
26+
"**/*.mts",
27+
"**/*.cts"
2528
],
2629
"extends": [
2730
"plugin:@typescript-eslint/eslint-recommended",

.github/bin/clean.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: lint
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
pull_request:
7+
workflow_dispatch:
8+
inputs:
9+
build_and_test_all_packages:
10+
type: boolean
11+
description: Lint all packages
12+
required: true
13+
14+
concurrency:
15+
group: branch-node--lint--${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
lint:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 1
29+
- uses: actions/setup-node@v3
30+
with:
31+
node-version: 18
32+
33+
- name: npm ci
34+
run: |
35+
npm ci --ignore-scripts
36+
37+
- name: lint
38+
run: npm run lint

.github/workflows/test.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
required: true
1313

1414
concurrency:
15-
group: branch-node-${{ github.ref }}
15+
group: branch-node--test--${{ github.ref }}
1616
cancel-in-progress: true
1717

1818
defaults:
@@ -66,18 +66,14 @@ jobs:
6666
GITHUB_ACTION_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
6767
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6868

69-
# Build, lint and PostCSS Tape tests must all work and pass :
69+
# Build and PostCSS Tape tests must all work and pass :
7070
# - with exact dependencies from package-lock.json
7171
# - without requiring postinstall scripts from dependencies to run
7272
- name: build
7373
run: |
7474
npm run build --if-present $MODIFIED_WORKSPACES
7575
if: matrix.is_base_node_version && matrix.is_base_os_version
7676

77-
- name: lint
78-
run: npm run lint --if-present $MODIFIED_WORKSPACES
79-
if: matrix.is_base_node_version && matrix.is_base_os_version
80-
8177
- name: docs
8278
run: npm run docs --if-present $MODIFIED_WORKSPACES
8379
if: matrix.is_base_node_version && matrix.is_base_os_version

cli/csstools-cli/package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,11 @@
7676
"@csstools/base-cli": "0.1.0"
7777
},
7878
"scripts": {
79-
"prebuild": "npm run clean",
8079
"build": "rollup -c ../../rollup/default.mjs && npm run set-cli-file-permissions",
81-
"clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true }); fs.mkdirSync('./dist');\"",
8280
"csstools-cli": "csstools-cli",
83-
"lint": "npm run lint:eslint && npm run lint:package-json",
84-
"lint:eslint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern",
85-
"lint:package-json": "node ../../.github/bin/format-package-json.mjs",
86-
"prepublishOnly": "npm run clean && npm run build && npm run test",
81+
"lint": "node ../../.github/bin/format-package-json.mjs",
82+
"prepublishOnly": "npm run build && npm run test",
8783
"set-cli-file-permissions": "chmod a+x ./dist/cli.cjs",
88-
"stryker": "stryker run --logLevel error",
8984
"test": "exit 0",
9085
"test:cli": "bash ./test/cli/test.sh"
9186
},

cli/csstools-cli/stryker.conf.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

e2e/interop/custom-media--design-tokens--global-data/result.css renamed to e2e/interop/custom-media--design-tokens--global-data/dist/result.css

File renamed without changes.

e2e/interop/custom-media--design-tokens--global-data/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"private": true,
55
"description": "Can you use custom-media, design-tokens and global-data together?",
66
"scripts": {
7-
"build": "postcss style.css -o ./result.css",
8-
"watch": "postcss style.css -w -o ./result.css",
7+
"build": "postcss style.css -o ./dist/result.css",
8+
"watch": "postcss style.css -w -o ./dist/result.css",
99
"test": "node ./test.mjs"
1010
},
1111
"devDependencies": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'assert';
22
import fs from 'fs/promises';
33

4-
const result = await fs.readFile('./result.css');
4+
const result = await fs.readFile('./dist/result.css');
55
const expect = await fs.readFile('./expect.css');
66

77
assert.equal(result.toString(), expect.toString());

0 commit comments

Comments
 (0)