Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aniravi24 committed Sep 2, 2024
0 parents commit 3ac59db
Show file tree
Hide file tree
Showing 52 changed files with 9,587 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
13 changes: 13 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@changesets/changelog-github",
{ "repo": "aniravi24/typeshift" }
],
"commit": false,
"fixed": [["typeshift"]],
"ignore": [],
"updateInternalDependencies": "patch"
}
115 changes: 115 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// Default template copied from: https://cz-git.qbb.sh/config/

/** @type {import('cz-git').UserConfig} */
module.exports = {
// I'm just putting something in here because this rules key can't be empty
// If you see red underline in the rules object, make sure it's not "LintLens", that's just a false positive from ESLint VSCode extension
rules: {
// @see: https://commitlint.js.org/#/reference-rules
"header-max-length": [2, "always", 120],
"scope-case": [0],
"subject-case": [0],
},
prompt: {
// alias: { fd: "docs: fix typos" },
messages: {
type: "Select the type of change that you're committing:",
scope: "Denote the SCOPE of this change (optional):",
customScope: "Denote the SCOPE of this change:",
subject: "Write a SHORT, IMPERATIVE tense description of the change:\n",
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
breaking:
'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',
footerPrefixSelect:
"Select the ISSUES type of changeList by this change (optional):",
customFooterPrefix: "Input ISSUES prefix:",
footer: "List any ISSUES by this change. E.g.: #31, #34:\n",
generatingByAI: "Generating your AI commit subject...",
generatedSelectByAI: "Select suitable subject by AI generated:",
confirmCommit: "Are you sure you want to proceed with the commit above?",
},
types: [
{ value: "feat", name: "feat: A new feature", emoji: ":sparkles:" },
{ value: "fix", name: "fix: A bug fix", emoji: ":bug:" },
{
value: "docs",
name: "docs: Documentation only changes",
emoji: ":memo:",
},
{
value: "style",
name: "style: Changes that do not affect the meaning of the code",
emoji: ":lipstick:",
},
{
value: "refactor",
name: "refactor: A code change that neither fixes a bug nor adds a feature",
emoji: ":recycle:",
},
{
value: "perf",
name: "perf: A code change that improves performance",
emoji: ":zap:",
},
{
value: "test",
name: "test: Adding missing tests or correcting existing tests",
emoji: ":white_check_mark:",
},
{
value: "build",
name: "build: Changes that affect the build system or external dependencies",
emoji: ":package:",
},
{
value: "ci",
name: "ci: Changes to our CI configuration files and scripts",
emoji: ":ferris_wheel:",
},
{
value: "chore",
name: "chore: Other changes that don't modify src or test files",
emoji: ":hammer:",
},
{
value: "revert",
name: "revert: Reverts a previous commit",
emoji: ":rewind:",
},
],
useEmoji: false,
emojiAlign: "center",
useAI: false,
aiNumber: 1,
themeColorCode: "",
// scopes,
// allowCustomScopes: true,
allowEmptyScopes: true,
customScopesAlign: "top",
customScopesAlias: "custom",
emptyScopesAlias: "empty",
upperCaseSubject: false,
markBreakingChangeMode: false,
allowBreakingChanges: ["feat", "fix"],
breaklineNumber: 100,
breaklineChar: "|",
skipQuestions: [],
issuePrefixes: [
{ value: "closed", name: "closed: ISSUES has been processed" },
],
customIssuePrefixAlign: "top",
emptyIssuePrefixAlias: "skip",
customIssuePrefixAlias: "custom",
allowCustomIssuePrefix: true,
allowEmptyIssuePrefix: true,
confirmColorize: true,
maxHeaderLength: 120,
maxSubjectLength: Infinity,
minSubjectLength: 0,
scopeOverrides: undefined,
defaultBody: "",
defaultIssues: "",
defaultScope: "",
defaultSubject: "",
},
};
70 changes: 70 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
// This helps turn off rules that may conflict with prettier, we don't use it for anything else
"extends": ["prettier"],
"ignorePatterns": ["migrations", "models", "generated", "dist", "docs"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.mts", "*.js", "*.jsx"],
"plugins": ["sort-keys"],
"rules": {
"sort-keys": "off", // disable default eslint sort-keys
"sort-keys/sort-keys-fix": "error"
}
},
{
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict"
],
"files": ["*.ts", "*.tsx", "*.mts"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["simple-import-sort", "import", "typescript-sort-keys"],
"rules": {
"@typescript-eslint/ban-ts-comment": [
"error",
{
"minimumDescriptionLength": 3,
"ts-check": false,
"ts-expect-error": "allow-with-description"
}
],
"@typescript-eslint/consistent-type-definitions": [
"error",
"interface"
],
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/no-non-null-assertion": "off", // this rule just isn't useful for us right now
"@typescript-eslint/no-throw-literal": "off",
"@typescript-eslint/no-unnecessary-condition": "off", // this rule just isn't useful for us right now
// This is already managed by typescript itself
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/restrict-plus-operands": "off", // this rule just isn't useful for us right now
"@typescript-eslint/restrict-template-expressions": "off", // this rule just isn't useful for us right now
// "@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/sort-type-constituents": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/unbound-method": "off",
"eqeqeq": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"no-extra-bind": "error",
"no-fallthrough": "error",
"no-invalid-regexp": "error",
"no-invalid-this": "error",
"no-return-assign": "error",
"no-self-compare": "error",
"no-useless-concat": "error",
"no-useless-return": "error",
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
"typescript-sort-keys/interface": "error"
}
}
],
"root": true
}
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Bug Report
description: File a bug report
title: "issue: "
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: version
attributes:
label: Version Number
description: What's the version number?
placeholder: Version number.
validations:
required: true
- type: input
id: codesandbox
attributes:
label: Codesandbox/Stackblitz
description: Codesandbox/Stackblitz link
- type: textarea
id: what-happened
attributes:
label: Steps to reproduce
placeholder: Tell us what you see!
value: |
1. Setup queue '...'
2. Run node '....'
3. See error
validations:
required: true
- type: textarea
id: what-expect
attributes:
label: Expected behavior
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: environment-info
attributes:
label: Additional Environment Information
description: Please tell us anything we should know about your environment. This could include Operating System, JS runtime version (Node.js, etc.)
render: shell
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
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: "feature request, waiting-up-vote"
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.
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Pull Request Template

## Proposed Changes

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing tests pass locally with my changes
52 changes: 52 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Main Release

on:
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
HUSKY: 0

jobs:
run:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2

- name: Setup Node 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"

- name: Install deps
run: pnpm install && pnpm postinstall-steps

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Generate docs
if: steps.changesets.outputs.published == 'true'
run: pnpm docgen

- name: Deploy docs to gh-pages
if: steps.changesets.outputs.published == 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs
Loading

0 comments on commit 3ac59db

Please sign in to comment.