Skip to content

Commit

Permalink
🎉 init: 初始化项目
Browse files Browse the repository at this point in the history
  • Loading branch information
bfrontend committed May 14, 2023
1 parent 1d16465 commit 0bb2005
Show file tree
Hide file tree
Showing 22 changed files with 4,903 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@webxmsj"
}
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Lint
run: nr lint

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Typecheck
run: nr typecheck

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [16.x]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3

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

- name: Set node version to ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Build
run: nr build

- name: Test
run: nr test
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16.x

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.cache
.DS_Store
.idea
*.log
*.tgz
*.vsix
coverage
dist
lib-cov
logs
node_modules
temp
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore-workspace-root-check=true
node-linker=hoisted
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"amodio.tsl-problem-matcher"
]
}
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "npm: dev"
}
]
}
26 changes: 26 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"problemMatcher": [
{
"base": "$ts-webpack-watch",
"background": {
"activeOnStart": true,
"beginsPattern": "Build start",
"endsPattern": "Build success"
}
}
],
"group": "build"
}
]
}
5 changes: 5 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
src
# node_modules
test
.github
.vscode
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 webxmsj
Copyright (c) 2023 webxmsj <https://github.com/webxmsj>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<p align="center">
<img src="./res/icon.png" height="160"/>
</p>

<h1 align="center">VS Code Open in Browser</h1>

<a href="https://marketplace.visualstudio.com/items?itemName=webxmsj.open-browser" target="__blank"><img src="https://img.shields.io/visual-studio-marketplace/v/webxmsj.open-browser.svg?color=eee&amp;label=VS%20Code%20Marketplace&logo=visual-studio-code" alt="Visual Studio Marketplace Version" /></a>

Add a button to go to the GitHub on the status bar.

![](https://raw.githubusercontent.com/webxmsj/images/main/vscode-open-browser.png)

## License

[MIT](./LICENSE) License © 2022 [webxmsj](https://github.com/webxmsj)
Binary file added open-repository-0.0.1.zip
Binary file not shown.
139 changes: 139 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"publisher": "webxmsj",
"name": "open-browser",
"displayName": "Open repository in browser",
"version": "0.0.1",
"private": true,
"packageManager": "[email protected]",
"description": "Add a button to open current project in browser",
"author": "webxmsj <[email protected]>",
"license": "MIT",
"funding": "https://github.com/sponsors/webxmsj",
"homepage": "https://github.com/webxmsj/open-browser#readme",
"repository": {
"type": "git",
"url": "https://github.com/webxmsj/open-browser"
},
"bugs": {
"url": "https://github.com/webxmsj/open-browser/issues"
},
"sponsor": {
"url": "https://github.com/sponsors/webxmsj"
},
"categories": [
"Other"
],
"main": "./dist/index.js",
"icon": "res/icon.png",
"files": [
"dist"
],
"engines": {
"vscode": "^1.77.0"
},
"activationEvents": [
"onStartupFinished"
],
"contributes": {
"commands": [
{
"command": "open-browser.open",
"category": "open-browser",
"title": "open repository in browser"
}
],
"configuration": {
"type": "object",
"title": "open repository in browser extension configuration",
"properties": {
"open-browser.textTransform": {
"type": "string",
"enum": [
"none",
"uppercase",
"lowercase",
"capitalize"
],
"default": "capitalize",
"description": "Defines project name text style inside template"
},
"open-browser.colorful": {
"type": "boolean",
"default": true,
"description": "Use color"
},
"open-browser.color": {
"type": "string",
"default": "",
"description": "The color of status text. When not defined, a random color will be used based on the project name."
},
"open-browser.remoteName": {
"type": "string",
"default": "origin",
"description": "Name of the remote repository"
},
"open-browser.branch": {
"type": "string",
"description": "Name of the remote branch",
"default": "master"
},
"open-browser.useLocalBranch": {
"type": "boolean",
"description": "Use the local branch instead of the fixed remote branch",
"default": true
},
"open-browser.useLocalRange": {
"type": "boolean",
"description": "Highlight the local selection range, if there's one",
"default": true
},
"open-browser.alignPriority": {
"type": "number",
"default": 100000,
"description": "Defines priority of the label. Higher values mean the label should be shown more to the left, requires restart of vscode"
},
"open-browser.useLocalLine": {
"type": "boolean",
"description": "Highlight the local line if there's no selection range",
"default": false
}
}
}
},
"scripts": {
"build": "tsup src/index.ts --external vscode",
"dev": "nr build --watch",
"lint": "eslint .",
"vscode:prepublish": "nr build",
"publish": "vsce publish",
"pack": "vsce package",
"test": "vitest",
"typecheck": "tsc --noEmit",
"release": "bumpp && nr publish"
},
"devDependencies": {
"@antfu/ni": "^0.21.2",
"@types/findup-sync": "^4.0.2",
"@types/lodash": "^4.14.194",
"@types/node": "^18.15.11",
"@types/vscode": "^1.77.0",
"@vscode/vsce": "^2.19.0",
"@webxmsj/eslint-config": "^0.0.11",
"bumpp": "^9.1.0",
"eslint": "^8.37.0",
"esno": "^0.16.3",
"pnpm": "^8.1.1",
"rimraf": "^4.4.1",
"tsup": "^6.7.0",
"typescript": "^5.0.3",
"vite": "^4.2.1",
"vitest": "^0.29.8"
},
"dependencies": {
"find-up": "^6.3.0",
"findup-sync": "^5.0.0",
"lodash": "^4.17.21",
"pify": "^6.1.0",
"simple-git": "^3.18.0"
}
}
Loading

0 comments on commit 0bb2005

Please sign in to comment.