@upleveled/preflight 7.0.9 → 8.0.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/bin/preflight.ts +3 -0
- package/package.json +21 -40
- package/src/checks/allChangesCommittedToGit.ts +2 -2
- package/src/checks/eslint.ts +1 -1
- package/src/checks/eslintConfigIsValid.ts +3 -2
- package/src/checks/linkOnGithubAbout.ts +1 -1
- package/src/checks/noDependencyProblems/noDependenciesWithoutTypes.ts +2 -2
- package/src/checks/noDependencyProblems/noUnusedDependencies.ts +2 -2
- package/src/checks/noExtraneousFilesCommittedToGit.ts +1 -1
- package/src/checks/noSecretsCommittedToGit.ts +1 -1
- package/src/checks/nodeModulesIgnoredFromGit.ts +2 -2
- package/src/checks/preflightIsLatestVersion.ts +2 -2
- package/src/checks/prettier.ts +1 -1
- package/src/checks/projectFolderNameMatchesCorrectFormat.ts +1 -1
- package/src/checks/stylelint.ts +1 -1
- package/src/checks/stylelintConfigIsValid.ts +7 -5
- package/src/checks/useSinglePackageManager.ts +1 -1
- package/src/index.ts +19 -19
- package/src/util/packageJson.ts +1 -1
- package/bin/preflight.js +0 -3
- package/dist/checks/allChangesCommittedToGit.d.ts +0 -2
- package/dist/checks/eslint.d.ts +0 -2
- package/dist/checks/eslintConfigIsValid.d.ts +0 -2
- package/dist/checks/linkOnGithubAbout.d.ts +0 -2
- package/dist/checks/noDependencyProblems/noDependenciesWithoutTypes.d.ts +0 -2
- package/dist/checks/noDependencyProblems/noUnusedDependencies.d.ts +0 -2
- package/dist/checks/noExtraneousFilesCommittedToGit.d.ts +0 -2
- package/dist/checks/noSecretsCommittedToGit.d.ts +0 -2
- package/dist/checks/nodeModulesIgnoredFromGit.d.ts +0 -2
- package/dist/checks/preflightIsLatestVersion.d.ts +0 -2
- package/dist/checks/prettier.d.ts +0 -2
- package/dist/checks/projectFolderNameMatchesCorrectFormat.d.ts +0 -2
- package/dist/checks/stylelint.d.ts +0 -3
- package/dist/checks/stylelintConfigIsValid.d.ts +0 -2
- package/dist/checks/useSinglePackageManager.d.ts +0 -2
- package/dist/index.d.ts +0 -1
- package/dist/preflight.esm.js +0 -722
- package/dist/preflight.esm.js.map +0 -1
- package/dist/util/commandExample.d.ts +0 -1
- package/dist/util/crossPlatform.d.ts +0 -1
- package/dist/util/drone.d.ts +0 -1
- package/dist/util/packageJson.d.ts +0 -53
- package/dist/util/preflightBinPath.d.ts +0 -1
- package/dist/util/randomUserAgent.d.ts +0 -1
package/bin/preflight.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upleveled/preflight",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"repository": "upleveled/preflight",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "UpLeveled (https://github.com/upleveled)",
|
|
@@ -9,72 +9,53 @@
|
|
|
9
9
|
"Karl Horky <karl.horky@gmail.com>"
|
|
10
10
|
],
|
|
11
11
|
"type": "module",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"typings": "dist/index.d.ts",
|
|
12
|
+
"module": "./src/index.ts",
|
|
13
|
+
"types": "./src/index.ts",
|
|
15
14
|
"bin": {
|
|
16
|
-
"preflight": "bin/preflight.
|
|
15
|
+
"preflight": "./bin/preflight.ts"
|
|
17
16
|
},
|
|
18
17
|
"files": [
|
|
19
|
-
"bin/preflight.js",
|
|
20
|
-
"dist",
|
|
18
|
+
"./bin/preflight.js",
|
|
21
19
|
"src"
|
|
22
20
|
],
|
|
23
|
-
"jest": {
|
|
24
|
-
"transformIgnorePatterns": [
|
|
25
|
-
"node_modules/(?!execa)/"
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
21
|
"dependencies": {
|
|
29
|
-
"@types/eslint": "9.6.
|
|
30
|
-
"algoliasearch": "5.
|
|
22
|
+
"@types/eslint": "9.6.1",
|
|
23
|
+
"algoliasearch": "5.8.1",
|
|
31
24
|
"chalk": "5.3.0",
|
|
32
25
|
"cheerio": "1.0.0",
|
|
33
26
|
"depcheck": "1.4.7",
|
|
34
27
|
"domhandler": "5.0.3",
|
|
35
|
-
"execa": "9.
|
|
36
|
-
"listr2": "8.2.
|
|
28
|
+
"execa": "9.4.0",
|
|
29
|
+
"listr2": "8.2.5",
|
|
37
30
|
"node-fetch": "3.3.2",
|
|
38
31
|
"p-reduce": "3.0.0",
|
|
39
|
-
"readdirp": "
|
|
32
|
+
"readdirp": "4.0.2",
|
|
40
33
|
"semver": "7.6.3",
|
|
41
|
-
"top-user-agents": "2.1.
|
|
34
|
+
"top-user-agents": "2.1.24",
|
|
35
|
+
"tsx": "4.19.1"
|
|
42
36
|
},
|
|
43
37
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@jest/globals": "29.7.0",
|
|
46
|
-
"@size-limit/file": "11.1.4",
|
|
47
|
-
"@types/babel__core": "7.20.5",
|
|
48
|
-
"@types/jest": "29.5.12",
|
|
49
|
-
"@types/node": "22.3.0",
|
|
38
|
+
"@types/node": "22.7.5",
|
|
50
39
|
"@types/p-map": "2.0.0",
|
|
51
40
|
"@types/semver": "7.5.8",
|
|
52
|
-
"
|
|
53
|
-
"eslint": "
|
|
54
|
-
"eslint-config-upleveled": "8.6.14",
|
|
41
|
+
"eslint": "9.12.0",
|
|
42
|
+
"eslint-config-upleveled": "8.8.0",
|
|
55
43
|
"p-map": "7.0.2",
|
|
56
|
-
"postinstall-postinstall": "2.1.0",
|
|
57
44
|
"prettier": "3.3.3",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"tslib": "2.6.3",
|
|
62
|
-
"typescript": "5.5.4"
|
|
45
|
+
"stylelint": "16.9.0",
|
|
46
|
+
"typescript": "5.6.3",
|
|
47
|
+
"vitest": "2.1.2"
|
|
63
48
|
},
|
|
64
49
|
"engines": {
|
|
65
50
|
"node": ">=18"
|
|
66
51
|
},
|
|
67
52
|
"scripts": {
|
|
68
|
-
"analyze": "size-limit --why",
|
|
69
|
-
"build": "tsdx build --format esm --target node --tsconfig tsconfig.src.json",
|
|
70
53
|
"docker-build": "docker build --tag preflight .",
|
|
71
|
-
"docker-build-run": "pnpm docker-build
|
|
72
|
-
"docker-build-ts": "tsc --project docker/tsconfig.build.json",
|
|
54
|
+
"docker-build-run": "pnpm docker-build && pnpm docker-run",
|
|
73
55
|
"docker-run": "docker run preflight",
|
|
74
56
|
"lint": "eslint . --max-warnings 0",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"test": "tsdx test",
|
|
57
|
+
"start": "tsx watch ./src/index.ts",
|
|
58
|
+
"test": "vitest run",
|
|
78
59
|
"test-local": "rm -rf ./__tests__/fixtures/__temp && pnpm test"
|
|
79
60
|
}
|
|
80
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fs } from 'node:fs';
|
|
2
2
|
import { execa } from 'execa';
|
|
3
|
-
import { commandExample } from '../util/commandExample';
|
|
4
|
-
import { isDrone } from '../util/drone';
|
|
3
|
+
import { commandExample } from '../util/commandExample.ts';
|
|
4
|
+
import { isDrone } from '../util/drone.ts';
|
|
5
5
|
|
|
6
6
|
export const title = 'All changes committed to Git';
|
|
7
7
|
|
package/src/checks/eslint.ts
CHANGED
|
@@ -68,8 +68,9 @@ export default async function eslintConfigIsValid() {
|
|
|
68
68
|
const eslintDisableOccurrences = [];
|
|
69
69
|
|
|
70
70
|
for await (const { path } of readdirp('.', {
|
|
71
|
-
directoryFilter:
|
|
72
|
-
|
|
71
|
+
directoryFilter: (dir) =>
|
|
72
|
+
!['.git', '.next', 'node_modules'].includes(dir.basename),
|
|
73
|
+
fileFilter: (file) => /\.(?:js|jsx|ts|tsx)$/.test(file.basename),
|
|
73
74
|
})) {
|
|
74
75
|
const fileContents = await fs.readFile(path, 'utf-8');
|
|
75
76
|
if (/eslint-disable|eslint [a-z0-9@/-]+: (0|off)/.test(fileContents)) {
|
|
@@ -2,7 +2,7 @@ import { load } from 'cheerio';
|
|
|
2
2
|
import type { Element } from 'domhandler';
|
|
3
3
|
import { execa } from 'execa';
|
|
4
4
|
import fetch from 'node-fetch';
|
|
5
|
-
import { randomUserAgent } from '../util/randomUserAgent';
|
|
5
|
+
import { randomUserAgent } from '../util/randomUserAgent.ts';
|
|
6
6
|
|
|
7
7
|
export const title = 'GitHub repo has deployed project link under About';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync, promises as fs } from 'node:fs';
|
|
2
2
|
import { algoliasearch } from 'algoliasearch';
|
|
3
3
|
import pReduce from 'p-reduce';
|
|
4
|
-
import { commandExample } from '../../util/commandExample';
|
|
5
|
-
import { projectPackageJson } from '../../util/packageJson';
|
|
4
|
+
import { commandExample } from '../../util/commandExample.ts';
|
|
5
|
+
import { projectPackageJson } from '../../util/packageJson.ts';
|
|
6
6
|
|
|
7
7
|
const client = algoliasearch(
|
|
8
8
|
// Application ID and API key specific to UpLeveled
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execa } from 'execa';
|
|
2
|
-
import { commandExample } from '../../util/commandExample';
|
|
3
|
-
import { preflightBinPath } from '../../util/preflightBinPath';
|
|
2
|
+
import { commandExample } from '../../util/commandExample.ts';
|
|
3
|
+
import { preflightBinPath } from '../../util/preflightBinPath.ts';
|
|
4
4
|
|
|
5
5
|
export const title = 'No unused dependencies';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fs } from 'node:fs';
|
|
2
2
|
import { execa } from 'execa';
|
|
3
|
-
import { commandExample } from '../util/commandExample';
|
|
4
|
-
import { normalizeNewlines } from '../util/crossPlatform';
|
|
3
|
+
import { commandExample } from '../util/commandExample.ts';
|
|
4
|
+
import { normalizeNewlines } from '../util/crossPlatform.ts';
|
|
5
5
|
|
|
6
6
|
export const title = 'node_modules/ folder ignored in Git';
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
2
|
import { execa } from 'execa';
|
|
3
3
|
import semver from 'semver';
|
|
4
|
-
import { commandExample } from '../util/commandExample';
|
|
5
|
-
import { preflightPackageJson } from '../util/packageJson';
|
|
4
|
+
import { commandExample } from '../util/commandExample.ts';
|
|
5
|
+
import { preflightPackageJson } from '../util/packageJson.ts';
|
|
6
6
|
|
|
7
7
|
export const title = 'Preflight is latest version';
|
|
8
8
|
|
package/src/checks/prettier.ts
CHANGED
package/src/checks/stylelint.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { createRequire } from 'node:module';
|
|
|
3
3
|
import { execa } from 'execa';
|
|
4
4
|
import readdirp from 'readdirp';
|
|
5
5
|
import semver from 'semver';
|
|
6
|
-
import { supportedStylelintFileExtensions } from './stylelint';
|
|
6
|
+
import { supportedStylelintFileExtensions } from './stylelint.ts';
|
|
7
7
|
|
|
8
8
|
const require = createRequire(`${process.cwd()}/`);
|
|
9
9
|
|
|
@@ -77,10 +77,12 @@ export default config;`;
|
|
|
77
77
|
const stylelintDisableOccurrences = [];
|
|
78
78
|
|
|
79
79
|
for await (const { path } of readdirp('.', {
|
|
80
|
-
directoryFilter:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
directoryFilter: (dir) =>
|
|
81
|
+
!['.git', '.next', 'node_modules'].includes(dir.basename),
|
|
82
|
+
fileFilter: (file) =>
|
|
83
|
+
new RegExp(`\\.(?:${supportedStylelintFileExtensions.join('|')})$`).test(
|
|
84
|
+
file.basename,
|
|
85
|
+
),
|
|
84
86
|
})) {
|
|
85
87
|
const fileContents = await fs.readFile(path, 'utf-8');
|
|
86
88
|
if (fileContents.includes('stylelint-disable')) {
|
package/src/index.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Listr,
|
|
3
|
-
ListrContext,
|
|
4
|
-
ListrDefaultRenderer,
|
|
5
|
-
ListrTask,
|
|
3
|
+
type ListrContext,
|
|
4
|
+
type ListrDefaultRenderer,
|
|
5
|
+
type ListrTask,
|
|
6
6
|
ListrTaskWrapper,
|
|
7
7
|
} from 'listr2';
|
|
8
|
-
import * as allChangesCommittedToGit from './checks/allChangesCommittedToGit.
|
|
9
|
-
import * as eslint from './checks/eslint.
|
|
10
|
-
import * as eslintConfigIsValid from './checks/eslintConfigIsValid.
|
|
11
|
-
import * as linkOnGithubAbout from './checks/linkOnGithubAbout.
|
|
12
|
-
import * as nodeModulesIgnoredFromGit from './checks/nodeModulesIgnoredFromGit.
|
|
13
|
-
import * as noDependenciesWithoutTypes from './checks/noDependencyProblems/noDependenciesWithoutTypes.
|
|
14
|
-
import * as noUnusedAndMissingDependencies from './checks/noDependencyProblems/noUnusedDependencies.
|
|
15
|
-
import * as noExtraneousFilesCommittedToGit from './checks/noExtraneousFilesCommittedToGit.
|
|
16
|
-
import * as noSecretsCommittedToGit from './checks/noSecretsCommittedToGit.
|
|
17
|
-
import * as preflightIsLatestVersion from './checks/preflightIsLatestVersion.
|
|
18
|
-
import * as prettier from './checks/prettier.
|
|
19
|
-
import * as projectFolderNameMatchesCorrectFormat from './checks/projectFolderNameMatchesCorrectFormat.
|
|
20
|
-
import * as stylelint from './checks/stylelint.
|
|
21
|
-
import * as stylelintConfigIsValid from './checks/stylelintConfigIsValid.
|
|
22
|
-
import * as useSinglePackageManager from './checks/useSinglePackageManager.
|
|
8
|
+
import * as allChangesCommittedToGit from './checks/allChangesCommittedToGit.ts';
|
|
9
|
+
import * as eslint from './checks/eslint.ts';
|
|
10
|
+
import * as eslintConfigIsValid from './checks/eslintConfigIsValid.ts';
|
|
11
|
+
import * as linkOnGithubAbout from './checks/linkOnGithubAbout.ts';
|
|
12
|
+
import * as nodeModulesIgnoredFromGit from './checks/nodeModulesIgnoredFromGit.ts';
|
|
13
|
+
import * as noDependenciesWithoutTypes from './checks/noDependencyProblems/noDependenciesWithoutTypes.ts';
|
|
14
|
+
import * as noUnusedAndMissingDependencies from './checks/noDependencyProblems/noUnusedDependencies.ts';
|
|
15
|
+
import * as noExtraneousFilesCommittedToGit from './checks/noExtraneousFilesCommittedToGit.ts';
|
|
16
|
+
import * as noSecretsCommittedToGit from './checks/noSecretsCommittedToGit.ts';
|
|
17
|
+
import * as preflightIsLatestVersion from './checks/preflightIsLatestVersion.ts';
|
|
18
|
+
import * as prettier from './checks/prettier.ts';
|
|
19
|
+
import * as projectFolderNameMatchesCorrectFormat from './checks/projectFolderNameMatchesCorrectFormat.ts';
|
|
20
|
+
import * as stylelint from './checks/stylelint.ts';
|
|
21
|
+
import * as stylelintConfigIsValid from './checks/stylelintConfigIsValid.ts';
|
|
22
|
+
import * as useSinglePackageManager from './checks/useSinglePackageManager.ts';
|
|
23
23
|
import {
|
|
24
24
|
preflightPackageJson,
|
|
25
25
|
projectPackageJson,
|
|
26
|
-
} from './util/packageJson.
|
|
26
|
+
} from './util/packageJson.ts';
|
|
27
27
|
|
|
28
28
|
const projectDependencies = projectPackageJson.dependencies || {};
|
|
29
29
|
|
package/src/util/packageJson.ts
CHANGED
|
@@ -61,5 +61,5 @@ export const projectPackageJson = JSON.parse(
|
|
|
61
61
|
) as PackageJson;
|
|
62
62
|
|
|
63
63
|
export const preflightPackageJson = JSON.parse(
|
|
64
|
-
await fs.readFile(new URL('
|
|
64
|
+
await fs.readFile(new URL('../../package.json', import.meta.url), 'utf-8'),
|
|
65
65
|
) as PackageJson;
|
package/bin/preflight.js
DELETED
package/dist/checks/eslint.d.ts
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|