Skip to content

Commit 0dfd704

Browse files
fix: optimize repository dependencies/packages (#585)
* fix: @codeimage/prisma-models build script * feat: update ts version * chore: update solidjs and fix types * chore: update solid-use
1 parent d68f3d0 commit 0dfd704

File tree

32 files changed

+698
-460
lines changed

32 files changed

+698
-460
lines changed

CONTRIBUTING.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ To start contributing to the project, you have to fork this repository and clone
2626
```bash
2727
git clone https://github.com/YOUR_USERNAME/codeimage.git
2828
```
29-
### pulling submodules first time
30-
```bash
31-
git submodule update --init --recursive
32-
```
29+
3330
### Installing Node.js and pnpm
3431

3532
This repository uses [pnpm](https://pnpm.io/it/) to manage multiple projects. You need to install **pnpm 7 or higher**

apps/api/tsconfig.dts.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"emitDeclarationOnly": true,
66
"declarationMap": false,
77
"outDir": "./dist",
8-
"moduleResolution": "Node16",
9-
"module": "ES2022",
8+
"moduleResolution": "NodeNext",
9+
"module": "NodeNext",
1010
"target": "ES2022"
1111
}
12-
}
12+
}

apps/api/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"allowSyntheticDefaultImports": true,
77
"sourceMap": true,
88
"moduleResolution": "NodeNext",
9-
"module": "ES2022",
9+
"module": "NodeNext",
1010
"target": "ES2022",
1111
"typeRoots": [
1212
"./src/common/domainFunctions/functions.d.ts"
@@ -15,4 +15,4 @@
1515
"include": [
1616
"./src/**/*.ts"
1717
]
18-
}
18+
}

apps/codeimage/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"prettier": "^2.8.4",
2626
"rimraf": "^3.0.2",
2727
"sass": "^1.58.3",
28-
"typescript": "^4.9.5",
28+
"typescript": "~5.3.2",
2929
"vite": "^3.2.5",
3030
"vite-plugin-pwa": "^0.14.7",
3131
"vite-plugin-solid": "^2.7.0",
@@ -104,8 +104,8 @@
104104
"rxjs": "^7.8.0",
105105
"solid-codemirror": "^2.3.0",
106106
"solid-headless": "^0.13.0",
107-
"solid-js": "^1.7.3",
108-
"solid-use": "^0.5.0",
107+
"solid-js": "^1.8.6",
108+
"solid-use": "^0.7.2",
109109
"statebuilder": "^0.4.2",
110110
"tinykeys": "^1.4.0",
111111
"workbox-precaching": "^6.5.4",

apps/codeimage/src/components/Terminal/DynamicTerminal/DynamicTerminal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {AVAILABLE_TERMINAL_THEMES} from '@core/configuration/terminal-themes';
33

44
import {children, createMemo, JSXElement, ParentComponent} from 'solid-js';
55
import {Dynamic} from 'solid-js/web';
6-
import {omitProps} from 'solid-use';
6+
import {omitProps} from 'solid-use/props';
77
import {CodeImageLogoV2} from '../../Icons/CodeImageLogoV2';
88
import * as styles from '../terminal.css';
99
import {BaseTerminalProps} from '../TerminalHost';

apps/codeimage/src/core/hooks/isMobile.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type AppMode = 'full' | 'mobile';
2-
import {useMediaQuery} from 'solid-use';
2+
import {useMediaQuery} from 'solid-use/media-query';
33

44
export function useModality(): AppMode {
55
const phone = useMediaQuery(`screen and (max-width: 768px)`);

apps/website/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"node-html-parser": "^6.1.5",
1414
"rollup": "^2.79.1",
1515
"solid-start-node": "^0.2.26",
16-
"typescript": "^4.8.4",
16+
"typescript": "~5.3.2",
1717
"vite": "^3.1.8"
1818
},
1919
"sideEffects": true,

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"prettier": "^2.8.4",
8686
"tslib": "^2.5.0",
8787
"tsx": "^3.12.3",
88-
"typescript": "^4.9.5",
88+
"typescript": "~5.3.2",
8989
"vite": "^3.2.5",
9090
"@railway/cli": "^3.3.1"
9191
},

packages/atomic-state/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
},
3535
"peerDependencies": {
3636
"rxjs": "^7.8.0",
37-
"solid-js": "^1.6.8"
37+
"solid-js": "^1.8.6"
3838
},
3939
"devDependencies": {
4040
"@types/node": "^18.14.6",
4141
"rollup": "^2.79.1",
4242
"rollup-preset-solid": "^1.4.0",
4343
"rxjs": "^7.8.0",
44-
"solid-js": "1.6.3",
44+
"solid-js": "^1.8.6",
4545
"vite": "^3.2.5",
4646
"vite-plugin-dts": "^1.7.3",
4747
"vite-plugin-solid": "^2.6.1",

packages/atomic-state/src/createStore.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import {from as rxjsFrom, map, type Observable, Subject} from 'rxjs';
22
import {Accessor, createSignal, from, observable} from 'solid-js';
3-
import {
4-
createStore as coreCreateStore,
5-
SetStoreFunction,
6-
unwrap,
7-
} from 'solid-js/store';
3+
import {createStore as coreCreateStore, unwrap} from 'solid-js/store';
4+
import {SetStoreFunction} from './experimental/store-types';
85

96
export type StoreEvent = {
107
type: string;
@@ -41,7 +38,7 @@ export function createStore<T extends object>(initialState: T) {
4138
);
4239
const [signal, setSignal] = createSignal<symbol>();
4340

44-
const setStore = (...args: Parameters<typeof internalSetStore>) => {
41+
const setStore = (...args: Parameters<SetStoreFunction<T>>) => {
4542
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4643
const returnValue = (internalSetStore as any)(...args);
4744
setSignal(Symbol());

packages/atomic-state/src/createStoreSetters.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SetStoreFunction} from 'solid-js/store';
1+
import {SetStoreFunction} from './experimental/store-types';
22
import {getStoreInternals} from './getStoreInternals';
33

44
// eslint-disable-next-line @typescript-eslint/ban-types
@@ -30,12 +30,10 @@ export function createStoreAutoSetters<T extends {}>(
3030
{},
3131
{
3232
get(_, property: string) {
33-
return (...args: Parameters<typeof $$setter>) => {
33+
return (...args: any) => {
3434
const [, prop] = property.split('set');
3535
const lowerProperty = prop.charAt(0).toLowerCase() + prop.slice(1);
36-
const fnArgs = [lowerProperty, ...args] as unknown as Parameters<
37-
typeof $$setter
38-
>;
36+
const fnArgs = [lowerProperty, ...args] as unknown as any;
3937
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4038
($$setter as any)(...fnArgs);
4139
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import type {
2+
NotWrappable,
3+
Part,
4+
PickMutable,
5+
StoreSetter,
6+
} from 'solid-js/store/types/store';
7+
8+
type W<T> = Exclude<T, NotWrappable>;
9+
type KeyOf<T> = number extends keyof T
10+
? 0 extends 1 & T
11+
? keyof T
12+
: [T] extends [never]
13+
? never
14+
: [T] extends [readonly unknown[]]
15+
? number
16+
: keyof T
17+
: keyof T;
18+
type MutableKeyOf<T> = KeyOf<T> & keyof PickMutable<T>;
19+
20+
export interface SetStoreFunction<T> {
21+
<
22+
K1 extends KeyOf<W<T>>,
23+
K2 extends KeyOf<W<W<T>[K1]>>,
24+
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
25+
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
26+
K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
27+
K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
28+
K7 extends MutableKeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>,
29+
>(
30+
k1: Part<W<T>, K1>,
31+
k2: Part<W<W<T>[K1]>, K2>,
32+
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
33+
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
34+
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
35+
k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
36+
k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>,
37+
setter: StoreSetter<
38+
W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7],
39+
[K7, K6, K5, K4, K3, K2, K1]
40+
>,
41+
): void;
42+
43+
<
44+
K1 extends KeyOf<W<T>>,
45+
K2 extends KeyOf<W<W<T>[K1]>>,
46+
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
47+
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
48+
K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
49+
K6 extends MutableKeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
50+
>(
51+
k1: Part<W<T>, K1>,
52+
k2: Part<W<W<T>[K1]>, K2>,
53+
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
54+
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
55+
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
56+
k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
57+
setter: StoreSetter<
58+
W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6],
59+
[K6, K5, K4, K3, K2, K1]
60+
>,
61+
): void;
62+
63+
<
64+
K1 extends KeyOf<W<T>>,
65+
K2 extends KeyOf<W<W<T>[K1]>>,
66+
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
67+
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
68+
K5 extends MutableKeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
69+
>(
70+
k1: Part<W<T>, K1>,
71+
k2: Part<W<W<T>[K1]>, K2>,
72+
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
73+
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
74+
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
75+
setter: StoreSetter<
76+
W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5],
77+
[K5, K4, K3, K2, K1]
78+
>,
79+
): void;
80+
81+
<
82+
K1 extends KeyOf<W<T>>,
83+
K2 extends KeyOf<W<W<T>[K1]>>,
84+
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
85+
K4 extends MutableKeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
86+
>(
87+
k1: Part<W<T>, K1>,
88+
k2: Part<W<W<T>[K1]>, K2>,
89+
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
90+
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
91+
setter: StoreSetter<W<W<W<W<T>[K1]>[K2]>[K3]>[K4], [K4, K3, K2, K1]>,
92+
): void;
93+
94+
<
95+
K1 extends KeyOf<W<T>>,
96+
K2 extends KeyOf<W<W<T>[K1]>>,
97+
K3 extends MutableKeyOf<W<W<W<T>[K1]>[K2]>>,
98+
>(
99+
k1: Part<W<T>, K1>,
100+
k2: Part<W<W<T>[K1]>, K2>,
101+
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
102+
setter: StoreSetter<W<W<W<T>[K1]>[K2]>[K3], [K3, K2, K1]>,
103+
): void;
104+
105+
<K1 extends KeyOf<W<T>>, K2 extends MutableKeyOf<W<W<T>[K1]>>>(
106+
k1: Part<W<T>, K1>,
107+
k2: Part<W<W<T>[K1]>, K2>,
108+
setter: StoreSetter<W<W<T>[K1]>[K2], [K2, K1]>,
109+
): void;
110+
111+
<K1 extends MutableKeyOf<W<T>>>(
112+
k1: Part<W<T>, K1>,
113+
setter: StoreSetter<W<T>[K1], [K1]>,
114+
): void;
115+
116+
(setter: StoreSetter<T, []>): void;
117+
118+
// <
119+
// K1 extends KeyOf<W<T>>,
120+
// K2 extends KeyOf<W<W<T>[K1]>>,
121+
// K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
122+
// K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
123+
// K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
124+
// K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
125+
// K7 extends KeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>,
126+
// >(
127+
// k1: Part<W<T>, K1>,
128+
// k2: Part<W<W<T>[K1]>, K2>,
129+
// k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
130+
// k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
131+
// k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
132+
// k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
133+
// k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>,
134+
// // ...rest: Rest<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7], [K7, K6, K5, K4, K3, K2, K1]>
135+
// ): void;
136+
}

packages/config/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@
5656
"prettier-plugin-java": "2.0.0",
5757
"prettier-plugin-rust": "0.1.8",
5858
"prettier-plugin-sql": "0.12.1",
59-
"solid-js": "1.6.3"
59+
"solid-js": "^1.8.6"
6060
},
6161
"peerDependencies": {
6262
"@codeimage/highlight": "workspace:*",
6363
"@codemirror/language": "^6.3.1",
6464
"@codemirror/state": "^6.1.4",
6565
"@codemirror/view": "^6.6.0",
66-
"solid-js": "^1.6.3"
66+
"solid-js": "^1.8.6"
6767
},
6868
"devDependencies": {
6969
"rimraf": "^3.0.2",
70-
"typescript": "^4.9.5",
70+
"typescript": "~5.3.2",
7171
"vite": "^3.2.5",
7272
"vite-plugin-dts": "^1.7.3",
7373
"vite-plugin-solid": "^2.6.1"

packages/config/tsconfig.dts.json

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"compilerOptions": {
44
"declaration": true,
55
"declarationMap": false,
6-
"emitDeclarationOnly": true,
76
"outDir": "./dist"
87
}
98
}

packages/dom-export/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"prettier": "^2.8.4",
6161
"rimraf": "^3.0.2",
6262
"tslib": "^2.5.0",
63-
"typescript": "^4.9.5",
63+
"typescript": "~5.3.2",
6464
"vite": "^3.2.5",
6565
"vite-plugin-dts": "^1.7.3",
6666
"vitest": "0.26.2"
@@ -71,10 +71,10 @@
7171
},
7272
"dependencies": {
7373
"@solid-primitives/platform": "^0.0.101",
74-
"solid-js": "1.6.3"
74+
"solid-js": "^1.8.6"
7575
},
7676
"peerDependencies": {
7777
"@solid-primitives/platform": "^0.0.101",
78-
"solid-js": "^1.5.2"
78+
"solid-js": "^1.8.6"
7979
}
8080
}

packages/highlight/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@
255255
"rollup": "^2.79.1",
256256
"rollup-plugin-dts": "^5.2.0",
257257
"solid-codemirror": "^2.2.1",
258-
"solid-js": "^1.7.3",
258+
"solid-js": "^1.8.6",
259259
"ts-morph": "16.0.0",
260-
"typescript": "^4.9.5",
260+
"typescript": "~5.3.2",
261261
"vite": "^3.2.5",
262262
"vite-plugin-dts": "^1.7.3",
263263
"vite-plugin-solid": "^2.6.1"

packages/kit

-1
This file was deleted.

packages/locale/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
},
3232
"dependencies": {
3333
"@solid-primitives/i18n": "^1.2.4",
34-
"solid-js": "^1.7.3"
34+
"solid-js": "^1.8.6"
3535
},
3636
"peerDependencies": {
37-
"solid-js": "^1.7.3"
37+
"solid-js": "^1.8.6"
3838
},
3939
"devDependencies": {
4040
"rimraf": "^3.0.2",
41-
"typescript": "^4.9.5",
41+
"typescript": "~5.3.2",
4242
"vite": "^3.2.5",
4343
"vite-plugin-dts": "^2.2.0",
4444
"vite-plugin-solid": "^2.7.0"

packages/prisma-models/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
},
2020
"scripts": {
2121
"test": "echo \"Error: no test specified\" && exit 1",
22-
"build": "tsc"
22+
"build": "tsx ./scripts/build.ts",
23+
"build:ts": "tsc"
2324
},
2425
"keywords": [],
2526
"author": "Riccardo Perra",
2627
"license": "MIT",
2728
"devDependencies": {
28-
"typescript": "^4.9.5"
29+
"typescript": "~5.3.2"
2930
}
30-
}
31+
}

0 commit comments

Comments
 (0)