-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
69 additions
and
43 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
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,24 +1,31 @@ | ||
const pkg = require("../../package.json"); | ||
import { createRequire } from "node:module"; | ||
const require = createRequire(import.meta.url); | ||
|
||
const pkg = require("../../package.json"); | ||
const [homepage] = pkg.homepage.split("#"); | ||
const linkify = (file) => `${homepage}/blob/master/${file}`; | ||
|
||
module.exports = { | ||
EINVALIDPACKAGEROOT: ({ packageRoot }) => ({ | ||
export function EINVALIDPACKAGEROOT ({ packageRoot }) { | ||
return { | ||
message: "Invalid `packageRoot` option.", | ||
details: `The [packageRoot option](${linkify('README.md#packageRoot')}) option, must be a non empty \`String\`. | ||
Your configuration for the \`packageRoot\` option is \`${packageRoot}\`.` | ||
}), | ||
} | ||
} | ||
|
||
EINVALIDPROJECTEROOT: ({ projectRoot }) => ({ | ||
export function EINVALIDPROJECTEROOT ({ projectRoot }) | ||
{ | ||
return { | ||
message: "Invalid `projectRoot` option.", | ||
details: `The [projectRoot option](${linkify('README.md#projectRoot')}) option, if defined must be a non empty \`String\`. | ||
Your configuration for the \`projectRoot\` option is \`${projectRoot}\`.` | ||
}), | ||
} | ||
} | ||
|
||
EINVALIDOUTPUT: ({ output }) => ({ | ||
export function EINVALIDOUTPUT ({ output }) { | ||
return { | ||
message: "Invalid `output` option.", | ||
details: `The [output option](${linkify('README.md#output')}) option, must be a non empty \`String\` and must end with \`.unitypackage\`. | ||
Your configuration for the \`output\` option is \`${output}\`.` | ||
}), | ||
}; | ||
} | ||
} |
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 SemanticReleaseError = require('@semantic-release/error'); | ||
const ERROR_DEFINITIONS = require('./definitions/errors'); | ||
import SemanticReleaseError from "@semantic-release/error"; | ||
import * as ERROR_DEFINITIONS from "./definitions/errors.js"; | ||
|
||
module.exports = (code, ctx = {}, context) => { | ||
export default function getError(code, ctx = {}, context) { | ||
const { message, details } = ERROR_DEFINITIONS[code](ctx); | ||
return new SemanticReleaseError(message, code, details); | ||
}; | ||
} |
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,14 +1,14 @@ | ||
const glob = require("glob"); | ||
import glob from "glob"; | ||
import createUnityPackage from "unitypackage"; | ||
|
||
module.exports = ({packageRoot, projectRoot, output}, context) => { | ||
export default function preparePackage({packageRoot, projectRoot, output}, context) | ||
{ | ||
const { logger } = context; | ||
|
||
const metaFiles = [`${packageRoot}.meta`]; | ||
glob.sync(`${packageRoot}/**/*.meta`, {}).map(file => { | ||
metaFiles.push(file); | ||
}); | ||
|
||
let createUnityPackage = import("unitypackage").default; | ||
logger.log("T: " + createUnityPackage); | ||
createUnityPackage(metaFiles, projectRoot, output, logger.log); | ||
}; | ||
} |
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,9 @@ | ||
const { isNil } = require("lodash"); | ||
import {isNil} from "lodash-es"; | ||
|
||
module.exports = ({ packageRoot, projectRoot, output }) => ({ | ||
packageRoot, | ||
projectRoot: isNil(projectRoot) ? "./" : projectRoot, | ||
output | ||
}); | ||
export default function resolveConfig({ packageRoot, projectRoot, output }) { | ||
return { | ||
packageRoot, | ||
projectRoot: isNil(projectRoot) ? "./" : projectRoot, | ||
output | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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