Skip to content

Commit

Permalink
bundle in one file
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmachuca committed Nov 6, 2024
1 parent 3224e29 commit 1117f7f
Show file tree
Hide file tree
Showing 15 changed files with 1,853 additions and 1,883 deletions.
11 changes: 6 additions & 5 deletions build-esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const alias = require("esbuild-plugin-alias");
const path = require("path");

const baseSettings = {
entryPoints: ["src/*.ts", "src/*.mts", "src/*.cts"], // Your entry file
entryPoints: ["src/QCObjects.ts"], // Your entry file
bundle: true,
outdir: "public/cjs", // Output dir
format: "cjs", // or "esm" depending on your module system
Expand All @@ -24,7 +24,7 @@ const baseSettings = {
};

const cjsSettings = {...baseSettings,
entryPoints: ["src/*.cts"], // Your entry file
entryPoints: ["src/QCObjects.ts"], // Your entry file
outdir: "public/cjs", // Output dir
format: "cjs", // or "esm" depending on your module system
platform: "node", // or "browser" depending on your target environment
Expand All @@ -35,18 +35,19 @@ const cjsSettings = {...baseSettings,
};

const esmSettings = {...baseSettings,
entryPoints: ["src/*.mts"], // Your entry file
entryPoints: ["src/QCObjects.ts"], // Your entry file
outdir: "public/esm", // Output dir
format: "esm", // or "esm" depending on your module system
platform: "neutral", // or "browser" depending on your target environment
platform: "browser", // or "browser" depending on your target environment
outExtension: {
".js":".mjs"
}

};

const browserSettings = {...baseSettings,
entryPoints: ["src/*.mts"], // Your entry file
entryPoints: ["src/QCObjects.ts"], // Your entry file
bundle: true,
outdir: "public/browser", // Output dir
format: "iife", // or "esm" depending on your module system
platform: "browser", // or "browser" depending on your target environment
Expand Down
2 changes: 1 addition & 1 deletion build/Class.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const Class = (name, _type, _definition) => {
}
hierarchy() {
const __instance__ = this;
return this.getClass().hierarchy(__instance__);
return this.getClass()?.hierarchy(__instance__);
}
append(_child) {
const child = _child || this.body;
Expand Down
2 changes: 1 addition & 1 deletion build/InheritClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class InheritClass {
}
hierarchy() {
const __instance__ = this;
return this.getClass().hierarchy(__instance__);
return this.constructor.hierarchy(__instance__);
}
append(_child) {
const child = _child || this.body;
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"name": "qcobjects",
"version": "2.5.102-beta",
"description": "QCObjects is an Open-source framework that empowers full-stack developers to make micro-services and micro-frontends into an N-Tier architecture.",
"main": "public/cjs/index.cjs",
"module": "public/esm/index.mjs",
"browser": "public/browser/index.js",
"main": "public/cjs/QCObjects.cjs",
"module": "public/esm/QCObjects.mjs",
"browser": "public/browser/QCObjects.js",
"type": "commonjs",
"types": "build/index.d.ts",
"exports": {
".": {
"require": "./public/cjs/index.cjs",
"import": "./public/esm/index.mjs"
"require": "./public/cjs/QCObjects.cjs",
"import": "./public/esm/QCObjects.mjs"
},
"./types/*": "./types/*",
"./package.json": "./package.json"
Expand Down
17 changes: 4 additions & 13 deletions public/browser/index.js → public/browser/QCObjects.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions public/browser/QCObjects.js.map

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions public/browser/index.js.map

This file was deleted.

117 changes: 99 additions & 18 deletions public/esm/index.mjs → public/cjs/QCObjects.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __esm = (fn, res) => function __init() {
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
var __commonJS = (cb, mod) => function __require2() {
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
Expand All @@ -37,6 +32,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/assign.ts
var require_assign = __commonJS({
Expand Down Expand Up @@ -97,7 +93,7 @@ var init_platform = __esm({
return isDeno ? deno_require(name) : ((name2) => {
let r;
try {
r = __require(name2);
r = require(name2);
} catch (e) {
logger.debug(`An error ocurred importing module. ${e}`);
r = { export: {} };
Expand Down Expand Up @@ -633,7 +629,7 @@ var init_InheritClass = __esm({
}
hierarchy() {
const __instance__ = this;
return this.getClass().hierarchy(__instance__);
return this.constructor.hierarchy(__instance__);
}
append(_child) {
const child = _child || this.body;
Expand Down Expand Up @@ -951,7 +947,7 @@ var init_Class = __esm({
}
hierarchy() {
const __instance__ = this;
return this.getClass().hierarchy(__instance__);
return this.getClass()?.hierarchy(__instance__);
}
append(_child) {
const child = _child || this.body;
Expand Down Expand Up @@ -4446,7 +4442,7 @@ function loadSDK() {
}
if (tryImportingSDK) {
logger.info("Importing SDK... " + sdkName);
if (isNodeCommonJS && typeof __require !== "undefined") {
if (isNodeCommonJS && typeof require !== "undefined") {
const sdk = _require_("qcobjects-sdk");
if (sdk) {
logger.debug("QCObjects SDK was loaded OK.");
Expand Down Expand Up @@ -5056,6 +5052,7 @@ __export(QCObjects_exports, {
subelements: () => subelements,
waitUntil: () => waitUntil
});
module.exports = __toCommonJS(QCObjects_exports);
var AssignPolyfill = __toESM(require_assign());
init_top();
init_PrimaryCollections();
Expand Down Expand Up @@ -6485,10 +6482,94 @@ init_mathFunctions();
init_top();
init_make_global();
var QCObjects = __toESM(require_MainProcess());

// src/index.mts
var src_default = QCObjects_exports;
export {
src_default as default
};
//# sourceMappingURL=index.mjs.map
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ArrayCollection,
ArrayList,
AssignPolyfill,
BackendMicroservice,
CONFIG,
Class,
ClassFactory,
ComplexStorageCache,
Component,
ComponentURI,
ConfigService,
Controller,
DDO,
DefaultTemplateHandler,
Effect,
Export,
GlobalSettings,
Import,
InheritClass,
JSONService,
Logger,
NamespaceRef,
New,
ObjectName,
Package,
Processor,
QCObjects,
Ready,
RegisterClass,
RegisterWidget,
RegisterWidgets,
Service,
SourceCSS,
SourceJS,
Tag,
TagElements,
Timer,
Toggle,
TransitionEffect,
VO,
View,
_Cast,
_CastProps,
_ComponentWidget_,
_Crypt,
_DOMCreateElement,
_DataStringify,
_LegacyCopy,
_QC_CLASSES,
_QC_PACKAGES,
_QC_PACKAGES_IMPORTED,
_QC_READY_LISTENERS,
_Ready,
__getType__,
__instanceID,
__is_raw_class__,
__make_global__,
__to_number,
_buildComponentsFromElements_,
_fireAsyncLoad,
_methods_,
_protected_code_,
_require_,
_super_,
_tag_filter_,
_top,
asyncLoad,
captureFalseTouch,
componentLoader,
findPackageNodePath,
getDocumentLayout,
global,
isBrowser,
isNodeCommonJS,
isQCObjects_Class,
isQCObjects_Object,
is_a,
is_phonegap,
logger,
range,
ready,
resetTop,
serviceLoader,
setDefaultProcessors,
shortCode,
subelements,
waitUntil
});
//# sourceMappingURL=QCObjects.cjs.map
7 changes: 7 additions & 0 deletions public/cjs/QCObjects.cjs.map

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions public/cjs/index.cjs.map

This file was deleted.

Loading

0 comments on commit 1117f7f

Please sign in to comment.