Skip to content

Commit fb04381

Browse files
chore: prepare 0.1.0 release to GitHub package registry
1 parent 393c61b commit fb04381

File tree

3 files changed

+58
-34
lines changed

3 files changed

+58
-34
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
packages: write
11+
steps:
12+
- uses: actions/checkout@v2
13+
# Setup .npmrc file to publish to GitHub Packages
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: '14.x'
17+
registry-url: 'https://npm.pkg.github.com'
18+
# Defaults to the user or organization that owns the workflow file
19+
scope: '@meshcloud'
20+
- run: yarn
21+
- run: yarn test
22+
- run: yarn build
23+
- run: yarn publish
24+
env:
25+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "notion-markdown-cms",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
4+
"engines": {
5+
"node": "^14"
6+
},
47
"main": "dist/index.js",
58
"repository": "git@github.com:meshcloud/cloudfoundation.git",
69
"author": "Johannes Rudolph <jrudolph@meshcloud.io>",
@@ -12,8 +15,7 @@
1215
"LICENSE"
1316
],
1417
"scripts": {
15-
"build": "tsc",
16-
"prepare": "tsc",
18+
"build": "tsc --build",
1719
"test": "jest",
1820
"test:watch": "jest --watch"
1921
},
@@ -35,4 +37,4 @@
3537
"mime-types": "^2.1.32",
3638
"slugify": "^1.6.0"
3739
}
38-
}
40+
}

src/PropertiesParser.spec.ts

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { Page } from "@notionhq/client/build/src/api-types";
2-
import { PropertiesParser } from "./PropertiesParser";
3-
import { RichTextRenderer } from "./RichTextRenderer";
4-
import { DatabaseConfig } from "./SyncConfig";
1+
import { Page } from '@notionhq/client/build/src/api-types';
2+
3+
import { PropertiesParser } from './PropertiesParser';
4+
import { RichTextRenderer } from './RichTextRenderer';
5+
import { DatabaseConfig } from './SyncConfig';
56

67
const page: Partial<Page> = {
78
id: "123",
@@ -35,31 +36,28 @@ describe("PropertiesParser", () => {
3536
describe("parse", () => {
3637

3738
test("preserves all properties and adds conventional with no include filter", async () => {
38-
const sut = new PropertiesParser(new RichTextRenderer());
39+
const sut = new PropertiesParser(new RichTextRenderer({} as any, {} as any));
3940

4041
const config: DatabaseConfig = {
4142
outDir: "db/",
42-
properties: {
43-
category: "Category",
44-
},
43+
renderAs: 'table',
44+
entries: {
45+
emitToIndex: false
46+
}
4547
};
4648

47-
const result = sut.parse(page as any, config);
49+
const result = await sut.parseProperties(page as any, config);
4850

4951
const expected = {
50-
meta: {
51-
category: "Tools",
52-
id: "123",
53-
title: "Terraform",
54-
url: "http://example.com/123",
55-
order: 30
56-
},
52+
category: null,
53+
order: 30,
54+
title: "Terraform",
5755
keys: new Map([
5856
["order", "order"],
5957
["Category", "category"],
6058
["Name", "name"],
6159
]),
62-
values: {
60+
properties: {
6361
order: 30,
6462
category: "Tools",
6563
name: "Terraform",
@@ -69,31 +67,30 @@ describe("PropertiesParser", () => {
6967
});
7068

7169
test("filters according to include filter", async () => {
72-
const sut = new PropertiesParser(new RichTextRenderer());
70+
const sut = new PropertiesParser(new RichTextRenderer({} as any, {} as any));
7371

7472
const config: DatabaseConfig = {
7573
outDir: "db/",
74+
renderAs: "table",
7675
properties: {
77-
category: "Category",
7876
include: ["Name", "Category"],
7977
},
78+
entries: {
79+
emitToIndex: false
80+
}
8081
};
8182

82-
const result = sut.parse(page as any, config);
83-
83+
const result = await sut.parseProperties(page as any, config);
84+
8485
const expected = {
85-
meta: {
86-
category: "Tools",
87-
id: "123",
88-
title: "Terraform",
89-
url: "http://example.com/123",
90-
order: 30
91-
},
86+
category: null,
87+
order: 30,
88+
title: "Terraform",
9289
keys: new Map([
93-
["Name", "name"],
9490
["Category", "category"],
91+
["Name", "name"],
9592
]),
96-
values: {
93+
properties: {
9794
category: "Tools",
9895
name: "Terraform",
9996
},

0 commit comments

Comments
 (0)