Skip to content

Commit 083ffec

Browse files
committed
chore(compas-convert): init package
Signed-off-by: Dirk de Visser <[email protected]>
1 parent 70cee83 commit 083ffec

File tree

8 files changed

+107
-1
lines changed

8 files changed

+107
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ This repository is set up as a monorepo. All individual packages are set up with
2626
test and lint setups. The workspace root maintains the below scripts to run them across
2727
all packages in the workspace.
2828

29+
Development requires Node.js 22+ & NPM 10+.
30+
2931
```shell
3032
# Install dependencies
3133
npm install

packages/compas-convert/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024-present Lightbase B.V
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/compas-convert/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Compas convert
2+
3+
Convert Compas code-bases to TypeScript and beyond.
4+
5+
## Context
6+
7+
We want to migrate all active projects to TypeScript. Allowing us to use migrate to
8+
TypeScript powered libraries like Zod and Drizzle ORM to replace Compas.
9+
10+
## Goals
11+
12+
- Backwards compatibility; everything runs in production. We should be able to push the
13+
output of this tool, feature-freeze for a week to execute manual testing and then use
14+
our normal processes like nothing happened.
15+
- Completeness; we would rather spend a few extra weeks polishing the output of this tool,
16+
than to have to do that work later across all projects manually.
17+
- DX; the developer experience on the converted projects should be better or the same. For
18+
example, including the migration to Vitest in this tool will enable us to finally have
19+
IDE support for tests in our projects.
20+
- Source-to-source; we will only change things in the project structure if it makes sense
21+
for the new tools.
22+
23+
## TODO
24+
25+
- [ ] Fully implement the 'compas-compat' target in
26+
[open-api-code-gen](../open-api-code-gen).
27+
- [ ] Pre-condition: verify project uses '@lightbase/eslint-config'
28+
- [ ] Pre-condition: verify project uses Compas
29+
- [ ] Initial: remove jsconfig + setup tsconfig
30+
- [ ] Initial: copy (almost) all files, renaming them to `.ts`
31+
- [ ] Pass: function doc blocks to inline types
32+
- [ ] Pass: @compas/test to Vitest
33+
- [ ] Pass: inline JSDoc blocks to inline types
34+
- [ ] Pass: common issues
35+
- Run TypeScript and find common errors
36+
- [ ] Pass: build step. Fixup CI, Dockerfile, docs, etc
37+
- [ ] Pass: Generator compatibility. Create / improve Compas Typescript targets for
38+
tighter integrations.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { defineConfig } from "@lightbase/eslint-config";
2+
3+
export default defineConfig({});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "@lightbase/compas-convert",
3+
"version": "0.0.1",
4+
"description": "Convert Compas code-bases to TypeScript and beyond",
5+
"type": "module",
6+
"license": "MIT",
7+
"bugs": {
8+
"url": "https://github.com/lightbasenl/platforms/issues"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/lightbasenl/platforms.git",
13+
"directory": "packages/compas-convert"
14+
},
15+
"exports": {
16+
".": {
17+
"import": "./dist/src/index.js"
18+
}
19+
},
20+
"main": "./dist/src/index.js",
21+
"types": "./dist/src/index.d.ts",
22+
"files": ["README.md", "LICENSE", "dist/src"],
23+
"scripts": {
24+
"build": "tsc -p ./tsconfig.json",
25+
"lint": "eslint . --fix --cache --cache-strategy content --cache-location .cache/eslint/ --color",
26+
"lint:ci": "eslint .",
27+
"test": "vitest",
28+
"clean": "rm -rf ./.cache ./dist"
29+
},
30+
"dependencies": {},
31+
"devDependencies": {}
32+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
3+
export const foo = 5;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "@total-typescript/tsconfig/tsc/no-dom/library-monorepo",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
6+
"include": ["**/*"]
7+
}

packages/open-api-code-gen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lightbase/open-api-code-gen",
3-
"version": "0.2.2",
3+
"version": "0.0.1",
44
"description": "Generate evolving API clients from OpenAPI specs",
55
"type": "module",
66
"license": "MIT",

0 commit comments

Comments
 (0)