Skip to content

Commit

Permalink
Custom react wrapper (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarDamkjaer authored Oct 24, 2023
1 parent 19ffd9d commit 6f394d2
Show file tree
Hide file tree
Showing 27 changed files with 6,188 additions and 612 deletions.
1,094 changes: 1,016 additions & 78 deletions package-lock.json

Large diffs are not rendered by default.

224 changes: 0 additions & 224 deletions packages/react-codemirror/e2e_tests/auto-completion.spec.ts

This file was deleted.

45 changes: 0 additions & 45 deletions packages/react-codemirror/e2e_tests/sanity-checks.spec.ts

This file was deleted.

16 changes: 8 additions & 8 deletions packages/react-codemirror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"license": "Apache-2.0",
"files": [
"dist",
"esm",
"package.json",
"README.md"
],
Expand All @@ -26,8 +25,8 @@
"build-commonjs": "esbuild ./src/index.ts --bundle --format=cjs --sourcemap --packages=external --outfile=dist/cjs/index.cjs",
"clean": "rm -rf dist",
"test": "jest",
"test:e2e": "playwright test",
"e2e-http-server": "vite dev"
"test:e2e": "playwright test -c playwright-ct.config.ts",
"test:e2e-ui": "playwright test -c playwright-ct.config.ts --ui"
},
"dependencies": {
"@neo4j-cypher/language-support": "2.0.0-next.0",
Expand All @@ -40,23 +39,24 @@
"@codemirror/view": "^6.13.2",
"@lezer/common": "^1.0.2",
"@lezer/highlight": "^1.1.3",
"@uiw/react-codemirror": "^4.19.9",
"ayu": "^8.0.1",
"fastest-levenshtein": "^1.0.16",
"react": "^18.2.0",
"vscode-languageserver-types": "^3.17.3"
},
"devDependencies": {
"@neo4j-ndl/base": "^1.10.1",
"@playwright/experimental-ct-react": "^1.39.0",
"@playwright/test": "^1.36.2",
"@types/react": "^18.0.28",
"@vitejs/plugin-react": "^3.1.0",
"concurrently": "^8.2.1",
"esbuild": "^0.19.4",
"lodash": "^4.17.21",
"playwright": "^1.36.2",
"typescript": "^4.9.5",
"vite": "^4.4.8",
"vite-plugin-node-stdlib-browser": "^0.2.1"
"react": "^18.2.0",
"typescript": "^4.9.5"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { defineConfig, devices } from '@playwright/test';
import { defineConfig, devices } from '@playwright/experimental-ct-react';

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './e2e_tests',
testDir: './',
/* The base directory, relative to the config file, for snapshot files created with toMatchSnapshot and toHaveScreenshot. */
snapshotDir: './__snapshots__',
/* Maximum time one test can run for. */
timeout: 10 * 1000,
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand All @@ -17,25 +21,14 @@ export default defineConfig({
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},

// Configure only chrome until we can fix flakyness in webkit/firefox
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],

webServer: {
command: 'npm run e2e-http-server -w @neo4j-cypher/react-codemirror',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
/* Port to use for Playwright component endpoint. */
ctPort: 3100,
},
// Glob patterns or regular expressions that match test files.
testMatch: '*.spec.tsx',

projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Codemirror Playground</title>
<title>Testing Page</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/e2e-entry.tsx"></script>
<div id="queryExecuted"></div>
<script type="module" src="./index.tsx"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions packages/react-codemirror/playwright/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Import styles, initialize component theme here.
// import '../src/common.css';
Loading

0 comments on commit 6f394d2

Please sign in to comment.