Compare commits

...
43 Commits
Author SHA1 Message Date
fbede54388 fix(deps): update dependency cosmiconfig to v8.1.2
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-17 13:33:58 -07:00
6d286cd5d6 chore(deps): update dependency sinon to v15.0.2 (#2730)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-14 05:05:34 +00:00
bc6d8b4411 chore(deps): update dependency testdouble to v3.17.0 (#2731)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-14 01:22:13 +00:00
9986f6fe20 chore(deps): lock file maintenance
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-06 21:15:28 -08:00
Justin MartinandGitHub 6bd6afd8f7 docs: add new to create WritableStreamBuffer instances (#2724) 2023-03-06 23:10:48 -06:00
00714c0fc8 chore(deps): lock file maintenance (#2684)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-04 14:40:56 -06:00
Chris. WebsterandGitHub c71d5d94ce test: Windows support in integration tests (#2722)
* ci: win32 escape slash as doubleslash for test

Pathing in stderr output has double backslash in the filename.  The test
will now use double backslash in the existence test.

Signed-off-by: Chris. Webster <chris@webstech.net>

* ci: avoid Windows pop-up in credential tests

Windows uses a `credential.helper` that will open a pop-up for
credentials if they are missing.  A git config parameter will now be set
to avoid the pop-up.

Signed-off-by: Chris. Webster <chris@webstech.net>

---------

Signed-off-by: Chris. Webster <chris@webstech.net>
2023-03-04 12:37:05 -06:00
Chris. WebsterandGitHub c04e827757 test: update docker config for windows support (#2721
There is legacy support for PortBindings and Binds at the root level of
the config.  Currently (including Windows) these reside under the
HostConfig.  ExposedPorts is now used to identify the externally
available ports.

Signed-off-by: Chris. Webster <chris@webstech.net>
2023-03-03 17:09:19 -06:00
Chris. WebsterandGitHub 6ead75bf73 test: index test should reset testdouble (#2723) 2023-03-03 15:58:42 -06:00
ab3dfe4aba chore(deps): update dependency c8 to v7.13.0 (#2716)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-28 23:29:06 -06:00
Matt Travi df6dbf0295 docs(navigation): removed the hash from the configuration usage page 2023-02-28 22:59:01 -06:00
Matt Travi ea8ed80e71 docs(navigation): removed the hash from the ci usage page 2023-02-28 22:57:29 -06:00
Matt Travi e47ea08255 docs(ci-configurations): removed hash from the links 2023-02-28 22:27:15 -06:00
Matt Travi 4e5b181ffb docs(node-version): linked to proper recipe page for ci-configurations 2023-02-28 22:23:21 -06:00
Matt Travi 5acdaabaaf docs(ci-configuration): further fixed the format of links to recipes 2023-02-28 22:15:15 -06:00
Matt Travi 724dc823fa docs(ci-configuration): fixed the format of links to recipes 2023-02-28 22:09:16 -06:00
31d9bfe00a fix(deps): update dependency execa to v7 (#2709)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-27 23:18:19 -06:00
7bbaaf9a48 chore(deps): update dependency ava to v5.2.0 (#2702)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-27 23:05:07 -06:00
42b67ce994 ci: set test workflow timeout to 10 minutes (#2720)
Co-authored-by: Matt Travi <programmer@travi.org>
2023-02-27 22:17:40 -06:00
Chris. WebsterandGitHub f991a599f5 test(integration): fix package name conflict (#2719) 2023-02-27 22:01:57 -06:00
Lars TrieloffandGitHub 1775ed80b9 docs(extending): add link to semantic-release-coralogix (#2710) 2023-02-16 00:45:54 -06:00
1beeb84c90 build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-03 10:08:15 -08:00
d170f73e0b feat(plugins): add support for loading ESM plugins (#2688)
Co-authored-by: Matt Travi <programmer@travi.org>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2023-01-24 23:24:02 -06:00
Chris. WebsterandGitHub 5df624c6e5 fix(windows): fixed issues preventing execution from windows (#2672) 2023-01-23 20:38:37 -06:00
Matt TraviandGitHub 914b0a2642 Revert "chore(deps): update dependency ava to v5.1.1" (#2682)
This reverts commit 3f3b286fb8.
2023-01-22 21:39:16 -06:00
Khaled BadenjkiandGitHub 140e36d60f docs(workflow-configuration): improved sentence structure (#2679) 2023-01-20 13:49:17 -06:00
Anton OvechkinandGitHub e9efbc7a52 docs(pre-releases): Correct @latest version in semantic-release (#2668)
There is a tiny typo in the version mentioned in `Working on another future release` section. It says that installing with `npm install example-module` will still receive version `1.0.0`, but in fact, there was a bug fix made on the default distribution channel one step before.
2023-01-18 03:08:40 +00:00
3f3b286fb8 chore(deps): update dependency ava to v5.1.1
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-15 15:27:52 -08:00
4db048423d chore(deps): lock file maintenance
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-14 11:54:27 -08:00
AlexandGitHub be2e1965ae ci(permissions): provided only the necessary permissions to the GITHUB_TOKEN 2023-01-14 08:11:42 -06:00
Gregor Martynus e607e234f3 build(release.yml): set node-version to lts/* 2023-01-13 12:51:39 -08:00
Shane O'GradyandGitHub c7b8e10bd1 docs: update node LTS version for npx command (#2669)
The [lts tag](https://www.npmjs.com/package/node?activeTab=versions) refers to Node.js 16.13.2. To use v18 of Node you need to use the tag `v18-lts`.
2023-01-13 09:24:31 -08:00
ac1371470d chore(deps): update dependency mockserver-client to v5.15.0
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-12 13:51:24 -08:00
7e6d9226fa chore(deps): update dependency nock to v13.3.0 (#2665)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-11 01:38:21 +00:00
Ben LimmerandGitHub 63073d64c0 docs: update GH Actions recipe actions to v3 (#2652) 2023-01-10 12:32:29 -08:00
cb45d27726 fix(deps): update dependency semver-diff to v4 (#1915)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-08 00:57:59 -06:00
f914c1ed86 fix(deps): update dependency cosmiconfig to v8
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-07 15:40:20 -08:00
c4da008e29 fix(deps): update dependency hosted-git-info to v6
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-07 15:39:59 -08:00
b707475b85 chore(deps): update dependency sinon to v15 (#2653)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-07 11:27:44 +00:00
b9579349ca chore(deps): update dependency fs-extra to v11 (#2650)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-07 08:39:35 +00:00
4b74f005c4 chore(deps): update dependency ava to v5 (#2649)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-07 05:49:16 +00:00
bbb5e5ade6 chore(deps): update dependency testdouble to v3.16.8 (#2646)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-07 02:25:38 +00:00
a1e0467f04 chore(deps): update dependency sinon to v14.0.2 (#2645)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-06 23:31:08 +00:00
21 changed files with 4062 additions and 3707 deletions
+7 -1
View File
@@ -6,8 +6,14 @@ name: Release
- next
- beta
- "*.x"
permissions:
contents: read # for checkout
jobs:
release:
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
name: release
runs-on: ubuntu-latest
steps:
@@ -15,7 +21,7 @@ jobs:
- uses: actions/setup-node@v3
with:
cache: npm
node-version: 16
node-version: lts/*
- run: npm ci
- run: npx semantic-release
env:
+4
View File
@@ -12,6 +12,9 @@ on:
- opened
- synchronize
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
test_matrix:
strategy:
@@ -21,6 +24,7 @@ jobs:
- 19
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
+2 -2
View File
@@ -4,8 +4,8 @@
- [Getting started](docs/usage/getting-started.md#getting-started)
- [Installation](docs/usage/installation.md#installation)
- [CI Configuration](docs/usage/ci-configuration.md#ci-configuration)
- [Configuration](docs/usage/configuration.md#configuration)
- [CI Configuration](docs/usage/ci-configuration.md)
- [Configuration](docs/usage/configuration.md)
- [Plugins](docs/usage/plugins.md)
- [Workflow configuration](docs/usage/workflow-configuration.md)
- [Shareable configurations](docs/usage/shareable-configurations.md)
+1 -1
View File
@@ -25,7 +25,7 @@ See https://github.com/semantic-release/semantic-release/blob/master/docs/suppor
execa("git", ["--version"])
.then(({ stdout }) => {
const gitVersion = findVersions(stdout)[0];
const gitVersion = findVersions(stdout, { loose: true })[0];
if (lt(gitVersion, MIN_GIT_VERSION)) {
console.error(`[semantic-release]: Git version ${MIN_GIT_VERSION} is required. Found ${gitVersion}.`);
process.exit(1);
+2 -2
View File
@@ -6,8 +6,8 @@
const semanticRelease = require("semantic-release");
const { WritableStreamBuffer } = require("stream-buffers");
const stdoutBuffer = WritableStreamBuffer();
const stderrBuffer = WritableStreamBuffer();
const stdoutBuffer = new WritableStreamBuffer();
const stderrBuffer = new WritableStreamBuffer();
try {
const result = await semanticRelease(
+3
View File
@@ -171,3 +171,6 @@
- `verifyConditions` Validate configuration, `Cargo.toml`, and local cargo executable. Also, logs in into `crates.io`.
- `prepare` Write the new version number into `Cargo.toml` file and perform `cargo check` if configured.
- `publish` Publish the Rust crate to `crates.io`
- [semantic-release-coralogix](https://github.com/adobe/semantic-release-coralogix)
- `verifyConditions` Verified that required credentials are provided and API is accessible
- `publish` add a release tag to Coralogix
@@ -29,11 +29,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
@@ -62,7 +62,7 @@ The Git history of the repository is now:
We now decide to work on another future major release, in parallel of the beta one, which will also be composed of multiple features, some of them being breaking changes.
To implement that workflow we can create the branch `alpha` from the branch `beta` and commit our first feature there. When pushing that commit, **semantic-release** will publish the pre-release version `3.0.0-alpha.1` on the dist-tag `@alpha`. That allow us to run integration tests by installing our module with `npm install example-module@alpha`. Other users installing with `npm install example-module` will still receive the version `1.0.0`.
To implement that workflow we can create the branch `alpha` from the branch `beta` and commit our first feature there. When pushing that commit, **semantic-release** will publish the pre-release version `3.0.0-alpha.1` on the dist-tag `@alpha`. That allow us to run integration tests by installing our module with `npm install example-module@alpha`. Other users installing with `npm install example-module` will still receive the version `1.0.1`.
The Git history of the repository is now:
+2 -2
View File
@@ -14,7 +14,7 @@ See our [Node Support Policy](node-support-policy.md) for our long-term promise
The recommended approach is to run the `semantic-release` command from a CI job running on the latest available LTS version of node.
This can either be a job used by your project to test on the latest Node LTS version or a dedicated job for the release steps.
See [CI configuration](../usage/ci-configuration.md) and [CI configuration recipes](../recipes/release-workflow/README.md#ci-configurations) for more details.
See [CI configuration](../usage/ci-configuration.md) and [CI configuration recipes](../recipes/ci-configurations/README.md#ci-configurations) for more details.
## Alternative solutions
@@ -24,7 +24,7 @@ See [CI configuration](../usage/ci-configuration.md) and [CI configuration recip
Use it to execute the `semantic-release` command.
```bash
$ npx -p node@lts -c "npx semantic-release"
$ npx -p node@v18-lts -c "npx semantic-release"
```
**Note**: See [What is npx](./FAQ.md#what-is-npx) for more details.
+2 -2
View File
@@ -14,7 +14,7 @@ Here are a few examples of the CI services that can be used to achieve this:
- [Wercker Workflows](http://devcenter.wercker.com/docs/workflows)
- [GoCD Pipelines](https://docs.gocd.org/current/introduction/concepts_in_go.html#pipeline).
See [CI configuration recipes](../recipes/ci-configurations#ci-configurations) for more details.
See [CI configuration recipes](../recipes/ci-configurations/README.md) for more details.
## Authentication
@@ -45,6 +45,6 @@ See each plugin's documentation for the environment variables required.
The authentication token/credentials have to be made available in the CI service via environment variables.
See [CI configuration recipes](../recipes/ci-configurations#ci-configurations) for more details on how to configure environment variables in your CI service.
See [CI configuration recipes](../recipes/ci-configurations/README.md) for more details on how to configure environment variables in your CI service.
**Note**: The environment variables `GH_TOKEN`, `GITHUB_TOKEN`, `GL_TOKEN` and `GITLAB_TOKEN` can be used for both the Git authentication and the API authentication required by [@semantic-release/github](https://github.com/semantic-release/github) and [@semantic-release/gitlab](https://github.com/semantic-release/gitlab).
+1 -1
View File
@@ -12,7 +12,7 @@ See [Release workflow recipes](../recipes/release-workflow/README.md#release-wor
The release workflow is configured via the [branches option](./configuration.md#branches) which accepts a single or an array of branch definitions.
Each branch can be defined either as a string, a [glob](https://github.com/micromatch/micromatch#matching-features) or an object. For string and glob definitions each [property](#branches-properties) will be defaulted.
A branch can defined as one of three types:
A branch can be defined as one of three types:
- [release](#release-branches): to make releases on top of the last version released
- [maintenance](#maintenance-branches): to make releases on top of an old release
+12 -3
View File
@@ -52,9 +52,18 @@ export async function loadPlugin({cwd}, name, pluginsPath) {
? dirname(resolveFrom.silent(__dirname, pluginsPath[name]) || resolveFrom(cwd, pluginsPath[name]))
: __dirname;
// See https://github.com/mysticatea/eslint-plugin-node/issues/250
// eslint-disable-next-line node/no-unsupported-features/es-syntax
return isFunction(name) ? name : (await import(resolveFrom.silent(basePath, name) || resolveFrom(cwd, name))).default;
if (isFunction(name)) {
return name;
}
const file = resolveFrom.silent(basePath, name) || resolveFrom(cwd, name);
const { default: cjsExport, ...esmNamedExports } = await import(`file://${file}`);
if (cjsExport) {
return cjsExport;
}
return esmNamedExports;
}
export function parseConfig(plugin) {
+3952 -3672
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -32,16 +32,16 @@
"@semantic-release/npm": "^9.0.0",
"@semantic-release/release-notes-generator": "^10.0.0",
"aggregate-error": "^4.0.1",
"cosmiconfig": "^7.0.0",
"cosmiconfig": "^8.0.0",
"debug": "^4.0.0",
"env-ci": "^8.0.0",
"execa": "^6.1.0",
"execa": "^7.0.0",
"figures": "^5.0.0",
"find-versions": "^5.1.0",
"get-stream": "^6.0.0",
"git-log-parser": "^1.2.0",
"hook-std": "^3.0.0",
"hosted-git-info": "^5.1.0",
"hosted-git-info": "^6.0.0",
"lodash-es": "^4.17.21",
"marked": "^4.1.0",
"marked-terminal": "^5.1.1",
@@ -51,29 +51,29 @@
"read-pkg-up": "^9.1.0",
"resolve-from": "^5.0.0",
"semver": "^7.3.2",
"semver-diff": "^3.1.1",
"semver-diff": "^4.0.0",
"signale": "^1.2.1",
"yargs": "^17.5.1"
},
"devDependencies": {
"ava": "4.3.3",
"c8": "7.12.0",
"ava": "5.2.0",
"c8": "7.13.0",
"clear-module": "4.1.2",
"codecov": "3.8.3",
"delay": "5.0.0",
"dockerode": "3.3.4",
"file-url": "^4.0.0",
"fs-extra": "^10.1.0",
"fs-extra": "^11.0.0",
"got": "^12.5.0",
"js-yaml": "4.1.0",
"mockserver-client": "5.14.0",
"nock": "13.2.9",
"mockserver-client": "5.15.0",
"nock": "13.3.0",
"p-retry": "^5.1.1",
"prettier": "^2.7.1",
"sinon": "14.0.0",
"sinon": "15.0.2",
"stream-buffers": "3.0.2",
"tempy": "^3.0.0",
"testdouble": "3.16.6"
"testdouble": "3.17.0"
},
"engines": {
"node": ">=18"
+3
View File
@@ -0,0 +1,3 @@
export async function verifyConditions(pluginConfig, context) {
context.logger.log("verifyConditions called");
}
+4 -1
View File
@@ -23,7 +23,10 @@ export async function start() {
container = await docker.createContainer({
Tty: true,
Image: IMAGE,
PortBindings: {[`${SERVER_PORT}/tcp`]: [{HostPort: `${HOST_PORT}`}]},
HostConfig: {
PortBindings: {[`${SERVER_PORT}/tcp`]: [{HostPort: `${HOST_PORT}`}]}
},
ExposedPorts: {[`${SERVER_PORT}/tcp`]: {}}
});
await container.start();
+4 -1
View File
@@ -19,7 +19,10 @@ export async function start() {
container = await docker.createContainer({
Tty: true,
Image: IMAGE,
PortBindings: {[`${MOCK_SERVER_PORT}/tcp`]: [{HostPort: `${MOCK_SERVER_PORT}`}]},
HostConfig: {
PortBindings: {[`${MOCK_SERVER_PORT}/tcp`]: [{HostPort: `${MOCK_SERVER_PORT}`}]}
},
ExposedPorts: {[`${MOCK_SERVER_PORT}/tcp`]: {}}
});
await container.start();
+5 -2
View File
@@ -25,8 +25,11 @@ export async function start() {
container = await docker.createContainer({
Tty: true,
Image: IMAGE,
PortBindings: {[`${REGISTRY_PORT}/tcp`]: [{HostPort: `${REGISTRY_PORT}`}]},
Binds: [`${path.join(__dirname, 'config.yaml')}:/verdaccio/conf/config.yaml`],
HostConfig: {
PortBindings: {[`${REGISTRY_PORT}/tcp`]: [{HostPort: `${REGISTRY_PORT}`}]},
Binds: [`${path.join(__dirname, 'config.yaml')}:/verdaccio/conf/config.yaml`],
},
ExposedPorts: {[`${REGISTRY_PORT}/tcp`]: {}}
});
await container.start();
+5 -1
View File
@@ -39,7 +39,11 @@ test.beforeEach((t) => {
};
});
test("Plugins are called with expected values", async (t) => {
test.afterEach.always((t) => {
td.reset();
});
test.serial("Plugins are called with expected values", async (t) => {
// Create a git repository, set the current working directory at the root of the repo
const { cwd, repositoryUrl } = await gitRepo(true);
// Add commits to the master branch
+27 -1
View File
@@ -44,6 +44,7 @@ const cli = path.resolve("./bin/semantic-release.js");
const pluginError = path.resolve("./test/fixtures/plugin-error");
const pluginInheritedError = path.resolve("./test/fixtures/plugin-error-inherited");
const pluginLogEnv = path.resolve("./test/fixtures/plugin-log-env");
const pluginEsmNamedExports = path.resolve("./test/fixtures/plugin-esm-named-exports");
test.before(async () => {
await Promise.all([gitbox.start(), npmRegistry.start(), mockServer.start()]);
@@ -597,7 +598,7 @@ test("Log unexpected errors from plugins and exit with 1", async (t) => {
// Verify the type and message are logged
t.regex(stderr, /Error: a/);
// Verify the the stacktrace is logged
t.regex(stderr, new RegExp(pluginError));
t.regex(stderr, new RegExp(process.platform === "win32" ? pluginError.replace(/\\/g, "\\\\") : pluginError));
// Verify the Error properties are logged
t.regex(stderr, /errorProperty: 'errorProperty'/);
t.is(exitCode, 1);
@@ -686,6 +687,7 @@ test("Use the valid git credentials when multiple are provided", async (t) => {
BB_TOKEN_BASIC_AUTH: gitbox.gitCredential,
GIT_ASKPASS: "echo",
GIT_TERMINAL_PROMPT: 0,
GIT_CONFIG_PARAMETERS: "'credential.helper='",
},
branch: { name: "master" },
options: { repositoryUrl: "http://toto@localhost:2080/git/test-auth.git" },
@@ -706,6 +708,7 @@ test("Use the repository URL as is if none of the given git credentials are vali
GITLAB_TOKEN: "trash",
GIT_ASKPASS: "echo",
GIT_TERMINAL_PROMPT: 0,
GIT_CONFIG_PARAMETERS: "'credential.helper='",
},
branch: { name: "master" },
options: { repositoryUrl: dummyUrl },
@@ -713,3 +716,26 @@ test("Use the repository URL as is if none of the given git credentials are vali
dummyUrl
);
});
test("ESM Plugin with named exports", async (t) => {
const packageName = "plugin-exports";
// Create a git repository, set the current working directory at the root of the repo
t.log("Create git repository");
const { cwd, repositoryUrl } = await gitbox.createRepo(packageName);
await writeJson(path.resolve(cwd, "package.json"), {
name: packageName,
version: "0.0.0-dev",
repository: { url: repositoryUrl },
release: { plugins: [pluginEsmNamedExports] },
});
t.log("$ semantic-release");
const { stdout, stderr } = await execa(cli, [], {
env: { ...env, MY_TOKEN: "secret token" },
cwd,
reject: false,
extendEnv: false,
});
t.regex(stdout, new RegExp(`verifyConditions called`));
});
+12 -1
View File
@@ -199,7 +199,18 @@ test('loadPlugin', async (t) => {
await loadPlugin({cwd}, './plugin-noop.cjs', {'./plugin-noop.cjs': './test/fixtures'}),
'From a shareable config context'
);
t.is(func, await loadPlugin({cwd}, func, {}), 'Defined as a function');
t.is(
(await import("../fixtures/plugin-noop.cjs")).default,
await loadPlugin({ cwd }, "./plugin-noop.cjs", { "./plugin-noop.cjs": "./test/fixtures" }),
"From a shareable config context"
);
const { ...namedExports } = await import("../fixtures/plugin-esm-named-exports.js");
const plugin = await loadPlugin({ cwd }, "./plugin-esm-named-exports.js", {
"./plugin-esm-named-exports.js": "./test/fixtures",
});
t.deepEqual(namedExports, plugin, "ESM with named exports");
t.is(func, await loadPlugin({ cwd }, func, {}), "Defined as a function");
});
test('parseConfig', (t) => {