create-aws-project 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -0
- package/dist/__tests__/generator/replace-tokens.spec.d.ts +1 -0
- package/dist/__tests__/generator/replace-tokens.spec.js +281 -0
- package/dist/__tests__/generator.spec.d.ts +1 -0
- package/dist/__tests__/generator.spec.js +162 -0
- package/dist/__tests__/validation/project-name.spec.d.ts +1 -0
- package/dist/__tests__/validation/project-name.spec.js +57 -0
- package/dist/__tests__/wizard.spec.d.ts +1 -0
- package/dist/__tests__/wizard.spec.js +232 -0
- package/dist/aws/iam.d.ts +75 -0
- package/dist/aws/iam.js +264 -0
- package/dist/aws/organizations.d.ts +79 -0
- package/dist/aws/organizations.js +168 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +206 -0
- package/dist/commands/setup-github.d.ts +4 -0
- package/dist/commands/setup-github.js +185 -0
- package/dist/generator/copy-file.d.ts +15 -0
- package/dist/generator/copy-file.js +56 -0
- package/dist/generator/generate-project.d.ts +14 -0
- package/dist/generator/generate-project.js +81 -0
- package/dist/generator/index.d.ts +4 -0
- package/dist/generator/index.js +3 -0
- package/dist/generator/replace-tokens.d.ts +29 -0
- package/dist/generator/replace-tokens.js +68 -0
- package/dist/github/secrets.d.ts +109 -0
- package/dist/github/secrets.js +275 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/prompts/auth.d.ts +3 -0
- package/dist/prompts/auth.js +23 -0
- package/dist/prompts/aws-config.d.ts +2 -0
- package/dist/prompts/aws-config.js +14 -0
- package/dist/prompts/features.d.ts +2 -0
- package/dist/prompts/features.js +10 -0
- package/dist/prompts/github-setup.d.ts +53 -0
- package/dist/prompts/github-setup.js +208 -0
- package/dist/prompts/org-structure.d.ts +9 -0
- package/dist/prompts/org-structure.js +93 -0
- package/dist/prompts/platforms.d.ts +2 -0
- package/dist/prompts/platforms.js +12 -0
- package/dist/prompts/project-name.d.ts +2 -0
- package/dist/prompts/project-name.js +8 -0
- package/dist/prompts/theme.d.ts +2 -0
- package/dist/prompts/theme.js +14 -0
- package/dist/templates/index.d.ts +4 -0
- package/dist/templates/index.js +2 -0
- package/dist/templates/manifest.d.ts +11 -0
- package/dist/templates/manifest.js +99 -0
- package/dist/templates/tokens.d.ts +39 -0
- package/dist/templates/tokens.js +37 -0
- package/dist/templates/types.d.ts +52 -0
- package/dist/templates/types.js +1 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.js +1 -0
- package/dist/validation/project-name.d.ts +1 -0
- package/dist/validation/project-name.js +12 -0
- package/dist/wizard.d.ts +2 -0
- package/dist/wizard.js +81 -0
- package/package.json +68 -0
- package/templates/.github/actions/build-and-test/action.yml +24 -0
- package/templates/.github/actions/deploy-cdk/action.yml +46 -0
- package/templates/.github/actions/deploy-web/action.yml +72 -0
- package/templates/.github/actions/setup/action.yml +29 -0
- package/templates/.github/pull_request_template.md +15 -0
- package/templates/.github/workflows/deploy-dev.yml +80 -0
- package/templates/.github/workflows/deploy-prod.yml +67 -0
- package/templates/.github/workflows/deploy-stage.yml +77 -0
- package/templates/.github/workflows/pull-request.yml +72 -0
- package/templates/.vscode/extensions.json +7 -0
- package/templates/.vscode/settings.json +67 -0
- package/templates/apps/api/.eslintrc.json +18 -0
- package/templates/apps/api/cdk/app.ts +93 -0
- package/templates/apps/api/cdk/auth/cognito-stack.ts +164 -0
- package/templates/apps/api/cdk/cdk.json +73 -0
- package/templates/apps/api/cdk/deployment-user-stack.ts +187 -0
- package/templates/apps/api/cdk/org-stack.ts +67 -0
- package/templates/apps/api/cdk/static-stack.ts +361 -0
- package/templates/apps/api/cdk/tsconfig.json +39 -0
- package/templates/apps/api/cdk/user-stack.ts +255 -0
- package/templates/apps/api/jest.config.ts +38 -0
- package/templates/apps/api/lambdas.yml +84 -0
- package/templates/apps/api/project.json.template +58 -0
- package/templates/apps/api/src/__tests__/setup.ts +10 -0
- package/templates/apps/api/src/handlers/users/create-user.ts +52 -0
- package/templates/apps/api/src/handlers/users/delete-user.ts +45 -0
- package/templates/apps/api/src/handlers/users/get-me.ts +72 -0
- package/templates/apps/api/src/handlers/users/get-user.ts +45 -0
- package/templates/apps/api/src/handlers/users/get-users.ts +23 -0
- package/templates/apps/api/src/handlers/users/index.ts +17 -0
- package/templates/apps/api/src/handlers/users/update-user.ts +72 -0
- package/templates/apps/api/src/lib/dynamo/dynamo-model.ts +504 -0
- package/templates/apps/api/src/lib/dynamo/index.ts +12 -0
- package/templates/apps/api/src/lib/dynamo/utils.ts +39 -0
- package/templates/apps/api/src/middleware/auth0-auth.ts +97 -0
- package/templates/apps/api/src/middleware/cognito-auth.ts +90 -0
- package/templates/apps/api/src/models/UserModel.ts +109 -0
- package/templates/apps/api/src/schemas/user.schema.ts +44 -0
- package/templates/apps/api/src/services/user-service.ts +108 -0
- package/templates/apps/api/src/utils/auth-context.ts +60 -0
- package/templates/apps/api/src/utils/common/helpers.ts +26 -0
- package/templates/apps/api/src/utils/lambda-handler.ts +148 -0
- package/templates/apps/api/src/utils/response.ts +52 -0
- package/templates/apps/api/src/utils/validator.ts +75 -0
- package/templates/apps/api/tsconfig.app.json +15 -0
- package/templates/apps/api/tsconfig.json +19 -0
- package/templates/apps/api/tsconfig.spec.json +17 -0
- package/templates/apps/mobile/.env.example +5 -0
- package/templates/apps/mobile/.eslintrc.json +33 -0
- package/templates/apps/mobile/app.json +33 -0
- package/templates/apps/mobile/assets/.gitkeep +0 -0
- package/templates/apps/mobile/babel.config.js +19 -0
- package/templates/apps/mobile/index.js +7 -0
- package/templates/apps/mobile/jest.config.ts +22 -0
- package/templates/apps/mobile/metro.config.js +35 -0
- package/templates/apps/mobile/package.json +22 -0
- package/templates/apps/mobile/project.json.template +64 -0
- package/templates/apps/mobile/src/App.tsx +367 -0
- package/templates/apps/mobile/src/__tests__/App.spec.tsx +46 -0
- package/templates/apps/mobile/src/__tests__/store/user-store.spec.ts +156 -0
- package/templates/apps/mobile/src/config/api.ts +16 -0
- package/templates/apps/mobile/src/store/user-store.ts +56 -0
- package/templates/apps/mobile/src/test-setup.ts +10 -0
- package/templates/apps/mobile/tsconfig.json +22 -0
- package/templates/apps/web/.env.example +13 -0
- package/templates/apps/web/.eslintrc.json +26 -0
- package/templates/apps/web/index.html +13 -0
- package/templates/apps/web/jest.config.ts +24 -0
- package/templates/apps/web/package.json +15 -0
- package/templates/apps/web/project.json.template +66 -0
- package/templates/apps/web/src/App.tsx +352 -0
- package/templates/apps/web/src/__mocks__/config/api.ts +41 -0
- package/templates/apps/web/src/__tests__/App.spec.tsx +240 -0
- package/templates/apps/web/src/__tests__/store/user-store.spec.ts +185 -0
- package/templates/apps/web/src/auth/auth0-provider.tsx +103 -0
- package/templates/apps/web/src/auth/cognito-provider.tsx +143 -0
- package/templates/apps/web/src/auth/index.ts +7 -0
- package/templates/apps/web/src/auth/use-auth.ts +16 -0
- package/templates/apps/web/src/config/amplify-config.ts +31 -0
- package/templates/apps/web/src/config/api.ts +38 -0
- package/templates/apps/web/src/config/auth0-config.ts +17 -0
- package/templates/apps/web/src/main.tsx +41 -0
- package/templates/apps/web/src/store/user-store.ts +56 -0
- package/templates/apps/web/src/styles.css +165 -0
- package/templates/apps/web/src/test-setup.ts +1 -0
- package/templates/apps/web/src/theme/index.ts +30 -0
- package/templates/apps/web/src/vite-env.d.ts +19 -0
- package/templates/apps/web/tsconfig.app.json +24 -0
- package/templates/apps/web/tsconfig.json +22 -0
- package/templates/apps/web/tsconfig.spec.json +28 -0
- package/templates/apps/web/vite.config.ts +87 -0
- package/templates/manifest.json +28 -0
- package/templates/packages/api-client/.eslintrc.json +18 -0
- package/templates/packages/api-client/jest.config.ts +13 -0
- package/templates/packages/api-client/package.json +8 -0
- package/templates/packages/api-client/project.json.template +34 -0
- package/templates/packages/api-client/src/__tests__/api-client.spec.ts +408 -0
- package/templates/packages/api-client/src/api-client.ts +201 -0
- package/templates/packages/api-client/src/config.ts +193 -0
- package/templates/packages/api-client/src/index.ts +9 -0
- package/templates/packages/api-client/tsconfig.json +22 -0
- package/templates/packages/api-client/tsconfig.lib.json +11 -0
- package/templates/packages/api-client/tsconfig.spec.json +14 -0
- package/templates/packages/common-types/.eslintrc.json +18 -0
- package/templates/packages/common-types/package.json +6 -0
- package/templates/packages/common-types/project.json.template +26 -0
- package/templates/packages/common-types/src/api.types.ts +24 -0
- package/templates/packages/common-types/src/auth.types.ts +36 -0
- package/templates/packages/common-types/src/common.types.ts +46 -0
- package/templates/packages/common-types/src/index.ts +19 -0
- package/templates/packages/common-types/src/lambda.types.ts +39 -0
- package/templates/packages/common-types/src/user.types.ts +31 -0
- package/templates/packages/common-types/tsconfig.json +19 -0
- package/templates/packages/common-types/tsconfig.lib.json +11 -0
- package/templates/root/.editorconfig +23 -0
- package/templates/root/.nvmrc +1 -0
- package/templates/root/eslint.config.js +61 -0
- package/templates/root/jest.preset.js +16 -0
- package/templates/root/nx.json +29 -0
- package/templates/root/package.json +131 -0
- package/templates/root/tsconfig.base.json +29 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import Ajv, { ValidateFunction, JSONSchemaType, ErrorObject } from 'ajv';
|
|
2
|
+
import addFormats from 'ajv-formats';
|
|
3
|
+
|
|
4
|
+
// Initialize AJV with formats support (singleton)
|
|
5
|
+
const ajv = new Ajv({ allErrors: true, removeAdditional: true });
|
|
6
|
+
addFormats(ajv);
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Validation result interface
|
|
10
|
+
*/
|
|
11
|
+
export interface ValidationResult {
|
|
12
|
+
valid: boolean;
|
|
13
|
+
errors?: string[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Format AJV error objects into readable error messages
|
|
18
|
+
*/
|
|
19
|
+
function formatAjvErrors(errors: ErrorObject[]): string[] {
|
|
20
|
+
return errors.map(err => {
|
|
21
|
+
const field = err.instancePath.replace('/', '') || err.params['missingProperty'] || 'request';
|
|
22
|
+
return `${field}: ${err.message}`;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Generic validation function with detailed errors
|
|
28
|
+
*
|
|
29
|
+
* @param schema - JSONSchema to validate against
|
|
30
|
+
* @param data - Data to validate
|
|
31
|
+
* @returns ValidationResult with detailed error messages
|
|
32
|
+
*/
|
|
33
|
+
export function validate<T>(
|
|
34
|
+
schema: JSONSchemaType<T>,
|
|
35
|
+
data: unknown
|
|
36
|
+
): ValidationResult {
|
|
37
|
+
// Compile schema (AJV caches compiled schemas internally)
|
|
38
|
+
const validateFn: ValidateFunction<T> = ajv.compile(schema);
|
|
39
|
+
const valid = validateFn(data);
|
|
40
|
+
|
|
41
|
+
if (!valid && validateFn.errors) {
|
|
42
|
+
const errors = formatAjvErrors(validateFn.errors);
|
|
43
|
+
return { valid: false, errors };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return { valid: true };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Generic type guard validation function
|
|
51
|
+
*
|
|
52
|
+
* @param schema - JSONSchema to validate against
|
|
53
|
+
* @param data - Data to validate
|
|
54
|
+
* @returns Type guard boolean
|
|
55
|
+
*/
|
|
56
|
+
export function validateTypeGuard<T>(
|
|
57
|
+
schema: JSONSchemaType<T>,
|
|
58
|
+
data: unknown
|
|
59
|
+
): data is T {
|
|
60
|
+
const validateFn: ValidateFunction<T> = ajv.compile(schema);
|
|
61
|
+
return validateFn(data);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get validation errors as a formatted string
|
|
66
|
+
*
|
|
67
|
+
* @param errors - Array of error messages
|
|
68
|
+
* @returns Formatted error string
|
|
69
|
+
*/
|
|
70
|
+
export function getValidationErrors(errors?: string[]): string {
|
|
71
|
+
if (!errors || errors.length === 0) {
|
|
72
|
+
return 'Validation failed';
|
|
73
|
+
}
|
|
74
|
+
return errors.join(', ');
|
|
75
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../dist/out-tsc",
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"types": ["node"],
|
|
7
|
+
"moduleResolution": "node10",
|
|
8
|
+
"resolveJsonModule": true
|
|
9
|
+
},
|
|
10
|
+
"exclude": [
|
|
11
|
+
"**/*.spec.ts",
|
|
12
|
+
"**/*.test.ts"
|
|
13
|
+
],
|
|
14
|
+
"include": ["src/**/*.ts"]
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"forceConsistentCasingInFileNames": true,
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noImplicitOverride": true,
|
|
8
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
9
|
+
"noImplicitReturns": true,
|
|
10
|
+
"noFallthroughCasesInSwitch": true
|
|
11
|
+
},
|
|
12
|
+
"files": [],
|
|
13
|
+
"include": [],
|
|
14
|
+
"references": [
|
|
15
|
+
{
|
|
16
|
+
"path": "./tsconfig.app.json"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../dist/out-tsc",
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"types": ["jest", "node"]
|
|
8
|
+
},
|
|
9
|
+
"include": [
|
|
10
|
+
"jest.config.ts",
|
|
11
|
+
"src/**/*.test.ts",
|
|
12
|
+
"src/**/*.spec.ts",
|
|
13
|
+
"src/**/*.d.ts",
|
|
14
|
+
"src/__tests__/**/*.ts",
|
|
15
|
+
"src/__mocks__/**/*.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"../../.eslintrc.js",
|
|
4
|
+
"plugin:react/recommended",
|
|
5
|
+
"plugin:react-hooks/recommended",
|
|
6
|
+
"plugin:react-native/all"
|
|
7
|
+
],
|
|
8
|
+
"ignorePatterns": ["!**/*", "node_modules/**"],
|
|
9
|
+
"settings": {
|
|
10
|
+
"react": {
|
|
11
|
+
"version": "detect"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"overrides": [
|
|
15
|
+
{
|
|
16
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
17
|
+
"rules": {
|
|
18
|
+
"react/react-in-jsx-scope": "off",
|
|
19
|
+
"react/prop-types": "off",
|
|
20
|
+
"react-native/no-inline-styles": "warn",
|
|
21
|
+
"react-native/no-color-literals": "off"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"files": ["*.ts", "*.tsx"],
|
|
26
|
+
"rules": {}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"files": ["*.js", "*.jsx"],
|
|
30
|
+
"rules": {}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"expo": {
|
|
3
|
+
"name": "{{PROJECT_NAME_TITLE}}",
|
|
4
|
+
"slug": "{{PROJECT_NAME}}",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"orientation": "portrait",
|
|
7
|
+
"icon": "./assets/icon.png",
|
|
8
|
+
"userInterfaceStyle": "automatic",
|
|
9
|
+
"newArchEnabled": true,
|
|
10
|
+
"splash": {
|
|
11
|
+
"image": "./assets/splash.png",
|
|
12
|
+
"resizeMode": "contain",
|
|
13
|
+
"backgroundColor": "#3B82F6"
|
|
14
|
+
},
|
|
15
|
+
"assetBundlePatterns": [
|
|
16
|
+
"**/*"
|
|
17
|
+
],
|
|
18
|
+
"ios": {
|
|
19
|
+
"supportsTablet": true,
|
|
20
|
+
"bundleIdentifier": "com.yourcompany.{{PROJECT_NAME}}"
|
|
21
|
+
},
|
|
22
|
+
"android": {
|
|
23
|
+
"adaptiveIcon": {
|
|
24
|
+
"foregroundImage": "./assets/adaptive-icon.png",
|
|
25
|
+
"backgroundColor": "#3B82F6"
|
|
26
|
+
},
|
|
27
|
+
"package": "com.yourcompany.{{PROJECT_NAME}}"
|
|
28
|
+
},
|
|
29
|
+
"web": {
|
|
30
|
+
"favicon": "./assets/favicon.png"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module.exports = function (api) {
|
|
2
|
+
api.cache(true);
|
|
3
|
+
return {
|
|
4
|
+
presets: ['babel-preset-expo'],
|
|
5
|
+
plugins: [
|
|
6
|
+
[
|
|
7
|
+
'module-resolver',
|
|
8
|
+
{
|
|
9
|
+
root: ['./src'],
|
|
10
|
+
alias: {
|
|
11
|
+
'{{PACKAGE_SCOPE}}/common-types': '../../packages/common-types/src',
|
|
12
|
+
'{{PACKAGE_SCOPE}}/api-client': '../../packages/api-client/src',
|
|
13
|
+
},
|
|
14
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerRootComponent } from 'expo';
|
|
2
|
+
import App from './src/App';
|
|
3
|
+
|
|
4
|
+
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
|
5
|
+
// It also ensures that whether you load the app in Expo Go or in a native build,
|
|
6
|
+
// the environment is set up appropriately
|
|
7
|
+
registerRootComponent(App);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
displayName: 'mobile',
|
|
3
|
+
preset: 'jest-expo',
|
|
4
|
+
resolver: '@nx/jest/plugins/resolver',
|
|
5
|
+
moduleFileExtensions: ['ts', 'js', 'tsx', 'jsx'],
|
|
6
|
+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
|
7
|
+
moduleNameMapper: {
|
|
8
|
+
'\\.svg$': '@nx/expo/plugins/jest/svg-mock',
|
|
9
|
+
},
|
|
10
|
+
transform: {
|
|
11
|
+
'^.+\\.(js|ts|tsx)$': [
|
|
12
|
+
'babel-jest',
|
|
13
|
+
{
|
|
14
|
+
configFile: './apps/mobile/babel.config.js',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$':
|
|
18
|
+
'jest-expo/src/preset/assetFileTransformer.js',
|
|
19
|
+
},
|
|
20
|
+
coverageDirectory: '../../coverage/apps/mobile',
|
|
21
|
+
coverageReporters: ['html', 'text', 'json', 'json-summary'],
|
|
22
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const { getDefaultConfig } = require('expo/metro-config');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
// Get the default Expo config
|
|
5
|
+
const config = getDefaultConfig(__dirname);
|
|
6
|
+
|
|
7
|
+
// Get the workspace root (monorepo root)
|
|
8
|
+
const workspaceRoot = path.resolve(__dirname, '../..');
|
|
9
|
+
const projectRoot = __dirname;
|
|
10
|
+
|
|
11
|
+
// Watch all files in the monorepo
|
|
12
|
+
config.watchFolders = [workspaceRoot];
|
|
13
|
+
|
|
14
|
+
// Let Metro know where to resolve packages from
|
|
15
|
+
config.resolver.nodeModulesPaths = [
|
|
16
|
+
path.resolve(projectRoot, 'node_modules'),
|
|
17
|
+
path.resolve(workspaceRoot, 'node_modules'),
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
// Add support for additional file extensions
|
|
21
|
+
config.resolver.sourceExts = [...config.resolver.sourceExts, 'cjs'];
|
|
22
|
+
|
|
23
|
+
// Configure how Metro resolves modules
|
|
24
|
+
config.resolver.disableHierarchicalLookup = false;
|
|
25
|
+
|
|
26
|
+
// Add extra node modules to watch (our workspace packages)
|
|
27
|
+
config.resolver.extraNodeModules = {
|
|
28
|
+
'{{PACKAGE_SCOPE}}/common-types': path.resolve(workspaceRoot, 'packages/common-types/src'),
|
|
29
|
+
'{{PACKAGE_SCOPE}}/api-client': path.resolve(workspaceRoot, 'packages/api-client/src'),
|
|
30
|
+
// Force React Native to use its own React version
|
|
31
|
+
'react': path.resolve(projectRoot, 'node_modules/react'),
|
|
32
|
+
'react-native': path.resolve(projectRoot, 'node_modules/react-native'),
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
module.exports = config;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mobile",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "expo start",
|
|
7
|
+
"android": "expo start --android",
|
|
8
|
+
"ios": "expo start --ios",
|
|
9
|
+
"web": "expo start --web"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"react": "18.3.1",
|
|
13
|
+
"react-native": "0.79.6",
|
|
14
|
+
"expo": "~52.0.0",
|
|
15
|
+
"expo-status-bar": "~2.0.0",
|
|
16
|
+
"axios": "^1.13.2",
|
|
17
|
+
"zustand": "^5.0.8"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/react": "~18.3.12"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mobile",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "apps/mobile/src",
|
|
5
|
+
"projectType": "application",
|
|
6
|
+
"tags": [
|
|
7
|
+
"type:app",
|
|
8
|
+
"platform:mobile"
|
|
9
|
+
],
|
|
10
|
+
"targets": {
|
|
11
|
+
"lint": {
|
|
12
|
+
"executor": "@nx/eslint:lint",
|
|
13
|
+
"outputs": ["{options.outputFile}"],
|
|
14
|
+
"options": {
|
|
15
|
+
"lintFilePatterns": ["apps/mobile/**/*.{ts,tsx,js,jsx}"]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"start": {
|
|
19
|
+
"executor": "nx:run-commands",
|
|
20
|
+
"options": {
|
|
21
|
+
"command": "npx expo start",
|
|
22
|
+
"cwd": "apps/mobile"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"start:ios": {
|
|
26
|
+
"executor": "nx:run-commands",
|
|
27
|
+
"options": {
|
|
28
|
+
"command": "npx expo start --ios",
|
|
29
|
+
"cwd": "apps/mobile"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"start:android": {
|
|
33
|
+
"executor": "nx:run-commands",
|
|
34
|
+
"options": {
|
|
35
|
+
"command": "npx expo start --android",
|
|
36
|
+
"cwd": "apps/mobile"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"build:ios": {
|
|
40
|
+
"executor": "nx:run-commands",
|
|
41
|
+
"options": {
|
|
42
|
+
"command": "npx expo build:ios",
|
|
43
|
+
"cwd": "apps/mobile"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"build:android": {
|
|
47
|
+
"executor": "nx:run-commands",
|
|
48
|
+
"options": {
|
|
49
|
+
"command": "npx expo build:android",
|
|
50
|
+
"cwd": "apps/mobile"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"test": {
|
|
54
|
+
"executor": "@nx/jest:jest",
|
|
55
|
+
"outputs": [
|
|
56
|
+
"{workspaceRoot}/coverage/apps/mobile"
|
|
57
|
+
],
|
|
58
|
+
"options": {
|
|
59
|
+
"jestConfig": "apps/mobile/jest.config.ts",
|
|
60
|
+
"passWithNoTests": true
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|