Skip to content

Commit

Permalink
feat: Convert to esm
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Module is now ESM only
  • Loading branch information
Trygve Lie committed May 20, 2022
1 parent f1b5fa4 commit a378ece
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
8 changes: 4 additions & 4 deletions lib/layout-plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpIncoming } from '@podium/utils';
import { readFileSync } from 'node:fs';


const { HttpIncoming } = require('@podium/utils');
const pkg = require('../package.json');
const pkg = readFileSync(new URL('../package.json', import.meta.url))

const PodiumLayoutHapiPlugin = class PodiumLayoutHapiPlugin {
constructor() {
Expand Down Expand Up @@ -56,4 +56,4 @@ const PodiumLayoutHapiPlugin = class PodiumLayoutHapiPlugin {
}
};

module.exports = PodiumLayoutHapiPlugin;
export default PodiumLayoutHapiPlugin;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@podium/hapi-layout",
"version": "3.0.1",
"type": "module",
"description": "Hapi plugin for Podium Layout.",
"main": "lib/layout-plugin.js",
"license": "MIT",
Expand Down
12 changes: 5 additions & 7 deletions test/layout-plugin.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { PodletServer, request } from '@podium/test-utils';
import Layout from '@podium/layout';
import Hapi from '@hapi/hapi';
import tap from 'tap';


const { PodletServer, request } = require('@podium/test-utils');
const Layout = require('@podium/layout');
const Hapi = require('@hapi/hapi');
const tap = require('tap');

const HapiLayout = require('..');
import HapiLayout from '../lib/layout-plugin.js';

class Server {
constructor(options = {}, podletAddr) {
Expand Down

0 comments on commit a378ece

Please sign in to comment.