5 Commits

Author SHA1 Message Date
Conventional Changelog Action
5b36813618 chore(release): v1.0.42 2021-10-14 07:47:28 +00:00
GitHub Actions
dcf9898d67 fix(paginator): last page now correctly matches rex 2021-10-14 09:46:33 +02:00
Conventional Changelog Action
884fc90171 chore(release): v1.0.41 2021-10-14 07:13:40 +00:00
GitHub Actions
b97833f7c5 test: fixs suite 2021-10-14 09:12:48 +02:00
Simone Corsi
1d6848cd17 fix: should avoid index lock 2021-10-14 08:57:35 +02:00
5 changed files with 23 additions and 25 deletions

View File

@@ -1,5 +1,20 @@
## <small>1.0.42 (2021-10-14)</small>
* fix(paginator): last page now correctly matches rex ([dcf9898](https://github.com/simonecorsi/mawesome/commit/dcf9898))
## <small>1.0.41 (2021-10-14)</small>
* chore(release): v1.0.41 ([884fc90](https://github.com/simonecorsi/mawesome/commit/884fc90))
* test: fixs suite ([b97833f](https://github.com/simonecorsi/mawesome/commit/b97833f))
* fix: should avoid index lock ([1d6848c](https://github.com/simonecorsi/mawesome/commit/1d6848c))
## <small>1.0.40 (2021-10-13)</small>
* chore(release): v1.0.40 ([0e016f4](https://github.com/simonecorsi/mawesome/commit/0e016f4))
* fix: fixes while exit condition ([8f9b4cc](https://github.com/simonecorsi/mawesome/commit/8f9b4cc))
* feat: paginates using async generator ([51da6c2](https://github.com/simonecorsi/mawesome/commit/51da6c2))
@@ -18,19 +33,3 @@
## <small>1.0.37 (2021-06-23)</small>
* chore(release): v1.0.37 ([1643092](https://github.com/simonecorsi/mawesome/commit/1643092))
* build(deps): bump glob-parent from 5.1.1 to 5.1.2 ([e558e07](https://github.com/simonecorsi/mawesome/commit/e558e07))
* build(deps): bump hosted-git-info from 2.8.8 to 2.8.9 ([110a667](https://github.com/simonecorsi/mawesome/commit/110a667))
* build(deps): bump normalize-url from 4.5.0 to 4.5.1 ([202d6fe](https://github.com/simonecorsi/mawesome/commit/202d6fe))
## <small>1.0.36 (2021-06-23)</small>
* chore(release): v1.0.36 ([9c0b622](https://github.com/simonecorsi/mawesome/commit/9c0b622))
* feat: saving json data for future use ([7ceb9cb](https://github.com/simonecorsi/mawesome/commit/7ceb9cb))

View File

@@ -21415,7 +21415,7 @@ function getNextPage(links) {
if (!next || !last)
return null;
const matchNext = next.uri.match(/page=([0-9]*)/);
const matchLast = next.uri.match(/page=([0-9]*)/);
const matchLast = last.uri.match(/page=([0-9]*)/);
if (!matchNext || !matchLast)
return null;
if (matchNext[1] === matchLast[1])
@@ -21489,8 +21489,8 @@ function pushNewFiles(files = []) {
yield Promise.all(files.map(({ filename, data }) => __awaiter(this, void 0, void 0, function* () {
yield fsp.writeFile(filename, data);
yield git_1.default.add(filename);
yield git_1.default.commit(`chore(${filename}): updated ${filename}`);
})));
yield git_1.default.commit(`chore(updates): updated entries in files`);
yield git_1.default.push();
});
}

View File

@@ -1,6 +1,6 @@
{
"name": "mawesome",
"version": "1.0.40",
"version": "1.0.42",
"description": "Generate awesome list from user starred repositories",
"main": "index.js",
"author": "Simone Corsi<simonecorsi.dev@gmail.com>",

View File

@@ -37,8 +37,7 @@ export function getNextPage(links: PaginationLink[]): string | null {
const last = links.find((l) => l.rel === 'last');
if (!next || !last) return null;
const matchNext = next.uri.match(/page=([0-9]*)/);
const matchLast = next.uri.match(/page=([0-9]*)/);
const matchLast = last.uri.match(/page=([0-9]*)/);
if (!matchNext || !matchLast) return null;
if (matchNext[1] === matchLast[1]) return null;
return matchNext[1];
@@ -105,9 +104,9 @@ export async function pushNewFiles(files: File[] = []): Promise<any> {
files.map(async ({ filename, data }) => {
await fsp.writeFile(filename, data);
await git.add(filename);
await git.commit(`chore(${filename}): updated ${filename}`);
})
);
await git.commit(`chore(updates): updated entries in files`);
await git.push();
}

View File

@@ -71,9 +71,9 @@ test('generateMd should create TOC', async (t) => {
test('should push', async (t) => {
await pushNewFiles([{ filename: 'README.md', data: '# title' }]);
t.true(writeFile.calledWith('README.md', '# title'));
t.true(writeFile.called);
t.true(pull.called);
t.true(add.calledWith('README.md'));
t.true(commit.calledWith('chore(README.md): updated README.md'));
t.true(add.called);
t.true(commit.called);
t.true(push.called);
});