From 87f2c44c3e042c6afcf235d6cdc5aac925e6d965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ewilan=20Rivi=C3=A8re?= Date: Tue, 1 Aug 2023 09:47:14 +0200 Subject: [PATCH 1/7] 2.0.2 --- lib/package.json | 2 +- lib/src/server.ts | 2 +- lib/tsconfig.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/package.json b/lib/package.json index ebf8321..16b8880 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,7 +1,7 @@ { "name": "@kiwilan/typescriptable-laravel", "type": "module", - "version": "2.0.1", + "version": "2.0.2", "description": "Add some helpers for your Inertia app with TypeScript.", "author": "Ewilan Rivière ", "license": "MIT", diff --git a/lib/src/server.ts b/lib/src/server.ts index 8168f94..e9b622b 100644 --- a/lib/src/server.ts +++ b/lib/src/server.ts @@ -1,4 +1,4 @@ -import fs from 'node:fs/promises' +import { promises as fs } from 'node:fs' export async function execute(command: string): Promise { if (isProduction()) diff --git a/lib/tsconfig.json b/lib/tsconfig.json index f260784..c1230fa 100644 --- a/lib/tsconfig.json +++ b/lib/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "module": "ESNext", + "module": "ES2020", "target": "ESNext", "lib": ["ESNext", "DOM"], "esModuleInterop": true, From 2cf407506097fac8a79e8dc095b3f88e71a4edee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ewilan=20Rivi=C3=A8re?= Date: Tue, 1 Aug 2023 09:50:15 +0200 Subject: [PATCH 2/7] rollback --- lib/package.json | 2 +- lib/src/server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/package.json b/lib/package.json index 16b8880..83f6abe 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,7 +1,7 @@ { "name": "@kiwilan/typescriptable-laravel", "type": "module", - "version": "2.0.2", + "version": "2.0.3", "description": "Add some helpers for your Inertia app with TypeScript.", "author": "Ewilan Rivière ", "license": "MIT", diff --git a/lib/src/server.ts b/lib/src/server.ts index e9b622b..8168f94 100644 --- a/lib/src/server.ts +++ b/lib/src/server.ts @@ -1,4 +1,4 @@ -import { promises as fs } from 'node:fs' +import fs from 'node:fs/promises' export async function execute(command: string): Promise { if (isProduction()) From d168a91e61a024fce3b1b49a48eeed721b3b4c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ewilan=20Rivi=C3=A8re?= Date: Tue, 1 Aug 2023 09:52:29 +0200 Subject: [PATCH 3/7] externalize fs --- lib/package.json | 2 +- lib/tsup.config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/package.json b/lib/package.json index 83f6abe..f48839d 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,7 +1,7 @@ { "name": "@kiwilan/typescriptable-laravel", "type": "module", - "version": "2.0.3", + "version": "2.0.4", "description": "Add some helpers for your Inertia app with TypeScript.", "author": "Ewilan Rivière ", "license": "MIT", diff --git a/lib/tsup.config.ts b/lib/tsup.config.ts index d1c61f5..f4d29c0 100644 --- a/lib/tsup.config.ts +++ b/lib/tsup.config.ts @@ -6,7 +6,7 @@ export default defineConfig({ index: 'src/index.ts', }, format: ['cjs', 'esm'], - external: ['vue', '@inertiajs/vue3'], + external: ['vue', '@inertiajs/vue3', 'node:fs/promises', 'node:child_process'], outDir: 'dist', dts: true, minify: true, From 5f5b0c9303a1374c7c98fd559c5de0ce541d0b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ewilan=20Rivi=C3=A8re?= Date: Wed, 9 Aug 2023 12:10:11 +0200 Subject: [PATCH 4/7] docs --- tests/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..d1345d3 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,10 @@ +# Test environment + +## SQL Server + +```bash +docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=12345OHdf%e" \ + -p 1433:1433 --name sqlserver --hostname sqlserver \ + -d \ + mcr.microsoft.com/mssql/server:2022-latest +``` From 161b3902d9f89ecf2bd7856954328fcb7ebace58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ewilan=20Rivi=C3=A8re?= Date: Wed, 9 Aug 2023 12:10:24 +0200 Subject: [PATCH 5/7] fallabck EloquentRelation --- src/Typed/Eloquent/Utils/EloquentRelation.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Typed/Eloquent/Utils/EloquentRelation.php b/src/Typed/Eloquent/Utils/EloquentRelation.php index b98eb5e..5a11def 100644 --- a/src/Typed/Eloquent/Utils/EloquentRelation.php +++ b/src/Typed/Eloquent/Utils/EloquentRelation.php @@ -12,8 +12,8 @@ public function __construct( public string $field, public bool $isArray = false, public bool $isMorph = false, - public ?string $type = null, - public ?string $typeTs = null, + public string $type = 'mixed', + public string $typeTs = 'any', ) { } @@ -69,6 +69,14 @@ private static function make(ReflectionMethod $method): self $relation->typeTs = 'any'; } + if (! $relation->type) { + $relation->type = 'mixed'; + } + + if (! $relation->typeTs) { + $relation->typeTs = 'any'; + } + return $relation; } } From 7c5c5162fd7be80bc185f61ec6147ed19fb31322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ewilan=20Rivi=C3=A8re?= Date: Wed, 9 Aug 2023 12:10:32 +0200 Subject: [PATCH 6/7] docs --- lib/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/package.json b/lib/package.json index f48839d..b8bee64 100644 --- a/lib/package.json +++ b/lib/package.json @@ -5,7 +5,7 @@ "description": "Add some helpers for your Inertia app with TypeScript.", "author": "Ewilan Rivière ", "license": "MIT", - "homepage": "https://github.com/kiwilan/typescriptable-laravel/lib", + "homepage": "https://github.com/kiwilan/typescriptable-laravel/tree/main/lib", "repository": { "type": "git", "url": "git+https://github.com/kiwilan/typescriptable-laravel.git" From 4ad50f9d9661acb1c716bf464f294796da2556db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ewilan=20Rivi=C3=A8re?= Date: Wed, 9 Aug 2023 12:11:36 +0200 Subject: [PATCH 7/7] 1.11.01 - Add `EloquentRelation` fallback for `type` and `typeTs` --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 044e54c..4b9aa22 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "kiwilan/typescriptable-laravel", "description": "PHP package for Laravel to type Eloquent models, routes, Spatie Settings with autogenerated TypeScript. If you want to use some helpers with Inertia, you can install associated NPM package.", - "version": "1.11.0", + "version": "1.11.01", "keywords": [ "kiwilan", "laravel",