From a39a90113f2baaec6078102ad074d5b7a10f1ab7 Mon Sep 17 00:00:00 2001 From: Jack Kleeman Date: Wed, 25 Oct 2023 22:16:07 +0100 Subject: [PATCH] Remove npmrc --- .github/workflows/test.yml | 7 +------ typescript/ecommerce-store/README.md | 2 +- typescript/ecommerce-store/deployment/aws/README.md | 2 +- typescript/ecommerce-store/deployment/knative/README.md | 2 +- typescript/ecommerce-store/services/Dockerfile | 4 ++-- typescript/food-ordering/README.md | 2 +- typescript/food-ordering/services/Dockerfile | 4 ++-- typescript/package-lock.json | 5 ++--- 8 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 750e5485..c7110d97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,11 +22,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Create .npmrc - run: | - echo '@restatedev:registry=https://npm.pkg.github.com/' > typescript/.npmrc - echo '//npm.pkg.github.com/:_authToken=${GH_PACKAGE_READ_ACCESS_TOKEN}' >> typescript/.npmrc + registry-url: 'https://registry.npmjs.org' - run: npm ci --prefix typescript - env: - GH_PACKAGE_READ_ACCESS_TOKEN: ${{ secrets.GH_PACKAGE_READ_ACCESS_TOKEN }} - run: npm run --prefix typescript -ws verify diff --git a/typescript/ecommerce-store/README.md b/typescript/ecommerce-store/README.md index 8efd911e..4b3bbd99 100644 --- a/typescript/ecommerce-store/README.md +++ b/typescript/ecommerce-store/README.md @@ -24,7 +24,7 @@ Build the Docker containers for the web app and services: ```shell docker build -t dev.local/shopping-cart/react-app:0.0.1 ./react-shopping-cart -docker build ./services/ -t dev.local/shopping-cart/services:0.0.1 --secret id=npmrc,src=$HOME/.npmrc +docker build ./services/ -t dev.local/shopping-cart/services:0.0.1 ``` You can store the products data in the Restate runtime or in a separate Postgres DB: diff --git a/typescript/ecommerce-store/deployment/aws/README.md b/typescript/ecommerce-store/deployment/aws/README.md index 34e79b4d..661a60f3 100644 --- a/typescript/ecommerce-store/deployment/aws/README.md +++ b/typescript/ecommerce-store/deployment/aws/README.md @@ -27,7 +27,7 @@ Build the following Docker images and push them to AWS ECR. At the root of the r ```shell # Shopping services -docker build ./services -t $ECR_REPOSITORY/shopping-cart-demo:1.0.2 --secret id=npmrc,src=$HOME/.npmrc +docker build ./services -t $ECR_REPOSITORY/shopping-cart-demo:1.0.2 docker push $ECR_REPOSITORY/shopping-cart-demo:1.0.2 # Shopping web app docker build -t $ECR_REPOSITORY/shopping-cart-webapp:1.0.2 ./react-shopping-cart diff --git a/typescript/ecommerce-store/deployment/knative/README.md b/typescript/ecommerce-store/deployment/knative/README.md index 21ee4bc4..d97036c4 100644 --- a/typescript/ecommerce-store/deployment/knative/README.md +++ b/typescript/ecommerce-store/deployment/knative/README.md @@ -12,7 +12,7 @@ kn quickstart kind 2. Build the Docker images for the web application and backend services: ```shell docker build -t dev.local/shopping-cart/react-app:0.0.1 ./react-shopping-cart -docker build ./services/ -t dev.local/shopping-cart/services:0.0.1 --secret id=npmrc,src=$HOME/.npmrc +docker build ./services/ -t dev.local/shopping-cart/services:0.0.1 ``` Upload the images to the cluster: diff --git a/typescript/ecommerce-store/services/Dockerfile b/typescript/ecommerce-store/services/Dockerfile index 1d75bec6..3d3417ec 100644 --- a/typescript/ecommerce-store/services/Dockerfile +++ b/typescript/ecommerce-store/services/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /usr/src/app # copy package.json and package-lock.json separately to cache dependencies COPY package*.json . COPY tsconfig.json . -RUN --mount=type=secret,id=npmrc,target=/root/.npmrc npm install +RUN npm install COPY --chown=node:node . . RUN npm run proto @@ -19,4 +19,4 @@ ENV NODE_ENV production ENV PORT 8080 EXPOSE 8080 USER node -CMD ["dumb-init", "node", "./dist/app.js"] \ No newline at end of file +CMD ["dumb-init", "node", "./dist/app.js"] diff --git a/typescript/food-ordering/README.md b/typescript/food-ordering/README.md index dfc1b3d6..b3a01be3 100644 --- a/typescript/food-ordering/README.md +++ b/typescript/food-ordering/README.md @@ -60,7 +60,7 @@ Have a look at the implementation of the `prepareOrder` function in the `OrderSe Build the services: ```shell -docker build ./services/ -t dev.local/food-ordering/services:0.0.1 --secret id=npmrc,src=$HOME/.npmrc && \ +docker build ./services/ -t dev.local/food-ordering/services:0.0.1 && \ docker build ./pos_server/ -t dev.local/food-ordering/pos_server:0.0.1 ``` diff --git a/typescript/food-ordering/services/Dockerfile b/typescript/food-ordering/services/Dockerfile index d2a59a83..abdc7840 100644 --- a/typescript/food-ordering/services/Dockerfile +++ b/typescript/food-ordering/services/Dockerfile @@ -7,13 +7,13 @@ WORKDIR /usr/src/app # copy package.json and package-lock.json separately to cache dependencies COPY package*.json . -RUN --mount=type=secret,id=npmrc,target=/root/.npmrc npm install +RUN npm install COPY --chown=node:node .. . RUN npm run build -RUN --mount=type=secret,id=npmrc,target=/root/.npmrc npm prune --omit=dev +RUN npm prune --omit=dev ENV NODE_ENV production EXPOSE 8080 diff --git a/typescript/package-lock.json b/typescript/package-lock.json index d4c41b61..be388210 100644 --- a/typescript/package-lock.json +++ b/typescript/package-lock.json @@ -895,9 +895,8 @@ }, "node_modules/@restatedev/restate-sdk": { "version": "0.4.0", - "resolved": "https://npm.pkg.github.com/download/@restatedev/restate-sdk/0.4.0/12c9651c7a9298a847e29213cc62c178e4a2e1e5", - "integrity": "sha512-IImMMte61C4GZxrOiCjznkqwhPWWd7DTLMfEANw9kQaeE8xt3EdgDhHV6heTOq4xdZAIxfZfjnUUK32kW80xdA==", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@restatedev/restate-sdk/-/restate-sdk-0.4.0.tgz", + "integrity": "sha512-MeywjoPz/aFeK6XjZxpZ8+ZPhHMmMz0XrK0P4Ran4U5W8LdgDof47Q4HsqmDig8XXMBrRaLpe5+p2b0GBA+95w==", "dependencies": { "protobufjs": "^7.2.2", "ts-proto": "^1.140.0"