Skip to content

Commit

Permalink
Add next test project
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Mar 24, 2022
1 parent 368c888 commit 52ee0fb
Show file tree
Hide file tree
Showing 19 changed files with 2,819 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test-projects/bootstrap-projects.sh
@@ -0,0 +1,6 @@
#!/bin/bash

pushd next-gdg
rm -rf node_modules/@glideapps/glide-data-grid/dist
cp -r ../../packages/core/dist node_modules/@glideapps/glide-data-grid/dist
popd
4 changes: 4 additions & 0 deletions test-projects/next-gdg/.babelrc
@@ -0,0 +1,4 @@
{
"presets": ["next/babel"],
"plugins": [["styled-components", { "ssr": true }]]
}
3 changes: 3 additions & 0 deletions test-projects/next-gdg/.eslintrc.json
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
38 changes: 38 additions & 0 deletions test-projects/next-gdg/.gitignore
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# typescript
*.tsbuildinfo
34 changes: 34 additions & 0 deletions test-projects/next-gdg/README.md
@@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
39 changes: 39 additions & 0 deletions test-projects/next-gdg/components/Grid.tsx
@@ -0,0 +1,39 @@
import React from "react";
import DataEditor, { DataEditorContainer, DataEditorProps, GridCellKind, GridColumn } from "@glideapps/glide-data-grid";

export default function Grid() {
const getData = React.useCallback<DataEditorProps["getCellContent"]>(
cell => ({
kind: GridCellKind.Text,
allowOverlay: true,
readonly: true,
data: `${cell[0]},${cell[1]}`,
displayData: `${cell[0]},${cell[1]}`,
}),
[]
);

const cols = React.useMemo<GridColumn[]>(
() => [
{
width: 100,
title: "A",
},
{
width: 100,
title: "B",
},
{
width: 100,
title: "C",
},
],
[]
);

return (
<DataEditorContainer width={800} height={500}>
<DataEditor getCellContent={getData} columns={cols} rows={100} />
</DataEditorContainer>
);
}
5 changes: 5 additions & 0 deletions test-projects/next-gdg/next-env.d.ts
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
6 changes: 6 additions & 0 deletions test-projects/next-gdg/next.config.js
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}

module.exports = nextConfig

0 comments on commit 52ee0fb

Please sign in to comment.