create-awesome-node-app 0.1.0 → 0.2.0

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/index.cjs CHANGED
@@ -3423,7 +3423,9 @@ var require_chalk = __commonJS({
3423
3423
  // src/index.ts
3424
3424
  var import_commander = __toESM(require_commander(), 1);
3425
3425
  var import_chalk = __toESM(require_chalk(), 1);
3426
+ var import_semver = __toESM(require("semver"), 1);
3426
3427
  var import_core = require("@create-node-app/core");
3428
+ var import_helpers = require("@create-node-app/core/helpers");
3427
3429
 
3428
3430
  // src/options.ts
3429
3431
  var import_prompts = __toESM(require("prompts"), 1);
@@ -3638,7 +3640,7 @@ var getCnaOptions = async (options) => {
3638
3640
  // package.json
3639
3641
  var package_default = {
3640
3642
  name: "create-awesome-node-app",
3641
- version: "0.0.0",
3643
+ version: "0.1.0",
3642
3644
  type: "module",
3643
3645
  description: "Command line tool to create Node apps with a lot of different addons.",
3644
3646
  license: "MIT",
@@ -3685,6 +3687,7 @@ var package_default = {
3685
3687
  dependencies: {
3686
3688
  "@create-node-app/core": "*",
3687
3689
  prompts: "^2.4.1",
3690
+ semver: "^7.3.8",
3688
3691
  yargs: "^17.0.1"
3689
3692
  },
3690
3693
  devDependencies: {
@@ -3715,18 +3718,24 @@ var main = async () => {
3715
3718
  ).option(
3716
3719
  "--nodeps",
3717
3720
  "generate package.json file without installing dependencies"
3718
- ).option("--inplace", "apply setup to an existing project");
3719
- import_commander.default.allowUnknownOption().on("--help", () => {
3721
+ ).option("--inplace", "apply setup to an existing project").parse(process.argv);
3722
+ const latest = await (0, import_helpers.checkForLatestVersion)("create-awesome-node-app");
3723
+ if (latest && import_semver.default.lt(package_default.version, latest)) {
3720
3724
  console.log();
3721
- console.log(
3722
- ` Only ${import_chalk.default.green("[project-directory]")} is required.`
3725
+ console.error(
3726
+ import_chalk.default.yellow(
3727
+ `You are running \`create-react-app\` ${package_default.version}, which is behind the latest release (${latest}).
3728
+
3729
+ We recommend always using the latest version of create-react-app if possible.`
3730
+ )
3723
3731
  );
3724
3732
  console.log();
3725
3733
  console.log(
3726
- ` If you have any problems, do not hesitate to file an issue:`
3734
+ "The latest instructions for creating a new app can be found here:\nhttps://create-react-app.dev/docs/getting-started/"
3727
3735
  );
3728
- console.log(` ${import_chalk.default.cyan(`${package_default.bugs.url}/new`)}`);
3729
- }).parse(process.argv);
3736
+ console.log();
3737
+ return;
3738
+ }
3730
3739
  return (0, import_core.createNodeApp)(
3731
3740
  projectName,
3732
3741
  { ...import_commander.default.opts(), projectName },
package/dist/index.js CHANGED
@@ -3429,7 +3429,9 @@ var require_chalk = __commonJS({
3429
3429
  // src/index.ts
3430
3430
  var import_commander = __toESM(require_commander(), 1);
3431
3431
  var import_chalk = __toESM(require_chalk(), 1);
3432
+ import semver from "semver";
3432
3433
  import { createNodeApp } from "@create-node-app/core";
3434
+ import { checkForLatestVersion } from "@create-node-app/core/helpers";
3433
3435
 
3434
3436
  // src/options.ts
3435
3437
  import prompts from "prompts";
@@ -3644,7 +3646,7 @@ var getCnaOptions = async (options) => {
3644
3646
  // package.json
3645
3647
  var package_default = {
3646
3648
  name: "create-awesome-node-app",
3647
- version: "0.0.0",
3649
+ version: "0.1.0",
3648
3650
  type: "module",
3649
3651
  description: "Command line tool to create Node apps with a lot of different addons.",
3650
3652
  license: "MIT",
@@ -3691,6 +3693,7 @@ var package_default = {
3691
3693
  dependencies: {
3692
3694
  "@create-node-app/core": "*",
3693
3695
  prompts: "^2.4.1",
3696
+ semver: "^7.3.8",
3694
3697
  yargs: "^17.0.1"
3695
3698
  },
3696
3699
  devDependencies: {
@@ -3721,18 +3724,24 @@ var main = async () => {
3721
3724
  ).option(
3722
3725
  "--nodeps",
3723
3726
  "generate package.json file without installing dependencies"
3724
- ).option("--inplace", "apply setup to an existing project");
3725
- import_commander.default.allowUnknownOption().on("--help", () => {
3727
+ ).option("--inplace", "apply setup to an existing project").parse(process.argv);
3728
+ const latest = await checkForLatestVersion("create-awesome-node-app");
3729
+ if (latest && semver.lt(package_default.version, latest)) {
3726
3730
  console.log();
3727
- console.log(
3728
- ` Only ${import_chalk.default.green("[project-directory]")} is required.`
3731
+ console.error(
3732
+ import_chalk.default.yellow(
3733
+ `You are running \`create-react-app\` ${package_default.version}, which is behind the latest release (${latest}).
3734
+
3735
+ We recommend always using the latest version of create-react-app if possible.`
3736
+ )
3729
3737
  );
3730
3738
  console.log();
3731
3739
  console.log(
3732
- ` If you have any problems, do not hesitate to file an issue:`
3740
+ "The latest instructions for creating a new app can be found here:\nhttps://create-react-app.dev/docs/getting-started/"
3733
3741
  );
3734
- console.log(` ${import_chalk.default.cyan(`${package_default.bugs.url}/new`)}`);
3735
- }).parse(process.argv);
3742
+ console.log();
3743
+ return;
3744
+ }
3736
3745
  return createNodeApp(
3737
3746
  projectName,
3738
3747
  { ...import_commander.default.opts(), projectName },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-awesome-node-app",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "Command line tool to create Node apps with a lot of different addons.",
6
6
  "license": "MIT",
@@ -47,6 +47,7 @@
47
47
  "dependencies": {
48
48
  "@create-node-app/core": "*",
49
49
  "prompts": "^2.4.1",
50
+ "semver": "^7.3.8",
50
51
  "yargs": "^17.0.1"
51
52
  },
52
53
  "devDependencies": {