Skip to content

Commit

Permalink
chore!: upgrade to node 20x
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Dec 18, 2023
1 parent 871499e commit e7e2134
Show file tree
Hide file tree
Showing 12 changed files with 377 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-packages-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/setup-node@v2
with:
cache: 'npm'
node-version: '14'
node-version-file: .tool-versions
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@stordco'
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ on: [push]
jobs:
build:
name: Build and lint on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ubuntu-latest
strategy:
matrix:
node: ['12.x', '14.x']

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
node-version-file: .tool-versions

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 20.10.0
4 changes: 2 additions & 2 deletions example/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { MSWToolbar } from '../.';
import { Button, ChakraProvider, HStack } from '@chakra-ui/react';
import type { SetupWorkerApi } from 'msw';
import type { SetupWorker } from 'msw/browser';
import { APP_NAME } from './constants';

const isDev = process.env.NODE_ENV === 'development';

let worker: SetupWorkerApi;
let worker: SetupWorker;

// An example of deferring app mounting until the worker has been loaded in development only
const prepareWorker = async () => {
Expand Down
7 changes: 3 additions & 4 deletions example/mocks/browser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { rest, setupWorker } from 'msw';
import { setupWorker } from 'msw/browser';
import {http, HttpResponse} from 'msw';
import { createUtils } from '../../';
import { APP_NAME } from '../constants';

Expand All @@ -7,9 +8,7 @@ const { json } = createUtils(APP_NAME);
export const getWorker = () => {
return setupWorker(
...[
rest.get('http://www.example.com', (_req, res, ctx) => {
return json(res, ctx, { okay: 'there' });
}),
http.get('http://www.example.com', () => HttpResponse.json({ okay: 'there' })),
]
);
};
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/react": "^16.9.11",
"@types/react-dom": "^16.8.4",
"copyfiles": "^2.4.1",
"msw": "^0.35.0",
"msw": "^2.0.11",
"parcel": "^1.12.3",
"prettier": "^2.4.1",
"typescript": "^3.4.5"
Expand Down
Loading

0 comments on commit e7e2134

Please sign in to comment.