Skip to content

Commit

Permalink
refactor: monorepo + upgrade core dependencies (#291)
Browse files Browse the repository at this point in the history
* - refactor: monorepo

* fix package

* revert to eslint/prettier

* formatting

* formatting

* formatting

* fix eslint

* formatting

* fixes

* fixes

* fixes

* update packagelock

---------

Co-authored-by: paulclindo <[email protected]>
  • Loading branch information
agallardol and paulclindo authored Jun 12, 2024
1 parent a3f2937 commit c296775
Show file tree
Hide file tree
Showing 196 changed files with 28,671 additions and 14,300 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/node_modules
**/dist
**/android
**/ios
**/ios
16 changes: 13 additions & 3 deletions apps/shinkai-app-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"extends": [
"plugin:cypress/recommended",
"../../.eslintrc.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
}
]
Expand Down
16 changes: 11 additions & 5 deletions apps/shinkai-app-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/shinkai-app-e2e/src",
"projectType": "application",
"tags": [],
"implicitDependencies": [
"shinkai-app"
],
"targets": {
"e2e": {
"executor": "@nx/cypress:cypress",
Expand All @@ -22,12 +26,14 @@
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"outputs": [
"{options.outputFile}"
],
"options": {
"lintFilePatterns": ["apps/shinkai-app-e2e/**/*.{js,ts}"]
"lintFilePatterns": [
"apps/shinkai-app-e2e/**/*.{js,ts}"
]
}
}
},
"tags": [],
"implicitDependencies": ["shinkai-app"]
}
}
5 changes: 4 additions & 1 deletion apps/shinkai-app-e2e/src/e2e/connect.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ describe('shinkai-app', () => {

it('should display app description', () => {
// Function helper example, see `../support/app.po.ts` file
getDescription().should('have.text', 'AI AGENT OS THAT UNLOCKS THE POTENTIAL OF LLMs');
getDescription().should(
'have.text',
'AI AGENT OS THAT UNLOCKS THE POTENTIAL OF LLMs',
);
});
});
3 changes: 1 addition & 2 deletions apps/shinkai-app-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@

// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
getDataCy(...args: Parameters<typeof cy.get>): ReturnType<typeof cy.get>;
}
}
//
// -- This is a parent command --
Cypress.Commands.add('getDataCy', (selector, ...args) => {
return cy.get(`[data-cy=${selector}]`, ...args)
return cy.get(`[data-cy=${selector}]`, ...args);
});
//
// -- This is a child command --
Expand Down
26 changes: 21 additions & 5 deletions apps/shinkai-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
{
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"extends": [
"plugin:@nx/react",
"../../.eslintrc.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
Expand Down
1 change: 1 addition & 0 deletions apps/shinkai-app/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.17
2 changes: 1 addition & 1 deletion apps/shinkai-app/capacitor.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const config: CapacitorConfig = {
androidScheme: 'https',
url: process.env.SERVE ? 'http://10.0.2.2:9000' : undefined,
cleartext: process.env.SERVE ? true : false,
}
},
};

export default config;
116 changes: 115 additions & 1 deletion apps/shinkai-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,122 @@
"private": true,
"version": "0.0.1",
"type": "module",
"description": "Shinkai Multiplatform App",
"scripts": {
"start": "npm run dev",
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"serve:android": "SERVE=true npx cap run android"
},
"dependencies": {
"@capacitor-community/barcode-scanner": "^4.0.1",
"@capacitor/android": "^5.5.0",
"@capacitor/app": "5.0.6",
"@capacitor/camera": "^5.0.6",
"@capacitor/core": "^5.2.2",
"@capacitor/haptics": "5.0.6",
"@capacitor/ios": "^5.5.0",
"@capacitor/keyboard": "5.0.6",
"@capacitor/status-bar": "5.0.6",
"@hookform/error-message": "^2.0.1",
"@hookform/resolvers": "^3.3.1",
"@ionic/react": "^7.0.0",
"@ionic/react-router": "^7.0.0",
"@lottiefiles/react-lottie-player": "^3.5.3",
"@noble/ed25519": "^2.0.0",
"@noble/hashes": "^1.3.1",
"@tanstack/react-query": "^5.37.1",
"@tanstack/react-query-devtools": "^5.37.1",
"@uidotdev/usehooks": "^2.2.0",
"@uiw/react-markdown-preview": "^4.1.16",
"@yudiel/react-qr-scanner": "^1.1.10",
"@zxing/browser": "^0.1.4",
"clsx": "^2.1.1",
"ionicons": "^7.0.0",
"jsbi": "^4.3.0",
"lucide-react": "^0.323.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.47.0",
"react-router-dom": "^5.3.3",
"sonner": "^1.4.41",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.22.2",
"zustand": "^4.4.2"
},
"devDependencies": {
"@babel/cli": "^7.22.10",
"@babel/core": "^7.14.5",
"@babel/plugin-syntax-bigint": "^7.8.3",
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.14.5",
"@capacitor/cli": "^5.5.0",
"@crxjs/vite-plugin": "^2.0.0-beta.18",
"@estruyf/github-actions-reporter": "^1.4.0",
"@noble/ed25519": "^2.0.0",
"@noble/hashes": "^1.3.2",
"@peculiar/webcrypto": "^1.4.3",
"@playwright/test": "^1.40.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@rollup/plugin-url": "^7.0.0",
"@tailwindcss/typography": "^0.5.10",
"@tauri-apps/cli": "^1.5.11",
"@testing-library/jest-dom": "^6.1.2",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.5.4",
"@types/libsodium-wrappers-sumo": "^0.7.7",
"@types/node": "18.14.2",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@vitejs/plugin-legacy": "^4.1.1",
"@vitejs/plugin-react": "~4.0.0",
"@vitest/coverage-c8": "~0.32.0",
"@vitest/ui": "~0.32.0",
"autoprefixer": "^10.4.16",
"babel-jest": "^29.4.1",
"babel-plugin-transform-bigint-to-jsbi": "^1.0.3",
"capacitor-set-version": "^2.2.0",
"curve25519-js": "^0.0.4",
"cypress": "^13.1.0",
"date-fns": "^3.6.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-cypress": "^2.13.4",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-perfectionist": "^2.1.0",
"eslint-plugin-playwright": "^0.15.3",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unicorn": "^48.0.1",
"jest": "^29.6.4",
"jest-environment-jsdom": "^29.4.1",
"jest-environment-node": "^29.4.1",
"jsdom": "^22.1.0",
"lodash": "^4.17.21",
"patch-package": "^8.0.0",
"postcss": "^8.4.31",
"prettier": "^3.1.0",
"tailwindcss": "^3.3.3",
"ts-jest": "^29.1.0",
"typescript": "^5.3.2",
"url-loader": "^4.1.1",
"vite": "^4.5.2",
"vite-plugin-dts": "^2.3.0",
"vite-plugin-top-level-await": "^1.3.1",
"vite-plugin-wasm": "^3.2.2",
"vite-tsconfig-paths": "^4.2.3",
"vitest": "^0.34.3",
"zip-lib": "^1.0.4"
},
"engines": {
"node": "18",
"npm": "9"
}
}
99 changes: 19 additions & 80 deletions apps/shinkai-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,35 @@
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/apps/shinkai-app"
},
"configurations": {
"development": {
"mode": "development"
},
"production": {
"mode": "production"
}
}
"command": "cd apps/shinkai-app && npx tsc && npx vite build"
},
"build:ios": {
"executor": "nx:run-commands",
"defaultConfiguration": "production",
"options": {
"commands": [
"npx nx build shinkai-app",
"cd apps/shinkai-app && npx cap sync ios",
"cd apps/shinkai-app && npx cap build ios"
],
"parallel": false
},
"commands": [
"npx nx build shinkai-app",
"cd apps/shinkai-app && npx cap sync ios",
"cd apps/shinkai-app && npx cap build ios"
],
"configurations": {
"development": {},
"production": {}
}
},
"build:android": {
"executor": "nx:run-commands",
"defaultConfiguration": "production",
"options": {
"commands": [
"npx nx build shinkai-app",
"cd apps/shinkai-app && npx cap sync android",
"cd apps/shinkai-app && npx cap build android --keystorepath=$ANDROID_KEYSTORE_FILE_PATH --keystorepass=$ANDROID_KEYSTORE_PASS --keystorealias=$ANDROID_KEYSTORE_ALIAS --keystorealiaspass=$ANDROID_KEYSTORE_ALIAS_PASS",
"cp -r ./apps/shinkai-app/android/app/build/outputs/bundle/release/ ./dist/apps/shinkai-app-android"
],
"parallel": false
},
"commands": [
"npx nx build shinkai-app",
"cd apps/shinkai-app && npx cap sync android",
"cd apps/shinkai-app && npx cap build android --keystorepath=$ANDROID_KEYSTORE_FILE_PATH --keystorepass=$ANDROID_KEYSTORE_PASS --keystorealias=$ANDROID_KEYSTORE_ALIAS --keystorealiaspass=$ANDROID_KEYSTORE_ALIAS_PASS",
"cp -r ./apps/shinkai-app/android/app/build/outputs/bundle/release/ ./dist/apps/shinkai-app-android"
],
"configurations": {
"development": {},
"production": {}
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "shinkai-app:build",
"port": 9000
},
"configurations": {
"development": {
"buildTarget": "shinkai-app:build:development",
"hmr": true
},
"production": {
"buildTarget": "shinkai-app:build:production",
"hmr": false
}
}
"command": "cd apps/shinkai-app && npx vite"
},
"serve:android": {
"executor": "nx:run-script",
Expand All @@ -83,40 +47,15 @@
"production": {}
}
},
"preview": {
"executor": "@nx/vite:preview-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "shinkai-app:build"
},
"configurations": {
"development": {
"buildTarget": "shinkai-app:build:development"
},
"production": {
"buildTarget": "shinkai-app:build:production"
}
}
},
"test": {
"executor": "@nx/vite:test",
"outputs": ["{options.reportsDirectory}"],
"options": {
"passWithNoTests": true,
"reportsDirectory": "../../coverage/apps/shinkai-app"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/shinkai-app/**/*.{ts,tsx,js,jsx}"]
}
},
"serve-static": {
"executor": "@nx/web:file-server",
"outputs": [
"{options.outputFile}"
],
"options": {
"buildTarget": "shinkai-app:build"
"lintFilePatterns": [
"apps/shinkai-app/**/*.{ts,tsx,js,jsx}"
]
}
}
},
Expand Down
Loading

0 comments on commit c296775

Please sign in to comment.