Skip to content

Commit

Permalink
feat: sanity-super-pane
Browse files Browse the repository at this point in the history
This is the first commit of sanity super pane. This project is authored with semantic
release (i.e. automatic, unemotional versions).
  • Loading branch information
ricokahler committed Mar 25, 2021
1 parent 69cf544 commit d80ff63
Show file tree
Hide file tree
Showing 54 changed files with 41,625 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "react-app" }
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
push:
branches:
- alpha
# - main
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 12
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test
on:
- pull_request

jobs:
release:
name: Test
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm ci

- name: Run build
run: npm run build
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
14 changes: 14 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
scripts
src
.github
.eslintrc
.gitignore
.prettierrc
.releaserc.json
external.d.ts
.env
package-lock.json
renovate.json
rollup.config.js
tsconfig.json
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "singleQuote": true }
9 changes: 9 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"branches": ["main", { "name": "alpha", "prerelease": true }],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Rico Kahler

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions example-project/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "react-app" }
10 changes: 10 additions & 0 deletions example-project/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Sanity Movies Content Studio

Congratulations, you have now installed the Sanity Content Studio, an open source real-time content editing environment connected to the Sanity backend.

Now you can do the following things:

- [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
- Check out one of the example frontends: [React](https://github.com/sanity-io/example-frontend-next-js)[React Native](https://github.com/sanity-io/example-app-react-native) | [Vue](https://github.com/sanity-io/example-frontend-vue-js)[PHP](https://github.com/sanity-io/example-frontend-silex-twig)
- [Join the community Slack](https://slack.sanity.io/?utm_source=readme)
- [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
8 changes: 8 additions & 0 deletions example-project/config/.checksums
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"#": "Used by Sanity to keep track of configuration file checksums, do not delete or modify!",
"@sanity/default-layout": "bb034f391ba508a6ca8cd971967cbedeb131c4d19b17b28a0895f32db5d568ea",
"@sanity/default-login": "6fb6d3800aa71346e1b84d95bbcaa287879456f2922372bb0294e30b968cd37f",
"@sanity/form-builder": "b38478227ba5e22c91981da4b53436df22e48ff25238a55a973ed620be5068aa",
"@sanity/data-aspects": "d199e2c199b3e26cd28b68dc84d7fc01c9186bf5089580f2e2446994d36b3cb6",
"@sanity/google-maps-input": "57ae3a403ce6a070b31ec6fa1f3c8339cafa66661eaddba1d4d5ee3cc2197ec2"
}
3 changes: 3 additions & 0 deletions example-project/config/@sanity/data-aspects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"listOptions": {}
}
6 changes: 6 additions & 0 deletions example-project/config/@sanity/default-layout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"toolSwitcher": {
"order": [],
"hidden": []
}
}
7 changes: 7 additions & 0 deletions example-project/config/@sanity/default-login.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"providers": {
"mode": "append",
"redirectOnSingle": false,
"entries": []
}
}
5 changes: 5 additions & 0 deletions example-project/config/@sanity/form-builder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"images": {
"directUploads": true
}
}
8 changes: 8 additions & 0 deletions example-project/config/@sanity/google-maps-input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"apiKey": null,
"defaultZoom": 11,
"defaultLocation": {
"lat": 40.7058254,
"lng": -74.1180863
}
}
45 changes: 45 additions & 0 deletions example-project/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "exampleproject",
"private": true,
"version": "1.0.0",
"description": "",
"main": "package.json",
"author": "Rico Kahler <rico@bloomscape.com>",
"license": "UNLICENSED",
"scripts": {
"start": "sanity start",
"build": "sanity build"
},
"keywords": [
"sanity"
],
"dependencies": {
"@sanity/base": "^2.6.2",
"@sanity/components": "^2.2.6",
"@sanity/core": "^2.6.2",
"@sanity/default-layout": "^2.6.2",
"@sanity/default-login": "^2.2.6",
"@sanity/desk-tool": "^2.6.3",
"@sanity/google-maps-input": "^2.6.2",
"@sanity/vision": "^2.2.6",
"@types/classnames": "^2.2.11",
"@types/react-window": "^1.8.2",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^4.19.0",
"babel-eslint": "^10.0.0",
"eslint": "^7.22.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-react-hooks": "^4.0.8",
"prop-types": "^15.7",
"react": "^17.0",
"react-dom": "^17.0",
"react-error-boundary": "^3.1.1",
"react-icons": "^3.11.0",
"react-window": "^1.8.6",
"typescript": "^4.2.3"
}
}
1 change: 1 addition & 0 deletions example-project/plugins/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
User-specific packages can be placed here
33 changes: 33 additions & 0 deletions example-project/sanity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"root": true,
"project": {
"name": "example-project"
},
"api": {
"projectId": "vs7c9lm7",
"dataset": "production"
},
"plugins": [
"@sanity/base",
"@sanity/components",
"@sanity/default-layout",
"@sanity/default-login",
"@sanity/desk-tool",
"@sanity/google-maps-input"
],
"env": {
"development": {
"plugins": ["@sanity/vision"]
}
},
"parts": [
{
"name": "part:@sanity/base/schema",
"path": "./schemas/schema"
},
{
"name": "part:@sanity/desk-tool/structure",
"path": "./structure.js"
}
]
}
65 changes: 65 additions & 0 deletions example-project/schemas/blockContent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* This is the schema definition for the rich text fields used for
* for this blog studio. When you import it in schemas.js it can be
* reused in other parts of the studio with:
* {
* name: 'someName',
* title: 'Some title',
* type: 'blockContent'
* }
*/
export default {
title: 'Block Content',
name: 'blockContent',
type: 'array',
of: [
{
title: 'Block',
type: 'block',
// Styles let you set what your user can mark up blocks with. These
// correspond with HTML tags, but you can set any title or value
// you want and decide how you want to deal with it where you want to
// use your content.
styles: [
{title: 'Normal', value: 'normal'},
{title: 'H1', value: 'h1'},
{title: 'H2', value: 'h2'},
{title: 'H3', value: 'h3'},
{title: 'H4', value: 'h4'},
{title: 'Quote', value: 'blockquote'},
],
lists: [{title: 'Bullet', value: 'bullet'}],
// Marks let you mark up inline text in the block editor.
marks: {
// Decorators usually describe a single property – e.g. a typographic
// preference or highlighting by editors.
decorators: [
{title: 'Strong', value: 'strong'},
{title: 'Emphasis', value: 'em'},
],
// Annotations can be any object structure – e.g. a link or a footnote.
annotations: [
{
title: 'URL',
name: 'link',
type: 'object',
fields: [
{
title: 'URL',
name: 'href',
type: 'url',
},
],
},
],
},
},
// You can add additional types here. Note that you can't use
// primitive types such as 'string' and 'number' in the same array
// as a block type.
{
type: 'image',
options: {hotspot: true},
},
],
}
35 changes: 35 additions & 0 deletions example-project/schemas/castMember.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export default {
name: 'castMember',
title: 'Cast Member',
type: 'object',
fields: [
{
name: 'characterName',
title: 'Character Name',
type: 'string',
},
{
name: 'person',
title: 'Actor',
type: 'reference',
to: [{type: 'person'}],
},
{
name: 'externalId',
title: 'External ID',
type: 'number',
},
{
name: 'externalCreditId',
title: 'External Credit ID',
type: 'string',
},
],
preview: {
select: {
subtitle: 'characterName',
title: 'person.name',
media: 'person.image',
},
},
}
49 changes: 49 additions & 0 deletions example-project/schemas/crewMember.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
export default {
name: 'crewMember',
title: 'Crew Member',
type: 'object',
fields: [
{
name: 'department',
title: 'Department',
type: 'string',
},
{
name: 'job',
title: 'Job',
type: 'string',
},
{
name: 'person',
title: 'Person',
type: 'reference',
to: [{type: 'person'}],
},
{
name: 'externalId',
title: 'External ID',
type: 'number',
},
{
name: 'externalCreditId',
title: 'External Credit ID',
type: 'string',
},
],
preview: {
select: {
name: 'person.name',
job: 'job',
department: 'department',
media: 'person.image',
},
prepare(selection) {
const {name, job, department, media} = selection
return {
title: name,
subtitle: `${job} [${department}]`,
media,
}
},
},
}
Loading

0 comments on commit d80ff63

Please sign in to comment.