Skip to content

Commit

Permalink
Merge pull request #30 from alovajs/feat/split-extension-package
Browse files Browse the repository at this point in the history
Feat/split extension package
  • Loading branch information
JOU-amjs authored Nov 8, 2024
2 parents 4e34fcd + 3c60f92 commit add925a
Show file tree
Hide file tree
Showing 177 changed files with 44,633 additions and 3,914 deletions.
22 changes: 22 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "alovajs/devtools" }],
"commit": false,
"fixed": [],
"linked": [],
"ignore": [
"api-v3-js-commonjs-test",
"api-js-commonjs-test",
"api-v3-js-test",
"api-v3-ts-test",
"api-js-test",
"api-ts-test",
"api-common"
],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "minor",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
5 changes: 5 additions & 0 deletions .changeset/cyan-rats-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'alova-vscode-extension': major
---

the first GA version
5 changes: 5 additions & 0 deletions .changeset/slow-kids-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@alova/wormhole': patch
---

initial version
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service_name: github-action
repo_token: k4mCwLORlEDAb7wQcYXgMbvAwx2CadBOE
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

52 changes: 0 additions & 52 deletions .eslintrc.cjs

This file was deleted.

3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github: alovajs
open_collective: alova
custom: https://afdian.net/a/huzhen555
10 changes: 10 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See https://github.com/actions/labeler

'🚨 action':
- .github/workflows/**

'wormhole':
- packages/wormhole/**

'vscode':
- packages/vscode-extension/**
15 changes: 15 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Automatically labels PRs based on the configuration file
# you are probably looking for 👉 `.github/labeler.yml`
name: Label PRs

on:
- pull_request_target

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
sync-labels: true
43 changes: 43 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: pull_request check

# trigger condition: pull_request to any branch
on:
pull_request:
paths-ignore:
- '.vscode/**'
- '**/*.md'
- '.github/**'
- '.changeset/**'

jobs:
quality:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.head.ref, 'changeset-release') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

# install pnpm version by `packageManager` in package.json
- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Lint check
run: pnpm run lint

- name: Format
run: pnpm run format

- name: Unit tests
run: pnpm run test
76 changes: 76 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Release

# trigger condition: pull_request to any branch
on:
push:
branches:
- main

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

# install pnpm version by `packageManager` in package.json
- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Lint check
run: pnpm run lint

- name: Format
run: pnpm run format

release:
runs-on: ubuntu-latest
needs: [quality]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

# install pnpm version by `packageManager` in package.json
- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/[email protected]
with:
# Note: pnpm install after versioning is necessary to refresh lockfile
version: pnpm run changeset:version
publish: pnpm run release
commit: 'ci: release'
title: 'ci: release'
env:
# Needs access to push to main
GITHUB_TOKEN: ${{ secrets.ALOVA_GITHUB_TOKEN }}
# Needs access to publish to npm
NPM_TOKEN: ${{ secrets.NPM_ALOVA_PUBLISH_TOKEN }}
# publish vscode extension to marketplace
VSCE_PAT: ${{ secrets.VSCODE_EXTENSION_TOKEN }}
11 changes: 4 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ dist
*.vsix
.vscode-test/

# 忽略test下的生成文件
test/api-*/src/*
test/api-*/*openapi*.*
test/api-*/*swagger*.*
test/api-*/alova.config.*
!test/api-*/src/.gitkeep
!test/api-common/*
# testing
/coverage

alova_tmp_*
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# Ensure files are linted before commit
pnpm lint-staged
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
enable-pre-post-scripts = true
10 changes: 8 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-extension",
"-u",
"tdd",
"--disable-extensions"
],
"cwd": "${workspaceFolder}/packages/vscode-extension",
"outFiles": ["${workspaceFolder}/packages/vscode-extension/out/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
Expand Down
47 changes: 7 additions & 40 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,21 @@
"tasks": [
{
"label": "watch",
"dependsOn": ["npm: watch:tsc", "npm: watch:esbuild"],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"options": {
"cwd": "${workspaceFolder}/packages/vscode-extension"
},
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": ["npm: watch", "npm: watch-tests"],
"problemMatcher": []
}
]
}
Loading

0 comments on commit add925a

Please sign in to comment.