Skip to content

Commit 2b52dab

Browse files
authored
chore: use maxgraph@core 0.1.0 (#28)
The workflow now build the projects with both the maxGraph version declared in package.json and a locally built development version. Also bump the ubuntu runner from 20.04 to 22.04.
1 parent 93a4d70 commit 2b52dab

File tree

8 files changed

+40
-45
lines changed

8 files changed

+40
-45
lines changed

.github/workflows/check-typescript-projects.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424

2525
jobs:
2626
build_maxgraph_package:
27-
runs-on: ubuntu-20.04
27+
runs-on: ubuntu-22.04
2828
steps:
2929
- uses: actions/checkout@v3
3030
with:
@@ -46,38 +46,35 @@ jobs:
4646
packages/core/maxgraph-core-*.tgz
4747
4848
build_example:
49-
runs-on: ubuntu-20.04
49+
runs-on: ubuntu-22.04
5050
needs: [build_maxgraph_package]
5151
strategy:
5252
# don't cancel running jobs even if one fails
5353
fail-fast: false
5454
matrix:
5555
project: [parcel-ts, rollup-ts, vitejs-ts]
56-
env:
57-
project_dir: ${{github.workspace}}/projects/${{matrix.project}}
58-
maxgraph_package_dir: ${{github.workspace}}/..
56+
npm-package: ['release', 'development']
57+
defaults:
58+
run:
59+
working-directory: ${{github.workspace}}/projects/${{matrix.project}}
5960
steps:
60-
- name: Download maxgraph npm package
61+
- name: Download the maxgraph npm package
62+
if: ${{ matrix.npm-package == 'development' }}
63+
id: 'download'
6164
uses: actions/download-artifact@v3
6265
with:
6366
name: maxgraph-npm-package
64-
path: ${{env.maxgraph_package_dir}}
65-
- name: Get path to the maxgraph npm package archive
66-
working-directory: ${{env.maxgraph_package_dir}}
67-
run: |
68-
echo "pwd:" && pwd
69-
echo "ls:" && ls -lh
70-
echo "package file:" && ls maxgraph-core*
71-
echo "path:" && echo "`pwd`/`ls maxgraph-core*`"
72-
echo "maxgraph_package_path=`pwd`/`ls maxgraph-core*`" >> $GITHUB_ENV
67+
path: ${{github.workspace}}/../maxgraph-npm-package
7368
- uses: actions/checkout@v3
7469
- name: Setup node
7570
uses: actions/setup-node@v3
7671
with:
7772
node-version-file: '.nvmrc'
78-
- name: Install dependencies and link the local maxgraph npm package
79-
working-directory: ${{env.project_dir}}
80-
run: npm install ${{env.maxgraph_package_path}}
73+
- name: Install dependencies
74+
run: npm install
75+
- name: Install maxgraph development npm package
76+
if: ${{ matrix.npm-package == 'development' }}
77+
# use wildcard as the file contains the version, and we don't know it
78+
run: npm install ${{steps.download.outputs.download-path}}/maxgraph-core*.tgz
8179
- name: Build project
82-
working-directory: ${{env.project_dir}}
8380
run: npm run build

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
Demonstrate how to integrate [maxGraph](https://github.com/maxGraph/maxGraph/) in projects.
44

5-
**Important**: currently, there is no package published on npmjs, so use the [maxGraph development version](#maxgraph-dev-version)
6-
75
## Getting started
86

97
### Setup
@@ -18,6 +16,13 @@ nvm use
1816
If the Node version is not installed, `nvm` will state how to install the required version.
1917

2018

19+
### Available projects
20+
21+
- [TypeScript with Parcel](./projects/parcel-ts/README.md)
22+
- [TypeScript with Rollup](./projects/rollup-ts/README.md)
23+
- [TypeScript with ViteJs](./projects/vitejs-ts/README.md)
24+
25+
2126
### <a id="maxgraph-dev-version"></a> Use the maxGraph development version
2227

2328
Build [maxGraph](https://github.com/maxGraph/maxGraph/) locally:
@@ -30,10 +35,3 @@ In this folder where you clone the `maxgraph-integration-examples` project, go t
3035
Repack of maxgraph is automatically available in the examples
3136
- alternative: `npm install <path_to_locally_installed_maxgraph>/packages/core/maxgraph-core-0.1.0.tgz`. This changes
3237
the package.json file. You must run this command again each time you rebuild the maxgraph npm package.
33-
34-
35-
### Available projects
36-
37-
- [TypeScript with Parcel](./projects/parcel-ts/README.md)
38-
- [TypeScript with Rollup](./projects/rollup-ts/README.md)
39-
- [TypeScript with ViteJs](./projects/vitejs-ts/README.md)

projects/parcel-ts/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
Parcel v2 is used in this TypeScript project: https://parceljs.org
44

5-
<!-- not working for now, no package available on npmjs
5+
## Setup
6+
67
From the project root, run `npm install`.
7-
-->
88

9-
See the README about maxGraph integration.
9+
If you want to use the maxGraph development version (built locally), see the README about maxGraph integration.
10+
11+
## Running the project
1012

11-
Then, run `npm run dev` and go to http://localhost:1234/
13+
Run `npm run dev` and go to http://localhost:1234/
1214

1315
If you want to bundle the application, run `npm run build`.

projects/parcel-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "tsc && parcel build index.html"
88
},
99
"dependencies": {
10-
"@maxgraph/core": "*"
10+
"@maxgraph/core": "0.1.0"
1111
},
1212
"devDependencies": {
1313
"parcel": "~2.8.2",

projects/rollup-ts/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ Adapted from https://github.com/typed-mxgraph/typed-mxgraph-example-bundled-with
99

1010
### Setup
1111

12-
See the README about maxGraph integration.
12+
From the project root, run `npm install`.
1313

14-
<!-- does not work for now
15-
```shell
16-
npm install
17-
```
18-
-->
14+
If you want to use the maxGraph development version (built locally), see the README about maxGraph integration.
1915

2016
### Running the project
2117

projects/rollup-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"start": "serve public"
1010
},
1111
"dependencies": {
12-
"@maxgraph/core": "*"
12+
"@maxgraph/core": "0.1.0"
1313
},
1414
"devDependencies": {
1515
"@rollup/plugin-node-resolve": "~15.0.1",

projects/vitejs-ts/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
Initialized from https://github.com/vitejs/vite/tree/v2.9.8/packages/create-vite/template-vanilla-ts
44

5-
<!-- not working for now, no package available on npmjs
5+
## Setup
6+
67
From the project root, run `npm install`.
7-
-->
88

9-
See the README about maxGraph integration.
9+
If you want to use the maxGraph development version (built locally), see the README about maxGraph integration.
10+
11+
## Running the project
1012

11-
Then, run `npm run dev` and go to http://localhost:5173/
13+
Run `npm run dev` and go to http://localhost:5173/
1214

1315
If you want to bundle the application, run `npm run build` and then run `npm run preview` to access to a preview of the
1416
bundle application.

projects/vitejs-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"preview": "vite preview"
99
},
1010
"dependencies": {
11-
"@maxgraph/core": "*"
11+
"@maxgraph/core": "0.1.0"
1212
},
1313
"devDependencies": {
1414
"typescript": "~4.9.4",

0 commit comments

Comments
 (0)