Skip to content

Commit

Permalink
chore!: bump required node version to 16 (#4972)
Browse files Browse the repository at this point in the history

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
  • Loading branch information
jcesarmobile and liamdebeasi committed Mar 29, 2023
1 parent c055b0e commit d3c4c48
Show file tree
Hide file tree
Showing 29 changed files with 93 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ jobs:
strategy:
matrix:
node:
- 14.x
- 12.x
- 10.x
- 18.x
- 16.x
steps:
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Restore Dependency Cache
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
name: Build and Deploy Docker Container with latest CLI
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 14.x
- uses: actions/checkout@v2
node-version: 16.x
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: GitHub Container Registry Login
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/cli-framework-output/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"files": [
"dist/",
Expand All @@ -33,7 +33,7 @@
"@types/debug": "^4.1.1",
"@types/inquirer": "0.0.43",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
"lint-staged": "^10.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/cli-framework-prompts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"files": [
"dist/",
Expand All @@ -33,7 +33,7 @@
"@types/debug": "^4.1.1",
"@types/inquirer": "0.0.43",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
"lint-staged": "^10.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/cli-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "./index.js",
"types": "./index.d.ts",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"scripts": {
"clean": "rimraf index.* definitions.* errors.* guards.* lib utils",
Expand Down Expand Up @@ -40,7 +40,7 @@
"@types/jest": "^26.0.10",
"@types/lodash": "^4.14.104",
"@types/minimist": "^1.2.0",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"@types/write-file-atomic": "^3.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
Expand Down
12 changes: 7 additions & 5 deletions packages/@ionic/cli/bin/ionic
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ process.on('message', function(msg) {

var semver = require('semver');
var version = semver.parse(process.version);
var minversion = 'v10.3.0';
var minversion = 'v16.0.0';

if (semver.lt(version, minversion)) {
var details = version.major === 6
? ' Node.js 6 reached end-of-life on 2019-04-30 and is no longer supported.'
: version.major === 8
? ' Node.js 8 reached end-of-life on 2019-12-31 and is no longer supported.'
var details = version.major === 10
? ' Node.js 10 reached end-of-life on 2021-04-30 and is no longer supported.'
: version.major === 12
? ' Node.js 12 reached end-of-life on 2022-04-30 and is no longer supported.'
: version.major === 14
? ' Node.js 14 reached end-of-life on 2023-04-30 and is no longer supported.'
: '';

process.stderr.write('ERR: Your Node.js version is ' + version.raw + '.' + details + ' Please update to the latest Node LTS version.\n');
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ionic": "./bin/ionic"
},
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"main": "./index.js",
"types": "./index.d.ts",
Expand Down Expand Up @@ -73,7 +73,7 @@
"@types/elementtree": "^0.1.0",
"@types/jest": "^26.0.10",
"@types/lodash": "^4.14.104",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"@types/semver": "^7.1.0",
"@types/split2": "^2.1.6",
"@types/superagent": "4.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/@ionic/cli/src/lib/oauth/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export abstract class OAuth2Flow<T extends OpenIdToken> {
if (req.url) {
const params = qs.parse(req.url.substring(req.url.indexOf('?') + 1));

if (params.code) {
if (params.code && params.state) {
res.writeHead(200, { 'Content-Type': ContentType.HTML });
res.end(successHtml);
req.socket.destroy();
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/cli/src/lib/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ export abstract class ServeCLI<T extends ServeCLIOptions> extends EventEmitter {

const ws = this.createLoggerStream();

p.stdout.pipe(split2()).pipe(this.createStreamFilter(line => this.stdoutFilter(line))).pipe(ws);
p.stderr.pipe(split2()).pipe(this.createStreamFilter(line => this.stderrFilter(line))).pipe(ws);
p.stdout?.pipe(split2()).pipe(this.createStreamFilter(line => this.stdoutFilter(line))).pipe(ws);
p.stderr?.pipe(split2()).pipe(this.createStreamFilter(line => this.stderrFilter(line))).pipe(ws);

this.once('ready', () => {
resolve();
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/cli/src/lib/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Shell implements IShell {
debug('Error in subprocess stdout pipe: %o', err);
});

promise.p.stdout.pipe(s);
promise.p.stdout?.pipe(s);
}

if (promise.p.stderr) {
Expand All @@ -66,7 +66,7 @@ export class Shell implements IShell {
debug('Error in subprocess stderr pipe: %o', err);
});

promise.p.stderr.pipe(s);
promise.p.stderr?.pipe(s);
}

if (killOnExit) {
Expand Down
2 changes: 1 addition & 1 deletion packages/@ionic/discover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/netmask": "^1.0.30",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"@types/ws": "^7.2.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
Expand Down
19 changes: 10 additions & 9 deletions packages/@ionic/discover/src/publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class Publisher extends events.EventEmitter implements IPublisherEventEmi
};
}

protected getInterfaces(): Interface[] {
protected getInterfaces(): Interface[] | undefined {
return prepareInterfaces(os.networkInterfaces());
}

Expand Down Expand Up @@ -151,20 +151,20 @@ export class Publisher extends events.EventEmitter implements IPublisherEventEmi
}
}

export function prepareInterfaces(interfaces: { [index: string]: os.NetworkInterfaceInfo[] }): Interface[] {
export function prepareInterfaces(interfaces: NodeJS.Dict<os.NetworkInterfaceInfo[]>): Interface[] | undefined {
const set = new Set<string>();

return Object.keys(interfaces)
.map(key => interfaces[key])
.reduce((prev, current) => prev.concat(current))
.filter(iface => iface.family === 'IPv4')
.map(iface => {
const values = Object.values(interfaces);
const flatValues = values.reduce((prev, current) => prev?.concat(current ? current : []));
if (flatValues) {
return flatValues
.filter((iface: os.NetworkInterfaceInfo) => iface.family === 'IPv4')
.map((iface: os.NetworkInterfaceInfo) => {
return {
address: iface.address,
broadcast: computeBroadcastAddress(iface.address, iface.netmask),
};
})
.filter(iface => {
.filter((iface: any) => {
if (!set.has(iface.broadcast)) {
set.add(iface.broadcast);

Expand All @@ -173,6 +173,7 @@ export function prepareInterfaces(interfaces: { [index: string]: os.NetworkInter

return false;
});
}
}

export function newSilentPublisher(namespace: string, name: string, port: number): Publisher {
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/utils-array/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"files": [
"dist/",
Expand Down Expand Up @@ -37,7 +37,7 @@
"devDependencies": {
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
"lint-staged": "^10.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/utils-fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"files": [
"dist/",
Expand Down Expand Up @@ -39,7 +39,7 @@
"devDependencies": {
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
"lint-staged": "^10.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/utils-network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"files": [
"dist/",
Expand Down Expand Up @@ -37,7 +37,7 @@
"devDependencies": {
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
"lint-staged": "^10.0.2",
Expand Down
14 changes: 8 additions & 6 deletions packages/@ionic/utils-network/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ function getDefaultAddresses(): string[] {

for (const device of Object.keys(networkInterfaces)) {
const networkInterface = networkInterfaces[device];

addresses.push(...networkInterface.map(i => i.address));
if (networkInterface) {
addresses.push(...networkInterface.map(i => i.address));
}
}
} catch (e) {
// swallow
Expand All @@ -32,10 +33,11 @@ export function getExternalIPv4Interfaces(): NetworkInterface[] {

for (const device of Object.keys(networkInterfaces)) {
const networkInterface = networkInterfaces[device];

for (const networkAddress of networkInterface) {
if (!networkAddress.internal && networkAddress.family === 'IPv4') {
devices.push({ device, ...networkAddress });
if (networkInterface) {
for (const networkAddress of networkInterface) {
if (!networkAddress.internal && networkAddress.family === 'IPv4') {
devices.push({ device, ...networkAddress });
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/utils-object/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"files": [
"dist/",
Expand Down Expand Up @@ -37,7 +37,7 @@
"devDependencies": {
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
"lint-staged": "^10.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/utils-process/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"files": [
"dist/",
Expand Down Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"@types/signal-exit": "^3.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/utils-stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"files": [
"dist/",
Expand Down Expand Up @@ -37,7 +37,7 @@
"devDependencies": {
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
"lint-staged": "^10.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/@ionic/utils-stream/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class ReadableStreamBuffer extends Readable {
this._send();
}

feed(data: Buffer | string, encoding = 'utf8'): void {
feed(data: Buffer | string, encoding: BufferEncoding = 'utf8'): void {
if (this._stopped) {
throw new Error('ReadableStreamBuffer is stopped. Can no longer feed.');
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@ionic/utils-subprocess/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"engines": {
"node": ">=10.3.0"
"node": ">=16.0.0"
},
"files": [
"dist/",
Expand Down Expand Up @@ -44,7 +44,7 @@
"@types/cross-spawn": "^6.0.0",
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/node": "~16.0.0",
"jest": "^26.4.2",
"jest-cli": "^26.0.1",
"lint-staged": "^10.0.2",
Expand Down
Loading

0 comments on commit d3c4c48

Please sign in to comment.