@zenuml/core 3.24.2 → 3.24.3
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/.dockerignore +19 -0
- package/Dockerfile +36 -0
- package/README.md +25 -0
- package/package.json +1 -1
- package/vite.config.js +6 -6
package/.dockerignore
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
node_modules
|
|
2
|
+
.git
|
|
3
|
+
.gitignore
|
|
4
|
+
.github
|
|
5
|
+
*.md
|
|
6
|
+
dist
|
|
7
|
+
.watchmanconfig
|
|
8
|
+
.prettierrc
|
|
9
|
+
.prettierignore
|
|
10
|
+
.editorconfig
|
|
11
|
+
.eslintignore
|
|
12
|
+
.eslintrc.js
|
|
13
|
+
.git-blame-ignore-revs
|
|
14
|
+
.vscode
|
|
15
|
+
cypress
|
|
16
|
+
cypress.config.ts
|
|
17
|
+
docs
|
|
18
|
+
test
|
|
19
|
+
vite.config.lib.js
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
FROM node:20-slim AS base
|
|
2
|
+
|
|
3
|
+
# Set environment variables for pnpm
|
|
4
|
+
ENV PNPM_HOME="/pnpm"
|
|
5
|
+
ENV PATH="$PNPM_HOME:$PATH"
|
|
6
|
+
ENV DOCKER=true
|
|
7
|
+
|
|
8
|
+
# Enable corepack to use pnpm
|
|
9
|
+
RUN corepack enable
|
|
10
|
+
|
|
11
|
+
# Set the working directory
|
|
12
|
+
WORKDIR /app
|
|
13
|
+
|
|
14
|
+
# Copy the project files to the working directory
|
|
15
|
+
COPY . .
|
|
16
|
+
|
|
17
|
+
RUN pnpm add -g serve
|
|
18
|
+
|
|
19
|
+
FROM base As prod-deps
|
|
20
|
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts
|
|
21
|
+
FROM base AS deps
|
|
22
|
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
|
23
|
+
|
|
24
|
+
FROM base AS build
|
|
25
|
+
COPY --from=deps /app/node_modules /app/node_modules
|
|
26
|
+
RUN pnpm build:site
|
|
27
|
+
|
|
28
|
+
FROM base
|
|
29
|
+
COPY --from=prod-deps /app/node_modules /app/node_modules
|
|
30
|
+
COPY --from=build /app/dist /app/dist
|
|
31
|
+
|
|
32
|
+
# Expose the port the app runs on
|
|
33
|
+
EXPOSE 8080
|
|
34
|
+
|
|
35
|
+
# Command to run the application
|
|
36
|
+
CMD ["serve", "-s", "dist", "-l", "8080"]
|
package/README.md
CHANGED
|
@@ -90,6 +90,31 @@ tunnels for this.
|
|
|
90
90
|
3. You will be given a command that install a service locally. Run it.
|
|
91
91
|
4. Your localhost:8080 will be available at `air.zenuml.com`.
|
|
92
92
|
|
|
93
|
+
### Docker
|
|
94
|
+
|
|
95
|
+
To run the application using Docker, follow these steps:
|
|
96
|
+
|
|
97
|
+
1. **Build the Docker image**:
|
|
98
|
+
Navigate to the root directory of the project and run the following command to build the Docker image:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
docker build -t zenuml-core .
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
2. **Run the Docker container**:
|
|
105
|
+
After building the image, you can run the Docker container with the following command:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
docker run -p 8080:8080 zenuml-core
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
This will start the application and map port 8080 of the container to port 8080 on your local machine.
|
|
112
|
+
|
|
113
|
+
3. **Access the application**:
|
|
114
|
+
Open your web browser and navigate to `http://localhost:8080` to access the application.
|
|
115
|
+
|
|
116
|
+
Make sure Docker is installed and running on your machine before executing these commands.
|
|
117
|
+
|
|
93
118
|
# Code Structure
|
|
94
119
|
|
|
95
120
|
This repository contains both the DSL parser and the renderer.
|
package/package.json
CHANGED
package/vite.config.js
CHANGED
|
@@ -4,12 +4,12 @@ import createVuePlugin from "@vitejs/plugin-vue";
|
|
|
4
4
|
import { execSync } from "child_process";
|
|
5
5
|
import svgLoader from "vite-svg-loader";
|
|
6
6
|
|
|
7
|
-
process.env.VITE_APP_GIT_HASH =
|
|
8
|
-
|
|
9
|
-
.trim();
|
|
10
|
-
process.env.VITE_APP_GIT_BRANCH =
|
|
11
|
-
|
|
12
|
-
.trim();
|
|
7
|
+
process.env.VITE_APP_GIT_HASH = process.env.DOCKER
|
|
8
|
+
? ""
|
|
9
|
+
: execSync("git rev-parse --short HEAD").toString().trim();
|
|
10
|
+
process.env.VITE_APP_GIT_BRANCH = process.env.DOCKER
|
|
11
|
+
? ""
|
|
12
|
+
: execSync("git branch --show-current").toString().trim();
|
|
13
13
|
|
|
14
14
|
function getCypressHtmlFiles() {
|
|
15
15
|
const cypressFolder = resolve(__dirname, "cy");
|