@solidstarters/solid-core 1.2.30 → 1.2.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidstarters/solid-core",
3
- "version": "1.2.30",
3
+ "version": "1.2.32",
4
4
  "description": "This module is a NestJS module containing all the required core providers required by a Solid application",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,10 @@
24
24
  "test:cov": "jest --coverage",
25
25
  "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
26
26
  "test:e2e": "jest --config ./test/jest-e2e.json",
27
- "prepare": "npm run build"
27
+ "prepare": "npm run build",
28
+ "publish:patch": "node publish.js patch",
29
+ "publish:minor": "node publish.js minor",
30
+ "publish:major": "node publish.js major"
28
31
  },
29
32
  "author": "Oswald Rodrigues <oswald@logicloop.io>",
30
33
  "license": "ISC",
package/publish.js ADDED
@@ -0,0 +1,16 @@
1
+ const { execSync } = require("child_process");
2
+
3
+ const versionType = process.argv[2] || "patch"; // Default to patch if not specified
4
+
5
+ try {
6
+ console.log(`🔄 Updating package version (${versionType})...`);
7
+ execSync(`npm version ${versionType}`, { stdio: "inherit" });
8
+
9
+ console.log("📦 Publishing package...");
10
+ execSync("npm publish", { stdio: "inherit" });
11
+
12
+ console.log("✅ Published successfully!");
13
+ } catch (error) {
14
+ console.error("❌ Error:", error.message);
15
+ process.exit(1);
16
+ }
@@ -0,0 +1,47 @@
1
+ import { v4 as uuidv4 } from 'uuid';
2
+ import { Injectable } from "@nestjs/common";
3
+ import { ComputedFieldProvider } from "src/decorators/computed-field-provider.decorator";
4
+ import { IComputedFieldProvider } from "../../interfaces";
5
+ import { kebabCase } from "lodash";
6
+
7
+ @ComputedFieldProvider()
8
+ @Injectable()
9
+ export class ConcatComputedFieldProvider implements IComputedFieldProvider<any> {
10
+
11
+ name(): string {
12
+ return "ConcatComputedFieldProvider";
13
+ }
14
+
15
+ help(): string {
16
+ return "Computed field provider used to create fields whose value is a concatenation of other fields in the same model.";
17
+ }
18
+
19
+ valueType(): string {
20
+ return "string";
21
+ }
22
+
23
+ async computeValue(dto: any, ctxt: any): Promise<string> {
24
+ const separator = ctxt.separator;
25
+ const fields = ctxt.fields;
26
+ const slugify = ctxt.slugify || false;
27
+
28
+ let concatenatedString = '';
29
+ for (let i = 0; i < fields.length; i++) {
30
+ const field = fields[i];
31
+
32
+ // if slugify then each field val to be converted to a slug before concatenation
33
+ let fieldVal = dto[field];
34
+ if (slugify) {
35
+ fieldVal = kebabCase(fieldVal);
36
+ }
37
+
38
+ if (concatenatedString) {
39
+ concatenatedString += separator;
40
+ }
41
+ concatenatedString += fieldVal;
42
+ }
43
+
44
+ return concatenatedString;
45
+ }
46
+
47
+ }
@@ -389,7 +389,7 @@ export class ModelMetadataService {
389
389
 
390
390
  const menu = {
391
391
  displayName: `${model.displayName}`,
392
- name: `${model.singularName}`,
392
+ name: `${model.singularName}-menu-item`,
393
393
  sequenceNumber: 1,
394
394
  actionUserKey: `${model.singularName}-list-view`,
395
395
  moduleUserKey: `${model.module.name}`,
@@ -448,7 +448,7 @@ export class ModelMetadataService {
448
448
  },
449
449
  {
450
450
  type: "column",
451
- attrs: { name: "group-1", label: "", className: "col-6" },
451
+ attrs: { name: "group-2", label: "", className: "col-6" },
452
452
  children: column2Fields
453
453
  }]
454
454
  },
@@ -737,6 +737,10 @@ export class ModelMetadataService {
737
737
  }
738
738
  }));
739
739
 
740
+ const midIndex = Math.ceil(formViewLayout.length / 2);
741
+ const firstHalf = formViewLayout.slice(0, midIndex);
742
+ const secondHalf = formViewLayout.slice(midIndex);
743
+
740
744
  const resolvedModule = await this.dataSource.getRepository(ModuleMetadata).findOne({
741
745
  where: { id: model.module.id }
742
746
  });
@@ -788,7 +792,12 @@ export class ModelMetadataService {
788
792
  {
789
793
  type: "column",
790
794
  attrs: { name: "group-1", label: "", className: "col-6" },
791
- children: formViewLayout
795
+ children: firstHalf
796
+ },
797
+ {
798
+ type: "column",
799
+ attrs: { name: "group-2", label: "", className: "col-6" },
800
+ children: secondHalf
792
801
  }
793
802
  ]
794
803
  }
@@ -136,6 +136,7 @@ import { Setting } from './entities/setting.entity';
136
136
  import { SettingService } from './services/setting.service';
137
137
  import { SettingController } from './controllers/setting.controller';
138
138
  import { ModuleMetadataHelperService } from './helpers/module-metadata-helper.service';
139
+ import { ConcatComputedFieldProvider } from './services/computed-fields/concat-computed-field-provider.service';
139
140
 
140
141
 
141
142
  @Global()
@@ -294,6 +295,7 @@ import { ModuleMetadataHelperService } from './helpers/module-metadata-helper.se
294
295
  PermissionMetadataSeederService,
295
296
  UserService,
296
297
  SettingService,
298
+ ConcatComputedFieldProvider,
297
299
  ],
298
300
  exports: [
299
301
  ModuleMetadataService,