@needle-tools/engine 4.16.1-next.b4c9779 → 4.16.1-next.e45724f

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.
Files changed (73) hide show
  1. package/dist/{needle-engine.bundle-B5gYfP-3.umd.cjs → needle-engine.bundle-CWDn3Osx.umd.cjs} +3 -3
  2. package/dist/{needle-engine.bundle-Bpn20g7P.min.js → needle-engine.bundle-CupCi9ih.min.js} +1 -1
  3. package/dist/{needle-engine.bundle-BGxftKpt.js → needle-engine.bundle-Kai1_GLU.js} +2 -2
  4. package/dist/needle-engine.js +2 -2
  5. package/dist/needle-engine.min.js +1 -1
  6. package/dist/needle-engine.umd.cjs +1 -1
  7. package/package.json +1 -9
  8. package/plugins/next/next.d.ts +0 -7
  9. package/plugins/next/next.js +2 -2
  10. package/plugins/vite/ai.d.ts +0 -16
  11. package/plugins/vite/ai.js +2 -2
  12. package/plugins/vite/alias.d.ts +0 -6
  13. package/plugins/vite/alias.js +2 -2
  14. package/plugins/vite/asap.d.ts +0 -6
  15. package/plugins/vite/asap.js +1 -1
  16. package/plugins/vite/build-pipeline.d.ts +0 -6
  17. package/plugins/vite/build-pipeline.js +1 -1
  18. package/plugins/vite/build.d.ts +0 -6
  19. package/plugins/vite/build.js +1 -1
  20. package/plugins/vite/buildinfo.d.ts +0 -6
  21. package/plugins/vite/buildinfo.js +1 -1
  22. package/plugins/vite/copyfiles.d.ts +0 -6
  23. package/plugins/vite/copyfiles.js +1 -1
  24. package/plugins/vite/custom-element-data.d.ts +0 -11
  25. package/plugins/vite/custom-element-data.js +1 -1
  26. package/plugins/vite/defines.d.ts +0 -9
  27. package/plugins/vite/defines.js +1 -1
  28. package/plugins/vite/dependencies.d.ts +1 -7
  29. package/plugins/vite/dependencies.js +1 -1
  30. package/plugins/vite/dependency-watcher.d.ts +0 -6
  31. package/plugins/vite/dependency-watcher.js +1 -1
  32. package/plugins/vite/drop.d.ts +0 -6
  33. package/plugins/vite/drop.js +1 -1
  34. package/plugins/vite/editor-connection.d.ts +0 -7
  35. package/plugins/vite/editor-connection.js +1 -1
  36. package/plugins/vite/facebook-instant-games.d.ts +0 -6
  37. package/plugins/vite/facebook-instant-games.js +1 -1
  38. package/plugins/vite/imports-logger.d.ts +0 -7
  39. package/plugins/vite/imports-logger.js +1 -1
  40. package/plugins/vite/index.d.ts +27 -27
  41. package/plugins/vite/index.js +1 -1
  42. package/plugins/vite/license.d.ts +0 -6
  43. package/plugins/vite/license.js +2 -2
  44. package/plugins/vite/local-files-core.d.ts +1 -7
  45. package/plugins/vite/local-files-core.js +2 -2
  46. package/plugins/vite/logger.d.ts +0 -7
  47. package/plugins/vite/logger.js +1 -1
  48. package/plugins/vite/meta.d.ts +0 -6
  49. package/plugins/vite/meta.js +1 -1
  50. package/plugins/vite/needle-app.d.ts +0 -6
  51. package/plugins/vite/needle-app.js +1 -1
  52. package/plugins/vite/npm.d.ts +0 -3
  53. package/plugins/vite/npm.js +1 -1
  54. package/plugins/vite/peer.d.ts +0 -6
  55. package/plugins/vite/peer.js +1 -1
  56. package/plugins/vite/poster.d.ts +0 -6
  57. package/plugins/vite/poster.js +2 -2
  58. package/plugins/vite/pwa.d.ts +0 -6
  59. package/plugins/vite/pwa.js +1 -1
  60. package/plugins/vite/reload.d.ts +0 -6
  61. package/plugins/vite/reload.js +1 -1
  62. package/plugins/vite/server.d.ts +0 -6
  63. package/plugins/vite/server.js +2 -2
  64. package/plugins/vite/transform-codegen.d.ts +0 -7
  65. package/plugins/vite/transform-codegen.js +1 -1
  66. package/plugins/vite/transform.d.ts +0 -4
  67. package/plugins/vite/transform.js +1 -1
  68. package/plugins/vite/vite-4.4-hack.d.ts +0 -4
  69. package/plugins/vite/vite-4.4-hack.js +1 -1
  70. package/plugins/vite/drop-client.d.ts +0 -1
  71. package/plugins/vite/local-files-internals.d.ts +0 -3
  72. package/plugins/vite/poster-client.d.ts +0 -1
  73. package/plugins/vite/reload-client.d.ts +0 -1
@@ -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 function needleBuildInfo(command, config, userSettings) {
15
+ export const needleBuildInfo = (command, config, userSettings) => {
16
16
 
17
17
  if (userSettings?.noBuildInfo) return null;
18
18
 
@@ -1,7 +1 @@
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
- */
7
1
  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 function needleCopyFiles(command, config, userSettings) {
17
+ export const needleCopyFiles = (command, config, userSettings) => {
18
18
 
19
19
  if (config?.noCopy === true || userSettings?.noCopy === true) {
20
20
  return null;
@@ -1,14 +1,3 @@
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
- */
12
1
  export function needleCustomElementData(_command: "build" | "serve", _config: import("../types").needleMeta | null, userSettings?: import("../types").userSettings): import("vite").Plugin | null;
13
2
  export default needleCustomElementData;
14
3
  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 function needleCustomElementData(_command, _config, userSettings = {}) {
69
+ export const needleCustomElementData = (_command, _config, userSettings = {}) => {
70
70
  // Allow disabling the workspace updater
71
71
  if (userSettings?.noCustomElementData === true) return null;
72
72
 
@@ -1,10 +1 @@
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
- */
10
1
  export function needleDefines(command: "build" | "serve", needleEngineConfig: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin;
@@ -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 function needleDefines(command, needleEngineConfig, userSettings) {
20
+ export const needleDefines = (command, needleEngineConfig, userSettings) => {
21
21
 
22
22
  if (!userSettings) userSettings = {};
23
23
 
@@ -8,14 +8,8 @@
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[];
18
11
  /**
19
12
  * @type {string[]}
20
13
  */
21
14
  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 function needleDependencies(command, config, userSettings) {
32
+ export const needleDependencies = (command, config, userSettings) => {
33
33
 
34
34
  /**
35
35
  * @type {import('vite').Plugin}
@@ -1,9 +1,3 @@
1
- /**
2
- * @param {"build" | "serve"} command
3
- * @param {unknown} _config
4
- * @param {import('../types').userSettings} userSettings
5
- * @returns {import('vite').Plugin | null}
6
- */
7
1
  export function needleDependencyWatcher(command: "build" | "serve", _config: unknown, userSettings: import("../types").userSettings): import("vite").Plugin | null;
8
2
  export type PackageJson = {
9
3
  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 function needleDependencyWatcher(command, _config, userSettings) {
20
+ export const needleDependencyWatcher = (command, _config, userSettings) => {
21
21
  if (command === "build") return null;
22
22
 
23
23
  if (userSettings?.noDependencyWatcher === true) return null;
@@ -1,7 +1 @@
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
- */
7
1
  export function needleDrop(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types/userconfig.js").userSettings): import("vite").Plugin | null | undefined;
@@ -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 function needleDrop(command, config, userSettings) {
15
+ export const needleDrop = (command, config, userSettings) => {
16
16
  if (command === "build") return;
17
17
 
18
18
  if(userSettings.useDrop !== true) return null;
@@ -1,8 +1 @@
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
- */
8
1
  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 async function editorConnection(command, config, userSettings, pluginsArray) {
23
+ export const editorConnection = async (command, config, userSettings, pluginsArray) => {
24
24
  if (command === "build") return;
25
25
 
26
26
  // Editor sync currently only supports Unity
@@ -1,7 +1 @@
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
- */
7
1
  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 function needleFacebookInstantGames(command, config, userSettings) {
39
+ export const needleFacebookInstantGames = (command, config, userSettings) => {
40
40
 
41
41
  if (userSettings.noFacebookInstantGames === true) return;
42
42
 
@@ -1,10 +1,3 @@
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
- */
8
1
  export function needleImportsLogger(_command: "build" | "serve", _config: unknown, userSettings: import("../types").userSettings): import("vite").Plugin | null;
9
2
  export type GraphNode = {
10
3
  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 function needleImportsLogger(_command, _config, userSettings) {
13
+ export const needleImportsLogger = (_command, _config, userSettings) => {
14
14
 
15
15
  if (!userSettings.debugImportChains) return null;
16
16
 
@@ -1,30 +1,3 @@
1
- /** # Needle Engine plugins for Vite
2
- * Plugins include hot reload support, meta tags, defines, build pipeline, PWA, and more.
3
- * ## Using PWA
4
- * How to add PWA support to your vite project:
5
- * 1) Install the [vite pwa plugin](https://vite-pwa-org.netlify.app/): `npm install vite-plugin-pwa --save-dev`
6
- * 2) Add the following to your vite.config.js:
7
- * You first pass the PWAOptions to the needlePlugins function, then you pass the same PWAOptions to the VitePWA plugin.
8
- * You *can* use also add a `.webmanifest` file to your web project and edit the [PWA manifest](https://developer.mozilla.org/en-US/docs/Web/Manifest) settings there.
9
- * ```js
10
- * export default defineConfig(async ({ command }) => {
11
- * // @type {import("vite-plugin-pwa").VitePWAOptions}
12
- * const PWAOptions = {};
13
- * ...
14
- * return {
15
- * plugins: [
16
- * ...
17
- * needlePlugins(command, needleConfig, { pwaOptions: PWAOptions }),
18
- * VitePWA(PWAOptions),
19
- * ],
20
- * }
21
- * ```
22
- * @param {"build" | "serve"} command
23
- * @param {import('../types/needleConfig').needleMeta | null | undefined} config
24
- * @param {import('../types/index.js').userSettings} [userSettings]
25
- * @returns {Promise<import('vite').Plugin[]>}
26
- */
27
- export function needlePlugins(command: "build" | "serve", config?: import("../types/needleConfig").needleMeta | null | undefined, userSettings?: import("../types/index.js").userSettings): Promise<import("vite").Plugin[]>;
28
1
  export { needleAI } from "./ai.js";
29
2
  export { needleAsap } from "./asap.js";
30
3
  export { needleDefines } from "./defines.js";
@@ -51,4 +24,31 @@ export { needleApp } from "./needle-app.js";
51
24
  export { needleServer } from "./server.js";
52
25
  export * from "./gzip.js";
53
26
  export * from "./config.js";
27
+ /** # Needle Engine plugins for Vite
28
+ * Plugins include hot reload support, meta tags, defines, build pipeline, PWA, and more.
29
+ * ## Using PWA
30
+ * How to add PWA support to your vite project:
31
+ * 1) Install the [vite pwa plugin](https://vite-pwa-org.netlify.app/): `npm install vite-plugin-pwa --save-dev`
32
+ * 2) Add the following to your vite.config.js:
33
+ * You first pass the PWAOptions to the needlePlugins function, then you pass the same PWAOptions to the VitePWA plugin.
34
+ * You *can* use also add a `.webmanifest` file to your web project and edit the [PWA manifest](https://developer.mozilla.org/en-US/docs/Web/Manifest) settings there.
35
+ * ```js
36
+ * export default defineConfig(async ({ command }) => {
37
+ * // @type {import("vite-plugin-pwa").VitePWAOptions}
38
+ * const PWAOptions = {};
39
+ * ...
40
+ * return {
41
+ * plugins: [
42
+ * ...
43
+ * needlePlugins(command, needleConfig, { pwaOptions: PWAOptions }),
44
+ * VitePWA(PWAOptions),
45
+ * ],
46
+ * }
47
+ * ```
48
+ * @param {"build" | "serve"} command
49
+ * @param {import('../types/needleConfig').needleMeta | null | undefined} config
50
+ * @param {import('../types/index.js').userSettings} [userSettings]
51
+ * @returns {Promise<import('vite').Plugin[]>}
52
+ */
53
+ export const needlePlugins: any;
54
54
  export { needleMakeFilesLocal, needleLocalFilesSceneAnalysis } from "./local-files.js";
@@ -115,7 +115,7 @@ const defaultUserSettings = {
115
115
  * @param {import('../types/index.js').userSettings} [userSettings]
116
116
  * @returns {Promise<import('vite').Plugin[]>}
117
117
  */
118
- export async function needlePlugins(command, config = undefined, userSettings = {}) {
118
+ export const needlePlugins = async (command, config = undefined, userSettings = {}) => {
119
119
 
120
120
  if (!config) config = {}
121
121
 
@@ -1,7 +1 @@
1
- /** This plugin is used to apply the license to the needle engine.
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}
6
- */
7
1
  export function needleLicense(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types/userconfig.js").userSettings): import("vite").Plugin;
@@ -7,7 +7,7 @@ import { loadConfig } from './config.js';
7
7
  * @param {import('../types/userconfig.js').userSettings} userSettings
8
8
  * @returns {import('vite').Plugin}
9
9
  */
10
- export function needleLicense(command, config, userSettings) {
10
+ export const needleLicense = (command, config, userSettings) => {
11
11
  let license = undefined;
12
12
 
13
13
  return {
@@ -53,4 +53,4 @@ export function needleLicense(command, config, userSettings) {
53
53
  }
54
54
  }
55
55
  }
56
- }
56
+ };
@@ -1,10 +1,3 @@
1
- /**
2
- * @param {"build" | "serve"} command
3
- * @param {unknown} _config
4
- * @param {import('../types').userSettings} userSettings
5
- * @returns {import('vite').Plugin | null}
6
- */
7
- export function needleMakeFilesLocal(command: "build" | "serve", _config: unknown, userSettings: import("../types").userSettings): import("vite").Plugin | null;
8
1
  /**
9
2
  * @param {LocalizationOptions} options
10
3
  * @param {AutoPolicy | null} autoPolicy
@@ -43,6 +36,7 @@ export function getFeatureBasePath(basePath: string, feature: string): string;
43
36
  */
44
37
  export function handleWebXRProfiles(baseUrl: string, basePath: string, currentDir: string, context: LocalizationContext): Promise<string>;
45
38
  export { makeFilesLocalIsEnabled };
39
+ export function needleMakeFilesLocal(command: "build" | "serve", _config: unknown, userSettings: import("../types").userSettings): import("vite").Plugin | null;
46
40
  export type LocalizationContext = import("./local-files-types.js").LocalizationContext;
47
41
  export type LocalizationOptions = import("./local-files-types.js").LocalizationOptions;
48
42
  export type LocalizationStats = import("./local-files-types.js").LocalizationStats;
@@ -213,7 +213,7 @@ function recordLocalizedAsset(stats, url, sizeBytes, mimeType) {
213
213
  * @param {import('../types').userSettings} userSettings
214
214
  * @returns {import('vite').Plugin | null}
215
215
  */
216
- export function needleMakeFilesLocal(command, _config, userSettings) {
216
+ export const needleMakeFilesLocal = (command, _config, userSettings) => {
217
217
  if (!makeFilesLocalIsEnabled(userSettings)) {
218
218
  return null;
219
219
  }
@@ -373,7 +373,7 @@ export function needleMakeFilesLocal(command, _config, userSettings) {
373
373
  }
374
374
  });
375
375
  return plugin;
376
- }
376
+ };
377
377
 
378
378
  /**
379
379
  * @param {LocalizationOptions} options
@@ -1,8 +1 @@
1
- /**
2
- * write logs to local file
3
- * @param {string} command
4
- * @param {unknown} _config
5
- * @param {import('../types/userconfig.js').userSettings} userSettings
6
- * @returns {import('vite').Plugin | null}
7
- */
8
1
  export function needleLogger(command: string, _config: unknown, userSettings: import("../types/userconfig.js").userSettings): import("vite").Plugin | null;
@@ -15,7 +15,7 @@ const __dirname = path.dirname(__filename);
15
15
  * @param {import('../types/userconfig.js').userSettings} userSettings
16
16
  * @returns {import('vite').Plugin | null}
17
17
  */
18
- export function needleLogger(command, _config, userSettings) {
18
+ export const needleLogger = (command, _config, userSettings) => {
19
19
 
20
20
  if (userSettings?.disableLogging === true) {
21
21
  return null;
@@ -1,7 +1 @@
1
- /**
2
- * @param {"build" | "serve"} command
3
- * @param {import('../types/needleConfig').needleMeta | null} config
4
- * @param {import('../types').userSettings} userSettings
5
- * @returns {import('vite').Plugin}
6
- */
7
1
  export function needleMeta(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null, userSettings: import("../types").userSettings): import("vite").Plugin;
@@ -11,7 +11,7 @@ import { needleGreenBold, needleLog } from './logging.js';
11
11
  * @param {import('../types').userSettings} userSettings
12
12
  * @returns {import('vite').Plugin}
13
13
  */
14
- export function needleMeta(command, config, userSettings) {
14
+ export const needleMeta = (command, config, userSettings) => {
15
15
 
16
16
  // we can check if this is a build
17
17
  const isBuild = command === 'build';
@@ -1,7 +1 @@
1
- /**
2
- * @param {'serve' | 'build'} command
3
- * @param {{} | undefined | null} config
4
- * @param {import('../types').userSettings} userSettings
5
- * @returns {import('vite').Plugin[] | null}
6
- */
7
1
  export function needleApp(command: "serve" | "build", config: {} | undefined | null, userSettings: import("../types").userSettings): import("vite").Plugin[] | null;
@@ -10,7 +10,7 @@ import { needleLog } from './logging.js';
10
10
  * @param {import('../types').userSettings} userSettings
11
11
  * @returns {import('vite').Plugin[] | null}
12
12
  */
13
- export function needleApp(command, config, userSettings) {
13
+ export const needleApp = (command, config, userSettings) => {
14
14
 
15
15
  if (command !== "build") {
16
16
  return null;
@@ -1,4 +1 @@
1
- /**
2
- * @param {import('../types').userSettings} userSettings
3
- */
4
1
  export function needleNPM(command: any, config: any, userSettings: import("../types").userSettings): void;
@@ -3,6 +3,6 @@ import { ensureNpmDirectoryExists } from '../common/npm.js';
3
3
  /**
4
4
  * @param {import('../types').userSettings} userSettings
5
5
  */
6
- export function needleNPM(command, config, userSettings) {
6
+ export const needleNPM = (command, config, userSettings) => {
7
7
  ensureNpmDirectoryExists();
8
8
  }
@@ -1,7 +1 @@
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
- */
7
1
  export function needlePeerjs(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin | undefined;
@@ -7,7 +7,7 @@ import { needleLog } from './logging.js';
7
7
  * @param {import('../types').userSettings} userSettings
8
8
  * @returns {import("vite").Plugin | undefined}
9
9
  */
10
- export function needlePeerjs(command, config, userSettings) {
10
+ export const needlePeerjs = (command, config, userSettings) => {
11
11
 
12
12
  if (userSettings.noPeer === true) return;
13
13
 
@@ -1,8 +1,2 @@
1
1
  export function getPosterPath(): string;
2
- /**
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 | undefined}
7
- */
8
2
  export function needlePoster(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin | undefined;
@@ -15,7 +15,7 @@ export function getPosterPath() {
15
15
  * @param {import('../types').userSettings} userSettings
16
16
  * @returns {import('vite').Plugin | undefined}
17
17
  */
18
- export function needlePoster(command, config, userSettings) {
18
+ export const needlePoster = (command, config, userSettings) => {
19
19
  // only relevant for local development
20
20
  if (command === 'build') return [];
21
21
 
@@ -79,4 +79,4 @@ export function needlePoster(command, config, userSettings) {
79
79
  },
80
80
  },
81
81
  }
82
- }
82
+ };
@@ -1,7 +1 @@
1
- /** Provides reasonable defaults for a PWA manifest and workbox settings.
2
- * @param {"build" | "serve"} command
3
- * @param {import("../types/needleConfig").needleMeta | null} config
4
- * @param {import('../types').userSettings} userSettings
5
- * @returns {import('vite').Plugin | undefined}
6
- */
7
1
  export function needlePWA(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null, userSettings: import("../types").userSettings): import("vite").Plugin | undefined;
@@ -13,7 +13,7 @@ const pwaErrorWithInstructions = "It seems that you're trying to build a PWA usi
13
13
  * @param {import('../types').userSettings} userSettings
14
14
  * @returns {import('vite').Plugin | undefined}
15
15
  */
16
- export function needlePWA(command, config, userSettings) {
16
+ export const needlePWA = (command, config, userSettings) => {
17
17
  // @ts-ignore // TODO correctly type the userSettings.pwaOptions object
18
18
  /** @type {import("vite-plugin-pwa").VitePWAOptions | false} */
19
19
  const pwaOptions = userSettings.pwa === true
@@ -1,7 +1 @@
1
- /**
2
- * @param {"build" | "serve"} command
3
- * @param {import('../types/needleConfig').needleMeta | null} config
4
- * @param {import('../types').userSettings} userSettings
5
- * @returns {import('vite').Plugin | undefined}
6
- */
7
1
  export function needleReload(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null, userSettings: import("../types").userSettings): import("vite").Plugin | undefined;
@@ -20,7 +20,7 @@ let assetsDirectory = "";
20
20
  * @param {import('../types').userSettings} userSettings
21
21
  * @returns {import('vite').Plugin | undefined}
22
22
  */
23
- export function needleReload(command, config, userSettings) {
23
+ export const needleReload = (command, config, userSettings) => {
24
24
  if (command === "build") return undefined;
25
25
 
26
26
  if (userSettings?.noReload === true) return undefined;
@@ -1,7 +1 @@
1
- /** Can open the network server in the browser.
2
- * @param {"build" | "serve"} command
3
- * @param {import('../types').needleMeta | null} config
4
- * @param {import('../types').userSettings} userSettings
5
- * @returns {import('vite').Plugin}
6
- */
7
1
  export function needleServer(command: "build" | "serve", config: import("../types").needleMeta | null, userSettings: import("../types").userSettings): import("vite").Plugin;
@@ -4,7 +4,7 @@
4
4
  * @param {import('../types').userSettings} userSettings
5
5
  * @returns {import('vite').Plugin}
6
6
  */
7
- export function needleServer(command, config, userSettings) {
7
+ export const needleServer = (command, config, userSettings) => {
8
8
 
9
9
  const shouldOpenBrowser = userSettings.openBrowser === true;
10
10
 
@@ -64,4 +64,4 @@ export function needleServer(command, config, userSettings) {
64
64
  }
65
65
  },
66
66
  }
67
- }
67
+ };
@@ -1,8 +1 @@
1
- /** Modify the glb load path in codegen files.
2
- * This is necessary if the assets directory is not the default (changed by the user in needle.config.json).
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 | undefined}
7
- */
8
1
  export function needleTransformCodegen(command: "build" | "serve", config: import("../types/needleConfig").needleMeta | null | undefined, userSettings: import("../types").userSettings): import("vite").Plugin | undefined;
@@ -7,7 +7,7 @@ import { builtAssetsDirectory, tryLoadProjectConfig } from './config.js';
7
7
  * @param {import('../types').userSettings} userSettings
8
8
  * @returns {import('vite').Plugin | undefined}
9
9
  */
10
- export function needleTransformCodegen(command, config, userSettings) {
10
+ export const needleTransformCodegen = (command, config, userSettings) => {
11
11
 
12
12
  if (config?.noCodegenTransform === true || userSettings?.noCodegenTransform === true) {
13
13
  return;
@@ -1,5 +1 @@
1
- /**
2
- * @param {import('../types').userSettings} userSettings
3
- * @returns {import('vite').Plugin[]}
4
- */
5
1
  export function needleTransformCode(command: any, config: any, userSettings: import("../types").userSettings): import("vite").Plugin[];
@@ -5,7 +5,7 @@
5
5
  * @param {import('../types').userSettings} userSettings
6
6
  * @returns {import('vite').Plugin[]}
7
7
  */
8
- export function needleTransformCode(command, config, userSettings) {
8
+ export const needleTransformCode = (command, config, userSettings) => {
9
9
 
10
10
  return [
11
11
  {
@@ -1,7 +1,3 @@
1
- /**
2
- * Make sure we dont have vite 4.4.x installed when needle engine is used locally
3
- * @param {import('../types').userSettings} userSettings
4
- */
5
1
  export function vite_4_4_hack(command: any, config: any, userSettings: import("../types").userSettings): {
6
2
  name: string;
7
3
  configureServer(server: any): Promise<void>;
@@ -6,7 +6,7 @@ import { execSync } from 'child_process';
6
6
  * Make sure we dont have vite 4.4.x installed when needle engine is used locally
7
7
  * @param {import('../types').userSettings} userSettings
8
8
  */
9
- export function vite_4_4_hack(command, config, userSettings) {
9
+ export const vite_4_4_hack = (command, config, userSettings) => {
10
10
  if (userSettings.vite44Hack === false) return;
11
11
  return {
12
12
  name: "needle-vite-4.4-hack",
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export { getActiveHandlers, getFeatureBasePath, handleWebXRProfiles, makeLocal, makeLocalHtml } from "./local-files-core.js";
2
- export { analyzeProjectGlbs, buildAutoPolicy, collectAssetGlbs, collectIndexHtmlSkyboxUrls, collectNeedleComponentExtensionBlobs, detectAutoPolicy, getWebXRProfilesForMode, hasAutoFeatureSelection, readGlbJsonChunk, resolveSkyboxSelectionUrls, resolveSkyboxValueToUrl, shouldHandleUrlInAutoMode } from "./local-files-analysis.js";
3
- export { fixDracoRangeQueryProbe, fixRelativeNewURL, getRelativeToBasePath } from "./local-files-utils.js";
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};