Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
Co-authored-by: S. Ali Mihandoost <alimd@gmail.com>
  • Loading branch information
njfamirm and S. Ali Mihandoost committed Dec 4, 2024
0 parents commit 9158322
Show file tree
Hide file tree
Showing 40 changed files with 9,686 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig is awesome: https://EditorConfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 140

[*.{js,ts}]
block_comment_start = /**
block_comment = *
block_comment_end = */

[*.md]
trim_trailing_whitespace = false
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.js
*.mjs
*.cjs
*.d.ts
/demo/es-bench/
/uniquely/flight-finder-pwa
node_modules
_data
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"root": true,
"extends": "@alwatr/eslint-config"
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @AliMD
56 changes: 56 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: /
open-pull-requests-limit: 20
commit-message:
prefix: 'deps'
reviewers:
- AliMD
schedule:
interval: weekly
time: '00:30'
day: 'thursday'
labels:
- ci
- priority-low
- maintenance
groups:
github-actions:
patterns:
- '*'

- package-ecosystem: npm
directory: /
versioning-strategy: increase
open-pull-requests-limit: 20
commit-message:
prefix: 'deps'
reviewers:
- AliMD
schedule:
interval: weekly
time: '00:30'
day: 'thursday'
labels:
- dependencies
- ci
- priority-low
- maintenance
groups:
production-dependencies:
dependency-type: 'production'
exclude-patterns:
- '@alwatr/*'
- 'fract'
development-dependencies:
dependency-type: 'development'
exclude-patterns:
- '@alwatr/*'
- 'fract'
alwatr-dependencies:
patterns:
- '@alwatr/*'
- 'fract'
90 changes: 90 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
- name: 'bug-report'
color: ee0811
description: 'Inconsistencies or issues which will cause a problem for users or implementors.'
- name: 'feature-request'
color: 0e9a26
description: 'Request new features or options.'

- name: 'breaking-change'
color: ee0701
description: 'A change that changes the API or breaks backward compatibility for users.'
- name: 'bugfix'
color: ee0701
description: 'Inconsistencies or issues which will cause a problem for users or implementors.'
- name: 'documentation'
color: 0052cc
description: 'Solely about the documentation of the project.'
- name: 'enhancement'
color: 1d76db
description: 'Enhancement of the code, not introducing new features.'
- name: 'refactor'
color: 1d76db
description: 'Updating the code with simpler, easier to understand or more efficient syntax or methods.'
- name: 'performance'
color: 1d76db
description: 'Improving performance of the project, not introducing new features.'
- name: 'new-feature'
color: 0e8a16
description: 'New features or options.'
- name: 'maintenance'
color: 2af79e
description: 'Generic maintenance tasks.'
- name: 'ci'
color: 1d76db
description: 'Work that improves the continuous integration.'
- name: 'dependencies'
color: 1d76db
description: 'Change in project dependencies.'

- name: 'in-progress'
color: fbca04
description: 'Issue is currently being worked on by a developer.'
- name: 'stale'
color: fef2c0
description: 'No activity for quite some time.'
- name: 'no-stale'
color: fef2c0
description: 'This is exempt from the stale bot.'
- name: 'auto-closed'
color: fef2c0
description: 'No activity for quite some time.'

- name: 'security'
color: ee0701
description: 'Addressing a vulnerability or security risk in this project.'
- name: 'incomplete'
color: fef2c0
description: 'Missing information.'
- name: 'invalid'
color: fef2c0
description: "This is off-topic, spam, or otherwise doesn't apply to this project."

- name: 'good first issue'
color: 0e8a16
description: 'Good first issue for people wanting to contribute to this project.'
- name: 'help-wanted'
color: 0e8a16
description: 'We need some extra helping hands or expertise in order to resolve this!'

- name: 'priority-critical'
color: ee0701
description: 'Must be addressed as soon as possible.'
- name: 'priority-high'
color: b60205
description: 'After critical issues are fixed, these should be dealt with before any further issues.'
- name: 'priority-medium'
color: 0e8a16
description: 'This issue may be useful, and needs some attention.'
- name: 'priority-low'
color: e4ea8a
description: 'Nice addition, maybe... someday...'

- name: 'major'
color: b60205
description: 'This PR causes a major bump in the version number.'
- name: 'minor'
color: 0e8a16
description: 'This PR causes a minor bump in the version number.'
- name: 'release'
color: 5319E7
description: 'Release PR from next to main.'
61 changes: 61 additions & 0 deletions .github/workflows/build-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Build & Lint

on:
workflow_dispatch:

pull_request:

push:
branches:
- next
- main

env:
NODE_VERSION: lts/*

jobs:
build-lint-ts:
name: Build & Lint Typescript
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: ⤵️ Checkout repository
uses: actions/checkout@v4.2.2

- name: 🏗 Setup nodejs
uses: actions/setup-node@v4.1.0
with:
node-version: ${{ env.NODE_VERSION }}

- name: 🏗 Setup nodejs corepack
run: corepack enable

- name: 🏗 Get yarn config
id: yarn_config
run: echo "cache_folder=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: 🏗 Cache Layer
uses: actions/cache@v4.1.2
# id: yarn_cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn_config.outputs.cache_folder }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: 🏗 Install dependencies
run: yarn install --immutable

- name: 🚀 Build Typescript
run: yarn build

- name: 🚀 Run ESLint
run: yarn lint

- name: 🚀 Run Jest
run: yarn test
48 changes: 48 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: CodeQL

on:
workflow_dispatch:

schedule:
- cron: '0 7 * */2 *'
# │ │ │ │ │
# │ │ │ │ └─── day of the week (0 - 6 or SUN-SAT)
# │ │ │ └────── month (1 - 12 or JAN-DEC)
# │ │ └───────── day of the month (1 - 31)
# │ └─────────── hour (0 - 23)
# └───────────── minute (0 - 59)

jobs:
analyze-code-ql:
name: CodeQL Analyze
runs-on: ubuntu-latest

permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['TypeScript']
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: ⤵️ Checkout repository
uses: actions/checkout@v4.2.2

- name: 🏗 Initialize CodeQL
uses: github/codeql-action/init@v3.27.0
with:
languages: ${{ matrix.language }}
# 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

- name: 🏗 Auto build
uses: github/codeql-action/autobuild@v3.27.0

- name: 🚀 Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.27.0
23 changes: 23 additions & 0 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Dependency Review

on:
workflow_dispatch:

pull_request:

jobs:
dependency-review:
name: Dependency Review
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: ⤵️ Checkout repository
uses: actions/checkout@v4.2.2

- name: 🚀 Dependency Review
uses: actions/dependency-review-action@v4.4.0
63 changes: 63 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Publish NPM

on:
workflow_dispatch:

release:
types:
- created

env:
NODE_VERSION: lts/*

jobs:
publish-npm:
if: github.repository_owner == 'Alwatr'

name: Publish NPM
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: ⤵️ Checkout repository
uses: actions/checkout@v4.2.2

- name: 🏗 Setup nodejs
uses: actions/setup-node@v4.1.0
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'

- name: 🏗 Setup nodejs corepack
run: corepack enable

- name: 🏗 Get yarn config
id: yarn_config
run: echo "cache_folder=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: 🏗 Cache Layer
uses: actions/cache@v4.1.2
# id: yarn_cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn_config.outputs.cache_folder }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: 🏗 Install dependencies
run: yarn install --immutable

- name: 🏗 Build Typescript
run: yarn build

# - name: 🚀 Extra Packages Build
# run: yarn build:r

- name: 🚀 Publish
run: yarn run publish --yes
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Loading

0 comments on commit 9158322

Please sign in to comment.