generated from hemengke1997/ts-starter
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffa2067
commit e36ac70
Showing
27 changed files
with
3,309 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
{ | ||
"extends": "@minko-fe/eslint-config" | ||
"extends": "@minko-fe/eslint-config", | ||
"overrides": [ | ||
{ | ||
"files": ["**/*.md/*.*"], | ||
"rules": { | ||
"no-restricted-syntax": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Npm Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
publish-npm: | ||
if: "contains(github.event.head_commit.message, 'release')" | ||
runs-on: ${{matrix.os}} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [16.x] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2.0.1 | ||
with: | ||
version: 6.31.0 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: https://registry.npmjs.org/ | ||
cache: 'pnpm' | ||
|
||
- name: Install Dependencies | ||
run: pnpm install | ||
|
||
- name: Publish to NPM | ||
run: pnpm -r publish --access public --no-git-checks | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Create Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build: | ||
name: Create Release | ||
runs-on: ${{matrix.os}} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
|
||
- name: Create Release for Tag | ||
id: release_tag | ||
uses: yyx990803/release-tag@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OPER_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
body: | | ||
Please refer to [CHANGELOG.md](https://github.com/hemengke1997/vite-plugin-public-typescript/blob/master/CHANGELOG.md) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
name: ✅ test | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
branched: | ||
-main | ||
|
||
jobs: | ||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# vite-plugin-public-typescript | ||
|
||
a template for typescript project or plugin | ||
## Feature | ||
|
||
- transform public typescript to public javascript | ||
- output js with hash | ||
|
||
## Install | ||
|
||
```bash | ||
pnpm add vite-plugin-public-typescript -D | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
npm i vite-plugin-public-typescript -D | ||
``` | ||
|
||
## Usage | ||
|
||
```ts | ||
import { defineConfig } from 'vite' | ||
import { publicTypescript } from 'vite-plugin-public-typescript' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
publicTypescript({ | ||
inputDir: 'publicTypescript', | ||
outputDir: 'lib', | ||
manifestName: 'manifest', | ||
hash: true, | ||
}), | ||
], | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + TS</title> | ||
<!--app-head--> | ||
</head> | ||
<body> | ||
<div id="app"><!--app-html--></div> | ||
<script type="module" src="/src/entry-client.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "vite-project", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "node server", | ||
"build": "npm run build:client && npm run build:server", | ||
"build:client": "vite build --ssrManifest --outDir dist/client", | ||
"build:server": "vite build --ssr src/entry-server.ts --outDir dist/server", | ||
"preview": "cross-env NODE_ENV=production node server" | ||
}, | ||
"dependencies": { | ||
"compression": "^1.7.4", | ||
"express": "^4.18.1", | ||
"sirv": "^2.0.2" | ||
}, | ||
"devDependencies": { | ||
"@types/express": "^4.17.14", | ||
"@types/node": "^18.7.21", | ||
"cross-env": "^7.0.3", | ||
"typescript": "^4.8.3", | ||
"vite": "^3.1.3", | ||
"vite-plugin-public-typescript": "link: ./../../../" | ||
} | ||
} |
Oops, something went wrong.