Skip to content

Commit 1ce8aa6

Browse files
feat(init): 🚀 create monorepo template (#3)
1 parent 446fa7a commit 1ce8aa6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+11656
-55
lines changed

‎.all-contributorsrc‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"badgeTemplate": "<img alt=\"All Contributors: <%= contributors.length %>\" src=\"https://img.shields.io/badge/all_contributors-<%= contributors.length %>-21bb42.svg\" />",
3+
"commit": false,
4+
"commitConvention": "angular",
5+
"contributors": [
6+
{
7+
"login": "navin-moorthy",
8+
"name": "Navin Moorthy",
9+
"avatar_url": "https://avatars.githubusercontent.com/u/39694575?v=4",
10+
"profile": "https://navinmoorthy.me/",
11+
"contributions": ["code"]
12+
}
13+
],
14+
"contributorsPerLine": 7,
15+
"files": ["README.md"],
16+
"imageSize": 100,
17+
"projectName": "frappe-ui-react",
18+
"projectOwner": "timelessco",
19+
"repoHost": "https://github.com",
20+
"repoType": "github"
21+
}

‎.changeset/README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by
4+
`@changesets/cli`, a build tool that works with multi-package repos, or
5+
single-package repos to help you version and publish your code. You can find the
6+
full documentation for it [in our repository](https://github.com/changesets/changesets)
7+
8+
We have a quick list of common questions to get you started engaging with this
9+
project in [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

‎.changeset/changelog.cjs‎

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
// Thanks to https://github.com/changesets/changesets/blob/main/packages/changelog-github/src/index.ts
2+
3+
const {
4+
getInfo,
5+
getInfoFromPullRequest,
6+
} = require("@changesets/get-github-info");
7+
// @ts-ignore
8+
const { config } = require("dotenv");
9+
10+
config();
11+
12+
module.exports = {
13+
getDependencyReleaseLine: async (
14+
changesets,
15+
dependenciesUpdated,
16+
options,
17+
) => {
18+
if (!options.repo) {
19+
throw new Error(
20+
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]',
21+
);
22+
}
23+
24+
if (dependenciesUpdated.length === 0) return "";
25+
26+
const changesetLink = `- Updated dependencies [${(
27+
await Promise.all(
28+
changesets.map(async (cs) => {
29+
if (cs.commit) {
30+
const { links } = await getInfo({
31+
repo: options.repo,
32+
commit: cs.commit,
33+
});
34+
return links.commit;
35+
}
36+
37+
return undefined;
38+
}),
39+
)
40+
)
41+
.filter(Boolean)
42+
.join(", ")}]:`;
43+
44+
const updatedDependenciesList = dependenciesUpdated.map((dependency) => {
45+
return ` - ${dependency.name}@${dependency.newVersion}`;
46+
});
47+
48+
return [changesetLink, ...updatedDependenciesList].join("\n");
49+
},
50+
getReleaseLine: async (changeset, type, options) => {
51+
if (!options || !options.repo) {
52+
throw new Error(
53+
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]',
54+
);
55+
}
56+
57+
let prFromSummary;
58+
let commitFromSummary;
59+
const usersFromSummary = [];
60+
61+
const replacedChangelog = changeset.summary
62+
.replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/imu, (_, pr) => {
63+
const number_ = Number(pr);
64+
if (!Number.isNaN(number_)) prFromSummary = number_;
65+
return "";
66+
})
67+
.replace(/^\s*commit:\s*(\S+)/imu, (_, commit) => {
68+
commitFromSummary = commit;
69+
return "";
70+
})
71+
.replaceAll(/^\s*(?:author|user):\s*@?(\S+)/gimu, (_, user) => {
72+
usersFromSummary.push(user);
73+
return "";
74+
})
75+
.trim();
76+
77+
const [firstLine, ...futureLines] = replacedChangelog
78+
.split("\n")
79+
.map((line) => {
80+
return line.trimEnd();
81+
});
82+
83+
const links = await (async () => {
84+
if (prFromSummary !== undefined) {
85+
let { links: prLinks } = await getInfoFromPullRequest({
86+
repo: options.repo,
87+
pull: prFromSummary,
88+
});
89+
if (commitFromSummary) {
90+
prLinks = {
91+
...links,
92+
commit: `[\`${commitFromSummary}\`](https://github.com/${options.repo}/commit/${commitFromSummary})`,
93+
};
94+
}
95+
96+
return prLinks;
97+
}
98+
99+
const commitToFetchFrom = commitFromSummary || changeset.commit;
100+
if (commitToFetchFrom) {
101+
const { links: repoLinks } = await getInfo({
102+
repo: options.repo,
103+
commit: commitToFetchFrom,
104+
});
105+
return repoLinks;
106+
}
107+
108+
return {
109+
commit: null,
110+
pull: null,
111+
user: null,
112+
};
113+
})();
114+
115+
const users = usersFromSummary.length
116+
? usersFromSummary
117+
.map((userFromSummary) => {
118+
return `[@${userFromSummary}](https://github.com/${userFromSummary})`;
119+
})
120+
.join(", ")
121+
: links.user;
122+
123+
return `\n\n🦋 ${links.pull === null ? "" : links.pull + " "}${firstLine}${
124+
links.commit === null ? "" : " (" + links.commit + ")"
125+
} ${users === null ? "" : "by " + users}\n${futureLines
126+
.map((line) => {
127+
return `${line}`;
128+
})
129+
.join("\n")}`;
130+
},
131+
};

‎.changeset/config.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3+
"changelog": ["./changelog.cjs", { "repo": "timelessco/frappe-ui-react" }],
4+
"privatePackages": { "version": true, "tag": true },
5+
"commit": false,
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

‎.editorconfig‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
# Non-configurable Prettier behaviors
6+
charset = utf-8
7+
insert_final_newline = true
8+
# Caveat: Prettier won’t trim trailing whitespace inside template strings, but your editor might.
9+
trim_trailing_whitespace = true
10+
11+
# Configurable Prettier behaviors
12+
end_of_line = lf
13+
indent_style = tab
14+
indent_size = 2
15+
max_line_length = 80

‎.env.example‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Export the github token to the cli needed for the github release using `pnpm release`
2+
# `export `GITHUB_TOKEN=ghp_...`

0 commit comments

Comments
 (0)