qcobjects 2.5.141-beta → 2.5.142

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.
@@ -0,0 +1,47 @@
1
+ name: Node.js Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v6
13
+ with:
14
+ token: ${{ secrets.GITHUB_TOKEN }}
15
+ ref: ${{ github.ref }}
16
+ - uses: actions/setup-node@v6
17
+ with:
18
+ node-version: 22
19
+ - run: npm i --legacy-peer-deps
20
+ - run: npm test
21
+
22
+ publish-npm:
23
+ needs: build
24
+ runs-on: ubuntu-latest
25
+ permissions:
26
+ contents: read
27
+ id-token: write
28
+ steps:
29
+ - uses: actions/checkout@v6
30
+ with:
31
+ token: ${{ secrets.GITHUB_TOKEN }}
32
+ ref: ${{ github.ref }}
33
+ - uses: actions/setup-node@v6
34
+ with:
35
+ node-version: 22
36
+ - name: Upgrade npm for OIDC support (requires >=11.5.1)
37
+ run: npm install -g npm@latest
38
+ - run: npm i --legacy-peer-deps
39
+ - name: Publish to npm
40
+ run: |
41
+ if [[ "${{ github.ref }}" == *-beta ]]; then
42
+ npm publish --tag beta
43
+ elif [[ "${{ github.ref }}" == *-lts ]]; then
44
+ npm publish --tag lts
45
+ else
46
+ npm publish
47
+ fi
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.141-beta
1
+ 2.5.142
package/build/CONFIG.js CHANGED
@@ -65,7 +65,12 @@ class CONFIG extends InheritClass_1.InheritClass {
65
65
  Logger_1.logger.debug("No config value for: " + name);
66
66
  _value = _default;
67
67
  }
68
- return Processor_1.GlobalProcessor.processObject(_value) || _default;
68
+ const processedValue = Processor_1.GlobalProcessor.processObject(_value);
69
+ // Special handling for null values
70
+ if (_value === null && processedValue === null) {
71
+ return null;
72
+ }
73
+ return processedValue || _default;
69
74
  }
70
75
  static _instance;
71
76
  static get instance() {
@@ -31,16 +31,30 @@ class Processor extends InheritClass_1.InheritClass {
31
31
  }
32
32
  return Processor._instance;
33
33
  }
34
+ static setProcessor(_proc_) {
35
+ if (typeof _proc_ === "function" && _proc_.name !== "") {
36
+ Processor.instance.processors[_proc_.name] = _proc_;
37
+ }
38
+ }
34
39
  setProcessor(_proc_) {
35
40
  if (typeof _proc_ === "function" && _proc_.name !== "") {
36
41
  this.processors[_proc_.name] = _proc_;
37
42
  }
38
43
  }
44
+ static getProcessor(_procName_) {
45
+ return Processor.instance.processors[_procName_];
46
+ }
47
+ static getProcessorNames() {
48
+ return Object.keys(Processor.instance.processors);
49
+ }
39
50
  component;
40
51
  execute(component, processorName, args) {
41
52
  const processorHandler = (typeof component !== "undefined" && component !== null) ? (component.processorHandler) : (this);
42
53
  return processorHandler?.processors[processorName].bind(processorHandler).apply(processorHandler, [component, args?.split(",")]);
43
54
  }
55
+ static process(template, component = null) {
56
+ return Processor.instance.process(template, component);
57
+ }
44
58
  process(template, component = null) {
45
59
  const processorHandler = (component !== null) ? (component.processorHandler) : ((0, New_1.New)(Processor, { component: null }));
46
60
  if (typeof template === "string") {
@@ -54,7 +68,17 @@ class Processor extends InheritClass_1.InheritClass {
54
68
  }
55
69
  return template;
56
70
  }
71
+ static processObject(obj, component) {
72
+ if (obj === null || obj === undefined) {
73
+ return obj;
74
+ }
75
+ return Processor.instance.processObject(obj, component);
76
+ }
57
77
  processObject(obj, component = null) {
78
+ // If obj is null or undefined, return it as is
79
+ if (obj === null || obj === undefined) {
80
+ return obj;
81
+ }
58
82
  let __instance__ = (component === null) ? (this) : (component.processorHandler);
59
83
  if (typeof __instance__ === "undefined") {
60
84
  __instance__ = new Processor({ component });
@@ -0,0 +1,184 @@
1
+ > **Note**: This documentation was generated with the assistance of AI. While we strive for accuracy, please verify critical information and consult the official QCObjects repository for the most up-to-date documentation.
2
+
3
+ # QCObjects Framework Audit
4
+
5
+ ## Overview
6
+ QCObjects is an open-source framework designed for full-stack development with a focus on micro-services and micro-frontends in an N-Tier architecture. This audit analyzes both the core framework and its CLI tools.
7
+
8
+ ## Version Information
9
+ - Core Package: 2.5.141-beta
10
+ - CLI Package: 2.5.105-beta
11
+ - License: LGPL-3.0
12
+
13
+ ## Core Framework Analysis
14
+
15
+ ### 1. Project Structure & Distribution
16
+ - Multiple module format support:
17
+ - CommonJS (cjs)
18
+ - ES Modules (esm)
19
+ - Browser bundle
20
+ - TypeScript support with type definitions
21
+ - Flexible exports configuration
22
+
23
+ ### 2. Build & Development Tools
24
+ - TypeScript-based project
25
+ - ESBuild for bundling
26
+ - Multiple build scripts:
27
+ - TypeScript compilation
28
+ - Type definitions generation
29
+ - Browser bundle creation
30
+ - Testing framework: Jasmine
31
+ - Linting: ESLint with TypeScript support
32
+
33
+ ### 3. Development Requirements
34
+ - Node.js ≥ 22
35
+ - npm ≥ 10
36
+ - Modern tooling stack
37
+
38
+ ### 4. Core Architecture Components
39
+
40
+ #### Source Code Structure
41
+ ```typescript
42
+ // MVC Implementation
43
+ - Controller.ts (2.9KB)
44
+ - View.ts (542B)
45
+ - Component.ts (54KB)
46
+
47
+ // Component System
48
+ - Component.ts (54KB)
49
+ - ComponentFactory.ts (6.1KB)
50
+ - componentLoader.ts (12KB)
51
+
52
+ // Service Layer
53
+ - Service.ts (3.6KB)
54
+ - BackendMicroservice.ts (8.4KB)
55
+ - serviceLoader.ts (13KB)
56
+
57
+ // Security
58
+ - Crypt.ts (2.8KB)
59
+ - Base64.ts (2.6KB)
60
+ - secretKey.ts (113B)
61
+
62
+ // Core Architecture
63
+ - Class.ts (9.2KB)
64
+ - InheritClass.ts (7.7KB)
65
+ - ClassFactory.ts (1.6KB)
66
+ - MainProcess.ts (17KB)
67
+
68
+ // Platform Support
69
+ - platform.ts (1.1KB)
70
+ - basePath.ts (613B)
71
+ - domain.ts (132B)
72
+
73
+ // Data Management
74
+ - DataStringify.ts (556B)
75
+ - ComplexStorageCache.ts (2.9KB)
76
+ - PrimaryCollections.ts (3.1KB)
77
+ - ArrayCollection.ts (3.6KB)
78
+ ```
79
+
80
+ ## CLI Tools Analysis
81
+
82
+ ### 1. Command Line Interface
83
+ ```bash
84
+ # Main Commands
85
+ qcobjects create <appname> [options] # Create new applications
86
+ qcobjects publish <appname> # Publish applications
87
+ qcobjects generate-sw <appname> # Generate service workers
88
+ qcobjects launch <appname> # Launch applications
89
+ ```
90
+
91
+ ### 2. Project Generation Features
92
+ ```bash
93
+ # Progressive Web App Creation
94
+ qcobjects create mynewapp --pwa
95
+
96
+ # Accelerated Mobile Pages
97
+ qcobjects create mynewapp --amp
98
+ ```
99
+
100
+ ### 3. Server Integration
101
+ - HTTP/2 server configuration: `/etc/qcobjects/config.json`
102
+ - Service management:
103
+ ```bash
104
+ service qcobjects status
105
+ service qcobjects start
106
+ service qcobjects stop
107
+ service qcobjects restart
108
+ ```
109
+
110
+ ## Strengths and Weaknesses
111
+
112
+ ### Strengths
113
+ 1. **Component System**
114
+ - Robust component architecture
115
+ - Sophisticated lifecycle management
116
+ - Efficient component loading
117
+
118
+ 2. **Development Tooling**
119
+ - Comprehensive CLI support
120
+ - Built-in HTTP/2 server
121
+ - Multiple project templates
122
+
123
+ 3. **Architecture**
124
+ - Clear separation of concerns
125
+ - Modular design
126
+ - Type safety support
127
+
128
+ 4. **Build System**
129
+ - Multiple module format support
130
+ - Modern bundling with ESBuild
131
+ - TypeScript integration
132
+
133
+ ### Weaknesses
134
+ 1. **Node.js Version Requirement**
135
+ - Requires Node.js ≥ 22 (currently in development)
136
+ - May limit adoption in production environments
137
+
138
+ 2. **Documentation-Implementation Gap**
139
+ - Some features are more sophisticated than documented
140
+ - Others are less robust than suggested
141
+
142
+ 3. **Backend Features**
143
+ - Limited backend service templates
144
+ - Basic microservice scaffolding
145
+ - Needs more robust backend tooling
146
+
147
+ 4. **Cross-Platform Support**
148
+ - Browser-centric implementation
149
+ - Limited platform-specific optimizations
150
+
151
+ ## Recommendations
152
+
153
+ ### 1. Documentation Improvements
154
+ - Better integration of CLI documentation
155
+ - More comprehensive API documentation
156
+ - Clear separation of browser vs Node.js features
157
+ - Better documentation of limitations and requirements
158
+
159
+ ### 2. Technical Enhancements
160
+ - Reduce Node.js version requirement
161
+ - Enhance backend microservices capabilities
162
+ - Strengthen cross-platform support
163
+ - Add more robust security features
164
+
165
+ ### 3. Architecture Alignment
166
+ - Better balance between frontend and backend features
167
+ - More comprehensive N-Tier architecture support
168
+ - Enhanced PWA feature implementation
169
+
170
+ ### 4. Development Workflow
171
+ - Add more project templates
172
+ - Improve testing infrastructure
173
+ - Enhance microservice development tools
174
+ - Better integration with modern development workflows
175
+
176
+ ## Conclusion
177
+ QCObjects shows promise as a full-stack framework with strong frontend capabilities. While it provides good tooling and component architecture, it needs improvements in backend support and cross-platform capabilities. The high Node.js version requirement may limit its immediate adoption in production environments.
178
+
179
+ The framework is actively maintained and shows good engineering practices, but could benefit from better alignment between documentation and implementation, particularly in areas of backend support and cross-platform capabilities.
180
+
181
+ ## Version Information
182
+ - Audit Date: March 2024
183
+ - Framework Version: 2.5.141-beta
184
+ - CLI Version: 2.5.105-beta
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjects",
3
- "version": "2.5.141-beta",
3
+ "version": "2.5.142",
4
4
  "description": "QCObjects is an Open-source framework that empowers full-stack developers to make micro-services and micro-frontends into an N-Tier architecture.",
5
5
  "main": "public/cjs/index.cjs",
6
6
  "module": "public/esm/index.mjs",
@@ -30,7 +30,7 @@
30
30
  "scripts": {
31
31
  "build": "npm run build:ts-types && npm run build:ts && npm run build:browser",
32
32
  "postbuild": "node ./postbuild.js",
33
- "build:ts": "npm test && npx tsc",
33
+ "build:ts": "npm run coverage && npx tsc",
34
34
  "build:ts-types": "npx tsc --project tsconfig.d.json",
35
35
  "build:browser": "npm run build:esbuild",
36
36
  "build:esbuild": "node ./build-esbuild.js",
@@ -38,8 +38,9 @@
38
38
  "test:ts-types": "npx tsc --project ./tsconfig.jasmine.json ",
39
39
  "test:jasmine": "npm run test:ts-types && npx ts-node -r tsconfig-paths/register --project ./tsconfig.jasmine.json ./node_modules/jasmine/bin/jasmine.js",
40
40
  "test": "(npm run lint && npm run test:jasmine)",
41
- "lint": "(npx -y eslint@latest src/**/*.ts --fix )",
42
- "preversion": "npm cache verify && npm test",
41
+ "coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
42
+ "lint": "(npx eslint src/**/*.ts --fix )",
43
+ "preversion": "npm cache verify && npm run coverage",
43
44
  "sync": "git add . && git commit -am ",
44
45
  "postversion": "git push && git push --tags",
45
46
  "v-patch": "qcobjects v-patch",
@@ -54,7 +55,7 @@
54
55
  },
55
56
  "repository": {
56
57
  "type": "git",
57
- "url": "git+https://github.com/QuickGroup/QCObjects.git"
58
+ "url": "git+https://github.com/QuickCorp/QCObjects.git"
58
59
  },
59
60
  "keywords": [
60
61
  "qcobjects",
@@ -111,17 +112,17 @@
111
112
  ],
112
113
  "author": "Jean Machuca <correojean@gmail.com>",
113
114
  "bugs": {
114
- "url": "https://github.com/QuickGroup/QCObjects/issues"
115
+ "url": "https://github.com/QuickCorp/QCObjects/issues"
115
116
  },
116
117
  "homepage": "https://qcobjects.com",
117
118
  "devDependencies": {
118
119
  "@eslint/eslintrc": "^3.1.0",
119
120
  "@eslint/js": "^9.13.0",
120
- "@types/jasmine": "^5.1.5",
121
- "@types/node": "^22.10.2",
121
+ "@types/jasmine": "^5.1.7",
122
+ "@types/node": "^22.13.10",
122
123
  "@typescript-eslint/eslint-plugin": "^5.58.0",
123
124
  "@typescript-eslint/parser": "^5.58.0",
124
- "esbuild": "^0.24.0",
125
+ "esbuild": "^0.25.0",
125
126
  "esbuild-plugin-alias": "^0.2.1",
126
127
  "eslint": "^8.57.1",
127
128
  "eslint-config-prettier": "^8.10.0",
@@ -137,7 +138,8 @@
137
138
  "ts-node": "^10.9.2",
138
139
  "tsconfig-paths": "^4.2.0",
139
140
  "typescript": "^5.7.2",
140
- "typescript-eslint": "^8.18.1"
141
+ "typescript-eslint": "^8.18.1",
142
+ "nyc": "^15.1.0"
141
143
  },
142
144
  "engines": {
143
145
  "npm": ">=10",
@@ -1523,7 +1523,11 @@ var global = (() => {
1523
1523
  logger.debug("No config value for: " + name);
1524
1524
  _value = _default;
1525
1525
  }
1526
- return GlobalProcessor.processObject(_value) || _default;
1526
+ const processedValue = GlobalProcessor.processObject(_value);
1527
+ if (_value === null && processedValue === null) {
1528
+ return null;
1529
+ }
1530
+ return processedValue || _default;
1527
1531
  }
1528
1532
  static _instance;
1529
1533
  static get instance() {
@@ -1581,16 +1585,30 @@ var global = (() => {
1581
1585
  }
1582
1586
  return _Processor._instance;
1583
1587
  }
1588
+ static setProcessor(_proc_) {
1589
+ if (typeof _proc_ === "function" && _proc_.name !== "") {
1590
+ _Processor.instance.processors[_proc_.name] = _proc_;
1591
+ }
1592
+ }
1584
1593
  setProcessor(_proc_) {
1585
1594
  if (typeof _proc_ === "function" && _proc_.name !== "") {
1586
1595
  this.processors[_proc_.name] = _proc_;
1587
1596
  }
1588
1597
  }
1598
+ static getProcessor(_procName_) {
1599
+ return _Processor.instance.processors[_procName_];
1600
+ }
1601
+ static getProcessorNames() {
1602
+ return Object.keys(_Processor.instance.processors);
1603
+ }
1589
1604
  component;
1590
1605
  execute(component, processorName, args) {
1591
1606
  const processorHandler = typeof component !== "undefined" && component !== null ? component.processorHandler : this;
1592
1607
  return processorHandler?.processors[processorName].bind(processorHandler).apply(processorHandler, [component, args?.split(",")]);
1593
1608
  }
1609
+ static process(template, component = null) {
1610
+ return _Processor.instance.process(template, component);
1611
+ }
1594
1612
  process(template, component = null) {
1595
1613
  const processorHandler = component !== null ? component.processorHandler : New(_Processor, { component: null });
1596
1614
  if (typeof template === "string") {
@@ -1606,7 +1624,16 @@ var global = (() => {
1606
1624
  }
1607
1625
  return template;
1608
1626
  }
1627
+ static processObject(obj, component) {
1628
+ if (obj === null || obj === void 0) {
1629
+ return obj;
1630
+ }
1631
+ return _Processor.instance.processObject(obj, component);
1632
+ }
1609
1633
  processObject(obj, component = null) {
1634
+ if (obj === null || obj === void 0) {
1635
+ return obj;
1636
+ }
1610
1637
  let __instance__ = component === null ? this : component.processorHandler;
1611
1638
  if (typeof __instance__ === "undefined") {
1612
1639
  __instance__ = new _Processor({ component });