@chrona-city/ugc-kit 1.5.12 → 1.5.13
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/README.md +63 -0
- package/docs/harness-onboarding.md +38 -0
- package/docs/meshy.md +13 -0
- package/docs/runtime-download.md +9 -0
- package/lib/creator-api.mjs +70 -0
- package/lib/creator-cli.mjs +13 -3
- package/lib/creator-install.mjs +48 -5
- package/lib/creator-mcp.mjs +1 -0
- package/lib/creator-session.mjs +5 -0
- package/lib/creator-toolchain-compat.mjs +3 -0
- package/lib/meshy-cli.mjs +23 -0
- package/lib/meshy-store.mjs +33 -10
- package/node_modules/pngjs/CHANGELOG.md +128 -0
- package/package.json +1 -2
- package/runtime-catalog.json +16 -16
- package/node_modules/@esbuild/darwin-arm64/README.md +0 -3
- package/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
- package/node_modules/@esbuild/darwin-arm64/package.json +0 -20
- package/node_modules/@esbuild/darwin-x64/README.md +0 -3
- package/node_modules/@esbuild/darwin-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/darwin-x64/package.json +0 -20
- package/node_modules/@esbuild/linux-arm64/README.md +0 -3
- package/node_modules/@esbuild/linux-arm64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-arm64/package.json +0 -20
- package/node_modules/@esbuild/linux-x64/README.md +0 -3
- package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-x64/package.json +0 -20
- package/node_modules/esbuild/LICENSE.md +0 -21
- package/node_modules/esbuild/README.md +0 -3
- package/node_modules/esbuild/bin/esbuild +0 -223
- package/node_modules/esbuild/install.js +0 -289
- package/node_modules/esbuild/lib/main.d.ts +0 -716
- package/node_modules/esbuild/lib/main.js +0 -2242
- package/node_modules/esbuild/package.json +0 -49
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
### 7.0.0 - 19/02/2023
|
|
4
|
+
|
|
5
|
+
- BREAKING - Drop support for node 12 (Though nothing incompatible in this release yet)
|
|
6
|
+
- Switch to a pngjs organisation
|
|
7
|
+
|
|
8
|
+
### 6.0.0 - 24/10/2020
|
|
9
|
+
|
|
10
|
+
- BREAKING - Sync version now throws if there is unexpected content at the end of the stream.
|
|
11
|
+
- BREAKING - Drop support for node 10 (Though nothing incompatible in this release yet)
|
|
12
|
+
- Reduce the number of files included in the package
|
|
13
|
+
|
|
14
|
+
### 5.1.0 - 13/09/2020
|
|
15
|
+
|
|
16
|
+
- Add option to skip rescaling
|
|
17
|
+
|
|
18
|
+
### 5.0.0 - 15/04/2020
|
|
19
|
+
|
|
20
|
+
- Drop support for Node 8
|
|
21
|
+
- Browserified bundle may now contain ES20(15-20) code if the supported node version supports it. Please run the browserified version through babel if you need to support older browsers.
|
|
22
|
+
|
|
23
|
+
### 4.0.1 - 15/04/2020
|
|
24
|
+
|
|
25
|
+
- Fix to possible null reference in nextTick of async method
|
|
26
|
+
|
|
27
|
+
### 4.0.0 - 09/04/2020
|
|
28
|
+
|
|
29
|
+
- Fix issue in newer nodes with using Buffer
|
|
30
|
+
- Fix async issue with some png files
|
|
31
|
+
- Drop support for Node 4 & 6
|
|
32
|
+
|
|
33
|
+
### 3.4.0 - 09/03/2019
|
|
34
|
+
|
|
35
|
+
- Include whether the png has alpha in the meta data
|
|
36
|
+
- emit an error if the image is truncated instead of hanging
|
|
37
|
+
- Add a browserified version
|
|
38
|
+
- speed up some mapping functions
|
|
39
|
+
|
|
40
|
+
### 3.3.3 - 19/04/2018
|
|
41
|
+
|
|
42
|
+
- Real fix for node 9
|
|
43
|
+
|
|
44
|
+
### 3.3.2 - 16/02/2018
|
|
45
|
+
|
|
46
|
+
- Fix for node 9
|
|
47
|
+
|
|
48
|
+
### 3.3.1 - 15/11/2017
|
|
49
|
+
|
|
50
|
+
- Bugfixes and removal of es6
|
|
51
|
+
|
|
52
|
+
### 3.3.0
|
|
53
|
+
|
|
54
|
+
- Add writing 16 bit channels and support for grayscale input
|
|
55
|
+
|
|
56
|
+
### 3.2.0 - 30/04/2017
|
|
57
|
+
|
|
58
|
+
- Support for encoding 8-bit grayscale images
|
|
59
|
+
|
|
60
|
+
### 3.1.0 - 30/04/2017
|
|
61
|
+
|
|
62
|
+
- Support for pngs with zlib chunks that are malformed after valid data
|
|
63
|
+
|
|
64
|
+
### 3.0.1 - 16/02/2017
|
|
65
|
+
|
|
66
|
+
- Fix single pixel pngs
|
|
67
|
+
|
|
68
|
+
### 3.0.0 - 03/08/2016
|
|
69
|
+
|
|
70
|
+
- Drop support for node below v4 and iojs. Pin to 2.3.0 to use with old, unsupported or patched node versions.
|
|
71
|
+
|
|
72
|
+
### 2.3.0 - 22/04/2016
|
|
73
|
+
|
|
74
|
+
- Support for sync in node 0.10
|
|
75
|
+
|
|
76
|
+
### 2.2.0 - 04/12/2015
|
|
77
|
+
|
|
78
|
+
- Add sync write api
|
|
79
|
+
- Fix newfile example
|
|
80
|
+
- Correct comparison table
|
|
81
|
+
|
|
82
|
+
### 2.1.0 - 28/10/2015
|
|
83
|
+
|
|
84
|
+
- rename package to pngjs
|
|
85
|
+
- added 'bgColor' option
|
|
86
|
+
|
|
87
|
+
### 2.0.0 - 08/10/2015
|
|
88
|
+
|
|
89
|
+
- fixes to readme
|
|
90
|
+
- _breaking change_ - bitblt on the png prototype now doesn't take a unused, unnecessary src first argument
|
|
91
|
+
|
|
92
|
+
### 1.2.0 - 13/09/2015
|
|
93
|
+
|
|
94
|
+
- support passing colorType to write PNG's and writing bitmaps without alpha information
|
|
95
|
+
|
|
96
|
+
### 1.1.0 - 07/09/2015
|
|
97
|
+
|
|
98
|
+
- support passing a deflate factory for controlled compression
|
|
99
|
+
|
|
100
|
+
### 1.0.2 - 22/08/2015
|
|
101
|
+
|
|
102
|
+
- Expose all PNG creation info
|
|
103
|
+
|
|
104
|
+
### 1.0.1 - 21/08/2015
|
|
105
|
+
|
|
106
|
+
- Fix non square interlaced files
|
|
107
|
+
|
|
108
|
+
### 1.0.0 - 08/08/2015
|
|
109
|
+
|
|
110
|
+
- More tests
|
|
111
|
+
- source linted
|
|
112
|
+
- maintainability refactorings
|
|
113
|
+
- async API - exceptions in reading now emit warnings
|
|
114
|
+
- documentation improvement - sync api now documented, adjustGamma documented
|
|
115
|
+
- breaking change - gamma chunk is now written. previously a read then write would destroy gamma information, now it is persisted.
|
|
116
|
+
|
|
117
|
+
### 0.0.3 - 03/08/2015
|
|
118
|
+
|
|
119
|
+
- Error handling fixes
|
|
120
|
+
- ignore files for smaller npm footprint
|
|
121
|
+
|
|
122
|
+
### 0.0.2 - 02/08/2015
|
|
123
|
+
|
|
124
|
+
- Bugfixes to interlacing, support for transparent colours
|
|
125
|
+
|
|
126
|
+
### 0.0.1 - 02/08/2015
|
|
127
|
+
|
|
128
|
+
- Initial release, see pngjs for older changelog.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrona-city/ugc-kit",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.13",
|
|
4
4
|
"description": "Chrona creator CLI, SDK and MCP tools for validated multiplayer content",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -116,7 +116,6 @@
|
|
|
116
116
|
},
|
|
117
117
|
"bundleDependencies": [
|
|
118
118
|
"@modelcontextprotocol/server",
|
|
119
|
-
"esbuild",
|
|
120
119
|
"gltf-validator",
|
|
121
120
|
"pngjs",
|
|
122
121
|
"smol-toml",
|
package/runtime-catalog.json
CHANGED
|
@@ -5,33 +5,33 @@
|
|
|
5
5
|
{
|
|
6
6
|
"schemaVersion": "1.0.0",
|
|
7
7
|
"kind": "public-runtime-lock",
|
|
8
|
-
"runtimeId": "
|
|
9
|
-
"runtimeHash": "sha256:
|
|
8
|
+
"runtimeId": "runtime_110e49df719755e06b0decff75e91a44d6fd5c8177e06609fdd8b88094af4ea6",
|
|
9
|
+
"runtimeHash": "sha256:110e49df719755e06b0decff75e91a44d6fd5c8177e06609fdd8b88094af4ea6",
|
|
10
10
|
"manifest": {
|
|
11
|
-
"bytes":
|
|
12
|
-
"sha256": "sha256:
|
|
13
|
-
"url": "https://chrona.city/runtime-packages/
|
|
11
|
+
"bytes": 160826,
|
|
12
|
+
"sha256": "sha256:8a59c5b5f2cb806e9f43d2b23b13eb22f033b3758e9b64b117b146c1f95b2cf7",
|
|
13
|
+
"url": "https://chrona.city/runtime-packages/runtime_110e49df719755e06b0decff75e91a44d6fd5c8177e06609fdd8b88094af4ea6/runtime-manifest.json"
|
|
14
14
|
},
|
|
15
15
|
"archive": {
|
|
16
|
-
"bytes":
|
|
17
|
-
"sha256": "sha256:
|
|
18
|
-
"url": "https://chrona.city/runtime-packages/
|
|
16
|
+
"bytes": 12345177,
|
|
17
|
+
"sha256": "sha256:15ad0a19b414d04768bac7755f218dca72b17f9ecae1dcf60b8e4a0eaf7ffd71",
|
|
18
|
+
"url": "https://chrona.city/runtime-packages/runtime_110e49df719755e06b0decff75e91a44d6fd5c8177e06609fdd8b88094af4ea6/runtime.zip"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"schemaVersion": "1.0.0",
|
|
23
23
|
"kind": "public-runtime-lock",
|
|
24
|
-
"runtimeId": "
|
|
25
|
-
"runtimeHash": "sha256:
|
|
24
|
+
"runtimeId": "runtime_4f2469adcb46d2ef001c0e1ae8015be6d4f7d8ac03f7d5d7ed39f9e7911b9be2",
|
|
25
|
+
"runtimeHash": "sha256:4f2469adcb46d2ef001c0e1ae8015be6d4f7d8ac03f7d5d7ed39f9e7911b9be2",
|
|
26
26
|
"manifest": {
|
|
27
|
-
"bytes":
|
|
28
|
-
"sha256": "sha256:
|
|
29
|
-
"url": "https://chrona.city/runtime-packages/
|
|
27
|
+
"bytes": 61663,
|
|
28
|
+
"sha256": "sha256:37263ffe4831fafebe9b51b04d0b750e986b9802d1e63299e15a36fe0d9b5f4e",
|
|
29
|
+
"url": "https://chrona.city/runtime-packages/runtime_4f2469adcb46d2ef001c0e1ae8015be6d4f7d8ac03f7d5d7ed39f9e7911b9be2/runtime-manifest.json"
|
|
30
30
|
},
|
|
31
31
|
"archive": {
|
|
32
|
-
"bytes":
|
|
33
|
-
"sha256": "sha256:
|
|
34
|
-
"url": "https://chrona.city/runtime-packages/
|
|
32
|
+
"bytes": 7856027,
|
|
33
|
+
"sha256": "sha256:f7058294e15dc8d4d902f7ab40b87b5e6332cf6ad7e7b5a18b7d83f59f1e558f",
|
|
34
|
+
"url": "https://chrona.city/runtime-packages/runtime_4f2469adcb46d2ef001c0e1ae8015be6d4f7d8ac03f7d5d7ed39f9e7911b9be2/runtime.zip"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
]
|
|
Binary file
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@esbuild/darwin-arm64",
|
|
3
|
-
"version": "0.25.9",
|
|
4
|
-
"description": "The macOS ARM 64-bit binary for esbuild, a JavaScript bundler.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/evanw/esbuild.git"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"preferUnplugged": true,
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=18"
|
|
13
|
-
},
|
|
14
|
-
"os": [
|
|
15
|
-
"darwin"
|
|
16
|
-
],
|
|
17
|
-
"cpu": [
|
|
18
|
-
"arm64"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
Binary file
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@esbuild/darwin-x64",
|
|
3
|
-
"version": "0.25.9",
|
|
4
|
-
"description": "The macOS 64-bit binary for esbuild, a JavaScript bundler.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/evanw/esbuild.git"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"preferUnplugged": true,
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=18"
|
|
13
|
-
},
|
|
14
|
-
"os": [
|
|
15
|
-
"darwin"
|
|
16
|
-
],
|
|
17
|
-
"cpu": [
|
|
18
|
-
"x64"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
Binary file
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@esbuild/linux-arm64",
|
|
3
|
-
"version": "0.25.9",
|
|
4
|
-
"description": "The Linux ARM 64-bit binary for esbuild, a JavaScript bundler.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/evanw/esbuild.git"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"preferUnplugged": true,
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=18"
|
|
13
|
-
},
|
|
14
|
-
"os": [
|
|
15
|
-
"linux"
|
|
16
|
-
],
|
|
17
|
-
"cpu": [
|
|
18
|
-
"arm64"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
Binary file
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@esbuild/linux-x64",
|
|
3
|
-
"version": "0.25.9",
|
|
4
|
-
"description": "The Linux 64-bit binary for esbuild, a JavaScript bundler.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/evanw/esbuild.git"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"preferUnplugged": true,
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=18"
|
|
13
|
-
},
|
|
14
|
-
"os": [
|
|
15
|
-
"linux"
|
|
16
|
-
],
|
|
17
|
-
"cpu": [
|
|
18
|
-
"x64"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Evan Wallace
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
-
mod
|
|
24
|
-
));
|
|
25
|
-
|
|
26
|
-
// lib/npm/node-platform.ts
|
|
27
|
-
var fs = require("fs");
|
|
28
|
-
var os = require("os");
|
|
29
|
-
var path = require("path");
|
|
30
|
-
var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
|
|
31
|
-
var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
|
|
32
|
-
var packageDarwin_arm64 = "@esbuild/darwin-arm64";
|
|
33
|
-
var packageDarwin_x64 = "@esbuild/darwin-x64";
|
|
34
|
-
var knownWindowsPackages = {
|
|
35
|
-
"win32 arm64 LE": "@esbuild/win32-arm64",
|
|
36
|
-
"win32 ia32 LE": "@esbuild/win32-ia32",
|
|
37
|
-
"win32 x64 LE": "@esbuild/win32-x64"
|
|
38
|
-
};
|
|
39
|
-
var knownUnixlikePackages = {
|
|
40
|
-
"aix ppc64 BE": "@esbuild/aix-ppc64",
|
|
41
|
-
"android arm64 LE": "@esbuild/android-arm64",
|
|
42
|
-
"darwin arm64 LE": "@esbuild/darwin-arm64",
|
|
43
|
-
"darwin x64 LE": "@esbuild/darwin-x64",
|
|
44
|
-
"freebsd arm64 LE": "@esbuild/freebsd-arm64",
|
|
45
|
-
"freebsd x64 LE": "@esbuild/freebsd-x64",
|
|
46
|
-
"linux arm LE": "@esbuild/linux-arm",
|
|
47
|
-
"linux arm64 LE": "@esbuild/linux-arm64",
|
|
48
|
-
"linux ia32 LE": "@esbuild/linux-ia32",
|
|
49
|
-
"linux mips64el LE": "@esbuild/linux-mips64el",
|
|
50
|
-
"linux ppc64 LE": "@esbuild/linux-ppc64",
|
|
51
|
-
"linux riscv64 LE": "@esbuild/linux-riscv64",
|
|
52
|
-
"linux s390x BE": "@esbuild/linux-s390x",
|
|
53
|
-
"linux x64 LE": "@esbuild/linux-x64",
|
|
54
|
-
"linux loong64 LE": "@esbuild/linux-loong64",
|
|
55
|
-
"netbsd arm64 LE": "@esbuild/netbsd-arm64",
|
|
56
|
-
"netbsd x64 LE": "@esbuild/netbsd-x64",
|
|
57
|
-
"openbsd arm64 LE": "@esbuild/openbsd-arm64",
|
|
58
|
-
"openbsd x64 LE": "@esbuild/openbsd-x64",
|
|
59
|
-
"sunos x64 LE": "@esbuild/sunos-x64"
|
|
60
|
-
};
|
|
61
|
-
var knownWebAssemblyFallbackPackages = {
|
|
62
|
-
"android arm LE": "@esbuild/android-arm",
|
|
63
|
-
"android x64 LE": "@esbuild/android-x64",
|
|
64
|
-
"openharmony arm64 LE": "@esbuild/openharmony-arm64"
|
|
65
|
-
};
|
|
66
|
-
function pkgAndSubpathForCurrentPlatform() {
|
|
67
|
-
let pkg;
|
|
68
|
-
let subpath;
|
|
69
|
-
let isWASM2 = false;
|
|
70
|
-
let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
|
|
71
|
-
if (platformKey in knownWindowsPackages) {
|
|
72
|
-
pkg = knownWindowsPackages[platformKey];
|
|
73
|
-
subpath = "esbuild.exe";
|
|
74
|
-
} else if (platformKey in knownUnixlikePackages) {
|
|
75
|
-
pkg = knownUnixlikePackages[platformKey];
|
|
76
|
-
subpath = "bin/esbuild";
|
|
77
|
-
} else if (platformKey in knownWebAssemblyFallbackPackages) {
|
|
78
|
-
pkg = knownWebAssemblyFallbackPackages[platformKey];
|
|
79
|
-
subpath = "bin/esbuild";
|
|
80
|
-
isWASM2 = true;
|
|
81
|
-
} else {
|
|
82
|
-
throw new Error(`Unsupported platform: ${platformKey}`);
|
|
83
|
-
}
|
|
84
|
-
return { pkg, subpath, isWASM: isWASM2 };
|
|
85
|
-
}
|
|
86
|
-
function pkgForSomeOtherPlatform() {
|
|
87
|
-
const libMainJS = require.resolve("esbuild");
|
|
88
|
-
const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS)));
|
|
89
|
-
if (path.basename(nodeModulesDirectory) === "node_modules") {
|
|
90
|
-
for (const unixKey in knownUnixlikePackages) {
|
|
91
|
-
try {
|
|
92
|
-
const pkg = knownUnixlikePackages[unixKey];
|
|
93
|
-
if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
|
|
94
|
-
} catch {
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
for (const windowsKey in knownWindowsPackages) {
|
|
98
|
-
try {
|
|
99
|
-
const pkg = knownWindowsPackages[windowsKey];
|
|
100
|
-
if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
|
|
101
|
-
} catch {
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
function downloadedBinPath(pkg, subpath) {
|
|
108
|
-
const esbuildLibDir = path.dirname(require.resolve("esbuild"));
|
|
109
|
-
return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
|
|
110
|
-
}
|
|
111
|
-
function generateBinPath() {
|
|
112
|
-
if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
|
|
113
|
-
if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
|
|
114
|
-
console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
|
|
115
|
-
} else {
|
|
116
|
-
return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
const { pkg, subpath, isWASM: isWASM2 } = pkgAndSubpathForCurrentPlatform();
|
|
120
|
-
let binPath2;
|
|
121
|
-
try {
|
|
122
|
-
binPath2 = require.resolve(`${pkg}/${subpath}`);
|
|
123
|
-
} catch (e) {
|
|
124
|
-
binPath2 = downloadedBinPath(pkg, subpath);
|
|
125
|
-
if (!fs.existsSync(binPath2)) {
|
|
126
|
-
try {
|
|
127
|
-
require.resolve(pkg);
|
|
128
|
-
} catch {
|
|
129
|
-
const otherPkg = pkgForSomeOtherPlatform();
|
|
130
|
-
if (otherPkg) {
|
|
131
|
-
let suggestions = `
|
|
132
|
-
Specifically the "${otherPkg}" package is present but this platform
|
|
133
|
-
needs the "${pkg}" package instead. People often get into this
|
|
134
|
-
situation by installing esbuild on Windows or macOS and copying "node_modules"
|
|
135
|
-
into a Docker image that runs Linux, or by copying "node_modules" between
|
|
136
|
-
Windows and WSL environments.
|
|
137
|
-
|
|
138
|
-
If you are installing with npm, you can try not copying the "node_modules"
|
|
139
|
-
directory when you copy the files over, and running "npm ci" or "npm install"
|
|
140
|
-
on the destination platform after the copy. Or you could consider using yarn
|
|
141
|
-
instead of npm which has built-in support for installing a package on multiple
|
|
142
|
-
platforms simultaneously.
|
|
143
|
-
|
|
144
|
-
If you are installing with yarn, you can try listing both this platform and the
|
|
145
|
-
other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
|
|
146
|
-
feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
|
|
147
|
-
Keep in mind that this means multiple copies of esbuild will be present.
|
|
148
|
-
`;
|
|
149
|
-
if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) {
|
|
150
|
-
suggestions = `
|
|
151
|
-
Specifically the "${otherPkg}" package is present but this platform
|
|
152
|
-
needs the "${pkg}" package instead. People often get into this
|
|
153
|
-
situation by installing esbuild with npm running inside of Rosetta 2 and then
|
|
154
|
-
trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
|
|
155
|
-
2 is Apple's on-the-fly x86_64-to-arm64 translation service).
|
|
156
|
-
|
|
157
|
-
If you are installing with npm, you can try ensuring that both npm and node are
|
|
158
|
-
not running under Rosetta 2 and then reinstalling esbuild. This likely involves
|
|
159
|
-
changing how you installed npm and/or node. For example, installing node with
|
|
160
|
-
the universal installer here should work: https://nodejs.org/en/download/. Or
|
|
161
|
-
you could consider using yarn instead of npm which has built-in support for
|
|
162
|
-
installing a package on multiple platforms simultaneously.
|
|
163
|
-
|
|
164
|
-
If you are installing with yarn, you can try listing both "arm64" and "x64"
|
|
165
|
-
in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
|
|
166
|
-
https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
|
|
167
|
-
Keep in mind that this means multiple copies of esbuild will be present.
|
|
168
|
-
`;
|
|
169
|
-
}
|
|
170
|
-
throw new Error(`
|
|
171
|
-
You installed esbuild for another platform than the one you're currently using.
|
|
172
|
-
This won't work because esbuild is written with native code and needs to
|
|
173
|
-
install a platform-specific binary executable.
|
|
174
|
-
${suggestions}
|
|
175
|
-
Another alternative is to use the "esbuild-wasm" package instead, which works
|
|
176
|
-
the same way on all platforms. But it comes with a heavy performance cost and
|
|
177
|
-
can sometimes be 10x slower than the "esbuild" package, so you may also not
|
|
178
|
-
want to do that.
|
|
179
|
-
`);
|
|
180
|
-
}
|
|
181
|
-
throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild.
|
|
182
|
-
|
|
183
|
-
If you are installing esbuild with npm, make sure that you don't specify the
|
|
184
|
-
"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
|
|
185
|
-
of "package.json" is used by esbuild to install the correct binary executable
|
|
186
|
-
for your current platform.`);
|
|
187
|
-
}
|
|
188
|
-
throw e;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (/\.zip\//.test(binPath2)) {
|
|
192
|
-
let pnpapi;
|
|
193
|
-
try {
|
|
194
|
-
pnpapi = require("pnpapi");
|
|
195
|
-
} catch (e) {
|
|
196
|
-
}
|
|
197
|
-
if (pnpapi) {
|
|
198
|
-
const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation;
|
|
199
|
-
const binTargetPath = path.join(
|
|
200
|
-
root,
|
|
201
|
-
"node_modules",
|
|
202
|
-
".cache",
|
|
203
|
-
"esbuild",
|
|
204
|
-
`pnpapi-${pkg.replace("/", "-")}-${"0.25.9"}-${path.basename(subpath)}`
|
|
205
|
-
);
|
|
206
|
-
if (!fs.existsSync(binTargetPath)) {
|
|
207
|
-
fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
|
|
208
|
-
fs.copyFileSync(binPath2, binTargetPath);
|
|
209
|
-
fs.chmodSync(binTargetPath, 493);
|
|
210
|
-
}
|
|
211
|
-
return { binPath: binTargetPath, isWASM: isWASM2 };
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return { binPath: binPath2, isWASM: isWASM2 };
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// lib/npm/node-shim.ts
|
|
218
|
-
var { binPath, isWASM } = generateBinPath();
|
|
219
|
-
if (isWASM) {
|
|
220
|
-
require("child_process").execFileSync("node", [binPath].concat(process.argv.slice(2)), { stdio: "inherit" });
|
|
221
|
-
} else {
|
|
222
|
-
require("child_process").execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
223
|
-
}
|