@objectql/create 3.0.0 → 4.0.0

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 (33) hide show
  1. package/dist/bin.js +7 -0
  2. package/package.json +1 -1
  3. package/templates/enterprise/CHANGELOG.md +11 -0
  4. package/templates/enterprise/__tests__/data-api.test.ts +8 -0
  5. package/templates/enterprise/__tests__/metadata-api.test.ts +8 -0
  6. package/templates/enterprise/__tests__/metadata-loading.test.ts +8 -0
  7. package/templates/enterprise/jest.config.js +8 -0
  8. package/templates/enterprise/package.json +4 -2
  9. package/templates/enterprise/src/core/index.ts +8 -0
  10. package/templates/enterprise/src/extensions/user.ts +8 -0
  11. package/templates/enterprise/src/index.ts +10 -2
  12. package/templates/enterprise/src/modules/crm/index.ts +8 -0
  13. package/templates/enterprise/src/modules/finance/index.ts +8 -0
  14. package/templates/enterprise/src/modules/hr/index.ts +8 -0
  15. package/templates/enterprise/src/modules/project/index.ts +8 -0
  16. package/templates/enterprise/src/plugins/audit/audit.plugin.ts +40 -19
  17. package/templates/enterprise/src/plugins/audit/index.ts +9 -4
  18. package/templates/enterprise/src/shared/constants.ts +8 -0
  19. package/templates/enterprise/src/shared/utils.ts +8 -0
  20. package/templates/enterprise/src/shared/validators.ts +8 -0
  21. package/templates/enterprise/tsconfig.json +5 -0
  22. package/templates/enterprise/tsconfig.tsbuildinfo +1 -1
  23. package/templates/hello-world/CHANGELOG.md +9 -0
  24. package/templates/hello-world/package.json +1 -1
  25. package/templates/hello-world/src/index.ts +8 -0
  26. package/templates/starter/CHANGELOG.md +11 -0
  27. package/templates/starter/__tests__/projects-hooks-actions.test.ts +8 -0
  28. package/templates/starter/jest.config.js +8 -0
  29. package/templates/starter/package.json +3 -2
  30. package/templates/starter/src/modules/projects/projects.action.ts +8 -0
  31. package/templates/starter/src/modules/projects/projects.hook.ts +8 -0
  32. package/templates/starter/src/seed.ts +8 -0
  33. package/templates/starter/tsconfig.tsbuildinfo +1 -1
package/dist/bin.js CHANGED
@@ -37,6 +37,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
+ /**
41
+ * ObjectQL
42
+ * Copyright (c) 2026-present ObjectStack Inc.
43
+ *
44
+ * This source code is licensed under the MIT license found in the
45
+ * LICENSE file in the root directory of this source tree.
46
+ */
40
47
  const commander_1 = require("commander");
41
48
  const path = __importStar(require("path"));
42
49
  const fs = __importStar(require("fs-extra"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectql/create",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "Create ObjectQL apps with one command",
5
5
  "bin": {
6
6
  "create-objectql": "./dist/bin.js"
@@ -1,5 +1,16 @@
1
1
  # @objectql/starter-enterprise
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [79d04e1]
8
+ - Updated dependencies [faeef39]
9
+ - @objectql/core@3.0.1
10
+ - @objectql/driver-sql@3.0.1
11
+ - @objectql/platform-node@3.0.1
12
+ - @objectql/types@3.0.1
13
+
3
14
  ## 3.0.0
4
15
 
5
16
  ### Patch Changes
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Data API Tests for Enterprise Starter
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Metadata API Tests for Enterprise Starter
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Metadata Loading Tests for Enterprise Starter
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  module.exports = {
2
10
  preset: 'ts-jest',
3
11
  testEnvironment: 'node',
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectql/example-enterprise-erp",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "ObjectQL Enterprise Example - CRM & HR Demo",
5
5
  "private": true,
6
6
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "scripts": {
28
28
  "start": "ts-node src/index.ts",
29
29
  "codegen": "objectql types -s src -o src/types",
30
- "build": "npm run codegen && tsc && rsync -a --include '*/' --include '*.yml' --exclude '*' src/ dist/",
30
+ "build": "tsc && rsync -a --include '*/' --include '*.yml' --exclude '*' src/ dist/",
31
31
  "test": "jest"
32
32
  },
33
33
  "peerDependencies": {
@@ -43,7 +43,9 @@
43
43
  "@objectql/cli": "workspace:*",
44
44
  "@objectql/driver-sql": "workspace:*",
45
45
  "@objectql/platform-node": "workspace:*",
46
+ "@objectstack/spec": "^0.2.0",
46
47
  "@types/jest": "^30.0.0",
48
+ "@types/node": "^20.0.0",
47
49
  "jest": "^30.2.0",
48
50
  "ts-jest": "^29.4.6",
49
51
  "typescript": "^5.3.0"
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Core Module - Foundation Objects
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  // Auto-generated by ObjectQL. DO NOT EDIT.
2
10
  import { ObjectDoc } from '@objectql/types';
3
11
 
@@ -1,8 +1,16 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { ObjectQL } from '@objectql/core';
2
10
  import { SqlDriver } from '@objectql/driver-sql';
3
11
  import { ObjectLoader } from '@objectql/platform-node';
4
12
  import * as path from 'path';
5
- import { AuditLogPlugin } from './plugins/audit/audit.plugin';
13
+ import AuditLogPlugin from './plugins/audit/audit.plugin';
6
14
 
7
15
  async function main() {
8
16
  console.log("🚀 Starting Enterprise ERP Showcase...");
@@ -18,7 +26,7 @@ async function main() {
18
26
  });
19
27
 
20
28
  // Register Plugin
21
- app.use(new AuditLogPlugin());
29
+ app.use(AuditLogPlugin);
22
30
 
23
31
  const loader = new ObjectLoader(app.metadata);
24
32
  await loader.load(path.join(__dirname));
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * CRM Module - Customer Relationship Management
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Finance Module - Finance & Accounting
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * HR Module - Human Resources Management
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Project Module - Project Management
3
11
  *
@@ -1,23 +1,44 @@
1
- import { ObjectQLPlugin, IObjectQL, MutationHookContext } from '@objectql/types';
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
 
3
- export class AuditLogPlugin implements ObjectQLPlugin {
4
- name = 'audit-log';
5
-
6
- setup(app: IObjectQL) {
7
- console.log('[AuditLogPlugin] Setting up...');
9
+ // Import RuntimePlugin types from @objectql/core instead of @objectstack/runtime
10
+ // to avoid ESM/CJS compatibility issues
11
+ interface RuntimeContext {
12
+ engine: any; // ObjectStackKernel
13
+ }
8
14
 
9
- // 1. Listen to all 'afterCreate' events
10
- app.on('afterCreate', '*', async (ctx) => {
11
- // Narrow down context type or use assertion since 'afterCreate' is Mutation
12
- const mutationCtx = ctx as MutationHookContext;
13
- const userId = mutationCtx.user?.id || 'Guest';
14
- console.log(`[Audit] Created ${mutationCtx.objectName} (ID: ${mutationCtx.id}) by User ${userId}`);
15
- });
15
+ interface RuntimePlugin {
16
+ name: string;
17
+ install?: (ctx: RuntimeContext) => void | Promise<void>;
18
+ onStart?: (ctx: RuntimeContext) => void | Promise<void>;
19
+ }
16
20
 
17
- // 2. Listen to all 'afterDelete' events
18
- app.on('afterDelete', '*', async (ctx) => {
19
- const mutationCtx = ctx as MutationHookContext;
20
- console.log(`[Audit] Deleted ${mutationCtx.objectName} (ID: ${mutationCtx.id})`);
21
- });
21
+ const AuditLogPlugin: RuntimePlugin = {
22
+ name: 'audit-log',
23
+
24
+ async install(ctx: RuntimeContext) {
25
+ console.log('[AuditLogPlugin] Installing...');
26
+ // Plugin installation logic here
27
+ },
28
+
29
+ async onStart(ctx: RuntimeContext) {
30
+ console.log('[AuditLogPlugin] Starting...');
31
+
32
+ // TODO: Register event handlers using the runtime context
33
+ // The RuntimeContext provides:
34
+ // - ctx.engine for accessing the kernel
35
+
36
+ // For now, we'll just log that the plugin is started
37
+ console.log('[AuditLogPlugin] Plugin started');
38
+
39
+ // Note: The new plugin system uses RuntimeContext instead of PluginContextData
40
+ // This will need to be enhanced when the full events API is available
22
41
  }
23
- }
42
+ };
43
+
44
+ export default AuditLogPlugin;
@@ -1,6 +1,11 @@
1
- // Export the plugin for external usage
2
- export * from './audit.plugin';
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
3
8
 
4
- // Make it the default export as well for easier consumption
5
- import { AuditLogPlugin } from './audit.plugin';
9
+ // Export the plugin for external usage
10
+ import AuditLogPlugin from './audit.plugin';
6
11
  export default AuditLogPlugin;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Shared constants used across the application
3
11
  */
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Shared utility functions
3
11
  */
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Shared validation utilities
3
11
  */
@@ -19,5 +19,10 @@
19
19
  "exclude": [
20
20
  "node_modules",
21
21
  "dist"
22
+ ],
23
+ "references": [
24
+ {
25
+ "path": "../../../packages/foundation/types"
26
+ }
22
27
  ]
23
28
  }