@farris/cli 2.0.1 → 2.0.2-ba-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +2 -2
 - package/lib/commands/build-components.js +39 -38
 - package/lib/commands/build-components.js.map +1 -1
 - package/lib/commands/build-css.js +38 -27
 - package/lib/commands/build-css.js.map +1 -1
 - package/lib/commands/build-lib.js +25 -27
 - package/lib/commands/build-lib.js.map +1 -1
 - package/lib/commands/build.js +15 -15
 - package/lib/commands/build.js.map +1 -1
 - package/lib/commands/create-app.js +54 -54
 - package/lib/commands/dev-serve.js +18 -23
 - package/lib/commands/dev-serve.js.map +1 -1
 - package/lib/commands/extract-i18n.js +75 -0
 - package/lib/commands/extract-i18n.js.map +1 -0
 - package/lib/commands/preview-serve.js +16 -16
 - package/lib/common/constant.js +22 -18
 - package/lib/common/constant.js.map +1 -1
 - package/lib/common/generate-app.js +44 -44
 - package/lib/common/get-dependencies.js +9 -9
 - package/lib/common/get-farris-config.js +11 -11
 - package/lib/common/get-farris-config.js.map +1 -1
 - package/lib/common/get-version.js +6 -6
 - package/lib/common/get-vite-config.js +50 -40
 - package/lib/common/get-vite-config.js.map +1 -1
 - package/lib/config/vite-app.js +13 -14
 - package/lib/config/vite-app.js.map +1 -1
 - package/lib/config/vite-common.js +21 -0
 - package/lib/config/vite-common.js.map +1 -0
 - package/lib/config/vite-component.js +30 -32
 - package/lib/config/vite-component.js.map +1 -1
 - package/lib/config/vite-lib.js +26 -27
 - package/lib/config/vite-lib.js.map +1 -1
 - package/lib/index.js +83 -65
 - package/lib/index.js.map +1 -1
 - package/lib/plugins/create-component-style.js +45 -44
 - package/lib/plugins/create-component-style.js.map +1 -1
 - package/lib/plugins/create-package-json.js +33 -33
 - package/lib/plugins/dts.js +8 -8
 - package/lib/plugins/html-system.js +11 -11
 - package/lib/plugins/replace.js +17 -13
 - package/lib/plugins/replace.js.map +1 -1
 - package/lib/plugins/systemjs-bundle.js +15 -15
 - package/package.json +42 -40
 - package/templates/mobile/.eslintrc.cjs +15 -15
 - package/templates/mobile/.prettierrc.json +7 -7
 - package/templates/mobile/farris.config.mjs +24 -24
 - package/templates/mobile/index.html +12 -12
 - package/templates/mobile/package.json +28 -28
 - package/templates/mobile/src/App.vue +80 -80
 - package/templates/mobile/src/components/TheButton.vue +3 -3
 - package/templates/mobile/src/main.ts +12 -12
 - package/templates/mobile/src/router/index.ts +23 -23
 - package/templates/mobile/src/views/AboutView.vue +15 -15
 - package/templates/mobile/src/views/HomeView.vue +9 -9
 - package/templates/mobile/tsconfig.json +17 -17
 - package/templates/web/.eslintrc.cjs +15 -15
 - package/templates/web/.prettierrc.json +7 -7
 - package/templates/web/farris.config.mjs +24 -24
 - package/templates/web/index.html +12 -12
 - package/templates/web/package.json +28 -28
 - package/templates/web/src/App.vue +80 -80
 - package/templates/web/src/components/TheButton.vue +3 -3
 - package/templates/web/src/main.ts +10 -10
 - package/templates/web/src/router/index.ts +23 -23
 - package/templates/web/src/views/AboutView.vue +15 -15
 - package/templates/web/src/views/HomeView.vue +9 -9
 - package/templates/web/tsconfig.json +17 -17
 
| 
         @@ -1,45 +1,45 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { resolve } from 'path';
         
     | 
| 
       2 
     | 
    
         
            -
            import { createRequire } from "node:module";
         
     | 
| 
       3 
     | 
    
         
            -
            import { CWD, getDirname } from './constant.js';
         
     | 
| 
       4 
     | 
    
         
            -
            import { getVersion } from "./get-version.js";
         
     | 
| 
       5 
     | 
    
         
            -
            const require = createRequire(import.meta.url);
         
     | 
| 
       6 
     | 
    
         
            -
            const { copySync, readFileSync, writeFileSync } = require("fs-extra");
         
     | 
| 
       7 
     | 
    
         
            -
            const Array2String = (arr) => {
         
     | 
| 
       8 
     | 
    
         
            -
                return `[${arr.reduce((acc, cur, index) => {
         
     | 
| 
       9 
     | 
    
         
            -
                    acc = index === 1 ? "'" + acc + "'" : acc;
         
     | 
| 
       10 
     | 
    
         
            -
                    acc += `,'${cur}'`;
         
     | 
| 
       11 
     | 
    
         
            -
                    return acc;
         
     | 
| 
       12 
     | 
    
         
            -
                })}]`;
         
     | 
| 
       13 
     | 
    
         
            -
            };
         
     | 
| 
       14 
     | 
    
         
            -
            const copyTemplate = (template, target) => {
         
     | 
| 
       15 
     | 
    
         
            -
                const templatePath = resolve(getDirname(import.meta.url), '../../templates', template);
         
     | 
| 
       16 
     | 
    
         
            -
                const targetPath = resolve(CWD, target);
         
     | 
| 
       17 
     | 
    
         
            -
                console.log(templatePath, targetPath);
         
     | 
| 
       18 
     | 
    
         
            -
                copySync(templatePath, targetPath);
         
     | 
| 
       19 
     | 
    
         
            -
            };
         
     | 
| 
       20 
     | 
    
         
            -
            const replaceContent = (path, args) => {
         
     | 
| 
       21 
     | 
    
         
            -
                let content = readFileSync(path, 'utf-8');
         
     | 
| 
       22 
     | 
    
         
            -
                Object.keys(args).forEach((key) => {
         
     | 
| 
       23 
     | 
    
         
            -
                    const regexp = new RegExp(`<%= ${key} %>`, 'g');
         
     | 
| 
       24 
     | 
    
         
            -
                    const value = Array.isArray(args[key]) ? Array2String(args[key]) : args[key];
         
     | 
| 
       25 
     | 
    
         
            -
                    content = content.replace(regexp, value);
         
     | 
| 
       26 
     | 
    
         
            -
                });
         
     | 
| 
       27 
     | 
    
         
            -
                writeFileSync(path, content);
         
     | 
| 
       28 
     | 
    
         
            -
            };
         
     | 
| 
       29 
     | 
    
         
            -
            export const generateApp = (options) => {
         
     | 
| 
       30 
     | 
    
         
            -
                const { name, type, formats, format, platform } = options;
         
     | 
| 
       31 
     | 
    
         
            -
                const template = type === 'lib' ? 'lib' : platform;
         
     | 
| 
       32 
     | 
    
         
            -
                copyTemplate(template, name);
         
     | 
| 
       33 
     | 
    
         
            -
                const replaceFiles = [
         
     | 
| 
       34 
     | 
    
         
            -
                    'package.json',
         
     | 
| 
       35 
     | 
    
         
            -
                    'farris.config.mjs',
         
     | 
| 
       36 
     | 
    
         
            -
                    'index.html'
         
     | 
| 
       37 
     | 
    
         
            -
                ];
         
     | 
| 
       38 
     | 
    
         
            -
                const cliVersion = getVersion();
         
     | 
| 
       39 
     | 
    
         
            -
                replaceFiles.forEach(replaceFile => {
         
     | 
| 
       40 
     | 
    
         
            -
                    replaceContent(resolve(CWD, name, replaceFile), { name, formats, format, platform, cliVersion });
         
     | 
| 
       41 
     | 
    
         
            -
                });
         
     | 
| 
       42 
     | 
    
         
            -
                console.log(`cd ${name}`);
         
     | 
| 
       43 
     | 
    
         
            -
                console.log(`npm install or yarn`);
         
     | 
| 
       44 
     | 
    
         
            -
            };
         
     | 
| 
      
 1 
     | 
    
         
            +
            import { resolve } from 'path';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { createRequire } from "node:module";
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { CWD, getDirname } from './constant.js';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { getVersion } from "./get-version.js";
         
     | 
| 
      
 5 
     | 
    
         
            +
            const require = createRequire(import.meta.url);
         
     | 
| 
      
 6 
     | 
    
         
            +
            const { copySync, readFileSync, writeFileSync } = require("fs-extra");
         
     | 
| 
      
 7 
     | 
    
         
            +
            const Array2String = (arr) => {
         
     | 
| 
      
 8 
     | 
    
         
            +
                return `[${arr.reduce((acc, cur, index) => {
         
     | 
| 
      
 9 
     | 
    
         
            +
                    acc = index === 1 ? "'" + acc + "'" : acc;
         
     | 
| 
      
 10 
     | 
    
         
            +
                    acc += `,'${cur}'`;
         
     | 
| 
      
 11 
     | 
    
         
            +
                    return acc;
         
     | 
| 
      
 12 
     | 
    
         
            +
                })}]`;
         
     | 
| 
      
 13 
     | 
    
         
            +
            };
         
     | 
| 
      
 14 
     | 
    
         
            +
            const copyTemplate = (template, target) => {
         
     | 
| 
      
 15 
     | 
    
         
            +
                const templatePath = resolve(getDirname(import.meta.url), '../../templates', template);
         
     | 
| 
      
 16 
     | 
    
         
            +
                const targetPath = resolve(CWD, target);
         
     | 
| 
      
 17 
     | 
    
         
            +
                console.log(templatePath, targetPath);
         
     | 
| 
      
 18 
     | 
    
         
            +
                copySync(templatePath, targetPath);
         
     | 
| 
      
 19 
     | 
    
         
            +
            };
         
     | 
| 
      
 20 
     | 
    
         
            +
            const replaceContent = (path, args) => {
         
     | 
| 
      
 21 
     | 
    
         
            +
                let content = readFileSync(path, 'utf-8');
         
     | 
| 
      
 22 
     | 
    
         
            +
                Object.keys(args).forEach((key) => {
         
     | 
| 
      
 23 
     | 
    
         
            +
                    const regexp = new RegExp(`<%= ${key} %>`, 'g');
         
     | 
| 
      
 24 
     | 
    
         
            +
                    const value = Array.isArray(args[key]) ? Array2String(args[key]) : args[key];
         
     | 
| 
      
 25 
     | 
    
         
            +
                    content = content.replace(regexp, value);
         
     | 
| 
      
 26 
     | 
    
         
            +
                });
         
     | 
| 
      
 27 
     | 
    
         
            +
                writeFileSync(path, content);
         
     | 
| 
      
 28 
     | 
    
         
            +
            };
         
     | 
| 
      
 29 
     | 
    
         
            +
            export const generateApp = (options) => {
         
     | 
| 
      
 30 
     | 
    
         
            +
                const { name, type, formats, format, platform } = options;
         
     | 
| 
      
 31 
     | 
    
         
            +
                const template = type === 'lib' ? 'lib' : platform;
         
     | 
| 
      
 32 
     | 
    
         
            +
                copyTemplate(template, name);
         
     | 
| 
      
 33 
     | 
    
         
            +
                const replaceFiles = [
         
     | 
| 
      
 34 
     | 
    
         
            +
                    'package.json',
         
     | 
| 
      
 35 
     | 
    
         
            +
                    'farris.config.mjs',
         
     | 
| 
      
 36 
     | 
    
         
            +
                    'index.html'
         
     | 
| 
      
 37 
     | 
    
         
            +
                ];
         
     | 
| 
      
 38 
     | 
    
         
            +
                const cliVersion = getVersion();
         
     | 
| 
      
 39 
     | 
    
         
            +
                replaceFiles.forEach(replaceFile => {
         
     | 
| 
      
 40 
     | 
    
         
            +
                    replaceContent(resolve(CWD, name, replaceFile), { name, formats, format, platform, cliVersion });
         
     | 
| 
      
 41 
     | 
    
         
            +
                });
         
     | 
| 
      
 42 
     | 
    
         
            +
                console.log(`cd ${name}`);
         
     | 
| 
      
 43 
     | 
    
         
            +
                console.log(`npm install or yarn`);
         
     | 
| 
      
 44 
     | 
    
         
            +
            };
         
     | 
| 
       45 
45 
     | 
    
         
             
            //# sourceMappingURL=generate-app.js.map
         
     | 
| 
         @@ -1,10 +1,10 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { readFileSync } from "node:fs";
         
     | 
| 
       2 
     | 
    
         
            -
            import { resolve } from 'node:path';
         
     | 
| 
       3 
     | 
    
         
            -
            import { CWD } from "../common/constant.js";
         
     | 
| 
       4 
     | 
    
         
            -
            export const getDependencies = () => {
         
     | 
| 
       5 
     | 
    
         
            -
                const pkg = readFileSync(resolve(CWD, 'package.json'), 'utf-8');
         
     | 
| 
       6 
     | 
    
         
            -
                const packageJson = JSON.parse(pkg);
         
     | 
| 
       7 
     | 
    
         
            -
                const { dependencies, peerDependencies } = packageJson;
         
     | 
| 
       8 
     | 
    
         
            -
                return [...Object.keys(dependencies || {}), ...Object.keys(peerDependencies || {})];
         
     | 
| 
       9 
     | 
    
         
            -
            };
         
     | 
| 
      
 1 
     | 
    
         
            +
            import { readFileSync } from "node:fs";
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { resolve } from 'node:path';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { CWD } from "../common/constant.js";
         
     | 
| 
      
 4 
     | 
    
         
            +
            export const getDependencies = () => {
         
     | 
| 
      
 5 
     | 
    
         
            +
                const pkg = readFileSync(resolve(CWD, 'package.json'), 'utf-8');
         
     | 
| 
      
 6 
     | 
    
         
            +
                const packageJson = JSON.parse(pkg);
         
     | 
| 
      
 7 
     | 
    
         
            +
                const { dependencies, peerDependencies } = packageJson;
         
     | 
| 
      
 8 
     | 
    
         
            +
                return [...Object.keys(dependencies || {}), ...Object.keys(peerDependencies || {})];
         
     | 
| 
      
 9 
     | 
    
         
            +
            };
         
     | 
| 
       10 
10 
     | 
    
         
             
            //# sourceMappingURL=get-dependencies.js.map
         
     | 
| 
         @@ -1,12 +1,12 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { pathToFileURL } from 'node:url';
         
     | 
| 
       2 
     | 
    
         
            -
            import { FAARIS_CONFIG_FILE } from './constant.js';
         
     | 
| 
       3 
     | 
    
         
            -
            async function getFarrisConfigAsync() {
         
     | 
| 
       4 
     | 
    
         
            -
                try {
         
     | 
| 
       5 
     | 
    
         
            -
                    return (await import(pathToFileURL( 
     | 
| 
       6 
     | 
    
         
            -
                }
         
     | 
| 
       7 
     | 
    
         
            -
                catch (err) {
         
     | 
| 
       8 
     | 
    
         
            -
                    return {};
         
     | 
| 
       9 
     | 
    
         
            -
                }
         
     | 
| 
       10 
     | 
    
         
            -
            }
         
     | 
| 
       11 
     | 
    
         
            -
            export { getFarrisConfigAsync };
         
     | 
| 
      
 1 
     | 
    
         
            +
            import { pathToFileURL } from 'node:url';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { FAARIS_CONFIG_FILE } from './constant.js';
         
     | 
| 
      
 3 
     | 
    
         
            +
            async function getFarrisConfigAsync(configFile = FAARIS_CONFIG_FILE) {
         
     | 
| 
      
 4 
     | 
    
         
            +
                try {
         
     | 
| 
      
 5 
     | 
    
         
            +
                    return (await import(pathToFileURL(configFile).href)).default;
         
     | 
| 
      
 6 
     | 
    
         
            +
                }
         
     | 
| 
      
 7 
     | 
    
         
            +
                catch (err) {
         
     | 
| 
      
 8 
     | 
    
         
            +
                    return {};
         
     | 
| 
      
 9 
     | 
    
         
            +
                }
         
     | 
| 
      
 10 
     | 
    
         
            +
            }
         
     | 
| 
      
 11 
     | 
    
         
            +
            export { getFarrisConfigAsync };
         
     | 
| 
       12 
12 
     | 
    
         
             
            //# sourceMappingURL=get-farris-config.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"get-farris-config.js","sourceRoot":"","sources":["../../src/common/get-farris-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,KAAK,UAAU,oBAAoB; 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"get-farris-config.js","sourceRoot":"","sources":["../../src/common/get-farris-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,KAAK,UAAU,oBAAoB,CAAC,UAAU,GAAE,kBAAkB;IAChE,IAAI;QACF,OAAO,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;KAC/D;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
         
     | 
| 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { createRequire } from 'node:module';
         
     | 
| 
       2 
     | 
    
         
            -
            const require = createRequire(import.meta.url);
         
     | 
| 
       3 
     | 
    
         
            -
            const packageJson = require('../../package.json');
         
     | 
| 
       4 
     | 
    
         
            -
            export const getVersion = () => {
         
     | 
| 
       5 
     | 
    
         
            -
                return packageJson.version;
         
     | 
| 
       6 
     | 
    
         
            -
            };
         
     | 
| 
      
 1 
     | 
    
         
            +
            import { createRequire } from 'node:module';
         
     | 
| 
      
 2 
     | 
    
         
            +
            const require = createRequire(import.meta.url);
         
     | 
| 
      
 3 
     | 
    
         
            +
            const packageJson = require('../../package.json');
         
     | 
| 
      
 4 
     | 
    
         
            +
            export const getVersion = () => {
         
     | 
| 
      
 5 
     | 
    
         
            +
                return packageJson.version;
         
     | 
| 
      
 6 
     | 
    
         
            +
            };
         
     | 
| 
       7 
7 
     | 
    
         
             
            //# sourceMappingURL=get-version.js.map
         
     | 
| 
         @@ -1,41 +1,51 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { mergeConfig } from 'vite';
         
     | 
| 
       2 
     | 
    
         
            -
            import { getFarrisConfigAsync } from './get-farris-config.js';
         
     | 
| 
       3 
     | 
    
         
            -
            import { getDependencies } from '../common/get-dependencies.js';
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
                const  
     | 
| 
       7 
     | 
    
         
            -
                 
     | 
| 
       8 
     | 
    
         
            -
                 
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
                         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
            } 
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
                 
     | 
| 
       38 
     | 
    
         
            -
                return  
     | 
| 
       39 
     | 
    
         
            -
            };
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            import { mergeConfig } from 'vite';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { getFarrisConfigAsync } from './get-farris-config.js';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { getDependencies } from '../common/get-dependencies.js';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
         
     | 
| 
      
 5 
     | 
    
         
            +
            const formatFarrisConfig = (farrisConfig, type) => {
         
     | 
| 
      
 6 
     | 
    
         
            +
                const { lib, format, target, minify = true, outDir, externals = { include: [], exclude: [] }, externalDependencies, plugins = [], alias, server, cssInjected, packageName = '@farris/mobile-ui-vue' } = 
         
     | 
| 
      
 7 
     | 
    
         
            +
                farrisConfig;
         
     | 
| 
      
 8 
     | 
    
         
            +
                externals.include = farrisConfig.externals.include || [];
         
     | 
| 
      
 9 
     | 
    
         
            +
                const dependencies = externalDependencies ? getDependencies() : [];
         
     | 
| 
      
 10 
     | 
    
         
            +
                let external = externals.include ? [...externals.include, ...dependencies] : dependencies;
         
     | 
| 
      
 11 
     | 
    
         
            +
                external = external.filter((item) => !externals.exclude?.includes(item));
         
     | 
| 
      
 12 
     | 
    
         
            +
                format && (process.env.FARRIS_FORMAT = format);
         
     | 
| 
      
 13 
     | 
    
         
            +
                if (cssInjected) {
         
     | 
| 
      
 14 
     | 
    
         
            +
                    plugins.push(cssInjectedByJsPlugin());
         
     | 
| 
      
 15 
     | 
    
         
            +
                }
         
     | 
| 
      
 16 
     | 
    
         
            +
                if (packageName) {
         
     | 
| 
      
 17 
     | 
    
         
            +
                    process.env.PackageName = packageName;
         
     | 
| 
      
 18 
     | 
    
         
            +
                }
         
     | 
| 
      
 19 
     | 
    
         
            +
                const viteConfig = {
         
     | 
| 
      
 20 
     | 
    
         
            +
                    build: {
         
     | 
| 
      
 21 
     | 
    
         
            +
                        target,
         
     | 
| 
      
 22 
     | 
    
         
            +
                        minify,
         
     | 
| 
      
 23 
     | 
    
         
            +
                        lib: type === 'lib' ? lib : undefined,
         
     | 
| 
      
 24 
     | 
    
         
            +
                        rollupOptions: {
         
     | 
| 
      
 25 
     | 
    
         
            +
                            output: {
         
     | 
| 
      
 26 
     | 
    
         
            +
                                format
         
     | 
| 
      
 27 
     | 
    
         
            +
                            },
         
     | 
| 
      
 28 
     | 
    
         
            +
                            external: externals.filter ? externals.filter(external) : external
         
     | 
| 
      
 29 
     | 
    
         
            +
                        },
         
     | 
| 
      
 30 
     | 
    
         
            +
                        outDir
         
     | 
| 
      
 31 
     | 
    
         
            +
                    },
         
     | 
| 
      
 32 
     | 
    
         
            +
                    server,
         
     | 
| 
      
 33 
     | 
    
         
            +
                    plugins,
         
     | 
| 
      
 34 
     | 
    
         
            +
                    resolve: {
         
     | 
| 
      
 35 
     | 
    
         
            +
                        alias
         
     | 
| 
      
 36 
     | 
    
         
            +
                    }
         
     | 
| 
      
 37 
     | 
    
         
            +
                };
         
     | 
| 
      
 38 
     | 
    
         
            +
                return viteConfig;
         
     | 
| 
      
 39 
     | 
    
         
            +
            };
         
     | 
| 
      
 40 
     | 
    
         
            +
            const formatViteConfig = async (type, configFile) => {
         
     | 
| 
      
 41 
     | 
    
         
            +
                const { viteConfig = {}, ...farrisConfig } = await getFarrisConfigAsync(configFile);
         
     | 
| 
      
 42 
     | 
    
         
            +
                const customViteConfig = formatFarrisConfig(farrisConfig, type);
         
     | 
| 
      
 43 
     | 
    
         
            +
                return mergeConfig(customViteConfig, viteConfig);
         
     | 
| 
      
 44 
     | 
    
         
            +
            };
         
     | 
| 
      
 45 
     | 
    
         
            +
            const getViteConfig = async (type = 'app', configFile) => {
         
     | 
| 
      
 46 
     | 
    
         
            +
                const viteConfig = await formatViteConfig(type, configFile);
         
     | 
| 
      
 47 
     | 
    
         
            +
                const { default: defaultViteConfig } = await import(`../config/vite-${type}.js`);
         
     | 
| 
      
 48 
     | 
    
         
            +
                return mergeConfig(defaultViteConfig, viteConfig);
         
     | 
| 
      
 49 
     | 
    
         
            +
            };
         
     | 
| 
      
 50 
     | 
    
         
            +
            export { getViteConfig };
         
     | 
| 
       41 
51 
     | 
    
         
             
            //# sourceMappingURL=get-vite-config.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"get-vite-config.js","sourceRoot":"","sources":["../../src/common/get-vite-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,WAAW, 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"get-vite-config.js","sourceRoot":"","sources":["../../src/common/get-vite-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,WAAW,EAAiB,MAAM,MAAM,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,qBAAqB,MAAM,gCAAgC,CAAC;AAiBnE,MAAM,kBAAkB,GAAG,CAAC,YAA0B,EAAE,IAAY,EAAE,EAAE;IACtE,MAAM,EACJ,GAAG,EACH,MAAM,EACN,MAAM,EACN,MAAM,GAAG,IAAI,EACb,MAAM,EACN,SAAS,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EACxC,oBAAoB,EACpB,OAAO,GAAG,EAAE,EACZ,KAAK,EACL,MAAM,EACN,WAAW,EACX,WAAW,GAAG,uBAAuB,EACtC,GAAG,YAAY,CAAC;IAEjB,MAAM,YAAY,GAAG,oBAAoB,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnE,IAAI,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAE1F,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAEzE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,MAAM,CAAC,CAAC;IAE/C,IAAG,WAAW,EAAC;QACb,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;KACvC;IACD,IAAG,WAAW,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC;KACvC;IAED,MAAM,UAAU,GAAG;QACjB,KAAK,EAAE;YACL,MAAM;YACN,MAAM;YACN,GAAG,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;YACrC,aAAa,EAAE;gBACb,MAAM,EAAE;oBACN,MAAM;iBACP;gBACD,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ;aACnE;YACD,MAAM;SACP;QACD,MAAM;QACN,OAAO;QACP,OAAO,EAAE;YACP,KAAK;SACN;KACF,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,KAAK,EAAE,IAAY,EAAE,UAAmB,EAAE,EAAE;IACnE,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,YAAY,EAAE,GAAG,MAAM,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACpF,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAEhE,OAAO,WAAW,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,UAAmB,EAAE,EAAE;IAChE,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC5D,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,IAAI,KAAK,CAAC,CAAC;IAEjF,OAAO,WAAW,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
         
     | 
    
        package/lib/config/vite-app.js
    CHANGED
    
    | 
         @@ -1,15 +1,14 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import  
     | 
| 
       2 
     | 
    
         
            -
            import  
     | 
| 
       3 
     | 
    
         
            -
            import  
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
                     
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
            };
         
     | 
| 
      
 1 
     | 
    
         
            +
            import { mergeConfig } from 'vite';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { htmlSystemPlugin } from '../plugins/html-system.js';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import CommonConfig from "./vite-common.js";
         
     | 
| 
      
 4 
     | 
    
         
            +
            export default mergeConfig(CommonConfig, {
         
     | 
| 
      
 5 
     | 
    
         
            +
                define: {
         
     | 
| 
      
 6 
     | 
    
         
            +
                    __VUE_OPTIONS_API__: 'true',
         
     | 
| 
      
 7 
     | 
    
         
            +
                    __VUE_PROD_DEVTOOLS__: 'true',
         
     | 
| 
      
 8 
     | 
    
         
            +
                    __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'true'
         
     | 
| 
      
 9 
     | 
    
         
            +
                },
         
     | 
| 
      
 10 
     | 
    
         
            +
                plugins: [
         
     | 
| 
      
 11 
     | 
    
         
            +
                    process.env.FARRIS_FORMAT === 'systemjs' && htmlSystemPlugin()
         
     | 
| 
      
 12 
     | 
    
         
            +
                ]
         
     | 
| 
      
 13 
     | 
    
         
            +
            });
         
     | 
| 
       15 
14 
     | 
    
         
             
            //# sourceMappingURL=vite-app.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"vite-app.js","sourceRoot":"","sources":["../../src/config/vite-app.ts"],"names":[],"mappings":"AAAA,OAAO, 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"vite-app.js","sourceRoot":"","sources":["../../src/config/vite-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAE5C,eAAe,WAAW,CAAC,YAAY,EAAE;IACvC,MAAM,EAAE;QACN,mBAAmB,EAAE,MAAM;QAC3B,qBAAqB,EAAE,MAAM;QAC7B,uCAAuC,EAAE,MAAM;KAChD;IACD,OAAO,EAAE;QACP,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,UAAU,IAAI,gBAAgB,EAAE;KAC/D;CACF,CAAC,CAAC"}
         
     | 
| 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import vue from '@vitejs/plugin-vue';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import vueJsx from '@vitejs/plugin-vue-jsx';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { CWD } from '../common/constant.js';
         
     | 
| 
      
 4 
     | 
    
         
            +
            export default {
         
     | 
| 
      
 5 
     | 
    
         
            +
                root: CWD,
         
     | 
| 
      
 6 
     | 
    
         
            +
                base: './',
         
     | 
| 
      
 7 
     | 
    
         
            +
                plugins: [
         
     | 
| 
      
 8 
     | 
    
         
            +
                    vue(),
         
     | 
| 
      
 9 
     | 
    
         
            +
                    vueJsx()
         
     | 
| 
      
 10 
     | 
    
         
            +
                ],
         
     | 
| 
      
 11 
     | 
    
         
            +
                configFile: false,
         
     | 
| 
      
 12 
     | 
    
         
            +
                css: {
         
     | 
| 
      
 13 
     | 
    
         
            +
                    preprocessorOptions: {
         
     | 
| 
      
 14 
     | 
    
         
            +
                        scss: {
         
     | 
| 
      
 15 
     | 
    
         
            +
                            api: 'modern-compiler',
         
     | 
| 
      
 16 
     | 
    
         
            +
                            silenceDeprecations: ['global-builtin', 'legacy-js-api']
         
     | 
| 
      
 17 
     | 
    
         
            +
                        },
         
     | 
| 
      
 18 
     | 
    
         
            +
                    }
         
     | 
| 
      
 19 
     | 
    
         
            +
                }
         
     | 
| 
      
 20 
     | 
    
         
            +
            };
         
     | 
| 
      
 21 
     | 
    
         
            +
            //# sourceMappingURL=vite-common.js.map
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"vite-common.js","sourceRoot":"","sources":["../../src/config/vite-common.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,oBAAoB,CAAC;AACrC,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,eAAe;IACb,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI;IACV,OAAO,EAAE;QACP,GAAG,EAAE;QACL,MAAM,EAAE;KACT;IACD,UAAU,EAAE,KAAK;IACjB,GAAG,EAAE;QACH,mBAAmB,EAAE;YACnB,IAAI,EAAE;gBACJ,GAAG,EAAE,iBAAiB;gBACtB,mBAAmB,EAAE,CAAC,gBAAgB,EAAE,eAAe,CAAC;aACzD;SACF;KACF;CACF,CAAC"}
         
     | 
| 
         @@ -1,33 +1,31 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import  
     | 
| 
       2 
     | 
    
         
            -
            import  
     | 
| 
       3 
     | 
    
         
            -
            import {  
     | 
| 
       4 
     | 
    
         
            -
            import {  
     | 
| 
       5 
     | 
    
         
            -
            import {  
     | 
| 
       6 
     | 
    
         
            -
            export default {
         
     | 
| 
       7 
     | 
    
         
            -
                 
     | 
| 
       8 
     | 
    
         
            -
                 
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
                                 
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
                }
         
     | 
| 
       32 
     | 
    
         
            -
            };
         
     | 
| 
      
 1 
     | 
    
         
            +
            import { mergeConfig } from 'vite';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import CommonConfig from "./vite-common.js";
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { replace } from "../plugins/replace.js";
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { createComponentStyle } from "../plugins/create-component-style.js";
         
     | 
| 
      
 5 
     | 
    
         
            +
            import { getPackageName } from '../common/constant.js';
         
     | 
| 
      
 6 
     | 
    
         
            +
            export default mergeConfig(CommonConfig, {
         
     | 
| 
      
 7 
     | 
    
         
            +
                logLevel: 'silent',
         
     | 
| 
      
 8 
     | 
    
         
            +
                plugins: [createComponentStyle(), replace((format, args) => `../${args[0]}/index.${format}.js`)],
         
     | 
| 
      
 9 
     | 
    
         
            +
                build: {
         
     | 
| 
      
 10 
     | 
    
         
            +
                    lib: {
         
     | 
| 
      
 11 
     | 
    
         
            +
                        fileName: "index",
         
     | 
| 
      
 12 
     | 
    
         
            +
                        formats: ["esm"],
         
     | 
| 
      
 13 
     | 
    
         
            +
                    },
         
     | 
| 
      
 14 
     | 
    
         
            +
                    rollupOptions: {
         
     | 
| 
      
 15 
     | 
    
         
            +
                        output: {
         
     | 
| 
      
 16 
     | 
    
         
            +
                            exports: "named",
         
     | 
| 
      
 17 
     | 
    
         
            +
                            globals: (id) => {
         
     | 
| 
      
 18 
     | 
    
         
            +
                                if (id.includes(getPackageName())) {
         
     | 
| 
      
 19 
     | 
    
         
            +
                                    const name = id.split('/').pop() || '';
         
     | 
| 
      
 20 
     | 
    
         
            +
                                    return name.slice(0, 1).toUpperCase() + name.slice(1);
         
     | 
| 
      
 21 
     | 
    
         
            +
                                }
         
     | 
| 
      
 22 
     | 
    
         
            +
                                const map = {
         
     | 
| 
      
 23 
     | 
    
         
            +
                                    vue: "Vue"
         
     | 
| 
      
 24 
     | 
    
         
            +
                                };
         
     | 
| 
      
 25 
     | 
    
         
            +
                                return map[id];
         
     | 
| 
      
 26 
     | 
    
         
            +
                            }
         
     | 
| 
      
 27 
     | 
    
         
            +
                        }
         
     | 
| 
      
 28 
     | 
    
         
            +
                    }
         
     | 
| 
      
 29 
     | 
    
         
            +
                }
         
     | 
| 
      
 30 
     | 
    
         
            +
            });
         
     | 
| 
       33 
31 
     | 
    
         
             
            //# sourceMappingURL=vite-component.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"vite-component.js","sourceRoot":"","sources":["../../src/config/vite-component.ts"],"names":[],"mappings":"AAAA,OAAO, 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"vite-component.js","sourceRoot":"","sources":["../../src/config/vite-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAe,WAAW,CAAC,YAAY,EAAE;IACvC,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,CAAC,oBAAoB,EAAE,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,IAAI,EAAC,EAAE,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,UAAU,MAAM,KAAK,CAAC,CAAC;IAC/F,KAAK,EAAC;QACJ,GAAG,EAAE;YACH,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,CAAC,KAAK,CAAC;SACjB;QACD,aAAa,EAAE;YACb,MAAM,EAAE;gBACN,OAAO,EAAE,OAAO;gBAChB,OAAO,EAAE,CAAC,EAAU,EAAC,EAAE;oBACrB,IAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,EAAE;wBAChC,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;wBACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBACtD;oBACD,MAAM,GAAG,GAA2B;wBAClC,GAAG,EAAE,KAAK;qBACX,CAAC;oBACF,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC;gBACjB,CAAC;aACF;SACF;KACF;CACF,CAAC,CAAC"}
         
     | 
    
        package/lib/config/vite-lib.js
    CHANGED
    
    | 
         @@ -1,28 +1,27 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import  
     | 
| 
       2 
     | 
    
         
            -
            import  
     | 
| 
       3 
     | 
    
         
            -
            import { CWD } from '../common/constant.js';
         
     | 
| 
       4 
     | 
    
         
            -
            import {  
     | 
| 
       5 
     | 
    
         
            -
            import  
     | 
| 
       6 
     | 
    
         
            -
            export default {
         
     | 
| 
       7 
     | 
    
         
            -
                 
     | 
| 
       8 
     | 
    
         
            -
                 
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
                     
     | 
| 
       16 
     | 
    
         
            -
                     
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
                             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
                                 
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
            };
         
     | 
| 
      
 1 
     | 
    
         
            +
            import { mergeConfig } from 'vite';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { resolve } from "node:path";
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { CWD, getPackageName } from '../common/constant.js';
         
     | 
| 
      
 4 
     | 
    
         
            +
            import { systemjsBundle } from '../plugins/systemjs-bundle.js';
         
     | 
| 
      
 5 
     | 
    
         
            +
            import CommonConfig from "./vite-common.js";
         
     | 
| 
      
 6 
     | 
    
         
            +
            export default mergeConfig(CommonConfig, {
         
     | 
| 
      
 7 
     | 
    
         
            +
                logLevel: 'silent',
         
     | 
| 
      
 8 
     | 
    
         
            +
                plugins: [systemjsBundle()],
         
     | 
| 
      
 9 
     | 
    
         
            +
                build: {
         
     | 
| 
      
 10 
     | 
    
         
            +
                    lib: {
         
     | 
| 
      
 11 
     | 
    
         
            +
                        entry: resolve(CWD, `./src/main.ts`),
         
     | 
| 
      
 12 
     | 
    
         
            +
                        fileName: "index",
         
     | 
| 
      
 13 
     | 
    
         
            +
                    },
         
     | 
| 
      
 14 
     | 
    
         
            +
                    target: 'es2019',
         
     | 
| 
      
 15 
     | 
    
         
            +
                    outDir: resolve(CWD, `./lib`),
         
     | 
| 
      
 16 
     | 
    
         
            +
                    rollupOptions: {
         
     | 
| 
      
 17 
     | 
    
         
            +
                        output: {
         
     | 
| 
      
 18 
     | 
    
         
            +
                            exports: "named",
         
     | 
| 
      
 19 
     | 
    
         
            +
                            globals: {
         
     | 
| 
      
 20 
     | 
    
         
            +
                                vue: "Vue",
         
     | 
| 
      
 21 
     | 
    
         
            +
                                [getPackageName()]: getPackageName()
         
     | 
| 
      
 22 
     | 
    
         
            +
                            }
         
     | 
| 
      
 23 
     | 
    
         
            +
                        }
         
     | 
| 
      
 24 
     | 
    
         
            +
                    },
         
     | 
| 
      
 25 
     | 
    
         
            +
                }
         
     | 
| 
      
 26 
     | 
    
         
            +
            });
         
     | 
| 
       28 
27 
     | 
    
         
             
            //# sourceMappingURL=vite-lib.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"vite-lib.js","sourceRoot":"","sources":["../../src/config/vite-lib.ts"],"names":[],"mappings":"AAAA,OAAO, 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"vite-lib.js","sourceRoot":"","sources":["../../src/config/vite-lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAE5C,eAAe,WAAW,CAAC,YAAY,EAAE;IACvC,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,CAAC,cAAc,EAAE,CAAC;IAC3B,KAAK,EAAC;QACJ,GAAG,EAAE;YACH,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC;YACpC,QAAQ,EAAE,OAAO;SAClB;QACD,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC;QAC7B,aAAa,EAAE;YACb,MAAM,EAAE;gBACN,OAAO,EAAE,OAAO;gBAChB,OAAO,EAAE;oBACP,GAAG,EAAE,KAAK;oBACV,CAAC,cAAc,EAAE,CAAC,EAAE,cAAc,EAAE;iBACrC;aACF;SACF;KACF;CACF,CAAC,CAAC"}
         
     | 
    
        package/lib/index.js
    CHANGED
    
    | 
         @@ -1,66 +1,84 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #!/usr/bin/env node
         
     | 
| 
       2 
     | 
    
         
            -
            import { Command } from 'commander';
         
     | 
| 
       3 
     | 
    
         
            -
            import { getVersion } from "./common/get-version.js";
         
     | 
| 
       4 
     | 
    
         
            -
            const program = new Command();
         
     | 
| 
       5 
     | 
    
         
            -
            program.version(`@farris/cli ${getVersion()}`);
         
     | 
| 
       6 
     | 
    
         
            -
            program
         
     | 
| 
       7 
     | 
    
         
            -
                .command('build')
         
     | 
| 
       8 
     | 
    
         
            -
                .description('构建')
         
     | 
| 
       9 
     | 
    
         
            -
                .option('-c --configFile [configFile]', 'config file path')
         
     | 
| 
       10 
     | 
    
         
            -
                . 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
       12 
     | 
    
         
            -
                 
     | 
| 
       13 
     | 
    
         
            -
            });
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
                . 
     | 
| 
       18 
     | 
    
         
            -
                . 
     | 
| 
       19 
     | 
    
         
            -
                .option('- 
     | 
| 
       20 
     | 
    
         
            -
                .option('- 
     | 
| 
       21 
     | 
    
         
            -
                . 
     | 
| 
       22 
     | 
    
         
            -
                 
     | 
| 
       23 
     | 
    
         
            -
                 
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
                 
     | 
| 
       27 
     | 
    
         
            -
                 
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
                 
     | 
| 
       31 
     | 
    
         
            -
                 
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
                . 
     | 
| 
       35 
     | 
    
         
            -
                . 
     | 
| 
       36 
     | 
    
         
            -
                 
     | 
| 
       37 
     | 
    
         
            -
                 
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                 
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
                . 
     | 
| 
       44 
     | 
    
         
            -
                . 
     | 
| 
       45 
     | 
    
         
            -
                .action(async () => {
         
     | 
| 
       46 
     | 
    
         
            -
                 
     | 
| 
       47 
     | 
    
         
            -
                 
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
                . 
     | 
| 
       52 
     | 
    
         
            -
                . 
     | 
| 
       53 
     | 
    
         
            -
                .action(async ( 
     | 
| 
       54 
     | 
    
         
            -
                const {  
     | 
| 
       55 
     | 
    
         
            -
                return  
     | 
| 
       56 
     | 
    
         
            -
            });
         
     | 
| 
       57 
     | 
    
         
            -
            program
         
     | 
| 
       58 
     | 
    
         
            -
                .command(' 
     | 
| 
       59 
     | 
    
         
            -
                .description('创建  
     | 
| 
       60 
     | 
    
         
            -
                .option('-p --port [port]', 'Server Port')
         
     | 
| 
       61 
     | 
    
         
            -
                .action(async (options) => {
         
     | 
| 
       62 
     | 
    
         
            -
                 
     | 
| 
       63 
     | 
    
         
            -
                 
     | 
| 
       64 
     | 
    
         
            -
             
     | 
| 
       65 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            #!/usr/bin/env node
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { Command } from 'commander';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { getVersion } from "./common/get-version.js";
         
     | 
| 
      
 4 
     | 
    
         
            +
            const program = new Command();
         
     | 
| 
      
 5 
     | 
    
         
            +
            program.version(`@farris/cli ${getVersion()}`);
         
     | 
| 
      
 6 
     | 
    
         
            +
            program
         
     | 
| 
      
 7 
     | 
    
         
            +
                .command('build')
         
     | 
| 
      
 8 
     | 
    
         
            +
                .description('构建')
         
     | 
| 
      
 9 
     | 
    
         
            +
                .option('-c --configFile [configFile]', 'config file path')
         
     | 
| 
      
 10 
     | 
    
         
            +
                .option('-vc --viteConfigFile [viteConfigFile]', 'vite config file path')
         
     | 
| 
      
 11 
     | 
    
         
            +
                .action(async (options) => {
         
     | 
| 
      
 12 
     | 
    
         
            +
                process.env.BUILD_TYPE = 'app';
         
     | 
| 
      
 13 
     | 
    
         
            +
                const { buildCommon } = await import('./commands/build.js');
         
     | 
| 
      
 14 
     | 
    
         
            +
                buildCommon(options);
         
     | 
| 
      
 15 
     | 
    
         
            +
            });
         
     | 
| 
      
 16 
     | 
    
         
            +
            program
         
     | 
| 
      
 17 
     | 
    
         
            +
                .command('build-lib')
         
     | 
| 
      
 18 
     | 
    
         
            +
                .description('构建')
         
     | 
| 
      
 19 
     | 
    
         
            +
                .option('-c --configFile [configFile]', 'config file path')
         
     | 
| 
      
 20 
     | 
    
         
            +
                .option('-vc --viteConfigFile [viteConfigFile]', 'vite config file path')
         
     | 
| 
      
 21 
     | 
    
         
            +
                .option('-f --format [format]', 'lib format')
         
     | 
| 
      
 22 
     | 
    
         
            +
                .option('-d --dts', 'dts')
         
     | 
| 
      
 23 
     | 
    
         
            +
                .option('-ep --emitPackage', 'createPackage')
         
     | 
| 
      
 24 
     | 
    
         
            +
                .action(async (options) => {
         
     | 
| 
      
 25 
     | 
    
         
            +
                process.env.BUILD_TYPE = 'lib';
         
     | 
| 
      
 26 
     | 
    
         
            +
                const { buildLib } = await import('./commands/build-lib.js');
         
     | 
| 
      
 27 
     | 
    
         
            +
                return buildLib(options);
         
     | 
| 
      
 28 
     | 
    
         
            +
            });
         
     | 
| 
      
 29 
     | 
    
         
            +
            program
         
     | 
| 
      
 30 
     | 
    
         
            +
                .command('build-components')
         
     | 
| 
      
 31 
     | 
    
         
            +
                .description('构建')
         
     | 
| 
      
 32 
     | 
    
         
            +
                .option('-c --configFile [configFile]', 'config file path')
         
     | 
| 
      
 33 
     | 
    
         
            +
                .option('-vc --viteConfigFile [viteConfigFile]', 'vite config file path')
         
     | 
| 
      
 34 
     | 
    
         
            +
                .action(async (options) => {
         
     | 
| 
      
 35 
     | 
    
         
            +
                process.env.BUILD_TYPE = 'components';
         
     | 
| 
      
 36 
     | 
    
         
            +
                const { buildComponents } = await import('./commands/build-components.js');
         
     | 
| 
      
 37 
     | 
    
         
            +
                return buildComponents(options);
         
     | 
| 
      
 38 
     | 
    
         
            +
            });
         
     | 
| 
      
 39 
     | 
    
         
            +
            program
         
     | 
| 
      
 40 
     | 
    
         
            +
                .command('build-css')
         
     | 
| 
      
 41 
     | 
    
         
            +
                .description('构建')
         
     | 
| 
      
 42 
     | 
    
         
            +
                .option('-e --entry [entry]', 'entry file')
         
     | 
| 
      
 43 
     | 
    
         
            +
                .option('-o --outfile [outfile]', 'outfile')
         
     | 
| 
      
 44 
     | 
    
         
            +
                .option('-m --minify [minify]', 'minify')
         
     | 
| 
      
 45 
     | 
    
         
            +
                .action(async (options) => {
         
     | 
| 
      
 46 
     | 
    
         
            +
                process.env.BUILD_TYPE = 'css';
         
     | 
| 
      
 47 
     | 
    
         
            +
                const { buildCss } = await import('./commands/build-css.js');
         
     | 
| 
      
 48 
     | 
    
         
            +
                return buildCss(options);
         
     | 
| 
      
 49 
     | 
    
         
            +
            });
         
     | 
| 
      
 50 
     | 
    
         
            +
            program
         
     | 
| 
      
 51 
     | 
    
         
            +
                .command('create-app')
         
     | 
| 
      
 52 
     | 
    
         
            +
                .description('新建 App 模板')
         
     | 
| 
      
 53 
     | 
    
         
            +
                .action(async () => {
         
     | 
| 
      
 54 
     | 
    
         
            +
                const { createApp } = await import('./commands/create-app.js');
         
     | 
| 
      
 55 
     | 
    
         
            +
                return createApp();
         
     | 
| 
      
 56 
     | 
    
         
            +
            });
         
     | 
| 
      
 57 
     | 
    
         
            +
            program
         
     | 
| 
      
 58 
     | 
    
         
            +
                .command('dev')
         
     | 
| 
      
 59 
     | 
    
         
            +
                .description('创建 Dev Server')
         
     | 
| 
      
 60 
     | 
    
         
            +
                .option('-p --port [port]', 'Server Port')
         
     | 
| 
      
 61 
     | 
    
         
            +
                .action(async (options) => {
         
     | 
| 
      
 62 
     | 
    
         
            +
                process.env.BUILD_TYPE = 'app';
         
     | 
| 
      
 63 
     | 
    
         
            +
                const { devServe } = await import('./commands/dev-serve.js');
         
     | 
| 
      
 64 
     | 
    
         
            +
                return devServe(options);
         
     | 
| 
      
 65 
     | 
    
         
            +
            });
         
     | 
| 
      
 66 
     | 
    
         
            +
            program
         
     | 
| 
      
 67 
     | 
    
         
            +
                .command('preview')
         
     | 
| 
      
 68 
     | 
    
         
            +
                .description('创建 Preview Server')
         
     | 
| 
      
 69 
     | 
    
         
            +
                .option('-p --port [port]', 'Server Port')
         
     | 
| 
      
 70 
     | 
    
         
            +
                .action(async (options) => {
         
     | 
| 
      
 71 
     | 
    
         
            +
                process.env.BUILD_TYPE = 'app';
         
     | 
| 
      
 72 
     | 
    
         
            +
                const { previewServe } = await import('./commands/preview-serve.js');
         
     | 
| 
      
 73 
     | 
    
         
            +
                return previewServe(options);
         
     | 
| 
      
 74 
     | 
    
         
            +
            });
         
     | 
| 
      
 75 
     | 
    
         
            +
            program
         
     | 
| 
      
 76 
     | 
    
         
            +
                .command('extract-i18n')
         
     | 
| 
      
 77 
     | 
    
         
            +
                .description('抽取国际化资源到JSON文件')
         
     | 
| 
      
 78 
     | 
    
         
            +
                .option('-c --configFile [configFile]', 'config file path')
         
     | 
| 
      
 79 
     | 
    
         
            +
                .action(async (options) => {
         
     | 
| 
      
 80 
     | 
    
         
            +
                const { extractI18n } = await import('./commands/extract-i18n.js');
         
     | 
| 
      
 81 
     | 
    
         
            +
                return extractI18n(options);
         
     | 
| 
      
 82 
     | 
    
         
            +
            });
         
     | 
| 
      
 83 
     | 
    
         
            +
            program.parse();
         
     | 
| 
       66 
84 
     | 
    
         
             
            //# sourceMappingURL=index.js.map
         
     |