Utilise tsconfig paths for workspace module resolution (#454)

* use @sd/client for tsconfig extends

* move all svgs to @sd/assets

* only use vite-tsconfig-paths

* remove ui from web

* use relative extends for ui tsconfig

* remove aliases from landing?

* use wacky landing vite config

* try using tsconfig paths and root on landing

* Revert "try using tsconfig paths and root on landing"

This reverts commit 43bd2a0f84.

* remove tsconfig-paths from landing
This commit is contained in:
Brendan Allan
2022-11-07 12:18:41 +08:00
committed by GitHub
parent 998abb8f2c
commit cc84db49c8
21 changed files with 24 additions and 33 deletions

View File

@@ -12,8 +12,8 @@
"dmg": "open ../../target/release/bundle/dmg/"
},
"dependencies": {
"@rspc/tauri": "^0.0.0-main-7c0a67c1",
"@rspc/client": "^0.0.0-main-7c0a67c1",
"@rspc/tauri": "^0.0.0-main-7c0a67c1",
"@sd/client": "workspace:*",
"@sd/interface": "workspace:*",
"@sd/ui": "workspace:*",
@@ -22,6 +22,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@sd/config": "workspace:*",
"@tauri-apps/cli": "1.1.1",
"@tauri-apps/tauricon": "github:tauri-apps/tauricon",
"@types/babel-core": "^6.25.7",
@@ -33,6 +34,7 @@
"sass": "^1.55.0",
"typescript": "^4.8.4",
"vite": "^3.1.4",
"vite-plugin-svgr": "^2.2.1"
"vite-plugin-svgr": "^2.2.1",
"vite-tsconfig-paths": "^3.5.2"
}
}

View File

@@ -1,7 +1,4 @@
{
"extends": "../../packages/config/interface.tsconfig.json",
"compilerOptions": {
"target": "es2020"
},
"extends": "@sd/config/interface.tsconfig.json",
"include": ["src"]
}

View File

@@ -1,6 +1,7 @@
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import svgr from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-tsconfig-paths';
import { name, version } from './package.json';
@@ -10,6 +11,7 @@ export default defineConfig({
port: 8001
},
plugins: [
tsconfigPaths(),
react(),
svgr({
svgrOptions: {

View File

@@ -12,12 +12,12 @@
"@rspc/client": "^0.0.0-main-7c0a67c1",
"@sd/client": "workspace:*",
"@sd/interface": "workspace:*",
"@sd/ui": "workspace:*",
"@tanstack/react-query": "^4.12.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@sd/config": "workspace:*",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^2.1.0",
@@ -28,6 +28,6 @@
"vite": "^3.1.4",
"vite-plugin-html": "^3.2.0",
"vite-plugin-svgr": "^2.2.1",
"vite-plugin-tsconfig-paths": "^1.2.0"
"vite-tsconfig-paths": "^3.5.2"
}
}

View File

@@ -1,5 +1,4 @@
{
"extends": "../../packages/config/interface.tsconfig.json",
"compilerOptions": {},
"extends": "@sd/config/interface.tsconfig.json",
"include": ["src"]
}

View File

@@ -3,7 +3,7 @@ import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';
import { createHtmlPlugin } from 'vite-plugin-html';
import svg from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-plugin-tsconfig-paths';
import tsconfigPaths from 'vite-tsconfig-paths';
import { name, version } from './package.json';
@@ -13,9 +13,9 @@ export default defineConfig({
port: 8002
},
plugins: [
tsconfigPaths(),
react(),
svg({ svgrOptions: { icon: true } }),
tsconfigPaths(),
createHtmlPlugin({
minify: true
}),
@@ -25,7 +25,6 @@ export default defineConfig({
})
],
root: 'src',
publicDir: '../../packages/interface/src/assets',
define: {
pkgJson: { name, version }
},

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 288 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 721 B

View File

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

View File

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 315 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -8,8 +8,6 @@
],
"scripts": {
"test": "jest",
"dev": "tsc -w",
"build": "tsc",
"lint": "TIMING=1 eslint src --fix",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
},

View File

@@ -23,7 +23,8 @@
"paths": {
"@sd/interface": ["../../packages/interface"],
"@sd/ui": ["../../packages/ui"],
"@sd/client": ["../../packages/client"]
"@sd/client": ["../../packages/client"],
"@sd/assets": ["../../packages/assets"]
}
},
"exclude": ["node_modules"]

View File

@@ -1,9 +1,9 @@
import closeIconPath from '@sd/assets/svgs/macos_close.svg';
import fullscreenIconPath from '@sd/assets/svgs/macos_fullscreen.svg';
import minimizeIconPath from '@sd/assets/svgs/macos_minimize.svg';
import clsx from 'clsx';
import { HTMLAttributes, useEffect, useRef } from 'react';
import closeIconPath from '../../assets/svg/macos_close.svg';
import fullscreenIconPath from '../../assets/svg/macos_fullscreen.svg';
import minimizeIconPath from '../../assets/svg/macos_minimize.svg';
import { useFocusState } from '../../hooks/useFocusState';
import { DefaultProps } from '../primitive/types';

View File

@@ -1,8 +1,4 @@
{
"extends": "../config/interface.tsconfig.json",
"compilerOptions": {
"target": "es2020",
"outDir": "./dist"
},
"include": ["src", "../ui/src/Dialog.tsx", "../ui/src/Loader.tsx"]
"extends": "@sd/config/interface.tsconfig.json",
"include": ["src"]
}

View File

@@ -12,7 +12,6 @@
"./package.json": "./package.json"
},
"scripts": {
"build": "tsc",
"storybook": "start-storybook -p 6006",
"storybook:build": "build-storybook"
},

View File

@@ -1,9 +1,7 @@
{
"extends": "../config/base.tsconfig.json",
"include": [
"src"
],
"compilerOptions": {
"outDir": "./dist"
}
"extends": "../config/interface.tsconfig.json",
"include": ["src"],
"compilerOptions": {
"outDir": "./dist"
}
}

BIN
pnpm-lock.yaml generated
View File

Binary file not shown.