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 all 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
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"root": true,
"parser": "espree",
"parser": "@babel/eslint-parser",
"extends": [
"plugin:node/recommended",
"plugin:promise/recommended",
Expand All @@ -13,6 +13,10 @@
"jasmine": true
},
"parserOptions": {
"requireConfigFile": false,
"babelOptions": {
"plugins": ["@babel/plugin-syntax-import-assertions"]
},
"sourceType": "module",
"ecmaVersion": 12,
"ecmaFeatures": {
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
161 changes: 153 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 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 Expand Up @@ -53,6 +53,8 @@
"@commitlint/cli": "^16.0.2",
"@commitlint/config-conventional": "^16.0.0",
"babel-eslint": "^10.1.0",
"@babel/eslint-parser": "^7.18.9",
"@babel/plugin-syntax-import-assertions": "^7.20.0",
"eslint": "^8.7.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^27.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This plugin example is only to show you how plugins can be added. For a more complete plugin template
// use the `create-plugin` command
import Logger from "@reactioncommerce/logger";
import packageData from "./package.json";
import packageData from "./package.json" assert { type: "json" };

const { version } = packageData;

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 templates/api-project/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { importPluginsJSONFile, ReactionAPICore } from "@reactioncommerce/api-core";
import dotenv from "dotenv";
import Logger from "@reactioncommerce/logger";
import packageJson from "./package.json";
import packageJson from "./package.json" assert { type: "json" };

const api = new ReactionAPICore({
serveStaticPaths: ["public"],
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
Loading