@farris/cli 2.0.0-beta.7 → 2.0.1

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.
Files changed (64) hide show
  1. package/bin/index.js +0 -0
  2. package/lib/commands/build-components.js +39 -36
  3. package/lib/commands/build-components.js.map +1 -0
  4. package/lib/commands/build-css.js +28 -11
  5. package/lib/commands/build-css.js.map +1 -0
  6. package/lib/commands/build-lib.js +28 -16
  7. package/lib/commands/build-lib.js.map +1 -0
  8. package/lib/commands/build.js +16 -10
  9. package/lib/commands/build.js.map +1 -0
  10. package/lib/commands/create-app.js +55 -54
  11. package/lib/commands/create-app.js.map +1 -0
  12. package/lib/commands/dev-serve.js +24 -23
  13. package/lib/commands/dev-serve.js.map +1 -0
  14. package/lib/commands/preview-serve.js +17 -16
  15. package/lib/commands/preview-serve.js.map +1 -0
  16. package/lib/common/constant.js +19 -18
  17. package/lib/common/constant.js.map +1 -0
  18. package/lib/common/generate-app.js +45 -44
  19. package/lib/common/generate-app.js.map +1 -0
  20. package/lib/common/get-dependencies.js +10 -9
  21. package/lib/common/get-dependencies.js.map +1 -0
  22. package/lib/common/get-farris-config.js +12 -11
  23. package/lib/common/get-farris-config.js.map +1 -0
  24. package/lib/common/get-version.js +7 -6
  25. package/lib/common/get-version.js.map +1 -0
  26. package/lib/common/get-vite-config.js +41 -38
  27. package/lib/common/get-vite-config.js.map +1 -0
  28. package/lib/config/vite-app.js +15 -14
  29. package/lib/config/vite-app.js.map +1 -0
  30. package/lib/config/vite-component.js +33 -0
  31. package/lib/config/vite-component.js.map +1 -0
  32. package/lib/config/vite-lib.js +28 -35
  33. package/lib/config/vite-lib.js.map +1 -0
  34. package/lib/index.js +66 -54
  35. package/lib/index.js.map +1 -0
  36. package/lib/plugins/{gen-component-style.js → create-component-style.js} +45 -43
  37. package/lib/plugins/create-component-style.js.map +1 -0
  38. package/lib/plugins/create-package-json.js +34 -0
  39. package/lib/plugins/create-package-json.js.map +1 -0
  40. package/lib/plugins/dts.js +9 -8
  41. package/lib/plugins/dts.js.map +1 -0
  42. package/lib/plugins/html-system.js +12 -11
  43. package/lib/plugins/html-system.js.map +1 -0
  44. package/lib/plugins/replace.js +14 -13
  45. package/lib/plugins/replace.js.map +1 -0
  46. package/lib/plugins/systemjs-bundle.js +16 -0
  47. package/lib/plugins/systemjs-bundle.js.map +1 -0
  48. package/package.json +5 -3
  49. package/templates/mobile/farris.config.mjs +23 -23
  50. package/templates/{lib → web}/farris.config.mjs +23 -34
  51. package/templates/{lib → web}/package.json +4 -4
  52. package/templates/web/src/App.vue +80 -0
  53. package/templates/web/src/components/TheButton.vue +3 -0
  54. package/templates/{lib → web}/src/main.ts +3 -2
  55. package/templates/web/src/router/index.ts +23 -0
  56. package/templates/web/src/views/AboutView.vue +15 -0
  57. package/templates/web/src/views/HomeView.vue +9 -0
  58. package/templates/{lib → web}/tsconfig.json +5 -5
  59. package/templates/lib/packages/button/src/index.vue +0 -4
  60. package/templates/lib/packages/index.ts +0 -7
  61. package/templates/lib/src/App.vue +0 -5
  62. /package/templates/{lib → web}/.eslintrc.cjs +0 -0
  63. /package/templates/{lib → web}/.prettierrc.json +0 -0
  64. /package/templates/{lib → web}/index.html +0 -0
package/bin/index.js CHANGED
File without changes
@@ -1,36 +1,39 @@
1
- import { readdirSync, lstatSync } from "node:fs";
2
- import { resolve } from "node:path";
3
- import { buildCommon } from "./build.js";
4
- import { CWD } from "../common/constant.js";
5
- import { replace } from "../plugins/replace.js";
6
- import { genComponentStyle } from "../plugins/gen-component-style.js";
7
- export async function buildComponents(options) {
8
- const components = readdirSync("./components").filter((name) => {
9
- const componentDir = resolve(CWD, `./components`, name);
10
- const isDir = lstatSync(componentDir).isDirectory();
11
- return isDir && readdirSync(componentDir).includes("index.ts");
12
- });
13
- components.forEach(async (component) => {
14
- const entry = resolve(CWD, `./components/${component}/index.ts`);
15
- const outDir = resolve(CWD, `./package/${component}`);
16
- const config = {
17
- publicDir: false,
18
- build: {
19
- lib: {
20
- entry
21
- },
22
- outDir
23
- },
24
- plugins: [genComponentStyle(), replace((format, args) => `..${args[1]}/index.${format}.js`)]
25
- };
26
- console.log(`build ${component} begin`);
27
- await buildCommon({ ...options, config, type: 'lib' });
28
- console.log(`build ${component} success`);
29
- // const cssEntry = `./components/${component}/src/${component}.scss`;
30
- // if(!existsSync(cssEntry)) {
31
- // return;
32
- // }
33
- // await buildCss({...options,entry: cssEntry, outfile: `./package/${component}/index.css` });
34
- });
35
- }
36
- ;
1
+ import { readdirSync, lstatSync, existsSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import ora from 'ora';
4
+ import { buildCommon } from "./build.js";
5
+ import { buildCss } from "./build-css.js";
6
+ import { CWD } from "../common/constant.js";
7
+ const excludeComponents = ['property-panel', 'dynamic-resolver', 'dynamic-view'];
8
+ export async function buildComponents(options) {
9
+ process.env.BUILD_TYPE = 'components';
10
+ const components = readdirSync("./components").filter((name) => {
11
+ const componentDir = resolve(CWD, `./components`, name);
12
+ const isDir = lstatSync(componentDir).isDirectory();
13
+ return isDir && readdirSync(componentDir).includes("index.ts");
14
+ }).filter(name => !excludeComponents.includes(name));
15
+ const spinner = ora(`build components begin`).start();
16
+ components.forEach(async (component) => {
17
+ const entry = resolve(CWD, `./components/${component}/index.ts`);
18
+ const outDir = resolve(CWD, `./package/${component}`);
19
+ const config = {
20
+ publicDir: '',
21
+ build: {
22
+ lib: {
23
+ entry
24
+ },
25
+ outDir
26
+ }
27
+ };
28
+ spinner.text = `building ${component}`;
29
+ await buildCommon({ ...options, config, type: 'component' });
30
+ spinner.succeed(`build ${component} success`);
31
+ const cssEntry = `./components/${component}/src/${component}.scss`;
32
+ if (!existsSync(cssEntry)) {
33
+ return;
34
+ }
35
+ await buildCss({ ...options, entry: cssEntry, outfile: `./package/${component}/index.css` });
36
+ });
37
+ }
38
+ ;
39
+ //# sourceMappingURL=build-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-components.js","sourceRoot":"","sources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,GAAG,EAAE,aAAa,SAAS,EAAE,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,EAAE;YACb,KAAK,EAAE;gBACL,GAAG,EAAC;oBACF,KAAK;iBACN;gBACD,MAAM;aACP;SACF,CAAC;QAEF,OAAO,CAAC,IAAI,GAAG,YAAY,SAAS,EAAE,CAAC;QAEvC,MAAM,WAAW,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAG,CAAC,CAAC;QAE9D,OAAO,CAAC,OAAO,CAAC,SAAS,SAAS,UAAU,CAAC,CAAC;QAE9C,MAAM,QAAQ,GAAG,gBAAgB,SAAS,QAAQ,SAAS,OAAO,CAAC;QACnE,IAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YACxB,OAAO;SACR;QACD,MAAM,QAAQ,CAAC,EAAC,GAAG,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,SAAS,YAAY,EAAE,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AAEL,CAAC;AAAA,CAAC"}
@@ -1,11 +1,28 @@
1
- import { build } from "esbuild";
2
- import { sassPlugin } from 'esbuild-sass-plugin';
3
- export async function buildCss(options) {
4
- const { entry, outfile } = options;
5
- await build({
6
- entryPoints: [entry],
7
- outfile,
8
- bundle: true,
9
- plugins: [sassPlugin()],
10
- });
11
- }
1
+ import { build } from "esbuild";
2
+ import { sassPlugin } from 'esbuild-sass-plugin';
3
+ import path from 'node:path';
4
+ import { CWD } from "../common/constant.js";
5
+ const replaceUrl = (source, pathname, entry) => {
6
+ const basedir = path.dirname(pathname);
7
+ const entrydir = path.resolve(CWD, path.dirname(entry));
8
+ const relativedir = path.relative(entrydir, basedir);
9
+ const regExp = /(url\(['"]?)(\.\.?\/[^'")]+['"]?)(\))/g;
10
+ return source.replace(regExp, (substring, ...args) => `url(./${path.join(relativedir, args[1]).replaceAll('\\', '/')})`);
11
+ };
12
+ export async function buildCss(options) {
13
+ const { entry, outfile } = options;
14
+ await build({
15
+ entryPoints: [entry],
16
+ outfile,
17
+ bundle: true,
18
+ plugins: [sassPlugin({
19
+ precompile(source, pathname) {
20
+ return replaceUrl(source, pathname, entry);
21
+ }
22
+ })],
23
+ loader: {
24
+ '.ttf': 'dataurl'
25
+ }
26
+ });
27
+ }
28
+ //# sourceMappingURL=build-css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-css.js","sourceRoot":"","sources":["../../src/commands/build-css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAE,KAAa,EAAC,EAAE;IACpE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,wCAAwC,CAAC;IACxD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,GAAG,IAAI,EAAC,EAAE,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AAC1H,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAY;IACzC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACnC,MAAM,KAAK,CAAC;QACV,WAAW,EAAE,CAAC,KAAK,CAAC;QACpB,OAAO;QACP,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,CAAC,UAAU,CAAC;gBACnB,UAAU,CAAC,MAAM,EAAE,QAAQ;oBACzB,OAAO,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAC7C,CAAC;aACF,CAAC,CAAC;QACH,MAAM,EAAE;YACN,MAAM,EAAE,SAAS;SAClB;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,16 +1,28 @@
1
- import { buildCommon } from "./build.js";
2
- import { generateTypes } from "../plugins/dts.js";
3
- export async function buildLib(options) {
4
- const { dts = false } = options;
5
- const config = {
6
- publicDir: false,
7
- plugins: [
8
- dts && generateTypes("./components", "./package/types")
9
- ]
10
- };
11
- console.log(`build lib begin`);
12
- await buildCommon({ ...options, config, type: 'lib' });
13
- console.log(`build lib success`);
14
- // await buildCss({...options, entry: "./components/index.scss", outfile: "./package/index.css"});
15
- }
16
- ;
1
+ import ora from 'ora';
2
+ import { buildCommon } from "./build.js";
3
+ import { generateTypes } from "../plugins/dts.js";
4
+ import { existsSync } from 'node:fs';
5
+ import { buildCss } from './build-css.js';
6
+ import { createPackageJson } from '../plugins/create-package-json.js';
7
+ export async function buildLib(options) {
8
+ process.env.BUILD_TYPE = 'lib';
9
+ const { dts = true, emitPackage } = options;
10
+ const config = {
11
+ publicDir: '',
12
+ plugins: [
13
+ dts && generateTypes("./components", "./package/types"),
14
+ emitPackage && createPackageJson()
15
+ ]
16
+ };
17
+ const spinner = ora(`build lib begin`).start();
18
+ spinner.text = `building lib`;
19
+ const libConfig = await buildCommon({ ...options, config, type: 'lib' });
20
+ const { css } = libConfig.build;
21
+ if (existsSync(css.entry)) {
22
+ spinner.text = `building css`;
23
+ await buildCss({ entry: css.entry, outfile: css.outfile });
24
+ }
25
+ spinner.succeed(`build success`);
26
+ }
27
+ ;
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AAG,CAAC,OAAO,EAAE,CAAC,CAAC;KAC5D;IAED,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AACnC,CAAC;AAAA,CAAC"}
@@ -1,10 +1,16 @@
1
- import { build, mergeConfig, loadConfigFromFile } from 'vite';
2
- import { getViteConfig } from '../common/get-vite-config.js';
3
- export async function buildCommon(options) {
4
- const { configFile, config, type } = options;
5
- const viteConfig = await loadConfigFromFile({ command: 'build', mode: 'production' }, configFile);
6
- const defaultConfig = await getViteConfig(type);
7
- const libConfig = mergeConfig(mergeConfig(defaultConfig, viteConfig ? viteConfig.config : {}), config);
8
- await build(libConfig);
9
- }
10
- ;
1
+ import { build, mergeConfig, loadConfigFromFile } from 'vite';
2
+ import { getViteConfig } from '../common/get-vite-config.js';
3
+ export async function buildCommon(options, loadFile = true) {
4
+ const { configFile, config = {}, type } = options;
5
+ if (!loadFile) {
6
+ await build(config);
7
+ return config;
8
+ }
9
+ const viteConfig = await loadConfigFromFile({ command: 'build', mode: 'production' }, configFile);
10
+ const defaultConfig = await getViteConfig(type);
11
+ const libConfig = mergeConfig(mergeConfig(defaultConfig, viteConfig ? viteConfig.config : {}), config);
12
+ await build(libConfig);
13
+ return libConfig;
14
+ }
15
+ ;
16
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAc,MAAM,MAAM,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAQ7D,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAA2B,EAAE,QAAQ,GAAG,IAAI;IAC5E,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAElD,IAAG,CAAC,QAAQ,EAAE;QACZ,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC;KACf;IAED,MAAM,UAAU,GAAG,MAAM,kBAAkB,CAAC,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAC,EAAE,UAAU,CAAC,CAAC;IAEhG,MAAM,aAAa,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAEhD,MAAM,SAAS,GAAE,WAAW,CAAC,WAAW,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAEtG,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC;IAEvB,OAAO,SAAS,CAAC;AACnB,CAAC;AAAA,CAAC"}
@@ -1,54 +1,55 @@
1
- import { generateApp } from "../common/generate-app.js";
2
- import inquirer from "inquirer";
3
- const prompt = inquirer.createPromptModule();
4
- const questions = [
5
- {
6
- type: "input",
7
- name: "name",
8
- message: "What is your project name?",
9
- default: "my-project",
10
- },
11
- {
12
- type: "list",
13
- name: "type",
14
- message: "What type of project is this?",
15
- choices: ["app", "lib"],
16
- },
17
- {
18
- type: "list",
19
- name: "platform",
20
- message: "What platform of project is this?",
21
- choices: ["pc", "mobile"],
22
- when: (response) => {
23
- const { type } = response;
24
- return type === 'app';
25
- }
26
- },
27
- {
28
- type: "checkbox",
29
- name: "formats",
30
- message: "What output format of project is this?",
31
- choices: ["es", "umd", "systemjs"],
32
- default: ["es", "umd"],
33
- when: (response) => {
34
- const { type } = response;
35
- return type === 'lib';
36
- }
37
- },
38
- {
39
- type: "list",
40
- name: "format",
41
- message: "What output format of project is this?",
42
- choices: ["es", "umd", "systemjs"],
43
- default: ["es"],
44
- when: (response) => {
45
- const { type } = response;
46
- return type === 'app';
47
- }
48
- }
49
- ];
50
- export async function createApp() {
51
- const response = await prompt(questions);
52
- generateApp(response);
53
- }
54
- ;
1
+ import { generateApp } from "../common/generate-app.js";
2
+ import inquirer from "inquirer";
3
+ const prompt = inquirer.createPromptModule();
4
+ const questions = [
5
+ {
6
+ type: "input",
7
+ name: "name",
8
+ message: "What is your project name?",
9
+ default: "my-project",
10
+ },
11
+ {
12
+ type: "list",
13
+ name: "type",
14
+ message: "What type of project is this?",
15
+ choices: ["app", "lib"],
16
+ },
17
+ {
18
+ type: "list",
19
+ name: "platform",
20
+ message: "What platform of project is this?",
21
+ choices: ["web", "mobile"],
22
+ when: (response) => {
23
+ const { type } = response;
24
+ return type === 'app';
25
+ }
26
+ },
27
+ {
28
+ type: "checkbox",
29
+ name: "formats",
30
+ message: "What output format of project is this?",
31
+ choices: ["es", "umd", "systemjs"],
32
+ default: ["es", "umd"],
33
+ when: (response) => {
34
+ const { type } = response;
35
+ return type === 'lib';
36
+ }
37
+ },
38
+ {
39
+ type: "list",
40
+ name: "format",
41
+ message: "What output format of project is this?",
42
+ choices: ["es", "umd", "systemjs"],
43
+ default: ["es"],
44
+ when: (response) => {
45
+ const { type } = response;
46
+ return type === 'app';
47
+ }
48
+ }
49
+ ];
50
+ export async function createApp() {
51
+ const response = await prompt(questions);
52
+ generateApp(response);
53
+ }
54
+ ;
55
+ //# sourceMappingURL=create-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-app.js","sourceRoot":"","sources":["../../src/commands/create-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,MAAM,MAAM,GAAG,QAAQ,CAAC,kBAAkB,EAAE,CAAC;AAE7C,MAAM,SAAS,GAAG;IAChB;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,4BAA4B;QACrC,OAAO,EAAE,YAAY;KACtB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,+BAA+B;QACxC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;KACxB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,mCAAmC;QAC5C,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;QAC1B,IAAI,EAAE,CAAC,QAAa,EAAE,EAAE;YACtB,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;YAC1B,OAAO,IAAI,KAAK,KAAK,CAAC;QACxB,CAAC;KACF;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,wCAAwC;QACjD,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC;QAClC,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;QACtB,IAAI,EAAE,CAAC,QAAa,EAAE,EAAE;YACtB,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;YAC1B,OAAO,IAAI,KAAK,KAAK,CAAC;QACxB,CAAC;KACF;IACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,wCAAwC;QACjD,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC;QAClC,OAAO,EAAE,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,CAAC,QAAa,EAAE,EAAE;YACtB,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;YAC1B,OAAO,IAAI,KAAK,KAAK,CAAC;QACxB,CAAC;KACF;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;IAEzC,WAAW,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC;AAAA,CAAC"}
@@ -1,23 +1,24 @@
1
- import { createServer, mergeConfig } from 'vite';
2
- import { getViteConfig } from '../common/get-vite-config.js';
3
- export const devServe = async (options) => {
4
- const { port = 1337, host = true } = options;
5
- const config = await getViteConfig();
6
- const devConfig = mergeConfig({
7
- configFile: false,
8
- mode: 'dev',
9
- define: {
10
- __VUE_OPTIONS_API__: 'true',
11
- __VUE_PROD_DEVTOOLS__: 'true',
12
- __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'true'
13
- },
14
- server: {
15
- port,
16
- host,
17
- hmr: true
18
- }
19
- }, config);
20
- const server = await createServer(devConfig);
21
- await server.listen();
22
- server.printUrls();
23
- };
1
+ import { createServer, mergeConfig } from 'vite';
2
+ import { getViteConfig } from '../common/get-vite-config.js';
3
+ export const devServe = async (options) => {
4
+ const { port = 1337, host = true } = options;
5
+ const config = await getViteConfig();
6
+ const devConfig = mergeConfig({
7
+ configFile: false,
8
+ mode: 'dev',
9
+ define: {
10
+ __VUE_OPTIONS_API__: 'true',
11
+ __VUE_PROD_DEVTOOLS__: 'true',
12
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'true'
13
+ },
14
+ server: {
15
+ port,
16
+ host,
17
+ hmr: true
18
+ }
19
+ }, config);
20
+ const server = await createServer(devConfig);
21
+ await server.listen();
22
+ server.printUrls();
23
+ };
24
+ //# sourceMappingURL=dev-serve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-serve.js","sourceRoot":"","sources":["../../src/commands/dev-serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAO7D,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAAE,OAAqB,EAAE,EAAE;IACtD,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAE7C,MAAM,MAAM,GAAG,MAAM,aAAa,EAAE,CAAC;IAErC,MAAM,SAAS,GAAG,WAAW,CAAC;QAC5B,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,KAAK;QACX,MAAM,EAAE;YACN,mBAAmB,EAAE,MAAM;YAC3B,qBAAqB,EAAE,MAAM;YAC7B,uCAAuC,EAAE,MAAM;SAChD;QACD,MAAM,EAAE;YACN,IAAI;YACJ,IAAI;YACJ,GAAG,EAAE,IAAI;SACV;KACF,EAAE,MAAM,CAAC,CAAC;IAEX,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,CAAC;IAC7C,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;IAEtB,MAAM,CAAC,SAAS,EAAE,CAAC;AACrB,CAAC,CAAC"}
@@ -1,16 +1,17 @@
1
- import { preview, mergeConfig } from 'vite';
2
- import { getViteConfig } from '../common/get-vite-config.js';
3
- export const previewServe = async (options) => {
4
- const { port = 4137, host = true } = options;
5
- const config = await getViteConfig();
6
- const previewConfig = mergeConfig({
7
- configFile: false,
8
- preview: {
9
- port,
10
- host,
11
- open: true
12
- }
13
- }, config);
14
- const server = await preview(previewConfig);
15
- server.printUrls();
16
- };
1
+ import { preview, mergeConfig } from 'vite';
2
+ import { getViteConfig } from '../common/get-vite-config.js';
3
+ export const previewServe = async (options) => {
4
+ const { port = 4137, host = true } = options;
5
+ const config = await getViteConfig();
6
+ const previewConfig = mergeConfig({
7
+ configFile: false,
8
+ preview: {
9
+ port,
10
+ host,
11
+ open: true
12
+ }
13
+ }, config);
14
+ const server = await preview(previewConfig);
15
+ server.printUrls();
16
+ };
17
+ //# sourceMappingURL=preview-serve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-serve.js","sourceRoot":"","sources":["../../src/commands/preview-serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAO7D,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,OAAuB,EAAE,EAAE;IAC5D,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAE7C,MAAM,MAAM,GAAG,MAAM,aAAa,EAAE,CAAC;IACrC,MAAM,aAAa,GAAG,WAAW,CAAC;QAChC,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE;YACP,IAAI;YACJ,IAAI;YACJ,IAAI,EAAE,IAAI;SACX;KACF,EAAE,MAAM,CAAC,CAAC;IAEX,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;IAE5C,MAAM,CAAC,SAAS,EAAE,CAAC;AACrB,CAAC,CAAC"}
@@ -1,18 +1,19 @@
1
- import { existsSync } from 'node:fs';
2
- import { fileURLToPath } from 'node:url';
3
- import { join, dirname } from 'node:path';
4
- function findRootDir(dir) {
5
- if (existsSync(join(dir, 'farris.config.js'))) {
6
- return dir;
7
- }
8
- const parentDir = dirname(dir);
9
- if (dir === parentDir) {
10
- return dir;
11
- }
12
- return findRootDir(parentDir);
13
- }
14
- export const getDirname = (url) => fileURLToPath(new URL('.', url));
15
- // Root paths
16
- export const CWD = process.cwd();
17
- export const ROOT = findRootDir(CWD);
18
- export const FAARIS_CONFIG_FILE = join(CWD, 'farris.config.mjs');
1
+ import { existsSync } from 'node:fs';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { join, dirname } from 'node:path';
4
+ function findRootDir(dir) {
5
+ if (existsSync(join(dir, 'farris.config.js'))) {
6
+ return dir;
7
+ }
8
+ const parentDir = dirname(dir);
9
+ if (dir === parentDir) {
10
+ return dir;
11
+ }
12
+ return findRootDir(parentDir);
13
+ }
14
+ export const getDirname = (url) => fileURLToPath(new URL('.', url));
15
+ // Root paths
16
+ export const CWD = process.cwd();
17
+ export const ROOT = findRootDir(CWD);
18
+ export const FAARIS_CONFIG_FILE = join(CWD, 'farris.config.mjs');
19
+ //# sourceMappingURL=constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constant.js","sourceRoot":"","sources":["../../src/common/constant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,SAAS,WAAW,CAAC,GAAW;IAC9B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,EAAE;QAC7C,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,GAAG,KAAK,SAAS,EAAE;QACrB,OAAO,GAAG,CAAC;KACZ;IAED,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC;AACD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAC,EAAE,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAE3E,aAAa;AAEb,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;AACrC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC"}
@@ -1,44 +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
+ //# sourceMappingURL=generate-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-app.js","sourceRoot":"","sources":["../../src/common/generate-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtE,MAAM,YAAY,GAAG,CAAC,GAAU,EAAE,EAAE;IAClC,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QACxC,GAAG,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAC1C,GAAG,IAAI,KAAK,GAAG,GAAG,CAAC;QACnB,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,GAAG,CAAC;AACR,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAE,EAAE;IACxD,MAAM,YAAY,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EAAE,IAAI,CAAC,CAAC;IAE7B,MAAM,YAAY,GAAG;QACnB,cAAc;QACd,mBAAmB;QACnB,YAAY;KACb,CAAC;IAEF,MAAM,UAAU,GAAG,UAAU,EAAE,CAAC;IAChC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACjC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;IACnG,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AACrC,CAAC,CAAC"}
@@ -1,9 +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
+ //# sourceMappingURL=get-dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-dependencies.js","sourceRoot":"","sources":["../../src/common/get-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;IAChE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,WAAW,CAAC;IAEvD,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,CAAC;AACtF,CAAC,CAAC"}
@@ -1,11 +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(FAARIS_CONFIG_FILE).href)).default;
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() {
4
+ try {
5
+ return (await import(pathToFileURL(FAARIS_CONFIG_FILE).href)).default;
6
+ }
7
+ catch (err) {
8
+ return {};
9
+ }
10
+ }
11
+ export { getFarrisConfigAsync };
12
+ //# sourceMappingURL=get-farris-config.js.map
@@ -0,0 +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;IACjC,IAAI;QACF,OAAO,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;KACvE;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -1,6 +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
+ //# sourceMappingURL=get-version.js.map