Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Init repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Vahor committed Aug 27, 2023
1 parent be5b9c6 commit 1c8d0fa
Show file tree
Hide file tree
Showing 24 changed files with 2,385 additions and 280 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-hotels-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pedaki/prettier-config": patch
---

add prettier in peerDependencies
5 changes: 5 additions & 0 deletions .changeset/rude-fans-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pedaki/eslint-config": patch
---

add eslint in peerDependencies
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'todo':
'📦 packages':
- any:
- 'packages/**'
84 changes: 84 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
schedule:
# Run at 19:26 UTC every Tuesday
- cron: "26 19 * * 2"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["typescript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
4 changes: 4 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: 'Pull Request Labeler'
on:
- pull_request_target

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
triage:
permissions:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ jobs:
- name: Install deps
run: pnpm install --child-concurrency 3 --frozen-lockfile --prefer-offline

- name: Create Release Pull Request
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
131 changes: 131 additions & 0 deletions .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Based on https://github.com/Shopify/polaris

name: Snapshot Release

on:
issue_comment:
types:
- created

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
snapshot:
name: Snapshot Release
runs-on: ubuntu-latest
if: |
github.event.issue.pull_request &&
github.event.comment.body == '/snapshot' &&
github.repository == 'pedakihq/pedaki'
steps:
- name: Add initial reaction
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ github.event.comment.id }}
reactions: eyes
edit-mode: replace
body: |
@${{ github.actor }} your snapshot release is being processed.
:hourglass_flowing_sand: This may take a few minutes...
- name: Enforce permission requirement
id: check-permissions
continue-on-error: true
uses: prince-chrismc/check-actor-permissions-action@v2
with:
permission: write

- name: Add reaction if permission requirement not met
if: steps.check-permissions.outcome == 'failure'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ github.event.comment.id }}
reactions: confused
edit-mode: replace
body: |
@${{ github.actor }} you do not have permission to run this command.
Please ask a maintainer to run this command for you.
- name: Exit if permission requirement not met
if: steps.check-permissions.outcome == 'failure'
run: exit 1

- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

# Because changeset entries are consumed and removed on the
# 'changeset-release/main' branch, we need to reset the files
# so the following 'changeset version --snapshot' command will
# regenerate the package version bumps with the snapshot releases
- name: Reset changeset entries on changeset-release/main branch
run: |
if [[ $(git branch --show-current) == 'changeset-release/main' ]]; then
git checkout origin/main -- .changeset
fi
- uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install deps
run: pnpm install --child-concurrency 3 --frozen-lockfile --prefer-offline

- name: Create an .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
- name: Run Changeset
id: changeset
run: |
pnpm exec changeset version --snapshot
pnpm run publish:prepare
output=$(pnpm exec changeset publish --tag next)
echo "$output"
version=$(echo "$output" | grep -zoE 'New tag: *.*@([^ \n]+)' | head -n 1 | sed -E 's/New tag: *.*@([^ \n]+)/\1/')
echo "VERSION=$version"
echo "version=$version" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Send success comment
uses: peter-evans/create-or-update-comment@v3
if: success()
with:
comment-id: ${{ github.event.comment.id }}
reactions: rocket
reactions-edit-mode: replace
edit-mode: replace
body: |
@${{ github.actor }} your snapshot release has been published!
:rocket: `${{ steps.changeset.outputs.version }}`
- name: Send failure comment
uses: peter-evans/create-or-update-comment@v3
if: failure()
with:
comment-id: ${{ github.event.comment.id }}
reactions: -1
reactions-edit-mode: replace
edit-mode: replace
body: |
@${{ github.actor }} your snapshot release failed to publish.
Please check the logs for more information.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
node_modules
node_modules
.envrc
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
File renamed without changes.
43 changes: 33 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
{
"name": "pedaki",
"version": "1.0.0",
"description": "",
"main": "index.js",
"version": "0.0.0",
"private": true,
"repository": "https://github.com/PedakiHQ/pedaki",
"homepage": "https://www.pedaki.fr",
"author": "Nathan David <me@vahor.fr>",
"license": "CC-BY-NC-SA-4.0",
"keywords": [
"pedaki"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"start": "dotenv -- turbo run start",
"format:check": "turbo run format:check",
"format": "turbo run format",
"clean": "turbo run clean",
"build": "dotenv -- turbo run build",
"test": "NODE_ENV=test dotenv -- turbo run test",
"dev": "dotenv -- turbo run dev",
"lint": "SKIP_ENV_VALIDATION=true && turbo run lint",
"publish:prepare": "turbo run publish:prepare",
"publish": "pnpm run publish:prepare && changeset publish",
"typecheck": "turbo run typecheck"
},
"keywords": [],
"author": "Nathan David <me@vahor.fr>",
"license": "MIT",
"dependencies": {
"@changesets/cli": "^2.26.2"
}
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@types/node": "^18.17.11",
"turbo": "^1.10.13"
},
"engines": {
"node": ">=18.0.0 <19.0.0",
"pnpm": ">=8.0.0",
"yarn": "use-pnpm",
"npm": "use-pnpm"
},
"packageManager": "pnpm@8.7.0"
}
1 change: 1 addition & 0 deletions packages/eslint-config/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
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 @@
# @pedaki/eslint-config

## 0.0.1

### Patch Changes

- [#3](https://github.com/PedakiHQ/pedaki/pull/3) [`b35c14e`](https://github.com/PedakiHQ/pedaki/commit/b35c14ed0deee6070b064f9a7c145ee9ca000936) Thanks [@Vahor](https://github.com/Vahor)! - add prettier and eslint packages
1 change: 1 addition & 0 deletions packages/eslint-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @pedaki/eslint-config
37 changes: 37 additions & 0 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import"],
env: {
browser: true,
node: true,
},
extends: [
"next",
"prettier",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
],
ignorePatterns: ["*.tsbuildinfo", "node_modules", "dist", "coverage"],
rules: {
"@next/next/no-html-link-for-pages": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{ checksVoidReturn: false },
],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
},
reportUnusedDisableDirectives: true,
};
25 changes: 25 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@pedaki/eslint-config",
"version": "0.0.1",
"main": "index.js",
"author": "Nathan David <me@vahor.fr>",
"repository": "https://github.com/PedakiHQ/pedaki/tree/main/packages/eslint-config",
"homepage": "https://www.pedaki.fr",
"description": "ESLint configuration for Pedaki projects",
"license": "MIT",
"private": false,
"scripts": {
"format": "prettier --write . --cache",
"format:check": "prettier --check . --cache"
},
"devDependencies": {
"@types/eslint": "^8.44.2",
"@typescript-eslint/eslint-plugin": "6.4.1",
"@typescript-eslint/parser": "6.4.1",
"eslint-config-next": "^13.4.19",
"eslint-config-prettier": "^9.0.0"
},
"peerDependencies": {
"eslint": "^8.47.0"
}
}
1 change: 1 addition & 0 deletions packages/prettier-config/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
Loading

0 comments on commit 1c8d0fa

Please sign in to comment.