From 520467b3d6e2925f61d14fe1ab31a714972c6d1e Mon Sep 17 00:00:00 2001 From: Quavo Date: Sun, 14 Aug 2022 21:56:08 +0000 Subject: [PATCH 01/50] Update grammar in index.tsx --- apps/venus/src/app/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/venus/src/app/index.tsx b/apps/venus/src/app/index.tsx index 529f988af6..e886c07c35 100644 --- a/apps/venus/src/app/index.tsx +++ b/apps/venus/src/app/index.tsx @@ -714,7 +714,7 @@ export function App() { > Your data is yours; it is always locally stored and secured - available to you always. While still being - able enjoy collaboration features such as real-time + able to enjoy collaboration features such as real-time editing and sharing with others, without any cloud setup. From 011a969a539de564c503a20f3ec5a4f10513d9d3 Mon Sep 17 00:00:00 2001 From: alt0 Date: Mon, 15 Aug 2022 17:17:49 +0800 Subject: [PATCH 02/50] fix: update get-started template --- apps/ligo-virgo/src/pages/workspace/Home.tsx | 6 +- .../templates/get-started-group1.json | 186 ++-------------- .../templates/get-started-group2.json | 200 ++++++++++++++++++ .../templates/template-factory.ts | 5 +- 4 files changed, 230 insertions(+), 167 deletions(-) create mode 100644 libs/datasource/db-service/src/services/editor-block/templates/get-started-group2.json diff --git a/apps/ligo-virgo/src/pages/workspace/Home.tsx b/apps/ligo-virgo/src/pages/workspace/Home.tsx index aa7f62cd4f..31de316209 100644 --- a/apps/ligo-virgo/src/pages/workspace/Home.tsx +++ b/apps/ligo-virgo/src/pages/workspace/Home.tsx @@ -23,7 +23,11 @@ export function WorkspaceHome() { user_initial_page_id, TemplateFactory.generatePageTemplateByGroupKeys({ name: '👋 Get Started with AFFINE', - groupKeys: ['getStartedGroup0', 'getStartedGroup1'], + groupKeys: [ + 'getStartedGroup0', + 'getStartedGroup1', + 'getStartedGroup2', + ], }) ); } diff --git a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json index b98c0e2fcb..6098cfbc8c 100644 --- a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json +++ b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json @@ -1,83 +1,14 @@ { "type": "group", - "properties": { - "recastCurrentViewId": "vwjI_O0J2CEsHyMW", - "metaProps": [ - { - "id": "bNjVwBq8YLxvmvr7", - "name": "Status#GVsG", - "type": "status", - "options": [ - { - "id": "wusZ8Qht8rsmFD1s", - "name": "No Started", - "color": "#AF1212", - "background": "#FFCECE", - "iconName": "status" - }, - { - "id": "qLJFK5bqYhW8NLtQ", - "name": "In Progress", - "color": "#896406", - "background": "#FFF5AB", - "iconName": "status" - }, - { - "id": "u0ZgY0sRCnqMkxzn", - "name": "Complete", - "color": "#05683D", - "background": "#C5FBE0", - "iconName": "status" - } - ] - }, - { - "id": "DfVMd-EXXO9-WZTO", - "type": "date", - "name": "Date#0neY", - "background": "#6880FF", - "color": "#fff", - "iconName": "date" - }, - { - "id": "UgQQiv9D-72nRyYy", - "type": "mention", - "name": "Mention#Recx", - "background": "#FFD568", - "color": "#FFFFFF", - "iconName": "collaborator" - }, - { - "id": "ICT1AlKCQkwYLjGs", - "type": "text", - "name": "Text#uObM", - "background": "#67dcaa", - "color": "#FFF", - "iconName": "text" - } - ], - "recastViews": [ - { - "id": "qJslh-HAKnf8gGV-", - "name": "Text", - "type": "page" - }, - { - "id": "vwjI_O0J2CEsHyMW", - "name": "Kanban", - "type": "kanban", - "groupBy": "bNjVwBq8YLxvmvr7" - } - ] - }, + "properties": {}, "blocks": [ { - "type": "text", + "type": "heading1", "properties": { "text": { "value": [ { - "text": "You can customize a Kanban to fit your workflow. Such as by adding/removing columns or changing Tag App labels." + "text": "Want to save changes?" } ] }, @@ -85,116 +16,41 @@ }, "blocks": [] }, - { - "type": "text", - "properties": { - "text": { - "value": [{ "text": "Add a Due Date to set a reminder" }] - }, - "recastValues": { - "bNjVwBq8YLxvmvr7": { - "id": "bNjVwBq8YLxvmvr7", - "type": "status", - "value": "wusZ8Qht8rsmFD1s" - }, - "DfVMd-EXXO9-WZTO": { - "id": "DfVMd-EXXO9-WZTO", - "type": "date", - "value": 1660233600000 - } - }, - "textStyle": {} - }, - "blocks": [] - }, - { - "type": "text", - "properties": { - "text": { - "value": [{ "text": "Type @ to mention people" }] - }, - "recastValues": { - "bNjVwBq8YLxvmvr7": { - "id": "bNjVwBq8YLxvmvr7", - "type": "status", - "value": "wusZ8Qht8rsmFD1s" - }, - "UgQQiv9D-72nRyYy": { - "id": "UgQQiv9D-72nRyYy", - "type": "mention", - "value": "AFFiNE" - } - }, - "textStyle": {} - }, - "blocks": [] - }, { "type": "todo", "properties": { "text": { "value": [ { - "text": "Check the box to complete the task!" + "text": "Your data is always stored locally first, and only stored where you want it." } ] - }, - "recastValues": { - "bNjVwBq8YLxvmvr7": { - "id": "bNjVwBq8YLxvmvr7", - "type": "status", - "value": "qLJFK5bqYhW8NLtQ" - } - }, - "textStyle": {}, - "collapsed": { "value": false } - }, - "blocks": [ - { - "type": "todo", - "properties": { - "text": { "value": [{ "text": "Check 01" }] }, - "textStyle": {}, - "collapsed": { "value": false }, - "checked": { "value": true } - }, - "blocks": [] - }, - { - "type": "todo", - "properties": { - "text": { "value": [{ "text": "Check 02" }] }, - "textStyle": {} - }, - "blocks": [] } - ] + } }, { - "type": "text", + "type": "todo", "properties": { "text": { "value": [ { - "text": "The GroupBy button allows you to customise how you want your data grouped just utilize your preferred Tag App settings" + "text": "So if you want to make changes, you can open a local folder via SYNC TO DISK (you should find the link at the top-right of the page). " } ] - }, - "recastValues": { - "bNjVwBq8YLxvmvr7": { - "id": "bNjVwBq8YLxvmvr7", - "type": "status", - "value": "u0ZgY0sRCnqMkxzn" - }, - "ICT1AlKCQkwYLjGs": { - "id": "ICT1AlKCQkwYLjGs", - "type": "text", - "value": "GroupBy others" - } - }, - "textStyle": {} - }, - "blocks": [] + } + } + }, + { + "type": "todo", + "properties": { + "text": { + "value": [ + { + "text": "Once you have opened a local folder any changes you make will be saved and stored locally on your device only." + } + ] + } + } } ] } diff --git a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group2.json b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group2.json new file mode 100644 index 0000000000..b98c0e2fcb --- /dev/null +++ b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group2.json @@ -0,0 +1,200 @@ +{ + "type": "group", + "properties": { + "recastCurrentViewId": "vwjI_O0J2CEsHyMW", + "metaProps": [ + { + "id": "bNjVwBq8YLxvmvr7", + "name": "Status#GVsG", + "type": "status", + "options": [ + { + "id": "wusZ8Qht8rsmFD1s", + "name": "No Started", + "color": "#AF1212", + "background": "#FFCECE", + "iconName": "status" + }, + { + "id": "qLJFK5bqYhW8NLtQ", + "name": "In Progress", + "color": "#896406", + "background": "#FFF5AB", + "iconName": "status" + }, + { + "id": "u0ZgY0sRCnqMkxzn", + "name": "Complete", + "color": "#05683D", + "background": "#C5FBE0", + "iconName": "status" + } + ] + }, + { + "id": "DfVMd-EXXO9-WZTO", + "type": "date", + "name": "Date#0neY", + "background": "#6880FF", + "color": "#fff", + "iconName": "date" + }, + { + "id": "UgQQiv9D-72nRyYy", + "type": "mention", + "name": "Mention#Recx", + "background": "#FFD568", + "color": "#FFFFFF", + "iconName": "collaborator" + }, + { + "id": "ICT1AlKCQkwYLjGs", + "type": "text", + "name": "Text#uObM", + "background": "#67dcaa", + "color": "#FFF", + "iconName": "text" + } + ], + "recastViews": [ + { + "id": "qJslh-HAKnf8gGV-", + "name": "Text", + "type": "page" + }, + { + "id": "vwjI_O0J2CEsHyMW", + "name": "Kanban", + "type": "kanban", + "groupBy": "bNjVwBq8YLxvmvr7" + } + ] + }, + "blocks": [ + { + "type": "text", + "properties": { + "text": { + "value": [ + { + "text": "You can customize a Kanban to fit your workflow. Such as by adding/removing columns or changing Tag App labels." + } + ] + }, + "textStyle": {} + }, + "blocks": [] + }, + { + "type": "text", + "properties": { + "text": { + "value": [{ "text": "Add a Due Date to set a reminder" }] + }, + "recastValues": { + "bNjVwBq8YLxvmvr7": { + "id": "bNjVwBq8YLxvmvr7", + "type": "status", + "value": "wusZ8Qht8rsmFD1s" + }, + "DfVMd-EXXO9-WZTO": { + "id": "DfVMd-EXXO9-WZTO", + "type": "date", + "value": 1660233600000 + } + }, + "textStyle": {} + }, + "blocks": [] + }, + { + "type": "text", + "properties": { + "text": { + "value": [{ "text": "Type @ to mention people" }] + }, + "recastValues": { + "bNjVwBq8YLxvmvr7": { + "id": "bNjVwBq8YLxvmvr7", + "type": "status", + "value": "wusZ8Qht8rsmFD1s" + }, + "UgQQiv9D-72nRyYy": { + "id": "UgQQiv9D-72nRyYy", + "type": "mention", + "value": "AFFiNE" + } + }, + "textStyle": {} + }, + "blocks": [] + }, + { + "type": "todo", + "properties": { + "text": { + "value": [ + { + "text": "Check the box to complete the task!" + } + ] + }, + "recastValues": { + "bNjVwBq8YLxvmvr7": { + "id": "bNjVwBq8YLxvmvr7", + "type": "status", + "value": "qLJFK5bqYhW8NLtQ" + } + }, + "textStyle": {}, + "collapsed": { "value": false } + }, + "blocks": [ + { + "type": "todo", + "properties": { + "text": { "value": [{ "text": "Check 01" }] }, + "textStyle": {}, + "collapsed": { "value": false }, + "checked": { "value": true } + }, + "blocks": [] + }, + { + "type": "todo", + "properties": { + "text": { "value": [{ "text": "Check 02" }] }, + "textStyle": {} + }, + "blocks": [] + } + ] + }, + { + "type": "text", + "properties": { + "text": { + "value": [ + { + "text": "The GroupBy button allows you to customise how you want your data grouped just utilize your preferred Tag App settings" + } + ] + }, + "recastValues": { + "bNjVwBq8YLxvmvr7": { + "id": "bNjVwBq8YLxvmvr7", + "type": "status", + "value": "u0ZgY0sRCnqMkxzn" + }, + "ICT1AlKCQkwYLjGs": { + "id": "ICT1AlKCQkwYLjGs", + "type": "text", + "value": "GroupBy others" + } + }, + "textStyle": {} + }, + "blocks": [] + } + ] +} diff --git a/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts b/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts index 9acbaf17ed..6c8d5a5643 100644 --- a/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts +++ b/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts @@ -2,6 +2,7 @@ import blogTemplate from './blog.json'; import emptyTemplate from './empty.json'; import getStartedGroup0 from './get-started-group0.json'; import getStartedGroup1 from './get-started-group1.json'; +import getStartedGroup2 from './get-started-group2.json'; import gridTemplate from './grid.json'; import todoTemplate from './todo.json'; import { Template, TemplateMeta } from './types'; @@ -12,7 +13,8 @@ export type GroupTemplateKeys = | 'empty' | 'grid' | 'getStartedGroup0' - | 'getStartedGroup1'; + | 'getStartedGroup1' + | 'getStartedGroup2'; type GroupTemplateMap = Record; const groupTemplateMap = { empty: emptyTemplate, @@ -21,6 +23,7 @@ const groupTemplateMap = { grid: gridTemplate, getStartedGroup0, getStartedGroup1, + getStartedGroup2, } as GroupTemplateMap; const defaultTemplateList: Array = [ From 95424fa11476f35b2ee0e9686c0a847620df17cf Mon Sep 17 00:00:00 2001 From: alt0 Date: Mon, 15 Aug 2022 17:27:53 +0800 Subject: [PATCH 03/50] fix: update get-started template(automatically) --- .../src/services/editor-block/templates/get-started-group1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json index 6098cfbc8c..354f85eb46 100644 --- a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json +++ b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json @@ -46,7 +46,7 @@ "text": { "value": [ { - "text": "Once you have opened a local folder any changes you make will be saved and stored locally on your device only." + "text": "Once you have opened a local folder any changes you make will be saved automatically and stored locally on your device only." } ] } From 2ff02426c0bc4f6af2399abeee443f01f8939282 Mon Sep 17 00:00:00 2001 From: DarkSky Date: Mon, 15 Aug 2022 17:41:16 +0800 Subject: [PATCH 04/50] chore: make linter happy --- apps/venus/src/app/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/venus/src/app/index.tsx b/apps/venus/src/app/index.tsx index b604f04271..71db02985e 100644 --- a/apps/venus/src/app/index.tsx +++ b/apps/venus/src/app/index.tsx @@ -715,9 +715,9 @@ export function App() { > Your data is yours; it is always locally stored and secured - available to you always. While still being - able to enjoy collaboration features such as real-time - editing and sharing with others, without any cloud - setup. + able to enjoy collaboration features such as + real-time editing and sharing with others, without + any cloud setup. From 9276e5eeba8bf6a8230eef2f9dae55eee14ce2d2 Mon Sep 17 00:00:00 2001 From: DarkSky Date: Mon, 15 Aug 2022 18:03:20 +0800 Subject: [PATCH 05/50] chore: docs now moved to docs.affine.pro --- docs/CONTRIBUTING.md | 13 --- docs/affine-code-guideline.md | 22 ---- docs/affine-git-guideline.md | 91 ---------------- docs/affine-icons-user-guide.md | 7 -- docs/how-to-add-ui-component-in-affine.md | 53 --------- ...to-auto-download-figma-assets-in-affine.md | 13 --- docs/how-to-customize-rollup-config.md | 3 - docs/how-to-write-css-in-affine.md | 103 ------------------ 8 files changed, 305 deletions(-) delete mode 100644 docs/CONTRIBUTING.md delete mode 100644 docs/affine-code-guideline.md delete mode 100644 docs/affine-git-guideline.md delete mode 100644 docs/affine-icons-user-guide.md delete mode 100644 docs/how-to-add-ui-component-in-affine.md delete mode 100644 docs/how-to-auto-download-figma-assets-in-affine.md delete mode 100644 docs/how-to-customize-rollup-config.md delete mode 100644 docs/how-to-write-css-in-affine.md diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md deleted file mode 100644 index dbf6928456..0000000000 --- a/docs/CONTRIBUTING.md +++ /dev/null @@ -1,13 +0,0 @@ -# AFFiNE CONTRIBUTING - -Contributions are **welcome** and will be fully **credited**. - -## **Requirements** - -If the project maintainer has any additional requirements, you will find them listed here. - -- Code Style [AFFiNE Code Guideline](./affine-code-guideline.md) -- Git Rules [AFFiNE Git Guideline ](./affine-git-guideline.md) -- • **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. - -**Happy coding**! diff --git a/docs/affine-code-guideline.md b/docs/affine-code-guideline.md deleted file mode 100644 index d98ba3cb51..0000000000 --- a/docs/affine-code-guideline.md +++ /dev/null @@ -1,22 +0,0 @@ -# AFFiNE Code Guideline - -| Item | Specification | Example | -| ----------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------- | -| [Packages/Paths]() | aaa-bbb-ccc | ligo-virgo, editor-todo | -| [.tsx]() | PascalCase | AddPage.tsx | -| [.ts]() | kebab-case | file-export.ts | -| [.json]() | kebab-case | file-export.ts | -| [Domain File]() | OpenRules | xx._d.ts_ | _tsconfig.xx_.json | xx.spec .ts | .env.xx | yy-ds.ts | -| [Types]() | UpperCamelCase | WebEvent | -| [Enum variants]() | UpperCamelCase | Status{ Todo,Completed } | -| [Functions]() | lowerCamelCase | | -| [React Funciton Compoment]() | UpperCamelCase | function DocShare(){} | -| [React HOC]() | UpperCamelCase | function BussinessText(){} | -| [Function Parameter]() | lowerCamelCase | function searchByIdOrName(idOrname){ } | -| [Methods for external access]() | lowerCamelCase | public sayHello(){ }; | -| [Externally Accessible Variables (Variables)]() | lowerCamelCase | animal.sleepCount | -| [General constructors]() | constructor or with_more_details | | -| [Local variables]() | lowerCamelCase | const tableCollection = []; | -| [Statics]() | SCREAMING_SNAKE_CASE | GLOBAL_MESSAGES | -| [Constants](b) | SCREAMING_SNAKE_CASE | GLOBAL_CONFIG | -| [Type parameters]() | UpperCamelCase , usually a single capital letter: T | let a: Animal = new Animal() | diff --git a/docs/affine-git-guideline.md b/docs/affine-git-guideline.md deleted file mode 100644 index 71fcb12834..0000000000 --- a/docs/affine-git-guideline.md +++ /dev/null @@ -1,91 +0,0 @@ -# AFFiNE Git Guideline - -# 1. Git Branch Name - -- fix/ -- feat/ - -# 2. **Commit message guidelines** - -AFFiNE uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated version management and package publishing. For that to work, commitmessages need to be in the right format. - -### **Atomic commits** - -If possible, make [atomic commits](https://en.wikipedia.org/wiki/Atomic_commit), which means: - -- a commit should contain exactly one self-contained functional change -- a functional change should be contained in exactly one commit -- a commit should not create an inconsistent state (such as test errors, linting errors, partial fix, feature with documentation etc...) - -A complex feature can be broken down into multiple commits as long as each one keep a consistent state and consist of a self-contained change. - -### **Commit message format** - -Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**: - -`(): - - - - -