-
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.
- Loading branch information
Showing
6 changed files
with
135 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { PluginType } from "@mokr/core"; | ||
|
||
async function install() { | ||
// jest -> test workflow | ||
// semanticRelease -> release workflow | ||
// prettier -> lint workflow | ||
// typescript -> build workflow | ||
} | ||
|
||
async function remove() {} | ||
|
||
async function load() {} | ||
|
||
export const githubActions = { | ||
type: PluginType.Monorepo, | ||
install, | ||
remove, | ||
load, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { | ||
enqueueInstallDependency, | ||
enqueueRemoveDependency, | ||
logInfo, | ||
PluginArgs, | ||
PluginType, | ||
removeFile, | ||
writeFile, | ||
writeJson, | ||
} from "@mokr/core"; | ||
import { join } from "node:path"; | ||
|
||
const CONFIG_FILENAME = ".releaserc.json"; | ||
const CONFIG = { | ||
branches: ["main"], | ||
plugins: [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
assets: ["CHANGELOG.md", "package.json", "packages/*/package.json"], | ||
message: | ||
"chore(release): ${nextRelease.version}\n\n${nextRelease.notes}\n\n[skip ci]", | ||
}, | ||
], | ||
], | ||
}; | ||
|
||
const NPMRC_FILENAME = ".npmrc"; | ||
const NPMRC = ` | ||
workspaces = true | ||
workspaces-update = false | ||
`; | ||
|
||
async function install({ directory }: PluginArgs) { | ||
enqueueInstallDependency({ | ||
directory, | ||
identifier: [ | ||
"@semantic-release/changelog", | ||
"@semantic-release/git", | ||
"semantic-release", | ||
], | ||
dev: true, | ||
}); | ||
|
||
await writeJson({ | ||
path: join(directory, CONFIG_FILENAME), | ||
data: CONFIG, | ||
}); | ||
|
||
await writeFile({ | ||
path: join(directory, NPMRC_FILENAME), | ||
contents: NPMRC, | ||
}); | ||
|
||
logInfo( | ||
`semantic-release in our monorepo configuration is currently broken due to https://github.com/semantic-release/npm/pull/529` | ||
); | ||
} | ||
|
||
async function remove({ directory }: PluginArgs) { | ||
enqueueRemoveDependency({ | ||
directory, | ||
identifier: [ | ||
"@semantic-release/changelog", | ||
"@semantic-release/git", | ||
"semantic-release", | ||
], | ||
}); | ||
|
||
await removeFile({ | ||
path: join(directory, CONFIG_FILENAME), | ||
}); | ||
|
||
await removeFile({ | ||
path: join(directory, NPMRC_FILENAME), | ||
}); | ||
} | ||
|
||
async function load() {} | ||
|
||
export const semanticRelease = { | ||
type: PluginType.Monorepo, | ||
install, | ||
remove, | ||
load, | ||
}; |