Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Convert library to ES modules
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Jun 2, 2022
1 parent aee9b1b commit 9ab3d46
Show file tree
Hide file tree
Showing 18 changed files with 460 additions and 449 deletions.
4 changes: 3 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"presets": [
["@babel/preset-env", {
"targets": { "node": "current" }
"targets": { "node": "14" },
// Leave import/export statements unchanged in the babel transpiling output.
"modules": false
}]
]
}
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist/
lib/
node_modules/
tests/fixtures/
8 changes: 4 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
"rules": {
"import/no-extraneous-dependencies": ["error", {
"devDependencies": [
"Gruntfile.js",
"tests/**/*.js",
"webpack.config.js",
"tests/**/*.js"
]
}
],
Expand All @@ -28,6 +26,8 @@
// We almost only use anonymous functions...
"func-names": "off",
// We don't use .tsx files
"amo/only-tsx-files": "off"
"amo/only-tsx-files": "off",
// NOTE: disabled due to https://github.com/import-js/eslint-plugin-import/issues/2104
"import/extensions": [0, "never"]
}
}
16 changes: 5 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# OSX
.DS_Store

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
.cache

# Build artifacts.
npm-debug.log
node_modules
dist/*
coverage
/coverage/
/lib/*
/node_modules/
/npm-debug.log
/*.tgz
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Dockerfile
/bin/
/build/
/coverage/
/dist/
/lib/
/docker/
/node_modules/
# white-list files we want to process
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as lib from './lib/index.js';

export default lib;

export const { signAddon, signAddonAndExit } = lib;
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
export default {
// See: https://jestjs.io/docs/ecmascript-modules
transform: {},
testEnvironment: 'node',
testPathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/node_modules/'],
};
Loading

0 comments on commit 9ab3d46

Please sign in to comment.