Skip to content

Commit

Permalink
fix: optimize repository dependencies/packages (#585)
Browse files Browse the repository at this point in the history
* fix: @codeimage/prisma-models build script
* feat: update ts version
* chore: update solidjs and fix types
* chore: update solid-use
  • Loading branch information
riccardoperra authored Nov 30, 2023
1 parent d68f3d0 commit 0dfd704
Show file tree
Hide file tree
Showing 32 changed files with 698 additions and 460 deletions.
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ To start contributing to the project, you have to fork this repository and clone
```bash
git clone https://github.com/YOUR_USERNAME/codeimage.git
```
### pulling submodules first time
```bash
git submodule update --init --recursive
```

### Installing Node.js and pnpm

This repository uses [pnpm](https://pnpm.io/it/) to manage multiple projects. You need to install **pnpm 7 or higher**
Expand Down
6 changes: 3 additions & 3 deletions apps/api/tsconfig.dts.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"emitDeclarationOnly": true,
"declarationMap": false,
"outDir": "./dist",
"moduleResolution": "Node16",
"module": "ES2022",
"moduleResolution": "NodeNext",
"module": "NodeNext",
"target": "ES2022"
}
}
}
4 changes: 2 additions & 2 deletions apps/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"moduleResolution": "NodeNext",
"module": "ES2022",
"module": "NodeNext",
"target": "ES2022",
"typeRoots": [
"./src/common/domainFunctions/functions.d.ts"
Expand All @@ -15,4 +15,4 @@
"include": [
"./src/**/*.ts"
]
}
}
6 changes: 3 additions & 3 deletions apps/codeimage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"prettier": "^2.8.4",
"rimraf": "^3.0.2",
"sass": "^1.58.3",
"typescript": "^4.9.5",
"typescript": "~5.3.2",
"vite": "^3.2.5",
"vite-plugin-pwa": "^0.14.7",
"vite-plugin-solid": "^2.7.0",
Expand Down Expand Up @@ -104,8 +104,8 @@
"rxjs": "^7.8.0",
"solid-codemirror": "^2.3.0",
"solid-headless": "^0.13.0",
"solid-js": "^1.7.3",
"solid-use": "^0.5.0",
"solid-js": "^1.8.6",
"solid-use": "^0.7.2",
"statebuilder": "^0.4.2",
"tinykeys": "^1.4.0",
"workbox-precaching": "^6.5.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {AVAILABLE_TERMINAL_THEMES} from '@core/configuration/terminal-themes';

import {children, createMemo, JSXElement, ParentComponent} from 'solid-js';
import {Dynamic} from 'solid-js/web';
import {omitProps} from 'solid-use';
import {omitProps} from 'solid-use/props';
import {CodeImageLogoV2} from '../../Icons/CodeImageLogoV2';
import * as styles from '../terminal.css';
import {BaseTerminalProps} from '../TerminalHost';
Expand Down
2 changes: 1 addition & 1 deletion apps/codeimage/src/core/hooks/isMobile.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type AppMode = 'full' | 'mobile';
import {useMediaQuery} from 'solid-use';
import {useMediaQuery} from 'solid-use/media-query';

export function useModality(): AppMode {
const phone = useMediaQuery(`screen and (max-width: 768px)`);
Expand Down
2 changes: 1 addition & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"node-html-parser": "^6.1.5",
"rollup": "^2.79.1",
"solid-start-node": "^0.2.26",
"typescript": "^4.8.4",
"typescript": "~5.3.2",
"vite": "^3.1.8"
},
"sideEffects": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"prettier": "^2.8.4",
"tslib": "^2.5.0",
"tsx": "^3.12.3",
"typescript": "^4.9.5",
"typescript": "~5.3.2",
"vite": "^3.2.5",
"@railway/cli": "^3.3.1"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/atomic-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
},
"peerDependencies": {
"rxjs": "^7.8.0",
"solid-js": "^1.6.8"
"solid-js": "^1.8.6"
},
"devDependencies": {
"@types/node": "^18.14.6",
"rollup": "^2.79.1",
"rollup-preset-solid": "^1.4.0",
"rxjs": "^7.8.0",
"solid-js": "1.6.3",
"solid-js": "^1.8.6",
"vite": "^3.2.5",
"vite-plugin-dts": "^1.7.3",
"vite-plugin-solid": "^2.6.1",
Expand Down
9 changes: 3 additions & 6 deletions packages/atomic-state/src/createStore.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import {from as rxjsFrom, map, type Observable, Subject} from 'rxjs';
import {Accessor, createSignal, from, observable} from 'solid-js';
import {
createStore as coreCreateStore,
SetStoreFunction,
unwrap,
} from 'solid-js/store';
import {createStore as coreCreateStore, unwrap} from 'solid-js/store';
import {SetStoreFunction} from './experimental/store-types';

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

const setStore = (...args: Parameters<typeof internalSetStore>) => {
const setStore = (...args: Parameters<SetStoreFunction<T>>) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const returnValue = (internalSetStore as any)(...args);
setSignal(Symbol());
Expand Down
8 changes: 3 additions & 5 deletions packages/atomic-state/src/createStoreSetters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {SetStoreFunction} from 'solid-js/store';
import {SetStoreFunction} from './experimental/store-types';
import {getStoreInternals} from './getStoreInternals';

// eslint-disable-next-line @typescript-eslint/ban-types
Expand Down Expand Up @@ -30,12 +30,10 @@ export function createStoreAutoSetters<T extends {}>(
{},
{
get(_, property: string) {
return (...args: Parameters<typeof $$setter>) => {
return (...args: any) => {
const [, prop] = property.split('set');
const lowerProperty = prop.charAt(0).toLowerCase() + prop.slice(1);
const fnArgs = [lowerProperty, ...args] as unknown as Parameters<
typeof $$setter
>;
const fnArgs = [lowerProperty, ...args] as unknown as any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
($$setter as any)(...fnArgs);
};
Expand Down
136 changes: 136 additions & 0 deletions packages/atomic-state/src/experimental/store-types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import type {
NotWrappable,
Part,
PickMutable,
StoreSetter,
} from 'solid-js/store/types/store';

type W<T> = Exclude<T, NotWrappable>;
type KeyOf<T> = number extends keyof T
? 0 extends 1 & T
? keyof T
: [T] extends [never]
? never
: [T] extends [readonly unknown[]]
? number
: keyof T
: keyof T;
type MutableKeyOf<T> = KeyOf<T> & keyof PickMutable<T>;

export interface SetStoreFunction<T> {
<
K1 extends KeyOf<W<T>>,
K2 extends KeyOf<W<W<T>[K1]>>,
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
K7 extends MutableKeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>,
>(
k1: Part<W<T>, K1>,
k2: Part<W<W<T>[K1]>, K2>,
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>,
setter: StoreSetter<
W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7],
[K7, K6, K5, K4, K3, K2, K1]
>,
): void;

<
K1 extends KeyOf<W<T>>,
K2 extends KeyOf<W<W<T>[K1]>>,
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
K6 extends MutableKeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
>(
k1: Part<W<T>, K1>,
k2: Part<W<W<T>[K1]>, K2>,
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
setter: StoreSetter<
W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6],
[K6, K5, K4, K3, K2, K1]
>,
): void;

<
K1 extends KeyOf<W<T>>,
K2 extends KeyOf<W<W<T>[K1]>>,
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
K5 extends MutableKeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
>(
k1: Part<W<T>, K1>,
k2: Part<W<W<T>[K1]>, K2>,
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
setter: StoreSetter<
W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5],
[K5, K4, K3, K2, K1]
>,
): void;

<
K1 extends KeyOf<W<T>>,
K2 extends KeyOf<W<W<T>[K1]>>,
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
K4 extends MutableKeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
>(
k1: Part<W<T>, K1>,
k2: Part<W<W<T>[K1]>, K2>,
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
setter: StoreSetter<W<W<W<W<T>[K1]>[K2]>[K3]>[K4], [K4, K3, K2, K1]>,
): void;

<
K1 extends KeyOf<W<T>>,
K2 extends KeyOf<W<W<T>[K1]>>,
K3 extends MutableKeyOf<W<W<W<T>[K1]>[K2]>>,
>(
k1: Part<W<T>, K1>,
k2: Part<W<W<T>[K1]>, K2>,
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
setter: StoreSetter<W<W<W<T>[K1]>[K2]>[K3], [K3, K2, K1]>,
): void;

<K1 extends KeyOf<W<T>>, K2 extends MutableKeyOf<W<W<T>[K1]>>>(
k1: Part<W<T>, K1>,
k2: Part<W<W<T>[K1]>, K2>,
setter: StoreSetter<W<W<T>[K1]>[K2], [K2, K1]>,
): void;

<K1 extends MutableKeyOf<W<T>>>(
k1: Part<W<T>, K1>,
setter: StoreSetter<W<T>[K1], [K1]>,
): void;

(setter: StoreSetter<T, []>): void;

// <
// K1 extends KeyOf<W<T>>,
// K2 extends KeyOf<W<W<T>[K1]>>,
// K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
// K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
// K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
// K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
// K7 extends KeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>,
// >(
// k1: Part<W<T>, K1>,
// k2: Part<W<W<T>[K1]>, K2>,
// k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
// k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
// k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
// k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
// k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>,
// // ...rest: Rest<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7], [K7, K6, K5, K4, K3, K2, K1]>
// ): void;
}
6 changes: 3 additions & 3 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@
"prettier-plugin-java": "2.0.0",
"prettier-plugin-rust": "0.1.8",
"prettier-plugin-sql": "0.12.1",
"solid-js": "1.6.3"
"solid-js": "^1.8.6"
},
"peerDependencies": {
"@codeimage/highlight": "workspace:*",
"@codemirror/language": "^6.3.1",
"@codemirror/state": "^6.1.4",
"@codemirror/view": "^6.6.0",
"solid-js": "^1.6.3"
"solid-js": "^1.8.6"
},
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^4.9.5",
"typescript": "~5.3.2",
"vite": "^3.2.5",
"vite-plugin-dts": "^1.7.3",
"vite-plugin-solid": "^2.6.1"
Expand Down
1 change: 0 additions & 1 deletion packages/config/tsconfig.dts.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": {
"declaration": true,
"declarationMap": false,
"emitDeclarationOnly": true,
"outDir": "./dist"
}
}
6 changes: 3 additions & 3 deletions packages/dom-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"prettier": "^2.8.4",
"rimraf": "^3.0.2",
"tslib": "^2.5.0",
"typescript": "^4.9.5",
"typescript": "~5.3.2",
"vite": "^3.2.5",
"vite-plugin-dts": "^1.7.3",
"vitest": "0.26.2"
Expand All @@ -71,10 +71,10 @@
},
"dependencies": {
"@solid-primitives/platform": "^0.0.101",
"solid-js": "1.6.3"
"solid-js": "^1.8.6"
},
"peerDependencies": {
"@solid-primitives/platform": "^0.0.101",
"solid-js": "^1.5.2"
"solid-js": "^1.8.6"
}
}
4 changes: 2 additions & 2 deletions packages/highlight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@
"rollup": "^2.79.1",
"rollup-plugin-dts": "^5.2.0",
"solid-codemirror": "^2.2.1",
"solid-js": "^1.7.3",
"solid-js": "^1.8.6",
"ts-morph": "16.0.0",
"typescript": "^4.9.5",
"typescript": "~5.3.2",
"vite": "^3.2.5",
"vite-plugin-dts": "^1.7.3",
"vite-plugin-solid": "^2.6.1"
Expand Down
1 change: 0 additions & 1 deletion packages/kit
Submodule kit deleted from 34dae9
6 changes: 3 additions & 3 deletions packages/locale/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
},
"dependencies": {
"@solid-primitives/i18n": "^1.2.4",
"solid-js": "^1.7.3"
"solid-js": "^1.8.6"
},
"peerDependencies": {
"solid-js": "^1.7.3"
"solid-js": "^1.8.6"
},
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^4.9.5",
"typescript": "~5.3.2",
"vite": "^3.2.5",
"vite-plugin-dts": "^2.2.0",
"vite-plugin-solid": "^2.7.0"
Expand Down
7 changes: 4 additions & 3 deletions packages/prisma-models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"
"build": "tsx ./scripts/build.ts",
"build:ts": "tsc"
},
"keywords": [],
"author": "Riccardo Perra",
"license": "MIT",
"devDependencies": {
"typescript": "^4.9.5"
"typescript": "~5.3.2"
}
}
}
Loading

0 comments on commit 0dfd704

Please sign in to comment.