Skip to content

Commit

Permalink
feat: open source
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenngoclongdev committed Sep 16, 2024
1 parent 6a42bab commit b8bfea3
Show file tree
Hide file tree
Showing 48 changed files with 10,630 additions and 14 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)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/old-chefs-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"terminal-keeper": patch
---

open source
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
31 changes: 23 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,36 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
labels: ''
assignees: ''

---

**Describe the bug**
<!--- A clear and concise description of what the bug is. --->
A clear and concise description of what the bug is.

**To Reproduce**
<!--- Steps to reproduce the behavior: --->
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. --->
A clear and concise description of what you expected to happen.

**Platform:**
- OS:
- vscode version:
- extension version:
**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- VSCode Version [e.g. 22]

**Smartphone (please complete the following information):**
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- VSCode Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
14 changes: 10 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature request
labels: ''
assignees: ''

---

**Please describe feature/problem details and solution you'd like.**
<!--- A clear and concise description of what the problem is and solution you'd like--->
**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. --->
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.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: ci

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
steps:
- uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@vscode-utility'

- name: Install dependency
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release Pull Request or publish package
id: changesets
uses: changesets/action@v1
with:
commit: 'chore: update versions'
title: 'chore: update versions'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to Visual Studio Marketplace
if: steps.changesets.outputs.hasChangesets == 'true'
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VSCE_PAT }}
preRelease: false
registryUrl: https://marketplace.visualstudio.com

- name: Publish to Open VSX Registry
if: steps.changesets.outputs.hasChangesets == 'true'
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
preRelease: false
148 changes: 148 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: manual

on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release Type'
required: true
type: choice
default: 'patch'
options:
- patch
- minor
- major
releaseChannel:
description: 'Release Channel'
required: true
type: choice
default: stable
options:
- stable
- edge
publishMarketplace:
description: 'Publish on Visual Studio Marketplace?'
required: true
type: choice
default: 'yes'
options:
- 'yes'
- 'no'
publishOpenVSX:
description: 'Publish on Open VSX Registry?'
required: true
type: choice
default: 'yes'
options:
- 'yes'
- 'no'

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node version
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@vscode-utility'

- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Check style and format
run: npm run lint
- name: Test package
uses: coactions/setup-xvfb@v1
with:
run: npm test

- name: Setup Git
run: |
git config --global user.name "LongNguyen"
git config --global user.email "[email protected]"
- name: Get Current Version Number
run: |
CURRENT_VERSION=$(cat package.json | jq .version | cut -d'"' -f 2)
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
- name: Bump New Version (Edge)
if: ${{ github.event.inputs.releaseChannel == 'edge' && !contains(env.CURRENT_VERSION, 'edge') }}
run: |
RELEASE_VERSION=$(npx semver $CURRENT_VERSION -i pre${{ github.event.inputs.releaseType }} --preid edge)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "Bump to $RELEASE_VERSION"
- name: Bump New Version (Edge)
if: ${{ github.event.inputs.releaseChannel == 'edge' && contains(env.CURRENT_VERSION, 'edge') }}
run: |
RELEASE_VERSION=$(npx semver $CURRENT_VERSION -i prerelease)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "Bump to $RELEASE_VERSION"
- name: Bump New Version (Stable)
if: ${{ github.event.inputs.releaseChannel == 'stable' }}
run: |
RELEASE_VERSION=$(npx semver $CURRENT_VERSION -i github.event.inputs.releaseType)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "Bump to $RELEASE_VERSION"
- name: Version Package
run: |
npm version $RELEASE_VERSION
git tag -a $RELEASE_VERSION -m "$RELEASE_VERSION"
- name: Publish to Visual Studio Marketplace (Edge)
if: ${{ github.event.inputs.publishMarketplace == 'yes' && github.event.inputs.releaseChannel == 'edge' }}
uses: HaaLeo/publish-vscode-extension@v1
with:
preRelease: true
pat: ${{ secrets.VSCE_PAT }}
registryUrl: https://marketplace.visualstudio.com
- name: Publish to Visual Studio Marketplace (Stable)
if: ${{ github.event.inputs.publishMarketplace == 'yes' && github.event.inputs.releaseChannel == 'stable' }}
uses: HaaLeo/publish-vscode-extension@v1
with:
preRelease: false
pat: ${{ secrets.VSCE_PAT }}
registryUrl: https://marketplace.visualstudio.com

- name: Publish to Open VSX Registry (Edge)
if: ${{ github.event.inputs.publishOpenVSX == 'yes' && github.event.inputs.releaseChannel == 'edge' }}
uses: HaaLeo/publish-vscode-extension@v1
with:
preRelease: true
pat: ${{ secrets.OPEN_VSX_TOKEN }}
- name: Publish to Open VSX Registry (Stable)
if: ${{ github.event.inputs.publishOpenVSX == 'yes' && github.event.inputs.releaseChannel == 'stable' }}
uses: HaaLeo/publish-vscode-extension@v1
with:
preRelease: false
pat: ${{ secrets.OPEN_VSX_TOKEN }}

- name: Push Tags
run: |
git log -1 --stat
git push origin main --tags
- run: |
export GIT_TAG=$(git describe --tags --abbrev=0)
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV
- name: GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: './*.tgz'
bodyFile: CHANGELOG.md
tag: ${{ env.GIT_TAG }}
prerelease: ${{ github.event.inputs.releaseChannel == 'edge' }}
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
.DS_Store
dist
node_modules
.vscode-test/
*.vsix
**/.DS_Store
.npmrc
temp.*
**/.DS_Store
src/__test__/fixtures/*.ts
pnpm-lock.yaml
yarn-lock.json
web/build/**
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": []
}
37 changes: 37 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--disable-extensions"],
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
"name": "Run Web Extension in VS Code",
"type": "extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionDevelopmentKind=web", "--disable-extensions"],
"outFiles": ["${workspaceFolder}/dist/web/**/*.js"],
"preLaunchTask": "npm: watch-web"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/dist/__test__/suite/index",
"--launchArgs=${workspaceFolder}/src/__test__/fixtures/",
"--disable-extensions"
],
"outFiles": ["${workspaceFolder}/dist/__test__/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
Loading

0 comments on commit b8bfea3

Please sign in to comment.