Skip to content

Commit

Permalink
Update explore-cytoscape with changes from main (#648)
Browse files Browse the repository at this point in the history
* CLI Version Upgrade
Also fixing the CLI by;
Introducing `tsup` to bundle our packages together into a useable executable.
Migrated `spectral` into `shared` - updated README and steps - now the steps aren't referenced via file and are part of the code itself. Simplfying validation code.

* Cleaned up Spectral from CODEOWNERS

* Update dependency ts-graphviz to v2.1.5 (#629)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Missing package-lock.json (#631)

* Update docusaurus monorepo to v3.6.2 (#605)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matthew Bain <[email protected]>

* Update dependency @types/node to v22.10.1 (#635)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update docusaurus monorepo to v3.6.3 (#633)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* This fixes #316 (#634)

Introducing a `-pretty` flag to the validate command.

* #486 Unify instantiation mechanisms (#521)

* add instantiate module and move relationships/metadata to use it

* #486 initial unification

* #486 add path context to generate command logging

* #486 fix condition when instantiating

* 486 clean up functions and split property instantiation

* #486 lint

* #486 always instantiate 'interfaces' block

* 486 test improvements

* #486 comments cleanup

* #486 test improvements

* Workspace Bin Movement

Now that I know more about workspaces, the published CLI didn't have a bin element so wasn't being linked as part of the release/install.

Also ran lint-fix - so some other line ending fixes.

* Instantiate refs and qualify relative paths when generating

* Extract update logic to higher-order function

* Add schema directory test for qualifying refs

* Properly instantiate enums (first cut)

* Fix typing issue and enum placeholder logic

* Log potential values for an enum when instantiated

* Suggested change to appendPath

* Lint

---------

Co-authored-by: Thels <[email protected]>

* #639 - Github Action Chore - Standardizing Existing - Introducing Docs Build for PRs (#643)

* chore: fixes #639

* Code review fixes

---------

Co-authored-by: Matthew Bain <[email protected]>

* Update docs url to new domain (#644)

* Update dependency globals to v15.13.0 (#641)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update typescript-eslint monorepo to v8.17.0 (#602)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

---------

Co-authored-by: Thels <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matthew Bain <[email protected]>
Co-authored-by: Will Osborne <[email protected]>
Co-authored-by: David Johnston <[email protected]>
  • Loading branch information
6 people authored Dec 3, 2024
1 parent c1842ab commit 514d9a9
Show file tree
Hide file tree
Showing 78 changed files with 10,410 additions and 6,262 deletions.
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

/shared/ @aidanm3341 @lbulanti-ms @willosborne @grahampacker-ms @jpgough-ms @rocketstack-matt @Thels

/spectral/ @willosborne @lbulanti-ms @grahampacker-ms @jpgough-ms @rocketstack-matt

/translator/ @Budlee @matthewgardner @jpgough-ms @rocketstack-matt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CLI
name: Build CLI

on:
pull_request:
Expand All @@ -20,7 +20,6 @@ jobs:
runs-on: ubuntu-latest

steps:
# Ensure full PR checkout
- name: Checkout PR Branch
uses: actions/checkout@v4

Expand All @@ -32,8 +31,11 @@ jobs:
- name: Install workspace
run: npm ci

- name: Lint CLI Module
run: npm run lint --workspace=cli

- name: Build workspace
run: npm run build

- name: Run tests for CLI
run: npm run test --workspace=cli
run: npm run test --workspace=cli
35 changes: 35 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Docs

on:
pull_request:
branches:
- "main"
paths:
- "docs/**"
push:
branches:
- "main"
paths:
- "docs/**"

jobs:
docs:
name: Build Docs Module
runs-on: ubuntu-latest

steps:
- name: Checkout PR Branch
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: v20

- name: Install docs
run: npm ci
working-directory: docs

- name: Build docs
run: npm run build
working-directory: docs
39 changes: 39 additions & 0 deletions .github/workflows/build-shared.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build Shared

on:
pull_request:
branches:
- "main"
paths:
- "shared/**"
push:
branches:
- "main"
paths:
- "shared/**"

jobs:
shared:
name: Build, Test, and Lint Shared Module
runs-on: ubuntu-latest

steps:
- name: Checkout PR Branch
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: v20

- name: Install workspace
run: npm ci

- name: Lint Shared Module
run: npm run lint --workspace=shared

- name: Build workspace
run: npm run build

- name: Run tests for Shared
run: npm run test --workspace=shared
22 changes: 22 additions & 0 deletions .github/workflows/build-translator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build Translators

on:
push:
branches: ["main"]
paths: ["translator/**"]
pull_request:
branches: ["main"]
paths: ["translator/**"]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: maven
- run: mvn -B install --file ./translator/pom.xml
3 changes: 1 addition & 2 deletions .github/workflows/license-scanning-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ jobs:
strategy:
matrix:
node-version: ['20.x']
module-folder: ['cli', 'docs']
module-folder: ['cli', 'docs', 'shared']
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install --omit=dev
# - run: yarn install --production --frozen-lockfile
working-directory: ${{ matrix.module-folder }}
- run: npm install -g node-license-validator
working-directory: ${{ matrix.module-folder }}
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/shared-tests.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/translator.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
- "calm/draft/**"
- "calm/pattern/**"
- "calm/samples/**"
- "spectral/**"
- "shared/src/spectral/**"
push:
branches:
- "main"
paths:
- "calm/draft/**"
- "calm/pattern/**"
- "calm/samples/**"
- "spectral/**"
- "shared/src/spectral/**"

jobs:
spectrals:
Expand All @@ -30,6 +30,16 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: v20
- run: npm install @stoplight/spectral-cli
- run: npx spectral lint --ruleset spectral/instantiation/validation-rules.yaml 'calm/samples/api-gateway-instantiation(*.json|*.yaml)'

- name: Install workspace
run: npm ci

- name: Build workspace
run: npm run build

- name: Install Spectral-CLI
run: npm install @stoplight/spectral-cli

- name: Run Example Spectral Linting
run: npx spectral lint --ruleset ./shared/dist/spectral/rules-instantiation.js 'calm/samples/api-gateway-instantiation(*.json|*.yaml)'

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ node_modules/
**/.vscode-test/
**/out/
**/dependency-check-report/

**/tsconfig.tsbuildinfo
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ your project.

| Project | Lead Maintainers | Builds |
| -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Common Architecture Language Model](./calm) | [@rocketstack-matt](https://github.com/rocketstack-matt), [@jpgough-ms](https://github.com/jpgough-ms) | [![Validation of CALM Samples](https://github.com/finos/architecture-as-code/actions/workflows/spectral-validation.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/spectral-validation.yml) |
| [Docs](./docs) | [@rocketstack-matt](https://github.com/rocketstack-matt) | [![Sync Docs to S3](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml) |
| [CLI](./cli) & [Shared](./shared) | [@aidanm3341](https://github.com/aidanm3341), [@lbulanti-ms](https://github.com/lbulanti-ms), [@willosborne](https://github.com/willosborne), [@grahampacker-ms](https://github.com/grahampacker-ms) [@Thels](https://github.com/Thels) | [![Build CLI](https://github.com/finos/architecture-as-code/actions/workflows/cli-tests.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/cli-tests.yml) [![Build Shared Module](https://github.com/finos/architecture-as-code/actions/workflows/shared-tests.yml/badge.svg?branch=main)](https://github.com/finos/architecture-as-code/actions/workflows/shared-tests.yml) |
| [Spectral](./spectral) | [@willosborne](https://github.com/willosborne), [@lbulanti-ms](https://github.com/lbulanti-ms), [@grahampacker-ms](https://github.com/grahampacker-ms) | [![Validation of CALM Samples](https://github.com/finos/architecture-as-code/actions/workflows/spectral-validation.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/spectral-validation.yml) |
| [Translators](./translator) | [@Budlee](https://github.com/Budlee) [@matthewgardner](https://github.com/matthewgardner) [@jpgough-ms](https://github.com/jpgough-ms) | [![Build Translators](https://github.com/finos/architecture-as-code/actions/workflows/translator.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/translator.yml) |
| [Common Architecture Language Model](./calm) | [@rocketstack-matt](https://github.com/rocketstack-matt), [@jpgough-ms](https://github.com/jpgough-ms) | [![Validation of CALM Samples](https://github.com/finos/architecture-as-code/actions/workflows/spectral-validation.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/validate-spectral.yml) |
| [Docs](./docs) | [@rocketstack-matt](https://github.com/rocketstack-matt) | [![Sync Docs to S3](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml) [![Build Docs](https://github.com/finos/architecture-as-code/actions/workflows/build-docs.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/build-docs.yml) |
| [CLI](./cli) & [Shared](./shared) | [@aidanm3341](https://github.com/aidanm3341), [@lbulanti-ms](https://github.com/lbulanti-ms), [@willosborne](https://github.com/willosborne), [@grahampacker-ms](https://github.com/grahampacker-ms) [@Thels](https://github.com/Thels) | [![Build CLI](https://github.com/finos/architecture-as-code/actions/workflows/build-cli/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/build-cli.yml) [![Build Shared Module](https://github.com/finos/architecture-as-code/actions/workflows/build-shared.yml/badge.svg?branch=main)](https://github.com/finos/architecture-as-code/actions/workflows/build-shared.yml) | |
| [Translators](./translator) | [@Budlee](https://github.com/Budlee) [@matthewgardner](https://github.com/matthewgardner) [@jpgough-ms](https://github.com/jpgough-ms) | [![Build Translator](https://github.com/finos/architecture-as-code/actions/workflows/build-translator.yml/badge.svg)](https://github.com/finos/architecture-as-code/actions/workflows/build-translator.yml) |

## Getting Involved

Expand Down Expand Up @@ -59,6 +58,22 @@ We accept contributions via Pull Request, to make a contribution:
6. Push to the branch (`git push origin feature/fooBar`)
7. Create a new Pull Request


## GitHub actions

There aren't many standards to follow when it comes to Github actions - but some good rules of thumb for this project are;

- GitHub actions should follow the naming conventions of pre-existing actions to maintain consistency. So that users can find other build-related steps in the same place.
- Ensure that any obscure actions are documented so that others can follow and maintain them.


## Language Dependencies

### TypeScript Packages

Currently we have three typescript packages - two of which are managed via `npm workspaces` and one which is just raw `npm`. How these are built and manages slightly differs until they are all under the same worksapce - please look at their related github actions to learn how to build/test each of them.


## License

Copyright 2024 FINOS
Expand Down
4 changes: 2 additions & 2 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ npm install
npm run build
# Step 3: Link the workspace locally for testing
npm link:cli
npm run link:cli
# Step 4: Start the watch process for live development
# Step 4 : Run `watch` to check for changes automatically and re-bundle. This watching is via `chokidar` and isn't instant - give it a second or two to propogate changes.
npm run watch
```
Expand Down
9 changes: 6 additions & 3 deletions cli/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
module.exports = {
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['./**/*.spec.ts'],
testMatch: ['**/*.spec.ts'],
transformIgnorePatterns: [
"<rootDir>/node_modules/(?!calm-shared)",
'<rootDir>/node_modules/(?!@finos/calm-shared)',
'^.+\\.js$'
],
transform: {
'^.+\\.ts?$': 'ts-jest',
},
rootDir: '.',
watchPathIgnorePatterns: ['<rootDir>/../shared/']
};
19 changes: 13 additions & 6 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@finos/calm-cli",
"version": "0.2.6",
"version": "0.2.7",
"description": "A set of tools for interacting with the Common Architecture Language Model (CALM)",
"main": "dist/index.js",
"files": [
Expand All @@ -10,10 +10,10 @@
"calm": "dist/index.js"
},
"scripts": {
"build": "tsc",
"watch": "tsc -watch -p ./",
"clean": "rimraf dist",
"test": "jest --verbose",
"build": "tsup && npm run copy-calm-schema",
"watch": "node watch.mjs",
"copy-calm-schema": "copyfiles \"../calm/draft/2024-04/meta/*\" dist/calm/",
"test": "jest",
"lint": "eslint src",
"lint-fix": "eslint src --fix",
"dependency-check": "dependency-check --project 'calm-cli' --scan . --out ./dependency-check-report --format ALL --suppression ../.github/node-cve-ignore-list.xml"
Expand All @@ -28,6 +28,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"canvas": "^2.11.2",
"commander": "^12.0.0",
"copyfiles": "^2.4.1",
"mkdirp": "^3.0.1"
Expand All @@ -38,11 +39,17 @@
"@types/json-pointer": "^1.0.34",
"@types/junit-report-builder": "^3.0.2",
"@types/lodash": "^4.17.0",
"@types/node": "^22.10.0",
"@types/xml2js": "^0.4.14",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.15.0",
"chokidar": "^4.0.1",
"eslint": "^9.13.0",
"globals": "^15.12.0",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"ts-node": "10.9.2",
"tsup": "^8.0.0",
"typescript": "^5.4.3",
"xml2js": "^0.6.2"
}
Expand Down
Loading

0 comments on commit 514d9a9

Please sign in to comment.