Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,16 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: formulus/package-lock.json
cache-dependency-path: |
formulus/package-lock.json
packages/tokens/package-lock.json

- name: Install and build @ode/tokens
working-directory: .
run: |
cd packages/tokens
npm install
npm run build

- name: Install dependencies
run: npm install
Expand Down Expand Up @@ -262,19 +271,19 @@ jobs:
echo "| Synkronus | ${{ needs.synkronus.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Synkronus CLI | ${{ needs.synkronus-cli.result }} |" >> $GITHUB_STEP_SUMMARY

if [ "${{ needs.formulus.result }}" != "success" ] && [ "${{ needs.formulus.result }}" != "skipped" ]; then
if [ "${{ needs.formulus.result }}" == "failure" ]; then
echo "❌ Formulus CI failed"
exit 1
fi
if [ "${{ needs.formulus-formplayer.result }}" != "success" ] && [ "${{ needs.formulus-formplayer.result }}" != "skipped" ]; then
if [ "${{ needs.formulus-formplayer.result }}" == "failure" ]; then
echo "❌ Formulus Formplayer CI failed"
exit 1
fi
if [ "${{ needs.synkronus.result }}" != "success" ] && [ "${{ needs.synkronus.result }}" != "skipped" ]; then
if [ "${{ needs.synkronus.result }}" == "failure" ]; then
echo "❌ Synkronus CI failed"
exit 1
fi
if [ "${{ needs.synkronus-cli.result }}" != "success" ] && [ "${{ needs.synkronus-cli.result }}" != "skipped" ]; then
if [ "${{ needs.synkronus-cli.result }}" == "failure" ]; then
echo "❌ Synkronus CLI CI failed"
exit 1
fi
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/formulus-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ jobs:
packages/tokens/package-lock.json
packages/tokens/package.json

- name: Install npm dependencies (formulus)
working-directory: formulus
run: npm ci

- name: Install and build @ode/tokens
working-directory: packages/tokens
run: |
npm install
npm run build

- name: Install npm dependencies (formulus)
working-directory: formulus
run: npm ci

- name: Set up Java
uses: actions/setup-java@v4
with:
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ COPY packages/tokens/package*.json ./packages/tokens/
COPY packages/tokens/package-lock.json ./packages/tokens/
COPY packages/tokens/style-dictionary.config.js ./packages/tokens/
COPY packages/tokens/config.json ./packages/tokens/
COPY packages/tokens/scripts ./packages/tokens/scripts
COPY packages/tokens/src ./packages/tokens/src
COPY packages/components/package*.json ./packages/components/
COPY synkronus-portal/package*.json ./synkronus-portal/
Expand Down
45 changes: 44 additions & 1 deletion formulus/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,58 @@
import { getDefaultConfig, mergeConfig } from '@react-native/metro-config';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

/** Monorepo root (parent of formulus) so Metro can resolve @ode/tokens and @ode/components */
const monorepoRoot = path.resolve(__dirname, '..');

/**
* Force a single React/react-native instance so hooks work (avoids "Invalid hook call" / "useState of null").
* Without this, @ode/components would use its own node_modules/react and we'd have two React copies.
*/
const projectRoot = __dirname;

/**
* Force react and react-native to always resolve from the app's node_modules
* (avoids incomplete copy in packages/components). react-native-svg only uses
* extraNodeModules so Metro resolves its real entry (lib/commonjs/index.js).
*/
const forcedModules = {
react: path.resolve(projectRoot, 'node_modules/react'),
'react-native': path.resolve(projectRoot, 'node_modules/react-native'),
};
const extraModules = {
...forcedModules,
'react-native-svg': path.resolve(
projectRoot,
'node_modules/react-native-svg',
),
};

/**
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @type {import('@react-native/metro-config').MetroConfig}
*/
const config = {};
const config = {
watchFolders: [monorepoRoot],
resolver: {
unstable_enableSymlinks: true,
unstable_enablePackageExports: true,
extraNodeModules: extraModules,
resolveRequest(context, moduleName, platform) {
if (forcedModules[moduleName]) {
return {
type: 'sourceFile',
filePath: path.join(forcedModules[moduleName], 'index.js'),
};
}
return context.resolveRequest(context, moduleName, platform);
},
},
};

export default mergeConfig(getDefaultConfig(__dirname), config);
Loading
Loading