@needle-tools/engine 4.16.1-next.e45724f → 4.16.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.
- package/CHANGELOG.md +7 -0
- package/components.needle.json +1 -1
- package/dist/{needle-engine.bundle-CupCi9ih.min.js → needle-engine.bundle-BOzZVXHu.min.js} +125 -125
- package/dist/{needle-engine.bundle-Kai1_GLU.js → needle-engine.bundle-VXttgVve.js} +3854 -3848
- package/dist/{needle-engine.bundle-CWDn3Osx.umd.cjs → needle-engine.bundle-nJtehyVz.umd.cjs} +125 -125
- package/dist/needle-engine.d.ts +24 -8
- package/dist/needle-engine.js +2 -2
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine-components/EventType.d.ts +1 -13
- package/lib/engine-components/EventType.js +13 -12
- package/lib/engine-components/EventType.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +24 -8
- package/lib/engine-components/ReflectionProbe.js +33 -15
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/package.json +10 -2
- package/plugins/next/next.d.ts +7 -0
- package/plugins/next/next.js +2 -2
- package/plugins/types/userconfig.d.ts +4 -6
- package/plugins/vite/ai.d.ts +16 -0
- package/plugins/vite/ai.js +2 -2
- package/plugins/vite/alias.d.ts +6 -0
- package/plugins/vite/alias.js +2 -2
- package/plugins/vite/asap.d.ts +6 -0
- package/plugins/vite/asap.js +1 -1
- package/plugins/vite/build-pipeline.d.ts +6 -0
- package/plugins/vite/build-pipeline.js +1 -1
- package/plugins/vite/build.d.ts +6 -0
- package/plugins/vite/build.js +1 -1
- package/plugins/vite/buildinfo.d.ts +6 -0
- package/plugins/vite/buildinfo.js +1 -1
- package/plugins/vite/copyfiles.d.ts +6 -0
- package/plugins/vite/copyfiles.js +1 -1
- package/plugins/vite/custom-element-data.d.ts +11 -0
- package/plugins/vite/custom-element-data.js +1 -1
- package/plugins/vite/defines.d.ts +9 -0
- package/plugins/vite/defines.js +1 -1
- package/plugins/vite/dependencies.d.ts +7 -1
- package/plugins/vite/dependencies.js +1 -1
- package/plugins/vite/dependency-watcher.d.ts +6 -0
- package/plugins/vite/dependency-watcher.js +1 -1
- package/plugins/vite/drop-client.d.ts +1 -0
- package/plugins/vite/drop.d.ts +6 -0
- package/plugins/vite/drop.js +1 -1
- package/plugins/vite/editor-connection.d.ts +7 -0
- package/plugins/vite/editor-connection.js +1 -1
- package/plugins/vite/facebook-instant-games.d.ts +6 -0
- package/plugins/vite/facebook-instant-games.js +1 -1
- package/plugins/vite/imports-logger.d.ts +7 -0
- package/plugins/vite/imports-logger.js +1 -1
- package/plugins/vite/index.d.ts +27 -27
- package/plugins/vite/index.js +1 -1
- package/plugins/vite/license.d.ts +6 -0
- package/plugins/vite/license.js +2 -2
- package/plugins/vite/local-files-core.d.ts +7 -1
- package/plugins/vite/local-files-core.js +2 -2
- package/plugins/vite/local-files-internals.d.ts +3 -0
- package/plugins/vite/logger.d.ts +7 -0
- package/plugins/vite/logger.js +1 -1
- package/plugins/vite/meta.d.ts +6 -0
- package/plugins/vite/meta.js +1 -1
- package/plugins/vite/needle-app.d.ts +6 -0
- package/plugins/vite/needle-app.js +1 -1
- package/plugins/vite/npm.d.ts +3 -0
- package/plugins/vite/npm.js +1 -1
- package/plugins/vite/peer.d.ts +6 -0
- package/plugins/vite/peer.js +1 -1
- package/plugins/vite/poster-client.d.ts +1 -0
- package/plugins/vite/poster.d.ts +6 -0
- package/plugins/vite/poster.js +2 -2
- package/plugins/vite/pwa.d.ts +6 -0
- package/plugins/vite/pwa.js +1 -1
- package/plugins/vite/reload-client.d.ts +1 -0
- package/plugins/vite/reload.d.ts +6 -0
- package/plugins/vite/reload.js +1 -1
- package/plugins/vite/server.d.ts +6 -0
- package/plugins/vite/server.js +2 -2
- package/plugins/vite/transform-codegen.d.ts +7 -0
- package/plugins/vite/transform-codegen.js +1 -1
- package/plugins/vite/transform.d.ts +4 -0
- package/plugins/vite/transform.js +1 -1
- package/plugins/vite/vite-4.4-hack.d.ts +4 -0
- package/plugins/vite/vite-4.4-hack.js +1 -1
- package/src/engine-components/EventType.ts +13 -12
- package/src/engine-components/ReflectionProbe.ts +37 -19
|
@@ -5,16 +5,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { Box3, CubeTexture, EquirectangularReflectionMapping, LinearSRGBColorSpace, Quaternion, Texture, Vector3 } from "three";
|
|
8
|
+
import { CreateWireCube } from "../engine/engine_gizmos.js";
|
|
8
9
|
import { MaterialPropertyBlock } from "../engine/engine_materialpropertyblock.js";
|
|
9
10
|
import { loadPMREM } from "../engine/engine_pmrem.js";
|
|
10
11
|
import { serializable } from "../engine/engine_serialization.js";
|
|
12
|
+
import { getBoundingBox } from "../engine/engine_three_utils.js";
|
|
11
13
|
import { getParam, resolveUrl } from "../engine/engine_utils.js";
|
|
12
14
|
import { Behaviour } from "./Component.js";
|
|
13
15
|
import { EventList } from "./EventList.js";
|
|
14
|
-
import { getBoundingBox } from "../engine/engine_three_utils.js";
|
|
15
|
-
import { CreateWireCube } from "../engine/engine_gizmos.js";
|
|
16
16
|
export const debug = getParam("debugreflectionprobe");
|
|
17
17
|
const disable = getParam("noreflectionprobe");
|
|
18
|
+
let box = null;
|
|
19
|
+
const _identityRotation = new Quaternion();
|
|
18
20
|
const $reflectionProbeKey = Symbol("reflectionProbeKey");
|
|
19
21
|
/**
|
|
20
22
|
* The [ReflectionProbe](https://engine.needle.tools/docs/api/ReflectionProbe) provides environment reflection data to materials within its defined area.
|
|
@@ -42,12 +44,10 @@ const $reflectionProbeKey = Symbol("reflectionProbeKey");
|
|
|
42
44
|
*/
|
|
43
45
|
export class ReflectionProbe extends Behaviour {
|
|
44
46
|
static _probes = new Map();
|
|
45
|
-
/** The bounding box for this component */
|
|
46
|
-
box = null;
|
|
47
47
|
static testBox = new Box3();
|
|
48
|
-
static _identityRotation = new Quaternion();
|
|
49
48
|
/**
|
|
50
|
-
* Checks if the given material is currently using a reflection probe.
|
|
49
|
+
* Checks if the given material is currently using a reflection probe.
|
|
50
|
+
* This is determined by checking for an override on the material's "envMap" property, which is set by the Renderer component when applying a reflection probe.
|
|
51
51
|
*/
|
|
52
52
|
static isUsingReflectionProbe(material) {
|
|
53
53
|
return !!material[$reflectionProbeKey];
|
|
@@ -104,7 +104,10 @@ export class ReflectionProbe extends Behaviour {
|
|
|
104
104
|
_texture;
|
|
105
105
|
_textureUrlInFlight;
|
|
106
106
|
/**
|
|
107
|
-
* The cubemap or HDR texture used for reflections. Can be assigned directly or via a URL string.
|
|
107
|
+
* The cubemap or HDR texture used for reflections. Can be assigned directly or via a URL string.
|
|
108
|
+
* When assigning via URL, the texture will be loaded asynchronously and applied once ready.
|
|
109
|
+
* @param tex The texture or URL to assign to this reflection probe
|
|
110
|
+
* @default null
|
|
108
111
|
*/
|
|
109
112
|
set texture(tex) {
|
|
110
113
|
if (this._texture === tex)
|
|
@@ -145,13 +148,22 @@ export class ReflectionProbe extends Behaviour {
|
|
|
145
148
|
get texture() {
|
|
146
149
|
return this._texture;
|
|
147
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* The intensity of the reflection probe's influence.
|
|
153
|
+
* Higher values will make reflections brighter, while lower values will make them dimmer.
|
|
154
|
+
* The default value is 1, which means the reflections will be applied at their original brightness. Adjust this value to achieve the desired look for your scene.
|
|
155
|
+
* @default 1
|
|
156
|
+
*/
|
|
148
157
|
intensity = 1;
|
|
149
158
|
/**
|
|
150
|
-
* Defines the center
|
|
159
|
+
* Defines the center of the reflection probe's influence area relative to the GameObject's position.
|
|
160
|
+
* The probe will affect objects within a box defined by this center and the `size` property.
|
|
161
|
+
* Note: The actual influence area is determined by both the `center` and `size` properties. The `center` defines the offset from the GameObject's position, while the `size` defines the dimensions of the box around that center. Objects within this box will be influenced by the reflection probe.
|
|
151
162
|
*/
|
|
152
163
|
center = new Vector3();
|
|
153
164
|
/**
|
|
154
165
|
* Defines the size of the reflection probe's influence area. Objects within this box will be affected by the probe's reflections.
|
|
166
|
+
* Note: The actual influence area is determined by both the `center` and `size` properties. The `center` defines the offset from the GameObject's position, while the `size` defines the dimensions of the box around that center. Objects within this box will be influenced by the reflection probe.
|
|
155
167
|
*/
|
|
156
168
|
size = new Vector3(1, 1, 1);
|
|
157
169
|
/**
|
|
@@ -159,14 +171,14 @@ export class ReflectionProbe extends Behaviour {
|
|
|
159
171
|
*/
|
|
160
172
|
__lightmapIntensityScale = true;
|
|
161
173
|
isInBox(obj) {
|
|
162
|
-
|
|
163
|
-
|
|
174
|
+
box ??= new Box3();
|
|
175
|
+
box.setFromCenterAndSize(this.gameObject.worldPosition.add(this.center), this.gameObject.worldScale.multiply(this.size));
|
|
164
176
|
getBoundingBox([obj], undefined, undefined, ReflectionProbe.testBox);
|
|
165
177
|
if (ReflectionProbe.testBox.isEmpty()) {
|
|
166
|
-
return
|
|
178
|
+
return box.containsPoint(obj.worldPosition);
|
|
167
179
|
}
|
|
168
180
|
else {
|
|
169
|
-
return
|
|
181
|
+
return box?.intersectsBox(ReflectionProbe.testBox);
|
|
170
182
|
}
|
|
171
183
|
}
|
|
172
184
|
constructor() {
|
|
@@ -197,7 +209,7 @@ export class ReflectionProbe extends Behaviour {
|
|
|
197
209
|
this._gizmo.position.copy(this.center);
|
|
198
210
|
if (this.size)
|
|
199
211
|
this._gizmo.scale.copy(this.size);
|
|
200
|
-
this._gizmo.worldQuaternion =
|
|
212
|
+
this._gizmo.worldQuaternion = _identityRotation.identity();
|
|
201
213
|
}
|
|
202
214
|
}
|
|
203
215
|
/** @internal */
|
|
@@ -225,7 +237,10 @@ export class ReflectionProbe extends Behaviour {
|
|
|
225
237
|
}
|
|
226
238
|
}
|
|
227
239
|
/**
|
|
228
|
-
* Applies this reflection probe to the given object by setting material property overrides for "envMap", "envMapRotation", and "envMapIntensity".
|
|
240
|
+
* Applies this reflection probe to the given object by setting material property overrides for "envMap", "envMapRotation", and "envMapIntensity".
|
|
241
|
+
* This is typically called by the Renderer component when determining which reflection probe to use for a given object.
|
|
242
|
+
* @param object The object to apply the reflection probe to
|
|
243
|
+
* @see {@link unapply} for the corresponding method to remove the probe's influence from an object.
|
|
229
244
|
*/
|
|
230
245
|
apply(object) {
|
|
231
246
|
if (disable)
|
|
@@ -245,7 +260,10 @@ export class ReflectionProbe extends Behaviour {
|
|
|
245
260
|
propertyBlock.setOverride("envMapIntensity", intensity);
|
|
246
261
|
}
|
|
247
262
|
/**
|
|
248
|
-
* Removes the reflection probe overrides from the given object.
|
|
263
|
+
* Removes the reflection probe overrides from the given object.
|
|
264
|
+
* This is typically called by the Renderer component when an object is no longer influenced by this probe or when the probe is disabled.
|
|
265
|
+
* @param object The object to remove the reflection probe overrides from
|
|
266
|
+
* @see {@link apply} for the corresponding method to apply the probe's influence to an object.
|
|
249
267
|
*/
|
|
250
268
|
unapply(obj) {
|
|
251
269
|
const block = MaterialPropertyBlock.get(obj);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReflectionProbe.js","sourceRoot":"","sources":["../../src/engine-components/ReflectionProbe.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAS,WAAW,EAAE,gCAAgC,EAAE,oBAAoB,EAAoC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEzK,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ReflectionProbe.js","sourceRoot":"","sources":["../../src/engine-components/ReflectionProbe.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAS,WAAW,EAAE,gCAAgC,EAAE,oBAAoB,EAAoC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEzK,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAA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AM,CAAC,CAAC;8CAoC/B;AAYD;IADC,YAAY,EAAE;kDACO;AAQtB;IADC,YAAY,CAAC,OAAO,CAAC;+CACU;AAOhC;IADC,YAAY,CAAC,OAAO,CAAC;6CACe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/engine",
|
|
3
|
-
"version": "4.16.
|
|
3
|
+
"version": "4.16.2",
|
|
4
4
|
"description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.",
|
|
5
5
|
"main": "dist/needle-engine.min.js",
|
|
6
6
|
"exports": {
|
|
@@ -22,10 +22,18 @@
|
|
|
22
22
|
"import": "./plugins/next/index.js",
|
|
23
23
|
"require": "./plugins/next/index.js"
|
|
24
24
|
},
|
|
25
|
+
"./plugins/vite": {
|
|
26
|
+
"types": "./plugins/vite/index.d.ts",
|
|
27
|
+
"default": "./plugins/vite/index.js"
|
|
28
|
+
},
|
|
25
29
|
"./plugins/vite/index.js": {
|
|
26
30
|
"types": "./plugins/vite/index.d.ts",
|
|
27
31
|
"default": "./plugins/vite/index.js"
|
|
28
32
|
},
|
|
33
|
+
"./plugins/next": {
|
|
34
|
+
"types": "./plugins/next/next.d.ts",
|
|
35
|
+
"default": "./plugins/next/index.js"
|
|
36
|
+
},
|
|
29
37
|
"./plugins/next/index.js": {
|
|
30
38
|
"types": "./plugins/next/next.d.ts",
|
|
31
39
|
"default": "./plugins/next/index.js"
|
|
@@ -184,4 +192,4 @@
|
|
|
184
192
|
"module": "lib/needle-engine.js",
|
|
185
193
|
"typings": "lib/needle-engine.d.ts",
|
|
186
194
|
"types": "lib/needle-engine.d.ts"
|
|
187
|
-
}
|
|
195
|
+
}
|
package/plugins/next/next.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/** Integrates Needle Engine into a Next.js project.
|
|
2
|
+
* Pass a nextConfig object in to add the needle specific settings.
|
|
3
|
+
* Optionally omit nextConfig and it will be created for you.
|
|
4
|
+
* @param {import('next').NextConfig} [nextConfig]
|
|
5
|
+
* @param {import('../types').userSettings} [userSettings]
|
|
6
|
+
* @returns {Promise<import('next').NextConfig>}
|
|
7
|
+
*/
|
|
1
8
|
export function needleNext(nextConfig?: any, userSettings?: import("../types").userSettings): Promise<any>;
|
package/plugins/next/next.js
CHANGED
|
@@ -19,7 +19,7 @@ const __dirname = dirname(__filename);
|
|
|
19
19
|
* @param {import('../types').userSettings} [userSettings]
|
|
20
20
|
* @returns {Promise<import('next').NextConfig>}
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export async function needleNext(nextConfig, userSettings) {
|
|
23
23
|
console.log("Apply 🌵 needle next config");
|
|
24
24
|
|
|
25
25
|
if (!nextConfig) {
|
|
@@ -139,4 +139,4 @@ export const needleNext = async (nextConfig, userSettings) => {
|
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
return nextConfig;
|
|
142
|
-
}
|
|
142
|
+
}
|
|
@@ -98,9 +98,10 @@ export type userSettings = {
|
|
|
98
98
|
*/
|
|
99
99
|
posterGenerationMode?: "default" | "once";
|
|
100
100
|
|
|
101
|
-
/** Pass in
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
/** Pass in PWA options, `true` to enable with defaults, or `false` to disable.
|
|
102
|
+
* Options are forwarded to `vite-plugin-pwa`.
|
|
103
|
+
*/
|
|
104
|
+
pwa?: Record<string, unknown> | boolean;
|
|
104
105
|
|
|
105
106
|
/** used by nextjs config to forward the webpack module */
|
|
106
107
|
modules?: needleModules;
|
|
@@ -164,9 +165,6 @@ export type userSettings = {
|
|
|
164
165
|
*/
|
|
165
166
|
openBrowser?: boolean;
|
|
166
167
|
|
|
167
|
-
/** Automatically import MaterialX for needle engine in 'main.ts' */
|
|
168
|
-
loadMaterialX?: boolean;
|
|
169
|
-
|
|
170
168
|
disableLogging?: boolean;
|
|
171
169
|
|
|
172
170
|
/** Set to true to disable the plugin that ensures VSCode workspace settings for custom-elements.json data */
|
package/plugins/vite/ai.d.ts
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Needle Engine Claude skill installer.
|
|
3
|
+
*
|
|
4
|
+
* Writes a Needle Engine skill to `.claude/skills/needle-engine/SKILL.md`.
|
|
5
|
+
* Claude Code auto-loads skills based on their description frontmatter, so
|
|
6
|
+
* Claude will automatically have Needle Engine context when working in the project.
|
|
7
|
+
*
|
|
8
|
+
* The skill is only written if `.claude/` already exists in the project root
|
|
9
|
+
* (i.e. the developer is already using Claude Code). Old skill files are
|
|
10
|
+
* always overwritten so the skill stays up to date with the engine version.
|
|
11
|
+
*
|
|
12
|
+
* @param {"build" | "serve"} command
|
|
13
|
+
* @param {{} | undefined | null} config
|
|
14
|
+
* @param {import('../types/index.js').userSettings} userSettings
|
|
15
|
+
* @returns {import('vite').Plugin | null}
|
|
16
|
+
*/
|
|
1
17
|
export function needleAI(command: "build" | "serve", config: {} | undefined | null, userSettings: import("../types/index.js").userSettings): import("vite").Plugin | null;
|
package/plugins/vite/ai.js
CHANGED
|
@@ -23,7 +23,7 @@ const pluginName = "needle-ai";
|
|
|
23
23
|
* @param {import('../types/index.js').userSettings} userSettings
|
|
24
24
|
* @returns {import('vite').Plugin | null}
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export function needleAI(command, config, userSettings) {
|
|
27
27
|
return {
|
|
28
28
|
name: pluginName,
|
|
29
29
|
enforce: "pre",
|
|
@@ -34,7 +34,7 @@ export const needleAI = (command, config, userSettings) => {
|
|
|
34
34
|
installClaudeSkill();
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
38
|
|
|
39
39
|
function writeSkill(claudeDir) {
|
|
40
40
|
const skillDir = join(claudeDir, "skills", "needle-engine");
|
package/plugins/vite/alias.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {"build" | "serve"} command
|
|
3
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
4
|
+
* @param {import('../types').userSettings} userSettings
|
|
5
|
+
* @returns {import('vite').Plugin | import('vite').Plugin[] | undefined}
|
|
6
|
+
*/
|
|
1
7
|
export function needleViteAlias(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin | import("vite").Plugin[] | undefined;
|
|
2
8
|
export type PackageResolveValue = "auto-resolve" | ((res: string, packageName: string, index: number, path: string) => string | null | void);
|
package/plugins/vite/alias.js
CHANGED
|
@@ -72,7 +72,7 @@ const packages_to_resolve = {
|
|
|
72
72
|
* @param {import('../types').userSettings} userSettings
|
|
73
73
|
* @returns {import('vite').Plugin | import('vite').Plugin[] | undefined}
|
|
74
74
|
*/
|
|
75
|
-
export
|
|
75
|
+
export function needleViteAlias(command, config, userSettings) {
|
|
76
76
|
|
|
77
77
|
if (config?.noAlias === true || userSettings?.noAlias === true)
|
|
78
78
|
return;
|
|
@@ -202,4 +202,4 @@ export const needleViteAlias = (command, config, userSettings) => {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
}
|
|
205
|
+
}
|
package/plugins/vite/asap.d.ts
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/** Injects needle asap script into the index.html for when the main needle engine bundle is still being downloaded.
|
|
2
|
+
* @param {"build" | "serve"} command
|
|
3
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
4
|
+
* @param {import('../types').userSettings} userSettings
|
|
5
|
+
* @returns {Promise<import('vite').Plugin[] | null>}
|
|
6
|
+
*/
|
|
1
7
|
export function needleAsap(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): Promise<import("vite").Plugin[] | null>;
|
package/plugins/vite/asap.js
CHANGED
|
@@ -15,7 +15,7 @@ const code = `import('@needle-tools/engine/src/asap/needle-asap.ts');`
|
|
|
15
15
|
* @param {import('../types').userSettings} userSettings
|
|
16
16
|
* @returns {Promise<import('vite').Plugin[] | null>}
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export async function needleAsap(command, config, userSettings) {
|
|
19
19
|
|
|
20
20
|
if (userSettings.noAsap) return null;
|
|
21
21
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export function waitForBuildPipelineToFinish(): Promise<void>;
|
|
2
|
+
/** Runs the needle build pipeline as part of the vite build process.
|
|
3
|
+
* @param {"build" | "serve"} command
|
|
4
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
5
|
+
* @param {import('../types').userSettings} userSettings
|
|
6
|
+
* @returns {import('vite').Plugin}
|
|
7
|
+
*/
|
|
2
8
|
export function needleBuildPipeline(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin;
|
|
3
9
|
export type BuildPipelinePayload = {
|
|
4
10
|
event?: string;
|
|
@@ -81,7 +81,7 @@ function increaseMaxWaitTime(debugLog) {
|
|
|
81
81
|
* @param {import('../types').userSettings} userSettings
|
|
82
82
|
* @returns {import('vite').Plugin}
|
|
83
83
|
*/
|
|
84
|
-
export
|
|
84
|
+
export async function needleBuildPipeline(command, config, userSettings) {
|
|
85
85
|
|
|
86
86
|
// we only want to run compression here if this is a distribution build
|
|
87
87
|
// this is handled however in the `apply` hook
|
package/plugins/vite/build.d.ts
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {"build" | "serve"} command
|
|
3
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
4
|
+
* @param {import('../types').userSettings} userSettings
|
|
5
|
+
* @returns {import('vite').Plugin}
|
|
6
|
+
*/
|
|
1
7
|
export function needleBuild(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin;
|
package/plugins/vite/build.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param {import('../types').userSettings} userSettings
|
|
6
6
|
* @returns {import('vite').Plugin}
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export function needleBuild(command, config, userSettings) {
|
|
9
9
|
|
|
10
10
|
// TODO: need to set this when building a dist
|
|
11
11
|
const isDeployOnlyBuild = config?.deployOnly === true;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/** Create a buildinfo file in the build directory.
|
|
2
|
+
* @param {"build" | "serve"} command
|
|
3
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
4
|
+
* @param {import('../types').userSettings} userSettings
|
|
5
|
+
* @returns {import('vite').Plugin | null}
|
|
6
|
+
*/
|
|
1
7
|
export function needleBuildInfo(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin | null;
|
|
@@ -12,7 +12,7 @@ let level = 0;
|
|
|
12
12
|
* @param {import('../types').userSettings} userSettings
|
|
13
13
|
* @returns {import('vite').Plugin | null}
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export function needleBuildInfo(command, config, userSettings) {
|
|
16
16
|
|
|
17
17
|
if (userSettings?.noBuildInfo) return null;
|
|
18
18
|
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/** Copy files on build from assets to dist.
|
|
2
|
+
* @param {"build" | "serve"} command
|
|
3
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
4
|
+
* @param {import('../types').userSettings} userSettings
|
|
5
|
+
* @returns {import('vite').Plugin | null}
|
|
6
|
+
*/
|
|
1
7
|
export function needleCopyFiles(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin | null;
|
|
@@ -14,7 +14,7 @@ const pluginName = "needle-copy-files";
|
|
|
14
14
|
* @param {import('../types').userSettings} userSettings
|
|
15
15
|
* @returns {import('vite').Plugin | null}
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export function needleCopyFiles(command, config, userSettings) {
|
|
18
18
|
|
|
19
19
|
if (config?.noCopy === true || userSettings?.noCopy === true) {
|
|
20
20
|
return null;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ensure the repo workspace or .vscode settings include Needle Engine custom HTML data if they exist.
|
|
3
|
+
* Copies custom-elements.json to the project and merges with existing user content.
|
|
4
|
+
* - Copies/merges `custom-elements.json` to project root
|
|
5
|
+
* - Adds `./custom-elements.json` to `.code-workspace settings.html.customData`
|
|
6
|
+
* - Adds `./custom-elements.json` to `.vscode/settings.json html.customData`
|
|
7
|
+
* @param {"build" | "serve"} _command
|
|
8
|
+
* @param {import('../types').needleMeta | null} _config
|
|
9
|
+
* @param {import('../types').userSettings} userSettings
|
|
10
|
+
* @returns {import('vite').Plugin | null}
|
|
11
|
+
*/
|
|
1
12
|
export function needleCustomElementData(_command: "build" | "serve", _config: import("../types").needleMeta | null, userSettings?: import("../types").userSettings): import("vite").Plugin | null;
|
|
2
13
|
export default needleCustomElementData;
|
|
3
14
|
export type CustomElementData = {
|
|
@@ -66,7 +66,7 @@ function mergeCustomElementData(sourceData, targetData) {
|
|
|
66
66
|
* @param {import('../types').userSettings} userSettings
|
|
67
67
|
* @returns {import('vite').Plugin | null}
|
|
68
68
|
*/
|
|
69
|
-
export
|
|
69
|
+
export function needleCustomElementData(_command, _config, userSettings = {}) {
|
|
70
70
|
// Allow disabling the workspace updater
|
|
71
71
|
if (userSettings?.noCustomElementData === true) return null;
|
|
72
72
|
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/** used to pass config variables into vite.config.define
|
|
2
|
+
* for example "useRapier"
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @param {"build" | "serve"} command
|
|
6
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} needleEngineConfig
|
|
7
|
+
* @param {import('../types').userSettings} userSettings
|
|
8
|
+
* @returns {import('vite').Plugin}
|
|
9
|
+
*/
|
|
1
10
|
export function needleDefines(command: "build" | "serve", needleEngineConfig: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin;
|
package/plugins/vite/defines.js
CHANGED
|
@@ -17,7 +17,7 @@ import { needleLog } from "./logging.js";
|
|
|
17
17
|
* @param {import('../types').userSettings} userSettings
|
|
18
18
|
* @returns {import('vite').Plugin}
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export function needleDefines(command, needleEngineConfig, userSettings) {
|
|
21
21
|
|
|
22
22
|
if (!userSettings) userSettings = {};
|
|
23
23
|
|
|
@@ -8,8 +8,14 @@
|
|
|
8
8
|
* @returns {boolean}
|
|
9
9
|
*/
|
|
10
10
|
export function isLocalNeedleEngineInstalled(root?: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @param {"build" | "serve"} command
|
|
13
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
14
|
+
* @param {import('../types').userSettings} userSettings
|
|
15
|
+
* @returns {import('vite').Plugin[]}
|
|
16
|
+
*/
|
|
17
|
+
export function needleDependencies(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin[];
|
|
11
18
|
/**
|
|
12
19
|
* @type {string[]}
|
|
13
20
|
*/
|
|
14
21
|
export const preloadScriptPaths: string[];
|
|
15
|
-
export function needleDependencies(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin[];
|
|
@@ -29,7 +29,7 @@ export function isLocalNeedleEngineInstalled(root = process.cwd()) {
|
|
|
29
29
|
* @param {import('../types').userSettings} userSettings
|
|
30
30
|
* @returns {import('vite').Plugin[]}
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export function needleDependencies(command, config, userSettings) {
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* @type {import('vite').Plugin}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {"build" | "serve"} command
|
|
3
|
+
* @param {unknown} _config
|
|
4
|
+
* @param {import('../types').userSettings} userSettings
|
|
5
|
+
* @returns {import('vite').Plugin | null}
|
|
6
|
+
*/
|
|
1
7
|
export function needleDependencyWatcher(command: "build" | "serve", _config: unknown, userSettings: import("../types").userSettings): import("vite").Plugin | null;
|
|
2
8
|
export type PackageJson = {
|
|
3
9
|
dependencies?: Record<string, string>;
|
|
@@ -17,7 +17,7 @@ function log(...msg) {
|
|
|
17
17
|
* @param {import('../types').userSettings} userSettings
|
|
18
18
|
* @returns {import('vite').Plugin | null}
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export function needleDependencyWatcher(command, _config, userSettings) {
|
|
21
21
|
if (command === "build") return null;
|
|
22
22
|
|
|
23
23
|
if (userSettings?.noDependencyWatcher === true) return null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/plugins/vite/drop.d.ts
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/** Experimental, allow dropping files from Unity into the running scene.
|
|
2
|
+
* @param {"build" | "serve"} command
|
|
3
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
4
|
+
* @param {import('../types/userconfig.js').userSettings} userSettings
|
|
5
|
+
* @returns {import('vite').Plugin | null | undefined}
|
|
6
|
+
*/
|
|
1
7
|
export function needleDrop(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types/userconfig.js").userSettings): import("vite").Plugin | null | undefined;
|
package/plugins/vite/drop.js
CHANGED
|
@@ -12,7 +12,7 @@ const __dirname = path.dirname(__filename);
|
|
|
12
12
|
* @param {import('../types/userconfig.js').userSettings} userSettings
|
|
13
13
|
* @returns {import('vite').Plugin | null | undefined}
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export function needleDrop(command, config, userSettings) {
|
|
16
16
|
if (command === "build") return;
|
|
17
17
|
|
|
18
18
|
if(userSettings.useDrop !== true) return null;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {"build" | "serve"} command
|
|
3
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
4
|
+
* @param {import('../types').userSettings} userSettings
|
|
5
|
+
* @param {import('vite').Plugin[]} [pluginsArray]
|
|
6
|
+
* @returns {Promise<import('vite').Plugin | undefined>}
|
|
7
|
+
*/
|
|
1
8
|
export function editorConnection(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings, pluginsArray?: import("vite").Plugin[]): Promise<import("vite").Plugin | undefined>;
|
|
@@ -20,7 +20,7 @@ let editorSyncEnabled = false;
|
|
|
20
20
|
* @param {import('vite').Plugin[]} [pluginsArray]
|
|
21
21
|
* @returns {Promise<import('vite').Plugin | undefined>}
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export async function editorConnection(command, config, userSettings, pluginsArray) {
|
|
24
24
|
if (command === "build") return;
|
|
25
25
|
|
|
26
26
|
// Editor sync currently only supports Unity
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {"build" | "serve"} command
|
|
3
|
+
* @param {import('../types/needleConfig').needleMeta | null | undefined} config
|
|
4
|
+
* @param {import('../types').userSettings} userSettings
|
|
5
|
+
* @returns {import('vite').Plugin | undefined}
|
|
6
|
+
*/
|
|
1
7
|
export function needleFacebookInstantGames(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin | undefined;
|
|
@@ -36,7 +36,7 @@ function log(...any) {
|
|
|
36
36
|
* @param {import('../types').userSettings} userSettings
|
|
37
37
|
* @returns {import('vite').Plugin | undefined}
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export function needleFacebookInstantGames(command, config, userSettings) {
|
|
40
40
|
|
|
41
41
|
if (userSettings.noFacebookInstantGames === true) return;
|
|
42
42
|
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** @typedef {{ id: string, imports: GraphNode[], importedBy: GraphNode[] }} GraphNode */
|
|
2
|
+
/**
|
|
3
|
+
* @param {"build" | "serve"} _command
|
|
4
|
+
* @param {unknown} _config
|
|
5
|
+
* @param {import('../types').userSettings} userSettings
|
|
6
|
+
* @returns {import('vite').Plugin | null}
|
|
7
|
+
*/
|
|
1
8
|
export function needleImportsLogger(_command: "build" | "serve", _config: unknown, userSettings: import("../types").userSettings): import("vite").Plugin | null;
|
|
2
9
|
export type GraphNode = {
|
|
3
10
|
id: string;
|
|
@@ -10,7 +10,7 @@ import fs from 'fs';
|
|
|
10
10
|
* @param {import('../types').userSettings} userSettings
|
|
11
11
|
* @returns {import('vite').Plugin | null}
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export function needleImportsLogger(_command, _config, userSettings) {
|
|
14
14
|
|
|
15
15
|
if (!userSettings.debugImportChains) return null;
|
|
16
16
|
|