@colyseus/monitor 0.17.0 → 0.17.2

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.
@@ -6,7 +6,7 @@
6
6
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
7
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
8
8
  <title>Colyseus Stats</title>
9
- <script type="module" crossorigin src="./assets/index-B2aU-jt1.js"></script>
9
+ <script type="module" crossorigin src="./assets/index-7t7PIc3B.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="./assets/index-8wRFHIxm.css">
11
11
  </head>
12
12
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colyseus/monitor",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "description": "Web Monitoring Panel for Colyseus",
5
5
  "input": "./src/index.ts",
6
6
  "main": "./build/index.js",
@@ -8,16 +8,22 @@
8
8
  "typings": "./build/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
+ "@source": "./src-backend/index.ts",
11
12
  "types": "./build/index.d.ts",
12
13
  "import": "./build/index.mjs",
13
14
  "require": "./build/index.js"
14
15
  },
15
16
  "./*": {
17
+ "@source": "./src-backend/*.ts",
16
18
  "types": "./build/*.d.ts",
17
- "import": "./src-backend/*.ts",
19
+ "import": "./build/*.mjs",
18
20
  "require": "./build/*.js"
19
21
  }
20
22
  },
23
+ "files": [
24
+ "build",
25
+ "src-backend"
26
+ ],
21
27
  "repository": {
22
28
  "type": "git",
23
29
  "url": "git://github.com/colyseus/colyseus.git"
@@ -62,7 +68,7 @@
62
68
  "dependencies": {
63
69
  "express": ">=4.16.0",
64
70
  "node-os-utils": "^2.0.0",
65
- "@colyseus/core": "^0.17.0"
71
+ "@colyseus/core": "^0.17.2"
66
72
  },
67
73
  "scripts": {
68
74
  "start": "vite",
package/build.mjs DELETED
@@ -1,110 +0,0 @@
1
- import path from 'path';
2
- import glob from 'fast-glob';
3
- import { fileURLToPath } from 'url';
4
- import ts from "typescript";
5
- import fs from "fs";
6
- import esbuild from "esbuild";
7
-
8
- // we need to change up how __dirname is used for ES6 purposes
9
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
-
11
- async function main() {
12
- // Absolute path to package directory
13
- const basePath = __dirname;
14
-
15
- // Get all .ts as input files
16
- const entryPoints = glob.sync(path.resolve(basePath, "src-backend", "**", "**.ts")
17
- .replace(/\\/g, '/')); // windows support
18
-
19
- const outdir = path.join(basePath, 'build');
20
-
21
- // Emit only .d.ts files
22
- const emitTSDeclaration = () => {
23
- console.log("Generating .d.ts...");
24
- const program = ts.createProgram(entryPoints, {
25
- declaration: true,
26
- emitDeclarationOnly: true,
27
- skipLibCheck: true,
28
- module: ts.ModuleKind.CommonJS,
29
- target: ts.ScriptTarget.ES2017,
30
- outDir: outdir,
31
- esModuleInterop: true,
32
- experimentalDecorators: true,
33
- });
34
- const emitResult = program.emit();
35
-
36
- const allDiagnostics = ts
37
- .getPreEmitDiagnostics(program)
38
- .concat(emitResult.diagnostics);
39
-
40
- allDiagnostics.forEach(diagnostic => {
41
- if (diagnostic.file) {
42
- const { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
43
- const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
44
- console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
45
- } else {
46
- console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
47
- }
48
- });
49
- }
50
-
51
- // CommonJS output
52
- console.log("Generating CJS build...");
53
- esbuild.build({
54
- entryPoints,
55
- outdir,
56
- format: "cjs",
57
- target: "es2017",
58
- sourcemap: "external",
59
- platform: "node",
60
- });
61
-
62
- // ESM output
63
- console.log("Generating ESM build...");
64
- esbuild.build({
65
- entryPoints,
66
- outdir,
67
- target: "esnext",
68
- format: "esm",
69
- bundle: true,
70
- sourcemap: "external",
71
- platform: "node",
72
- outExtension: { '.js': '.mjs', },
73
- plugins: [
74
- {
75
- name: 'add-mjs',
76
- setup(build) {
77
- build.onResolve({ filter: /.*/ }, (args) => {
78
- if (args.importer) return { path: args.path.replace(/^\.(.*)\.js$/, '.$1.mjs'), external: true }
79
- })
80
- },
81
- },
82
- {
83
- //
84
- // WORKAROUND FOR __dirname usage in ESM
85
- // TODO: need to have a better appraoch for ESM + CJS builds...
86
- //
87
- name: 'dirname',
88
- setup(build) {
89
- build.onLoad({ filter: /.*/ }, ({ path: filePath }) => {
90
- let contents = fs.readFileSync(filePath, "utf8");
91
- const loader = path.extname(filePath).substring(1);
92
- contents = contents.replace("__dirname", `path.dirname(fileURLToPath(import.meta.url))`)
93
- return {
94
- contents,
95
- loader,
96
- };
97
- });
98
- }
99
-
100
- }
101
- ]
102
- });
103
-
104
- // emit .d.ts files
105
- emitTSDeclaration();
106
- console.log("Done!");
107
- }
108
-
109
- export default await main();
110
-
package/index.html DELETED
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
8
- <title>Colyseus Stats</title>
9
- </head>
10
- <body>
11
- <div id="app"></div>
12
- <script type="module" src="/src/index.tsx"></script>
13
- </body>
14
- </html>
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "build",
4
- "module": "commonjs",
5
- "lib": ["ES2022"],
6
- "target": "es2017",
7
- "declaration": true,
8
- "noImplicitAny": false,
9
- "esModuleInterop": true,
10
- "experimentalDecorators": true,
11
- "skipLibCheck": true
12
- },
13
- "include": [
14
- "src-backend/**/*.ts"
15
- ]
16
- }
package/tsconfig.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "build",
4
- "module": "ESNext",
5
- "lib": ["ES2022", "DOM"],
6
- "target": "ES2022",
7
- "declaration": true,
8
- "noImplicitAny": false,
9
- "esModuleInterop": true,
10
- "experimentalDecorators": true,
11
- "useDefineForClassFields": false,
12
- "sourceMap": false,
13
- "skipLibCheck": true,
14
- "jsx": "react-jsx",
15
- "moduleResolution": "bundler",
16
- "resolveJsonModule": true,
17
- "isolatedModules": true,
18
- "noEmit": true
19
- },
20
- "include": [
21
- "src/**/*.ts",
22
- "src/**/*.tsx",
23
- "src-backend/**/*.ts",
24
- ],
25
- "references": [{ "path": "./tsconfig.node.json" }]
26
- }
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "allowSyntheticDefaultImports": true
8
- },
9
- "include": ["vite.config.ts"]
10
- }
package/vite.config.ts DELETED
@@ -1,26 +0,0 @@
1
- import { defineConfig } from 'vite';
2
- import react from '@vitejs/plugin-react';
3
- import path from 'path';
4
-
5
- // https://vitejs.dev/config/
6
- export default defineConfig({
7
- plugins: [react()],
8
- base: './',
9
- server: {
10
- port: 3000,
11
- open: true,
12
- },
13
- build: {
14
- outDir: 'build/static',
15
- sourcemap: true,
16
- },
17
- define: {
18
- 'process.env.npm_package_version': JSON.stringify(process.env.npm_package_version || '0.17.0'),
19
- },
20
- resolve: {
21
- extensions: ['.ts', '.tsx', '.js', '.json'],
22
- },
23
- optimizeDeps: {
24
- include: ['react', 'react-dom', 'react-router-dom'],
25
- },
26
- });