-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2497 from evidence-dev/release-2024-09-05
Release 2024 09 05
- Loading branch information
Showing
66 changed files
with
1,320 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/preprocess': patch | ||
--- | ||
|
||
properly typecheck .cjs/.js files in preprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/universal-sql': patch | ||
--- | ||
|
||
Set 644 permissions when writing parquet files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/core-components': patch | ||
--- | ||
|
||
fixed boxplot duplicates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/evidence': patch | ||
--- | ||
|
||
preview command uses VITE_EVIDENCE_SPA environment variable to serve build in SPA mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/components': patch | ||
--- | ||
|
||
Added scroll-to for prop sections in docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@evidence-dev/evidence': patch | ||
'@evidence-dev/preprocess': patch | ||
'@evidence-dev/sdk': patch | ||
--- | ||
|
||
Fix noisy "Failed to pre-render columns" log during build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/component-utilities': patch | ||
--- | ||
|
||
Add hmr error handling for reserved words query names |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/core-components': patch | ||
--- | ||
|
||
selected tabs with id prop selection persist on refresh/link shared |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/core-components': patch | ||
--- | ||
|
||
added default values for queries in button groups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
#!/usr/bin/env node | ||
|
||
import { spawn } from 'node:child_process'; | ||
import { readFile, writeFile, unlink, mkdir } from 'node:fs/promises'; | ||
import chalk from 'chalk'; | ||
import sade from 'sade'; | ||
import ora from 'ora'; | ||
|
||
/** @typedef {import('child_process').SpawnOptions} SpawnOptions */ | ||
|
||
// prettier-ignore | ||
const playwrightConfig = | ||
`import { defineConfig } from '@playwright/test'; | ||
import { config } from '../playwright-config'; | ||
export default defineConfig(config);` | ||
|
||
// prettier-ignore | ||
const defaultTestFile = | ||
`// @ts-check | ||
import { test, expect } from '@playwright/test'; | ||
import { waitForDevModeToLoad } from '../../test-utils'; | ||
test('has title', async ({ page }) => { | ||
await page.goto('/'); | ||
await waitForDevModeToLoad(page); | ||
await expect(page).toHaveTitle(/Welcome to Evidence/); | ||
});` | ||
|
||
const testScripts = { | ||
test: undefined, | ||
'test:preview': 'playwright test', | ||
'test:dev': 'cross-env DEV=true playwright test' | ||
}; | ||
|
||
/** @type {Partial<SpawnOptions>} */ | ||
const globalSpawnOpts = { | ||
shell: true | ||
}; | ||
|
||
/** | ||
* @param {string} command | ||
* @param {SpawnOptions} options | ||
*/ | ||
const spawnAsync = async (command, options) => { | ||
return new Promise((resolve, reject) => { | ||
const child = spawn(command, { | ||
...globalSpawnOpts, | ||
...options | ||
}); | ||
|
||
child.on('exit', (code) => { | ||
if (code === 0) { | ||
resolve(); | ||
} else { | ||
reject(); | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
/** | ||
* | ||
* @param {string} path | ||
* @param {(packageJson: any) => any} updater | ||
* @returns {Promise<void>} | ||
*/ | ||
const updatePackageJson = async (path, updater) => { | ||
const rawPackageJson = await readFile(path, 'utf-8'); | ||
const packageJson = JSON.parse(rawPackageJson); | ||
const modifiedPackageJson = updater(packageJson); | ||
await writeFile(path, JSON.stringify(modifiedPackageJson, null, '\t')); | ||
}; | ||
|
||
/** | ||
* @param {string} name | ||
* @param {{ debug?: boolean }} options | ||
*/ | ||
const run = async (name, options) => { | ||
const { debug } = options; | ||
|
||
const spinner = ora({ isEnabled: !debug }); | ||
|
||
try { | ||
globalSpawnOpts.stdio = debug ? 'inherit' : 'ignore'; | ||
|
||
spinner.start('Cloning template...'); | ||
await spawnAsync(`npx degit https://github.com/evidence-dev/template ${name}`); | ||
spinner.stopAndPersist({ symbol: '✔ ', text: 'Cloned template' }); | ||
|
||
spinner.start('Modifying package.json...'); | ||
await updatePackageJson(`${name}/package.json`, (packageJson) => { | ||
const dependencies = packageJson.dependencies ?? {}; | ||
Object.entries(dependencies).forEach(([name, version]) => { | ||
if (name.startsWith('@evidence-dev/')) { | ||
dependencies[name] = 'workspace:*'; | ||
} else { | ||
dependencies[name] = version; | ||
} | ||
}); | ||
return { | ||
...packageJson, | ||
name: `e2e-${name}`, | ||
private: true, | ||
dependencies, | ||
scripts: { | ||
...packageJson.scripts, | ||
...testScripts | ||
} | ||
}; | ||
}); | ||
spinner.stopAndPersist({ symbol: '✔ ', text: 'Modified package.json' }); | ||
|
||
spinner.start('Installing dependencies...'); | ||
await unlink(`${name}/package-lock.json`); | ||
await spawnAsync(`pnpm i -D cross-env --ignore-scripts`, { cwd: name }); | ||
// TODO the bulk of the time running this command is spent running our postinstall script, which is unnecessary | ||
await spawnAsync( | ||
`pnpm create playwright@latest --lang=js --no-browsers --no-examples --quiet`, | ||
{ cwd: name } | ||
); | ||
spinner.stopAndPersist({ symbol: '✔ ', text: 'Installed dependencies' }); | ||
|
||
spinner.start('Configuring playwright...'); | ||
await writeFile(`${name}/playwright.config.js`, playwrightConfig); | ||
spinner.stopAndPersist({ symbol: '✔ ', text: 'Configured playwright' }); | ||
|
||
spinner.start('Creating test file...'); | ||
await mkdir(`${name}/tests`); | ||
await writeFile(`${name}/tests/tests.spec.js`, defaultTestFile); | ||
spinner.stopAndPersist({ symbol: '✔ ', text: 'Created test file' }); | ||
|
||
spinner.start('Formatting files...'); | ||
await spawnAsync(`pnpm format`, { cwd: '..' }); | ||
spinner.stopAndPersist({ symbol: '✔ ', text: 'Formatted files' }); | ||
|
||
console.log(chalk.green(`\nE2E Test Project '${name}' created successfully!`)); | ||
console.log(chalk.dim(`Use test:dev and test:preview to run your tests`)); | ||
} catch (e) { | ||
spinner.stopAndPersist({ symbol: '❌' }); | ||
console.error(chalk.red('An error occurred while creating the project')); | ||
if (e) { | ||
console.error(e); | ||
} | ||
} | ||
}; | ||
|
||
////////////////////////////////////////// | ||
|
||
sade('create-e2e-project <name>') | ||
.describe('Create a new Evidence project from the template that is ready for E2E testing') | ||
.option('--debug', 'Enable debug mode') | ||
.example('my-tests') | ||
.action(run) | ||
.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```sql my_query | ||
select 1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.evidence/template | ||
.svelte-kit | ||
build | ||
node_modules | ||
.DS_Store | ||
static/data | ||
*.options.yaml | ||
.vscode/settings.json | ||
.env | ||
.evidence/meta | ||
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
loglevel=error | ||
audit=false | ||
fund=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Evidence Template Project | ||
|
||
## Using Codespaces | ||
|
||
If you are using this template in Codespaces, click the `Start Evidence` button in the bottom status bar. This will install dependencies and open a preview of your project in your browser - you should get a popup prompting you to open in browser. | ||
|
||
Or you can use the following commands to get started: | ||
|
||
```bash | ||
npm install | ||
npm run sources | ||
npm run dev -- --host 0.0.0.0 | ||
``` | ||
|
||
See [the CLI docs](https://docs.evidence.dev/cli/) for more command information. | ||
|
||
**Note:** Codespaces is much faster on the Desktop app. After the Codespace has booted, select the hamburger menu → Open in VS Code Desktop. | ||
|
||
## Get Started from VS Code | ||
|
||
The easiest way to get started is using the [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=evidence-dev.evidence): | ||
|
||
1. Install the extension from the VS Code Marketplace | ||
2. Open the Command Palette (Ctrl/Cmd + Shift + P) and enter `Evidence: New Evidence Project` | ||
3. Click `Start Evidence` in the bottom status bar | ||
|
||
## Get Started using the CLI | ||
|
||
```bash | ||
npx degit evidence-dev/template my-project | ||
cd my-project | ||
npm install | ||
npm run sources | ||
npm run dev | ||
``` | ||
|
||
Check out the docs for [alternative install methods](https://docs.evidence.dev/getting-started/install-evidence) including Docker, Github Codespaces, and alongside dbt. | ||
|
||
## Learning More | ||
|
||
- [Docs](https://docs.evidence.dev/) | ||
- [Github](https://github.com/evidence-dev/evidence) | ||
- [Slack Community](https://slack.evidence.dev/) | ||
- [Evidence Home Page](https://www.evidence.dev) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
components: | ||
# This loads all of evidence's core charts and UI components | ||
# You probably don't want to edit this dependency unless you know what you are doing | ||
"@evidence-dev/core-components": {} | ||
|
||
datasources: | ||
# You can add additional datasources here by adding npm packages. | ||
# Make to also add them to `package.json`. | ||
"@evidence-dev/bigquery": { } | ||
"@evidence-dev/csv": { } | ||
"@evidence-dev/databricks": { } | ||
"@evidence-dev/duckdb": { } | ||
"@evidence-dev/mssql": { } | ||
"@evidence-dev/mysql": { } | ||
"@evidence-dev/postgres": { } | ||
"@evidence-dev/snowflake": { } | ||
"@evidence-dev/sqlite": { } | ||
"@evidence-dev/trino": { } | ||
"@evidence-dev/motherduck": { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "e2e-spa", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"build": "cross-env VITE_EVIDENCE_SPA=true evidence build", | ||
"build:strict": "cross-env VITE_EVIDENCE_SPA=true evidence build:strict", | ||
"dev": "evidence dev --open /", | ||
"sources": "evidence sources", | ||
"preview": "cross-env VITE_EVIDENCE_SPA=true evidence preview", | ||
"test:preview": "playwright test", | ||
"test:dev": "echo e2e/spa has no dev mode tests" | ||
}, | ||
"engines": { | ||
"npm": ">=7.0.0", | ||
"node": ">=18.0.0" | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"@evidence-dev/bigquery": "workspace:*", | ||
"@evidence-dev/core-components": "workspace:*", | ||
"@evidence-dev/csv": "workspace:*", | ||
"@evidence-dev/databricks": "workspace:*", | ||
"@evidence-dev/duckdb": "workspace:*", | ||
"@evidence-dev/evidence": "workspace:*", | ||
"@evidence-dev/motherduck": "workspace:*", | ||
"@evidence-dev/mssql": "workspace:*", | ||
"@evidence-dev/mysql": "workspace:*", | ||
"@evidence-dev/postgres": "workspace:*", | ||
"@evidence-dev/snowflake": "workspace:*", | ||
"@evidence-dev/sqlite": "workspace:*", | ||
"@evidence-dev/trino": "workspace:*" | ||
}, | ||
"overrides": { | ||
"jsonwebtoken": "9.0.0", | ||
"trim@<0.0.3": ">0.0.3", | ||
"sqlite3": "5.1.5", | ||
"axios": "^1.7.4" | ||
}, | ||
"private": true, | ||
"devDependencies": { | ||
"@playwright/test": "^1.45.3", | ||
"@types/node": "^22.5.4", | ||
"cross-env": "^7.0.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This page uses a query param: {params.param} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Index |
Oops, something went wrong.