Skip to content

Commit

Permalink
Merge pull request #2793 from evidence-dev/fix/dont-import-injectedEv…
Browse files Browse the repository at this point in the history
…idenceImports-in-template-vite-config

fix: dont import injectedEvidenceImports in template vite config
  • Loading branch information
zachstence authored Nov 14, 2024
2 parents 4ff8faa + cb93ac3 commit aab7c3e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-toes-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@evidence-dev/duckdb': patch
---

Upgrade duckdb-async to 1.1.3
5 changes: 5 additions & 0 deletions .changeset/wet-tips-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@evidence-dev/evidence': patch
---

Dont import injectedEvidenceImports in template vite config. Instead, just put the packages in as strings when building the template.
4 changes: 2 additions & 2 deletions packages/datasources/duckdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@evidence-dev/db-commons": "workspace:*",
"duckdb-async": "1.0.0"
"duckdb-async": "1.1.3"
},
"devDependencies": {
"dotenv": "^16.0.1"
Expand All @@ -30,4 +30,4 @@
"evidence-datasource",
"duckdb"
]
}
}
2 changes: 0 additions & 2 deletions packages/evidence/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
import preprocess from '@evidence-dev/preprocess';
export const injectedEvidenceImports = preprocess.injectedEvidenceImports;
6 changes: 4 additions & 2 deletions packages/evidence/scripts/build-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import path from 'path';
import fsExtra from 'fs-extra';
import fs from 'fs';
import preprocess from '@evidence-dev/preprocess';

const templatePaths = [
'static/',
'sources/',
Expand Down Expand Up @@ -51,7 +53,6 @@ fsExtra.outputFileSync(
import { createLogger } from 'vite';
import { sourceQueryHmr, configVirtual } from '@evidence-dev/sdk/build/vite';
import { isDebug } from '@evidence-dev/sdk/utils';
import { injectedEvidenceImports } from '@evidence-dev/evidence';
const logger = createLogger();
const loggerWarn = logger.warn;
Expand Down Expand Up @@ -84,7 +85,8 @@ fsExtra.outputFileSync(
// We need these to prevent HMR from doing a full page reload
...(process.env.EVIDENCE_DISABLE_INCLUDE ? [] : [
'@evidence-dev/core-components',
...injectedEvidenceImports.map(i => i.from),
// Evidence packages injected into process-queries
${preprocess.injectedEvidenceImports.map((i) => `'${i.from}'`).join(',')},
'debounce',
'@duckdb/duckdb-wasm',
'apache-arrow'
Expand Down
21 changes: 14 additions & 7 deletions pnpm-lock.yaml

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

0 comments on commit aab7c3e

Please sign in to comment.