Skip to content

Commit 3416af7

Browse files
authored
Merge pull request #96 from sergiitk/cleanup/esm
[CLEANUP] Use esm instead of experimental modules
2 parents 3f4e6da + 094efdc commit 3416af7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+58
-32
lines changed

.nycrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"ava.config.js"
99
],
1010
"extension": [
11-
".jsx",
12-
".mjs"
11+
".jsx"
1312
]
1413
}

README.md

Lines changed: 1 addition & 1 deletion

ava.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
const avaConfig = {
33
files: [
44
'test/**/*.js',
5-
'test/**/*.mjs',
65
'!test/helpers',
76
'!test/mocks',
87
'!test/grafana',
@@ -12,7 +11,6 @@ const avaConfig = {
1211
compileEnhancements: false,
1312
extensions: [
1413
'js',
15-
'mjs',
1614
],
1715
// https://github.com/avajs/ava/blob/master/docs/03-assertions.md#custom-assertions
1816
// Chai is used for assertions.

docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ services:
133133
entrypoint: ['yarn']
134134
command: ['help']
135135
volumes:
136+
- ./src/:/usr/src/app/src/:ro
137+
- ./test/:/usr/src/app/test/:ro
136138
- ./package.json:/usr/src/app/package.json:rw
137139
- ./yarn.lock:/usr/src/app/yarn.lock:rw
138140
- node-modules-shared:/usr/src/app/node_modules

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"author": "Sergii Tkachenko <hi@sergii.org>",
77
"license": "MIT",
88
"main": "./src/pagerbeauty",
9+
"module": "./src/pagerbeauty",
910
"engines": {
1011
"node": "^10.14.0",
1112
"npm": "^6.4.1",
@@ -23,20 +24,21 @@
2324
"coverage:report:text": "nyc report --reporter=text",
2425
"coverage:report:html": "nyc report --reporter=html",
2526
"coverage:report:codecov": "nyc report --reporter=lcovonly && codecov",
26-
"lint": "eslint --ext .js --ext .mjs --ext .jsx -f unix .",
27-
"eslint": "eslint --ext .js --ext .mjs --ext .jsx",
27+
"lint": "eslint --ext .js --ext .jsx -f unix .",
28+
"eslint": "eslint --ext .js --ext .jsx",
2829
"mock:pagerduty_api": "mockserver -m test/mocks",
2930
"build": "webpack --config webpack.dev.js",
3031
"build:watch": "webpack --watch --config webpack.dev.js",
3132
"build:prod": "NODE_ENV=production webpack --config webpack.prod.js --display-modules",
32-
"app": "node --experimental-modules src/pagerbeauty.mjs",
33-
"app:watch": "nodemon --experimental-modules src/pagerbeauty.mjs",
34-
"app:prod": "NODE_ENV=production node --experimental-modules src/pagerbeauty.mjs",
33+
"app": "node -r esm src/pagerbeauty.js",
34+
"app:watch": "nodemon -r esm src/pagerbeauty.js",
35+
"app:prod": "NODE_ENV=production node -r esm src/pagerbeauty.js",
3536
"heroku-postbuild": "NODE_ENV=production webpack --config webpack.prod.js"
3637
},
3738
"dependencies": {
3839
"basic-auth": "^2.0.1",
3940
"dotenv": "^6.1.0",
41+
"esm": "^3.2.14",
4042
"koa": "^2.7.0",
4143
"koa-mount": "^4.0.0",
4244
"koa-route": "^3.2.0",
@@ -90,15 +92,12 @@
9092
"webpack-cli": "^3.2.3",
9193
"webpack-merge": "^4.2.1"
9294
},
93-
"resolutions": {
94-
"esm": "3.2.9"
95-
},
9695
"nodemonConfig": {
9796
"verbose": true,
9897
"watch": [
9998
"src"
10099
],
101-
"ext": "js,mjs,html.j2"
100+
"ext": "js,html.j2"
102101
},
103102
"babel": {
104103
"presets": [
File renamed without changes.

src/assets/javascripts/views/OnCallViews.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import React from 'react';
66

77
// ------- Internal imports ----------------------------------------------------
88

9-
import { OnCall } from '../../../models/OnCall.mjs';
10-
import { Incident } from '../../../models/Incident.mjs';
9+
import { OnCall } from '../../../models/OnCall';
10+
import { Incident } from '../../../models/Incident';
1111
import { PagerBeautyFetchNotFoundUiError } from '../ui-errors';
1212
import { StatusIndicatorView } from './StatusIndicatorView';
1313

0 commit comments

Comments
 (0)