@st1ggy/linter-config 7.3.0 → 7.3.1
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/README.md +2 -1
- package/package.json +2 -2
- package/scripts/package-smoke.mjs +56 -0
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ Releases are started manually from `Actions` → `Release` → `Run workflow`. I
|
|
|
112
112
|
|
|
113
113
|
## Toolchain (this repo)
|
|
114
114
|
|
|
115
|
-
The `CI` GitHub Actions workflow runs linting, Solid integration tests, TypeScript checks, and a package
|
|
115
|
+
The `CI` GitHub Actions workflow runs linting, Solid integration tests, TypeScript checks, and a packed-package smoke test on pushes to `main` and pull requests. The smoke test installs the tarball into a temporary project and checks the CLI and Solid preset import. The `Release` workflow runs these checks before publishing as well.
|
|
116
116
|
|
|
117
117
|
There is **one** published package at the **repository root** (no `packages/` workspace layout).
|
|
118
118
|
|
|
@@ -132,6 +132,7 @@ npm run lint
|
|
|
132
132
|
| `npm run lint:fix` | Auto-fix ESLint, Stylelint, Prettier |
|
|
133
133
|
| `npm run inventory` | Regenerate [`data/linter-config-inventory.json`](data/linter-config-inventory.json) |
|
|
134
134
|
| `node --test scripts/solid-config.test.mjs` | Check Solid JSX/TSX linting and wrapper generation |
|
|
135
|
+
| `node scripts/package-smoke.mjs` | Install a packed tarball and check its CLI and Solid preset |
|
|
135
136
|
| `npm run config:init` | `node ./scripts/linter-init.mjs init --common --dir ./examples/init-smoke` (skip existing); see [`scripts/README.md`](scripts/README.md) |
|
|
136
137
|
| `npm run config:migrate` | `migrate` selected legacy configs and overwrite wrappers |
|
|
137
138
|
| `npm run config:reinit` | alias for `config:migrate` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@st1ggy/linter-config",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.1",
|
|
4
4
|
"description": "ESLint, Prettier, and Stylelint shareable configs (sources under src/).",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/St1ggy/linter-config/tree/main#readme",
|
|
21
21
|
"bin": {
|
|
22
|
-
"
|
|
22
|
+
"linter-config": "./scripts/linter-init.mjs"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@eslint/compat": "^2.1.0",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint-disable sonarjs/no-os-command-from-path -- Use the developer's or CI runner's npm installation. */
|
|
2
|
+
|
|
3
|
+
import assert from 'node:assert/strict'
|
|
4
|
+
import { execFileSync } from 'node:child_process'
|
|
5
|
+
import { mkdtempSync, readFileSync, rmSync } from 'node:fs'
|
|
6
|
+
import { tmpdir } from 'node:os'
|
|
7
|
+
import path from 'node:path'
|
|
8
|
+
import { fileURLToPath } from 'node:url'
|
|
9
|
+
|
|
10
|
+
const root = fileURLToPath(new URL('..', import.meta.url))
|
|
11
|
+
const directory = mkdtempSync(path.join(tmpdir(), 'linter-package-'))
|
|
12
|
+
const packageJson = JSON.parse(readFileSync(path.join(root, 'package.json'), 'utf8'))
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const packed = execFileSync('npm', ['pack', '--json', '--pack-destination', directory], {
|
|
16
|
+
cwd: root,
|
|
17
|
+
encoding: 'utf8',
|
|
18
|
+
})
|
|
19
|
+
const [{ filename }] = JSON.parse(packed)
|
|
20
|
+
|
|
21
|
+
execFileSync(
|
|
22
|
+
'npm',
|
|
23
|
+
[
|
|
24
|
+
'install',
|
|
25
|
+
'--prefix',
|
|
26
|
+
directory,
|
|
27
|
+
'--ignore-scripts',
|
|
28
|
+
'--legacy-peer-deps',
|
|
29
|
+
'--no-audit',
|
|
30
|
+
'--no-fund',
|
|
31
|
+
'--package-lock=false',
|
|
32
|
+
path.join(directory, filename),
|
|
33
|
+
`eslint-plugin-solid@${packageJson.peerDependencies['eslint-plugin-solid']}`,
|
|
34
|
+
],
|
|
35
|
+
{ cwd: directory, stdio: 'inherit' },
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
const help = execFileSync('npm', ['exec', '--offline', '--', '@st1ggy/linter-config', '--help'], {
|
|
39
|
+
cwd: directory,
|
|
40
|
+
encoding: 'utf8',
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
assert.ok(help.includes('--solid'), 'The installed CLI must expose the Solid stack')
|
|
44
|
+
execFileSync(
|
|
45
|
+
process.execPath,
|
|
46
|
+
[
|
|
47
|
+
'--input-type=module',
|
|
48
|
+
'-e',
|
|
49
|
+
"import assert from 'node:assert/strict'; import config from '@st1ggy/linter-config/eslint-solid'; assert.ok(Array.isArray(config));",
|
|
50
|
+
],
|
|
51
|
+
{ cwd: directory, stdio: 'inherit' },
|
|
52
|
+
)
|
|
53
|
+
process.stdout.write('Packed CLI and Solid preset smoke checks passed.\n')
|
|
54
|
+
} finally {
|
|
55
|
+
rmSync(directory, { recursive: true, force: true })
|
|
56
|
+
}
|