From 48c1234725a96776aa7f998e3651c0c30165da0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E7=BA=AF?= Date: Thu, 31 Dec 2020 14:18:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20singular=E9=BB=98=E8=AE=A4=E4=B8=BA?= =?UTF-8?q?=E5=A4=8D=E6=95=B0=EF=BC=8Cfalse=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fes-compiler/src/service/getPaths.js | 2 +- packages/fes-preset-built-in/src/plugins/features/singular.js | 2 +- packages/fes-preset-built-in/src/utils/generateFiles.js | 3 ++- packages/fes-template-h5/src/{page => pages}/index.vue | 0 packages/fes-template-h5/src/{page => pages}/onepiece.vue | 0 packages/fes-template/src/{locale => locales}/en-US.js | 0 packages/fes-template/src/{locale => locales}/id-ID.js | 0 packages/fes-template/src/{locale => locales}/pt-BR.js | 0 packages/fes-template/src/{locale => locales}/zh-CN.js | 0 packages/fes-template/src/{locale => locales}/zh-TW.js | 0 packages/fes-template/src/{model => models}/user.js | 0 packages/fes-template/src/{page => pages}/index.vue | 0 packages/fes-template/src/{page => pages}/onepiece.vue | 0 13 files changed, 4 insertions(+), 3 deletions(-) rename packages/fes-template-h5/src/{page => pages}/index.vue (100%) rename packages/fes-template-h5/src/{page => pages}/onepiece.vue (100%) rename packages/fes-template/src/{locale => locales}/en-US.js (100%) rename packages/fes-template/src/{locale => locales}/id-ID.js (100%) rename packages/fes-template/src/{locale => locales}/pt-BR.js (100%) rename packages/fes-template/src/{locale => locales}/zh-CN.js (100%) rename packages/fes-template/src/{locale => locales}/zh-TW.js (100%) rename packages/fes-template/src/{model => models}/user.js (100%) rename packages/fes-template/src/{page => pages}/index.vue (100%) rename packages/fes-template/src/{page => pages}/onepiece.vue (100%) diff --git a/packages/fes-compiler/src/service/getPaths.js b/packages/fes-compiler/src/service/getPaths.js index 47cc2c45..0fccad10 100644 --- a/packages/fes-compiler/src/service/getPaths.js +++ b/packages/fes-compiler/src/service/getPaths.js @@ -20,7 +20,7 @@ export default function getServicePaths({ absSrcPath = join(cwd, 'src'); } - const absPagesPath = config.singular !== false + const absPagesPath = config.singular ? join(absSrcPath, 'page') : join(absSrcPath, 'pages'); diff --git a/packages/fes-preset-built-in/src/plugins/features/singular.js b/packages/fes-preset-built-in/src/plugins/features/singular.js index 14cfc299..5a6915e6 100644 --- a/packages/fes-preset-built-in/src/plugins/features/singular.js +++ b/packages/fes-preset-built-in/src/plugins/features/singular.js @@ -2,7 +2,7 @@ export default (api) => { api.describe({ key: 'singular', config: { - default: true, + default: false, schema(joi) { return joi .boolean(); diff --git a/packages/fes-preset-built-in/src/utils/generateFiles.js b/packages/fes-preset-built-in/src/utils/generateFiles.js index 532e6255..7a601ebe 100644 --- a/packages/fes-preset-built-in/src/utils/generateFiles.js +++ b/packages/fes-preset-built-in/src/utils/generateFiles.js @@ -42,7 +42,8 @@ export default async ({ api, watch }) => { type: api.ApplyPluginsType.add, initialValue: [ paths.absPagesPath, - join(paths.absSrcPath, api.config?.singular ? 'layout' : 'layouts'), + // 貌似没用到 + // join(paths.absSrcPath, api.config?.singular ? 'layout' : 'layouts'), join(paths.absSrcPath, 'app.js') ] }); diff --git a/packages/fes-template-h5/src/page/index.vue b/packages/fes-template-h5/src/pages/index.vue similarity index 100% rename from packages/fes-template-h5/src/page/index.vue rename to packages/fes-template-h5/src/pages/index.vue diff --git a/packages/fes-template-h5/src/page/onepiece.vue b/packages/fes-template-h5/src/pages/onepiece.vue similarity index 100% rename from packages/fes-template-h5/src/page/onepiece.vue rename to packages/fes-template-h5/src/pages/onepiece.vue diff --git a/packages/fes-template/src/locale/en-US.js b/packages/fes-template/src/locales/en-US.js similarity index 100% rename from packages/fes-template/src/locale/en-US.js rename to packages/fes-template/src/locales/en-US.js diff --git a/packages/fes-template/src/locale/id-ID.js b/packages/fes-template/src/locales/id-ID.js similarity index 100% rename from packages/fes-template/src/locale/id-ID.js rename to packages/fes-template/src/locales/id-ID.js diff --git a/packages/fes-template/src/locale/pt-BR.js b/packages/fes-template/src/locales/pt-BR.js similarity index 100% rename from packages/fes-template/src/locale/pt-BR.js rename to packages/fes-template/src/locales/pt-BR.js diff --git a/packages/fes-template/src/locale/zh-CN.js b/packages/fes-template/src/locales/zh-CN.js similarity index 100% rename from packages/fes-template/src/locale/zh-CN.js rename to packages/fes-template/src/locales/zh-CN.js diff --git a/packages/fes-template/src/locale/zh-TW.js b/packages/fes-template/src/locales/zh-TW.js similarity index 100% rename from packages/fes-template/src/locale/zh-TW.js rename to packages/fes-template/src/locales/zh-TW.js diff --git a/packages/fes-template/src/model/user.js b/packages/fes-template/src/models/user.js similarity index 100% rename from packages/fes-template/src/model/user.js rename to packages/fes-template/src/models/user.js diff --git a/packages/fes-template/src/page/index.vue b/packages/fes-template/src/pages/index.vue similarity index 100% rename from packages/fes-template/src/page/index.vue rename to packages/fes-template/src/pages/index.vue diff --git a/packages/fes-template/src/page/onepiece.vue b/packages/fes-template/src/pages/onepiece.vue similarity index 100% rename from packages/fes-template/src/page/onepiece.vue rename to packages/fes-template/src/pages/onepiece.vue