forked from release-drafter/release-drafter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use ESM and update most dependencies (release-drafter#1003)
- Loading branch information
Showing
33 changed files
with
80,306 additions
and
109,531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
{ | ||
"extends": ["eslint:recommended", "prettier"], | ||
"extends": ["eslint:recommended", "prettier", "plugin:unicorn/recommended"], | ||
"plugins": ["prettier"], | ||
"parserOptions": { | ||
"ecmaVersion": 9 | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"env": { "node": true, "es6": true }, | ||
"rules": { | ||
"prettier/prettier": "warn", | ||
"no-console": "off", | ||
"no-unused-vars": "warn" | ||
"no-unused-vars": "warn", | ||
"unicorn/no-null": "off", | ||
"unicorn/prevent-abbreviations": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const core = require('@actions/core') | ||
const { run } = require('@probot/adapter-github-actions') | ||
const app = require('./index') | ||
import core from '@actions/core' | ||
import { run } from '@probot/adapter-github-actions' | ||
import { app } from './index' | ||
|
||
run(app).catch((err) => { | ||
core.setFailed(`💥 Release drafter failed with error: ${err.message}`) | ||
run(app).catch((error) => { | ||
core.setFailed(`💥 Release drafter failed with error: ${error.message}`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
// joi-to-json-schema currently does not support v16 of Joi (https://github.com/lightsofapollo/joi-to-json-schema/issues/57) | ||
const convert = require('joi-to-json-schema') | ||
const fs = require('fs') | ||
const { schema } = require('../lib/schema') | ||
const args = process.argv.slice(2) || [] | ||
import convert from 'joi-to-json-schema' | ||
import fs from 'node:fs' | ||
import { schema } from '../lib/schema' | ||
const inputArguments = process.argv.slice(2) || [] | ||
|
||
const jsonSchema = { | ||
export const jsonSchema = { | ||
title: 'JSON schema for Release Drafter yaml files', | ||
id: | ||
'https://github.com/release-drafter/release-drafter/blob/master/schema.json', | ||
id: 'https://github.com/release-drafter/release-drafter/blob/master/schema.json', | ||
$schema: 'http://json-schema.org/draft-04/schema#', | ||
...convert(schema()), | ||
} | ||
|
||
// template is only required after deep merged, should not be required in the JSON schema | ||
// we should also remove the required field in case nothing remains after the filtering to keep draft04 compatibility | ||
const requiredField = jsonSchema.required.filter((item) => item !== 'template') | ||
if (requiredField.length) { | ||
if (requiredField.length > 0) { | ||
jsonSchema.required = requiredField | ||
} else { | ||
delete jsonSchema.required | ||
} | ||
|
||
if (args[0] === 'print') { | ||
fs.writeFileSync('./schema.json', `${JSON.stringify(jsonSchema, null, 2)}\n`) | ||
if (inputArguments[0] === 'print') { | ||
fs.writeFileSync( | ||
'./schema.json', | ||
`${JSON.stringify(jsonSchema, undefined, 2)}\n` | ||
) | ||
} | ||
|
||
module.exports.jsonSchema = jsonSchema |
Oops, something went wrong.