Skip to content

Commit

Permalink
refactor: use uni-app framework (doocs#55)
Browse files Browse the repository at this point in the history
* update framework to uni-app

* fix: bug fix

* fix: bug fix

* 修改输出路径

* feat: publicPath

* feat: manifest update

* fix: cssEditor theme

* fix: style

* style: format code with prettier

* fix: table style & copy style on the night mode

* fix: upload image

* fix: style

Co-authored-by: yanglbme <[email protected]>
  • Loading branch information
JimQing and yanglbme authored Feb 28, 2021
1 parent 432db15 commit b50ae32
Show file tree
Hide file tree
Showing 41 changed files with 23,518 additions and 12,188 deletions.
Empty file added .automator/h5/.automator.json
Empty file.
2 changes: 0 additions & 2 deletions .browserslistrc

This file was deleted.

19 changes: 16 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
[*.{js,jsx,ts,tsx,vue}]
# https://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0
48 changes: 24 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
module.exports = {
root: true,
env: {
node: true,
root: true,
env: {
node: true,
},
extends: ["plugin:vue/essential", "@vue/standard"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
camelcase: "off",
eqeqeq: "off",
},
parserOptions: {
parser: "babel-eslint",
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
],
env: {
jest: true,
},
},
extends: ["plugin:vue/essential", "@vue/standard"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
camelcase: "off",
eqeqeq: "off",
},
parserOptions: {
parser: "babel-eslint",
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
],
env: {
jest: true,
},
},
],
],
};
59 changes: 58 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
const plugins = [];

if (process.env.UNI_OPT_TREESHAKINGNG) {
plugins.push(
require("@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js")
);
}

if (
(process.env.UNI_PLATFORM === "app-plus" && process.env.UNI_USING_V8) ||
(process.env.UNI_PLATFORM === "h5" &&
process.env.UNI_H5_BROWSER === "builtin")
) {
const path = require("path");

const isWin = /^win/.test(process.platform);

const normalizePath = (path) => (isWin ? path.replace(/\\/g, "/") : path);

const input = normalizePath(process.env.UNI_INPUT_DIR);
try {
plugins.push([
require("@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console"),
{
file(file) {
file = normalizePath(file);
if (file.indexOf(input) === 0) {
return path.relative(input, file);
}
return false;
},
},
]);
} catch (e) {}
}

process.UNI_LIBRARIES = process.UNI_LIBRARIES || ["@dcloudio/uni-ui"];
process.UNI_LIBRARIES.forEach((libraryName) => {
plugins.push([
"import",
{
libraryName: libraryName,
customName: (name) => {
return `${libraryName}/lib/${name}/${name}`;
},
},
]);
});
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
presets: [
[
"@vue/app",
{
modules: "commonjs",
useBuiltIns: process.env.UNI_PLATFORM === "h5" ? "usage" : "entry",
},
],
],
plugins,
};
3 changes: 0 additions & 3 deletions jest.config.js

This file was deleted.

Loading

0 comments on commit b50ae32

Please sign in to comment.