1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.successes = exports.infos = exports.inputs = exports.confirms = exports.errors = void 0;
|
7 |
|
8 | var _constants = require("./constants");
|
9 |
|
10 | var _prompt = require("./prompt");
|
11 |
|
12 | let errors = {
|
13 | noSource: source => `no source file was provided, please create a file at ${source} or specify a custom source file with the ${_constants.PKG_JSON_CONFIG_FIELD} source option`,
|
14 | deniedWriteMainField: "changing the main field is required to build",
|
15 | invalidModuleField: "module field is invalid",
|
16 | invalidMainField: "main field is invalid",
|
17 | invalidUmdMainField: "umd:main field is invalid",
|
18 | invalidBrowserField: "browser field is invalid",
|
19 | invalidReactNativeField: "react-native field is invalid",
|
20 | umdNameNotSpecified: `the umd:main field is specified but a umdName option is not specified. please add it to the ${_constants.PKG_JSON_CONFIG_FIELD} field in your package.json`,
|
21 | deniedWriteBrowserField: "building browser bundles for modules that include typeof window or typeof document is currently required",
|
22 | noEntrypointPkgJson: "There is a missing package.json for an entrypoint",
|
23 | noEntrypoints: "packages must have at least one entrypoint, this package has no entrypoints"
|
24 | };
|
25 | exports.errors = errors;
|
26 | let confirms = {
|
27 | writeMainField: (0, _prompt.createPromptConfirmLoader)("preconstruct is going to change the main field in your package.json, are you okay with that?"),
|
28 | writeModuleField: (0, _prompt.createPromptConfirmLoader)("would you like to generate module builds? this will write to the module field in your package.json"),
|
29 | fixModuleField: (0, _prompt.createPromptConfirmLoader)("would you like to fix the module field?"),
|
30 | fixUmdBuild: (0, _prompt.createPromptConfirmLoader)("would you like to fix the umd field?"),
|
31 | shouldInstallObjectAssign: (0, _prompt.createPromptConfirmLoader)("Object.assign is polyfilled with object-assign to reduce bundle size when used with react. would you like to install object-assign automatically?"),
|
32 | shouldInstallBabelRuntime: (0, _prompt.createPromptConfirmLoader)("Babel helpers (functions inserted by babel transforms) should be imported from a @babel/runtime package (which has to be in your dependencies) to reduce bundle size. would you like to install @babel/runtime automatically?"),
|
33 | addBrowserField: (0, _prompt.createPromptConfirmLoader)("typeof window or typeof document is used in this package. would you like build seperate browser builds for better browser bundle sizes?"),
|
34 | fixBrowserField: (0, _prompt.createPromptConfirmLoader)("would you like to fix the browser build?"),
|
35 | createEntrypointPkgJson: (0, _prompt.createPromptConfirmLoader)("A package.json file does not exist for this entrypoint, would you like to create one automatically?")
|
36 | };
|
37 | exports.confirms = confirms;
|
38 | let inputs = {
|
39 | getUmdName: "what should the name used for UMD bundles be?"
|
40 | };
|
41 | exports.inputs = inputs;
|
42 | let infos = {
|
43 | validMainField: "main field is valid",
|
44 | validModuleField: "module field is valid",
|
45 | validUmdMainField: "umd:main field is valid",
|
46 | validEntrypoint: "a valid entry point exists.",
|
47 | validBrowserField: "browser field is valid",
|
48 | validReactNativeField: "react-native field is valid",
|
49 | validPackageEntrypoints: "package entrypoints are valid"
|
50 | };
|
51 | exports.infos = infos;
|
52 | let successes = {
|
53 | validProject: "project is valid!",
|
54 | startedWatching: "started watching!"
|
55 | };
|
56 | exports.successes = successes; |
\ | No newline at end of file |