@digitaldefiance/express-suite-starter 2.3.4 → 2.3.6

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.
Files changed (98) hide show
  1. package/dist/src/generate-monorepo.d.ts.map +1 -1
  2. package/dist/src/generate-monorepo.js +7 -2
  3. package/dist/src/generate-monorepo.js.map +1 -1
  4. package/package.json +2 -1
  5. package/scaffolding/api/.env.example.mustache +52 -0
  6. package/scaffolding/api/src/assets/.gitkeep +0 -0
  7. package/scaffolding/api/src/main.ts.mustache +19 -0
  8. package/scaffolding/api/src/views/index.ejs +34 -0
  9. package/scaffolding/api-lib/src/index.ts +9 -0
  10. package/scaffolding/api-lib/src/lib/application.ts +35 -0
  11. package/scaffolding/api-lib/src/lib/constants.ts.mustache +10 -0
  12. package/scaffolding/api-lib/src/lib/documents/index.ts +1 -0
  13. package/scaffolding/api-lib/src/lib/documents/user.ts +17 -0
  14. package/scaffolding/api-lib/src/lib/environment.ts +52 -0
  15. package/scaffolding/api-lib/src/lib/interfaces/constants.ts +9 -0
  16. package/scaffolding/api-lib/src/lib/interfaces/environment-aws.ts +7 -0
  17. package/scaffolding/api-lib/src/lib/interfaces/environment.ts +9 -0
  18. package/scaffolding/api-lib/src/lib/middlewares.ts.mustache +113 -0
  19. package/scaffolding/api-lib/src/lib/models/email-token.ts +12 -0
  20. package/scaffolding/api-lib/src/lib/models/mnemonic.ts +12 -0
  21. package/scaffolding/api-lib/src/lib/models/role.ts +12 -0
  22. package/scaffolding/api-lib/src/lib/models/used-direct-login-token.ts +12 -0
  23. package/scaffolding/api-lib/src/lib/models/user-role.ts +12 -0
  24. package/scaffolding/api-lib/src/lib/models/user.ts +14 -0
  25. package/scaffolding/api-lib/src/lib/routers/api.ts +23 -0
  26. package/scaffolding/api-lib/src/lib/routers/app.ts +31 -0
  27. package/scaffolding/api-lib/src/lib/routers/index.ts +2 -0
  28. package/scaffolding/api-lib/src/lib/schemas/index.ts +2 -0
  29. package/scaffolding/api-lib/src/lib/schemas/schema.ts +53 -0
  30. package/scaffolding/api-lib/src/lib/schemas/user.ts +13 -0
  31. package/scaffolding/api-lib/src/lib/services/email.ts +109 -0
  32. package/scaffolding/api-lib/src/lib/services/index.ts +1 -0
  33. package/scaffolding/api-lib/src/lib/shared-types.ts +172 -0
  34. package/scaffolding/devcontainer-mongodb/.devcontainer/.env.example +3 -0
  35. package/scaffolding/devcontainer-mongodb/.devcontainer/Dockerfile +6 -0
  36. package/scaffolding/devcontainer-mongodb/.devcontainer/devcontainer.json.mustache +31 -0
  37. package/scaffolding/devcontainer-mongodb/.devcontainer/docker-compose.yml +31 -0
  38. package/scaffolding/devcontainer-mongodb/.devcontainer/load-env.sh +20 -0
  39. package/scaffolding/devcontainer-mongodb/.devcontainer/post-create.sh.hbs +54 -0
  40. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/.env.example +14 -0
  41. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/Dockerfile +38 -0
  42. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/Mongo.Dockerfile +24 -0
  43. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/devcontainer.json +69 -0
  44. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/docker-compose.yml +66 -0
  45. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/entrypoint.sh +29 -0
  46. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/load-env.sh +20 -0
  47. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/mongodb_entrypoint.sh +124 -0
  48. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/mongodb_healthcheck.sh +36 -0
  49. package/scaffolding/devcontainer-mongodb-replicaset/.devcontainer/post-create.sh.hbs +54 -0
  50. package/scaffolding/devcontainer-simple/.devcontainer/.env.example +4 -0
  51. package/scaffolding/devcontainer-simple/.devcontainer/devcontainer.json.mustache +60 -0
  52. package/scaffolding/devcontainer-simple/.devcontainer/post-create.sh.hbs +72 -0
  53. package/scaffolding/inituserdb/.env.example.mustache +9 -0
  54. package/scaffolding/inituserdb/src/main.ts.mustache +178 -0
  55. package/scaffolding/lib/src/index.ts.mustache +6 -0
  56. package/scaffolding/lib/src/lib/constants.ts.mustache +15 -0
  57. package/scaffolding/lib/src/lib/ecies-config.ts +10 -0
  58. package/scaffolding/lib/src/lib/enumerations/{{workspaceName}}-string-key.ts.mustache +5 -0
  59. package/scaffolding/lib/src/lib/i18n-setup.ts.mustache +99 -0
  60. package/scaffolding/lib/src/lib/interfaces/constants.ts +13 -0
  61. package/scaffolding/lib/src/lib/strings-collection.ts.mustache +45 -0
  62. package/scaffolding/react/src/app/app.tsx.mustache +170 -0
  63. package/scaffolding/react/src/app/menus/extraMenu.tsx +20 -0
  64. package/scaffolding/react/src/app/menus/index.ts +5 -0
  65. package/scaffolding/react/src/app/pages/SplashPage.tsx +60 -0
  66. package/scaffolding/react/src/app/theme.tsx.mustache +91 -0
  67. package/scaffolding/react/src/assets/albatross.ico +0 -0
  68. package/scaffolding/react/src/assets/albatross.png +0 -0
  69. package/scaffolding/react/src/assets/albatross.svg +108 -0
  70. package/scaffolding/react/src/assets/fonts/allroundgothic-xlig.otf +0 -0
  71. package/scaffolding/react/src/assets/fonts/allroundgothic-xlig.ttf +0 -0
  72. package/scaffolding/react/src/assets/fonts/allroundgothic-xlig.woff +0 -0
  73. package/scaffolding/react/src/assets/fonts/allroundgothic-xlig.woff2 +0 -0
  74. package/scaffolding/react/src/assets/gen-by-albatross.png +0 -0
  75. package/scaffolding/react/src/assets/gen-by-albatross.svg +124 -0
  76. package/scaffolding/react/src/config/ecies.ts +10 -0
  77. package/scaffolding/react/src/config/runtime-config.ts +25 -0
  78. package/scaffolding/react/src/environments/environment.prod.ts.mustache +16 -0
  79. package/scaffolding/react/src/environments/environment.ts +15 -0
  80. package/scaffolding/react/src/interfaces/environment.ts +5 -0
  81. package/scaffolding/react/src/main.tsx +22 -0
  82. package/scaffolding/react/src/styles.scss +103 -0
  83. package/scaffolding/react/src/test-setup.ts +1 -0
  84. package/scaffolding/react-lib/src/index.ts +6 -0
  85. package/scaffolding/react-lib/src/theme/theme.tsx +67 -0
  86. package/scaffolding/root/.github/dependabot.yml +11 -0
  87. package/scaffolding/root/.github/workflows/ci.yml +44 -0
  88. package/scaffolding/root/.vscode/extensions.json +9 -0
  89. package/scaffolding/root/DEPLOYMENT.md +104 -0
  90. package/scaffolding/root/do-yarn.sh +148 -0
  91. package/scaffolding/root/ensure-git-globals.sh +30 -0
  92. package/scaffolding/root/eslint.config.mjs +70 -0
  93. package/scaffolding/root/list-scripts.sh +12 -0
  94. package/scaffolding/root/npm-install-globals.sh +5 -0
  95. package/scaffolding/root/nuke-node-modules.sh +23 -0
  96. package/scaffolding/root/recover-yarn.sh +37 -0
  97. package/scaffolding/root/reset.sh.mustache +25 -0
  98. package/scaffolding/root/setup-nvm.sh +15 -0
@@ -0,0 +1,44 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ permissions:
10
+ actions: read
11
+ contents: read
12
+
13
+ jobs:
14
+ main:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ with:
19
+ filter: tree:0
20
+ fetch-depth: 0
21
+
22
+
23
+
24
+
25
+ # This enables task distribution via Nx Cloud
26
+ # Run this command as early as possible, before dependencies are installed
27
+ # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
28
+ # Uncomment this line to enable task distribution
29
+ # - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"
30
+
31
+
32
+ # Cache node_modules
33
+ - uses: actions/setup-node@v4
34
+ with:
35
+ node-version: 20
36
+ cache: 'yarn'
37
+
38
+ - run: yarn install --frozen-lockfile
39
+ - uses: nrwl/nx-set-shas@v4
40
+
41
+ # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
42
+ # - run: yarn nx-cloud record -- echo Hello World
43
+ # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
44
+ - run: yarn nx affected -t lint test build
@@ -0,0 +1,9 @@
1
+ {
2
+ "recommendations": [
3
+ "nrwl.angular-console",
4
+ "esbenp.prettier-vscode",
5
+ "dbaeumer.vscode-eslint",
6
+ "ms-playwright.playwright",
7
+ "firsttris.vscode-jest-runner"
8
+ ]
9
+ }
@@ -0,0 +1,104 @@
1
+ # Deployment Guide
2
+
3
+ ## API Base URL Configuration
4
+
5
+ The React frontend needs to know where your API is hosted. There are three configuration methods:
6
+
7
+ ### 1. Same Domain (Recommended for Production)
8
+
9
+ Deploy frontend and API on the same domain. The production build uses relative URLs by default.
10
+
11
+ **Example**: `https://example.com` (frontend) and `https://example.com/api` (API)
12
+
13
+ No configuration needed - uses `environment.prod.ts` with `apiUrl: '/api'`
14
+
15
+ ### 2. Different Domain (Build-Time)
16
+
17
+ Edit `{{prefix}}-react/src/environments/environment.prod.ts`:
18
+
19
+ ```typescript
20
+ export const environment = {
21
+ production: true,
22
+ apiUrl: 'https://api.example.com/api',
23
+ };
24
+ ```
25
+
26
+ Rebuild: `yarn build`
27
+
28
+ ### 3. Different Domain (Runtime)
29
+
30
+ For deploying the same build to multiple domains, inject runtime config in your index.html:
31
+
32
+ ```html
33
+ <script>
34
+ window.APP_CONFIG = {
35
+ apiUrl: 'https://api.example.com/api'
36
+ };
37
+ </script>
38
+ ```
39
+
40
+ This overrides the environment file without rebuilding.
41
+
42
+ ## Environment Files
43
+
44
+ ### Development (`environment.ts`)
45
+
46
+ ```typescript
47
+ export const environment = {
48
+ production: false,
49
+ apiUrl: 'http://localhost:3000/api',
50
+ };
51
+ ```
52
+
53
+ ### Production (`environment.prod.ts`)
54
+
55
+ ```typescript
56
+ export const environment = {
57
+ production: true,
58
+ apiUrl: '/api', // Relative URL for same-domain deployment
59
+ };
60
+ ```
61
+
62
+ ## Build Commands
63
+
64
+ ```bash
65
+ # Development
66
+ yarn serve:dev
67
+
68
+ # Production build
69
+ yarn build
70
+
71
+ # Production serve
72
+ yarn serve
73
+ ```
74
+
75
+ ## API Environment Variables
76
+
77
+ Configure `{{prefix}}-api/.env`:
78
+
79
+ ```bash
80
+ # Required
81
+ MONGO_URI=mongodb://localhost:27017/{{workspaceName}}
82
+ JWT_SECRET=your-64-char-hex-secret
83
+ MNEMONIC_HMAC_SECRET=your-64-char-hex-secret
84
+ MNEMONIC_ENCRYPTION_KEY=your-64-char-hex-secret
85
+
86
+ # Optional
87
+ PORT=3000
88
+ HOST=0.0.0.0
89
+ DEBUG=false
90
+ ```
91
+
92
+ Generate secrets: `yarn new:secret`
93
+
94
+ ## Deployment Checklist
95
+
96
+ - [ ] Set production environment variables in `{{prefix}}-api/.env`
97
+ - [ ] Configure API base URL (method 1, 2, or 3 above)
98
+ - [ ] Run `yarn build` to build all projects
99
+ - [ ] Test production build locally: `yarn serve`
100
+ - [ ] Deploy `dist/{{prefix}}-api` to your API server
101
+ - [ ] Deploy `dist/{{prefix}}-react` to your web server
102
+ - [ ] Verify HTTPS is enabled
103
+ - [ ] Test authentication flow
104
+ - [ ] Monitor logs for errors
@@ -0,0 +1,148 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Ensure corepack is enabled and we're using the right yarn version
5
+ export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
6
+ corepack enable
7
+
8
+ # Source NVM if available
9
+ if [ -s "/usr/local/share/nvm/nvm.sh" ]; then
10
+ . /usr/local/share/nvm/nvm.sh
11
+ elif [ -s "${HOME}/.nvm/nvm.sh" ]; then
12
+ . "${HOME}/.nvm/nvm.sh"
13
+ fi
14
+
15
+ # Find all package.json files, excluding node_modules, dist, and hidden directories
16
+ PACKAGE_ROOTS=$(find . -type f -name "package.json" ! -path "*/node_modules/*" ! -path "*/dist/*" ! -path "*/.*/*")
17
+
18
+ # Make sure we start with the project root
19
+ PROJECT_ROOT=$(pwd -P)
20
+
21
+ if command -v realpath >/dev/null 2>&1; then
22
+ resolve_path() {
23
+ realpath -m "$1"
24
+ }
25
+ else
26
+ resolve_path() {
27
+ local path="$1"
28
+ if [ -z "$path" ]; then
29
+ return 1
30
+ fi
31
+
32
+ if [ -d "$path" ]; then
33
+ (cd "$path" 2>/dev/null && pwd -P) || return 1
34
+ return 0
35
+ fi
36
+
37
+ local dir
38
+ dir=$(dirname "$path")
39
+ if [ -z "$dir" ] || [ "$dir" = "." ]; then
40
+ dir="$PWD"
41
+ fi
42
+
43
+ local base
44
+ base=$(basename "$path")
45
+
46
+ (cd "$dir" 2>/dev/null && printf '%s/%s\n' "$(pwd -P)" "$base") || return 1
47
+ }
48
+ fi
49
+
50
+ trim_whitespace() {
51
+ local trimmed="$1"
52
+ trimmed="${trimmed#"${trimmed%%[![:space:]]*}"}"
53
+ trimmed="${trimmed%"${trimmed##*[![:space:]]}"}"
54
+ printf '%s' "$trimmed"
55
+ }
56
+
57
+ IGNORE_PATHS=()
58
+
59
+ add_ignore_path() {
60
+ local candidate="$1"
61
+ [ -n "$candidate" ] || return
62
+ for existing in "${IGNORE_PATHS[@]}"; do
63
+ if [ "$existing" = "$candidate" ]; then
64
+ return
65
+ fi
66
+ done
67
+ IGNORE_PATHS+=("$candidate")
68
+ }
69
+
70
+ while IFS= read -r IGNORE_FILE; do
71
+ [ -n "$IGNORE_FILE" ] || continue
72
+ IGNORE_DIR=$(dirname "$IGNORE_FILE")
73
+ IGNORE_DIR_ABS=$(cd "$IGNORE_DIR" 2>/dev/null && pwd -P)
74
+ [ -n "$IGNORE_DIR_ABS" ] || continue
75
+
76
+ while IFS= read -r RAW_PATTERN || [ -n "$RAW_PATTERN" ]; do
77
+ PATTERN=$(trim_whitespace "$RAW_PATTERN")
78
+ [ -n "$PATTERN" ] || continue
79
+ if [ "${PATTERN:0:1}" = "#" ]; then
80
+ continue
81
+ fi
82
+
83
+ if [ "${PATTERN:0:1}" = "/" ]; then
84
+ CANDIDATE="$PATTERN"
85
+ else
86
+ CANDIDATE="$IGNORE_DIR_ABS/$PATTERN"
87
+ fi
88
+
89
+ if ! RESOLVED=$(resolve_path "$CANDIDATE"); then
90
+ continue
91
+ fi
92
+
93
+ RESOLVED="${RESOLVED%/}"
94
+ if [ -f "$RESOLVED" ]; then
95
+ RESOLVED=$(dirname "$RESOLVED")
96
+ fi
97
+
98
+ add_ignore_path "$RESOLVED"
99
+ done < "$IGNORE_FILE"
100
+ done < <(find . -type f -name ".doyarnignore" ! -path "*/node_modules/*" ! -path "*/dist/*" ! -path "*/.*/*" 2>/dev/null)
101
+
102
+ # Run yarn in the project root using corepack
103
+ echo "Running yarn in $PROJECT_ROOT"
104
+ #corepack yarn "$@"
105
+ NODE_OPTIONS="--max_old_space_size=3072" corepack yarn "$@"
106
+
107
+ # Loop through each package.json file
108
+ for PACKAGE in $PACKAGE_ROOTS; do
109
+ # Get the directory containing the package.json file
110
+ PACKAGE_DIR=$(dirname "$PACKAGE")
111
+
112
+ PACKAGE_DIR_ABS=$(resolve_path "$PACKAGE_DIR")
113
+ [ -n "$PACKAGE_DIR_ABS" ] || continue
114
+
115
+ # Skip the project root directory
116
+ if [ "$PACKAGE_DIR_ABS" = "$PROJECT_ROOT" ]; then
117
+ continue
118
+ fi
119
+
120
+ SKIP_PACKAGE=false
121
+ if [ ${#IGNORE_PATHS[@]} -gt 0 ]; then
122
+ for IGNORE_PATH in "${IGNORE_PATHS[@]}"; do
123
+ [ -n "$IGNORE_PATH" ] || continue
124
+ case "$PACKAGE_DIR_ABS" in
125
+ "$IGNORE_PATH"|"$IGNORE_PATH"/*)
126
+ echo "Skipping yarn in $PACKAGE_DIR (ignored by .doyarnignore)"
127
+ SKIP_PACKAGE=true
128
+ break
129
+ ;;
130
+ esac
131
+ done
132
+ fi
133
+
134
+ if [ "$SKIP_PACKAGE" = true ]; then
135
+ continue
136
+ fi
137
+
138
+ # Change to the package directory
139
+ cd "$PACKAGE_DIR" || exit
140
+
141
+ # Run yarn using corepack
142
+ echo "Running yarn in $PACKAGE_DIR"
143
+ #corepack yarn "$@"
144
+ NODE_OPTIONS="--max_old_space_size=3072" corepack yarn "$@"
145
+
146
+ # Return to the project root directory
147
+ cd "$PROJECT_ROOT" || exit
148
+ done
@@ -0,0 +1,30 @@
1
+ #!/bin/bash
2
+ if [ -z "${GIT_EMAIL}" ]; then
3
+ echo "GIT_EMAIL is not set. Please set it to your email address."
4
+ exit 1
5
+ fi
6
+ if [ -z "${GIT_NAME}" ]; then
7
+ echo "GIT_NAME is not set. Please set it to your name."
8
+ exit 1
9
+ fi
10
+
11
+ # Check if user.email is already set
12
+ CURRENT_EMAIL=$(git config --global --get user.email || echo "")
13
+ # Check if user.name is already set
14
+ CURRENT_NAME=$(git config --global --get user.name || echo "")
15
+
16
+ # Set user.email if it's not set or different from GIT_EMAIL
17
+ if [ -z "${CURRENT_EMAIL}" ] || [ "${CURRENT_EMAIL}" != "${GIT_EMAIL}" ]; then
18
+ echo "Setting git global user.email to ${GIT_EMAIL}"
19
+ git config --global user.email "${GIT_EMAIL}"
20
+ else
21
+ echo "Git global user.email already set to ${CURRENT_EMAIL}"
22
+ fi
23
+
24
+ # Set user.name if it's not set or different from GIT_NAME
25
+ if [ -z "${CURRENT_NAME}" ] || [ "${CURRENT_NAME}" != "${GIT_NAME}" ]; then
26
+ echo "Setting git global user.name to ${GIT_NAME}"
27
+ git config --global user.name "${GIT_NAME}"
28
+ else
29
+ echo "Git global user.name already set to ${CURRENT_NAME}"
30
+ fi
@@ -0,0 +1,70 @@
1
+ // eslint.config.mjs
2
+
3
+ import typescriptPlugin from '@typescript-eslint/eslint-plugin';
4
+ import typescriptParser from '@typescript-eslint/parser';
5
+ import prettierConfig from 'eslint-config-prettier';
6
+ import prettierPlugin from 'eslint-plugin-prettier';
7
+ import reactPlugin from 'eslint-plugin-react';
8
+ import reactHooksPlugin from 'eslint-plugin-react-hooks';
9
+ import path from 'path';
10
+ import { fileURLToPath } from 'url';
11
+
12
+ // Get the directory name of the current module
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = path.dirname(__filename);
15
+
16
+ export default [
17
+ {
18
+ ignores: ['**/dist', '**/node_modules', '**/.nx'],
19
+ },
20
+ {
21
+ files: ['**/*.{ts,tsx,js,jsx}'],
22
+ languageOptions: {
23
+ parser: typescriptParser,
24
+ parserOptions: {
25
+ project: path.resolve(__dirname, './tsconfig.base.json'), // Use absolute path to the root tsconfig.base.json
26
+ ecmaVersion: 2023,
27
+ sourceType: 'module',
28
+ ecmaFeatures: {
29
+ jsx: true,
30
+ },
31
+ },
32
+ },
33
+ plugins: {
34
+ '@typescript-eslint': typescriptPlugin,
35
+ react: reactPlugin,
36
+ 'react-hooks': reactHooksPlugin,
37
+ prettier: prettierPlugin,
38
+ },
39
+ rules: {
40
+ // Recommended rules from plugins
41
+ ...typescriptPlugin.configs.recommended.rules,
42
+ ...reactPlugin.configs.recommended.rules,
43
+ ...reactHooksPlugin.configs.recommended.rules,
44
+ ...prettierConfig.rules,
45
+
46
+ // Disable conflicting core rules
47
+ 'no-empty-function': 'off',
48
+
49
+ // TypeScript-specific rules
50
+ '@typescript-eslint/no-empty-function': [
51
+ 'error',
52
+ { allow: ['arrowFunctions', 'functions'] },
53
+ ],
54
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
55
+ '@typescript-eslint/no-explicit-any': 'warn',
56
+ '@typescript-eslint/ban-types': 'off',
57
+ '@typescript-eslint/no-unused-vars': 'error',
58
+
59
+ // Other custom rules
60
+ 'prettier/prettier': 'error',
61
+ 'react/prop-types': 'off',
62
+ 'react/react-in-jsx-scope': 'off',
63
+ },
64
+ settings: {
65
+ react: {
66
+ version: 'detect',
67
+ },
68
+ },
69
+ },
70
+ ];
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+
3
+ # Check if jq is installed
4
+ if ! command -v jq &> /dev/null
5
+ then
6
+ echo "jq could not be found. Please install jq to use this script."
7
+ exit
8
+ fi
9
+
10
+ # Read and list the scripts from package.json
11
+ echo "Available scripts in package.json:"
12
+ jq -r '.scripts | to_entries[] | "\(.key): \(.value)"' package.json
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ yes | npm install -g yarn@latest @nrwl/cli nx jest @withgraphite/graphite-cli@stable --force "$@"
3
+ if [ ! -z "$GRAPHITE_KEY" ]; then
4
+ npx --yes @withgraphite/graphite-cli@stable auth --token "${GRAPHITE_KEY}"
5
+ fi
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+
3
+ # Find all package.json files, excluding node_modules, dist, and hidden directories
4
+ PACKAGE_ROOTS=$(find . -type f -name "package.json" ! -path "*/node_modules/*" ! -path "*/dist/*" ! -path "*/.*/*")
5
+
6
+ # Make sure we start with the project root
7
+ PROJECT_ROOT=$(pwd)
8
+
9
+ # Loop through each package.json file
10
+ for PACKAGE in $PACKAGE_ROOTS; do
11
+ # Get the directory containing the package.json file
12
+ PACKAGE_DIR=$(dirname "$PACKAGE")
13
+
14
+ # Change to the package directory
15
+ cd "$PACKAGE_DIR" || exit
16
+
17
+ # Run yarn
18
+ echo "Running `rm -rf node_modules` in $PACKAGE_DIR"
19
+ rm -rf node_modules/
20
+
21
+ # Return to the project root directory
22
+ cd "$PROJECT_ROOT" || exit
23
+ done
@@ -0,0 +1,37 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Ensure NVM is loaded and the correct Node version is active
5
+ if [ -s "/usr/local/share/nvm/nvm.sh" ]; then
6
+ echo "=== DEBUG: Sourcing NVM from /usr/local/share/nvm/nvm.sh"
7
+ . /usr/local/share/nvm/nvm.sh
8
+ elif [ -s "$HOME/.nvm/nvm.sh" ]; then
9
+ echo "=== DEBUG: Sourcing NVM from $HOME/.nvm/nvm.sh"
10
+ . "$HOME/.nvm/nvm.sh"
11
+ fi
12
+ # Only run nvm use if .nvmrc exists, otherwise skip and continue
13
+ if [ -f ".nvmrc" ]; then
14
+ nvm use
15
+ fi
16
+
17
+ # Set the desired Yarn version (default to 4.9.2 if not set)
18
+ DEFAULT_YARN_VERSION=${DEFAULT_YARN_VERSION:-4.9.2}
19
+
20
+ echo "Clearing .yarnrc, .yarnrc.yml, and .yarn"
21
+ rm -rf .yarnrc .yarnrc.yml .yarn
22
+
23
+ echo "Enabling corepack"
24
+ corepack enable
25
+
26
+ echo "Preparing yarn@${DEFAULT_YARN_VERSION} for immediate activation..."
27
+ corepack prepare yarn@${DEFAULT_YARN_VERSION} --activate
28
+
29
+ echo "Setting yarn version to ${DEFAULT_YARN_VERSION}"
30
+ corepack yarn set version ${DEFAULT_YARN_VERSION}
31
+
32
+ echo "Yarn version after setup:"
33
+ corepack yarn --version
34
+
35
+ echo "=== DEBUG: which yarn: $(which yarn)"
36
+ echo "=== DEBUG: yarn --version: $(yarn --version)"
37
+ echo "=== DEBUG: corepack yarn version: $(corepack yarn --version 2>&1 || echo 'corepack yarn not available')"
@@ -0,0 +1,25 @@
1
+ #!/bin/bash
2
+
3
+ SKIP_INSTALL=0
4
+ if [ "$1" == "--skip-install" ]; then
5
+ SKIP_INSTALL=1
6
+ fi
7
+
8
+ # change directories into the script directory
9
+ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
10
+ cd "$SCRIPT_DIR"
11
+ echo "Resetting the NX project"
12
+ npx nx reset
13
+ echo "Removing dist and node_modules directories"
14
+ rm -rf dist node_modules ./{{prefix}}-lib/node_modules ./{{prefix}}-api/node_modules ./{{prefix}}-react/node_modules ./{{prefix}}-api-lib/node_modules ./{{prefix}}-test-utils/node_modules ./tools/node_modules
15
+ rm -rf yarn.lock ./{{prefix}}-lib/yarn.lock ./{{prefix}}-api/yarn.lock ./{{prefix}}-react/yarn.lock
16
+
17
+ echo "Doing yarn cache clean"
18
+ ./do-yarn.sh cache clean
19
+
20
+ if [ $SKIP_INSTALL -eq 0 ]; then
21
+ echo "Doing yarn install"
22
+ ./do-yarn.sh install
23
+ else
24
+ echo "Skipping yarn install"
25
+ fi
@@ -0,0 +1,15 @@
1
+ #!/bin/bash
2
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
3
+
4
+ if [ -d "$HOME/.nvm" ]; then
5
+ export NVM_DIR="$HOME/.nvm"
6
+ elif [ -d "/usr/local/share/nvm" ]; then
7
+ export NVM_DIR="/usr/local/share/nvm"
8
+ fi
9
+ if [ -n "$NVM_DIR" ]; then
10
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
11
+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
12
+ sudo chmod -R 755 "${NVM_DIR}"
13
+ fi
14
+
15
+ nvm install ${DEFAULT_NVM_VERSION} && nvm use ${DEFAULT_NVM_VERSION}