Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
KeJunMao committed Oct 11, 2023
1 parent 2280f73 commit edf7e1c
Show file tree
Hide file tree
Showing 23 changed files with 2,563 additions and 506 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- "v*"
- 'v*'

jobs:
release:
Expand All @@ -21,7 +21,7 @@ jobs:
with:
node-version: 16.x
cache: pnpm
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'

- run: npx changelogithub
continue-on-error: true
Expand Down
64 changes: 64 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "never"
},
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{
"rule": "style/*",
"severity": "off"
},
{
"rule": "*-indent",
"severity": "off"
},
{
"rule": "*-spacing",
"severity": "off"
},
{
"rule": "*-spaces",
"severity": "off"
},
{
"rule": "*-order",
"severity": "off"
},
{
"rule": "*-dangle",
"severity": "off"
},
{
"rule": "*-newline",
"severity": "off"
},
{
"rule": "*quotes",
"severity": "off"
},
{
"rule": "*semi",
"severity": "off"
}
],
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,24 @@ pnpm i -D @uni-helper/vite-plugin-uni-manifest

```ts
// vite.config.ts
import { defineConfig } from "vite";
import Uni from "@dcloudio/vite-plugin-uni";
import UniManifest from "@uni-helper/vite-plugin-uni-manifest";
import { defineConfig } from 'vite'
import Uni from '@dcloudio/vite-plugin-uni'
import UniManifest from '@uni-helper/vite-plugin-uni-manifest'

export default defineConfig({
plugins: [Uni(), UniManifest()],
});
})
```

创建 `manifest.config.(ts|mts|cts|js|cjs|mjs|json)`, 然后用 TypeScript 编写你的 `manifest.json`

```ts
// manifest.config.ts
import { defineManifestConfig } from "@uni-helper/vite-plugin-uni-manifest";
import { defineManifestConfig } from '@uni-helper/vite-plugin-uni-manifest'

export default defineManifestConfig({...});
export default defineManifestConfig({
// code here...
})
```

[这里](./playground/manifest.config.ts),你可以找到 uni-app 默认的 Vite-TS 模版的`manifest.json` 是如何用 TypeScript 编写的
Expand Down
8 changes: 4 additions & 4 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defineBuildConfig } from "unbuild";
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: ["src/index"],
entries: ['src/index'],
declaration: true,
clean: true,
rollup: {
emitCJS: true,
},
failOnWarn: false,
externals: ["vite"],
});
externals: ['vite'],
})
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import antfu from '@antfu/eslint-config'

export default antfu()
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@uni-helper/vite-plugin-uni-manifest",
"type": "module",
"version": "0.2.1",
"packageManager": "pnpm@8.7.6",
"packageManager": "pnpm@8.9.0",
"description": "Use TypeScript to write manifest.json of uni-app",
"author": "KeJun",
"license": "MIT",
Expand Down Expand Up @@ -39,18 +39,22 @@
"prepublishOnly": "pnpm build",
"release": "bumpp",
"start": "esno src/index.ts",
"test": "vitest"
"test": "vitest",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"c12": "^1.4.2",
"type-fest": "^4.4.0"
},
"devDependencies": {
"@types/node": "^18.17.12",
"@antfu/eslint-config": "1.0.0-beta.25",
"@types/node": "^18.18.4",
"bumpp": "^9.2.0",
"eslint": "^8.51.0",
"esno": "^0.17.0",
"typescript": "^5.2.2",
"unbuild": "^2.0.0",
"vite": "^4.4.9"
},
"dependencies": {
"c12": "^1.4.2",
"type-fest": "^4.3.1"
"vite": "^4.4.11"
}
}
38 changes: 19 additions & 19 deletions playground/manifest.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { defineManifestConfig } from "@uni-helper/vite-plugin-uni-manifest";
import { defineManifestConfig } from '@uni-helper/vite-plugin-uni-manifest'

export default defineManifestConfig({
name: "uni-helper",
appid: "",
description: "",
versionName: "1.0.0",
versionCode: "100",
transformPx: false,
'name': 'uni-helper',
'appid': '',
'description': '',
'versionName': '1.0.0',
'versionCode': '100',
'transformPx': false,
/* 5+App特有相关 */
"app-plus": {
'app-plus': {
usingComponents: true,
nvueStyleCompiler: "uni-app",
nvueStyleCompiler: 'uni-app',
compilerVersion: 3,
splashscreen: {
alwaysShowBeforeRender: true,
Expand Down Expand Up @@ -50,30 +50,30 @@ export default defineManifestConfig({
icons: {
android: {},
ios: {},
}
},
},
},
/* 快应用特有相关 */
quickapp: {},
'quickapp': {},
/* 小程序特有相关 */
"mp-weixin": {
appid: "",
'mp-weixin': {
appid: '',
setting: {
urlCheck: false,
},
usingComponents: true,
},
"mp-alipay": {
'mp-alipay': {
usingComponents: true,
},
"mp-baidu": {
'mp-baidu': {
usingComponents: true,
},
"mp-toutiao": {
'mp-toutiao': {
usingComponents: true,
},
uniStatistics: {
'uniStatistics': {
enable: false,
},
vueVersion: "3",
});
'vueVersion': '3',
})
6 changes: 3 additions & 3 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3090020230909001",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3090020230909001",
"vue": "^3.3.4",
"vue-i18n": "^9.2.2"
"vue-i18n": "^9.5.0"
},
"devDependencies": {
"@dcloudio/types": "^3.3.3",
"@dcloudio/types": "^3.4.0",
"@dcloudio/uni-automator": "3.0.0-alpha-3090020230909001",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3090020230909001",
"@dcloudio/uni-stacktracey": "3.0.0-alpha-3090020230909001",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3090020230909001",
"@uni-helper/vite-plugin-uni-manifest": "workspace:*",
"typescript": "^5.2.2",
"vite": "^4.4.9"
"vite": "^4.4.11"
}
}
6 changes: 3 additions & 3 deletions playground/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="vite/client" />

declare module '*.vue' {
import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
import type { DefineComponent } from 'vue'

const component: DefineComponent<object, object, any>
export default component
}
9 changes: 5 additions & 4 deletions playground/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { createSSRApp } from "vue";
import App from "./App.vue";
import { createSSRApp } from 'vue'
import App from './App.vue'

export function createApp() {
const app = createSSRApp(App);
const app = createSSRApp(App)
return {
app,
};
}
}
28 changes: 14 additions & 14 deletions playground/src/pages.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
"pages": [ // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}
10 changes: 5 additions & 5 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"compilerOptions": {
"target": "esnext",
"jsx": "preserve",
"lib": ["esnext", "dom"],
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"types": ["@dcloudio/types"],
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"types": ["@dcloudio/types"]
"esModuleInterop": true
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}
9 changes: 5 additions & 4 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { defineConfig } from "vite";
import Uni from "@dcloudio/vite-plugin-uni";
import UniManifest from "@uni-helper/vite-plugin-uni-manifest";
import { defineConfig } from 'vite'
import Uni from '@dcloudio/vite-plugin-uni'
import UniManifest from '@uni-helper/vite-plugin-uni-manifest'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [UniManifest(), Uni()],
});
})
Loading

0 comments on commit edf7e1c

Please sign in to comment.