History

fmt

Rhys Sullivan committed 6 months ago

Commit c92c57d1 parent 87ab5c7265 files · +5705 −8140Browse files

Showing the changes to scripts (5 of 265 files). Show all

Unified · Split

5 files
  1. scripts/check-release-notes.ts +2 −8
  2. scripts/oxlint-plugin-executor/rules/no-redundant-primitive-cast.js +2 −9
  3. scripts/oxlint-plugin-executor/rules/no-unsupported-effect-api.js +1 −2
  4. scripts/oxlint-plugin-executor/utils.js +3 −3
  5. scripts/publish-packages.ts +2 −6
scripts/check-release-notes.ts+2−8
@@ -61,11 +61,7 @@ const checkFile = (path: string): Violation[] => { · 60 unmodified lines
61};61};
62 62
63const targets = process.argv.slice(2);63const targets = process.argv.slice(2);
64const defaultTarget = resolve(64const defaultTarget = resolve(import.meta.dir, "..", "apps/cli/release-notes/next.md");
65 import.meta.dir,
66 "..",
67 "apps/cli/release-notes/next.md",
68);
69const paths = targets.length > 0 ? targets.map((p) => resolve(p)) : [defaultTarget];65const paths = targets.length > 0 ? targets.map((p) => resolve(p)) : [defaultTarget];
70 66
71let failed = false;67let failed = false;
@@ -90,8 +86,6 @@ if (failed) { · 18 unmodified lines
90 console.error(86 console.error(
91 `\nForbidden Thanks handles: ${FORBIDDEN_THANKS_HANDLES.map((h) => `@${h}`).join(", ")}`,87 `\nForbidden Thanks handles: ${FORBIDDEN_THANKS_HANDLES.map((h) => `@${h}`).join(", ")}`,
92 );88 );
93 console.error(89 console.error("Use a credited external GitHub username, or omit the attribution entirely.");
94 "Use a credited external GitHub username, or omit the attribution entirely.",
95 );
96 process.exit(1);90 process.exit(1);
97}91}
scripts/oxlint-plugin-executor/rules/no-redundant-primitive-cast.js+2−9
@@ -3,11 +3,7 @@ import { isConfigOrTooling, unwrapExpression } from "../utils.js"; · 2 unmodified lines
3const message =3const message =
4 "Avoid primitive casts like value as string. Remove redundant casts, or normalize unknown data with Schema/a typed adapter before use. Skill: wrdn-effect-schema-boundaries.";4 "Avoid primitive casts like value as string. Remove redundant casts, or normalize unknown data with Schema/a typed adapter before use. Skill: wrdn-effect-schema-boundaries.";
5 5
6const primitiveTypes = new Set([6const primitiveTypes = new Set(["TSStringKeyword", "TSNumberKeyword", "TSBooleanKeyword"]);
7 "TSStringKeyword",
8 "TSNumberKeyword",
9 "TSBooleanKeyword",
10]);
11 7
12const isPrimitiveType = (node) => primitiveTypes.has(node?.type);8const isPrimitiveType = (node) => primitiveTypes.has(node?.type);
13 9
@@ -31,10 +27,7 @@ export default { · 17 unmodified lines
31 if (isConfigOrTooling(context.filename)) return {};27 if (isConfigOrTooling(context.filename)) return {};
32 28
33 const check = (node) => {29 const check = (node) => {
34 if (30 if (isPrimitiveType(node.typeAnnotation) && isPossiblyRedundantExpression(node.expression)) {
35 isPrimitiveType(node.typeAnnotation) &&
36 isPossiblyRedundantExpression(node.expression)
37 ) {
38 context.report({ node, message });31 context.report({ node, message });
39 }32 }
40 };33 };
scripts/oxlint-plugin-executor/rules/no-unsupported-effect-api.js+1−2
@@ -15,8 +15,7 @@ const unsupported = new Map([ · 14 unmodified lines
15 ],15 ],
16]);16]);
17 17
18const message = (name) =>18const message = (name) => `${unsupported.get(name)} Skill: wrdn-effect-typed-errors.`;
19 `${unsupported.get(name)} Skill: wrdn-effect-typed-errors.`;
20 19
21export default {20export default {
22 meta: {21 meta: {
scripts/oxlint-plugin-executor/utils.js+3−3
@@ -67,7 +67,8 @@ export function hasObjectProperty(node, name) { · 66 unmodified lines
67 67
68export function getStringValue(node) {68export function getStringValue(node) {
69 const expression = unwrapExpression(node);69 const expression = unwrapExpression(node);
70 if (expression?.type === "Literal" && typeof expression.value === "string") return expression.value;70 if (expression?.type === "Literal" && typeof expression.value === "string")
71 return expression.value;
71 if (expression?.type === "StringLiteral") return expression.value;72 if (expression?.type === "StringLiteral") return expression.value;
72 return undefined;73 return undefined;
73}74}
@@ -78,8 +79,7 @@ export function isIdentifier(node, name) { · 4 unmodified lines
78 79
79export function isStringLiteral(node) {80export function isStringLiteral(node) {
80 return (81 return (
81 (node?.type === "Literal" && typeof node.value === "string") ||82 (node?.type === "Literal" && typeof node.value === "string") || node?.type === "StringLiteral"
82 node?.type === "StringLiteral"
83 );83 );
84}84}
85 85
scripts/publish-packages.ts+2−6
@@ -44,9 +44,7 @@ const PUBLIC_PACKAGE_DIRS = [ · 43 unmodified lines
44 "packages/plugins/openapi",44 "packages/plugins/openapi",
45] as const;45] as const;
46 46
47const parseArgs = (47const parseArgs = (argv: ReadonlyArray<string>): { dryRun: boolean; prepareOnly: boolean } => {
48 argv: ReadonlyArray<string>,
49): { dryRun: boolean; prepareOnly: boolean } => {
50 let dryRun = false;48 let dryRun = false;
51 let prepareOnly = false;49 let prepareOnly = false;
52 for (const arg of argv) {50 for (const arg of argv) {
@@ -151,9 +149,7 @@ const applyWorkspaceVersions = async ( · 98 unmodified lines
151 * `@effect-atom/*`, etc.) are real npm packages and pass through149 * `@effect-atom/*`, etc.) are real npm packages and pass through
152 * unchanged.150 * unchanged.
153 */151 */
154 const renamePeerDepBlock = (152 const renamePeerDepBlock = (block: DependencyBlock | undefined): DependencyBlock | undefined => {
155 block: DependencyBlock | undefined,
156 ): DependencyBlock | undefined => {
157 if (!block) return block;153 if (!block) return block;
158 const next: DependencyBlock = {};154 const next: DependencyBlock = {};
159 let mutated = false;155 let mutated = false;