diff --git a/.gitignore b/.gitignore index ffadb1a..8083453 100755 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ coverage *.tgz LLMLOG.md .turbo +.turbo/ +**/*/.turbo +tsconfig.tsbuildinfo diff --git a/package.json b/package.json index 1490f48..197ce3f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "jest.config.js", "scripts": { "build": "turbo run build", - "build:package": "turbo run build:package", + "build:package": "turbo run build:package --filter=@open-rpc/logs-react^... --filter=@open-rpc/inspector^...", "test": "turbo run test", "lint": "turbo run lint", "watch": "turbo run build test --watch", diff --git a/packages/docs-react/package.json b/packages/docs-react/package.json index 4cd44e9..55ed3ab 100644 --- a/packages/docs-react/package.json +++ b/packages/docs-react/package.json @@ -2,7 +2,16 @@ "name": "@open-rpc/docs-react", "version": "0.0.0-development", "description": "", + "type": "module", "main": "build/index.js", + "module": "build/index.js", + "types": "build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "import": "./build/index.js" + } + }, "scripts": { "lint": "eslint 'src/**/*.{ts,tsx}'", "build": "tsc --project tsconfig.json && cp src/ContentDescriptor/ContentDescriptor.css build/ContentDescriptor/", diff --git a/packages/inspector/.turbo/turbo-build$colon$package.log b/packages/inspector/.turbo/turbo-build$colon$package.log index 48964bc..d0cbde1 100644 --- a/packages/inspector/.turbo/turbo-build$colon$package.log +++ b/packages/inspector/.turbo/turbo-build$colon$package.log @@ -1,4 +1,32 @@ -> @open-rpc/inspector@0.0.0-development build:package /Users/shanejonas/code/openrpc/tools/packages/inspector +> @open-rpc/inspector@0.0.0-development build:package /Users/zcstarr/src/open-rpc/tools/packages/inspector > tsc --project tsconfig.json +src/containers/Inspector.tsx:41:43 - error TS2307: Cannot find module '@open-rpc/logs-react' or its corresponding type declarations. + +41 import JSONRPCLogger, { JSONRPCLog } from "@open-rpc/logs-react"; +   ~~~~~~~~~~~~~~~~~~~~~~ + +src/hooks/useTabs.ts:3:28 - error TS2307: Cannot find module '@open-rpc/logs-react' or its corresponding type declarations. + +3 import { JSONRPCLog } from "@open-rpc/logs-react"; +   ~~~~~~~~~~~~~~~~~~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/containers/Inspector.tsx:41 + 1 src/hooks/useTabs.ts:3 +npm ERR! code ELIFECYCLE +npm ERR! errno 2 +npm ERR! @open-rpc/inspector@0.0.0-development build:package: `tsc --project tsconfig.json` +npm ERR! Exit status 2 +npm ERR! +npm ERR! Failed at the @open-rpc/inspector@0.0.0-development build:package script. +npm ERR! This is probably not a problem with npm. There is likely additional logging output above. +npm WARN Local package.json exists, but node_modules missing, did you mean to install? + +npm ERR! A complete log of this run can be found in: +npm ERR! /Users/zcstarr/.npm/_logs/2024-12-05T04_11_45_527Z-debug.log + diff --git a/packages/inspector/package.json b/packages/inspector/package.json index 791ef34..df88ab6 100644 --- a/packages/inspector/package.json +++ b/packages/inspector/package.json @@ -2,9 +2,17 @@ "name": "@open-rpc/inspector", "version": "0.0.0-development", "description": "", - "main": "package/index.js", + "main": "build/index.js", + "module": "build/index.js", + "types": "build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "import": "./build/index.js" + } + }, "files": [ - "package/" + "build/" ], "publishConfig": { "access": "public" @@ -14,8 +22,8 @@ "build": "rescripts build", "lint": "eslint 'src/**/*.{ts,tsx}'", "test": "jest", - "build:package": "tsc --project tsconfig.json", - "clean": "rm -rf package build coverage", + "build:package": "tsc --build tsconfig.json", + "clean": "rm -rf build coverage", "format": "prettier --write 'src/**/*.{ts,tsx,js,jsx,json,md}'" }, "author": "", @@ -49,7 +57,7 @@ "@material-ui/lab": "4.0.0-alpha.47", "@monaco-editor/react": "^4.0.0", "@open-rpc/client-js": "^1.6.3", - "@open-rpc/logs-react": "*", + "@open-rpc/logs-react": "workspace:*", "@open-rpc/meta-schema": "^1.14.9", "@open-rpc/schema-utils-js": "^1.14.3", "@rehooks/window-size": "^1.0.2", diff --git a/packages/inspector/tsconfig.json b/packages/inspector/tsconfig.json index 67f8b17..def6124 100644 --- a/packages/inspector/tsconfig.json +++ b/packages/inspector/tsconfig.json @@ -1,8 +1,11 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./package", + "outDir": "./build", "rootDir": "./src" }, - "include": ["src"] + "include": ["src"], + "references": [ + { "path": "../logs-react" } + ] } diff --git a/packages/logs-react/.turbo/turbo-build$colon$package.log b/packages/logs-react/.turbo/turbo-build$colon$package.log index 1a4f8dc..0879e9d 100644 --- a/packages/logs-react/.turbo/turbo-build$colon$package.log +++ b/packages/logs-react/.turbo/turbo-build$colon$package.log @@ -1,7 +1,4 @@ -> @open-rpc/logs-react@0.0.0-development build:package /Users/shanejonas/code/openrpc/tools/packages/logs-react -> tsc --project tsconfig.json && mv package/exports.d.ts package/index.d.ts && mv package/exports.js package/index.js && find src/components -mindepth 1 -maxdepth 1 -type d -exec sh -c 'for f in {}/*.css; do cp "$f" "package/components/$(basename {})"; done' {} \; +> @open-rpc/logs-react@0.0.0-development build:package /Users/zcstarr/src/open-rpc/tools/packages/logs-react +> tsc --build tsconfig.json && cp -r src/**/*.css build/ -cp: src/components/logsReact/*.css: No such file or directory -cp: src/components/alert/*.css: No such file or directory -cp: src/components/logChips/*.css: No such file or directory diff --git a/packages/logs-react/package.json b/packages/logs-react/package.json index 61c2900..0d2f17c 100644 --- a/packages/logs-react/package.json +++ b/packages/logs-react/package.json @@ -2,10 +2,18 @@ "name": "@open-rpc/logs-react", "version": "0.0.0-development", "description": "", - "main": "package/index.js", + "main": "build/index.js", + "module": "build/index.js", + "types": "build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "import": "./build/index.js" + } + }, "homepage": "https://open-rpc.github.io/logs-react/", "files": [ - "package/" + "build/" ], "publishConfig": { "access": "public" @@ -13,10 +21,10 @@ "scripts": { "start": "vite", "build": "vite build", - "build:package": "tsc --project tsconfig.json && mv package/exports.d.ts package/index.d.ts && mv package/exports.js package/index.js && find src/components -mindepth 1 -maxdepth 1 -type d -exec sh -c 'for f in {}/*.css; do cp \"$f\" \"package/components/$(basename {})\"; done' {} \\;", + "build:package": "tsc --build tsconfig.json && cp -r src/**/*.css build/", "lint": "eslint 'src/**/*.{ts,tsx}'", "test": "jest", - "clean": "rm -rf package build coverage", + "clean": "rm -rf build coverage", "format": "prettier --write 'src/**/*.{ts,tsx,js,jsx,json,md}'" }, "author": "", diff --git a/packages/logs-react/tsconfig.json b/packages/logs-react/tsconfig.json index 67f8b17..922fbe2 100644 --- a/packages/logs-react/tsconfig.json +++ b/packages/logs-react/tsconfig.json @@ -1,8 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./package", - "rootDir": "./src" + "outDir": "./build", + "rootDir": "./src", + "composite": true }, "include": ["src"] } diff --git a/packages/playground/package.json b/packages/playground/package.json index 41f6eca..0a4a8fc 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -15,7 +15,7 @@ "@material-ui/core": "4.9.8", "@material-ui/icons": "4.9.1", "@material-ui/lab": "4.0.0-alpha.47", - "@open-rpc/docs-react": "*", + "@open-rpc/docs-react": "workspace:*", "@open-rpc/examples": "^1.3.3", "@open-rpc/inspector": "*", "@open-rpc/meta-schema": "^1.14.9", @@ -70,5 +70,15 @@ }, "engines": { "node": ">=18.20.5" + }, + "type": "module", + "main": "build/index.js", + "module": "build/index.js", + "types": "build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "import": "./build/index.js" + } } } diff --git a/packages/playground/tsconfig.json b/packages/playground/tsconfig.json index 58d4df3..2e63b7f 100644 --- a/packages/playground/tsconfig.json +++ b/packages/playground/tsconfig.json @@ -9,6 +9,9 @@ "isolatedModules": true, "noEmit": true }, + "references": [ + { "path": "../logs-react" } + ], "include": [ "src" ] diff --git a/packages/playground/vite.config.ts b/packages/playground/vite.config.ts index df19f7a..f866ef6 100644 --- a/packages/playground/vite.config.ts +++ b/packages/playground/vite.config.ts @@ -7,6 +7,9 @@ export default defineConfig({ react(), monacoEditorPlugin({}) ], + resolve: { + preserveSymlinks: true + }, build: { outDir: 'dist', sourcemap: true diff --git a/tsconfig.json b/tsconfig.json index e9bf89b..3e688ee 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,23 @@ { "compilerOptions": { - "target": "es5", - "module": "commonjs", - "lib": ["dom", "es2015", "es2016", "es2017"], + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "bundler", + "esModuleInterop": true, "jsx": "react", "declaration": true, - "sourceMap": true, "strict": true, - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "composite": true, + "baseUrl": ".", + "paths": { + "@open-rpc/*": ["packages/*/src"] + } }, - "exclude": ["node_modules", "build", "dist", "package"] + "references": [ + { "path": "packages/logs-react" }, + { "path": "packages/inspector" }, + { "path": "packages/docs-react" }, + { "path": "packages/playground" } + ] }