Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bootstrap 🚀 #2

Merged
merged 26 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0ccd483
chore: init migration to public repo
Strazz1337 Mar 15, 2024
ceff4b9
test: fixed tests after porting
Strazz1337 Mar 15, 2024
1e5c8b9
chore: package publish config
Strazz1337 Mar 15, 2024
9125fef
chore: support for disposable
Strazz1337 Mar 16, 2024
89c8ba9
chore: add repository keyword to package.json
Strazz1337 Mar 16, 2024
40fc8a0
chore: added docker compose
Strazz1337 Mar 16, 2024
0aa64c0
fix: get resource after service name set
Strazz1337 Mar 16, 2024
1cd80bc
fix: wrong param type index
Strazz1337 Mar 16, 2024
164873e
chore: init example app for testing
Strazz1337 Mar 16, 2024
fa7f788
docs: additional info in example app
Strazz1337 Mar 16, 2024
e122334
fix: linting errors
Strazz1337 Mar 16, 2024
5f9556b
feat: add $if / this return type
Strazz1337 Mar 17, 2024
9661c39
fix: options merge
Strazz1337 Mar 17, 2024
8fd9d98
feat: log adapter
Strazz1337 Mar 17, 2024
4132047
style: reformat code
Strazz1337 Mar 18, 2024
67f636c
chore: added mit license
Strazz1337 Mar 18, 2024
7caa38a
feat: added pre-commit / linting
Strazz1337 Mar 18, 2024
a73976a
chore(workflows): pr workflow
Strazz1337 Mar 18, 2024
0c2a40c
fix(workflows): removed parallel ci
Strazz1337 Mar 18, 2024
40236f6
chore(workflows): ci master
Strazz1337 Mar 18, 2024
5863755
docs: initial readmes
Strazz1337 Mar 18, 2024
6cfcb4b
chore: rename master to main
Strazz1337 Mar 18, 2024
5fc831c
chore: rename master to main
Strazz1337 Mar 18, 2024
32ca73c
chore: update license authors
Strazz1337 Mar 18, 2024
9eca2a4
chore: set version to 0.1
Strazz1337 Mar 19, 2024
fa18da5
fix: renamed main branch name
Strazz1337 Mar 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
42 changes: 42 additions & 0 deletions .eslintrc.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
}
]
}
70 changes: 70 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"ignorePatterns": [
"**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": [
"*"
]
}
]
}
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
]
}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.spec.ts",
"*.spec.tsx",
"*.spec.js",
"*.spec.jsx"
],
"env": {
"jest": true
},
"rules": {}
}
],
"extends": [
"./.eslintrc.base.json"
]
}
8 changes: 8 additions & 0 deletions .git-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# TODO: Enable format:check, but using statements must first be supported
#npx nx format:check
npx nx affected --target=lint --parallel=8 --exclude=@zonneplan/open-telemetry-js
npx nx affected --target=test --parallel=8 --ci --exclude=@zonneplan/open-telemetry-js
npx nx affected --target=build --parallel=8 --exclude=@zonneplan/open-telemetry-js
58 changes: 58 additions & 0 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: '[MAIN] Lint / Test / Build'

on:
push:
branches:
- main

jobs:
main:
name: Initialize the npm cache and install dependencies
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Nx cache key
id: nx-cache-key
run: echo "KEY=${{ runner.os }}-nx-${{ hashFiles('**/package-lock.json') }}" >> "$GITHUB_OUTPUT"

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
cache: npm

- name: Restore Nx cache
uses: actions/cache/restore@v3
id: nx-cache # use this to check for `cache-hit` ==> if: steps.nx-cache.outputs.cache-hit != 'true'
with:
path: .nx/cache/
key: ${{ env.KEY }}
restore-keys: |
${{ env.KEY }}
Linux-nx-
env:
KEY: ${{ steps.nx-cache-key.outputs.KEY }}

- name: Set shas
uses: nrwl/nx-set-shas@v4
if: ${{ !env.ACT }}
with:
main-branch-name: main

- name: Install dependencies
run: npm ci

- name: Lint
run: npx nx run-many --target=lint --parallel=8 --exclude=@zonneplan/open-telemetry-js

- name: Run tests
run: npx nx run-many --target=test --parallel=8 --ci --exclude=@zonneplan/open-telemetry-js

- name: Build
run: npx nx run-many --target=build --parallel=8 --exclude=@zonneplan/open-telemetry-js
61 changes: 61 additions & 0 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: '[PR] Lint / Test / Build'

on:
pull_request:
paths-ignore:
- '**/*.md'
- '.git-hooks/**'
- '.vscode/**'
- '.tools/**'

jobs:
main:
name: Initialize the npm cache and install dependencies
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Nx cache key
id: nx-cache-key
run: echo "KEY=${{ runner.os }}-nx-${{ hashFiles('**/package-lock.json') }}" >> "$GITHUB_OUTPUT"

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
cache: npm

- name: Restore Nx cache
uses: actions/cache/restore@v3
id: nx-cache # use this to check for `cache-hit` ==> if: steps.nx-cache.outputs.cache-hit != 'true'
with:
path: .nx/cache/
key: ${{ env.KEY }}
restore-keys: |
${{ env.KEY }}
Linux-nx-
env:
KEY: ${{ steps.nx-cache-key.outputs.KEY }}

- name: Set shas
uses: nrwl/nx-set-shas@v4
if: ${{ !env.ACT }}
with:
main-branch-name: main

- name: Install dependencies
run: npm ci

- name: Lint
run: npx nx affected --target=lint --parallel=8 --exclude=@zonneplan/open-telemetry-js

- name: Run tests
run: npx nx affected --target=test --parallel=8 --ci --exclude=@zonneplan/open-telemetry-js

- name: Build
run: npx nx affected --target=build --parallel=8 --exclude=@zonneplan/open-telemetry-js
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
/.nx/cache
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
28 changes: 28 additions & 0 deletions .verdaccio/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# path to a directory with all packages
storage: ../tmp/local-registry/storage

# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
maxage: 60m

packages:
'**':
# give all users (including non-authenticated users) full access
# because it is a local registry
access: $all
publish: $all
unpublish: $all

# if package is not available locally, proxy requests to npm registry
proxy: npmjs

# log settings
logs:
type: stdout
format: pretty
level: warn

publish:
allow_offline: true # set offline to true to allow publish offline
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [

"nrwl.angular-console",
"esbenp.prettier-vscode"
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner"
]
}
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Kevin Boonstra, Richard Tuin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading