- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
42 lines
1.9 KiB
Markdown
42 lines
1.9 KiB
Markdown
# resolve-workspace-root
|
|
|
|
Resolve the root of a workspace using [bun](https://bun.sh/guides/install/workspaces), [npm](https://docs.npmjs.com/cli/configuring-npm/package-json#workspaces), [pnpm](https://pnpm.io/workspaces), or [yarn](https://yarnpkg.com/features/workspaces).
|
|
|
|
- For bun, npm, and yarn - it looks for a parent **package.json** file, containing the `workspaces` config.
|
|
- For pnpm - it looks for a **package.json** and **pnpm-workspaces.yaml** file, containing the workspaces config.
|
|
|
|
## 🚀 How to use it
|
|
|
|
This package supports both synchronous and asynchronous lookups.
|
|
|
|
```ts
|
|
import { resolveWorkspaceRoot, resolveWorkspaceRootAsync } from 'resolve-workspace-root';
|
|
|
|
// Synchronous lookup, supporting bun, npm, pnpm, and yarn
|
|
const workspaceRoot = resolveWorkspaceRoot(__dirname);
|
|
// Synchronous lookup, supporting only bun, npm, and yarn
|
|
const workspaceRoot = resolveWorkspaceRoot(__dirname, { packageWorkspaces: false });
|
|
// Synchronous lookup, supporting only pnpm
|
|
const workspaceRoot = resolveWorkspaceRoot(__dirname, { pnpmWorkspaces: false });
|
|
|
|
// Asynchronous lookup, supporting bun, npm, pnpm, and yarn
|
|
const workspaceRoot = await resolveWorkspaceRootAsync(__dirname);
|
|
// Asynchronous lookup, supporting only bun, npm, and yarn
|
|
const workspaceRoot = await resolveWorkspaceRootAsync(__dirname, { packageWorkspaces: false });
|
|
// Asynchronous lookup, supporting only pnpm
|
|
const workspaceRoot = await resolveWorkspaceRootAsync(__dirname, { pnpmWorkspaces: false });
|
|
|
|
import { getWorkspaceGlobs, getWorkspaceGlobsAsync } from 'resolve-workspace-root';
|
|
|
|
// Synchronous lookup, supporting bun, npm, pnpm, and yarn
|
|
const workspaces = getWorkspaceGlobs(resolveWorkspaceRoot(__dirname));
|
|
// Asynchronous lookup, supporting bun, npm, pnpm, and yarn
|
|
const workspaces = await getWorkspaceGlobsAsync(resolveWorkspaceRoot(__dirname));
|
|
```
|
|
|
|
<div align="center">
|
|
<br />
|
|
with ❤️ <strong><a href="https://cedric.dev">Cedric</a></strong>
|
|
<br />
|
|
</div>
|