Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade node version to 18 #172

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: 'node:14'
- image: 'node:18.10.0'
delagroove marked this conversation as resolved.
Show resolved Hide resolved
dependencies:
pre:
- 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
Expand All @@ -15,7 +15,7 @@ jobs:
key: 'v1-dependencies-{{ checksum "package.json" }}'
deploy:
docker:
- image: 'node:14'
- image: 'node:18.10.0'
steps:
- checkout
- restore_cache:
Expand All @@ -25,7 +25,7 @@ jobs:
- run: npx semantic-release
lint:
docker:
- image: 'node:14'
- image: 'node:18.10.0'
steps:
- checkout
- restore_cache:
Expand All @@ -35,7 +35,7 @@ jobs:
- run: npm run lint
test:
docker:
- image: 'node:14'
- image: 'node:18.10.0'
steps:
- checkout
- restore_cache:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.18.1
18.10.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The CLI is the quickest and easiest way to develop on Open Commerce. It allows y
---
Before you can use the Open Commerce CLI, ensure you have all the base requirements for your operating system:
- We recommend installing [nvm](https://github.com/nvm-sh/nvm)
- [14.18.1 ≤ Node version < 16](https://nodejs.org/ja/blog/release/v14.18.1/)
- [16 ≤ Node version < 18.10.0](https://nodejs.org/ja/blog/release/v18.10.0/)
- [Yarn](https://yarnpkg.com/cli/install)
- [Git](https://git-scm.com/)
- [Docker](https://www.docker.com/get-started/)
Expand Down
2 changes: 1 addition & 1 deletion commands/develop-storefront.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import checkBeforeDevelop from "../utils/checkBeforeDevelop.js";
export default async function developStorefront(options) {
if (!await checkBeforeDevelop("storefront")) return;
Logger.info("Starting Open Commerce Admin Application Server in dev mode", { options });
const storefront = spawn("yarn", ["run", "start:dev"]);
const storefront = spawn("yarn", ["run", "start:dev:latest"]);
storefront.stdout.on("data", (data) => {
// eslint-disable-next-line no-console
console.log(data.toString().trim()); // Echo output of command to console
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"reaction": "index.js"
},
"engines": {
"node": ">=14.18.1"
"node": ">=18.10.0"
},
"type": "module",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"engines": {
"node": ">=14.18.1"
"node": ">=18.10.0"
},
"author": "",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion test_plan.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CLI manual test plan

## Using Node 14.18.1
## Using Node 18.10.0

1. Clone this repo to your local machine
2. Install package as global (`npm install -g`)
Expand Down
6 changes: 3 additions & 3 deletions tests/create-api-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ beforeEach(async () => {
});

describe("the node used for tests", () => {
it("should be 14 or 16", async () => {
it("should be 16 to 18", async () => {
const response = await execute("--version", []);
// eslint-disable-next-line jest/valid-expect
expect(response.trim().split(".")[0]).to.oneOf(["v15", "v14"]);
expect(response.trim().split(".")[0]).to.oneOf(["v16", "v17", "v18"]);
});
});

Expand All @@ -27,7 +27,7 @@ describe("The create-project-api command", () => {
const responseLines = response.trim().split(EOL);
// eslint-disable-next-line jest/valid-expect
expect(responseLines[1]).to.equal("reaction-cli: Project creation complete. Change to your directory and run `npm install`");
}).timeout(15000);
}).timeout(25000);
});

afterEach(async () => {
Expand Down
6 changes: 3 additions & 3 deletions utils/checkDependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { spawn } from "child_process";
import { sync as cmdExists } from "command-exists";
import Logger from "./logger.js";

const supportedNodeVersions = ["v14", "v15"];
const supportedNodeVersions = ["v16", "v17", "v18"];

/**
* @summary validate that we are using a supported version of node
Expand All @@ -18,8 +18,8 @@ async function checkNodeVersion() {
Logger.error(`Your node version must be one of: [ ${supportedNodeVersions.join(", ")} ]`);
resolve(nodeOk);
}
if (majorVersion === "v14" && minorVersion < "18") {
Logger.error("Your node version must be greater or equal to 14.18.1 and less than 16");
if (majorVersion === "v18" && minorVersion > "10") {
Logger.error("Your node version must be greater than 16 and lesser or equal to 18.10.0");
resolve(nodeOk);
}
nodeOk = true;
Expand Down