Skip to content

Commit

Permalink
feat(connect): added scalars as peer dep
Browse files Browse the repository at this point in the history
  • Loading branch information
gpuente committed Oct 25, 2024
1 parent d649dc1 commit 2e6c42c
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 9 deletions.
27 changes: 21 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"vite": "^5.4.8",
"vite-envs": "^4.4.5"
},
"peerDependencies": {
"@powerhousedao/scalars": "latest"
},
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
Expand All @@ -61,6 +64,7 @@
"@electron-forge/publisher-github": "^7.2.0",
"@playwright/test": "^1.41.2",
"@powerhousedao/design-system": "^1.4.0",
"@powerhousedao/scalars": "latest",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.4",
Expand All @@ -82,7 +86,7 @@
"did-key-creator": "^1.2.0",
"document-drive": "^1.0.2",
"document-model": "^2.2.0",
"document-model-libs": "^1.101.0",
"document-model-libs": "^1.102.0",
"electron": "30.0.0",
"electron-is-dev": "^3.0.1",
"electron-playwright-helpers": "^1.7.1",
Expand Down
13 changes: 13 additions & 0 deletions studio/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const studioDirname = fileURLToPath(new URL('.', import.meta.url));
const appPath = join(studioDirname, '..');
const viteEnvsScript = join(appPath, 'vite-envs.sh');

const projectRoot = process.cwd();

// silences dynamic import warnings
const logger = createLogger();
// eslint-disable-next-line @typescript-eslint/unbound-method
Expand Down Expand Up @@ -66,6 +68,17 @@ export async function startServer() {
open: true,
host: Boolean(process.env.HOST),
},
resolve: {
alias: {
// Resolve to the node_modules in the project root
'@powerhousedao/scalars': join(
projectRoot,
'node_modules',
'@powerhousedao',
'scalars',
),
},
},
plugins: [
viteConnectDevStudioPlugin(true),
viteEnvs({
Expand Down
3 changes: 2 additions & 1 deletion studio/vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ export function viteConnectDevStudioPlugin(
studioConfig[LOCAL_DOCUMENT_EDITORS_IMPORT];

return [
enabled && viteIgnoreStaticImport([externalImports]),
enabled &&
viteIgnoreStaticImport([externalImports, '@powerhousedao/scalars']),
{
name: 'vite-plugin-connect-dev-studio',
enforce: 'pre',
Expand Down
6 changes: 5 additions & 1 deletion vite.renderer.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ export default defineConfig(({ mode }) => {
? `${chunk.name}.js`
: 'assets/[name].[hash].js',
},
external: ['node:crypto', externalIds],
external: [
'node:crypto',
externalIds,
'@powerhousedao/scalars',
],
},
},
resolve: {
Expand Down

0 comments on commit 2e6c42c

Please sign in to comment.