create-tina-app 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +45 -34
- package/examples/tina-tailwind-sidebar-demo/package.json +2 -2
- package/package.json +1 -1
- package/examples/basic/.tina/__generated__/_graphql.json +0 -2304
- package/examples/basic/.tina/__generated__/_lookup.json +0 -56
- package/examples/basic/.tina/__generated__/_schema.json +0 -57
- package/examples/basic/.tina/__generated__/config/schema.json +0 -38
- package/examples/basic/.tina/__generated__/schema.gql +0 -159
- package/examples/basic/.tina/__generated__/types.ts +0 -285
- package/examples/basic/.tina/schema.ts +0 -40
- package/examples/basic/README.md +0 -24
- package/examples/basic/components/Layout.js +0 -28
- package/examples/basic/content/page/home.mdx +0 -2
- package/examples/basic/content/post/HelloWorld.md +0 -7
- package/examples/basic/next.config.js +0 -1
- package/examples/basic/package.json +0 -23
- package/examples/basic/pages/_app.js +0 -33
- package/examples/basic/pages/admin/[[...slug]].js +0 -3
- package/examples/basic/pages/index.js +0 -30
- package/examples/basic/pages/posts/[slug].js +0 -64
- package/examples/basic/pages/posts/index.js +0 -44
- package/examples/basic/public/favicon.ico +0 -0
- package/examples/basic/public/vercel.svg +0 -4
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "starter-basic",
|
|
3
|
-
"private": true,
|
|
4
|
-
"scripts": {
|
|
5
|
-
"dev": "yarn tinacms server:start -c \"next dev\"",
|
|
6
|
-
"build": "yarn tinacms server:start -c \"next build\"",
|
|
7
|
-
"start": "yarn tinacms server:start -c \"next start\"",
|
|
8
|
-
"lint": "next lint"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"next": "12.0.3",
|
|
12
|
-
"react": "17.0.2",
|
|
13
|
-
"react-dom": "17.0.2",
|
|
14
|
-
"react-is": "^17.0.2",
|
|
15
|
-
"styled-components": "^5.1.3",
|
|
16
|
-
"tinacms": "latest"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@tinacms/cli": "latest",
|
|
20
|
-
"eslint": "7",
|
|
21
|
-
"eslint-config-next": "12.0.3"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import dynamic from 'next/dynamic'
|
|
2
|
-
import { TinaEditProvider } from 'tinacms/dist/edit-state'
|
|
3
|
-
|
|
4
|
-
// @ts-ignore FIXME: default export needs to be 'ComponentType<{}>
|
|
5
|
-
const TinaCMS = dynamic(() => import('tinacms'), { ssr: false })
|
|
6
|
-
|
|
7
|
-
const NEXT_PUBLIC_TINA_CLIENT_ID = process.env.NEXT_PUBLIC_TINA_CLIENT_ID
|
|
8
|
-
const NEXT_PUBLIC_USE_LOCAL_CLIENT =
|
|
9
|
-
process.env.NEXT_PUBLIC_USE_LOCAL_CLIENT || true
|
|
10
|
-
|
|
11
|
-
const App = ({ Component, pageProps }) => {
|
|
12
|
-
return (
|
|
13
|
-
<>
|
|
14
|
-
<TinaEditProvider
|
|
15
|
-
showEditButton={true}
|
|
16
|
-
editMode={
|
|
17
|
-
<TinaCMS
|
|
18
|
-
branch="main"
|
|
19
|
-
clientId={NEXT_PUBLIC_TINA_CLIENT_ID}
|
|
20
|
-
isLocalClient={Boolean(Number(NEXT_PUBLIC_USE_LOCAL_CLIENT))}
|
|
21
|
-
{...pageProps}
|
|
22
|
-
>
|
|
23
|
-
{(livePageProps) => <Component {...livePageProps} />}
|
|
24
|
-
</TinaCMS>
|
|
25
|
-
}
|
|
26
|
-
>
|
|
27
|
-
<Component {...pageProps} />
|
|
28
|
-
</TinaEditProvider>
|
|
29
|
-
</>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default App
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { getStaticPropsForTina } from 'tinacms'
|
|
2
|
-
import { TinaMarkdown } from 'tinacms/dist/rich-text'
|
|
3
|
-
import { Layout } from '../components/Layout'
|
|
4
|
-
export default function Home(props) {
|
|
5
|
-
const content = props.data.getPageDocument.data.body
|
|
6
|
-
return (
|
|
7
|
-
<Layout>
|
|
8
|
-
<TinaMarkdown content={content} />
|
|
9
|
-
</Layout>
|
|
10
|
-
)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const getStaticProps = async () => {
|
|
14
|
-
const tinaProps = await getStaticPropsForTina({
|
|
15
|
-
query: `{
|
|
16
|
-
getPageDocument(relativePath: "home.mdx"){
|
|
17
|
-
data{
|
|
18
|
-
body
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}`,
|
|
22
|
-
variables: {},
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
props: {
|
|
27
|
-
...tinaProps,
|
|
28
|
-
},
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { getStaticPropsForTina } from 'tinacms'
|
|
2
|
-
import { Layout } from '../../components/Layout'
|
|
3
|
-
export default function Home(props) {
|
|
4
|
-
return (
|
|
5
|
-
<Layout>
|
|
6
|
-
<code>
|
|
7
|
-
<pre
|
|
8
|
-
style={{
|
|
9
|
-
backgroundColor: 'lightgray',
|
|
10
|
-
}}
|
|
11
|
-
>
|
|
12
|
-
{JSON.stringify(props.data.getPostDocument.data, null, 2)}
|
|
13
|
-
</pre>
|
|
14
|
-
</code>
|
|
15
|
-
</Layout>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const getStaticPaths = async () => {
|
|
20
|
-
const tinaProps = await getStaticPropsForTina({
|
|
21
|
-
query: `{
|
|
22
|
-
getPageList{
|
|
23
|
-
edges {
|
|
24
|
-
node {
|
|
25
|
-
sys {
|
|
26
|
-
filename
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}`,
|
|
32
|
-
variables: {},
|
|
33
|
-
})
|
|
34
|
-
const paths = tinaProps.data.getPageList.edges.map((x) => {
|
|
35
|
-
return { params: { slug: x.node.sys.filename } }
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
paths,
|
|
40
|
-
fallback: 'blocking',
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export const getStaticProps = async (ctx) => {
|
|
44
|
-
const tinaProps = await getStaticPropsForTina({
|
|
45
|
-
query: `query getPost($relativePath: String!) {
|
|
46
|
-
getPostDocument(relativePath: $relativePath) {
|
|
47
|
-
data {
|
|
48
|
-
title
|
|
49
|
-
body
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
`,
|
|
54
|
-
variables: {
|
|
55
|
-
relativePath: ctx.params.slug + '.md',
|
|
56
|
-
},
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
props: {
|
|
61
|
-
...tinaProps,
|
|
62
|
-
},
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { getStaticPropsForTina } from 'tinacms'
|
|
2
|
-
import { Layout } from '../../components/Layout'
|
|
3
|
-
import Link from 'next/link'
|
|
4
|
-
export default function Home(props) {
|
|
5
|
-
const postsList = props.data.getPostList.edges
|
|
6
|
-
return (
|
|
7
|
-
<Layout>
|
|
8
|
-
<h1>Posts</h1>
|
|
9
|
-
<div>
|
|
10
|
-
{postsList.map((post) => (
|
|
11
|
-
<div key={post.node.id}>
|
|
12
|
-
<Link href={`/posts/${post.node.sys.filename}`}>
|
|
13
|
-
<a>{post.node.sys.filename}</a>
|
|
14
|
-
</Link>
|
|
15
|
-
</div>
|
|
16
|
-
))}
|
|
17
|
-
</div>
|
|
18
|
-
</Layout>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const getStaticProps = async () => {
|
|
23
|
-
const tinaProps = await getStaticPropsForTina({
|
|
24
|
-
query: `{
|
|
25
|
-
getPostList{
|
|
26
|
-
edges {
|
|
27
|
-
node {
|
|
28
|
-
id
|
|
29
|
-
sys {
|
|
30
|
-
filename
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}`,
|
|
36
|
-
variables: {},
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
props: {
|
|
41
|
-
...tinaProps,
|
|
42
|
-
},
|
|
43
|
-
}
|
|
44
|
-
}
|
|
Binary file
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="283" height="64" viewBox="0 0 283 64" fill="none"
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<path d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.46 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM248.72 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.45 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM200.24 34c0 6 3.92 10 10 10 4.12 0 7.21-1.87 8.8-4.92l7.68 4.43c-3.18 5.3-9.14 8.49-16.48 8.49-11.05 0-19-7.2-19-18s7.96-18 19-18c7.34 0 13.29 3.19 16.48 8.49l-7.68 4.43c-1.59-3.05-4.68-4.92-8.8-4.92-6.07 0-10 4-10 10zm82.48-29v46h-9V5h9zM36.95 0L73.9 64H0L36.95 0zm92.38 5l-27.71 48L73.91 5H84.3l17.32 30 17.32-30h10.39zm58.91 12v9.69c-1-.29-2.06-.49-3.2-.49-5.81 0-10 4-10 10V51h-9V17h9v9.2c0-5.08 5.91-9.2 13.2-9.2z" fill="#000"/>
|
|
4
|
-
</svg>
|