Skip to content

Commit

Permalink
Merge pull request #187 from shawakash/pkg
Browse files Browse the repository at this point in the history
feat: updating scripts and pipeline and adding some actions
  • Loading branch information
shawakash authored Mar 8, 2024
2 parents 62ec2cf + 2f0d245 commit dd8d74e
Show file tree
Hide file tree
Showing 31 changed files with 486 additions and 44 deletions.
14 changes: 14 additions & 0 deletions .changeset/hip-islands-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@paybox/common": patch
"@repo/eslint-config": patch
"@paybox/kafka": patch
"@paybox/recoil": patch
"@repo/typescript-config": patch
"@paybox/ui": patch
"@paybox/api": patch
"@paybox/serverless": patch
"@paybox/zeus": patch
"@paybox/openapi": patch
---

feat: updating scripts and pipeline and adding some actions
43 changes: 43 additions & 0 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Changesets
description: A GitHub action to automate releases with Changesets
runs:
using: "node20"
main: "dist/index.js"
inputs:
publish:
description: "The command to use to build and publish packages"
required: false
version:
description: "The command to update version, edit CHANGELOG, read and delete changesets. Default to `changeset version` if not provided"
required: false
cwd:
description: Sets the cwd for the node process. Default to `process.cwd()`
required: false
commit:
description: |
The commit message. Default to `Version Packages`
required: false
title:
description: The pull request title. Default to `Version Packages`
required: false
setupGitUser:
description: Sets up the git user for commits as `"github-actions[bot]"`. Default to `true`
required: false
default: true
createGithubReleases:
description: "A boolean value to indicate whether to create Github releases after `publish` or not"
required: false
default: true
outputs:
published:
description: A boolean value to indicate whether a publishing is happened or not
publishedPackages:
description: >
A JSON array to present the published packages. The format is `[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@xx/xy", "version": "0.8.9"}]`
hasChangesets:
description: A boolean about whether there were changesets. Useful if you want to create your own publishing functionality.
pullRequestNumber:
description: The pull request number that was created or updated
branding:
icon: "package"
color: "blue"
File renamed without changes.
67 changes: 67 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
rules:
- name: "bug"
if: "contains(github.event.pull_request.title, 'bug')"
color: "d73a4a"
description: "Something isn't working"
- name: "enhancement"
if: "contains(github.event.pull_request.title, 'feature')"
color: "a2eeef"
description: "New feature or request"
- name: "documentation"
if: "contains(github.event.pull_request.title, 'docs')"
color: "0075ca"
description: "Documentation improvement"


# Add 'root' label to any root file changes
# Quotation marks are required for the leading asterisk
root:
- changed-files:
- any-glob-to-any-file: '*'

# Add 'AnyChange' label to any changes within the entire repository
AnyChange:
- changed-files:
- any-glob-to-any-file: '**'

# Add 'Documentation' label to any changes within 'docs' folder or any subfolders
Documentation:
- changed-files:
- any-glob-to-any-file: docs/**

# Add 'Documentation' label to any file changes within 'docs' folder
Documentation:
- changed-files:
- any-glob-to-any-file: docs/*

# Add 'Documentation' label to any file changes within 'docs' or 'guides' folders
Documentation:
- changed-files:
- any-glob-to-any-file:
- docs/*
- guides/*

## Equivalent of the above mentioned configuration using another syntax
Documentation:
- changed-files:
- any-glob-to-any-file: ['docs/*', 'guides/*']

# Add 'Documentation' label to any change to .md files within the entire repository
Documentation:
- changed-files:
- any-glob-to-any-file: '**/*.md'

# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
source:
- all:
- changed-files:
- any-glob-to-any-file: 'src/**/*'
- all-globs-to-all-files: '!src/docs/*'

# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
feature:
- head-branch: ['^feature', 'feature']

# Add 'release' label to any PR that is opened against the `main` branch
release:
- base-branch: 'main'
25 changes: 25 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- id: label-the-PR
uses: actions/labeler@v5

- id: run-frontend-tests
if: contains(steps.label-the-PR.outputs.all-labels, 'frontend')
run: |
echo "Running frontend tests..."
# Put your commands for running frontend tests here
- id: run-backend-tests
if: contains(steps.label-the-PR.outputs.all-labels, 'backend')
run: |
echo "Running backend tests..."
# Put your commands for running backend tests here
9 changes: 9 additions & 0 deletions apps/web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @paybox/web

## 0.0.8

### Patch Changes

- Updated dependencies
- @paybox/common@0.1.0
- @paybox/recoil@0.1.0
- @paybox/openapi@0.1.0

## 0.0.7

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paybox/web",
"version": "0.0.7",
"version": "0.0.8",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -12,9 +12,9 @@
"dependencies": {
"@faker-js/faker": "^8.4.0",
"@hookform/resolvers": "^3.3.4",
"@paybox/common": "^0.0.6",
"@paybox/openapi": "^0.0.7",
"@paybox/recoil": "^0.0.6",
"@paybox/common": "^0.1.0",
"@paybox/openapi": "^0.1.0",
"@paybox/recoil": "^0.1.0",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
Expand Down
17 changes: 17 additions & 0 deletions backend/api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @paybox/api

## 0.0.9

### Patch Changes

- Updated dependencies
- @paybox/kafka@2.0.0
- @paybox/openapi@0.1.1

## 0.0.8

### Patch Changes

- Updated dependencies
- @paybox/common@0.1.0
- @paybox/kafka@1.1.0
- @paybox/openapi@0.1.0

## 0.0.7

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions backend/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paybox/api",
"version": "0.0.7",
"version": "0.0.9",
"main": "./src/index.ts",
"types": "./src/index.ts",
"type": "commonjs",
Expand All @@ -15,9 +15,9 @@
"dependencies": {
"@apollo/server": "^4.10.0",
"@aws-sdk/client-s3": "^3.523.0",
"@paybox/common": "^0.0.6",
"@paybox/kafka": "^1.0.0",
"@paybox/openapi": "^0.0.7",
"@paybox/common": "^0.1.0",
"@paybox/kafka": "^2.0.0",
"@paybox/openapi": "^0.1.1",
"@solana/spl-token": "^0.3.11",
"@solana/wallet-adapter-wallets": "^0.19.26",
"@solana/web3.js": "^1.89.0",
Expand Down
7 changes: 7 additions & 0 deletions backend/serverless/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @paybox/serverless

## 0.0.8

### Patch Changes

- init package publishing
2 changes: 1 addition & 1 deletion backend/serverless/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paybox/serverless",
"version": "0.0.7",
"version": "0.0.8",
"main": "./src/index.ts",
"types": "./src/index.ts",
"type": "commonjs",
Expand Down
7 changes: 7 additions & 0 deletions backend/zeus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @paybox/zeus

## 0.1.0

### Minor Changes

- init package publishing
5 changes: 3 additions & 2 deletions backend/zeus/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@paybox/zeus",
"version": "0.0.6",
"version": "0.1.0",
"main": "./src/index.ts",
"types": "./src/index.ts",
"license": "MIT",
"private": "true",
"scripts": {
"zeus": "zeus http://localhost:8112/v1/graphql ./src --header=x-hasura-admin-secret:myadminsecretkey --header=x-hasura-role:admin && prettier src/zeus/*.ts --write",
"build": "esbuild ./src/index.js --bundle --platform=node --outfile=dist/index.js",
"build": "tsup src/index.ts --format cjs,esm --dts",
"dev": "yarn build -- --watch",
"codegen": "graphql-codegen generate --config src/codegen.yml"
},
"dependencies": {
Expand Down
18 changes: 18 additions & 0 deletions openapi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @paybox/openapi

## 0.1.1

### Patch Changes

- Updated dependencies
- @paybox/kafka@2.0.0

## 0.1.0

### Minor Changes

- init package publishing

### Patch Changes

- Updated dependencies
- @paybox/kafka@1.1.0

## 0.0.7

### Patch Changes
Expand Down
13 changes: 7 additions & 6 deletions openapi/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "@paybox/openapi",
"version": "0.0.7",
"main": "./src/index.ts",
"types": "./src/index.d.ts",
"version": "0.1.1",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"type": "commonjs",
"license": "MIT",
"private": "true",
"scripts": {
"dev": "node dist/index.js --trace-warning",
"build": "esbuild ./src/index.js --bundle --platform=node --outfile=dist/index.js && cp ./src/swagger/swagger.yaml ./dist/swagger.yaml",
"build": "tsup src/index.ts --format cjs,esm --dts && cp ./src/swagger/swagger.yaml ./dist/swagger.yaml",
"dev": "yarn build -- --watch",
"gen": "openapi-generator generate -i src/swagger/swagger.yaml -g typescript-axios -o ./src/spec-client && npx openapi-typescript src/swagger/swagger.yaml -o ./src/openapi.d.ts"
},
"dependencies": {
"@openapitools/openapi-generator-cli": "^2.9.0",
"@paybox/kafka": "^1.0.0",
"@paybox/kafka": "^2.0.0",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.6",
"global": "^4.4.0",
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"db": "docker compose -f ./backend/hasura/docker-compose.yml up",
"hasura": "hasura console --project backend/hasura/hasura",
"kafka": "docker compose -f ./docker/kafka/docker-compose.yml up",
"bump-versions": "yarn changeset version && yarn install"
"bump-versions": "yarn changeset version && yarn install",
"publish-packages": "turbo run build && changeset version && changeset publish"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -44,6 +45,7 @@
"husky": "^9.0.10",
"next": "^14.1.3",
"openapi-typescript-codegen": "^0.27.0",
"react": "^18.2.0"
"react": "^18.2.0",
"tsup": "^8.0.2"
}
}
7 changes: 7 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @paybox/common

## 0.1.0

### Minor Changes

- init package publishing
10 changes: 6 additions & 4 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "@paybox/common",
"version": "0.0.6",
"main": "./src/index.ts",
"types": "./src/index.ts",
"version": "0.1.0",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"private": "true",
"scripts": {
"build": "esbuild ./src/index.js --bundle --platform=node --outfile=dist/index.js"
"build": "tsup src/index.ts --format cjs,esm --dts",
"dev": "yarn build -- --watch"
},
"license": "MIT",
"dependencies": {
Expand Down
7 changes: 7 additions & 0 deletions packages/eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @repo/eslint-config

## 0.1.0

### Minor Changes

- init package publishing
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@repo/eslint-config",
"version": "0.0.6",
"version": "0.1.0",
"private": true,
"files": [
"library.js",
Expand Down
Loading

0 comments on commit dd8d74e

Please sign in to comment.