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

PIN-5062 - Added outbound models #1

Merged
merged 12 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
extends: ["@pagopa/eslint-config/strong"],
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.eslint.json",
},
rules: {
// Any project level custom rule
"@typescript-eslint/switch-exhaustiveness-check": "error",
"default-case": "off",
"prefer-arrow/prefer-arrow-functions": "off",
eqeqeq: ["error", "smart"],
"@typescript-eslint/consistent-type-definitions": "off",
"sort-keys": "off",
"functional/prefer-readonly-type": "off",
"@typescript-eslint/no-shadow": "off",
"extra-rules/no-commented-out-code": "off",
"sonarjs/no-duplicate-string": "off",
"max-lines-per-function": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-use-before-define": "off",
},
ignorePatterns: [".eslintrc.cjs", "**/src/gen/**/*.ts", "**/dist"],
};
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PR build
on:
pull_request:

jobs:
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: ./package.json
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm format:check

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: ./package.json
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm lint

check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: ./package.json
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm check

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: ./package.json
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm build
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish package to GitHub Packages
on:
push:
branches:
- main
paths-ignore:
- "CODEOWNERS"
- "**.md"
- ".**"

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://npm.pkg.github.com"
scope: "@pagopa"

- uses: pnpm/action-setup@v2

- run: pnpm i --frozen-lockfile
- run: pnpm build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.BOT_TOKEN }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed this guide.
BOT_TOKEN should be added to the repo secrets @galales

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀
I would leave to @micdes-pagopa the final word

50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Created by https://www.toptal.com/developers/gitignore/api/node,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=node,visualstudiocode

### Node ###
# Logs
logs
*.log
.pnpm-debug.log*

# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Output of 'npm pack'
*.tgz

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

**/dist
/src/gen

# MinIO container data
docker/minio-data

### Turbo ###
# Turborepo task cache
.turbo
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/gen/**/*
dist/**
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"editor.formatOnSave": true,
"prettier.requireConfig": false,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib",
"files.watcherExclude": {
"**/target": true
}
}
45 changes: 45 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "pagopa-interop-outbound-models",
"version": "1.0.0",
"private": true,
"description": "PagoPA Interoperability outbound models",
"main": "dist",
"type": "module",
"exports": {
".": "./dist/index.js"
},
"scripts": {
"postinstall": "pnpm run generate-protobuf",
"lint": "eslint . --ext .ts,.tsx",
"lint:autofix": "eslint . --ext .ts,.tsx --fix",
"format:check": "prettier --check src",
"format:write": "prettier --write src",
"build": "tsc",
"check": "tsc --project tsconfig.check.json",
"generate-protobuf": "mkdirp ./src/gen && npx protoc --ts_opt=eslint_disable --ts_out ./src/gen --proto_path ./proto ./proto/**/**/*.proto && tsc-esm-fix --src='src/gen/' --ext='.js'"
},
"keywords": [],
"author": "",
"license": "Apache-2.0",
"dependencies": {
"ts-pattern": "5.2.0",
"zod": "3.23.8"
},
"devDependencies": {
"eslint": "8.57.0",
"mkdirp": "3.0.1",
"prettier": "2.8.8",
"tsc-esm-fix": "2.20.27",
"typescript": "5.4.5",
"@types/node": "20.14.6",
"@protobuf-ts/protoc": "2.9.4",
"@protobuf-ts/plugin": "2.9.4",
"@protobuf-ts/runtime": "2.9.4",
"@tsconfig/node-lts": "20.1.3",
"@pagopa/eslint-config": "3.0.0"
},
"config": {
"protocVersion": "26.1"
},
"packageManager": "[email protected]"
}
Loading
Loading