Skip to content

Commit

Permalink
♻️ turborepo 로 이전 (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
woohm402 authored Sep 9, 2023
1 parent 8017303 commit 4091261
Show file tree
Hide file tree
Showing 128 changed files with 1,899 additions and 1,447 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci-friends.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ on:

jobs:
build:
name: Test
name: ci
timeout-minutes: 15
runs-on: ubuntu-latest

defaults:
run:
working-directory: friends

steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -28,3 +24,6 @@ jobs:

- name: Type Check
run: yarn tsc

- name: Unit Test
run: yarn test
10 changes: 5 additions & 5 deletions .github/workflows/deploy-friends-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

defaults:
run:
working-directory: friends
working-directory: apps/friends-react-native

steps:
- name: Checkout
Expand Down Expand Up @@ -45,8 +45,8 @@ jobs:
- name: Deploy to S3 and Invalidate Cloudfront
id: deploy-s3
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_SNUTT_RN_ASSETS }}
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID_SNUTT_RN_ASSETS }}
run: |
aws s3 cp ./public s3://$AWS_S3_BUCKET/$TAG_NAME/assets --recursive --content-type 'image/png'
aws s3 cp ./dist/ios.jsbundle s3://$AWS_S3_BUCKET/$TAG_NAME/ios.jsbundle --content-type 'application/javascript'
Expand All @@ -57,8 +57,8 @@ jobs:
id: update-configs
env:
BUCKET_URL: "https://snutt-rn-assets.wafflestudio.com"
SNUTT_APIKEY: ${{ secrets.SNUTT_APIKEY }}
SNUTT_TOKEN: ${{ secrets.SNUTT_TOKEN_DEV }}
SNUTT_APIKEY: ${{ secrets.SNUTT_ADMIN_APIKEY }}
SNUTT_TOKEN: ${{ secrets.SNUTT_ADMIN_TOKEN_DEV }}
run: |
curl 'https://snutt-api-dev.wafflestudio.com/v1/admin/configs/reactNativeBundleFriends' \
-H 'Content-Type: application/json' \
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-friends-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

defaults:
run:
working-directory: friends
working-directory: apps/friends-react-native

steps:
- name: Checkout
Expand Down Expand Up @@ -45,8 +45,8 @@ jobs:
- name: Deploy to S3 and Invalidate Cloudfront
id: deploy-s3
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_SNUTT_RN_ASSETS }}
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID_SNUTT_RN_ASSETS }}
run: |
aws s3 cp ./public s3://$AWS_S3_BUCKET/$TAG_NAME/assets --recursive --content-type 'image/png'
aws s3 cp ./dist/ios.jsbundle s3://$AWS_S3_BUCKET/$TAG_NAME/ios.jsbundle --content-type 'application/javascript'
Expand All @@ -57,8 +57,8 @@ jobs:
id: update-configs
env:
BUCKET_URL: "https://snutt-rn-assets.wafflestudio.com"
SNUTT_APIKEY: ${{ secrets.SNUTT_APIKEY }}
SNUTT_TOKEN: ${{ secrets.SNUTT_TOKEN_PROD }}
SNUTT_APIKEY: ${{ secrets.SNUTT_ADMIN_APIKEY }}
SNUTT_TOKEN: ${{ secrets.SNUTT_ADMIN_TOKEN_PROD }}
run: |
curl 'https://snutt-api.wafflestudio.com/v1/admin/configs/reactNativeBundleFriends' \
-H 'Content-Type: application/json' \
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_Store
.turbo
node_modules
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions friends/README.md → apps/friends-react-native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
## installation

```bash
git clone https://github.com/wafflestudio/snutt-rn
cd snutt-rn/friends
git clone https://github.com/wafflestudio/snutt-frontend
cd snutt-frontend/apps/friends-react-native
yarn
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions apps/friends-react-native/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
preset: 'react-native',
testMatch: ['**.test.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
};
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');
const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts;
const defaultAssetExts = require('metro-config/src/defaults/defaults').assetExts;
const workspaceRoot = path.resolve(__dirname, '../..');
const projectRoot = __dirname;
/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/

module.exports = mergeConfig(getDefaultConfig(__dirname), {
const config = mergeConfig(getDefaultConfig(__dirname), {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
getTransformOptions: async () => ({
Expand All @@ -23,3 +26,12 @@ module.exports = mergeConfig(getDefaultConfig(__dirname), {
sourceExts: [...defaultSourceExts, 'svg'],
},
});

config.watchFolders = [workspaceRoot];
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(workspaceRoot, 'node_modules'),
];
config.resolver.disableHierarchicalLookup = true;

module.exports = config;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "friends",
"name": "friends-react-native",
"version": "0.0.1",
"private": true,
"scripts": {
Expand Down Expand Up @@ -33,6 +33,7 @@
"@react-native/eslint-config": "^0.72.2",
"@react-native/metro-config": "^0.72.6",
"@tsconfig/react-native": "^3.0.0",
"@types/jest": "^29.5.4",
"@types/metro-config": "^0.76.3",
"@types/react": "^18.0.24",
"@types/react-native-dotenv": "^0.2.0",
Expand All @@ -48,6 +49,8 @@
"react-native-svg-transformer": "^1.1.0",
"react-test-renderer": "18.2.0",
"serve": "^14.2.1",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"engines": {
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { FriendRepository } from '../repositories/friendRepository';
import { createFriendService } from './createFriendService';

describe('createFriendService', () => {
const friendService = createFriendService({ repositories: [{} as FriendRepository] });
it('isValidDisplayName', () => {
expect(friendService.isValidDisplayName('asdf1234')).toBe(true);
});
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions friends/jest.config.js

This file was deleted.

17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "snutt-frontend",
"private": true,
"license": "MIT",
"author": "woohm402 <[email protected]>",
"scripts": {
"lint": "turbo run lint",
"test": "turbo run test",
"tsc": "turbo run tsc"
},
"dependencies": {
"turbo": "^1.10.12"
},
"workspaces": [
"apps/*"
]
}
9 changes: 9 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {},
"lint": {},
"tsc": {},
"test": {}
}
}
Loading

0 comments on commit 4091261

Please sign in to comment.