Skip to content

Commit b47d7be

Browse files
committed
Upgrade to ts-dev-stack
1 parent b375324 commit b47d7be

36 files changed

+7839
-25415
lines changed

.depcheckrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignores: ["esbuild-plugin-dev-server", "depcheck", "ts-dev-stack", "@types/*", "react", "react-dom", "serve-handler"]

.depcheckrc.json

-12
This file was deleted.

.eslintignore

-11
This file was deleted.

.eslintrc.json

-24
This file was deleted.

.github/workflows/main.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
node: ['latest']
12+
node: ['20']
1313
os: [ubuntu-latest, windows-latest, macos-latest]
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-node@v3
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
1717
with:
1818
node-version: ${{ matrix.node-version }}
1919
- run: git config --global user.name "Github Actions"
@@ -22,7 +22,6 @@ jobs:
2222
- run: npm install node-version-use -g
2323
- run: npm ci
2424
- run: npx playwright install --with-deps
25-
- run: npm run lint
25+
- run: npm run format
2626
- run: npm run build
27-
- run: npm test
2827
- run: npm run test:engines

.prettierignore

-11
This file was deleted.

.prettierrc.json

-6
This file was deleted.

lib/client.js renamed to assets/client.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function () {
1+
(() => {
22
function loadScript(url, callback) {
33
var script = document.createElement('script');
44
script.type = 'text/javascript';
@@ -15,31 +15,31 @@
1515
var launchEditorEndpoint = require('react-dev-utils/launchEditorEndpoint');
1616

1717
// enable reporting
18-
reo.setEditorHandler(function (location) {
18+
reo.setEditorHandler((location) => {
1919
var components = [];
20-
for (var key in location) components.push(key + '=' + encodeURIComponent(location[key]));
21-
fetch(launchEditorEndpoint + '?' + components.join('&'));
20+
for (var key in location) components.push(`${key}=${encodeURIComponent(location[key])}`);
21+
fetch(`${launchEditorEndpoint}?${components.join('&')}`);
2222
});
2323
reo.startReportingRuntimeErrors({});
2424

2525
function errorMessage(e, stack) {
2626
// react-error-overlay assumes relative filenames
2727
function relativefile(file) {
28-
return !file.startsWith('./') ? './' + file : file;
28+
return !file.startsWith('./') ? `./${file}` : file;
2929
}
3030

31-
if (!e.location) return 'Error: ' + e.text;
32-
var pluginText = e.pluginName ? '[plugin: ' + e.pluginName + '] ' : '';
33-
var message = stack ? '' : relativefile(e.location.file) + '\n';
34-
message += 'Error: ' + pluginText + e.text + '\n\tat ' + e.location.lineText;
35-
message += ' (' + (stack ? e.location.file + ':' : '') + e.location.line + ':' + e.location.column + ')';
31+
if (!e.location) return `Error: ${e.text}`;
32+
var pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : '';
33+
var message = stack ? '' : `${relativefile(e.location.file)}\n`;
34+
message += `Error: ${pluginText}${e.text}\n\tat ${e.location.lineText}`;
35+
message += ` (${stack ? `${e.location.file}:` : ''}${e.location.line}:${e.location.column})`;
3636
return message;
3737
}
3838

3939
// listen for build results
4040
var origin = window.location.origin.replace(/\/+$/, '');
41-
var connection = new SockJS(origin + '/esbuild');
42-
connection.onmessage = function (event) {
41+
var connection = new SockJS(`${origin}/esbuild`);
42+
connection.onmessage = (event) => {
4343
var result = JSON.parse(event.data);
4444
if (result.errors.length) return reo.reportBuildError(errorMessage(result.errors[0]));
4545
window.location.reload();

biome.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
3+
"files": {
4+
"ignore": ["assets/**", "dist/**", "node_modules/**", "test/data/**"]
5+
},
6+
"formatter": {
7+
"enabled": true,
8+
"lineWidth": 320,
9+
"indentStyle": "space"
10+
},
11+
"javascript": {
12+
"formatter": {
13+
"quoteStyle": "single",
14+
"trailingComma": "es5"
15+
}
16+
},
17+
"linter": {
18+
"enabled": true,
19+
"rules": {
20+
"recommended": true,
21+
"complexity": {
22+
"noForEach": "off",
23+
"useOptionalChain": "off"
24+
},
25+
"correctness": {
26+
"noUnusedVariables": "warn",
27+
"noInnerDeclarations": "off"
28+
},
29+
"style": {
30+
"noParameterAssign": "off"
31+
}
32+
}
33+
}
34+
}

dist/cjs/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"use strict";
2+
module.exports = require("./lib/plugin");
3+
module.exports.socketServer = require("./lib/socketServer");
4+
module.exports.client = require("./lib/client");
5+
6+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
7+
Object.defineProperty(exports.default, '__esModule', { value: true });
8+
for (var key in exports) exports.default[key] = exports[key];
9+
module.exports = exports.default;
10+
}

dist/cjs/index.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cjs/lib/client.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use strict";
2+
var path = require("path");
3+
var fs = require("fs");
4+
var string = null;
5+
module.exports = function client() {
6+
if (string) return string;
7+
string = fs.readFileSync(path.join(__dirname, "..", "..", "..", "assets", "client.js"), "utf8");
8+
string = string.replace("require('react-dev-utils/launchEditorEndpoint')", "'".concat(require("react-dev-utils/launchEditorEndpoint"), "'"));
9+
return string;
10+
};
11+
12+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
13+
Object.defineProperty(exports.default, '__esModule', { value: true });
14+
for (var key in exports) exports.default[key] = exports[key];
15+
module.exports = exports.default;
16+
}

dist/cjs/lib/client.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)