-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33df598
commit 6a3adce
Showing
6 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
compat-tests/fixtures/basic-vite4/basic-vite4.compat-test.ts
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,40 @@ | ||
// @cspotcode/zx is zx in CommonJS | ||
import {$, cd, path, ProcessPromise} from '@cspotcode/zx' | ||
import {testServerAndPage} from '../../utils/testUtils' | ||
|
||
const PATH_TO_PACKAGE = path.join(__dirname, `./package`) | ||
|
||
describe(`basic-vite4`, () => { | ||
test(`\`$ vite build\` should succeed`, async () => { | ||
cd(PATH_TO_PACKAGE) | ||
const {exitCode} = await $`npm run build` | ||
// at this point, the build should have succeeded | ||
expect(exitCode).toEqual(0) | ||
}) | ||
|
||
describe(`vite preview`, () => { | ||
function startServerOnPort(port: number): ProcessPromise<unknown> { | ||
cd(PATH_TO_PACKAGE) | ||
|
||
return $`npm run preview -- --port ${port}` | ||
} | ||
|
||
testServerAndPage({ | ||
startServerOnPort, | ||
checkServerStdoutToSeeIfItsReady: (chunk) => chunk.includes('--host'), | ||
}) | ||
}) | ||
|
||
describe(`vite dev`, () => { | ||
function startServerOnPort(port: number): ProcessPromise<unknown> { | ||
cd(PATH_TO_PACKAGE) | ||
|
||
return $`npm run dev -- --port ${port}` | ||
} | ||
|
||
testServerAndPage({ | ||
startServerOnPort, | ||
checkServerStdoutToSeeIfItsReady: (chunk) => chunk.includes('--host'), | ||
}) | ||
}) | ||
}) |
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 @@ | ||
/.cache | ||
/dist | ||
/package-lock.json |
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,2 @@ | ||
<!DOCTYPE html> | ||
<script type="module" src="./src/index.ts"></script> |
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 @@ | ||
{ | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@theatre/core": "0.0.1-COMPAT.1", | ||
"@theatre/studio": "0.0.1-COMPAT.1" | ||
}, | ||
"browserslist": { | ||
"production": [">0.2%", "not dead", "not op_mini all"], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
} | ||
} |
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,9 @@ | ||
import {getProject} from '@theatre/core' | ||
|
||
const project = getProject('Sample project') | ||
const sheet = project.sheet('Scene') | ||
|
||
if (import.meta.env.MODE === 'development') { | ||
const {default: studio} = await import('@theatre/studio') | ||
studio.initialize() | ||
} |
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,9 @@ | ||
{ | ||
"include": ["./src/**/*.ts"], | ||
"compilerOptions": { | ||
"types": ["vite/client"], | ||
"moduleResolution": "NodeNext", | ||
"module": "NodeNext", | ||
"target": "ESNext" | ||
} | ||
} |
6a3adce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
theatre-playground – ./
theatre-playground-git-main-theatrejs.vercel.app
theatre-playground.vercel.app
theatre-playground-theatrejs.vercel.app