@upleveled/preflight 9.0.12 → 10.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.js +1 -1
- package/package.json +29 -29
- package/src/checks/allChangesCommittedToGit.ts +0 -9
- package/src/checks/linkOnGithubAbout.ts +2 -8
- package/src/checks/noDependencyProblems/noDependenciesWithoutTypes.ts +8 -10
- package/src/index.ts +2 -2
- package/src/util/randomUserAgent.ts +0 -6
package/bin/preflight.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upleveled/preflight",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"repository": "upleveled/preflight",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "UpLeveled (https://github.com/upleveled)",
|
|
@@ -17,43 +17,43 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"src"
|
|
19
19
|
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"docker-build": "docker build --tag preflight .",
|
|
22
|
+
"docker-build-run": "pnpm docker-build && pnpm docker-run",
|
|
23
|
+
"docker-run": "docker run preflight",
|
|
24
|
+
"lint": "eslint . --max-warnings 0",
|
|
25
|
+
"start": "node --watch ./src/index.ts",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test-local": "rm -rf ./__tests__/fixtures/__temp && pnpm test"
|
|
28
|
+
},
|
|
20
29
|
"dependencies": {
|
|
21
|
-
"algoliasearch": "5.
|
|
22
|
-
"chalk": "
|
|
30
|
+
"algoliasearch": "5.57.0",
|
|
31
|
+
"chalk": "6.0.0",
|
|
23
32
|
"cheerio": "1.2.0",
|
|
24
33
|
"depcheck": "1.4.7",
|
|
25
|
-
"domhandler": "
|
|
26
|
-
"execa": "
|
|
27
|
-
"listr2": "
|
|
34
|
+
"domhandler": "6.0.1",
|
|
35
|
+
"execa": "10.0.1",
|
|
36
|
+
"listr2": "11.0.1",
|
|
28
37
|
"node-fetch": "3.3.2",
|
|
29
38
|
"p-reduce": "3.0.0",
|
|
30
|
-
"readdirp": "5.
|
|
31
|
-
"semver": "7.
|
|
32
|
-
"top-user-agents": "2.1.92"
|
|
39
|
+
"readdirp": "5.1.1",
|
|
40
|
+
"semver": "7.8.5"
|
|
33
41
|
},
|
|
34
42
|
"devDependencies": {
|
|
35
|
-
"@types/node": "
|
|
43
|
+
"@types/node": "26.4.0",
|
|
36
44
|
"@types/p-map": "2.0.0",
|
|
37
|
-
"@types/semver": "7.
|
|
38
|
-
"eslint": "9.
|
|
39
|
-
"eslint-config-upleveled": "
|
|
40
|
-
"p-map": "7.0.
|
|
41
|
-
"prettier": "3.
|
|
42
|
-
"stylelint": "17.
|
|
43
|
-
"typescript": "
|
|
44
|
-
"typescript-eslint": "8.
|
|
45
|
-
"vitest": "4.
|
|
45
|
+
"@types/semver": "7.8.0",
|
|
46
|
+
"eslint": "10.9.1",
|
|
47
|
+
"eslint-config-upleveled": "10.0.2",
|
|
48
|
+
"p-map": "7.0.7",
|
|
49
|
+
"prettier": "3.9.6",
|
|
50
|
+
"stylelint": "17.14.1",
|
|
51
|
+
"typescript": "6.0.3",
|
|
52
|
+
"typescript-eslint": "8.68.0",
|
|
53
|
+
"vitest": "4.1.11"
|
|
46
54
|
},
|
|
55
|
+
"packageManager": "pnpm@11.24.0",
|
|
47
56
|
"engines": {
|
|
48
57
|
"node": ">=22"
|
|
49
|
-
},
|
|
50
|
-
"scripts": {
|
|
51
|
-
"docker-build": "docker build --tag preflight .",
|
|
52
|
-
"docker-build-run": "pnpm docker-build && pnpm docker-run",
|
|
53
|
-
"docker-run": "docker run preflight",
|
|
54
|
-
"lint": "eslint . --max-warnings 0",
|
|
55
|
-
"start": "node --watch ./src/index.ts",
|
|
56
|
-
"test": "vitest run",
|
|
57
|
-
"test-local": "rm -rf ./__tests__/fixtures/__temp && pnpm test"
|
|
58
58
|
}
|
|
59
|
-
}
|
|
59
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { promises as fs } from 'node:fs';
|
|
2
1
|
import { execa } from 'execa';
|
|
3
2
|
import { commandExample } from '../util/commandExample.ts';
|
|
4
3
|
import { isDrone } from '../util/drone.ts';
|
|
@@ -6,14 +5,6 @@ import { isDrone } from '../util/drone.ts';
|
|
|
6
5
|
export const title = 'All changes committed to Git';
|
|
7
6
|
|
|
8
7
|
export default async function allChangesCommittedToGit() {
|
|
9
|
-
const { stdout: replSlug } = await execa`echo $REPL_SLUG`;
|
|
10
|
-
|
|
11
|
-
const isRunningInReplIt = replSlug !== '';
|
|
12
|
-
|
|
13
|
-
if (isRunningInReplIt) {
|
|
14
|
-
await fs.writeFile('.git/info/exclude', '.replit\n');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
8
|
const { stdout } = await execa`git status --porcelain`;
|
|
18
9
|
|
|
19
10
|
if (stdout !== '') {
|
|
@@ -2,7 +2,6 @@ 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.ts';
|
|
6
5
|
|
|
7
6
|
export const title = 'GitHub repo has deployed project link under About';
|
|
8
7
|
|
|
@@ -32,16 +31,11 @@ export default async function linkOnGithubAbout() {
|
|
|
32
31
|
|
|
33
32
|
if (!urlInAboutSection) {
|
|
34
33
|
throw new Error(
|
|
35
|
-
`Deployed project link not found in About section on ${repoUrl}. Click on the
|
|
34
|
+
`Deployed project link not found in About section on ${repoUrl}. Click on the gear symbol to the right of the About heading and paste the StackBlitz / Netlify / Fly.io / Vercel link in the Website box.`,
|
|
36
35
|
);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
const response = await fetch(urlInAboutSection
|
|
40
|
-
headers: {
|
|
41
|
-
// For Replit
|
|
42
|
-
'user-agent': randomUserAgent(),
|
|
43
|
-
},
|
|
44
|
-
});
|
|
38
|
+
const response = await fetch(urlInAboutSection);
|
|
45
39
|
|
|
46
40
|
if (!response.ok) {
|
|
47
41
|
throw new Error(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, promises as fs } from 'node:fs';
|
|
2
|
-
import { algoliasearch } from 'algoliasearch';
|
|
2
|
+
import { algoliasearch, type Hit } from 'algoliasearch';
|
|
3
3
|
import pReduce from 'p-reduce';
|
|
4
4
|
import { commandExample } from '../../util/commandExample.ts';
|
|
5
5
|
import { projectPackageJson } from '../../util/packageJson.ts';
|
|
@@ -12,12 +12,6 @@ const client = algoliasearch(
|
|
|
12
12
|
'ec73550aa8b2936dab436d4e02144784', // API Key
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
interface AlgoliaObj {
|
|
16
|
-
types?: {
|
|
17
|
-
definitelyTyped?: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
15
|
export const title = 'No dependencies without types';
|
|
22
16
|
|
|
23
17
|
// This is a naive check for matching @types/<pkg name> packages
|
|
@@ -60,14 +54,18 @@ export default async function noDependenciesWithoutTypes() {
|
|
|
60
54
|
return filteredDependencies;
|
|
61
55
|
}
|
|
62
56
|
|
|
63
|
-
let results:
|
|
57
|
+
let results: Hit<{
|
|
58
|
+
types?: {
|
|
59
|
+
definitelyTyped?: string;
|
|
60
|
+
};
|
|
61
|
+
}>;
|
|
64
62
|
|
|
65
63
|
try {
|
|
66
|
-
results =
|
|
64
|
+
results = await client.getObject({
|
|
67
65
|
indexName: 'npm-search',
|
|
68
66
|
objectID: dependency,
|
|
69
67
|
attributesToRetrieve: ['types'],
|
|
70
|
-
})
|
|
68
|
+
});
|
|
71
69
|
} catch (error) {
|
|
72
70
|
// Show dependency name if Algolia's `client.getObject()` throws with an
|
|
73
71
|
// error message (such as the error message "ObjectID does not exist"
|
package/src/index.ts
CHANGED
|
@@ -95,7 +95,7 @@ const listrTasks: ListrTask[] = [
|
|
|
95
95
|
|
|
96
96
|
const tasks = new Listr(listrTasks, {
|
|
97
97
|
exitOnError: false,
|
|
98
|
-
collectErrors:
|
|
98
|
+
collectErrors: true,
|
|
99
99
|
rendererOptions: {
|
|
100
100
|
collapseErrors: false,
|
|
101
101
|
removeEmptyLines: false,
|
|
@@ -107,6 +107,6 @@ const tasks = new Listr(listrTasks, {
|
|
|
107
107
|
|
|
108
108
|
await tasks.run();
|
|
109
109
|
|
|
110
|
-
if (tasks.errors.length > 0) {
|
|
110
|
+
if (tasks.errors && tasks.errors.length > 0) {
|
|
111
111
|
process.exit(1);
|
|
112
112
|
}
|