Skip to content

Commit

Permalink
SBG-ECOM: v0.0.1
Browse files Browse the repository at this point in the history
SBG-ECOM: v0.0.1
  • Loading branch information
crisconru authored May 23, 2024
2 parents b14731e + de692e1 commit a813319
Show file tree
Hide file tree
Showing 98 changed files with 2,653 additions and 19 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/sbg-ecom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: sbg-ecom

on:
workflow_dispatch:
push:
paths:
- packages/sbg-ecom/**

jobs:
# test:
# name: 🧪 Test
# runs-on: ubuntu-latest

# strategy:
# matrix:
# node-version: [18.x, 20.x]

# steps:
# - name: 👍 Checkout
# uses: actions/checkout@v4

# - name: ❇️ Setup node.js
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# cache: 'npm'

# - name: 📥 Install Dependencies
# run: npm install

# - name: 🧑‍🔬 Tests
# run: "npm run sbg-ecom:test"

publish:
name: 🚀 Publish
runs-on: ubuntu-latest
# needs: test
if: github.ref == 'refs/heads/main'

steps:
- name: 👍 Checkout
uses: actions/checkout@v4

- name: ❇️ Setup node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: 📥 Install Dependencies
run: npm install

- name: 🛠️ Build
run: "npm run sbg-ecom:build"

- name: 🚀 Publish to npm
run: "npm publish --access public --workspace=@coremarine/sbg-ecom"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.idea
.DS_Store
packages/**/lib/
imgs/discards

# Logs
logs
Expand Down
14 changes: 6 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ New packages will be publish when a pull request into `main` branch is accepted.

### How to create a TypeScript library

1. Copy the `template-library` folder inside packages and paste as a new folder
1. Copy the `library` folder inside `templates` and paste as a new folder inside `packages` -> `packages/<your-library>`
2. Look for the keyword `TODO:` in your IDE / Editor inside that folder, this is a hint to places you need to setup.
3. Setup npm package -> Modify library `package.json` (`packages/<your-library>/package.json`)
1. `name` to `@coremarine/<your-library>`
Expand All @@ -48,16 +48,15 @@ New packages will be publish when a pull request into `main` branch is accepted.
4. `test`
5. `test:coverage`
5. Setup CI/CD (Github Actions)
1. Go to `.github/workflows` folder
2. Copy `template-library.yml` file and paste as a new yml file `<your-library>.yml`
3. Change all TODO:
1. Copy `library.yml` file inside `templates` and paste as a new yml file `<your-library>.yml` inside `.github/workflows` folder
2. Change all TODO:
6. Document your library -> Modify `README.md` (`packages/<your-library>/README.md`)
7. Start with your library by coding in `src` and testing in `tests`
8. Link your new library in the global / monorepo README

### How to create a NodeRED component

1. Copy the `template-nodered` folder inside packages and paste as a new folder ending with `-nodered` -> `packages/<your-library>-nodered`
1. Copy the `nodered` folder inside `templates` and paste as a new folder ending with `-nodered` inside `packages` -> `packages/<your-library>-nodered`
2. Look for the keyword `TODO:` in your IDE / Editor inside that folder, this is a hint to places you need to setup.
3. Setup npm package -> Modify library `package.json` (`packages/<your-library>/package.json`)
1. `name` to `@coremarine/<your-library>`
Expand All @@ -70,9 +69,8 @@ New packages will be publish when a pull request into `main` branch is accepted.
1. `nodered:docker`
2. `nodered:test`
5. Setup CI/CD (Github Actions)
1. Go to `.github/workflows` folder
2. Copy `template-nodered.yml` file and paste as a new yml file `<your-library>-nodered.yml`
3. Change all TODO:
1. Copy `nodered.yml` file inside `templates` and paste as a new yml file `<your-library>-nodered.yml` inside `.github/workflows` folder
2. Change all TODO:
6. Document your library -> Modify `README.md` (`packages/<your-library>-nodered/README.md`)
7. Add component dependencies to package `Dockerfile` file
8. Rename project into package `docker-compose.yml` file
Expand Down
1 change: 1 addition & 0 deletions clean_monorepo.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
rm -rf node_modules \
packages/nmea-parser/dist packages/nmea-parser/node_modules packages/nmea-parser/coverage \
packages/norsub-emru/dist packages/norsub-emru/node_modules packages/norsub-emru/coverage \
packages/sbg-ecom/dist packages/sbg-ecom/node_modules packages/sbg-ecom/coverage \
packages/septentrio-sbf/dist packages/septentrio-sbf/node_modules packages/septentrio-sbf/coverage \
packages/thelmabiotel-tblive/dist packages/thelmabiotel-tblive/node_modules packages/thelmabiotel-tblive/coverage
Binary file added imgs/cma/cma-logo-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
74 changes: 65 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@
"septentrio-sbf:coverage": "npm run test:coverage --workspace=@coremarine/septentrio-sbf",
"septentrio-sbf:nodered:docker": "npm run docker --workspace=@coremarine/septentrio-sbf-nodered",
"septentrio-sbf:nodered:test": "npm run test --workspace=@coremarine/septentrio-sbf-nodered",
"sbg-ecom:lint": "npm run lint --workspace=@coremarine/sbg-ecom",
"sbg-ecom:format": "npm run format --workspace=@coremarine/sbg-ecom",
"sbg-ecom:build": "npm run build --workspace=@coremarine/sbg-ecom",
"sbg-ecom:test": "npm run test --workspace=@coremarine/sbg-ecom",
"sbg-ecom:coverage": "npm run test:coverage --workspace=@coremarine/sbg-ecom",
"sbg-ecom:nodered:docker": "npm run docker --workspace=@coremarine/sbg-ecom-nodered",
"sbg-ecom:nodered:test": "npm run test --workspace=@coremarine/sbg-ecom-nodered",
"thelmabiotel-tblive:lint": "npm run lint --workspace=@coremarine/thelmabiotel-tblive",
"thelmabiotel-tblive:format": "npm run format --workspace=@coremarine/thelmabiotel-tblive",
"thelmabiotel-tblive:build": "npm run build --workspace=@coremarine/thelmabiotel-tblive",
Expand All @@ -86,7 +93,8 @@
},
"ts-standard": {
"ignore": [
"vitest.workspace.ts"
"vitest.workspace.ts",
"templates"
]
}
}
5 changes: 4 additions & 1 deletion packages/nmea-parser-nodered/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
.flows*
flows_cred.json
tests/nodered/data/package.json

testing-checklist.md
TESTS.md
lines.js
tests/nodered/tests/*.txt
# Logs
logs
*.log
Expand Down
2 changes: 2 additions & 0 deletions packages/nmea-parser/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
.DS_Store
docs
lib
tests/*.txt
*.tss

# Logs
logs
Expand Down
Loading

0 comments on commit a813319

Please sign in to comment.