Skip to content

Commit

Permalink
feat: github packages를 받기위한 세팅 추가
Browse files Browse the repository at this point in the history
ui-kits를 받기위해서 .npmrc 파일을 추가함
- github token이 노출되는 것을 방지하기 위해 .envrc 파일을 추가해서 토큰을 관리하도록 함
- .yarnrc.yml에 설정 추가
- workflows에 GITHUB_ACCESS_TOKEN env 추가

close #11
  • Loading branch information
ppark2ya committed Dec 10, 2021
1 parent f0c396b commit 1c93bf1
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 17 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/web-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
NODE_OPTIONS: --max_old_space_size=4096
CF_DISTRIBUTION_ID: ${{ secrets.WEB_DEV_CF_DISTRIBUTION_ID }}
ACM_CERTIFICATE_ARN: ${{ secrets.ACM_CERTIFICATE_ARN }}
GITHUB_ACCESS_TOKEN: ${{ secrets.NPM_GITHUB_ACCESS_TOKEN }}
BUCKET_NAME: writing-hub-web-dev

defaults:
Expand All @@ -36,23 +37,23 @@ jobs:
- name: Install dependencies
run: yarn install --immutable --immutable-cache

# lint:
# runs-on: ubuntu-latest
# needs: [install-dependencies]
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
lint:
runs-on: ubuntu-latest
needs: [install-dependencies]
steps:
- name: Checkout code
uses: actions/checkout@v2

# - name: Setup node.js
# uses: actions/setup-node@v2
# with:
# node-version: "14"
- name: Setup node.js
uses: actions/setup-node@v2
with:
node-version: "14"

# - name: Install dependencies
# run: yarn install --immutable --immutable-cache
- name: Install dependencies
run: yarn install --immutable --immutable-cache

# - name: Lint
# run: yarn lint
- name: Lint
run: yarn lint

unit-testing:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ yarn-error.log*
# env
.env
.env.*
.envrc
2 changes: 2 additions & 0 deletions web/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//npm.pkg.github.com/:_authToken=${GITHUB_ACCESS_TOKEN}
@nolmungshemung:registry=https://npm.pkg.github.com/
Binary file not shown.
Binary file not shown.
7 changes: 6 additions & 1 deletion web/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.0.2.cjs
# https://stackoverflow.com/questions/61738819/installing-private-package-from-github-package-registry-using-yarn-fails-with-no
npmScopes:
"nolmungshemung":
npmAlwaysAuth: true
npmRegistryServer: "https://npm.pkg.github.com"
npmAuthToken: ${GITHUB_ACCESS_TOKEN}
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"deploy:remove": "serverless remove"
},
"dependencies": {
"@nolmungshemung/ui-kits": "^0.0.1",
"@stitches/react": "^1.2.1",
"axios": "^0.24.0",
"next": "11.1.2",
Expand Down
2 changes: 2 additions & 0 deletions web/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useState, ChangeEvent } from 'react';
import { useQueryClient } from 'react-query';
import TodoItem from '~/components/Todo/TodoItem';
import { useTodoList, useCreateTodo } from '~/data/todo/todo.hooks';
import { DefaultButton } from '@nolmungshemung/ui-kits';

const Home: NextPage = function () {
const queryClient = useQueryClient();
Expand Down Expand Up @@ -71,6 +72,7 @@ const Home: NextPage = function () {
<link rel="icon" href="/favicon.ico" />
</Head>
<div>{renderTodoList()}</div>
<DefaultButton>test</DefaultButton>
</div>
);
};
Expand Down
25 changes: 23 additions & 2 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,17 @@ __metadata:
languageName: node
linkType: hard

"@nolmungshemung/ui-kits@npm:^0.0.1":
version: 0.0.1
resolution: "@nolmungshemung/ui-kits@npm:0.0.1::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40nolmungshemung%2Fui-kits%2F0.0.1%2F6fc5f09e1fc3210fc6bec87ba70c2d638e52bcbd63a65897717e80e618e999b3"
dependencies:
"@stitches/react": ^1.2.5
react: ^17.0.2
react-dom: ^17.0.2
checksum: 9a9c84fee64634a417b95e2178af8779b50d8063c661514dff64a2238daa693b9e5fbca5fa6f59e530f3c2a82a84b951a02efdb42df9146000a4ce6b6cca53fd
languageName: node
linkType: hard

"@npmcli/fs@npm:^1.0.0":
version: 1.0.0
resolution: "@npmcli/fs@npm:1.0.0"
Expand Down Expand Up @@ -2170,6 +2181,15 @@ __metadata:
languageName: node
linkType: hard

"@stitches/react@npm:^1.2.5":
version: 1.2.6
resolution: "@stitches/react@npm:1.2.6"
peerDependencies:
react: ">= 16.3.0"
checksum: 416088cdde17a22d6cdb04cf1cf756c6e5fc291dd7e41f82ce422bb95432ad32b6d990e7264d996d367c40bbc674d61be087e4e1f7b23eea7f81ef6266373a9c
languageName: node
linkType: hard

"@szmarczak/http-timer@npm:^1.1.2":
version: 1.1.2
resolution: "@szmarczak/http-timer@npm:1.1.2"
Expand Down Expand Up @@ -10445,7 +10465,7 @@ __metadata:
languageName: node
linkType: hard

"react-dom@npm:17.0.2":
"react-dom@npm:17.0.2, react-dom@npm:^17.0.2":
version: 17.0.2
resolution: "react-dom@npm:17.0.2"
dependencies:
Expand Down Expand Up @@ -10497,7 +10517,7 @@ __metadata:
languageName: node
linkType: hard

"react@npm:17.0.2":
"react@npm:17.0.2, react@npm:^17.0.2":
version: 17.0.2
resolution: "react@npm:17.0.2"
dependencies:
Expand Down Expand Up @@ -12971,6 +12991,7 @@ [email protected]:
dependencies:
"@babel/core": ^7.15.8
"@babel/preset-env": ^7.15.8
"@nolmungshemung/ui-kits": ^0.0.1
"@stitches/react": ^1.2.1
"@types/jest": ^27.0.2
"@types/node": ^16.10.2
Expand Down

0 comments on commit 1c93bf1

Please sign in to comment.