Skip to content

Commit f432f31

Browse files
authored
Split main library into three different modules (#26)
1 parent 763a5bb commit f432f31

File tree

245 files changed

+31444
-12110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+31444
-12110
lines changed

.github/workflows/publish.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Publish Packages
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
package:
9+
description: 'Package to publish (all, core, shared, kubeflow)'
10+
required: true
11+
default: 'all'
12+
type: choice
13+
options:
14+
- all
15+
- core
16+
- shared
17+
- kubeflow
18+
19+
jobs:
20+
publish:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
id-token: write
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
registry-url: 'https://registry.npmjs.org'
34+
cache: 'npm'
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Run tests
40+
run: npm run test
41+
42+
- name: Build packages
43+
run: npm run build
44+
45+
- name: Publish all packages
46+
if: github.event_name == 'release' || github.event.inputs.package == 'all'
47+
run: npm run publish:all
48+
env:
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
51+
- name: Publish core package
52+
if: github.event.inputs.package == 'core'
53+
run: npm run publish:core
54+
env:
55+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56+
57+
- name: Publish shared package
58+
if: github.event.inputs.package == 'shared'
59+
run: npm run publish:shared
60+
env:
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
63+
- name: Publish kubeflow package
64+
if: github.event.inputs.package == 'kubeflow'
65+
run: npm run publish:kubeflow
66+
env:
67+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
name: Run Tests
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [20.x, 22.x]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Run linting
32+
run: npm run lint
33+
34+
- name: Run all tests
35+
run: npm run test
36+
37+
- name: Build all packages
38+
run: npm run build
39+
40+
test-coverage:
41+
name: Test Coverage
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Setup Node.js
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: '20.x'
52+
cache: 'npm'
53+
54+
- name: Install dependencies
55+
run: npm ci
56+
57+
- name: Run tests with coverage (mod-arch-core)
58+
run: npm run test:jest -- --coverage --workspace=mod-arch-core
59+
60+
- name: Run tests with coverage (mod-arch-shared)
61+
run: npm run test:jest -- --coverage --workspace=mod-arch-shared
62+
63+
test-individual-packages:
64+
name: Test Individual Packages
65+
runs-on: ubuntu-latest
66+
67+
strategy:
68+
matrix:
69+
package: [mod-arch-core, mod-arch-shared, mod-arch-kubeflow]
70+
71+
steps:
72+
- name: Checkout code
73+
uses: actions/checkout@v4
74+
75+
- name: Setup Node.js
76+
uses: actions/setup-node@v4
77+
with:
78+
node-version: '20.x'
79+
cache: 'npm'
80+
81+
- name: Install dependencies
82+
run: npm ci
83+
84+
- name: Test ${{ matrix.package }}
85+
run: |
86+
if [ "${{ matrix.package }}" = "mod-arch-core" ]; then
87+
npm run test:core
88+
elif [ "${{ matrix.package }}" = "mod-arch-shared" ]; then
89+
npm run test:shared
90+
elif [ "${{ matrix.package }}" = "mod-arch-kubeflow" ]; then
91+
npm run test:kubeflow
92+
fi
93+
94+
- name: Build ${{ matrix.package }}
95+
run: |
96+
if [ "${{ matrix.package }}" = "mod-arch-core" ]; then
97+
npm run build:core
98+
elif [ "${{ matrix.package }}" = "mod-arch-shared" ]; then
99+
npm run build:shared
100+
elif [ "${{ matrix.package }}" = "mod-arch-kubeflow" ]; then
101+
npm run build:kubeflow
102+
fi

.github/workflows/version-bump.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Version Bump
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version-type:
7+
description: 'Version bump type'
8+
required: true
9+
default: 'patch'
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
16+
jobs:
17+
version-bump:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
cache: 'npm'
32+
33+
- name: Configure Git
34+
run: |
35+
git config --local user.email "[email protected]"
36+
git config --local user.name "GitHub Action"
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Run tests
42+
run: npm run test
43+
44+
- name: Bump patch version
45+
if: github.event.inputs.version-type == 'patch'
46+
run: npm run version:patch
47+
48+
- name: Bump minor version
49+
if: github.event.inputs.version-type == 'minor'
50+
run: npm run version:minor
51+
52+
- name: Bump major version
53+
if: github.event.inputs.version-type == 'major'
54+
run: npm run version:major
55+
56+
- name: Push changes
57+
run: |
58+
git push origin main --follow-tags

.npmrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# npm configuration for publishing
2+
save-exact=true
3+
package-lock=true
4+
fund=false
5+
audit-level=moderate
6+
7+
# Registry configuration (uncomment when ready to publish)
8+
# registry=https://registry.npmjs.org/
9+
10+
# Access level for scoped packages
11+
access=public

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to mod-arch-shared
1+
# Contributing to mod-arch-library
22

3-
We love your input! We want to make contributing to mod-arch-shared as easy and transparent as possible, whether it's:
3+
We love your input! We want to make contributing to mod-arch-library as easy and transparent as possible, whether it's:
44

55
- Reporting a bug
66
- Discussing the current state of the code
@@ -33,8 +33,8 @@ We use GitHub to host code, to track issues and feature requests, as well as acc
3333

3434
1. Clone the repository
3535
```
36-
git clone https://github.com/your-organization/mod-arch-shared.git
37-
cd mod-arch-shared
36+
git clone https://github.com/your-organization/mod-arch-library.git
37+
cd mod-arch-library
3838
```
3939

4040
2. Install dependencies
@@ -58,12 +58,12 @@ To test your changes locally without publishing to npm:
5858

5959
2. In your consuming project, run:
6060
```
61-
npm link mod-arch-shared
61+
npm link mod-arch-library
6262
```
6363

6464
3. After you're done testing, you can unlink by running:
6565
```
66-
npm unlink --no-save mod-arch-shared
66+
npm unlink --no-save mod-arch-library
6767
```
6868
in your consuming project, and:
6969
```
@@ -91,7 +91,7 @@ When adding new components to the library, please follow these guidelines:
9191

9292
## Versioning
9393

94-
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your-organization/mod-arch-shared/tags).
94+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your-organization/mod-arch-library/tags).
9595

9696
- **MAJOR** version when you make incompatible API changes
9797
- **MINOR** version when you add functionality in a backwards compatible manner

0 commit comments

Comments
 (0)