UNPKG

piral-cli

Version:

The standard CLI for creating and building a Piral instance or a Pilet.

1,615 lines • 103 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generalInfo_0000 = generalInfo_0000; exports.generalWarning_0001 = generalWarning_0001; exports.generalError_0002 = generalError_0002; exports.generalDebug_0003 = generalDebug_0003; exports.generalVerbose_0004 = generalVerbose_0004; exports.appInstanceNotFound_0010 = appInstanceNotFound_0010; exports.appInstanceInvalid_0011 = appInstanceInvalid_0011; exports.appInstancesNotGiven_0012 = appInstancesNotGiven_0012; exports.packageJsonNotFound_0020 = packageJsonNotFound_0020; exports.packageJsonMissingName_0021 = packageJsonMissingName_0021; exports.packageJsonMissingVersion_0022 = packageJsonMissingVersion_0022; exports.packageNotInstalled_0023 = packageNotInstalled_0023; exports.packageVersionInvalid_0024 = packageVersionInvalid_0024; exports.importMapVersionSpecNotSatisfied_0025 = importMapVersionSpecNotSatisfied_0025; exports.importMapVersionSpecInvalid_0026 = importMapVersionSpecInvalid_0026; exports.importMapReferenceNotFound_0027 = importMapReferenceNotFound_0027; exports.importMapFileNotFound_0028 = importMapFileNotFound_0028; exports.invalidSharedDependency_0029 = invalidSharedDependency_0029; exports.scaffoldPathDoesNotExist_0030 = scaffoldPathDoesNotExist_0030; exports.upgradePathDoesNotExist_0031 = upgradePathDoesNotExist_0031; exports.projectReferenceNotSupported_0032 = projectReferenceNotSupported_0032; exports.invalidPiletTarget_0040 = invalidPiletTarget_0040; exports.invalidPiletPackage_0041 = invalidPiletPackage_0041; exports.invalidPiletPackage_0042 = invalidPiletPackage_0042; exports.invalidPiralReference_0043 = invalidPiralReference_0043; exports.cannotCreateDirectory_0044 = cannotCreateDirectory_0044; exports.didNotOverWriteFile_0045 = didNotOverWriteFile_0045; exports.cannotFindFile_0046 = cannotFindFile_0046; exports.portChanged_0047 = portChanged_0047; exports.portNotFree_0048 = portNotFree_0048; exports.localeFileForUpgradeMissing_0050 = localeFileForUpgradeMissing_0050; exports.gitLatestForUpgradeMissing_0051 = gitLatestForUpgradeMissing_0051; exports.cannotResolveVersion_0052 = cannotResolveVersion_0052; exports.cannotResolveDependency_0053 = cannotResolveDependency_0053; exports.skipUnresolvedDependency_0054 = skipUnresolvedDependency_0054; exports.missingPiletFeedUrl_0060 = missingPiletFeedUrl_0060; exports.missingPiletTarball_0061 = missingPiletTarball_0061; exports.failedToUpload_0062 = failedToUpload_0062; exports.failedToRead_0063 = failedToRead_0063; exports.failedUploading_0064 = failedUploading_0064; exports.failedHttpPost_0065 = failedHttpPost_0065; exports.unsuccessfulHttpPost_0066 = unsuccessfulHttpPost_0066; exports.httpPostResponse_0067 = httpPostResponse_0067; exports.failedHttpGet_0068 = failedHttpGet_0068; exports.failedToUploadPayment_0161 = failedToUploadPayment_0161; exports.failedToUploadVersion_0162 = failedToUploadVersion_0162; exports.failedToUploadSize_0163 = failedToUploadSize_0163; exports.entryPointMissing_0070 = entryPointMissing_0070; exports.entryPointMissing_0071 = entryPointMissing_0071; exports.expectedArray_0072 = expectedArray_0072; exports.entryPointDoesNotExist_0073 = entryPointDoesNotExist_0073; exports.packageJsonMissing_0074 = packageJsonMissing_0074; exports.packageJsonMissing_0075 = packageJsonMissing_0075; exports.declarationCouldNotBeGenerated_0076 = declarationCouldNotBeGenerated_0076; exports.entryFileMissing_0077 = entryFileMissing_0077; exports.frameworkLibMissing_0078 = frameworkLibMissing_0078; exports.validationFailed_0080 = validationFailed_0080; exports.validationWarned_0081 = validationWarned_0081; exports.appShellIncompatible_0100 = appShellIncompatible_0100; exports.toolingIncompatible_0101 = toolingIncompatible_0101; exports.appShellMaybeIncompatible_0102 = appShellMaybeIncompatible_0102; exports.publishDirectoryMissing_0110 = publishDirectoryMissing_0110; exports.publishEmulatorFilesUnexpected_0111 = publishEmulatorFilesUnexpected_0111; exports.publishXcopyMissingTarget_0112 = publishXcopyMissingTarget_0112; exports.publishProviderMissing_0113 = publishProviderMissing_0113; exports.publishEmulatorSourcesInvalid_0114 = publishEmulatorSourcesInvalid_0114; exports.publishFeedMissingUrl_0115 = publishFeedMissingUrl_0115; exports.publishFeedMissingVersion_0116 = publishFeedMissingVersion_0116; exports.skipEmulatorUpdate_0120 = skipEmulatorUpdate_0120; exports.remoteEmulatorNameChanged_0121 = remoteEmulatorNameChanged_0121; exports.optionalEmulatorAssetUpdateSkipped_0122 = optionalEmulatorAssetUpdateSkipped_0122; exports.requiredEmulatorAssetDownloadSkipped_0123 = requiredEmulatorAssetDownloadSkipped_0123; exports.missingEmulatorWebsite_0130 = missingEmulatorWebsite_0130; exports.failedToOpenBrowser_0170 = failedToOpenBrowser_0170; exports.invalidSchemaVersion_0171 = invalidSchemaVersion_0171; exports.bundlerMissing_0172 = bundlerMissing_0172; exports.defaultBundlerMissing_0173 = defaultBundlerMissing_0173; exports.bundlingFailed_0174 = bundlingFailed_0174; exports.bundlerUnspecified_0175 = bundlerUnspecified_0175; exports.bundlerNotInstalled_0176 = bundlerNotInstalled_0176; exports.piletJsonNotAvailable_0180 = piletJsonNotAvailable_0180; exports.platformNotSupported_0190 = platformNotSupported_0190; exports.apiCommandNameInvalid_0200 = apiCommandNameInvalid_0200; exports.apiArgumentInvalid_0201 = apiArgumentInvalid_0201; exports.apiValidateNameInvalid_0202 = apiValidateNameInvalid_0202; exports.apiValidateRunInvalid_0203 = apiValidateRunInvalid_0203; exports.apiPatchInvalid_0204 = apiPatchInvalid_0204; exports.pluginCouldNotBeLoaded_0205 = pluginCouldNotBeLoaded_0205; exports.apiBundlerInvalid_0206 = apiBundlerInvalid_0206; exports.apiReleaseProviderInvalid_0207 = apiReleaseProviderInvalid_0207; exports.piletMultiDebugAppShellDifferent_0301 = piletMultiDebugAppShellDifferent_0301; exports.piletMultiDebugAppShellVersions_0302 = piletMultiDebugAppShellVersions_0302; exports.piletMultiDebugExternalsDifferent_0303 = piletMultiDebugExternalsDifferent_0303; const types_1 = require("./types"); /** * @kind Info * * @summary * General information without further content. * * @abstract * Printed to inform you about certain progress in the current command. * * @see * - [Node Console](https://nodejs.org/api/console.html) * * @example * Nothing of interest yet. */ function generalInfo_0000(message) { return [types_1.LogLevels.info, '0000', message]; } /** * @kind Warning * * @summary * General warning without further content. * * @abstract * Printed to inform you about a potential problem that may require * changes to your project. * * @see * - [Node Console](https://nodejs.org/api/console.html) * * @example * Nothing of interest yet. */ function generalWarning_0001(message) { return [types_1.LogLevels.warning, '0001', message]; } /** * @kind Error * * @summary * General error without further content. * * @abstract * Printed to inform you about a problem that requires changes to * your project. * * @see * - [Node Console](https://nodejs.org/api/console.html) * * @example * Nothing of interest yet. */ function generalError_0002(message) { return [types_1.LogLevels.error, '0002', message]; } /** * @kind Debug * * @summary * General debug message without further content. * * @abstract * Printed to give some indication about the application's current * progress and state. * * @see * - [Node Console](https://nodejs.org/api/console.html) * * @example * Nothing of interest yet. */ function generalDebug_0003(message) { return [types_1.LogLevels.debug, '0003', message]; } /** * @kind Verbose * * @summary * General info message without further content. * * @abstract * Printed to inform you about some more detailed progress in the * application. * * @see * - [Node Console](https://nodejs.org/api/console.html) * * @example * Nothing of interest yet. */ function generalVerbose_0004(message) { return [types_1.LogLevels.verbose, '0004', message]; } /** * @kind Error * * @summary * Reported when the Piral instance defined in the package.json could not be found. * * @abstract * The Piral instance is defined in the package.json via an object set as value of the "piral" key. * * The resolution of the Piral instance is done via the `require.resolve` function of Node.js. Thus, if the defined module is simply not yet installed this error will be shown. * * @see * - [npm i](https://docs.npmjs.com/cli/install) * - [npm install is missing modules](https://stackoverflow.com/questions/24652681/npm-install-is-missing-modules) * * @example * Assuming that the available package.json of your pilet contains content such as: * * ```json * { * "name": "my-pilet", * // ... * "piral": { * "name": "my-app-shell" * } * } * ``` * * However, running * * ```sh * ls node_modules/my-app-shell * ``` * * returns an error. * * To mitigate it try running * * ```sh * npm i * ``` * * which will install all dependencies. */ function appInstanceNotFound_0010(name) { return [types_1.LogLevels.error, '0010', `The defined Piral instance ("${name}") could not be found.`]; } /** * @kind Error * * @summary * Reported when the Piral instance defined in the package.json seems invalid. * * @abstract * There are a couple of properties that need to be fulfilled by a valid Piral instance. * An important property is that the package.json contains an "app" field. * * The app field denotes the entry point of the Piral instance for bundling purposes. * It should be an HTML file. * * @see * - [Parcel HTML Asset](https://parceljs.org/languages/html/) * * @example * Make sure the package.json of the Piral instance is valid (has an "app" field). * * This could look as follows: * * ```json * { * "name": "my-piral", * // ... * "app": "src/index.html" * } * ``` */ function appInstanceInvalid_0011() { return [types_1.LogLevels.error, '0011', `Could not find a valid Piral instance.`]; } /** * @kind Error * * @summary * Reported when no valid Piral instance was specified. * * @abstract * The Piral instance is defined either in the package.json or in the pilet.json. * * The resolution of the Piral instance is done via the `require.resolve` function of Node.js. Thus, if the defined module is simply not yet installed this error will be shown. * * @see * - [npm i](https://docs.npmjs.com/cli/install) * - [npm install is missing modules](https://stackoverflow.com/questions/24652681/npm-install-is-missing-modules) * * @example * Assuming that the available pilet.json of your pilet contains content such as: * * ```json * { * // ... * "piralInstances": { * "my-app-shell": {} * } * } * ``` * * However, running * * ```sh * ls node_modules/my-app-shell * ``` * * returns an error. * * To mitigate it try running * * ```sh * npm i * ``` * * which will install all dependencies. */ function appInstancesNotGiven_0012() { return [types_1.LogLevels.error, '0012', `No Piral instances have been provided.`]; } /** * @kind Error * * @summary * No valid package.json found * * @abstract * For performing this action on the pilet more information is required, which should come from * the project's package.json. * * To operate correctly the piral-cli needs to read information provided in the package.json. * Unfortunately, in the given scenario no package.json was found, or the contents of the found * package.json have not met the expected standard. * * Make sure to operate the piral-cli only in a valid Node.js project folder. A valid Node.js * project folder has a package.json in its root. * * @see * - [npm Package Specification](https://docs.npmjs.com/files/package.json) * * @example * You can see if you are currently in a correct folder. * * ```sh * ls package.json * ``` * * If nothing is displayed make sure to either change to the right directory, or to start a new * project using: * * ```sh * npm init * ``` * * If you want to start directly with a pilet just use the following command: * * ```sh * npm init pilet * ``` */ function packageJsonNotFound_0020() { return [types_1.LogLevels.error, '0020', `No valid package.json could be found.`]; } /** * @kind Error * * @summary * Cannot pack the pilet - missing name. * * @abstract * For performing this action on the pilet the piral-cli needs to know the name of the pilet. * The name of the pilet is provided by the name field specified in its package.json. * * A valid package.json file requires a valid name. The name has to follow standard naming * conventions of the npm system. * * @see * - [Package Naming Guidelines](https://docs.npmjs.com/package-name-guidelines) * * @example * Check the contents of the available package.json: * * ```sh * cat package.json * ``` * * The displayed content should look similar to: * * ```json * { * "name": "my-pilet", * "version": "1.0.0", * "dependencies": {}, * "devDependencies": { * "piral-cli": "^0.11.0", * "my-piral": "1.0.0" * }, * "piral": { * "name": "my-piral", * "tooling": "0.11.0" * } * } * ``` * * The exact values do not matter much, but rather the general structure. */ function packageJsonMissingName_0021() { return [types_1.LogLevels.error, '0021', `Cannot pack the pilet - missing name.`]; } /** * @kind Error * * @summary * Cannot pack the pilet - missing version. * * @abstract * For performing this action on the pilet the piral-cli needs to know the version of the pilet. * The version of the pilet is provided by the version field specified in its package.json. * * A valid package.json file requires a valid version. The version has to follow standard semver * specification. * * @see * - [npm on Semantic Versioning](https://docs.npmjs.com/about-semantic-versioning) * * @example * Check the contents of the available package.json: * * ```sh * cat package.json * ``` * * The displayed content should look similar to: * * ```json * { * "name": "my-pilet", * "version": "1.0.0", * "dependencies": {}, * "devDependencies": { * "piral-cli": "^0.11.0", * "my-piral": "1.0.0" * }, * "piral": { * "name": "my-piral", * "tooling": "0.11.0" * } * } * ``` * * The exact values do not matter much, but rather the general structure. */ function packageJsonMissingVersion_0022() { return [types_1.LogLevels.error, '0022', `Cannot pack the pilet - missing version.`]; } /** * @kind Warning * * @summary * Cannot pack the package. * * @abstract * For updating a Piral instance the packages have to be installed. Otherwise, * it is impossible for the Piral CLI to detect what packages need to be updated * and which ones can remain at their current version. * * @see * - [npm Install](https://docs.npmjs.com/cli/install) * * @example * Check that the package is indeed installed: * * ```sh * cat node_modules/{missing-package}/package.json * ``` * * The displayed content should look similar to: * * ```json * { * "name": "missing package", * "version": "1.0.0", * "dependencies": {}, * "devDependencies": {} * } * ``` * * The exact values do not matter much, but rather that the file is found at all. */ function packageNotInstalled_0023(name) { return [types_1.LogLevels.warning, '0023', `Cannot find the package "${name}". Skipping.`]; } /** * @kind Error * * @summary * The desired version is invalid. * * @abstract * For updating a Piral instance the provided version must be a valid version * identifier (e.g., 0.10.0) or a valid tag (e.g., latest). * * Before an update is performed the desired version is checked with the available * versions. If no release for the given version was found then an error is emitted. * * @see * - [StackOverflow Listing npm Versions](https://stackoverflow.com/questions/41415945/how-to-list-all-versions-of-an-npm-module) * * @example * Check that the version is valid: * * ```sh * npm show piral-cli version --tag 0.10.10 * ``` * * The result has to be a valid version answer. In the given example there is no * response, so it is empty. A valid response appear for: * * ```sh * npm show piral-cli version --tag 0.10.9 * ``` * * Here the answer is 0.10.9. */ function packageVersionInvalid_0024(version) { return [types_1.LogLevels.error, '0024', `The given package version "${version}" is invalid.`]; } /** * @kind Error * * @summary * Cannot add the shared dependency since its version constraint is not satisfied. * * @abstract * The importmap definition allows you to define a version specifier separated with * the '@' character. If you write down a version specifier then it has to be * fulfilled already from the local version, otherwise the packaged version can * potentially not be resolved at runtime. This would resolve in a pilet that fails * when running in isolation and most likely fails when running with other pilets. * * @see * - [import-maps specification](https://github.com/WICG/import-maps) * * @example * Check the contents of the available package.json: * * ```sh * cat package.json * ``` * * The displayed content should look similar to (i.e., contain an importmap such as): * * ```json * { * "importmap": { * "imports": { * "foo@^3.2.1": "foo" * } * } * } * ``` * * For the error to occur the specifier (^3.2.1) potentially does not match the version (e.g., if * the version of the dependency is 3.1.2). * * One strategy is to remove the specifier, which will automatically use the exact current version * as specifier: * * ```json * { * "importmap": { * "imports": { * "foo": "foo" * } * } * } * ``` * * The best way, however, is to look at the used version and adjust the specifier to be correct again. * Alternatively, change the used version to satisfy the constraint again. */ function importMapVersionSpecNotSatisfied_0025(depName, availableVersion, specVersion) { return [ types_1.LogLevels.error, '0025', `The dependency "${depName}" is locally installed in version "${availableVersion}", but specified as "${specVersion}".`, ]; } /** * @kind Error * * @summary * The version spec part of the importmap identifer is invalid. * * @abstract * The importmap definition allows you to define a version specifier separated with * the '@' character. This part has to follow the semver convention and rules. * * Check your specifier via online tools such as "Semver check" to verify it is * valid and follows the semver specification. * * @see * - [Online Checker](https://jubianchi.github.io/semver-check/) * * @example * Check the contents of the available package.json: * * ```sh * cat package.json * ``` * * The displayed content should look similar to (i.e., contain an importmap such as): * * ```json * { * "importmap": { * "imports": { * "foo@bar": "foo" * } * } * } * ``` * * For the error to occur the specifier (bar) is not following the semver specification. * * One way is to remove the version spec, which will resolve to an exact version specifier * and therefore always works: * * ```json * { * "importmap": { * "imports": { * "foo": "foo" * } * } * } * ``` * * The best way, however, is to look at the used version and adjust the specifier to be correct again, * such as "^1.2.3" or "1.x" or "3" etc. */ function importMapVersionSpecInvalid_0026(depName) { return [types_1.LogLevels.error, '0026', `The dependency "${depName}" has an invalid version spec.`]; } /** * @kind Error * * @summary * The provided importmap reference could not be resolved. * * @abstract * The importmap consists of keys and values. The keys represent the packages names and optional * version specifiers to demand at runtime. The values represent the entry point or URL to use * when the dependency is not yet loaded. * * In case of a non-URL value the reference has either to be a valid package name or a file path * that leads to either a package or valid JS module. Either way, it needs to exist. If the path * is invalid an error will be emitted. * * @see * - [npm Install](https://docs.npmjs.com/cli/install) * * @example * Check the contents of the available package.json: * * ```sh * cat package.json * ``` * * The displayed content should look similar to (i.e., contain an importmap such as): * * ```json * { * "importmap": { * "imports": { * "foo@bar": "./node_modules/prect" * } * } * } * ``` * * Note the potential misspelling. It maybe should have been "./node_modules/preact". In such * cases the reference may not be resolved locally. If everything was written correctly the * node modules are most likely not installed (correctly). */ function importMapReferenceNotFound_0027(dir, reference) { return [ types_1.LogLevels.error, '0027', `The reference to "${reference}" could not be resolved from "${dir}". Are you sure the file or package exists?`, ]; } /** * @kind Error * * @summary * The provided importmap file could not be found. * * @abstract * The importmap can be referenced in a file from the package.json. If the named * file cannot be found the build process has to be stopped. Make sure that the * file has been specified relative to the package.json where it was referenced * from. * * @see * - [import-maps specification](https://github.com/WICG/import-maps) * * @example * Check the contents of the available package.json: * * ```sh * cat package.json * ``` * * The displayed content should look similar to (i.e., contain an importmap such as): * * ```json * { * "importmap": "./import-map.json" * } * ``` * * If the importmap has instead been (re)named "importmap.json" then this will not work. * Likewise, with the reference above the file is expected to be in the same directory * as the package.json. If it is, e.g., in the "src" subfolder you'd should reference it * as "./src/import-map.json" instead. */ function importMapFileNotFound_0028(dir, file) { return [types_1.LogLevels.error, '0028', `The importmap "${file}" could not be found at "${dir}".`]; } /** * @kind Warning * * @summary * The given dependency seems to be a Piral plugin and should not be exposed * as a shared dependency. * * @abstract * While you should be quite restrictive in general regarding sharing dependencies, * there are some dependencies that should never be shared. One area are dependencies * that are only meant for the app shell and don't make sense somewhere else. * * Even though many dependencies might exist that fall into that area the only ones * we know for sure are the so-called Piral plugins. These are dependencies that only * make sense to be used within an app shell, i.e., a Piral instance (or host application). * * When the Piral CLI detects that you want to share such a dependency from an app shell, * or alternatively within a pilet directly, it will print a warning. There might be false * positives here, so having an error here might be a bit too much. Nevertheless, depending * on your scenario you might want to treat these warnings as errors. * * @see * - [Sharing dependencies](https://docs.piral.io/concepts/I08-importmap) * * @example * Check the contents of the available package.json: * * ```sh * cat package.json * ``` * * The displayed content should look similar to (i.e., contain an importmap such as): * * ```json * { * "importmap": { * "imports": { * "piral-ng": "" * } * } * } * ``` * * This would share the whole Piral plugin, which does not make much sense. First of all, * the plugin is presumably already installed - it even could only be installed in a * Piral instance. Second, there is no use of the exported function somewhere else. * * Instead, you potentially might want to share a submodule. For instance, in the example * above the "piral-ng/common" submodule should be shared. * * ```json * { * "importmap": { * "imports": { * "piral-ng/common": "" * } * } * } * ``` */ function invalidSharedDependency_0029(name) { return [types_1.LogLevels.warning, '0029', `The dependency "${name}" should not be shared.`]; } /** * @kind Error * * @summary * Cannot not find the given full path to successfully scaffold the pilet. * * @abstract * The provided Piral instance resolves to a local file, however, this file cannot be found from the * current directory. Either specify an absolute path or make sure that the relative path works for * the current working directory. * * Since no Piral instance can be resolved the scaffolding process needs to be stopped. * * @see * - [Current Working Directory](https://en.wikipedia.org/wiki/Working_directory) * * @example * ... */ function scaffoldPathDoesNotExist_0030(fullPath) { return [types_1.LogLevels.error, '0030', `Could not find "${fullPath}" for scaffolding.`]; } /** * @kind Error * * @summary * Cannot not find the given full path to successfully upgrade the pilet. * * @abstract * The provided Piral instance resolves to a local file, however, this file cannot be found from the * current directory. Either specify an absolute path or make sure that the relative path works for * the current working directory. * * Since no Piral instance can be resolved the upgrade process needs to be stopped. * * @see * - [Current Working Directory](https://en.wikipedia.org/wiki/Working_directory) * * @example * ... */ function upgradePathDoesNotExist_0031(fullPath) { return [types_1.LogLevels.error, '0031', `Could not find "${fullPath}" for upgrading.`]; } /** * @kind Error * * @summary * Right now project references are not supported. Please specify a tarball. * * @abstract * The provided Piral instance resolves to a local project directory. Instead, * an already prepared tarball (using "piral build") has been expected. * * In the future we may change this and support direct project references, too, * however, right now you'll need to first prepare your Piral instance by * running `piral build`. Obviously, we could run that for you, too, but we would * not know what options you may want to use. * * Since no Piral instance can be resolved the command needs to be aborted. * * @see * - [Current Working Directory](https://en.wikipedia.org/wiki/Working_directory) * * @example * ... */ function projectReferenceNotSupported_0032(fullPath) { return [types_1.LogLevels.error, '0032', `Expected a tarball, but found a project at "${fullPath}".`]; } /** * @kind Error * * @summary * The provided target must be an existing directory containing a package.json. * * @abstract * The Piral CLI has to get some meta information for a pilet from its package.json. * The meta information include its name, version, which Piral instance to use, as well * as other relevant infos. * * Make sure to start the Piral CLI in the right folder containing a package.json or a * subdirectory. Alternatively, make sure to provide an additional path to the Piral * CLI via command line parameters. * * @see * - [npm Package Specification](https://docs.npmjs.com/files/package.json) * * @example * Make sure you are in the right directory by calling commands such as * * ```sh * pwd # gets the current directory * ``` * * or * * ```sh * ls -la # gets the files of the current directory * ``` * * Navigate to the right directory via the `cd` command. */ function invalidPiletTarget_0040() { return [types_1.LogLevels.error, '0040', `The provided target directory is not a valid.`]; } /** * @kind Error * * @summary * The section "piral" in the "package.json" file is missing. * * @abstract * The Piral CLI has to get some meta information for a pilet from its package.json. * The meta information include its name, version, which Piral instance to use, as well * as other relevant infos. * * Make sure that you modified the package.json correctly using the specification for * pilets or that the pilet was initially created / scaffolded by the Piral CLI using * the * * ```sh * pilet new * ``` * * command. * * Specifically, the package.json needs to contain a special key called `piral`, which * contains an object with additional fields. * * @see * - [Pilet Package Definition](https://docs.piral.io/reference/documentation/C31-pilet-metadata) * * @example * Your pilet's package.json may look similar to the following snippet: * * ```json * { * "name": "my-pilet", * "version": "1.0.0", * "devDependencies": { * "my-piral": "1.0.0", * "piral-cli": "0.11.0" * }, * "piral": { * "name": "my-piral", * "tooling": "0.11.0" * } * } * ``` */ function invalidPiletPackage_0041() { return [types_1.LogLevels.error, '0041', `Could not find a Piral instance reference.`]; } /** * @kind Error * * @summary * The field "name" in the "piral" section of the "package.json" file is missing. * * @abstract * The Piral CLI has to get some meta information for a pilet from its package.json. * The meta information include its name, version, which Piral instance to use, as well * as other relevant infos. * * Make sure that you modified the package.json correctly using the specification for * pilets or that the pilet was initially created / scaffolded by the Piral CLI using * the * * ```sh * pilet new * ``` * * command. * * Specifically, the package.json needs to contain a special section called `piral`, which * should contain (among others) a field `name` pointing to the Piral instance to use. * * @see * - [Pilet Package Definition](https://docs.piral.io/reference/documentation/C31-pilet-metadata) * * @example * If your Piral instance is called `my-piral` then the package.json may look similar to * the following snippet: * * ```json * { * "name": "my-pilet", * "version": "1.0.0", * "devDependencies": { * "my-piral": "1.0.0", * "piral-cli": "0.11.0" * }, * "piral": { * "name": "my-piral", * "tooling": "0.11.0" * } * } * ``` */ function invalidPiletPackage_0042() { return [types_1.LogLevels.error, '0042', `Could not find a Piral instance reference.`]; } /** * @kind Error * * @summary * The reference to the Piral instance in the "package.json" file is invalid. * * @abstract * Even though everything seems to be correct on the first glance it may be that the * actual reference is broken. This could be due to various reasons. * * - npm linking is broken * - The dependencies have not been installed yet (run `npm i`) * - The Piral instance's name is invalid (e.g., due to a typo) * * @see * - [Pilet Package Definition](https://docs.piral.io/reference/documentation/C31-pilet-metadata) * - [Node Modules Loading](https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders) * * @example * Let's say you just cloned the pilet via * * ```sh * git clone https://myhub.com/mypilet * ``` * * Right now the dependencies should still be missing as dependencies are usually not * checked in. Under these circumstances the Piral instance reference is invalid. * * Make sure to resolve the dependencies correctly by running * * ```sh * npm i * ``` */ function invalidPiralReference_0043() { return [types_1.LogLevels.error, '0043', `Invalid Piral instance reference.`]; } /** * @kind Error * * @summary * The desired target directory could not be created. * * @abstract * When a non-existing target directory is specified the Piral CLI needs to create it first. This, * however, can lead to problems if * * - the file system is corrupted * - necessary privileges are missing * - the given path is invalid * * If one of these cases is hit the Piral CLI needs to stop the action. * * @see * - [File System Permissions](https://en.wikipedia.org/wiki/File_system_permissions) * * @example * On nix systems the easiest way to ensure ownership of a folder is using the `chmod` command. * Make sure, however, to only expand permissions when overall security is still ensured. * * Ideally, you'd select a folder that is below your home directory. That way the necessary * permissions are there by definition. * * On nix systems you can change to your home directory via: * * ```sh * cd ~ * ``` * * On Windows you can use: * * ```sh * cd %HOMEPATH% * ``` */ function cannotCreateDirectory_0044() { return [types_1.LogLevels.error, '0044', 'Could not create the target directory.']; } /** * @kind Warning * * @summary * Reported when a file could not be overwritten. * * @abstract * Usually, this only indicates that a file already existed and was not overwritten. * There are three modes concerning the overwrite policy: * * - Do not overwrite (usually the default) * - Ask before overwriting * - Always overwrite * * In the first mode the warning is produced to indicate an operation was not * performed due to the integrated overwrite protection. * * @see * - [File System Permissions](https://en.wikipedia.org/wiki/File_system_permissions) * * @example * Many commands allow setting the overwrite mode. For instance, when performing an * upgrade of a pilet we can set it. * * To ask before overwriting the following command works: * * ```sh * pilet upgrade --force-overwrite prompt * ``` * * If you want to always overwrite use: * * ```sh * pilet upgrade --force-overwrite yes * ``` */ function didNotOverWriteFile_0045(file) { return [types_1.LogLevels.warning, '0045', `Did not overwrite: File ${file} already exists.`]; } /** * @kind Error * * @summary * Reported when a file could not be found. * * @abstract * Usually, this only indicates that a file already existed and was deleted or * that the configuration is corrupt. * * Make sure to have a valid Piral instance and the latest version of the Piral * CLI installed. Verify that the node_modules have not been corrupted. * * To avoid any issues try to upgrade the Piral CLI and reinstall the project * dependencies. * * @see * - [File System Permissions](https://en.wikipedia.org/wiki/File_system_permissions) * * @example * On some systems the node_modules folder may become instable or get corrupted * with multiple dependency installations and modifications. After a time a * complete swipe may be the best solution to ensure a stable project * configuration. */ function cannotFindFile_0046(file) { return [types_1.LogLevels.error, '0046', `The file "${file}" does not exist!`]; } /** * @kind Warning * * @summary * Reported when the provided / default port was not available. * * @abstract * By default, the debug commands spawn at the port 1234. However, under certain * circumstances (e.g., another debug command running somewhere) this port may not * be free. * * The piral-cli can select a new port, which is free, however, it will still report * a warning message in such cases. You can then always abort the current debug * process and start a new one - either closing the other run blocking the port or * explicitly selecting a new one using the `--port` flag. * * @see * - [Port (computer networking)](https://en.wikipedia.org/wiki/Port_(computer_networking)) * * @example * If you start one process to debug an app shell using `piral debug` and another process * to debug some pilet using `pilet debug` both processes would want to run on the default * port 1234. * * As a mitigation you can now either be very explicit, e.g., `piral debug --port 1010` and * `pilet debug --port 1020` or you can just drop one of the two and always only run a single * debug process. * * In any case, running both without any options also works, but then a new port will be chosen. * The output of the Piral CLI will always show you what port is currently used. */ function portChanged_0047(newPort, oldPort) { return [types_1.LogLevels.warning, '0047', `The selected port "${oldPort}" is already used. Changed port to "${newPort}".`]; } /** * @kind Error * * @summary * Reported when the provided / default port was not available. * * @abstract * By default, the debug commands spawn at the port 1234. However, under certain * circumstances (e.g., another debug command running somewhere) this port may not * be free. * * The piral-cli can select a new port, which is free, however, it will still report * a warning message in such cases. You can then always abort the current debug * process and start a new one - either closing the other run blocking the port or * explicitly selecting a new one using the `--port` flag. * * @see * - [Port (computer networking)](https://en.wikipedia.org/wiki/Port_(computer_networking)) * * @example * If you start one process to debug an app shell using `piral debug` and another process * to debug some pilet using `pilet debug` both processes would want to run on the default * port 1234. * * As a mitigation you can now either be very explicit, e.g., `piral debug --port 1010` and * `pilet debug --port 1020` or you can just drop one of the two and always only run a single * debug process. * * In any case, running both without any options also works, but then a new port will be chosen. * The output of the Piral CLI will always show you what port is currently used. */ function portNotFree_0048(port) { return [types_1.LogLevels.error, '0048', `The selected port "${port}" is already used.`]; } /** * @kind Warning * * @summary * Reported when the Piral instance is locally resolved, but no location for the upgrade is known. * * @abstract * The Piral instance is currently resolved locally, but no local file for the upgrade has been specified. * * Since the local resolution only works against a filename the update process has also to be triggered with * a file location. Otherwise, there is no chance to know a different file location. * * Potentially, you wanted to switch / resolve the module from npm instead. Therefore, we are then trying to * obtain the Piral instance from npm instead using the known name. * * @see * - [Local File Dependencies](https://stackoverflow.com/questions/14381898/local-dependency-in-package-json) * * @example * You may have set up the pilet using a locally available tgz file. In this case your original command may * have looked similar to: * * ```json * pilet new ../../my-app-shell/dist/emulator/my-app-shell-1.0.0.tgz * ``` * * To run an upgrade in such a scenario a command such as * * ```sh * pilet upgrade ../../my-app-shell/dist/emulator/my-app-shell-1.1.0.tgz * ``` * * needs to be used. */ function localeFileForUpgradeMissing_0050() { return [types_1.LogLevels.warning, '0050', `No local file for the upgrade has been specified.`]; } /** * @kind Warning * * @summary * Reported when the Piral instance is resolved via git, but an invalid version was specified. * * @abstract * The Piral instance is currently resolved via Git, but latest was not used to try a direct update. * * Right now we only support "latest" for Git resolved Piral instances. In this scenario we obtain the * current head from the repository's default branch and update accordingly. * * Potentially, you wanted to switch / resolve the module from npm instead. Therefore, we are then trying to * obtain the Piral instance from npm instead using the known name. * * @see * - [Git Dependencies in npm](https://medium.com/@jonchurch/use-github-branch-as-dependency-in-package-json-5eb609c81f1a) * * @example * You may have set up the pilet using a locally available tgz file. In this case your original command may * have looked similar to: * * ```json * pilet new https://github.com/foo/my-app-shell.git * ``` * * To run an upgrade in such a scenario a command such as * * ```sh * pilet upgrade latest * ``` * * needs to be used. * * Since "latest" is the default version the specifier can actually be omitted, too. */ function gitLatestForUpgradeMissing_0051() { return [types_1.LogLevels.warning, '0051', `No valid version has been not used.`]; } /** * @kind Warning * * @summary * Reported when the version of a dependency cannot be resolved. * * @abstract * When a pilet is scaffolded from a Piral instance special dev tools may be installed * as specified from the "devDependencies" section in the "pilets" section. * * The default version resolution falls back to the version specified already in the * standard "devDependencies" of the Piral instance's package.json. * * Under some conditions no version of the specified dependency can be determined. * * The conditions may be: * * - Missing dev dependencies * - Invalid dev dependencies * - Disk failures * * @see * - [Piral Instance Package Definition](https://docs.piral.io/reference/documentation/C21-piral-metadata) * * @example * The primary example hits when a dev dependency was specified that is otherwise not given. * * Consider the following package.json: * * ```json * { * "name": "my-piral", * "devDependencies": {}, * "pilets": { * "devDependencies": { * "prettier": true * } * } * } * ``` * * Just make sure that `prettier` is already available on the standard `devDependencies`. * * ```json * { * "name": "my-piral", * "devDependencies": { * "prettier": "^1.0.0" * }, * "pilets": { * "devDependencies": { * "prettier": true * } * } * } * ``` */ function cannotResolveVersion_0052(name) { return [types_1.LogLevels.warning, '0052', `The version for "${name}" could not be resolved. Using "latest".`]; } /** * @kind Warning * * @summary * Reported when a dependency cannot be resolved. * * @abstract * When a pilet is scaffolded from a Piral instance special dev tools may be installed * as specified from the "devDependencies" section in the "pilets" section. * * The default version resolution falls back to the version specified already in the * standard "devDependencies" of the Piral instance's package.json. * * Under some conditions no version of the specified dependency can be determined. * * The conditions may be: * * - Missing dev dependencies * - Invalid dev dependencies * - Disk failures * * @see * - [Piral Instance Package Definition](https://docs.piral.io/reference/documentation/C21-piral-metadata) * * @example * The primary example hits when a dev dependency was specified that is otherwise not given. * * Consider the following package.json: * * ```json * { * "name": "my-piral", * "devDependencies": {}, * "pilets": { * "devDependencies": { * "prettier": true * } * } * } * ``` * * Just make sure that `prettier` is already available on the standard `devDependencies`. * * ```json * { * "name": "my-piral", * "devDependencies": { * "prettier": "^1.0.0" * }, * "pilets": { * "devDependencies": { * "prettier": true * } * } * } * ``` */ function cannotResolveDependency_0053(names, rootDir) { return [ types_1.LogLevels.warning, '0053', `Could not resolve any package (tried "${names.join('", "')}") from "${rootDir}". Taking "latest" version.`, ]; } /** * @kind Info * * @summary * Reported when an inherited dependency cannot be resolved. * * @abstract * When a pilet is built all the inherited (i.e., centrally shared) dependencies will be resolved. In case * you did not install one of these dependencies a short info will be shown. This acts as a reminder that * you could install more dependencies - without any runtime cost. * * Note that even though shared dependencies are available at runtime in any case they will might be * for building your pilet. Therefore, if you plan to use shared dependencies please install them in your * pilet's repository. * * @see * - [Piral Instance Package Definition](https://docs.piral.io/reference/documentation/C21-piral-metadata) */ function skipUnresolvedDependency_0054(name) { return [types_1.LogLevels.info, '0054', `The inherited dependency "${name}" is not installed and will be skipped.`]; } /** * @kind Error * * @summary * Incomplete configuration. Missing URL of the pilet feed. * * @abstract * The publish command works either against the official public feed using a feed name * (e.g., `sample`) or a fully qualified URL working against *any* feed service. * * Make sure that the provided publish endpoint URL follows the Feed Service API specification. * * If the URL is missing (i.e., not provided) then the Piral CLI does not know to which feed * service to publish. * * @see * - [Feed API Specification](https://docs.piral.io/reference/specifications/feed-api-specification) * * @example * Always specify the URL via the `--url` provider. * * ```sh * pilet publish --url https://feed.piral.cloud/api/v1/pilet/sample * ``` */ function missingPiletFeedUrl_0060() { return [types_1.LogLevels.error, '0060', `Missing pilet feed service URL.`]; } /** * @kind Error * * @summary * Could not find a valid pilet to upload to the pilet feed. * * @abstract * The `pilet publish` commands works against an already created pilet package. * If no pilet package is yet available the command will ultimately fail. * * There are a couple of options. For instance, using the `--fresh` flag it is * possible to trigger a `pilet build` and `pilet pack` process implicitly. * * Otherwise, make sure to have a `.tgz` file in the directory or specify it * directly. * * @see * - [npm Pack](https://docs.npmjs.com/cli-commands/pack.html) * * @example * Make sure to have build a pilet beforehand: * * ```sh * pilet build * ``` * * Then you should pack the current contents: * * ```sh * pilet pack * ``` * * Finally, you can publish it: * * ```sh * pilet publish --url sample * ``` * * To do these three commands in one sweep just use `--fresh`: * * ```sh * pilet publish --fresh --url sample * ``` * * Using multiple commands is preferred if you use custom options, otherwise * just go for the single command. */ function missingPiletTarball_0061(sources) { return [types_1.LogLevels.error, '0061', `No files found using pattern "${sources.join('", "')}".`]; } /** * @kind Warning * * @summary * Could not upload the pilet to the pilet feed. * * @abstract * Uploading to the pilet feed service API failed. This could have various reasons: * * - Loss of connectivity * - The provided authentication was invalid or missing * - The URL was invalid * - The feed service does not follow the specification * - A custom condition from the feed service was rejected * - The given pilet was already available at the feed service * * The Piral CLI will print the error response from the feed service. Please contact * your feed service admin if nothing was printed. * * @see * - [Feed API Specification](https://docs.piral.io/reference/specifications/feed-api-specification) * * @example * Make sure that you are connected to the internet and that the desired feed service URL * can be reached from your computer. * * Run * * ```sh * pilet publish --fresh --url https://myfeedservice.com/api/pilet * ``` * * Look at the error response. Make sure that your version is not yet published. If other * conditions (e.g., a certain naming convention for your pilet) need to be followed adjust * the package.json accordingly. */ function failedToUpload_0062(fileName) { return [types_1.LogLevels.warning, '0062', `Could not upload "${fileName}" to feed service.`]; } /** * @kind Warning * * @summary * Could not read the contents from the pilet. * * @abstract * Publishing pilet requires a valid tgz file that can be read and transmitted. * If such a file can be found, however, cannot be opened then we have no chance * of publishing the pilet. * * This warning is thus emitted in case of: * * - an empty tgz file * - an inaccessible tgz file * * Make sure that the disk is properly functioning and that necessary permissions * are set to allow accessing the file. * * @see * - [File System Permissions](https://en.wikipedia.org/wiki/File_system_permissions) * * @example * Find the available tgz files: * * ```sh * ls -la *.tgz * ``` * * Make sure that at least one tgz file is available. Check the displayed permissions * and use `chmod` to set the right permissions. * * Usually, changing permissions should not be required at all. Make sure you operate * from the same user account as when the tgz file was created. */ function failedToRead_0063(fileName) { return [types_1.LogLevels.warning, '0063', `Could not read the file "${fileName}".`]; } /** * @kind Error * * @summary * Did finish uploading the pilet(s) with errors. * * @abstract * The Piral CLI tries to upload all matched .tgz files. In case of * multiple hits all files are published. This may not be the behavior you * look for as it will lead to errors in case of already published pilets. * * To avoid uploading already published pilets either perform a fresh * build omitting any tgz inputs at all or specify the tgz file directly. * * @see * - [Semantic Versioning](https://semver.org) * * @example * To perform a fresh build use the following command: * * ```sh * pilet publish --fresh --url sample * ``` * * In order to specify the file explicitly just use a positional argument. * * ```sh * pilet publish my-pilet-1.0.0.tgz --url sample * ``` * * Make sure that the specified file exists. * * Additionally, you can use globs to match multiple files. */ function failedUploading