Skip to content

Commit

Permalink
feat(compas-convert): use @lightbase/utils, bump some dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk de Visser <[email protected]>
  • Loading branch information
dirkdev98 committed Jan 24, 2025
1 parent dc814eb commit e59b65e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
4 changes: 2 additions & 2 deletions packages/compas-convert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ rm -rf ../compas-convert-test && npx compas-convert ../some-local-test-project .

Checklist:

- [ ] Any TS errors we need to fix still?
- [x] Any TS errors we need to fix still?
- Start documenting common errors and their fixes below
- [x] CRUD file errors add `@ts-nocheck` or comparable.
- [x] Check on generated input/output types for things like `ctx.body`
- [ ] Add `@lightbase/utils` package, and use that for `assertNotNil`.
- [x] Add `@lightbase/utils` package, and use that for `assertNotNil`.
- [x] Verify that all maintained projects at least convert.
- [x] Any ESLint rules we can fix?
- Start documenting common errors and their fixes below
Expand Down
2 changes: 1 addition & 1 deletion packages/compas-convert/src/passes/add-common-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function addCommonImports(context: Context, sourceFile: SourceFile) {
addPendingImport(
context,
sourceFile,
resolveRelativeImport(context, sourceFile, CONVERT_UTIL_PATH),
"@lightbase/utils",
CONVERT_UTIL.assertNotNil,
false,
);
Expand Down
12 changes: 0 additions & 12 deletions packages/compas-convert/src/passes/init-ts-morph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@ import { AppError } from "@compas/stdlib";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type $ConvertAny = any;
/**
* Asserts that the provided value is not null or undefined.
*/
export function assertNotNil<T>(
value: T,
message?: string,
): asserts value is NonNullable<T> {
if (value === null || value === undefined) {
throw new Error(\`Invariant failed: $\{ message }\`);
}
}
/**
* Asserts that the provided value is of type AppError
*
Expand Down
15 changes: 8 additions & 7 deletions packages/compas-convert/src/passes/init-typescript-in-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ export async function initTypescriptInProject(context: Context) {

packageJson.devDependencies ??= {};
packageJson.devDependencies["tsx"] = "4.19.2";
packageJson.devDependencies["typescript"] = "5.6.3";
packageJson.devDependencies["vitest"] = "2.0.5";
packageJson.devDependencies["typescript"] = "5.7.3";
packageJson.devDependencies["vitest"] = "3.0.4";
packageJson.devDependencies["@total-typescript/tsconfig"] = "1.0.4";
packageJson.devDependencies["@types/node"] = "latest";
packageJson.devDependencies["@compas/code-gen"] = "0.15.6";
packageJson.devDependencies["@compas/code-gen"] = "0.15.8";

packageJson.dependencies ??= {};
packageJson.dependencies["@compas/cli"] = "0.15.6";
packageJson.dependencies["@compas/server"] = "0.15.6";
packageJson.dependencies["@compas/stdlib"] = "0.15.6";
packageJson.dependencies["@compas/store"] = "0.15.6";
packageJson.dependencies["@lightbase/utils"] = "1.0.3";
packageJson.dependencies["@compas/cli"] = "0.15.8";
packageJson.dependencies["@compas/server"] = "0.15.8";
packageJson.dependencies["@compas/stdlib"] = "0.15.8";
packageJson.dependencies["@compas/store"] = "0.15.8";

packageJson.scripts ??= {};
packageJson.scripts["build"] = `tsc -p ./tsconfig.json`;
Expand Down

0 comments on commit e59b65e

Please sign in to comment.