Browse Source

docs: Add blog and books packages

Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
pull/153/head
Pranav C 3 years ago
parent
commit
9fcade5f14
  1. 40
      .github/workflows/publish-blog.yml
  2. 40
      .github/workflows/publish-book.yml
  3. 11
      .github/workflows/publish-docs.yml
  4. 0
      packages/noco-blog/.gitignore
  5. 0
      packages/noco-blog/README.md
  6. 0
      packages/noco-blog/assets/main.css
  7. 0
      packages/noco-blog/components/global/youtube.vue
  8. 0
      packages/noco-blog/content/en/index.md
  9. 2
      packages/noco-blog/content/settings.json
  10. 0
      packages/noco-blog/nuxt.config.js
  11. 0
      packages/noco-blog/package-lock.json
  12. 3
      packages/noco-blog/package.json
  13. 0
      packages/noco-blog/static/favicon-128.png
  14. 0
      packages/noco-blog/static/favicon-16.png
  15. 0
      packages/noco-blog/static/favicon-32.png
  16. 0
      packages/noco-blog/static/favicon-64.png
  17. 11
      packages/noco-book/.gitignore
  18. 11
      packages/noco-book/README.md
  19. 7
      packages/noco-book/assets/main.css
  20. 33
      packages/noco-book/components/global/youtube.vue
  21. 84
      packages/noco-book/content/en/index.md
  22. 11
      packages/noco-book/content/settings.json
  23. 12
      packages/noco-book/nuxt.config.js
  24. 13086
      packages/noco-book/package-lock.json
  25. 14
      packages/noco-book/package.json
  26. BIN
      packages/noco-book/static/favicon-128.png
  27. BIN
      packages/noco-book/static/favicon-16.png
  28. BIN
      packages/noco-book/static/favicon-32.png
  29. BIN
      packages/noco-book/static/favicon-64.png
  30. 11
      packages/noco-docs/.gitignore
  31. 11
      packages/noco-docs/README.md
  32. 7
      packages/noco-docs/assets/main.css
  33. 33
      packages/noco-docs/components/global/youtube.vue
  34. 0
      packages/noco-docs/content/en/apis/graphql/gql-apis-generated.md
  35. 0
      packages/noco-docs/content/en/apis/rest/rest-apis-generated.md
  36. 0
      packages/noco-docs/content/en/demos.md
  37. 84
      packages/noco-docs/content/en/index.md
  38. 0
      packages/noco-docs/content/en/introduction.md
  39. 11
      packages/noco-docs/content/settings.json
  40. 12
      packages/noco-docs/nuxt.config.js
  41. 13086
      packages/noco-docs/package-lock.json
  42. 14
      packages/noco-docs/package.json
  43. 0
      packages/noco-docs/static/architecture.png
  44. BIN
      packages/noco-docs/static/favicon-128.png
  45. BIN
      packages/noco-docs/static/favicon-16.png
  46. BIN
      packages/noco-docs/static/favicon-32.png
  47. BIN
      packages/noco-docs/static/favicon-64.png
  48. 8
      packages/nocodb/package-lock.json
  49. 2
      packages/nocodb/package.json
  50. 2
      packages/nocodb/src/example/docker.ts
  51. 5
      packages/nocodb/src/lib/noco/rest/RestAuthCtrl.ts
  52. 4
      packages/nocodb/src/lib/noco/rest/RestAuthCtrlEE.ts

40
.github/workflows/publish-blog.yml

@ -0,0 +1,40 @@
name: Publish Blog
on:
push:
branches: [ master ]
jobs:
copy-file:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check for change
run: |
echo "CHANGED=$([[ $(git log --pretty=format:'%h' -n 1 --skip 1 | xargs lerna ls --since | grep noco-blog) = noco-blog ]] && echo 'OK')" >> $GITHUB_ENV
- uses: actions/setup-node@v2
if: ${{ env.CHANGED == 'OK' }}
with:
node-version: 14
- name: Build docs
if: ${{ env.CHANGED == 'OK' }}
run: |
cd packages/noco-doc
npm install
npm run generate
- name: Pushes generated output
if: ${{ env.CHANGED == 'OK' }}
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: 'packages/noco-blog/dist/'
destination_repo: 'nocodb/noco-blog'
destination_folder: 'docs'
user_email: 'pranavxc@gmail.com'
user_name: 'pranavxc'
commit_message: 'Autorelease from github.com/nocodb/nocodb/packages/noco-blog'

40
.github/workflows/publish-book.yml

@ -0,0 +1,40 @@
name: Publish Book
on:
push:
branches: [ master ]
jobs:
copy-file:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check for change
run: |
echo "CHANGED=$([[ $(git log --pretty=format:'%h' -n 1 --skip 1 | xargs lerna ls --since | grep noco-book) = noco-book ]] && echo 'OK')" >> $GITHUB_ENV
- uses: actions/setup-node@v2
if: ${{ env.CHANGED == 'OK' }}
with:
node-version: 14
- name: Build docs
if: ${{ env.CHANGED == 'OK' }}
run: |
cd packages/noco-doc
npm install
npm run generate
- name: Pushes generated output
if: ${{ env.CHANGED == 'OK' }}
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: 'packages/noco-book/dist/'
destination_repo: 'nocodb/noco-book'
destination_folder: 'docs'
user_email: 'pranavxc@gmail.com'
user_name: 'pranavxc'
commit_message: 'Autorelease from github.com/nocodb/nocodb/packages/noco-book'

11
.github/workflows/publish-docs.yml

@ -10,10 +10,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check for change
run: |
echo "CHANGED=$([[ $(git log --pretty=format:'%h' -n 1 --skip 1 | xargs lerna ls --since | grep noco-docs) = noco-docs ]] && echo 'OK')" >> $GITHUB_ENV
- uses: actions/setup-node@v2
if: ${{ env.CHANGED == 'OK' }}
with:
node-version: 14
- name: Build docs
if: ${{ env.CHANGED == 'OK' }}
run: |
cd packages/noco-doc
npm install
@ -21,13 +27,14 @@ jobs:
- name: Pushes generated output
if: ${{ env.CHANGED == 'OK' }}
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: 'packages/noco-doc/dist/'
source_file: 'packages/noco-docs/dist/'
destination_repo: 'nocodb/noco-docs'
destination_folder: 'docs'
user_email: 'pranavxc@gmail.com'
user_name: 'pranavxc'
commit_message: 'Autorelease from github.com/nocodb/nocodb/packages/noco-doc'
commit_message: 'Autorelease from github.com/nocodb/nocodb/packages/noco-docs'

0
packages/noco-doc/.gitignore → packages/noco-blog/.gitignore vendored

0
packages/noco-doc/README.md → packages/noco-blog/README.md

0
packages/noco-doc/assets/main.css → packages/noco-blog/assets/main.css

0
packages/noco-doc/components/global/youtube.vue → packages/noco-blog/components/global/youtube.vue

0
packages/noco-doc/content/en/index.md → packages/noco-blog/content/en/index.md

2
packages/noco-doc/content/settings.json → packages/noco-blog/content/settings.json

@ -6,6 +6,6 @@
"dark": "/favicon-128.png"
},
"github": "nocodb/nocodb",
"defaultDir": "packages/noco-doc",
"defaultDir": "packages/noco-blog",
"twitter": "@nocodb"
}

0
packages/noco-doc/nuxt.config.js → packages/noco-blog/nuxt.config.js

0
packages/noco-doc/package-lock.json → packages/noco-blog/package-lock.json generated

3
packages/noco-doc/package.json → packages/noco-blog/package.json

@ -1,7 +1,6 @@
{
"name": "nc-doc-md-theme",
"name": "noco-blog",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",

0
packages/noco-doc/static/favicon-128.png → packages/noco-blog/static/favicon-128.png

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

0
packages/noco-doc/static/favicon-16.png → packages/noco-blog/static/favicon-16.png

Before

Width:  |  Height:  |  Size: 982 B

After

Width:  |  Height:  |  Size: 982 B

0
packages/noco-doc/static/favicon-32.png → packages/noco-blog/static/favicon-32.png

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
packages/noco-doc/static/favicon-64.png → packages/noco-blog/static/favicon-64.png

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

11
packages/noco-book/.gitignore vendored

@ -0,0 +1,11 @@
node_modules
*.iml
.idea
*.log*
.nuxt
.vscode
.DS_Store
coverage
dist
sw.*
.env

11
packages/noco-book/README.md

@ -0,0 +1,11 @@
# `noco-doc`
> TODO: description
## Usage
```
const nocoDoc = require('noco-doc');
// TODO: DEMONSTRATE API
```

7
packages/noco-book/assets/main.css

@ -0,0 +1,7 @@
main.container{
max-width:100% !important;
}
footer a[href="https://nuxtjs.org"]{
display: none;
}

33
packages/noco-book/components/global/youtube.vue

@ -0,0 +1,33 @@
<template>
<div>
<iframe type="text/html" width="100%" style="height:100%"
:src="`https://www.youtube.com/embed/${id}`"
frameborder="0" allowfullscreen></iframe>
</div>
</template>
<script>
export default {
name: "youtube",
props: {
id: String
}
}
</script>
<style scoped>
div {
background-color: red;
width: 100%;
padding-top: min(500px,56%);
position: relative;
}
iframe {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
</style>

84
packages/noco-book/content/en/index.md

@ -0,0 +1,84 @@
---
title: 'Setup and Usage'
description: 'Simple installation - takes about three minutes!'
position: 0
category: 'Getting started'
fullscreen: true
menuTitle: 'Install'
link: https://codesandbox.io/embed/vigorous-firefly-80kq5?hidenavigation=1&theme=dark
---
## Simple installation - takes about three minutes!
### Prerequisites
- __Must haves__
* [node.js >= 12](https://nodejs.org/en/download) / [Docker](https://www.docker.com/get-started)
* [MySql](https://dev.mysql.com/downloads/mysql/) / [Postgres](https://www.postgresql.org/download/) / [SQLserver](https://www.microsoft.com/en-gb/sql-server/sql-server-downloads) / SQLite Database
- Nice to haves
- Existing schemas can help to create APIs quickly.
- An example database schema can be found :<a class="grey--text"
href="https://github.com/lerocha/chinook-database/tree/master/ChinookDatabase/DataSources">
<u>here</u>
</a>
## Quick try
### 1-Click Deploy
<a href="https://heroku.com/deploy?template=https://github.com/npgia/nocodb-seed-heroku">
<img
src="https://www.herokucdn.com/deploy/button.svg"
width="300px"
alt="Deploy NocoDB to Heroku with 1-Click"
/>
</a>
### Node app or docker
<code-group>
<code-block label="NPX" active>
```bash
npx create-nocodb-app
```
</code-block>
<code-block label="Docker" >
```bash
docker run -d --name nocodb -p 8080:8080 nocodb/nocodb
```
</code-block>
<code-block label="Using Git" >
```bash
git clone https://github.com/nocodb/nocodb-seed
cd nocodb-seed
npm install
npm start
```
</code-block>
</code-group>
### Sample app
<code-sandbox :src="link"></code-sandbox>
# Sample Demos
### Docker deploying with one command
<youtube id="K-UEecQyiOk"></youtube>
### Using Npx
<youtube id="v6Nn75P1p7I"></youtube>
### Heroku Deployment
<youtube id="v6Nn75P1p7I"></youtube>

11
packages/noco-book/content/settings.json

@ -0,0 +1,11 @@
{
"title": "NocoDB",
"url": "https://nocodb.com",
"logo": {
"light": "/favicon-128.png",
"dark": "/favicon-128.png"
},
"github": "nocodb/nocodb",
"defaultDir": "packages/noco-book",
"twitter": "@nocodb"
}

12
packages/noco-book/nuxt.config.js

@ -0,0 +1,12 @@
import theme from '@nuxt/content-theme-docs'
export default theme({
docs: {
primaryColor: '#3282ff'
},
css: [
"./assets/main.css"
], content: {
liveEdit: false
}
})

13086
packages/noco-book/package-lock.json generated

File diff suppressed because it is too large Load Diff

14
packages/noco-book/package.json

@ -0,0 +1,14 @@
{
"name": "noco-book",
"version": "1.0.0",
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxt/content-theme-docs": "0.7.2",
"nuxt": "^2.15.2"
}
}

BIN
packages/noco-book/static/favicon-128.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
packages/noco-book/static/favicon-16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

BIN
packages/noco-book/static/favicon-32.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
packages/noco-book/static/favicon-64.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

11
packages/noco-docs/.gitignore vendored

@ -0,0 +1,11 @@
node_modules
*.iml
.idea
*.log*
.nuxt
.vscode
.DS_Store
coverage
dist
sw.*
.env

11
packages/noco-docs/README.md

@ -0,0 +1,11 @@
# `noco-doc`
> TODO: description
## Usage
```
const nocoDoc = require('noco-doc');
// TODO: DEMONSTRATE API
```

7
packages/noco-docs/assets/main.css

@ -0,0 +1,7 @@
main.container{
max-width:100% !important;
}
footer a[href="https://nuxtjs.org"]{
display: none;
}

33
packages/noco-docs/components/global/youtube.vue

@ -0,0 +1,33 @@
<template>
<div>
<iframe type="text/html" width="100%" style="height:100%"
:src="`https://www.youtube.com/embed/${id}`"
frameborder="0" allowfullscreen></iframe>
</div>
</template>
<script>
export default {
name: "youtube",
props: {
id: String
}
}
</script>
<style scoped>
div {
background-color: red;
width: 100%;
padding-top: min(500px,56%);
position: relative;
}
iframe {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
</style>

0
packages/noco-doc/content/en/apis/graphql/gql-apis-generated.md → packages/noco-docs/content/en/apis/graphql/gql-apis-generated.md

0
packages/noco-doc/content/en/apis/rest/rest-apis-generated.md → packages/noco-docs/content/en/apis/rest/rest-apis-generated.md

0
packages/noco-doc/content/en/demos.md → packages/noco-docs/content/en/demos.md

84
packages/noco-docs/content/en/index.md

@ -0,0 +1,84 @@
---
title: 'Setup and Usage'
description: 'Simple installation - takes about three minutes!'
position: 0
category: 'Getting started'
fullscreen: true
menuTitle: 'Install'
link: https://codesandbox.io/embed/vigorous-firefly-80kq5?hidenavigation=1&theme=dark
---
## Simple installation - takes about three minutes!
### Prerequisites
- __Must haves__
* [node.js >= 12](https://nodejs.org/en/download) / [Docker](https://www.docker.com/get-started)
* [MySql](https://dev.mysql.com/downloads/mysql/) / [Postgres](https://www.postgresql.org/download/) / [SQLserver](https://www.microsoft.com/en-gb/sql-server/sql-server-downloads) / SQLite Database
- Nice to haves
- Existing schemas can help to create APIs quickly.
- An example database schema can be found :<a class="grey--text"
href="https://github.com/lerocha/chinook-database/tree/master/ChinookDatabase/DataSources">
<u>here</u>
</a>
## Quick try
### 1-Click Deploy
<a href="https://heroku.com/deploy?template=https://github.com/npgia/nocodb-seed-heroku">
<img
src="https://www.herokucdn.com/deploy/button.svg"
width="300px"
alt="Deploy NocoDB to Heroku with 1-Click"
/>
</a>
### Node app or docker
<code-group>
<code-block label="NPX" active>
```bash
npx create-nocodb-app
```
</code-block>
<code-block label="Docker" >
```bash
docker run -d --name nocodb -p 8080:8080 nocodb/nocodb
```
</code-block>
<code-block label="Using Git" >
```bash
git clone https://github.com/nocodb/nocodb-seed
cd nocodb-seed
npm install
npm start
```
</code-block>
</code-group>
### Sample app
<code-sandbox :src="link"></code-sandbox>
# Sample Demos
### Docker deploying with one command
<youtube id="K-UEecQyiOk"></youtube>
### Using Npx
<youtube id="v6Nn75P1p7I"></youtube>
### Heroku Deployment
<youtube id="v6Nn75P1p7I"></youtube>

0
packages/noco-doc/content/en/introduction.md → packages/noco-docs/content/en/introduction.md

11
packages/noco-docs/content/settings.json

@ -0,0 +1,11 @@
{
"title": "NocoDB",
"url": "https://nocodb.com",
"logo": {
"light": "/favicon-128.png",
"dark": "/favicon-128.png"
},
"github": "nocodb/nocodb",
"defaultDir": "packages/noco-docs",
"twitter": "@nocodb"
}

12
packages/noco-docs/nuxt.config.js

@ -0,0 +1,12 @@
import theme from '@nuxt/content-theme-docs'
export default theme({
docs: {
primaryColor: '#3282ff'
},
css: [
"./assets/main.css"
], content: {
liveEdit: false
}
})

13086
packages/noco-docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

14
packages/noco-docs/package.json

@ -0,0 +1,14 @@
{
"name": "noco-docs",
"version": "1.0.0",
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxt/content-theme-docs": "0.7.2",
"nuxt": "^2.15.2"
}
}

0
packages/noco-doc/static/architecture.png → packages/noco-docs/static/architecture.png vendored

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
packages/noco-docs/static/favicon-128.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
packages/noco-docs/static/favicon-16.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

BIN
packages/noco-docs/static/favicon-32.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
packages/noco-docs/static/favicon-64.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

8
packages/nocodb/package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "nocodb",
"version": "0.10.3",
"version": "0.10.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -11076,9 +11076,9 @@
"integrity": "sha512-3AryS9uwa5NfISLxMciUonrH7YfXp+nlahB9T7girXIsLQrmwX4MdnuKs32akduCOGpKmjTJSWmATULbuMkbfw=="
},
"nc-help": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.2.tgz",
"integrity": "sha512-agMZsMSeEa9tXyiCTGC9XISEv4xGdYHj9kMbZ5ukG1DKHlAMxT3gpmld6TS3x7ZVV6J4GMIExtlJiWHg0DuRDw==",
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.4.tgz",
"integrity": "sha512-kwNlE+2U1ZLIp+ct3yh5ihQO81dXqiqUpJ5JezzJ00y5pu6P5R9gdY1LiVTrLawZoHXxsNlFQVTWw67P07Y5AQ==",
"requires": {
"axios": "^0.21.1",
"boxen": "^4.2.0",

2
packages/nocodb/package.json

@ -144,7 +144,7 @@
"mysql2": "^2.2.5",
"nanoid": "^3.1.20",
"nc-common": "0.0.6",
"nc-help": "^0.2.2",
"nc-help": "^0.2.4",
"nc-lib-gui": "^0.2.5",
"nc-plugin": "^0.1.1",
"nodemailer": "^6.4.10",

2
packages/nocodb/src/example/docker.ts

@ -12,7 +12,7 @@ server.set('view engine', 'ejs');
// process.env[`NC_DB`] = `mysql2://localhost:3306?u=root&p=password&d=mar_21`;
// process.env[`NC_DB`] = `pg://localhost:3306?u=root&p=password&d=mar_24`;
// process.env[`NC_DB`] = `pg://localhost:32768?u=postgres&p=xgene&d=abcde&search_path=nc_schema`;
process.env[`NC_DB`] = `pg://localhost:5432?u=postgres&p=xgene&d=abcde`;
// process.env[`NC_TRY`] = 'true';
// process.env[`NC_DASHBOARD_URL`] = '/test';

5
packages/nocodb/src/lib/noco/rest/RestAuthCtrl.ts

@ -1003,7 +1003,7 @@ export default class RestAuthCtrl {
}
const invite_token = uuidv4();
let count;
const user = await this.users.where({email}).first();
if (user) {
if (!await this.xcMeta.isUserHaveAccessToProject(req.body.project_id, user.id)) {
@ -1016,6 +1016,7 @@ export default class RestAuthCtrl {
invite_token_expires: new Date(Date.now() + (24 * 60 * 60 * 1000)),
email
});
count = await this.users.count('id').first();
const {id} = await this.users.where({email}).first();
await this.xcMeta.projectAddUser(req.body.project_id, id, 'creator');
@ -1029,7 +1030,7 @@ export default class RestAuthCtrl {
}
Tele.emit('evt', {evt_type: 'project:invite'})
Tele.emit('evt', {evt_type: 'project:invite', count:count?.count})
this.xcMeta.audit(req.body.project_id, null, 'nc_audit', {
op_type: 'AUTHENTICATION',
op_sub_type: 'INVITE',

4
packages/nocodb/src/lib/noco/rest/RestAuthCtrlEE.ts

@ -56,10 +56,12 @@ export default class RestAuthCtrlEE extends RestAuthCtrl {
});
const {id} = await this.users.where({email}).first();
const count = await this.users.count('id').first();
// add user to project
await this.xcMeta.projectAddUser(req.body.project_id, id, req.body.roles);
Tele.emit('evt', {evt_type: 'project:invite'})
Tele.emit('evt', {evt_type: 'project:invite', count: count?.count});
this.xcMeta.audit(req.body.project_id, null, 'nc_audit', {
op_type: 'AUTHENTICATION',
op_sub_type: 'INVITE',

Loading…
Cancel
Save