Skip to content

Commit

Permalink
chore(*): update taro and webpack deps (#34)
Browse files Browse the repository at this point in the history
chore(*): using webpack5 to package
chore(*): replace yarn with pnpm
chore(github): update github workflow
fix(about): remove global define variable `buildTime`
  • Loading branch information
j10ccc authored Mar 14, 2023
1 parent 1223f3d commit 770d968
Show file tree
Hide file tree
Showing 18 changed files with 12,678 additions and 14,418 deletions.
20 changes: 10 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"node": true
},
"extends": [
"eslint:recommended"
"plugin:vue/vue3-essential",
"@vue/eslint-config-typescript/recommended"
],
"overrides": [],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"ecmaVersion": 2021,
"sourceType": "module"
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"vue",
"@typescript-eslint"
"vue"
],
"rules": {
"indent": [
Expand All @@ -31,9 +31,9 @@
"error",
"double"
],
"semi": [
"error",
"always"
]
"semi": "error",
"vue/multi-word-component-names": "off",
"@typescript-eslint/ban-ts-comment": "off",
"no-trailing-spaces": "error"
}
}
}
58 changes: 36 additions & 22 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [master]
pull_request:
branches: [master]
- push
- pull_request

jobs:
build:
cache-and-install:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn global add @tarojs/cli
- run: yarn build:weapp --if-present
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build Taro weapp
run: pnpm build:weapp
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@ deploy_versions/
.rn_temp/
node_modules/
.DS_Store
.idea/
lib/
.vscode/
coverage/
config/prod.js
config/dev.js
tests/coverage/
.idea
.swc
52 changes: 0 additions & 52 deletions .yarnclean

This file was deleted.

16 changes: 4 additions & 12 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { buildDate, commit } from "./utils/version";
import PackageJson from "../package.json";
import path from "path";
const config = {
projectName: "WeJh-Taro",
Expand All @@ -13,18 +11,15 @@ const config = {
},
sourceRoot: "src",
outputRoot: "dist",
defineConstants: {
APP_VERSION: JSON.stringify(PackageJson.version),
"process.env.APP_NAME": JSON.stringify(PackageJson.name),
"process.env.COMMIT_HASH": JSON.stringify(commit),
"process.env.BUILD_TIME": JSON.stringify(buildDate),
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV)
},
copy: {
patterns: [],
options: {}
},
framework: "vue3",
compiler: "webpack5",
cache: {
enable: false
},
alias: {
"@/assets": path.resolve(__dirname, "..", "src/assets"),
"@/store": path.resolve(__dirname, "..", "src/store"),
Expand All @@ -37,9 +32,6 @@ const config = {
"@/style": path.resolve(__dirname, "..", "src/style")
},
mini: {
miniCssExtractPluginOption: {
ignoreOrder: true
},
postcss: {
pxtransform: {
enable: true,
Expand Down
18 changes: 0 additions & 18 deletions config/utils/version.js

This file was deleted.

28 changes: 0 additions & 28 deletions global.d.ts

This file was deleted.

70 changes: 36 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
},
"scripts": {
"build:weapp": "taro build --type weapp",
"build:weapp:upload": "taro build --type weapp --upload",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
Expand All @@ -27,50 +26,53 @@
"dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch",
"format": "prettier --config --write 'src/**/*.{ts,js,jsx,json,css,vue}'",
"test": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules && jest --coverage --maxWorkers=4"
"dev:quickapp": "npm run build:quickapp -- --watch"
},
"browserslist": [
"last 3 versions",
"Android >= 4.1",
"ios >= 8"
],
"dependencies": {
"@tarojs/components": "^3.6.1",
"@tarojs/mini-runner": "^3.6.1",
"@tarojs/plugin-framework-vue3": "^3.6.1",
"@tarojs/plugin-html": "^3.6.1",
"@tarojs/runtime": "^3.6.1",
"@tarojs/taro": "^3.6.1",
"@tarojs/webpack-runner": "^3.6.1",
"babel-plugin-import": "^1.13.3",
"@babel/runtime": "^7.7.7",
"@tarojs/components": "3.6.2",
"@tarojs/helper": "3.6.2",
"@tarojs/plugin-framework-vue3": "3.6.2",
"@tarojs/plugin-platform-alipay": "3.6.2",
"@tarojs/plugin-platform-h5": "3.6.2",
"@tarojs/plugin-platform-jd": "3.6.2",
"@tarojs/plugin-platform-qq": "3.6.2",
"@tarojs/plugin-platform-swan": "3.6.2",
"@tarojs/plugin-platform-tt": "3.6.2",
"@tarojs/plugin-platform-weapp": "3.6.2",
"@tarojs/runtime": "3.6.2",
"@tarojs/shared": "3.6.2",
"@tarojs/taro": "3.6.2",
"dayjs": "^1.11.4",
"vue": "^3.2.19",
"vue": "^3.0.0",
"vuex": "^4.0.0",
"vuex-persistedstate": "^4.1.0"
},
"devDependencies": {
"@babel/core": "^7.14.5",
"@babel/runtime": "^7.14.5",
"@tarojs/cli": "^3.6.1",
"@types/webpack-env": "^1.16.0",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
"@vue/babel-plugin-jsx": "^1.0.0-rc.4",
"@babel/core": "^7.8.0",
"@tarojs/cli": "3.6.2",
"@tarojs/webpack5-runner": "3.6.2",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"@vue/babel-plugin-jsx": "^1.0.6",
"@vue/compiler-sfc": "^3.0.0",
"@vue/test-utils": "^2.0.0-rc.6",
"babel-core": "^7.0.0-bridge.0",
"babel-preset-taro": "^3.5.5",
"cross-env": "^7.0.2",
"eslint": "^8.30.0",
"eslint-config-taro": "^3.5.5",
"eslint-plugin-vue": "^9.9.0",
"git-revision-webpack-plugin": "^5.0.0",
"ts-loader": "^9.2.6",
"typescript": "^4.4.3",
"vue-jest": "^5.0.0-alpha.7",
"vue-loader": "^16.8.1",
"webpack-bundle-analyzer": "^4.4.2"
"@vue/eslint-config-typescript": "^11.0.2",
"babel-preset-taro": "3.6.2",
"css-loader": "3.4.2",
"eslint": "^8.12.0",
"eslint-config-taro": "3.6.2",
"eslint-plugin-vue": "^8.0.0",
"postcss": "^8.4.18",
"style-loader": "1.3.0",
"stylelint": "^14.4.0",
"typescript": "^4.1.0",
"vue-loader": "^17.0.0",
"webpack": "5.69.0"
}
}
}
Loading

0 comments on commit 770d968

Please sign in to comment.