Skip to content

Commit

Permalink
build: use esbuild (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Jan 18, 2025
1 parent ab75481 commit 9e739d1
Show file tree
Hide file tree
Showing 69 changed files with 12,643 additions and 9,824 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
pull_request:
push:
branches: [main, master]

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Install node modules
run: yarn install
- run: npm run package

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Install node modules
run: yarn install
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
- run: npm test
if: runner.os != 'Linux'

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Install node modules
run: yarn install
- run: npm run lint
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/node_modules
package-lock.json
npm-debug.log
yarn.lock
# yarn.lock
*.vsix
!/cipchk.ng-zorro-vscode-7.3.4.vsix
!/cipchk.ng-zorro-vscode-zh-CN-7.3.4.vsix
Expand All @@ -17,4 +17,8 @@ yarn.lock
!/cipchk.ng-zorro-vscode-en-US-10.0.3.vsix
!/cipchk.ng-zorro-vscode-zh-CN-10.0.3.vsix
/out
/scripts/out
/snippets

.vscode/**
.vscode-test/**
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.x
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
});
34 changes: 20 additions & 14 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [{
"type": "node",
"request": "launch",
"name": "Resources",
"program": "${workspaceFolder}/scripts/resource/main.js"
},{
"type": "node",
"request": "launch",
"name": "Snippet",
"program": "${workspaceFolder}/scripts/snippet.js"
},
"configurations": [
{
"name": "Extension",
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
"${workspaceFolder}/**/*.js"
]
},
{
"name": "Run Web Extension",
"type": "extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionDevelopmentKind=web"
],
"outFiles": [
"${workspaceFolder}/**/*.js"
]
}
]
Expand Down
27 changes: 14 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"typescript.tsdk": "./node_modules/typescript/lib",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
"files.associations": {
".cssrem": "jsonc"
},
"[json]": {
"editor.formatOnSave": false
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"[jsonc]": {
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
"editor.formatOnSave": true,
"[markdown]": {
"editor.formatOnSave": false
},
"files.associations": {
"*.json": "jsonc",
".prettierrc": "jsonc",
".stylelintrc": "jsonc"
}
}
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
28 changes: 0 additions & 28 deletions .vscode/tasks.json

This file was deleted.

25 changes: 21 additions & 4 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
.vscode/**
.vscode-test/**
src/**
snippets/**
.gitignore
.yarnrc
esbuild.js
vsc-extension-quickstart.md
**/tsconfig.json
**/eslint.config.mjs
**/*.map
**/*.ts
**/.vscode-test.*
.github/**
.yarn/**
examples/**
demo.gif
.cssrem
.yarnrc.yml
scripts/**
build/**
.nvmrc

gulpfile.js
*.zip
.editorconfig
.gitignore
Expand All @@ -14,4 +28,7 @@ snippet-config.json
tsconfig.json
tslint.json
yarn.lock
TODO.md
TODO.md

build
out/test
Binary file added .yarn/install-state.gz
Binary file not shown.
934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enableImmutableInstalls: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.6.0.cjs
13 changes: 0 additions & 13 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@

![Help](help.gif)

# 注意从 `11.x` 版本开始,显示的语言会跟随 VSCode 的设定,无须安装不同版本 ng-zorro-vscode 插件,因此[简体中文版本](https://marketplace.visualstudio.com/items?itemName=cipchk.ng-zorro-vscode-zh-CN)的插件将不再更新。

## 旧版本

**注意:当前最新版本是基于 `11.0.0`**,你依然可以下载其他旧版本:

| 版本号 | 下载链接 |
|---------|----------|
| `10.x` | [10.0.3](https://raw.githubusercontent.com/ng-alain/ng-zorro-vscode/master/cipchk.ng-zorro-vscode-zh-CN-10.0.3.vsix) |
| `9.x` | [9.2.0](https://raw.githubusercontent.com/ng-alain/ng-zorro-vscode/master/cipchk.ng-zorro-vscode-zh-CN-9.2.0.vsix) |
| `8.x` | [8.3.3](https://raw.githubusercontent.com/ng-alain/ng-zorro-vscode/master/cipchk.ng-zorro-vscode-zh-CN-8.3.3.vsix) |
| `7.x` | [7.3.4](https://raw.githubusercontent.com/ng-alain/ng-zorro-vscode/master/cipchk.ng-zorro-vscode-zh-CN-7.3.4.vsix) |

## 特征

- 自动补全组件名、属性、复杂参数、可选值
Expand Down
Binary file removed cipchk.ng-zorro-vscode-7.3.4.vsix
Binary file not shown.
Binary file removed cipchk.ng-zorro-vscode-8.3.3.vsix
Binary file not shown.
Binary file removed cipchk.ng-zorro-vscode-en-US-10.0.3.vsix
Binary file not shown.
Binary file removed cipchk.ng-zorro-vscode-en-US-9.2.0.vsix
Binary file not shown.
Binary file removed cipchk.ng-zorro-vscode-zh-CN-10.0.3.vsix
Binary file not shown.
Binary file removed cipchk.ng-zorro-vscode-zh-CN-7.3.4.vsix
Binary file not shown.
Binary file removed cipchk.ng-zorro-vscode-zh-CN-8.3.3.vsix
Binary file not shown.
Binary file removed cipchk.ng-zorro-vscode-zh-CN-9.2.0.vsix
Binary file not shown.
34 changes: 34 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [
{
files: ["**/*.ts"],
},
{
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",
},

rules: {
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "import",
format: ["camelCase", "PascalCase"],
},
],

// curly: "warn",
// eqeqeq: "warn",
"no-throw-literal": "warn",
semi: "warn",
},
},
];
92 changes: 0 additions & 92 deletions gulpfile.js

This file was deleted.

10 changes: 0 additions & 10 deletions i18n/zh-cn/out/resources/index.i18n.json

This file was deleted.

4 changes: 0 additions & 4 deletions i18n/zh-cn/package.i18n.json

This file was deleted.

Loading

0 comments on commit 9e739d1

Please sign in to comment.