@icebreakers/monorepo 0.3.0 → 0.3.1
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/CONTRIBUTING.md +3 -0
- package/assets/scripts/setPkgJson.ts +14 -0
- package/assets/scripts/setReadme.ts +29 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/assets/CONTRIBUTING.md
CHANGED
|
@@ -4,6 +4,14 @@ import set from 'set-value'
|
|
|
4
4
|
import type { PackageJson } from 'pkg-types'
|
|
5
5
|
import type { Context } from './context'
|
|
6
6
|
|
|
7
|
+
const scripts = {
|
|
8
|
+
'script:init': 'tsx scripts/init.ts',
|
|
9
|
+
'script:sync': 'tsx scripts/sync.ts',
|
|
10
|
+
'script:clean': 'tsx scripts/clean.ts',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const scriptsEntries = Object.entries(scripts)
|
|
14
|
+
|
|
7
15
|
export default async function (ctx: Context) {
|
|
8
16
|
const { git, projects, cwd, workspaceFilepath } = ctx
|
|
9
17
|
const gitUrl = await git.getGitUrl()
|
|
@@ -20,10 +28,16 @@ export default async function (ctx: Context) {
|
|
|
20
28
|
if (directory) {
|
|
21
29
|
repository.directory = directory
|
|
22
30
|
}
|
|
31
|
+
else {
|
|
32
|
+
for (const [k, v] of scriptsEntries) {
|
|
33
|
+
set(pkgJson, `scripts.${k}`, v)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
23
36
|
set(pkgJson, 'repository', repository)
|
|
24
37
|
if (gitUser) {
|
|
25
38
|
set(pkgJson, 'author', `${gitUser.name} <${gitUser.email}>`)
|
|
26
39
|
}
|
|
40
|
+
|
|
27
41
|
// "maintainers": [
|
|
28
42
|
// "xxx <xxx@gmail.com> (url)",
|
|
29
43
|
// ],
|
|
@@ -5,6 +5,7 @@ import type { Context } from './context'
|
|
|
5
5
|
async function getRows(ctx: Context) {
|
|
6
6
|
const { projects, git, cwd } = ctx
|
|
7
7
|
const gitUrl = await git.getGitUrl()
|
|
8
|
+
const gitUser = await git.getUser()
|
|
8
9
|
const rows: string[] = []
|
|
9
10
|
if (gitUrl) {
|
|
10
11
|
rows.push(`# ${gitUrl.name}\n`)
|
|
@@ -14,6 +15,34 @@ async function getRows(ctx: Context) {
|
|
|
14
15
|
const p = path.relative(cwd, project.rootDirRealPath)
|
|
15
16
|
p && rows.push(`- [${project.manifest.name}](${p}) ${project.manifest.description ? `- ${project.manifest.description}` : ''}`)
|
|
16
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.')
|
|
17
46
|
|
|
18
47
|
return rows
|
|
19
48
|
}
|
package/dist/cli.cjs
CHANGED
package/dist/cli.js
CHANGED