cc-core-cli 1.0.152 → 1.0.155

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/bin/index.js CHANGED
@@ -72,6 +72,15 @@ if (action === 'upgrade') {
72
72
  return !IGNORE_FILES.find(f => name.includes(f))
73
73
  }
74
74
  })
75
+ try {
76
+ const pkgTemplate = jsonfile.readFileSync(`${__dirname}/../template/${project}/package.json`);
77
+ const pkgExisting = jsonfile.readFileSync('./package.json');
78
+ pkgExisting.dependencies = {...(pkgExisting.dependencies || {}),...(pkgTemplate.dependencies || {})};;
79
+ pkgExisting.devDependencies = {...(pkgExisting.devDependencies || {}),...(pkgTemplate.devDependencies || {})};
80
+ jsonfile.writeFileSync('./package.json', pkgExisting, { spaces: 2 });
81
+ } catch (e) {
82
+ return false
83
+ }
75
84
  spinner.succeed('(1/2) Copying files!')
76
85
  spinner.start('(2/2) Running npm install!')
77
86
  exec('npm install', (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-core-cli",
3
- "version": "1.0.152",
3
+ "version": "1.0.155",
4
4
  "description": "Command Line Interface tool for generating project templates for the (Your Platform's Name) platform.",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -0,0 +1,27 @@
1
+ version: 0.2
2
+
3
+ phases:
4
+ pre_build:
5
+ commands:
6
+ - echo Logging in to Amazon ECR...
7
+ - $(aws ecr get-login --no-include-email --region ap-southeast-1)
8
+ - REPOSITORY_URI=$ECR_URI
9
+ - COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
10
+ - IMAGE_TAG=${COMMIT_HASH:=latest}
11
+ build:
12
+ commands:
13
+ - echo logging in dockerhub...
14
+ - docker login -u $dockeruser -p $dockerpassword
15
+ - echo Build started on `date`
16
+ - echo Building the Docker image...
17
+ - docker build --no-cache -t $REPOSITORY_URI:latest --build-arg commit_hash=$COMMIT_HASH --build-arg NPM_TOKEN="$SHOPSTACK_TOKEN" .
18
+ - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
19
+ post_build:
20
+ commands:
21
+ - echo Build completed on `date`
22
+ - echo Pushing the Docker image...
23
+ - docker push $REPOSITORY_URI:$IMAGE_TAG
24
+ - echo Writing image definitions file...
25
+ - printf '[{"name":"%s","imageUri":"%s"}]' $IMAGE_CONTAINER_NAME $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
26
+ artifacts:
27
+ files: imagedefinitions.json
@@ -0,0 +1,27 @@
1
+ version: 0.2
2
+
3
+ phases:
4
+ pre_build:
5
+ commands:
6
+ - echo Logging in to Amazon ECR...
7
+ - $(aws ecr get-login --no-include-email --region ap-southeast-1)
8
+ - REPOSITORY_URI=$ECR_URI
9
+ - COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
10
+ - IMAGE_TAG=${COMMIT_HASH:=latest}
11
+ build:
12
+ commands:
13
+ - echo logging in dockerhub...
14
+ - docker login -u $dockeruser -p $dockerpassword
15
+ - echo Build started on `date`
16
+ - echo Building the Docker image...
17
+ - docker build --no-cache -t $REPOSITORY_URI:latest --build-arg commit_hash=$COMMIT_HASH --build-arg NPM_TOKEN="$SHOPSTACK_TOKEN" .
18
+ - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
19
+ post_build:
20
+ commands:
21
+ - echo Build completed on `date`
22
+ - echo Pushing the Docker image...
23
+ - docker push $REPOSITORY_URI:$IMAGE_TAG
24
+ - echo Writing image definitions file...
25
+ - printf '[{"name":"%s","imageUri":"%s"}]' $IMAGE_CONTAINER_NAME $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
26
+ artifacts:
27
+ files: imagedefinitions.json
@@ -14,9 +14,7 @@ phases:
14
14
  - docker login -u $dockeruser -p $dockerpassword
15
15
  - echo Build started on `date`
16
16
  - echo Building the Docker image...
17
- - sed -i "s|{{SHOPSTACK_TOKEN}}|$SHOPSATCK_TOKEN|g" .npmrc
18
- - cat .npmrc
19
- - docker build --no-cache -t $REPOSITORY_URI:latest --build-arg commit_hash=$COMMIT_HASH .
17
+ - docker build --no-cache -t $REPOSITORY_URI:latest --build-arg commit_hash=$COMMIT_HASH --build-arg NPM_TOKEN="$SHOPSTACK_TOKEN" .
20
18
  - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
21
19
  post_build:
22
20
  commands:
@@ -26,4 +24,4 @@ phases:
26
24
  - echo Writing image definitions file...
27
25
  - printf '[{"name":"%s","imageUri":"%s"}]' $IMAGE_CONTAINER_NAME $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
28
26
  artifacts:
29
- files: imagedefinitions.json
27
+ files: imagedefinitions.json
@@ -23,17 +23,17 @@
23
23
  "sonar:coverage": "jest --coverage --coverageReporters=lcov --coverageDirectory=coverage"
24
24
  },
25
25
  "dependencies": {
26
- "@shopstack/cc-core-lib": "2.5.328",
26
+ "@shopstack/cc-core-lib": "^2.6.0",
27
27
  "reflect-metadata": "^0.1.14"
28
28
  },
29
29
  "devDependencies": {
30
- "@nestjs/testing": "^10.3.5",
30
+ "@nestjs/testing": "^11.1.11",
31
31
  "@types/bcrypt": "^5.0.2",
32
32
  "@types/bull": "^3.14.4",
33
33
  "@types/chroma-js": "^2.4.0",
34
34
  "@types/express": "^4.17.8",
35
35
  "@types/jest": "^29.5.14",
36
- "@types/node": "^13.13.27",
36
+ "@types/node": "^24.10.4",
37
37
  "@types/numeral": "^2.0.2",
38
38
  "@types/supertest": "^2.0.10",
39
39
  "@typescript-eslint/eslint-plugin": "^6.1.0",
@@ -2,7 +2,7 @@ import * as _ from "lodash";
2
2
  import * as os from "os";
3
3
  import { Injectable } from "@nestjs/common";
4
4
  import axios, { AxiosInstance } from "axios";
5
- import { CONST } from "src/core/common/constants";
5
+ import { CONST } from '@shopstack/cc-core-lib/core'
6
6
  const cluster = require('node:cluster') as any
7
7
 
8
8
  CONST.INTERNAL_DOMAIN = `http://${process.env.LOOP_BACK_IP}:${process.env
@@ -14,9 +14,7 @@ phases:
14
14
  - docker login -u $dockeruser -p $dockerpassword
15
15
  - echo Build started on `date`
16
16
  - echo Building the Docker image...
17
- - sed -i "s|{{SHOPSTACK_TOKEN}}|$SHOPSATCK_TOKEN|g" .npmrc
18
- - cat .npmrc
19
- - docker build --no-cache -t $REPOSITORY_URI:latest --build-arg commit_hash=$COMMIT_HASH .
17
+ - docker build --no-cache -t $REPOSITORY_URI:latest --build-arg commit_hash=$COMMIT_HASH --build-arg NPM_TOKEN="$SHOPSTACK_TOKEN" .
20
18
  - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
21
19
  post_build:
22
20
  commands:
@@ -26,4 +24,4 @@ phases:
26
24
  - echo Writing image definitions file...
27
25
  - printf '[{"name":"%s","imageUri":"%s"}]' $IMAGE_CONTAINER_NAME $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
28
26
  artifacts:
29
- files: imagedefinitions.json
27
+ files: imagedefinitions.json
@@ -27,13 +27,13 @@
27
27
  "reflect-metadata": "^0.1.14"
28
28
  },
29
29
  "devDependencies": {
30
- "@nestjs/testing": "^10.3.5",
30
+ "@nestjs/testing": "^11.1.11",
31
31
  "@types/bcrypt": "^5.0.2",
32
32
  "@types/bull": "^3.14.4",
33
33
  "@types/chroma-js": "^2.4.0",
34
34
  "@types/express": "^4.17.8",
35
35
  "@types/jest": "^29.5.14",
36
- "@types/node": "^13.13.27",
36
+ "@types/node": "^24.10.4",
37
37
  "@types/numeral": "^2.0.2",
38
38
  "@types/supertest": "^2.0.10",
39
39
  "@typescript-eslint/eslint-plugin": "^6.1.0",
@@ -2,7 +2,7 @@ import * as _ from "lodash";
2
2
  import * as os from "os";
3
3
  import { Injectable } from "@nestjs/common";
4
4
  import axios, { AxiosInstance } from "axios";
5
- import { CONST } from "src/core/common/constants";
5
+ import { CONST } from '@shopstack/cc-core-lib/core'
6
6
  const cluster = require('node:cluster') as any
7
7
 
8
8
  CONST.INTERNAL_DOMAIN = `http://${process.env.LOOP_BACK_IP}:${process.env