-
Notifications
You must be signed in to change notification settings - Fork 5
refactor(all)!: convert to ESM #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tariq86
wants to merge
1
commit into
iamludal:main
Choose a base branch
from
tariq86:refactor/esm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 +1,5 @@ | ||
| node_modules/ | ||
| dist/ | ||
| yarn-error.log | ||
| package-lock.json | ||
| yarn.lock | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -5,17 +5,20 @@ | |
| "main": "src/index.js", | ||
| "author": "iamludal", | ||
| "homepage": "https://github.com/iamludal/semantic-release-jira-notes", | ||
| "repository": "https://github.com/iamludal/semantic-release-jira-notes", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/iamludal/semantic-release-jira-notes.git" | ||
| }, | ||
| "license": "MIT", | ||
| "type": "module", | ||
| "keywords": [ | ||
| "jira", | ||
| "semantic-release", | ||
| "release-notes", | ||
| "changelog" | ||
| ], | ||
| "dependencies": { | ||
| "@semantic-release/error": "2.2.0", | ||
| "@semantic-release/release-notes-generator": "^10.0.3", | ||
| "aggregate-error": "^4.0.1" | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need this dependency anymore? |
||
| "@semantic-release/error": "^4.0.0", | ||
| "@semantic-release/release-notes-generator": "^13.0.0" | ||
| } | ||
| } | ||
This file contains hidden or 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,4 +1,4 @@ | ||
| const verifyConditions = require("./lib/verify-conditions"); | ||
| const generateNotes = require("./lib/generate-notes"); | ||
| import verifyConditions from "./lib/verify-conditions.js"; | ||
| import generateNotes from "./lib/generate-notes.js"; | ||
|
|
||
| module.exports = { verifyConditions, generateNotes }; | ||
| export default { verifyConditions, generateNotes }; |
This file contains hidden or 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 INPUTS = { ticketPrefixes: "ticketPrefixes", jiraHost: "jiraHost" }; | ||
| export const INPUTS = { ticketPrefixes: "ticketPrefixes", jiraHost: "jiraHost" }; | ||
|
|
||
| const TICKET_PREFIX_REGEX = /^[A-Z][A-Z0-9]{0,50}$/; | ||
| const ISSUE_REGEX = /([A-Z][A-Z0-9]{0,50}-[1-9][0-9]*)/; | ||
| const DOMAIN_NAME_REGEX = /^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+[A-Za-z]{2,6}$/; | ||
| export const TICKET_PREFIX_REGEX = /^[A-Z][A-Z0-9]{0,50}$/; | ||
| export const ISSUE_REGEX = /([A-Z][A-Z0-9]{0,50}-[1-9][0-9]*)/; | ||
| export const DOMAIN_NAME_REGEX = /^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+[A-Za-z]{2,6}$/; | ||
|
|
||
| module.exports = { INPUTS, TICKET_PREFIX_REGEX, ISSUE_REGEX, DOMAIN_NAME_REGEX }; | ||
| export default { INPUTS, TICKET_PREFIX_REGEX, ISSUE_REGEX, DOMAIN_NAME_REGEX }; |
This file contains hidden or 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,21 +1,21 @@ | ||
| const SemanticReleaseError = require("@semantic-release/error"); | ||
| import SemanticReleaseError from "@semantic-release/error"; | ||
|
|
||
| class RegexError extends SemanticReleaseError { | ||
| export class RegexError extends SemanticReleaseError { | ||
| constructor(value, pattern) { | ||
| super(`Value '${value}' does not match regex: ${pattern}`); | ||
| } | ||
| } | ||
|
|
||
| class InvalidTypeError extends SemanticReleaseError { | ||
| export class InvalidTypeError extends SemanticReleaseError { | ||
| constructor(variableName, expectedType) { | ||
| super(`${variableName} should be of type: ${expectedType}`); | ||
| } | ||
| } | ||
|
|
||
| class InputRequiredError extends SemanticReleaseError { | ||
| export class InputRequiredError extends SemanticReleaseError { | ||
| constructor(inputName) { | ||
| super(`Input '${inputName}' is required`); | ||
| } | ||
| } | ||
|
|
||
| module.exports = { RegexError, InvalidTypeError, InputRequiredError }; | ||
| export default { RegexError, InvalidTypeError, InputRequiredError }; |
This file contains hidden or 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 hidden or 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,6 @@ | ||
| const { InputRequiredError, RegexError } = require("./errors"); | ||
| const SemanticReleaseError = require("@semantic-release/error"); | ||
| const AggregateErrorPromise = import("aggregate-error"); | ||
| const constants = require("./constants"); | ||
| import { InputRequiredError, RegexError } from "./errors"; | ||
| import SemanticReleaseError from "@semantic-release/error"; | ||
| import constants from "./constants"; | ||
|
|
||
| const { INPUTS, TICKET_PREFIX_REGEX, DOMAIN_NAME_REGEX } = constants; | ||
|
|
||
|
|
@@ -10,8 +9,6 @@ module.exports = async pluginConfig => { | |
| const jiraHost = pluginConfig[INPUTS.jiraHost]; | ||
| const errors = []; | ||
|
|
||
| const AggregateError = (await AggregateErrorPromise).default; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need this class anymore? We are using it a line 32 🤔 |
||
|
|
||
| if (ticketPrefixes && !Array.isArray(ticketPrefixes)) { | ||
| errors.push(new SemanticReleaseError(INPUTS.ticketPrefixes, Array.name)); | ||
| } else if (ticketPrefixes) { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lockfiles should not be added to gitignore as they allow to pin specific versions of dependencies, preventing to download different versions when running 2 times "npm install" at different times but from the same source code