-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(next): create basic package for using next.js framework
- Loading branch information
Frantz Kati
committed
Dec 4, 2020
1 parent
ef3c86c
commit a0c3e02
Showing
26 changed files
with
1,694 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules/ | ||
.env | ||
connect-session-knex.sqlite | ||
blog.sqlite | ||
storage/ | ||
mikrotensei | ||
.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require('dotenv').config() | ||
const { auth } = require('@tensei/auth') | ||
const { next } = require('@tensei/next') | ||
const { tensei } = require('@tensei/core') | ||
const { graphql } = require('@tensei/graphql') | ||
|
||
tensei() | ||
.plugins([auth().plugin(), next().plugin(), graphql().plugin()]) | ||
.databaseConfig({ | ||
dbName: 'mikrotensei.sqlite', | ||
type: 'sqlite' | ||
}) | ||
.start() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"ignoreRoot": [".git"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "@examples/next", | ||
"version": "0.4.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@mikro-orm/sqlite": "^4.3.2", | ||
"next": "^10.0.3", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1" | ||
}, | ||
"devDependencies": { | ||
"nodemon": "^2.0.4", | ||
"prettier": "^2.0.5" | ||
}, | ||
"scripts": { | ||
"start": "nodemon --watch ../../node_modules app.js", | ||
"prettier": "prettier --write './**/*.{js,json,css}'" | ||
}, | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Home() { | ||
return <h1>PAGE LOADED BY NEXT JS</h1> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
tensei.sqlite | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
tensei.sqlite | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<div align="center"> | ||
<br /> | ||
<br /> | ||
<img src="https://res.cloudinary.com/bahdcoder/image/upload/v1604236130/Asset_1_4x_fhcfyg.png" width="450px"> | ||
</div> | ||
|
||
<br /> | ||
|
||
<br /> | ||
|
||
<div align="center"> | ||
<h3> | ||
<strong> | ||
The fastest and easiest way to build powerful and secure APIs | ||
</strong> | ||
</h3> | ||
<p>Open source Node.js Headless CMS 🚀. </p> | ||
</div> | ||
|
||
<br /> | ||
|
||
<div align="center"> | ||
|
||
|
||
[![github-actions-image]][github-actions-url] [![npm-image]][npm-url] ![][typescript-image] [![license-image]][license-url] | ||
|
||
</div> | ||
|
||
<div align="center"> | ||
<h3> | ||
<a href="https://tenseijs.com"> | ||
Website | ||
</a> | ||
<span> | </span> | ||
<a href="https://tenseijs.com/docs"> | ||
Guides | ||
</a> | ||
<span> | </span> | ||
<a href="CONTRIBUTING.md"> | ||
Contributing | ||
</a> | ||
</h3> | ||
</div> | ||
|
||
<div align="center"> | ||
<sub>Built with ❤︎ by <a href="https://github.com/bahdcoder">Kati Frantz</a> | ||
</div> | ||
|
||
[github-actions-image]: https://img.shields.io/github/workflow/status/tenseijs/tensei/Tests?style=for-the-badge | ||
[github-actions-url]: https://github.com/tenseijs/tensei/actions?query=workflow%3ATests "github-actions" | ||
|
||
[npm-image]: https://img.shields.io/npm/v/@tensei/core.svg?style=for-the-badge&logo=npm | ||
[npm-url]: https://www.npmjs.com/package/@tensei/core "npm" | ||
|
||
[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript | ||
|
||
[license-url]: LICENSE.md | ||
[license-image]: https://img.shields.io/github/license/tenseijs/tensei?style=for-the-badge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "@tensei/next", | ||
"version": "0.4.1", | ||
"main": "./build/index.js", | ||
"license": "MIT", | ||
"types": "./build/index.d.ts", | ||
"files": [ | ||
"build/" | ||
], | ||
"devDependencies": {}, | ||
"scripts": { | ||
"prettier": "prettier --write './**/*.{js,json,ts,css}'", | ||
"build": "tsc --p tsconfig.json", | ||
"dev": "tsc --watch --p tsconfig.json", | ||
"test": "jest --verbose --runInBand --forceExit" | ||
}, | ||
"dependencies": { | ||
"next": "^10.0.3" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Next from 'next' | ||
import { plugin } from '@tensei/common' | ||
|
||
class NextJSPlugin { | ||
plugin() { | ||
return plugin('Next JS').boot(async ctx => { | ||
const app = Next({ | ||
dev: process.env.NODE_ENV !== 'production' | ||
}) | ||
|
||
await app.prepare() | ||
|
||
ctx.app.all('*', (request, response) => | ||
app.getRequestHandler()(request, response) | ||
) | ||
}) | ||
} | ||
} | ||
|
||
export const next = () => new NextJSPlugin() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2017", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"outDir": "./build", | ||
"strict": true, | ||
"baseUrl": "./src", | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"types": ["@types/jest"] | ||
}, | ||
"exclude": ["__tests__", "build"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { text, resource, textarea, belongsTo } from '@tensei/common' | ||
|
||
export default resource('Comment').fields([ | ||
text('Title').rules('required').searchable(), | ||
text('Title') | ||
.rules('required') | ||
.searchable(), | ||
textarea('Body').rules('required'), | ||
belongsTo('Post') | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.