Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/diagnostic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ If our build assets are located in `<dir>/dist-test/*` and the entry point for t

*\<dir>/diagnostic.js*
```ts
import launch from '@warp-drive/diagnostic/server/default-setup.js';
import { launch } from '@warp-drive/diagnostic/server';

await launch();
```
Expand Down Expand Up @@ -293,7 +293,7 @@ For github-actions, [use the official bun action](https://github.com/oven-sh/set
Finally, give your tests a run to make sure they still work as expected.

```sh
bun ./diagnostic.js
node ./diagnostic.js
```

And update any necessary scripts in `package.json`
Expand All @@ -303,7 +303,7 @@ And update any necessary scripts in `package.json`
"scripts": {
"build" "ember build",
- "test": "ember test"
+ "test": "bun run build && bun ./diagnostic.js"
+ "test": "bun run build && node ./diagnostic.js"
}
}
```
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/diagnostic/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default [
// browser (js/ts) ================
typescript.browser({
dirname: import.meta.dirname,
srcDirs: ['src'],
srcDirs: ['client/src'],
allowedImports: ['@ember/test-helpers', '@glimmer/manager', '@ember/runloop'],
rules: {
'no-console': 'off',
Expand Down
21 changes: 11 additions & 10 deletions packages/diagnostic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,16 @@
"logos"
],
"exports": {
".": {
"./server": {
"node": "./server/index.js",
"bun": "./server/index.js",
"deno": "./server/index.js",
"browser": {
"types": "./unstable-preview-types/index.d.ts",
"default": "./dist/index.js"
},
"import": {
"types": "./unstable-preview-types/index.d.ts",
"default": "./dist/index.js"
},
"default": "./server/index.js"
},
".": {
"types": "./unstable-preview-types/index.d.ts",
"default": "./dist/index.js"
},
"./*.css": {
"default": "./dist/*.css"
},
Expand Down Expand Up @@ -101,6 +97,9 @@
"@warp-drive/react": "workspace:*",
"@embroider/macros": "^1.18.1",
"dom-element-descriptors": "^0.5.1",
"hono": "^4.9.4",
"@hono/node-server": "^1.19.0",
"@hono/node-ws": "^1.2.0",
"qunit-dom": "^3.5.0"
},
"devDependencies": {
Expand All @@ -113,7 +112,9 @@
"@warp-drive/internal-config": "workspace:*",
"@types/react": "^19.1.11",
"@types/react-dom": "^19.1.8",
"bun-types": "^1.2.20",
"@types/node": "^24.3.0",
"@types/tmp": "^0.2.6",
"@types/debug": "^4.1.12",
"@ember/test-helpers": "5.2.0",
"ember-source": "~6.6.0",
"@glimmer/component": "^2.0.0",
Expand Down
7 changes: 3 additions & 4 deletions packages/diagnostic/server/default-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import fs from 'fs';
import path from 'path';

import { getBrowser, recommendedArgs } from './browsers/index.js';
import { launch } from './index.js';
import DefaultReporter from './reporters/default.js';
import { getFlags } from './utils/get-flags.js';

Expand All @@ -30,7 +29,7 @@ const SUITE_TIMEOUT = process.env.SUITE_TIMEOUT
? Number(process.env.SUITE_TIMEOUT) - SUITE_TIMEOUT_BUFFER
: DEFAULT_SUITE_TIMEOUT;

export default async function launchDefault(overrides = {}) {
export async function launchDefault(overrides = {}) {
const flags = getFlags().filtered;
Object.assign(overrides, flags);

Expand Down Expand Up @@ -71,7 +70,7 @@ export default async function launchDefault(overrides = {}) {
`\n\nLaunching with ${chalk.bold(chalk.cyan(CI_BROWSER))} (worker count ${chalk.bold(chalk.yellow(parallel))})\n\n`
);

await launch({
return {
// flag config
serve: overrides.serve ?? false,
noLaunch: overrides.noLaunch ?? false,
Expand Down Expand Up @@ -110,5 +109,5 @@ export default async function launchDefault(overrides = {}) {
args: recommendedArgs(BROWSER_TAG, overrides),
},
},
});
};
}
4 changes: 3 additions & 1 deletion packages/diagnostic/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { buildHandler } from './bun/socket-handler.js';
import { debug, error, print } from './utils/debug.js';
import { getPort } from './utils/port.js';
import { addCloseHandler } from './bun/watch.js';
import { launchDefault } from './default-setup.js';

async function getCertInfo() {
let CERT_PATH = process.env.HOLODECK_SSL_CERT_PATH;
Expand Down Expand Up @@ -66,7 +67,8 @@ async function getCertInfo() {
/** @type {import('bun-types')} */
const isBun = typeof Bun !== 'undefined';

export async function launch(config) {
export async function launch(settings) {
const config = launchDefault(settings);
if (isBun) {
debug(`Bun detected, using Bun.serve()`);

Expand Down
2 changes: 1 addition & 1 deletion packages/diagnostic/test/diagnostic.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import launch from '../server/default-setup';
import { launch } from '../server/src/index.ts';

await launch();
4 changes: 2 additions & 2 deletions packages/diagnostic/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["src/**/*"],
"include": ["client/src/**/*"],
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"module": "esnext",
Expand All @@ -20,7 +20,7 @@
// but causes us to not rebuild properly
"composite": true,
"incremental": true,
"rootDir": "src",
"rootDir": "client/src",
"declaration": true,
"declarationMap": true,
"declarationDir": "unstable-preview-types",
Expand Down
23 changes: 12 additions & 11 deletions packages/diagnostic/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ export const externals = [
'@glimmer/manager',
];
export const entryPoints = [
'./src/index.ts',
'./src/reporters/dom.ts',
'./src/runners/dom.ts',
'./src/helpers/install.ts',
'./src/ember.ts',
'./src/ember-classic.ts',
'./src/react.tsx',
'./src/spec.ts',
'./src/react/test-helpers.ts',
'./src/-types.ts',
'./client/src/index.ts',
'./client/src/reporters/dom.ts',
'./client/src/runners/dom.ts',
'./client/src/helpers/install.ts',
'./client/src/ember.ts',
'./client/src/ember-classic.ts',
'./client/src/react.tsx',
'./client/src/spec.ts',
'./client/src/react/test-helpers.ts',
'./client/src/-types.ts',
];

export default createConfig(
{
srcDir: './client/src',
entryPoints,
externals,
plugins: [keepAssets({ from: 'src', include: ['./styles/**/*.css'], dist: 'dist' })],
plugins: [keepAssets({ from: './client/src', include: ['./styles/**/*.css'], dist: 'dist' })],
},
import.meta.resolve
);
71 changes: 61 additions & 10 deletions pnpm-lock.yaml

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

Loading
Loading