toiljs 0.0.122 → 0.0.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +2 -0
- package/build/backend/.tsbuildinfo +1 -1
- package/build/cli/.tsbuildinfo +1 -1
- package/build/cli/index.js +236 -11
- package/build/compiler/.tsbuildinfo +1 -1
- package/build/compiler/toil-docs.generated.js +5 -4
- package/build/devserver/.tsbuildinfo +1 -1
- package/build/testing/.tsbuildinfo +1 -0
- package/build/testing/config.d.ts +9 -0
- package/build/testing/config.js +79 -0
- package/build/testing/setup.d.ts +1 -0
- package/build/testing/setup.js +11 -0
- package/package.json +53 -22
- package/tsconfig.testing.json +13 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import react from '@vitejs/plugin-react';
|
|
4
|
+
import { webdriverio } from '@vitest/browser-webdriverio';
|
|
5
|
+
import { defineConfig } from 'vitest/config';
|
|
6
|
+
export function defineTestConfig(options = {}) {
|
|
7
|
+
const root = path.resolve(options.root ?? process.cwd());
|
|
8
|
+
const browserBinary = process.env.TOIL_TEST_BROWSER_BINARY;
|
|
9
|
+
const driverBinary = process.env.TOIL_TEST_CHROMEDRIVER;
|
|
10
|
+
const setup = fileURLToPath(new URL('./setup.js', import.meta.url));
|
|
11
|
+
return defineConfig({
|
|
12
|
+
root,
|
|
13
|
+
publicDir: path.join(root, 'client/public'),
|
|
14
|
+
plugins: [react()],
|
|
15
|
+
resolve: {
|
|
16
|
+
alias: { client: path.join(root, 'client'), shared: path.join(root, 'shared') },
|
|
17
|
+
dedupe: ['react', 'react-dom'],
|
|
18
|
+
},
|
|
19
|
+
test: {
|
|
20
|
+
coverage: {
|
|
21
|
+
provider: 'v8',
|
|
22
|
+
reporter: ['text', 'html', 'json', 'lcov'],
|
|
23
|
+
reportsDirectory: path.join(root, 'coverage'),
|
|
24
|
+
include: ['client/**/*.{ts,tsx}', 'shared/**/*.{ts,tsx}'],
|
|
25
|
+
exclude: ['**/*.d.ts', '**/*.{test,spec}.{ts,tsx}', 'shared/server.ts'],
|
|
26
|
+
},
|
|
27
|
+
projects: [
|
|
28
|
+
{
|
|
29
|
+
extends: true,
|
|
30
|
+
test: {
|
|
31
|
+
name: 'unit',
|
|
32
|
+
environment: 'node',
|
|
33
|
+
include: [
|
|
34
|
+
...(options.unitInclude ?? [
|
|
35
|
+
'{client,tests,test}/**/*.{test,spec}.{ts,tsx}',
|
|
36
|
+
]),
|
|
37
|
+
],
|
|
38
|
+
exclude: [
|
|
39
|
+
'**/*.browser.{test,spec}.{ts,tsx}',
|
|
40
|
+
'**/node_modules/**',
|
|
41
|
+
'**/build/**',
|
|
42
|
+
],
|
|
43
|
+
setupFiles: [setup],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
extends: true,
|
|
48
|
+
test: {
|
|
49
|
+
name: 'browser',
|
|
50
|
+
include: [
|
|
51
|
+
...(options.browserInclude ?? [
|
|
52
|
+
'{client,tests,test}/**/*.browser.{test,spec}.{ts,tsx}',
|
|
53
|
+
]),
|
|
54
|
+
],
|
|
55
|
+
setupFiles: [setup],
|
|
56
|
+
browser: {
|
|
57
|
+
enabled: true,
|
|
58
|
+
headless: options.headless ?? true,
|
|
59
|
+
provider: webdriverio({
|
|
60
|
+
logLevel: 'error',
|
|
61
|
+
capabilities: {
|
|
62
|
+
'wdio:enforceWebDriverClassic': true,
|
|
63
|
+
...(driverBinary
|
|
64
|
+
? { 'wdio:chromedriverOptions': { binary: driverBinary } }
|
|
65
|
+
: {}),
|
|
66
|
+
'goog:chromeOptions': {
|
|
67
|
+
...(browserBinary ? { binary: browserBinary } : {}),
|
|
68
|
+
args: [...(options.chromeArgs ?? [])],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
instances: [{ browser: 'chrome' }],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Toil from 'toiljs/client';
|
|
2
|
+
import { DataReader, DataWriter, FastMap, FastSet } from 'toiljs/io';
|
|
3
|
+
Object.assign(globalThis, {
|
|
4
|
+
Toil,
|
|
5
|
+
DataReader,
|
|
6
|
+
DataWriter,
|
|
7
|
+
FastMap,
|
|
8
|
+
FastSet,
|
|
9
|
+
Server: Toil.Server,
|
|
10
|
+
parseError: Toil.parseError,
|
|
11
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toiljs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.123",
|
|
5
5
|
"author": "Dacely",
|
|
6
6
|
"description": "The modern React framework: a file-based React frontend and a ToilScript-compiled WebAssembly backend.",
|
|
7
7
|
"repository": {
|
|
@@ -77,6 +77,16 @@
|
|
|
77
77
|
"./oxlint": {
|
|
78
78
|
"types": "./presets/oxlint.d.ts",
|
|
79
79
|
"default": "./presets/oxlint.js"
|
|
80
|
+
},
|
|
81
|
+
"./vitest": {
|
|
82
|
+
"types": "./build/testing/config.d.ts",
|
|
83
|
+
"import": "./build/testing/config.js",
|
|
84
|
+
"default": "./build/testing/config.js"
|
|
85
|
+
},
|
|
86
|
+
"./vitest/setup": {
|
|
87
|
+
"types": "./build/testing/setup.d.ts",
|
|
88
|
+
"import": "./build/testing/setup.js",
|
|
89
|
+
"default": "./build/testing/setup.js"
|
|
80
90
|
}
|
|
81
91
|
},
|
|
82
92
|
"bin": {
|
|
@@ -105,7 +115,7 @@
|
|
|
105
115
|
"watch": "tsc -p tsconfig.json --watch",
|
|
106
116
|
"prepublishOnly": "npm run build",
|
|
107
117
|
"gen:docs": "node scripts/gen-toil-docs.mjs",
|
|
108
|
-
"build": "npm run build:shared && npm run build:logger && npm run build:io && npm run build:client && npm run build:backend && npm run build:devserver && npm run build:compiler && npm run build:cli",
|
|
118
|
+
"build": "npm run build:shared && npm run build:logger && npm run build:io && npm run build:client && npm run build:backend && npm run build:devserver && npm run build:compiler && npm run build:cli && npm run build:testing",
|
|
109
119
|
"build:shared": "tsc -p tsconfig.shared.json",
|
|
110
120
|
"build:logger": "tsc -p tsconfig.logger.json",
|
|
111
121
|
"build:client": "tsc -p tsconfig.client.json",
|
|
@@ -124,7 +134,8 @@
|
|
|
124
134
|
"lint": "oxlint --type-aware src",
|
|
125
135
|
"docs": "npm run build && node scripts/gen-api-docs.mjs",
|
|
126
136
|
"setup": "npm i && npm run build",
|
|
127
|
-
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
137
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
138
|
+
"build:testing": "tsc -p tsconfig.testing.json"
|
|
128
139
|
},
|
|
129
140
|
"dependencies": {
|
|
130
141
|
"@dacely/hyper-express": "^6.17.4",
|
|
@@ -132,19 +143,19 @@
|
|
|
132
143
|
"@dacely/toilscript-loader": "^0.1.0",
|
|
133
144
|
"@noble/curves": "^2.4.0",
|
|
134
145
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
135
|
-
"@vitejs/plugin-react": "^6.1.
|
|
146
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
136
147
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
137
148
|
"hash-wasm": "^4.12.0",
|
|
138
|
-
"juice": "^12.
|
|
139
|
-
"nodemailer": "^10.0.
|
|
140
|
-
"oxc-parser": "^0.
|
|
141
|
-
"oxlint": "^1.
|
|
142
|
-
"oxlint-tsgolint": "^7.0.
|
|
149
|
+
"juice": "^12.2.0",
|
|
150
|
+
"nodemailer": "^10.0.16",
|
|
151
|
+
"oxc-parser": "^0.153.0",
|
|
152
|
+
"oxlint": "^1.87.0",
|
|
153
|
+
"oxlint-tsgolint": "^7.0.2003",
|
|
143
154
|
"picocolors": "^1.1.1",
|
|
144
155
|
"semver": "^7.8.5",
|
|
145
|
-
"sharp": "^0.35.
|
|
156
|
+
"sharp": "^0.35.5",
|
|
146
157
|
"toilscript": ">=0.1.63",
|
|
147
|
-
"vite": "^8.3.
|
|
158
|
+
"vite": "^8.3.4",
|
|
148
159
|
"vite-imagetools": "^12.0.1",
|
|
149
160
|
"vite-plugin-node-polyfills": "^0.28.0"
|
|
150
161
|
},
|
|
@@ -152,32 +163,52 @@
|
|
|
152
163
|
"prettier": ">=3.0.0",
|
|
153
164
|
"react": "^19.3.0",
|
|
154
165
|
"react-dom": "^19.3.0",
|
|
155
|
-
"toilscript": ">=0.1.63"
|
|
166
|
+
"toilscript": ">=0.1.63",
|
|
167
|
+
"vitest": "^5.0.3",
|
|
168
|
+
"@vitest/browser-webdriverio": "^5.0.0",
|
|
169
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
170
|
+
"webdriverio": "^10.0.2"
|
|
156
171
|
},
|
|
157
172
|
"overrides": {
|
|
158
173
|
"elliptic": "file:./stubs/elliptic"
|
|
159
174
|
},
|
|
160
175
|
"devDependencies": {
|
|
161
|
-
"@babel/core": "^8.0.
|
|
162
|
-
"@babel/preset-env": "^8.0.
|
|
163
|
-
"@babel/preset-typescript": "^8.0.
|
|
176
|
+
"@babel/core": "^8.0.7",
|
|
177
|
+
"@babel/preset-env": "^8.0.7",
|
|
178
|
+
"@babel/preset-typescript": "^8.0.7",
|
|
164
179
|
"@clack/prompts": "^1.8.1",
|
|
165
180
|
"@testing-library/dom": "^10.4.2",
|
|
166
181
|
"@testing-library/react": "^16.3.3",
|
|
167
|
-
"@types/node": "^26.5
|
|
168
|
-
"@types/nodemailer": "^8.0.
|
|
182
|
+
"@types/node": "^26.6.5",
|
|
183
|
+
"@types/nodemailer": "^8.0.2",
|
|
169
184
|
"@types/react": "^19.3.0",
|
|
170
185
|
"@types/react-dom": "^19.3.0",
|
|
171
186
|
"@types/semver": "^7.8.0",
|
|
172
|
-
"@vitest/
|
|
173
|
-
"@vitest/
|
|
187
|
+
"@vitest/browser-webdriverio": "^5.0.0",
|
|
188
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
189
|
+
"@vitest/ui": "^5.0.3",
|
|
174
190
|
"esbuild": "^0.28.2",
|
|
175
|
-
"jsdom": "^30.
|
|
191
|
+
"jsdom": "^30.1.2",
|
|
176
192
|
"micromatch": "^4.0.8",
|
|
177
|
-
"prettier": "^3.9.
|
|
193
|
+
"prettier": "^3.9.9",
|
|
178
194
|
"react": "^19.3.0",
|
|
179
195
|
"react-dom": "^19.3.0",
|
|
180
196
|
"typescript": "^7.0.2",
|
|
181
|
-
"vitest": "^5.0.
|
|
197
|
+
"vitest": "^5.0.3",
|
|
198
|
+
"webdriverio": "^10.0.2"
|
|
199
|
+
},
|
|
200
|
+
"peerDependenciesMeta": {
|
|
201
|
+
"vitest": {
|
|
202
|
+
"optional": true
|
|
203
|
+
},
|
|
204
|
+
"@vitest/browser-webdriverio": {
|
|
205
|
+
"optional": true
|
|
206
|
+
},
|
|
207
|
+
"@vitest/coverage-v8": {
|
|
208
|
+
"optional": true
|
|
209
|
+
},
|
|
210
|
+
"webdriverio": {
|
|
211
|
+
"optional": true
|
|
212
|
+
}
|
|
182
213
|
}
|
|
183
214
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"rootDir": "src/testing",
|
|
8
|
+
"outDir": "build/testing",
|
|
9
|
+
"types": ["node"],
|
|
10
|
+
"tsBuildInfoFile": "build/testing/.tsbuildinfo"
|
|
11
|
+
},
|
|
12
|
+
"include": ["src/testing/**/*"]
|
|
13
|
+
}
|