@iebh/tera-fy 2.3.10 → 2.3.12
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 +32 -0
- package/api.md +8 -11
- package/dist/plugin.vue2.es2019.js +28 -27
- package/dist/terafy.bootstrapper.es2019.js +2 -2
- package/dist/terafy.bootstrapper.js +2 -2
- package/dist/terafy.es2019.js +5 -5
- package/dist/terafy.js +5 -5
- package/eslint.config.js +4 -66
- package/lib/{projectFile.ts → projectFile.js} +52 -76
- package/lib/syncro/{entities.ts → entities.js} +14 -83
- package/lib/syncro/{keyed.ts → keyed.js} +46 -68
- package/lib/syncro/{syncro.ts → syncro.js} +104 -136
- package/lib/{terafy.bootstrapper.ts → terafy.bootstrapper.js} +20 -30
- package/lib/{terafy.client.ts → terafy.client.js} +85 -84
- package/lib/{terafy.proxy.ts → terafy.proxy.js} +12 -26
- package/lib/{terafy.server.ts → terafy.server.js} +204 -229
- package/package.json +20 -39
- package/plugins/{base.ts → base.js} +3 -5
- package/plugins/{firebase.ts → firebase.js} +22 -21
- package/plugins/{vite.ts → vite.js} +3 -3
- package/plugins/{vue2.ts → vue2.js} +8 -10
- package/plugins/{vue3.ts → vue3.js} +7 -10
- package/utils/mixin.js +15 -0
- package/utils/{pathTools.ts → pathTools.js} +8 -9
- package/widgets/tera-file-select.vue +1 -1
- package/dist/lib/projectFile.d.ts +0 -190
- package/dist/lib/projectFile.js +0 -305
- package/dist/lib/projectFile.js.map +0 -1
- package/dist/lib/syncro/entities.d.ts +0 -34
- package/dist/lib/syncro/entities.js +0 -212
- package/dist/lib/syncro/entities.js.map +0 -1
- package/dist/lib/syncro/keyed (Rhino's conflicted copy 2026-05-10).js +0 -287
- package/dist/lib/syncro/keyed.d.ts +0 -95
- package/dist/lib/syncro/keyed.js +0 -288
- package/dist/lib/syncro/keyed.js (Rhino's conflicted copy 2026-05-10).map +0 -1
- package/dist/lib/syncro/keyed.js.map +0 -1
- package/dist/lib/syncro/syncro (Rhino's conflicted copy 2026-05-10).js +0 -765
- package/dist/lib/syncro/syncro.d (Rhino's conflicted copy 2026-05-10).ts +0 -336
- package/dist/lib/syncro/syncro.d.ts +0 -343
- package/dist/lib/syncro/syncro.js +0 -771
- package/dist/lib/syncro/syncro.js (Rhino's conflicted copy 2026-05-10).map +0 -1
- package/dist/lib/syncro/syncro.js.map +0 -1
- package/dist/lib/terafy.bootstrapper.d.ts +0 -42
- package/dist/lib/terafy.bootstrapper.js +0 -129
- package/dist/lib/terafy.bootstrapper.js.map +0 -1
- package/dist/lib/terafy.client.d.ts +0 -555
- package/dist/lib/terafy.client.js +0 -1153
- package/dist/lib/terafy.client.js.map +0 -1
- package/dist/lib/terafy.proxy.d.ts +0 -66
- package/dist/lib/terafy.proxy.js +0 -130
- package/dist/lib/terafy.proxy.js.map +0 -1
- package/dist/lib/terafy.server.d.ts +0 -697
- package/dist/lib/terafy.server.js +0 -2062
- package/dist/lib/terafy.server.js.map +0 -1
- package/dist/plugin.vue2.es2019 (Rhino's conflicted copy 2026-05-10).js +0 -1271
- package/dist/plugins/base.d.ts +0 -20
- package/dist/plugins/base.js +0 -22
- package/dist/plugins/base.js.map +0 -1
- package/dist/plugins/firebase.d.ts +0 -62
- package/dist/plugins/firebase.js +0 -123
- package/dist/plugins/firebase.js.map +0 -1
- package/dist/plugins/vite.d.ts +0 -12
- package/dist/plugins/vite.js +0 -22
- package/dist/plugins/vite.js.map +0 -1
- package/dist/plugins/vue2.d.ts +0 -67
- package/dist/plugins/vue2.js +0 -104
- package/dist/plugins/vue2.js.map +0 -1
- package/dist/plugins/vue3.d.ts +0 -63
- package/dist/plugins/vue3.js +0 -93
- package/dist/plugins/vue3.js.map +0 -1
- package/dist/utils/mixin.d.ts +0 -11
- package/dist/utils/mixin.js +0 -15
- package/dist/utils/mixin.js.map +0 -1
- package/dist/utils/pDefer.d.ts +0 -16
- package/dist/utils/pDefer.js +0 -19
- package/dist/utils/pDefer.js.map +0 -1
- package/dist/utils/pathTools.d.ts +0 -70
- package/dist/utils/pathTools.js +0 -120
- package/dist/utils/pathTools.js.map +0 -1
- package/tsconfig.json +0 -30
- package/utils/mixin.ts +0 -18
- package/utils/pDefer.ts +0 -27
|
@@ -2,20 +2,6 @@ import {create as createDomain} from 'node:domain';
|
|
|
2
2
|
import detectPort from 'detect-port';
|
|
3
3
|
import Proxy from 'http-proxy';
|
|
4
4
|
|
|
5
|
-
// Define options interface based on JSDoc and settings
|
|
6
|
-
interface TeraProxyOptions {
|
|
7
|
-
force?: boolean;
|
|
8
|
-
autoStart?: boolean;
|
|
9
|
-
host?: string;
|
|
10
|
-
port?: number;
|
|
11
|
-
targetProtocol?: string;
|
|
12
|
-
targetHost?: string;
|
|
13
|
-
targetPort?: number;
|
|
14
|
-
portConflict?: 'ignore' | 'throw';
|
|
15
|
-
// eslint-disable-next-line no-unused-vars
|
|
16
|
-
onLog?: (level: 'INFO' | 'WARN', ...msg: any[]) => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
5
|
export class TeraProxy {
|
|
20
6
|
/**
|
|
21
7
|
* Setup a local loopback proxy for TERA-tools.com
|
|
@@ -41,8 +27,8 @@ export class TeraProxy {
|
|
|
41
27
|
targetProtocol: 'https',
|
|
42
28
|
targetHost: 'dev.tera-tools.com',
|
|
43
29
|
targetPort: 443,
|
|
44
|
-
portConflict: 'ignore'
|
|
45
|
-
onLog: (level
|
|
30
|
+
portConflict: 'ignore',
|
|
31
|
+
onLog: (level, ...msg) => console.log(...msg),
|
|
46
32
|
}
|
|
47
33
|
|
|
48
34
|
|
|
@@ -50,7 +36,7 @@ export class TeraProxy {
|
|
|
50
36
|
* Eventual proxy server when the plugin has booted
|
|
51
37
|
* @type {ProxyServer}
|
|
52
38
|
*/
|
|
53
|
-
proxyServer
|
|
39
|
+
proxyServer;
|
|
54
40
|
|
|
55
41
|
|
|
56
42
|
/**
|
|
@@ -77,10 +63,10 @@ export class TeraProxy {
|
|
|
77
63
|
port: this.settings.targetPort,
|
|
78
64
|
},
|
|
79
65
|
}))
|
|
80
|
-
.then(()=> new Promise
|
|
66
|
+
.then(()=> new Promise((resolve, reject) => {
|
|
81
67
|
// Wrap listener in a domain so we can correctly catch EADDRINUSE
|
|
82
68
|
const domain = createDomain();
|
|
83
|
-
domain.on('error',
|
|
69
|
+
domain.on('error', err => {
|
|
84
70
|
if (err.code == 'EADDRINUSE') {
|
|
85
71
|
reject('PORT-CONFLICT');
|
|
86
72
|
} else {
|
|
@@ -89,10 +75,10 @@ export class TeraProxy {
|
|
|
89
75
|
});
|
|
90
76
|
// Run the server creation and listening within the domain
|
|
91
77
|
domain.run(() => {
|
|
92
|
-
if (!this.proxyServer) return reject(new Error('Proxy server not initialized'));
|
|
78
|
+
if (!this.proxyServer) return reject(new Error('Proxy server not initialized'));
|
|
93
79
|
this.proxyServer.listen(this.settings.port, this.settings.host)
|
|
94
80
|
// Handle errors on the proxy server itself, although domain should catch listen errors
|
|
95
|
-
this.proxyServer.on('error',
|
|
81
|
+
this.proxyServer.on('error', err => {
|
|
96
82
|
if (err.code == 'EADDRINUSE') {
|
|
97
83
|
reject('PORT-CONFLICT');
|
|
98
84
|
} else {
|
|
@@ -122,15 +108,15 @@ export class TeraProxy {
|
|
|
122
108
|
*/
|
|
123
109
|
stop() {
|
|
124
110
|
return Promise.resolve()
|
|
125
|
-
.then(()=> this.proxyServer && new Promise
|
|
111
|
+
.then(()=> this.proxyServer && new Promise(resolve => this.proxyServer.close(()=> resolve())))
|
|
126
112
|
}
|
|
127
113
|
|
|
128
114
|
|
|
129
|
-
constructor(options
|
|
115
|
+
constructor(options) {
|
|
130
116
|
if (options) Object.assign(this.settings, options);
|
|
131
117
|
|
|
132
118
|
// Auto start?
|
|
133
|
-
if (this.settings.autoStart) this.start().catch(err => {
|
|
119
|
+
if (this.settings.autoStart) this.start().catch(err => {
|
|
134
120
|
this.settings.onLog('WARN', 'Proxy auto-start failed:', err);
|
|
135
121
|
});
|
|
136
122
|
}
|
|
@@ -143,6 +129,6 @@ export class TeraProxy {
|
|
|
143
129
|
* @param {Object} [options] Options to pass to the Proxy module
|
|
144
130
|
* @returns {TeraProxy} A TeraProxy instance
|
|
145
131
|
*/
|
|
146
|
-
export default function(options
|
|
132
|
+
export default function(options) {
|
|
147
133
|
return new TeraProxy(options);
|
|
148
|
-
}
|
|
134
|
+
}
|