qcobjects 2.5.108-beta → 2.5.109-beta
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/VERSION +1 -1
- package/build/_import_.js +26 -0
- package/build/findPackageNodePath.js +5 -2
- package/build/index.cjs +25 -2
- package/build/platform.js +8 -2
- package/build-esbuild.js +8 -1
- package/package.json +2 -1
- package/postbuild.js +10 -0
- package/public/browser/QCObjects.js +39 -6
- package/public/browser/QCObjects.js.map +4 -4
- package/public/cjs/QCObjects.cjs +39 -6
- package/public/cjs/QCObjects.cjs.map +4 -4
- package/public/esm/QCObjects.mjs +37 -4
- package/public/esm/QCObjects.mjs.map +4 -4
- package/public/types/index.d.ts +6 -0
- package/src/_import_.ts +27 -0
- package/src/findPackageNodePath.ts +2 -2
- package/src/platform.ts +9 -2
- package/src/index.cts +0 -2
- package/src/index.mts +0 -2
package/public/cjs/QCObjects.cjs
CHANGED
|
@@ -78,11 +78,40 @@ var init_PrimaryCollections = __esm({
|
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
+
// src/_import_.ts
|
|
82
|
+
async function _import_(name) {
|
|
83
|
+
logger.debug(`Importing ${name}...`);
|
|
84
|
+
function isPackage(name2) {
|
|
85
|
+
logger.debug(`Validating if ${name2} is a package name...`);
|
|
86
|
+
return !name2.startsWith(".") && !name2.startsWith("/") && !name2.includes("/");
|
|
87
|
+
}
|
|
88
|
+
__name(isPackage, "isPackage");
|
|
89
|
+
try {
|
|
90
|
+
const hasExtension = /\.[^/\\]+$/.test(name);
|
|
91
|
+
if (!hasExtension && !isPackage(name)) {
|
|
92
|
+
logger.debug(`${name} does not have an extension and is not a package. Adding js extension.`);
|
|
93
|
+
name += ".js";
|
|
94
|
+
}
|
|
95
|
+
const m = await import(name);
|
|
96
|
+
return m;
|
|
97
|
+
} catch (error) {
|
|
98
|
+
logger.warn(`Failed to load module: ${error}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
var init_import = __esm({
|
|
102
|
+
"src/_import_.ts"() {
|
|
103
|
+
"use strict";
|
|
104
|
+
init_Logger();
|
|
105
|
+
__name(_import_, "_import_");
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
81
109
|
// src/platform.ts
|
|
82
110
|
var isDeno, isBrowser, isNodeCommonJS, deno_require, _require_, is_phonegap;
|
|
83
111
|
var init_platform = __esm({
|
|
84
112
|
"src/platform.ts"() {
|
|
85
113
|
"use strict";
|
|
114
|
+
init_import();
|
|
86
115
|
init_Logger();
|
|
87
116
|
isDeno = typeof window !== "undefined" && "Deno" in window;
|
|
88
117
|
isBrowser = typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self && !isDeno;
|
|
@@ -93,7 +122,11 @@ var init_platform = __esm({
|
|
|
93
122
|
return isDeno ? deno_require(name) : ((name2) => {
|
|
94
123
|
let r;
|
|
95
124
|
try {
|
|
96
|
-
|
|
125
|
+
_import_(name2).then((m) => {
|
|
126
|
+
r = m && m.default || m;
|
|
127
|
+
}).catch((e) => {
|
|
128
|
+
logger.warn(`An error ocurred: ${e}`);
|
|
129
|
+
});
|
|
97
130
|
} catch (e) {
|
|
98
131
|
logger.debug(`An error ocurred importing module. ${e}`);
|
|
99
132
|
r = { export: {} };
|
|
@@ -2213,9 +2246,9 @@ var init_componentLoader = __esm({
|
|
|
2213
2246
|
} else {
|
|
2214
2247
|
logger.debug("Loading the component as a local file in server...");
|
|
2215
2248
|
const _directLoad = /* @__PURE__ */ __name(function() {
|
|
2216
|
-
const
|
|
2249
|
+
const fs2 = _require_("fs");
|
|
2217
2250
|
logger.debug("SENDING THE NORMAL REQUEST ");
|
|
2218
|
-
|
|
2251
|
+
fs2.readFile(component2.url, _componentLoaded);
|
|
2219
2252
|
}, "_directLoad");
|
|
2220
2253
|
if (component2.cached) {
|
|
2221
2254
|
logger.debug("USING CACHE FOR COMPONENT: " + component2.name);
|
|
@@ -4264,7 +4297,7 @@ var init_Tag = __esm({
|
|
|
4264
4297
|
});
|
|
4265
4298
|
|
|
4266
4299
|
// src/findPackageNodePath.ts
|
|
4267
|
-
var findPackageNodePath;
|
|
4300
|
+
var import_node_fs, findPackageNodePath;
|
|
4268
4301
|
var init_findPackageNodePath = __esm({
|
|
4269
4302
|
"src/findPackageNodePath.ts"() {
|
|
4270
4303
|
"use strict";
|
|
@@ -4272,10 +4305,10 @@ var init_findPackageNodePath = __esm({
|
|
|
4272
4305
|
init_Export();
|
|
4273
4306
|
init_Logger();
|
|
4274
4307
|
init_platform();
|
|
4308
|
+
import_node_fs = __toESM(require("node:fs"));
|
|
4275
4309
|
findPackageNodePath = /* @__PURE__ */ __name(function(packagename) {
|
|
4276
4310
|
let sdkPath = null;
|
|
4277
4311
|
if (!isBrowser) {
|
|
4278
|
-
const fs = _require_("fs");
|
|
4279
4312
|
try {
|
|
4280
4313
|
let sdkPaths = [
|
|
4281
4314
|
`${CONFIG.get("projectPath")}${CONFIG.get("relativeImportPath")}`,
|
|
@@ -4292,7 +4325,7 @@ var init_findPackageNodePath = __esm({
|
|
|
4292
4325
|
""
|
|
4293
4326
|
].concat(module.paths);
|
|
4294
4327
|
sdkPaths = sdkPaths.filter((p) => {
|
|
4295
|
-
return
|
|
4328
|
+
return import_node_fs.default.existsSync(p + "/" + packagename);
|
|
4296
4329
|
});
|
|
4297
4330
|
if (sdkPaths.length > 0) {
|
|
4298
4331
|
sdkPath = sdkPaths[0];
|