Skip to content

Commit

Permalink
Merge remote-tracking branch 'getcronit/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
kleberbaum committed Aug 8, 2024
2 parents 1300357 + e7218e8 commit e6c1a28
Show file tree
Hide file tree
Showing 118 changed files with 7,238 additions and 2,829 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
push:
branches:
- main
- beta

jobs:
release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- run: yarn install
- name: Build
run: yarn run build
- name: Release
run: yarn workspaces run semantic-release -e semantic-release-monorepo
19 changes: 0 additions & 19 deletions .releaserc.json

This file was deleted.

27 changes: 27 additions & 0 deletions cache.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/node_modules/gatsby/cache-dir/create-content-digest-browser-shim.js b/node_modules/gatsby/cache-dir/create-content-digest-browser-shim.js
index edc673f..cbd390c 100644
--- a/node_modules/gatsby/cache-dir/create-content-digest-browser-shim.js
+++ b/node_modules/gatsby/cache-dir/create-content-digest-browser-shim.js
@@ -1 +1 @@
-exports.createContentDigest = () => ``
+export const createContentDigest = () => ``
diff --git a/node_modules/gatsby/cache-dir/public-page-renderer.js b/node_modules/gatsby/cache-dir/public-page-renderer.js
index 6a91ada..e2ee03a 100644
--- a/node_modules/gatsby/cache-dir/public-page-renderer.js
+++ b/node_modules/gatsby/cache-dir/public-page-renderer.js
@@ -1,9 +1,11 @@
const preferDefault = m => (m && m.default) || m

+let renderer = () => null;
+
if (process.env.BUILD_STAGE === `develop`) {
- module.exports = preferDefault(require(`./public-page-renderer-dev`))
+ renderer = preferDefault(require(`./public-page-renderer-dev`))
} else if (process.env.BUILD_STAGE === `build-javascript`) {
- module.exports = preferDefault(require(`./public-page-renderer-prod`))
-} else {
- module.exports = () => null
+ renderer = preferDefault(require(`./public-page-renderer-prod`))
}
+
+export default renderer;
2 changes: 1 addition & 1 deletion examples/my-gatsby-site/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GATSBY_LENS_API_URL=https://api.photonq.lens.atsnek.com/graphql
GATSBY_LENS_API_URL=https://api.lens.walther.exp.univie.ac.at:8080/graphql
#SENTRY_AUTH_TOKEN=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
7 changes: 3 additions & 4 deletions examples/my-gatsby-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@
"scripts": {
"develop": "gatsby develop",
"start": "gatsby develop",
"build": "NODE_OPTIONS=--max-old-space-size=8192 gatsby build",
"serve": "gatsby serve",
"clean": "gatsby clean",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@atsnek/jaen": "^1.0.0-rc.1",
"@atsnek/jaen-fields-mdx": "^1.0.0-rc.1",
"jaen": "*",
"jaen-fields-mdx": "*",
"@radix-ui/react-icons": "^1.3.0",
"@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v4.11.0/react-icons-all-files-4.11.0.tgz",
"gatsby": "^5.11.0",
"gatsby-plugin-jaen": "^1.0.0-rc.1",
"gatsby-plugin-jaen": "*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {LayoutProps, useWidget} from '@atsnek/jaen'
import {LayoutProps, useWidget} from 'jaen'
import {Box, Heading, HStack, Button} from '@chakra-ui/react'
import {useEffect} from 'react'

Expand Down
Binary file removed examples/my-gatsby-site/src/images/icon.png
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/my-gatsby-site/src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import {Link, HeadFC, PageProps} from 'gatsby'
import {PageConfig} from '@atsnek/jaen'
import {PageConfig} from 'jaen'
import {LightMode, GlobalStyle} from '@chakra-ui/react'

const pageStyles = {
Expand Down Expand Up @@ -55,7 +55,7 @@ const NotFoundPage: React.FC<PageProps> = () => {

export default NotFoundPage

export {Head} from '@atsnek/jaen'
export {Head} from 'jaen'

export const pageConfig: PageConfig = {
label: 'Oops! Page not found',
Expand Down
2 changes: 1 addition & 1 deletion examples/my-gatsby-site/src/pages/contact.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PageConfig, PageProps, useNotificationsContext} from '@atsnek/jaen'
import {PageConfig, PageProps, useNotificationsContext} from 'jaen'

import {
Button,
Expand Down
2 changes: 1 addition & 1 deletion examples/my-gatsby-site/src/pages/editor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Field, PageConfig, PageProps} from '@atsnek/jaen'
import {Field, PageConfig, PageProps} from 'jaen'

const Page: React.FC<PageProps> = ({location, pageContext}) => {
return <Field.Editor name="editor" />
Expand Down
2 changes: 1 addition & 1 deletion examples/my-gatsby-site/src/pages/hidden-node.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PageConfig, PageProps} from '@atsnek/jaen'
import {PageConfig, PageProps} from 'jaen'

const Page: React.FC<PageProps> = ({location, pageContext}) => {
return (
Expand Down
6 changes: 3 additions & 3 deletions examples/my-gatsby-site/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
useMediaModal,
usePageContext,
useSiteMetadataContext
} from '@atsnek/jaen'
} from 'jaen'
import {Link, useJaenFrameMenuContext} from 'gatsby-plugin-jaen'

import {Box, Button, LightMode, Text} from '@chakra-ui/react'
import {graphql} from 'gatsby'
import * as React from 'react'

import {UncontrolledMdxField} from '@atsnek/jaen-fields-mdx'
import {UncontrolledMdxField} from 'jaen-fields-mdx'
import {FaCogs} from '@react-icons/all-files/fa/FaCogs'

const pageStyles = {
Expand Down Expand Up @@ -403,4 +403,4 @@ export const query = graphql`
}
`

export {Head} from '@atsnek/jaen'
export {Head} from 'jaen'
18 changes: 15 additions & 3 deletions examples/my-gatsby-site/src/pages/mdx.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {Field, PageConfig, PageProps} from '@atsnek/jaen'
import {Field, PageConfig, PageProps} from 'jaen'
import {Box} from '@chakra-ui/react'
import {MdxField} from '@atsnek/jaen-fields-mdx'
import {MdxField, UncontrolledMdxField} from 'jaen-fields-mdx'
import {Link} from 'gatsby-plugin-jaen'
import {usePage} from '@atsnek/jaen'
import {usePage} from 'jaen'
import {useState} from 'react'

const QASMPlayground: React.FC<{
playground?: boolean
Expand All @@ -26,6 +27,17 @@ const Page: React.FC<PageProps> = ({location, pageContext}) => {

console.log('page:', page)

const [value, setValue] = useState<any>()

return (
<UncontrolledMdxField
components={{QASMPlayground}}
value={value}
onUpdateValue={setValue}
isEditing={true}
/>
)

return (
<>
<Link
Expand Down
2 changes: 1 addition & 1 deletion examples/my-gatsby-site/src/pages/section.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {connectBlock, Field, PageConfig, PageProps} from '@atsnek/jaen'
import {connectBlock, Field, PageConfig, PageProps} from 'jaen'
import {VStack} from '@chakra-ui/react'

const Block = connectBlock(
Expand Down
2 changes: 1 addition & 1 deletion examples/my-gatsby-site/src/pages/tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
PageConfig,
PageProps,
useCMSManagementContext
} from '@atsnek/jaen'
} from 'jaen'
import {CMSManagement} from 'gatsby-plugin-jaen'

const Page: React.FC<PageProps> = ({location, pageContext}) => {
Expand Down
2 changes: 1 addition & 1 deletion examples/my-gatsby-site/src/pages/user/[...].tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PageConfig, PageProps} from '@atsnek/jaen'
import {PageConfig, PageProps} from 'jaen'

const Page: React.FC<PageProps> = ({location, pageContext}) => {
// everything after /user/ is the handle
Expand Down
4 changes: 2 additions & 2 deletions examples/my-gatsby-site/src/pages/wholesale.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PageConfig, PageProps} from '@atsnek/jaen'
import {PageConfig, PageProps} from 'jaen'

const Page: React.FC<PageProps> = ({location, pageContext}) => {
return (
Expand All @@ -15,6 +15,6 @@ export const pageConfig: PageConfig = {
icon: 'FaWarehouse',
auth: {
isRequired: true,
roles: ['4d84a68f-7b18-4efe-ae73-d6d3dd226110']
roles: ['260237544631828483:kassabuch:admin']
}
}
6 changes: 3 additions & 3 deletions examples/my-gatsby-site/src/templates/BlogPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react'
import {Link, HeadFC, PageProps, navigate, graphql} from 'gatsby'
import {Field, PageConfig, useField, useJaenPageIndex} from '@atsnek/jaen'
import {Field, PageConfig, useField, useJaenPageIndex} from 'jaen'
import {Button} from '@chakra-ui/react'
import {MdxField} from '@atsnek/jaen-fields-mdx'
import {MdxField} from 'jaen-fields-mdx'

const BlogPage: React.FC<PageProps> = props => {
const index = useJaenPageIndex()
Expand Down Expand Up @@ -67,4 +67,4 @@ export const query = graphql`
}
`

export {Head} from '@atsnek/jaen'
export {Head} from 'jaen'
5 changes: 0 additions & 5 deletions lerna.json

This file was deleted.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"description": "The Webapps framework for creating scalable and dynamic applications with ease.",
"private": true,
"version": "1.0.0",
"repository": "https://github.com/atsnek/jaen",
"author": "Nico Schett <schett@atsnek.com>",
"repository": "https://github.com/jaenjs/jaen",
"author": "Nico Schett <nico.schett@cronit.io>",
"scripts": {
"lint:fix": "yarn eslint packages/jaen/src/ --fix",
"prettier:fix": "yarn prettier packages/jaen/src/ --write",
"format": "yarn prettier:fix && yarn lint:fix"
"format": "yarn prettier:fix && yarn lint:fix",
"build": "yarn workspace jaen run build && yarn workspace gatsby-source-jaen run build && yarn workspace gatsby-plugin-jaen run build && yarn workspace gatsby-jaen-mailpress run build && yarn workspace gatsby-jaen-lens run build && yarn workspace jaen-fields-mdx run build"
},
"workspaces": [
"packages/jaen",
Expand All @@ -25,13 +26,18 @@
"prettier-plugin-organize-imports": "^3.2.2"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/release-notes-generator": "^14.0.0",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-standard-with-typescript": "^27.0.1",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.32.0"
"eslint-plugin-react": "^7.32.0",
"semantic-release": "^24.0.0",
"semantic-release-monorepo": "^8.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-jaen-lens/gatsby/gatsby-node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PageConfig} from '@atsnek/jaen'
import {PageConfig} from 'jaen'
import {GatsbyNode, PluginOptions} from 'gatsby'

export interface JaenLensPluginOptions extends PluginOptions {
Expand Down
5 changes: 2 additions & 3 deletions packages/gatsby-jaen-lens/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gatsby-jaen-lens",
"version": "0.0.17",
"version": "1.0.0",
"description": "Snek lens plugin for Jaen to render proxied views of internal services behind a firewall.",
"main": "index.js",
"scripts": {
Expand All @@ -14,7 +14,7 @@
],
"keywords": [
"gatsby",
"@atsnek/jaen",
"jaen",
"snek-lens",
"proxy"
],
Expand All @@ -27,7 +27,6 @@
},
"peerDependencies": {
"@chakra-ui/react": "^2.8.0",
"@snek-functions/origin": "^0.9.0",
"react": "^18.2.0"
},
"devDependencies": {
Expand Down
18 changes: 17 additions & 1 deletion packages/gatsby-jaen-lens/src/clients/lens/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import {makeSnekQuery} from 'snek-query'
import {User} from 'oidc-client-ts'
import 'jaen/dist/types'

import {Query, Mutation} from './schema.generated'

const apiURL = process.env.GATSBY_LENS_API_URL
Expand All @@ -10,6 +13,19 @@ if (!apiURL) {
export const sq = makeSnekQuery(
{Query, Mutation},
{
apiURL
apiURL,
middlewares: [
({context}) => {
const oidcStorage = sessionStorage.getItem(
`oidc.user:${__JAEN_ZITADEL__.authority}:${__JAEN_ZITADEL__.clientId}`
)

if (oidcStorage) {
const user = User.fromStorageString(oidcStorage)

context.headers['Authorization'] = `Bearer ${user.access_token}`
}
}
]
}
)
Loading

0 comments on commit e6c1a28

Please sign in to comment.