Fakultas Ilmu Komputer UI

Commit dbeda4a4 authored by Wulan Mantiri's avatar Wulan Mantiri
Browse files

Merge branch 'PBI-1-setup_project_structure' into 'staging'

Setup project structure and configurations

See merge request !1
parents e79d7a0f ef6dfdce
Pipeline #64698 passed with stages
in 26 minutes and 9 seconds
{
"root": true,
"extends": "@react-native-community"
}
module.exports = {
root: true,
extends: '@react-native-community',
};
......@@ -61,3 +61,5 @@ buck-out/
# CocoaPods
/ios/Pods/
coverage/
......@@ -16,7 +16,7 @@ test:
before_script:
- yarn install
script:
- yarn test -- --coverage --watchAll=false --verbose --collectCoverageFrom="*.tsx"
- yarn test --coverage --watchAll=false --verbose --collectCoverageFrom="src/**/*.tsx"
build:
stage: build
......@@ -26,10 +26,14 @@ build:
script:
- cd android
- chmod +x gradlew && ./gradlew assembleRelease
- cd .. && cp android/app/build/outputs/apk/release/app-release.apk $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME"
paths:
- android/app/build/outputs/apk/release/app-release.apk
- $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
except:
changes:
- "README.md"
only:
- staging
- master
{
"bracketSpacing": true,
"endOfLine": "auto",
"jsxBracketSameLine": true,
"printWidth": 80,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* Generated with the TypeScript template
* https://github.com/react-native-community/react-native-template-typescript
*
* @format
*/
import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';
import {
Header,
LearnMoreLinks,
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
declare const global: {HermesInternal: null | {}};
const App = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Hello World</Text>
<Text style={styles.sectionDescription}>
kelompok we fall in love with PPL we cant have
</Text>
</View>
</View>
</ScrollView>
</SafeAreaView>
</>
);
};
const styles = StyleSheet.create({
scrollView: {
backgroundColor: Colors.lighter,
},
engine: {
position: 'absolute',
right: 0,
},
body: {
backgroundColor: Colors.white,
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
color: Colors.black,
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
color: Colors.dark,
},
highlight: {
fontWeight: '700',
},
footer: {
color: Colors.dark,
fontSize: 12,
fontWeight: '600',
padding: 4,
paddingRight: 12,
textAlign: 'right',
},
});
export default App;
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
root: ['./src'],
extensions: [
'.ios.ts',
'.android.ts',
'.ts',
'.ios.tsx',
'.android.tsx',
'.tsx',
'.jsx',
'.js',
'.json',
],
alias: {
'(.*)': './src/\\1',
},
},
],
],
};
/**
* @format
*/
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import { AppRegistry } from 'react-native';
import App from './src/app';
import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);
......@@ -7,11 +7,19 @@
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
"lint": "eslint . --ext .ts,.tsx --fix",
"prettify": "prettier --write src"
},
"dependencies": {
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
"react": "16.13.1",
"react-native": "0.63.4"
"react-native": "0.63.4",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^2.0.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^2.18.1"
},
"devDependencies": {
"@babel/core": "^7.8.4",
......@@ -21,9 +29,14 @@
"@types/react-native": "^0.63.2",
"@types/react-test-renderer": "^16.9.2",
"babel-jest": "^25.1.0",
"babel-plugin-module-resolver": "^4.0.0",
"eslint": "^6.5.1",
"husky": "^5.1.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^25.1.0",
"lint-staged": "^10.5.4",
"metro-react-native-babel-preset": "^0.59.0",
"prettier": "^2.2.1",
"react-test-renderer": "16.13.1",
"typescript": "^3.8.3"
},
......@@ -39,6 +52,23 @@
"jsx",
"json",
"node"
],
"moduleNameMapper": {
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "identity-obj-proxy"
},
"setupFiles": [
"./node_modules/react-native-gesture-handler/jestSetup.js"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,tsx}": [
"yarn run lint",
"yarn run prettify"
]
}
}
/**
* @format
*/
import 'react-native';
import React from 'react';
import App from '../App';
import App from '.';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
......
import React, { FC } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import * as ROUTES from 'constants/routes';
import { navigation } from 'constants/navigation';
const Stack = createStackNavigator();
const App: FC = () => {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName={ROUTES.home}>
{navigation.map(({ name, component }, i) => (
<Stack.Screen name={name} component={component} key={i} />
))}
</Stack.Navigator>
</NavigationContainer>
);
};
export default App;
import * as ROUTES from 'constants/routes';
import { HomePage } from 'scenes';
export const navigation = [
{
name: ROUTES.home,
component: HomePage,
},
];
export const home = 'home';
import React, { FC } from 'react';
import { View, Text } from 'react-native';
import { styles } from './styles';
const HomePage: FC = () => (
<View style={styles.view}>
<Text>Hello World</Text>
</View>
);
export default HomePage;
import { StyleSheet } from 'react-native';
export const styles = StyleSheet.create({
view: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});
export { default as HomePage } from './common/HomePage';
{
"compilerOptions": {
/* Basic Options */
......@@ -37,8 +36,10 @@
/* Module Resolution Options */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
"baseUrl": "./src", /* Base directory to resolve non-absolute module names. */
"paths": {
"(.*)": ["./\\1"]
},
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment