-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(story): apply changes back to base layer (#27)
## What? This PR does these things: - create `space-plugin-nuxt-base` project that contains all the auth logic - create `space-plugin-nuxt-starter` project, which is sort of a demo to show how to use the `-base` layer, with a simple example of listing stories - updates the Story Starter to use `space-plugin-nuxt-base` layer. ## Why? JIRA: EXT-2179 <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? Are there any linked issues? --> ## How to test? (optional) <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->
- Loading branch information
1 parent
acf9b57
commit 54abb31
Showing
49 changed files
with
14,966 additions
and
112 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,3 @@ | ||
CLIENT_ID= | ||
CLIENT_SECRET= | ||
BASE_URL= |
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,10 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@nuxt/eslint-config', 'plugin:vuejs-accessibility/recommended'], | ||
rules: { | ||
'vue/html-indent': 'off', | ||
'vue/max-attributes-per-line': 'off', | ||
'vue/multi-word-component-names': 'off', | ||
'vue/html-self-closing': 'off', | ||
}, | ||
}; |
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,24 @@ | ||
# Nuxt dev/build outputs | ||
.output | ||
.data | ||
.nuxt | ||
.nitro | ||
.cache | ||
dist | ||
|
||
# Node dependencies | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Misc | ||
.DS_Store | ||
.fleet | ||
.idea | ||
|
||
# Local env files | ||
.env | ||
.env.* | ||
!.env.example |
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 @@ | ||
shamefully-hoist=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,23 @@ | ||
# `space-plugin-nuxt-base` layer | ||
|
||
This Nuxt layer adds basic authentication flow to your existing Storyblok's Space Plugin app. | ||
|
||
## Configuration | ||
|
||
In your `nuxt.config.ts`, | ||
|
||
```js | ||
export default defineNuxtConfig({ | ||
extends: ['github:storyblok/space-tool-plugins/space-plugin-nuxt-base'], | ||
}); | ||
``` | ||
|
||
and make sure you have the `.env` file. | ||
|
||
``` | ||
CLIENT_ID= | ||
CLIENT_SECRET= | ||
BASE_URL= | ||
``` | ||
|
||
To learn more about the configuration, read the [space-plugin-nuxt-starter's README](https://github.com/storyblok/space-tool-plugins/blob/main/space-plugin-nuxt-starter/README.md#configuration). |
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,19 @@ | ||
export default defineAppConfig({ | ||
auth: { | ||
endpointPrefix: '/api/connect', | ||
initOauthFlowUrl: `/api/connect/storyblok`, | ||
successCallback: '/', | ||
errorCallback: '/401', | ||
}, | ||
}); | ||
|
||
declare module '@nuxt/schema' { | ||
interface AppConfigInput { | ||
auth: { | ||
endpointPrefix: string; | ||
initOauthFlowUrl: string; | ||
successCallback: string; | ||
errorCallback: string; | ||
}; | ||
} | ||
} |
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,9 @@ | ||
import type { AppSession } from '@storyblok/app-extension-auth'; | ||
|
||
declare module 'h3' { | ||
interface H3EventContext { | ||
appSession: AppSession; | ||
} | ||
} | ||
|
||
export default {}; |
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,4 @@ | ||
// https://nuxt.com/docs/api/configuration/nuxt-config | ||
export default defineNuxtConfig({ | ||
devtools: { enabled: 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,24 @@ | ||
{ | ||
"version": "0.0.1", | ||
"name": "@storyblok/space-plugin-nuxt-base", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"build": "nuxt build", | ||
"dev": "nuxt dev", | ||
"generate": "nuxt generate", | ||
"preview": "nuxt preview", | ||
"postinstall": "nuxt prepare" | ||
}, | ||
"dependencies": { | ||
"@storyblok/app-extension-auth": "1.0.0-alpha.1" | ||
}, | ||
"devDependencies": { | ||
"@nuxt/devtools": "latest", | ||
"h3": "^1.8.2", | ||
"nuxt": "^3.8.0", | ||
"vue": "^3.3.4", | ||
"vue-router": "^4.2.5", | ||
"typescript": "^5.1.3" | ||
} | ||
} |
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 @@ | ||
<template> | ||
<div class="container">This is `@storyblok/space-plugin-nuxt-base`.</div> | ||
</template> | ||
|
||
<style scoped> | ||
.container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
widows: 100%; | ||
height: 100vh; | ||
} | ||
</style> |
Oops, something went wrong.