-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
15,816 additions
and
29,557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,6 @@ README.md | |
docker-compose.yml | ||
**/.DS_Store | ||
**/venv | ||
**/env | ||
**/env | ||
**/dist | ||
**/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
nodejs 20.2.0 | ||
pnpm 8.6.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM node:20-slim AS base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
FROM base AS prod-deps | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile | ||
|
||
FROM base AS build | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN pnpm run -r build | ||
|
||
FROM base AS app-builder | ||
ENV NODE_ENV=production | ||
ENV PORT=8080 | ||
|
||
# To remove when nested package.json are correctly setup | ||
COPY --from=prod-deps /app/node_modules /app/node_modules | ||
|
||
COPY --from=prod-deps /app/packages/app-builder/node_modules/ /app/packages/app-builder/node_modules | ||
COPY --from=build /app/packages/app-builder/build /app/packages/app-builder/build | ||
COPY --from=build /app/packages/app-builder/public /app/packages/app-builder/public | ||
WORKDIR /app/packages/app-builder | ||
EXPOSE 8080 | ||
CMD [ "pnpm", "exec", "remix-serve", "build"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,52 @@ | ||
# Marble Front Monorepo | ||
|
||
This is the frontend marble monorepo. We use `npm` to handle dependancies and `nx` as build system tool. | ||
This is the frontend marble monorepo. We use `pnpm` to handle dependancies. | ||
|
||
## Getting started | ||
|
||
We recommand you look at [Nx](https://nx.dev/) documentation. For information, most of this monorepo follow the "Integrated Repo" philosophy. | ||
This README is a global README for the monorepo. Each package may have its own README. You can find them in the `packages/*/README.md` files. | ||
|
||
For VS Code users, we higlhy recommand the [official extension](https://nx.dev/core-features/integrate-with-editors#vscode-plugin:-nx-console). It will bring some UI on top of nx consol. It is based on the introspection of the monrepo `project.json` and `package.json` files, and thus can help you inspect/lauch all the targets of each projects. | ||
### Install pnpm | ||
|
||
> There is also some community extensions for WebStorm and Neovim | ||
```bash | ||
brew install pnpm | ||
``` | ||
|
||
## Environment variables in Nx | ||
> NB: more installation options [here](https://pnpm.io/installation) | ||
Nx task runner comes with [a built in opinionated way to handle env variables](https://nx.dev/recipes/environment-variables/define-environment-variables) | ||
To enable shell autocompletion (works for bash, zsh and fish), run: | ||
|
||
```bash | ||
pnpm install-completion | ||
``` | ||
|
||
### Install dependancies | ||
|
||
```bash | ||
pnpm install | ||
``` | ||
|
||
### Work in a package | ||
|
||
Each packages are located in the `packages` folder. To work in a package, you can use the `--filter` option of `pnpm` to trigger the dedicated scripts present in each `packages/*/package.json`. Exemple to start the app builder in dev mode: | ||
|
||
```bash | ||
# This will run the dev script in the ./packages/app-builder/package.json | ||
pnpm --filter app-builder run dev | ||
``` | ||
|
||
### Some usefull commands | ||
|
||
```bash | ||
# Start the builder app in dev mode | ||
pnpm --filter app-builder run dev | ||
|
||
# Generate the marble-api client | ||
pnpm --filter marble-api run generate-api | ||
|
||
# Start the storybook in dev mode | ||
pnpm --filter ui-design-system run storybook | ||
|
||
# Generate icons from svg files | ||
pnpm --filter ui-icons run generate-icons | ||
``` |
Oops, something went wrong.