Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Dec 23, 2024
0 parents commit a66291e
Show file tree
Hide file tree
Showing 68 changed files with 20,654 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .cpk/expo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* cpk-cli by hyochan
* Do not delete this folder and files if you are using cpk-cli
* https://www.npmjs.com/package/cpk
*/
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ROOT_URL=
expoProjectId=
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/*.js
# **/*/__tests__/**/*
node_modules/
assets/langs/ios/

# types
*.d.ts
30 changes: 30 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const path = require('path');

module.exports = {
root: true,
extends: ['expo', 'prettier', 'plugin:i18n-json/recommended'],
plugins: ['prettier'],
rules: {
'eslint-comments/no-unlimited-disable': 0,
'eslint-comments/no-unused-disable': 0,
'i18n-json/identical-keys': [
2,
{
filePath: path.resolve('./assets/langs/ko.json'),
},
],
'i18n-json/sorted-keys': [
2,
{
order: 'asc',
indentSpaces: 2,
},
],
'i18n-json/valid-message-syntax': [
2,
{
syntax: path.resolve('./custom-syntax-validator.ts'),
},
],
},
};
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install modules
run: bun install --immutable

- name: Check linting
run: bun lint:all

- name: Build typescript
run: bun tsc

- name: Remove dist
run: rm -rf ./dist

- name: Test
run: bun run test --coverage --silent

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# directory: ./coverage/
# flags: unittests
# name: codecov-umbrella
# fail_ci_if_error: false
# path_to_write_report: ./coverage/codecov_report.gz
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy Web on Release
on:
workflow_dispatch:
release:
types: [created]

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- uses: expo/expo-github-action@v8
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: Install modules
run: bun install --immutable

- name: Build web
run: bun build:web
env:
ROOT_URL: ${{ secrets.ROOT_URL }}
expoProjectId: ${{ secrets.expoProjectId }}
84 changes: 84 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifacts
*.jsbundle

# CocoaPods
/ios/Pods/

# Expo
.expo/*
web-build/

# Yarn
.yarn/*
!.yarn/releases

.env*
!.env.sample
.jest

# Android
/android

# iOS
/ios

# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# The following patterns were generated by expo-cli

expo-env.d.ts
# @end expo-cli
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx commitlint --edit $1
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

bun lint:ci
bun lint:i18n
6 changes: 6 additions & 0 deletions .ncurc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"reject": [
"typescript",
"eslint"
]
}
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
.expo
.git
npm-debug.log
package-lock.json
.DS_Store
ios
android
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// prettier.config.js or .prettierrc.js
module.exports = {
trailingComma: 'all',
arrowParens: 'always',
singleQuote: true,
jsxSingleQuote: false,
bracketSpacing: false,
};
32 changes: 32 additions & 0 deletions .vscode/cpk.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"CPK React Native Component": {
"prefix": "cpk",
"body": [
"/**",
" * @name $1",
" *",
" * See the style guide: https://github.com/hyochan/style-guide/blob/main/docs/REACT.md",
" */",
"import styled from '@emotion/native';",
"import {View} from 'react-native';",
"",
"type Props = {}",
"",
"function $1({}: Props): JSX.Element {",
"",
" return (",
" <Container>",
" <View></View>",
" </Container>",
" )",
"}",
"",
"export default $1",
"",
"const Container = styled.View`",
" flex: 1;",
"`"
],
"description": "React Native Component"
}
}
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"recommendations": [
"formulahendry.auto-rename-tag",
"aaron-bond.better-comments",
"vscode-icons-team.vscode-icons",
"streetsidesoftware.code-spell-checker",
"wix.vscode-import-cost",
"styled-components.vscode-styled-components",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
]
}
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to packager",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "attach"
}
]
}

46 changes: 46 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"eslint.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"javascript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.importModuleSpecifier": "relative",
"prettier.configPath": ".prettierrc.js",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true,
},
"cSpell.words": [
"cpk",
"crossplatformkorea",
"hyochan",
"Pressable",
"Pretendard"
]
}
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Expo Template CPK

[![CI](https://github.com/crossplatformkorea/expo-template-cpk/actions/workflows/ci.yml/badge.svg)](https://github.com/crossplatformkorea/expo-template-cpk/actions/workflows/ci.yml)

크로스플랫폼 코리아에서 관리하는 [Expo](https://expo.io) 프로젝트 템플릿입니다.

## 사용 방법

```bash
npx create-expo-app my-app --template expo-template-cpk
```

## 사용된 스택

- [react-native](https://github.com/facebook/react-native)
- [expo-router](https://expo.github.io/router)
- [emotion](https://emotion.sh)
- [dooboo-ui](https://github.com/dooboolab/dooboo-ui)
- [jest](https://github.com/facebook/jest)
- [react-native-testing-library](https://github.com/callstack/react-native-testing-library)
- [typescript](https://github.com/Microsoft/TypeScript)
- [ts-jest](https://github.com/kulshekhar/ts-jest)
- [prettier](https://prettier.io)
- [react-native-web](https://github.com/necolas/react-native-web)
- [expo-localization](https://docs.expo.dev/versions/latest/sdk/localization)

## 주요 소식

- 기본적으로 [dooboo-ui](https://github.com/dooboolab/dooboo-ui), [Expo](https://expo.io)를 위한 UI 프레임워크가 프로젝트에 사전 설치되어 있습니다. 마음에 드시길 바랍니다 🧡.
- 2023년 가장 빠른 패키지 매니저인 [bun](https://bun.sh)이 기본 패키지 매니저로 설정되어 있습니다.
3 changes: 3 additions & 0 deletions __mocks__/expo-asset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
loadSingleFontAsync: jest.fn(),
};
3 changes: 3 additions & 0 deletions __mocks__/sentry-expo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const Native = {
captureException: jest.fn(),
};
Loading

0 comments on commit a66291e

Please sign in to comment.