Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyingchun committed Aug 1, 2024
0 parents commit e95f9cb
Show file tree
Hide file tree
Showing 109 changed files with 15,354 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Armit Code of Conduct

## Scope

This code of conduct applies to those who wish to contribute to the Vendure project (any repo under the [hyperse-io](https://github.com/hyperse-io) organization) by way of issues and pull requests. It also applies to official project communications channels such as Slack.

## Standards

Contributors should conduct themselves according to these guidelines:

1. Treat others as you would wish to be treated.
2. Keep your communication professional<sup>1</sup>.
3. Refrain from unkind or inflammatory communications.

## Enforcement

Contributors and other community members can and should enforce the standard above. The mark of an effective and cohesive group is that the individual members enforce the mores of the group.

However, in certain circumstances a report to the project maintainers may be warranted. In this case, contact us at *[email protected]* so we can deal with it in an appropriate manner.

---

<sup>1</sup>_Definition of "professional":_

1. characterized by or conforming to the technical or ethical standards of a profession
2. exhibiting a courteous, conscientious, and generally businesslike manner in the workplace
[source: [www.merriam-webster.com](https://www.merriam-webster.com/dictionary/professional)]
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [hyperse-net]
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Something not working as it should
title: ""
labels: "type: bug \U0001F41B"
assignees: hyperse-net
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**

- @hyperse/\* version:
- Nodejs version:
- Database (mysql/postgres etc):

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
65 changes: 65 additions & 0 deletions .github/actions/yarn-nm-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
########################################################################################
# "yarn install" composite action for yarn 2/3/4+ and "nodeLinker: node-modules" #
#--------------------------------------------------------------------------------------#
# Cache: #
# - Downloaded zip archive (multi-arch, preserved across yarn.lock changes) #
# - Yarn install state (discarded in yarn.lock changes) #
# References: #
# - bench: https://gist.github.com/belgattitude/0ecd26155b47e7be1be6163ecfbb0f0b #
# - vs @setup/node: https://github.com/actions/setup-node/issues/325 #
########################################################################################

name: 'Monorepo install (yarn)'
description: 'Run yarn install with node_modules linker and cache enabled'
inputs:
skip-prisma-postinstall-generate:
description: 'Avoid prisma to automatically generate schema on postinstall'
required: false
default: 'true'
playwright-skip-browser-download:
description: 'Avoid playwright to download browsers automatically'
required: false
default: '1'

runs:
using: 'composite'

steps:
- name: Expose yarn config as "$GITHUB_OUTPUT"
id: yarn-config
shell: bash
run: |
echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
# Yarn rotates the downloaded cache archives, @see https://github.com/actions/setup-node/issues/325
# Yarn cache is also reusable between arch and os.
- name: Restore yarn cache
uses: actions/cache@v4
id: yarn-download-cache
with:
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
key: yarn-download-cache-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-download-cache-
# Save install_state (invalidated on yarn.lock changes)
- name: Restore yarn install state
id: yarn-install-state-cache
uses: actions/cache@v4
with:
path: .yarn/ci-cache/
key: ${{ runner.os }}-yarn-install-state-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}

- name: Install dependencies
shell: bash
run: |
yarn install --immutable --inline-builds
env:
# CI optimizations. Overrides yarnrc.yml options (or their defaults) in the CI action.
YARN_ENABLE_GLOBAL_CACHE: 'false' # Use local cache folder to keep downloaded archives
YARN_NM_MODE: 'hardlinks-local' # Hardlinks-(local|global) reduces io / node_modules size
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz # Very small speedup when lock does not change
# Other environment variables
HUSKY: '0' # By default do not run HUSKY install
PRISMA_SKIP_POSTINSTALL_GENERATE: ${{ inputs.skip-prisma-postinstall-generate }}
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: ${{ inputs.playwright-skip-browser-download }}
26 changes: 26 additions & 0 deletions .github/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Set to true to add reviewers to PRs
addReviewers: true

# Set to 'author' to add PR's author as a assignee
addAssignees: author

# A list of reviewers to be added to PRs (GitHub user name)
reviewers:
- hyperse-net

# A number of reviewers added to the PR
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 1

# A list of assignees, overrides reviewers if set
assignees:
- hyperse-net

# A number of assignees to add to the PRs
# Set to 0 to add all of the assignees.
# Uses numberOfReviewers if unset.
numberOfAssignees: 0

# A list of keywords to be skipped the process if PR's title include it
skipKeywords:
- wip
14 changes: 14 additions & 0 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Assign
on:
issues:
types: [opened]
pull_request:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/auto-assign@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: .github/auto-assign.yml
58 changes: 58 additions & 0 deletions .github/workflows/ci-integrity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI-integrity

on:
push:
branches:
- main
- major
- minor
paths:
- 'package.json'
- '*.lock'
- '.yarnrc.yml'
- '.github/**'

pull_request:
branches:
- main
- major
- minor
types:
- opened
- synchronize
- reopened
paths:
- 'package.json'
- '*.lock'
- '.yarnrc.yml'
- '.github/**'

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: 📥 Monorepo install
uses: ./.github/actions/yarn-nm-install

- name: Check for duplicate dependencies in lock file
run: |
yarn dedupe --check
- name: Check for yarn constraints.pro
run: |
yarn constraints
# https://github.com/sverweij/dependency-cruiser
# - name: Check monorepo dependency graph
# run: |
# yarn check:install
48 changes: 48 additions & 0 deletions .github/workflows/release-or-version-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ReleaseOrVersionPR

on:
push:
branches:
- main

jobs:
release:
# Basic security: the release job can only be executed from this repo and from the main branch (not a remote thing)
if: ${{ github.repository == 'tianyingchun/monorepo-turborepo' && contains('refs/heads/main',github.ref)}}
name: Release and changelog
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
# To run comparison we need more than the latest commit.
# @link https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
fetch-depth: 0

- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: 📥 Monorepo install
uses: ./.github/actions/yarn-nm-install

# @link https://github.com/changesets/action
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn g:release
cwd: ${{ github.workspace }}
title: '[Release] Version packages'
# Optional, might be used in conjunction with GITHUB_TOKEN to
# allow running the workflows on a Version package action.
# Be aware of security implications.
# setupGitUser: true
env:
# See https://github.com/changesets/action/issues/147
HOME: ${{ github.workspace }}
# Allows to download / query / comment packages
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Allows to publish packages
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
58 changes: 58 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

# Docker overrides

./docker-compose.override.yml

# Deployment platforms

.vercel
.swc
.next


# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Testing
/coverage

# Next.js
.next
out

# Production
build
dist

# Misc
.DS_Store
*.pem
tsconfig.tsbuildinfo
tsconfig.dev.tsbuildinfo
tsconfig.build.tsbuildinfo


# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.eslintcache

# Local ENV files
.env.local
.env.development.local
.env.test.local
.env.production.local

# Vercel
.vercel

# Turborepo
.turbo
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
2 changes: 2 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

yarn commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

yarn g:lint-staged-files --debug

Empty file added .npmrc
Empty file.
Loading

0 comments on commit e95f9cb

Please sign in to comment.