cc-core-cli 1.0.153 → 1.0.156

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.153",
3
+ "version": "1.0.156",
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": {
@@ -1,10 +1,13 @@
1
- FROM node:22-alpine
1
+ FROM node:18.20.0-alpine3.18
2
2
 
3
3
  RUN mkdir /app
4
4
  WORKDIR /app
5
5
 
6
+ ARG NPM_TOKEN
7
+ RUN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc \
8
+ && echo "@shopstack:registry=https://registry.npmjs.org/" >> .npmrc
9
+
6
10
  COPY package.json .
7
- COPY .npmrc .
8
11
  COPY . .
9
12
  RUN npm install --production
10
13
 
@@ -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
@@ -1,15 +1,15 @@
1
- FROM node:22-alpine
1
+ FROM node:18.20.0-alpine3.18
2
2
 
3
3
  RUN mkdir /app
4
4
  WORKDIR /app
5
5
 
6
- COPY package.json .
7
- RUN npm install
6
+ ARG NPM_TOKEN
7
+ RUN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc \
8
+ && echo "@shopstack:registry=https://registry.npmjs.org/" >> .npmrc
8
9
 
10
+ COPY package.json .
9
11
  COPY . .
10
-
11
- ARG commit_hash
12
- ENV BUILD_ID ${commit_hash}
12
+ RUN npm install --production
13
13
 
14
14
  RUN npm run build
15
- CMD ["npm", "run", "start"]
15
+ CMD ["npm", "run", "production"]
@@ -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
@@ -5,13 +5,19 @@ RUN apk add --no-cache build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev
5
5
  RUN apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation fontconfig
6
6
 
7
7
  WORKDIR /usr/src/app
8
+
9
+ ARG NPM_TOKEN
10
+ RUN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc \
11
+ && echo "@shopstack:registry=https://registry.npmjs.org/" >> .npmrc
12
+
13
+
8
14
  COPY package.json .
9
- COPY .npmrc .
10
15
  COPY . .
11
- RUN npm install -g @nestjs/cli && npm install
12
- RUN npm run build
13
16
 
17
+ RUN cat .npmrc
14
18
 
19
+ RUN npm install -g @nestjs/cli && npm install
20
+ RUN npm run build
15
21
 
16
22
  FROM node:22.14.0-alpine3.20 as production
17
23
 
@@ -45,8 +51,12 @@ RUN fc-cache -f -v
45
51
  RUN fc-list | grep "Sarabun"
46
52
 
47
53
  WORKDIR /usr/src/app
54
+
55
+ ARG NPM_TOKEN
56
+ RUN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc \
57
+ && echo "@shopstack:registry=https://registry.npmjs.org/" >> .npmrc
58
+
48
59
  COPY package.json .
49
- COPY .npmrc .
50
60
  COPY . .
51
61
  RUN npm install --only=production
52
62
  COPY --from=development /usr/src/app/dist ./dist
@@ -57,4 +67,4 @@ RUN find /usr/local/lib/node_modules -name "package-lock.json" -type f -delete
57
67
  RUN find /usr/src/app/node_modules -name "yarn.lock" -type f -delete
58
68
  RUN find /usr/src/app/node_modules -name "package-lock.json" -type f -delete
59
69
 
60
- CMD ["npm", "run", "start:prod"]
70
+ CMD ["npm", "run", "start:prod"]
@@ -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
@@ -5,13 +5,19 @@ RUN apk add --no-cache build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev
5
5
  RUN apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation fontconfig
6
6
 
7
7
  WORKDIR /usr/src/app
8
+
9
+ ARG NPM_TOKEN
10
+ RUN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc \
11
+ && echo "@shopstack:registry=https://registry.npmjs.org/" >> .npmrc
12
+
13
+
8
14
  COPY package.json .
9
- COPY .npmrc .
10
15
  COPY . .
11
- RUN npm install -g @nestjs/cli && npm install
12
- RUN npm run build
13
16
 
17
+ RUN cat .npmrc
14
18
 
19
+ RUN npm install -g @nestjs/cli && npm install
20
+ RUN npm run build
15
21
 
16
22
  FROM node:22.14.0-alpine3.20 as production
17
23
 
@@ -45,8 +51,12 @@ RUN fc-cache -f -v
45
51
  RUN fc-list | grep "Sarabun"
46
52
 
47
53
  WORKDIR /usr/src/app
54
+
55
+ ARG NPM_TOKEN
56
+ RUN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc \
57
+ && echo "@shopstack:registry=https://registry.npmjs.org/" >> .npmrc
58
+
48
59
  COPY package.json .
49
- COPY .npmrc .
50
60
  COPY . .
51
61
  RUN npm install --only=production
52
62
  COPY --from=development /usr/src/app/dist ./dist
@@ -57,4 +67,4 @@ RUN find /usr/local/lib/node_modules -name "package-lock.json" -type f -delete
57
67
  RUN find /usr/src/app/node_modules -name "yarn.lock" -type f -delete
58
68
  RUN find /usr/src/app/node_modules -name "package-lock.json" -type f -delete
59
69
 
60
- CMD ["npm", "run", "start:prod"]
70
+ CMD ["npm", "run", "start:prod"]
@@ -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