@icebreakers/monorepo 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/.github/workflows/ci.yml +4 -1
- package/assets/.github/workflows/release.yml +2 -0
- package/assets/package.json +6 -15
- package/assets/pnpm-workspace.yaml +1 -0
- package/dist/chunk-46UL2RFM.js +315 -0
- package/dist/cli.cjs +15191 -304
- package/dist/cli.js +15213 -5
- package/dist/index.cjs +43 -374
- package/dist/index.js +1 -1
- package/package.json +10 -3
- package/assets/scripts/monorepo/binaryMirror.ts +0 -17
- package/assets/scripts/monorepo/clean.ts +0 -14
- package/assets/scripts/monorepo/context.ts +0 -18
- package/assets/scripts/monorepo/git.ts +0 -56
- package/assets/scripts/monorepo/init.ts +0 -8
- package/assets/scripts/monorepo/mirror/sources.ts +0 -31
- package/assets/scripts/monorepo/mirror/utils.ts +0 -12
- package/assets/scripts/monorepo/setPkgJson.ts +0 -37
- package/assets/scripts/monorepo/setReadme.ts +0 -53
- package/assets/scripts/monorepo/sync.ts +0 -15
- package/assets/scripts/monorepo/utils.ts +0 -21
- package/dist/chunk-QDBTTGEJ.js +0 -613
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import set from 'set-value'
|
|
2
|
-
import { chinaMirrorsEnvs } from './sources'
|
|
3
|
-
|
|
4
|
-
export function setMirror(obj: object) {
|
|
5
|
-
const platforms = ['linux', 'windows', 'osx']
|
|
6
|
-
const prefix = 'terminal.integrated.env'
|
|
7
|
-
if (typeof obj === 'object' && obj) {
|
|
8
|
-
for (const platform of platforms) {
|
|
9
|
-
set(obj, [prefix, platform].join('.').replaceAll('.', '\\.'), chinaMirrorsEnvs)
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { PackageJson } from 'pkg-types'
|
|
2
|
-
import type { Context } from './context'
|
|
3
|
-
import fs from 'fs-extra'
|
|
4
|
-
import path from 'pathe'
|
|
5
|
-
import set from 'set-value'
|
|
6
|
-
|
|
7
|
-
export default async function (ctx: Context) {
|
|
8
|
-
const { git, projects, cwd, workspaceFilepath } = ctx
|
|
9
|
-
const gitUrl = await git.getGitUrl()
|
|
10
|
-
const gitUser = await git.getUser()
|
|
11
|
-
if (gitUrl && await fs.exists(workspaceFilepath)) {
|
|
12
|
-
for (const project of projects) {
|
|
13
|
-
const pkgJson = project.manifest
|
|
14
|
-
const directory = path.relative(cwd, project.rootDir)
|
|
15
|
-
set(pkgJson, 'bugs.url', `https://github.com/${gitUrl.full_name}/issues`)
|
|
16
|
-
const repository: PackageJson['repository'] = {
|
|
17
|
-
type: 'git',
|
|
18
|
-
url: `git+https://github.com/${gitUrl.full_name}.git`,
|
|
19
|
-
}
|
|
20
|
-
if (directory) {
|
|
21
|
-
repository.directory = directory
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
set(pkgJson, 'repository', repository)
|
|
25
|
-
if (gitUser) {
|
|
26
|
-
set(pkgJson, 'author', `${gitUser.name} <${gitUser.email}>`)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// "maintainers": [
|
|
30
|
-
// "xxx <xxx@gmail.com> (url)",
|
|
31
|
-
// ],
|
|
32
|
-
await fs.writeJSON(project.pkgJsonPath, pkgJson, {
|
|
33
|
-
spaces: 2,
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { Context } from './context'
|
|
2
|
-
import fs from 'fs-extra'
|
|
3
|
-
import path from 'pathe'
|
|
4
|
-
|
|
5
|
-
async function getRows(ctx: Context) {
|
|
6
|
-
const { projects, git, cwd } = ctx
|
|
7
|
-
const gitUrl = await git.getGitUrl()
|
|
8
|
-
const gitUser = await git.getUser()
|
|
9
|
-
const rows: string[] = []
|
|
10
|
-
if (gitUrl) {
|
|
11
|
-
rows.push(`# ${gitUrl.name}\n`)
|
|
12
|
-
}
|
|
13
|
-
rows.push('## Projects\n')
|
|
14
|
-
for (const project of projects) {
|
|
15
|
-
const p = path.relative(cwd, project.rootDirRealPath)
|
|
16
|
-
p && rows.push(`- [${project.manifest.name}](${p}) ${project.manifest.description ? `- ${project.manifest.description}` : ''}`)
|
|
17
|
-
}
|
|
18
|
-
// ## Documentation
|
|
19
|
-
// ## Communication
|
|
20
|
-
if (gitUrl) {
|
|
21
|
-
// ## Contributing
|
|
22
|
-
rows.push('\n## Contributing\n')
|
|
23
|
-
rows.push('Contributions Welcome! You can contribute in the following ways.')
|
|
24
|
-
rows.push('')
|
|
25
|
-
rows.push('- Create an Issue - Propose a new feature. Report a bug.')
|
|
26
|
-
rows.push('- Pull Request - Fix a bug and typo. Refactor the code.')
|
|
27
|
-
rows.push('- Create third-party middleware - Instruct below.')
|
|
28
|
-
rows.push('- Share - Share your thoughts on the Blog, X, and others.')
|
|
29
|
-
rows.push(`- Make your application - Please try to use ${gitUrl.name}.`)
|
|
30
|
-
rows.push('')
|
|
31
|
-
rows.push('For more details, see [CONTRIBUTING.md](CONTRIBUTING.md).')
|
|
32
|
-
// ## Contributors
|
|
33
|
-
rows.push('\n## Contributors\n')
|
|
34
|
-
rows.push(`Thanks to [all contributors](https://github.com/${gitUrl.full_name}/graphs/contributors)!`)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// ## Authors
|
|
38
|
-
|
|
39
|
-
rows.push('\n## Authors\n')
|
|
40
|
-
rows.push(`${gitUser.name} <${gitUser.email}>`)
|
|
41
|
-
|
|
42
|
-
// ## License
|
|
43
|
-
|
|
44
|
-
rows.push('\n## License\n')
|
|
45
|
-
rows.push('Distributed under the MIT License. See [LICENSE](LICENSE) for more information.')
|
|
46
|
-
|
|
47
|
-
return rows
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export default async function (ctx: Context) {
|
|
51
|
-
const rows = await getRows(ctx)
|
|
52
|
-
await fs.writeFile(path.resolve(ctx.cwd, 'README.md'), `${rows.join('\n')}\n`)
|
|
53
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import process from 'node:process'
|
|
2
|
-
import { execa } from 'execa'
|
|
3
|
-
import { getWorkspacePackages } from './utils'
|
|
4
|
-
|
|
5
|
-
const cwd = process.cwd()
|
|
6
|
-
|
|
7
|
-
const packages = await getWorkspacePackages(cwd)
|
|
8
|
-
|
|
9
|
-
for (const project of packages) {
|
|
10
|
-
if (project.manifest.name) {
|
|
11
|
-
await execa({
|
|
12
|
-
stdout: ['pipe', 'inherit'],
|
|
13
|
-
})`cnpm sync ${project.manifest.name}`
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { findWorkspacePackages } from '@pnpm/workspace.find-packages'
|
|
2
|
-
import path from 'pathe'
|
|
3
|
-
|
|
4
|
-
export async function getWorkspacePackages(cwd: string) {
|
|
5
|
-
const packages = await findWorkspacePackages(cwd)
|
|
6
|
-
return (
|
|
7
|
-
await Promise.allSettled(packages.map(async (project) => {
|
|
8
|
-
const pkgJsonPath = path.resolve(project.rootDir, 'package.json')
|
|
9
|
-
return {
|
|
10
|
-
...project,
|
|
11
|
-
pkgJsonPath,
|
|
12
|
-
}
|
|
13
|
-
}))
|
|
14
|
-
)
|
|
15
|
-
.filter((x) => {
|
|
16
|
-
return x.status === 'fulfilled'
|
|
17
|
-
})
|
|
18
|
-
.map((x) => {
|
|
19
|
-
return x.value
|
|
20
|
-
})
|
|
21
|
-
}
|