create-near-app 7.0.2-beta.0 → 7.0.2
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/dist/app.js +10 -0
- package/dist/messages.js +3 -3
- package/dist/user-input.js +3 -10
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -27,10 +27,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const path_1 = __importDefault(require("path"));
|
|
30
|
+
const semver_1 = __importDefault(require("semver"));
|
|
30
31
|
const make_1 = require("./make");
|
|
31
32
|
const user_input_1 = require("./user-input");
|
|
32
33
|
const show = __importStar(require("./messages"));
|
|
34
|
+
const tracking_1 = require("./tracking");
|
|
33
35
|
(async function () {
|
|
36
|
+
const supportedNodeVersion = require('../package.json').engines.node;
|
|
37
|
+
if (!semver_1.default.satisfies(process.version, supportedNodeVersion)) {
|
|
38
|
+
return show.unsupportedNodeVersion(supportedNodeVersion);
|
|
39
|
+
}
|
|
40
|
+
if (process.platform === 'win32') {
|
|
41
|
+
(0, tracking_1.trackUsage)('none', false, 'none');
|
|
42
|
+
return show.windowsWarning();
|
|
43
|
+
}
|
|
34
44
|
const prompt = await (0, user_input_1.promptAndGetConfig)();
|
|
35
45
|
if (prompt === undefined)
|
|
36
46
|
return;
|
package/dist/messages.js
CHANGED
|
@@ -84,9 +84,9 @@ npx create-near-app <projectName> [--frontend next-app|next-page] [--contract rs
|
|
|
84
84
|
exports.argsError = argsError;
|
|
85
85
|
const unsupportedNodeVersion = (supported) => (0, exports.show)((0, chalk_1.default) `{red We support node.js version ${supported} or later}`);
|
|
86
86
|
exports.unsupportedNodeVersion = unsupportedNodeVersion;
|
|
87
|
-
const windowsWarning = () => (0, exports.show)((0, chalk_1.default) `{
|
|
88
|
-
https://docs.
|
|
89
|
-
|
|
87
|
+
const windowsWarning = () => (0, exports.show)((0, chalk_1.default) `{red Please use Windows Subsystem for Linux (WSL)}
|
|
88
|
+
{yellow Learn more here: https://docs.near.org/blog/getting-started-on-windows}
|
|
89
|
+
`);
|
|
90
90
|
exports.windowsWarning = windowsWarning;
|
|
91
91
|
const directoryExists = (dirName) => (0, exports.show)((0, chalk_1.default) `{red This directory already exists! ${dirName}}`);
|
|
92
92
|
exports.directoryExists = directoryExists;
|
package/dist/user-input.js
CHANGED
|
@@ -32,7 +32,6 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
32
32
|
const prompts_1 = __importDefault(require("prompts"));
|
|
33
33
|
const commander_1 = require("commander");
|
|
34
34
|
const show = __importStar(require("./messages"));
|
|
35
|
-
const semver_1 = __importDefault(require("semver"));
|
|
36
35
|
const tracking_1 = require("./tracking");
|
|
37
36
|
const fs_1 = __importDefault(require("fs"));
|
|
38
37
|
async function getUserArgs() {
|
|
@@ -40,13 +39,14 @@ async function getUserArgs() {
|
|
|
40
39
|
.argument('[projectName]')
|
|
41
40
|
.option('--frontend [next-page|next-app|none]')
|
|
42
41
|
.option('--contract [ts|rs|none]')
|
|
42
|
+
.option('--components')
|
|
43
43
|
.option('--install')
|
|
44
44
|
.addHelpText('after', 'You can create a frontend or a contract with tests');
|
|
45
45
|
commander_1.program.parse();
|
|
46
46
|
const options = commander_1.program.opts();
|
|
47
47
|
const [projectName] = commander_1.program.args;
|
|
48
|
-
const { contract, frontend, install } = options;
|
|
49
|
-
return { contract, frontend, components
|
|
48
|
+
const { contract, frontend, install, components } = options;
|
|
49
|
+
return { contract, frontend, components, projectName, install };
|
|
50
50
|
}
|
|
51
51
|
exports.getUserArgs = getUserArgs;
|
|
52
52
|
const appChoices = [
|
|
@@ -125,13 +125,6 @@ async function getUserAnswers() {
|
|
|
125
125
|
}
|
|
126
126
|
exports.getUserAnswers = getUserAnswers;
|
|
127
127
|
async function promptAndGetConfig() {
|
|
128
|
-
const supportedNodeVersion = require('../package.json').engines.node;
|
|
129
|
-
if (!semver_1.default.satisfies(process.version, supportedNodeVersion)) {
|
|
130
|
-
return show.unsupportedNodeVersion(supportedNodeVersion);
|
|
131
|
-
}
|
|
132
|
-
// if (process.platform === 'win32') {
|
|
133
|
-
// return show.windowsWarning();
|
|
134
|
-
// }
|
|
135
128
|
// process cli args
|
|
136
129
|
let args = await getUserArgs();
|
|
137
130
|
// If no args, prompt user
|