Skip to content

Commit

Permalink
Merge pull request #30 from OpenNative/feat/update-workspace
Browse files Browse the repository at this point in the history
feat: workspace updates
  • Loading branch information
ammarahm-ed authored Jul 21, 2024
2 parents 1a2cb62 + 32655bf commit 1e71c23
Show file tree
Hide file tree
Showing 38 changed files with 5,721 additions and 6,287 deletions.
18 changes: 12 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -23,13 +23,19 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nrwl/nx/typescript"],
"rules": {}
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nx/typescript"],
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
"extends": ["plugin:@nx/javascript"],
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["references.d.ts"],
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ npm-debug.log
yarn-error.log
testem.log
/typings
.nx

# System Files
.DS_Store
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
/dist
/coverage
native-src

/.nx/workspace-data
/.nx/cache
2 changes: 1 addition & 1 deletion apps/demo-react-native/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"plugins": ["simple-import-sort"],
"ignorePatterns": ["!**/*", "public", ".cache", "node_modules"],
"overrides": [
Expand Down
13 changes: 5 additions & 8 deletions apps/demo-react-native/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"build-android": {
"executor": "@nrwl/react-native:build-android",
"outputs": [
"apps/demo-react-native/android/app/build/outputs/bundle",
"apps/demo-react-native/android/app/build/outputs/apk"
"{projectRoot}/android/app/build/outputs/bundle",
"{projectRoot}/android/app/build/outputs/apk"
],
"options": {}
},
Expand All @@ -23,7 +23,7 @@
},
"bundle-ios": {
"executor": "@nrwl/react-native:bundle",
"outputs": ["apps/demo-react-native/build"],
"outputs": ["{projectRoot}/build"],
"options": {
"entryFile": "apps/demo-react-native/index.js",
"platform": "ios",
Expand All @@ -39,10 +39,7 @@
"options": {}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/demo-react-native/**/*.{js,ts,tsx}"]
}
"executor": "@nx/eslint:lint"
},
"start": {
"executor": "@nrwl/react-native:start",
Expand All @@ -51,7 +48,7 @@
}
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "apps/demo-react-native/jest.config.js",
"passWithNoTests": true
Expand Down
1 change: 1 addition & 0 deletions apps/demo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ npm-debug.log
# app
!*.d.ts
!src/assets/fontawesome.min.css
!tailwind.config.js
/report/
.nsbuildinfo
/temp/
Expand Down
7 changes: 4 additions & 3 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
"react-native-module-test": "file:../../packages/react-native-module-test"
},
"devDependencies": {
"@nativescript/android": "^8.8.0-alpha.5",
"@nativescript/ios": "~8.7.0",
"@rigor789/resolve-package-path": "1.0.5",
"@nativescript/android": "~8.8.0",
"@nativescript/ios": "~8.8.0",
"@nativescript/tailwind": "^2.1.0",
"@rigor789/resolve-package-path": "1.0.7",
"metro-react-native-babel-preset": "file:../../node_modules/metro-react-native-babel-preset"
},
"scripts": {
Expand Down
11 changes: 4 additions & 7 deletions apps/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependsOn": [
{
"target": "build.all",
"projects": "dependencies"
"dependencies": true
}
]
},
Expand All @@ -29,7 +29,7 @@
"dependsOn": [
{
"target": "build.all",
"projects": "dependencies"
"dependencies": true
}
]
},
Expand All @@ -41,7 +41,7 @@
"dependsOn": [
{
"target": "build.all",
"projects": "dependencies"
"dependencies": true
}
]
},
Expand All @@ -52,10 +52,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/demo/**/*.ts"]
}
"executor": "@nx/eslint:lint"
}
}
}
3 changes: 3 additions & 0 deletions apps/demo/src/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
2 changes: 0 additions & 2 deletions apps/demo/src/app.scss

This file was deleted.

8 changes: 4 additions & 4 deletions apps/demo/src/main-page.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo">
<Page.actionBar>
<ActionBar title="Open Native" icon="" class="action-bar"/>
<ActionBar title="Open Native" icon="" />
</Page.actionBar>
<StackLayout class="p-20">
<StackLayout class="p-6">
<ScrollView class="h-full">
<StackLayout>
<Button text="core" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
<Button text="core" tap="{{ viewDemo }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
</StackLayout>
</ScrollView>
</StackLayout>
Expand Down
16 changes: 8 additions & 8 deletions apps/demo/src/plugin-demos/core.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:ui="./view" navigatingTo="navigatingTo" class="page">
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:ui="./view" navigatingTo="navigatingTo">
<Page.actionBar>
<ActionBar title="React Native Modules" icon="" class="action-bar">
<ActionBar title="React Native Modules" icon="">
</ActionBar>
</Page.actionBar>

<StackLayout>
<Button text="Test Primitives" tap="{{ testPrimitives }}" class="btn btn-primary"/>
<Button text="Test Promise" tap="{{ testPromise }}" class="btn btn-primary"/>
<Button text="Test Callback" tap="{{ testCallback }}" class="btn btn-primary"/>
<ui:ModuleTestView style="width:100%;height:200px;background-color:#f0f0f0;">
<Label text="I am a RN view with children" />
<StackLayout class="p-6">
<Button text="Test Primitives" tap="{{ testPrimitives }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
<Button text="Test Promise" tap="{{ testPromise }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
<Button text="Test Callback" tap="{{ testCallback }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>
<ui:ModuleTestView class="w-full h-[100] bg-gray-300 p-2">
<Label text="I am a RN view with children" class="text-xl" />
</ui:ModuleTestView>
</StackLayout>
</Page>
8 changes: 4 additions & 4 deletions apps/demo/src/plugin-demos/react-native-module-test.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo">
<Page.actionBar>
<ActionBar title="react-native-module-test" icon="" class="action-bar">
<ActionBar title="react-native-module-test" icon="">
</ActionBar>
</Page.actionBar>
<StackLayout class="p-20">
<StackLayout class="p-6">
<ScrollView class="h-full">
<StackLayout>
<Button text="Test react-native-module-test" tap="{{ testIt }}" class="btn btn-primary"/>
<Button text="Test react-native-module-test" tap="{{ testIt }}" class="bg-blue-500 rounded-full text-white p-4 mb-4"/>

</StackLayout>
</ScrollView>
Expand Down
13 changes: 13 additions & 0 deletions apps/demo/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{css,xml,html,vue,svelte,ts,tsx}'],
// use the .ns-dark class to control dark mode (applied by NativeScript) - since 'media' (default) is not supported.
darkMode: ['class', '.ns-dark'],
theme: {
extend: {},
},
plugins: [],
corePlugins: {
preflight: false, // disables browser-specific resets
},
};
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { getJestProjects } = require('@nrwl/jest');
const { getJestProjects } = require('@nx/jest');

export default { projects: [...getJestProjects()] };
50 changes: 30 additions & 20 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
{
"npmScope": "open-native",
"affected": {
"defaultBase": "master"
},
"implicitDependencies": {
"workspace.json": "*",
"package.json": {
"dependencies": "*",
"devDependencies": "*"
},
"tsconfig.base.json": "*",
"tslint.json": "*",
"nx.json": "*"
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.base.json", "{workspaceRoot}/tslint.json", "{workspaceRoot}/nx.json"],
"production": ["default", "!{projectRoot}/.eslintrc.json", "!{projectRoot}/src/test-setup.[jt]s"]
},
"workspaceLayout": {
"appsDir": "apps",
"libsDir": "packages"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "build.all", "build.hooks", "lint", "test", "e2e"],
"runtimeCacheInputs": ["node -v"],
"parallel": 1,
"useDaemonProcess": false
"runtimeCacheInputs": ["node -v"]
}
}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json"
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"useDaemonProcess": false,
"parallel": 1,
"targetDefaults": {
"build": {
"cache": true
},
"build.all": {
"cache": true
},
"build.hooks": {
"cache": true
},
"lint": {
"cache": true
},
"test": {
"cache": true
},
"e2e": {
"cache": true
}
},
"defaultBase": "master"
}
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,41 @@
},
"private": true,
"dependencies": {
"react": "^17.0.2",
"react-native": "^0.67.5",
"react": "^18.0.2",
"react-native": "^0.74.0",
"tslib": "^2.6.0"
},
"devDependencies": {
"@babel/core": "^7.18.13",
"@babel/plugin-proposal-decorators": "^7.22.7",
"@babel/plugin-syntax-decorators": "^7.22.5",
"@babel/runtime": "^7.18.9",
"@nativescript/core": "^8.7.3-next-04-24-2024-8819749399",
"@nativescript/plugin-tools": "5.1.0",
"@nativescript/types": "~8.5.0",
"@nativescript/webpack": "5.0.21",
"@nrwl/react-native": "15.8.1",
"@react-native-community/eslint-config": "^3.1.0",
"@rigor789/resolve-package-path": "1.0.5",
"@types/glob": "^8.0.0",
"@nativescript/core": "~8.8.0",
"@nativescript/plugin-tools": "5.3.0",
"@nativescript/tailwind": "^2.1.0",
"@nativescript/types": "~8.8.0",
"@nativescript/webpack": "~5.0.22",
"@nx/react-native": "^19.0.0",
"@react-native-community/eslint-config": "^3.2.0",
"@rigor789/resolve-package-path": "1.0.7",
"@types/jest": "~29.5.0",
"@types/react-native": "^0.67.8",
"@types/react-test-renderer": "^17.0.1",
"@types/react-native": "^0.73.0",
"@types/react-test-renderer": "^18.3.0",
"babel-jest": "^27.4.6",
"eslint": "^8.23.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"glob": "^8.0.3",
"husky": "^8.0.0",
"glob": "^10.0.0",
"husky": "~9.1.0",
"jest": "29.6.2",
"metro-react-native-babel-preset": "^0.67.0",
"nativescript-vue": "~2.9.0",
"nativescript-vue-template-compiler": "~2.9.0",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"react-test-renderer": "^17.0.2",
"react-test-renderer": "^18.3.1",
"rxjs": "~7.8.0",
"typescript": "~4.8.0",
"zone.js": "~0.13.0"
"tailwindcss": "~3.4.0",
"typescript": "~5.5.0",
"zone.js": "~0.14.0"
},
"lint-staged": {
"**/*.{js,ts,scss,json,html}": [
Expand Down
Loading

0 comments on commit 1e71c23

Please sign in to comment.