Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
iSplasher committed Sep 9, 2023
0 parents commit 98fea45
Show file tree
Hide file tree
Showing 55 changed files with 1,177 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# force everything to be LF,
# except for Windows batch files that require CRLF

* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
115 changes: 115 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Release Obsidian plugin

on:
push:
branches:
- master

env:
NODE_VERSION: "18.x"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # entire history is needed for the changelog

- name: Read manifest
run: |
echo "PLUGIN_ID=$(cat manifest.json | jq -r '.id')" >> $GITHUB_ENV
echo "PLUGIN_NAME=$(cat manifest.json | jq -r '.name')" >> $GITHUB_ENV
echo "PLUGIN_VERSION=$(cat manifest.json | jq -r '.version')" >> $GITHUB_ENV
echo "TAG_NAME=$(cat manifest.json | jq -r '.version')" >> $GITHUB_ENV
# check if tag exists and fail if not [force-release] in commit message
- name: Check if tag exists
id: check_tag
if: "!contains(github.event.head_commit.message, '[force-release]')"
run: |
git fetch --tags &> /dev/null
if git rev-parse ${{ env.TAG_NAME }} >/dev/null 2>&1; then
echo "Tag ${{ env.TAG_NAME }} already exists; Use [force-release] to skip check."
exit 1
else
echo "Will create tag ${{ env.TAG_NAME }} on release."
echo "PUSH_TAG=true" >> $GITHUB_ENV
fi
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"

- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: node_modules-${{hashFiles('package-lock.json')}}
restore-keys: node_modules- # Take any latest cache if failed to find it for current lock file

- name: Install dependencies
run: npm install

- name: Build
id: build
run: npm run build

- name: Generate changelog
id: changelog
uses: orhun/git-cliff-action@v2
with:
config: cliff.toml
args: --verbose --tag ${{ env.TAG_NAME }}
env:
OUTPUT: CHANGELOG.md


- name: Commit and push changelog
run: |
if ! git diff --quiet CHANGELOG.md; then
git config --local user.name "Github Actions"
git config --local user.email "[email protected]"
git add CHANGELOG.md
git commit -m "Update CHANGELOG.md"
git push
else
echo "No changes to CHANGELOG.md"
fi
- name: Create tag and push
if: env.PUSH_TAG == 'true'
run: |
git config --local user.name "Github Actions"
git config --local user.email "[email protected]"
git commit --allow-empty -m "Release ${{ env.TAG_NAME }}"
git tag ${{ env.TAG_NAME }}
git push
git push origin ${{ env.TAG_NAME }}
- name: Generate latest changes
id: changes
uses: orhun/git-cliff-action@v2
with:
config: cliff.toml
args: --verbose --latest --strip header
env:
OUTPUT: "CHANGELOG.md"

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.TAG_NAME }}
body: ${{ steps.changes.outputs.content }}
draft: false
prerelease: false
fail_on_unmatched_files: true
files: |
main.js
styles.css
manifest.json
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

dist/

**/*/.vitepress/*
!**/*/.vitepress/config.mjs

**/*/docs/src/api/

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# next.js
.next/
out/
build

# misc
.DS_Store
*.pem

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

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

# turbo
.turbo

# vercel
.vercel
41 changes: 41 additions & 0 deletions .vscode/insight-formatter.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"folders": [
{
"name": "✨ insight-formatter",
"path": ".."
},
{
"name": "⚙️ @insight-formatter/eslint-config-custom",
"path": "../config/eslint-config-custom"
},
{
"name": "⚙️ @insight-formatter/tsconfig",
"path": "../config/tsconfig"
},
{
"name": "⚙️ @insight-formatter/typedoc",
"path": "../config/typedoc"
},
{
"name": "📦 @insight-formatter/components",
"path": "../core/components"
},
{
"name": "📦 @insight-formatter/docs",
"path": "../core/docs"
},
{
"name": "🚀 @insight-formatter/formatter",
"path": "../core/formatter"
},
{
"name": "📦 @insight-formatter/cpp",
"path": "../languages/cpp"
}
],
"settings": {
"monorepoWorkspace.folders.regex.apps": "^app|web|api|frontend|backend|core/formatter",
"monorepoWorkspace.folders.regex.libs": "^common|package|lib|private|plugins|languages|core",
"monorepoWorkspace.folders.regex.tools": "^tool|script|util|config"
}
}
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Turborepo starter

This is an official starter Turborepo.

## Using this example

Run the following command:

```sh
npx create-turbo@latest
```

## What's inside?

This Turborepo includes the following packages/apps:

### Apps and Packages

- `docs`: a [Next.js](https://nextjs.org/) app
- `web`: another [Next.js](https://nextjs.org/) app
- `ui`: a stub React component library shared by both `web` and `docs` applications
- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `tsconfig`: `tsconfig.json`s used throughout the monorepo

Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).

### Utilities

This Turborepo has some additional tools already setup for you:

- [TypeScript](https://www.typescriptlang.org/) for static type checking
- [ESLint](https://eslint.org/) for code linting
- [Prettier](https://prettier.io) for code formatting

### Build

To build all apps and packages, run the following command:

```
cd my-turborepo
pnpm build
```

### Develop

To develop all apps and packages, run the following command:

```
cd my-turborepo
pnpm dev
```

### Remote Caching

Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands:

```
cd my-turborepo
npx turbo login
```

This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:

```
npx turbo link
```

## Useful Links

Learn more about the power of Turborepo:

- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
Binary file added bun.lockb
Binary file not shown.
79 changes: 79 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# git-cliff ~ default configuration file
# https://git-cliff.org/docs/configuration
#
# Lines starting with "#" are comments.
# Configuration options are organized into tables and keys.
# See documentation for more information on available options.

[changelog]
# changelog header
header = """
### Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://tera.netlify.app/docs
body = """
{% if version %}\
#### [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
#### [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
##### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
The entire changelog is found at `CHANGELOG.md`.
<!-- generated by git-cliff -->
"""

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features ✨" },
{ message = "^fix", group = "Bug Fixes 🐞" },
{ message = "^doc", group = "Documentation" },
{ message = "^ench", group = "Changes 🛠" },
{ message = "^improv", group = "Changes 🛠" },
{ message = "^perf", group = "Performance ⚡️" },
{ message = "^refactor", group = "Refactor" },
{ message = "^style", group = "Styling" },
{ message = "^test", group = "Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore", group = "Miscellaneous Tasks" },
{ body = ".*security", group = "Security 🔒" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# glob pattern for matching git tags
tag_pattern = "[0-9]*"
# regex for skipping tags
skip_tags = "0.0.0"
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42
3 changes: 3 additions & 0 deletions config/eslint-config-custom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@turbo/eslint-config`

Collection of internal eslint configurations.
Loading

0 comments on commit 98fea45

Please sign in to comment.