-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add nx workspace and color application
- Loading branch information
Vadim Subbotin
committed
Aug 8, 2024
1 parent
ab69673
commit 7725d96
Showing
44 changed files
with
26,467 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Editor configuration, see http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"root": true, | ||
"ignorePatterns": ["**/*"], | ||
"plugins": ["@nx"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": { | ||
"@nx/enforce-module-boundaries": [ | ||
"error", | ||
{ | ||
"enforceBuildableLibDependency": true, | ||
"allow": [], | ||
"depConstraints": [ | ||
{ | ||
"sourceTag": "*", | ||
"onlyDependOnLibsWithTags": ["*"] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"extends": ["plugin:@nx/typescript"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"extends": ["plugin:@nx/javascript"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# This enables task distribution via Nx Cloud | ||
# Run this command as early as possible, before dependencies are installed | ||
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun | ||
- run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" | ||
|
||
# Cache node_modules | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
|
||
- run: npm ci --legacy-peer-deps | ||
- uses: nrwl/nx-set-shas@v4 | ||
|
||
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud | ||
# - run: npx nx-cloud record -- echo Hello World | ||
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected | ||
- run: npx nx affected -t lint test build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# compiled output | ||
dist | ||
tmp | ||
/out-tsc | ||
|
||
# dependencies | ||
node_modules | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
|
||
# misc | ||
/.sass-cache | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
npm-debug.log | ||
yarn-error.log | ||
testem.log | ||
/typings | ||
|
||
# System Files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
.nx/cache | ||
.nx/workspace-data | ||
|
||
# Expo | ||
node_modules/ | ||
.expo/ | ||
.yarn/ | ||
dist/ | ||
npm-debug.* | ||
*.jks | ||
*.p8 | ||
*.p12 | ||
*.key | ||
*.mobileprovision | ||
*.orig.* | ||
web-build/ | ||
cache/ | ||
|
||
|
||
apps/color-e2e/artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Add files here to ignore them from prettier formatting | ||
/dist | ||
/coverage | ||
/.nx/cache | ||
/.nx/workspace-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"recommendations": [ | ||
"nrwl.angular-console", | ||
"esbenp.prettier-vscode", | ||
"firsttris.vscode-jest-runner" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Install dependencies | ||
|
||
Run `npm install` | ||
|
||
## Start the Color application | ||
|
||
Run `npx nx serve color` for starting dev server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@nx/react/babel", | ||
{ | ||
"runtime": "automatic" | ||
} | ||
] | ||
], | ||
"plugins": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"testRunner": { | ||
"args": { | ||
"$0": "jest", | ||
"config": "./jest.config.json" | ||
}, | ||
"jest": { | ||
"setupTimeout": 120000 | ||
} | ||
}, | ||
"apps": { | ||
"ios.debug": { | ||
"type": "ios.app", | ||
"build": "cd ../../apps/color/ios && xcodebuild -workspace Color.xcworkspace -scheme Color -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ./build -quiet", | ||
"binaryPath": "../../apps/color/ios/build/Build/Products/Debug-iphonesimulator/Color.app" | ||
}, | ||
"ios.release": { | ||
"type": "ios.app", | ||
"build": "cd ../../apps/color/ios && xcodebuild -workspace Color.xcworkspace -scheme Color -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ./build -quiet", | ||
"binaryPath": "../../apps/color/ios/build/Build/Products/Release-iphonesimulator/Color.app" | ||
}, | ||
|
||
"ios.local": { | ||
"type": "ios.app", | ||
"build": "npx nx run color:build --platform ios --profile preview --wait --local --no-interactive --output=../../apps/color/dist/Color.tar.gz", | ||
"binaryPath": "../../apps/color/dist/Color.app" | ||
}, | ||
|
||
"android.debug": { | ||
"type": "android.apk", | ||
"build": "cd ../../apps/color/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug", | ||
"binaryPath": "../../apps/color/android/app/build/outputs/apk/debug/app-debug.apk" | ||
}, | ||
"android.release": { | ||
"type": "android.apk", | ||
"build": "cd ../../apps/color/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release", | ||
"binaryPath": "../../apps/color/android/app/build/outputs/apk/release/app-release.apk" | ||
}, | ||
|
||
"android.local": { | ||
"type": "android.apk", | ||
"build": "npx nx run color:build --platform android --profile preview --wait --local --no-interactive --output=../../apps/color/dist/Color.apk", | ||
"binaryPath": "../../apps/color/dist/Color.apk" | ||
} | ||
}, | ||
"devices": { | ||
"simulator": { | ||
"type": "ios.simulator", | ||
"device": { | ||
"type": "iPhone 14" | ||
} | ||
}, | ||
"emulator": { | ||
"type": "android.emulator", | ||
"device": { | ||
"avdName": "Pixel_4a_API_30" | ||
} | ||
} | ||
}, | ||
"configurations": { | ||
"ios.sim.release": { | ||
"device": "simulator", | ||
"app": "ios.release" | ||
}, | ||
"ios.sim.debug": { | ||
"device": "simulator", | ||
"app": "ios.debug" | ||
}, | ||
|
||
"ios.sim.local": { | ||
"device": "simulator", | ||
"app": "ios.local" | ||
}, | ||
|
||
"android.emu.release": { | ||
"device": "emulator", | ||
"app": "android.release" | ||
}, | ||
"android.emu.debug": { | ||
"device": "emulator", | ||
"app": "android.debug" | ||
}, | ||
|
||
"android.emu.local": { | ||
"device": "emulator", | ||
"app": "android.local" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": ["plugin:@nx/react", "../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"preset": "../../jest.preset", | ||
"rootDir": ".", | ||
"testMatch": [ | ||
"<rootDir>/src/**/*.test.ts?(x)", | ||
"<rootDir>/src/**/*.spec.ts?(x)" | ||
], | ||
"testTimeout": 120000, | ||
"maxWorkers": 1, | ||
"globalSetup": "detox/runners/jest/globalSetup", | ||
"globalTeardown": "detox/runners/jest/globalTeardown", | ||
"reporters": ["detox/runners/jest/reporter"], | ||
"testEnvironment": "detox/runners/jest/testEnvironment", | ||
"verbose": true, | ||
"setupFilesAfterEnv": ["<rootDir>/test-setup.ts"], | ||
"transform": { | ||
"^.+\\.(ts|js|html)$": [ | ||
"ts-jest", | ||
{ "tsconfig": "<rootDir>/tsconfig.e2e.json" } | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "color-e2e", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "apps/color-e2e/src", | ||
"projectType": "application", | ||
"tags": [], | ||
"implicitDependencies": ["color"], | ||
"// targets": "to see all targets run: nx show project color-e2e --web", | ||
"targets": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { device, element, by, expect } from 'detox'; | ||
|
||
describe('Color', () => { | ||
beforeEach(async () => { | ||
await device.reloadReactNative(); | ||
}); | ||
|
||
it('should display welcome message', async () => { | ||
await expect(element(by.id('heading'))).toHaveText('Welcome Color 👋'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { device } from 'detox'; | ||
|
||
beforeAll(async () => { | ||
await device.launchApp(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"sourceMap": false, | ||
"outDir": "../../dist/out-tsc", | ||
"allowJs": true, | ||
"types": ["node", "jest", "detox"] | ||
}, | ||
"include": ["src/**/*.ts", "src/**/*.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.e2e.json" | ||
} | ||
] | ||
} |
Oops, something went wrong.