Skip to content

Commit

Permalink
chore: migrate package to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Nov 10, 2023
1 parent 6b166ca commit 5db6818
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"bugs": {
"url": "https://github.com/dessant/label-actions/issues"
},
"type": "module",
"main": "src/index.js",
"scripts": {
"build": "ncc build src/index.js -o dist",
Expand Down
2 changes: 1 addition & 1 deletion src/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ mutation ($lockableId: ID!) {
}
`;

module.exports = {
export {
addDiscussionCommentQuery,
getLabelQuery,
createLabelQuery,
Expand Down
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const core = require('@actions/core');
const github = require('@actions/github');
const yaml = require('js-yaml');
import core from '@actions/core';
import github from '@actions/github';
import yaml from 'js-yaml';

const {configSchema, actionSchema} = require('./schema');
const {
import {configSchema, actionSchema} from './schema.js';
import {
addDiscussionCommentQuery,
getLabelQuery,
createLabelQuery,
Expand All @@ -14,7 +14,7 @@ const {
reopenDiscussionQuery,
lockLockableQuery,
unlockLockableQuery
} = require('./data');
} from './data.js';

async function run() {
try {
Expand Down
4 changes: 2 additions & 2 deletions src/schema.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Joi = require('joi');
import Joi from 'joi';

const extendedJoi = Joi.extend(joi => {
return {
Expand Down Expand Up @@ -144,4 +144,4 @@ const actionSchema = Joi.object()
.min(1)
.max(200);

module.exports = {configSchema, actionSchema};
export {configSchema, actionSchema};

0 comments on commit 5db6818

Please sign in to comment.