-
Notifications
You must be signed in to change notification settings - Fork 27.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into fix/incoming-message-cookies-type
- Loading branch information
Showing
12 changed files
with
227 additions
and
0 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,37 @@ | ||
# 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* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# Ionic | ||
public/svg |
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,21 @@ | ||
# Ionic with TypeScript Example | ||
|
||
Example app using Next.js with [Ionic](https://ionicframework.com/) and [TypeScript](https://www.typescriptlang.org/). You can learn more about Ionic in the [documentation](https://ionicframework.com/docs). | ||
|
||
## Deploy your own | ||
|
||
Deploy the example using [Vercel](https://vercel.com): | ||
|
||
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/with-ionic-typescript) | ||
|
||
## How to use | ||
|
||
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example: | ||
|
||
```bash | ||
npx create-next-app --example with-ionic-typescript with-ionic-typescript-app | ||
# or | ||
yarn create next-app --example with-ionic-typescript with-ionic-typescript-app | ||
``` | ||
|
||
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). |
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 @@ | ||
import { ReactText, HTMLAttributes } from 'react' | ||
import { JSX as LocalJSX } from '@ionic/core' | ||
import { JSX as IoniconsJSX } from 'ionicons' | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import IonicIntrinsicElements = LocalJSX.IntrinsicElements | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import IoniconsIntrinsicElements = IoniconsJSX.IntrinsicElements | ||
|
||
type ToReact<T> = { | ||
[P in keyof T]?: T[P] & | ||
Omit<HTMLAttributes<Element>, 'className'> & { | ||
class?: string | ||
key?: ReactText | ||
} | ||
} | ||
|
||
declare global { | ||
export namespace JSX { | ||
interface IntrinsicElements | ||
extends ToReact<IonicIntrinsicElements & IoniconsIntrinsicElements> { | ||
key?: 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,2 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/types/global" /> |
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,20 @@ | ||
const path = require('path') | ||
const CopyPlugin = require('copy-webpack-plugin') | ||
module.exports = { | ||
webpack: (config) => { | ||
config.plugins.push( | ||
new CopyPlugin({ | ||
patterns: [ | ||
{ | ||
from: path.join( | ||
__dirname, | ||
'node_modules/ionicons/dist/ionicons/svg' | ||
), | ||
to: path.join(__dirname, 'public/svg'), | ||
}, | ||
], | ||
}) | ||
) | ||
return config | ||
}, | ||
} |
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 @@ | ||
{ | ||
"name": "with-ionic-typescript", | ||
"version": "0.1.0", | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"export": "next export -o build" | ||
}, | ||
"dependencies": { | ||
"@ionic/core": "^5.4.1", | ||
"ionicons": "^5.2.3", | ||
"next": "latest", | ||
"react": "17.0.1", | ||
"react-dom": "17.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14.14.6", | ||
"@types/react": "^16.9.55", | ||
"copy-webpack-plugin": "6.2.1", | ||
"typescript": "^4.0.5" | ||
}, | ||
"license": "MIT" | ||
} |
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,44 @@ | ||
import React, { useEffect } from 'react' | ||
import { defineCustomElements as ionDefineCustomElements } from '@ionic/core/loader' | ||
|
||
/* Core CSS required for Ionic components to work properly */ | ||
import '@ionic/core/css/core.css' | ||
|
||
/* Basic CSS for apps built with Ionic */ | ||
import '@ionic/core/css/normalize.css' | ||
import '@ionic/core/css/structure.css' | ||
import '@ionic/core/css/typography.css' | ||
|
||
/* Optional CSS utils that can be commented out */ | ||
import '@ionic/core/css/padding.css' | ||
import '@ionic/core/css/float-elements.css' | ||
import '@ionic/core/css/text-alignment.css' | ||
import '@ionic/core/css/text-transformation.css' | ||
import '@ionic/core/css/flex-utils.css' | ||
import '@ionic/core/css/display.css' | ||
|
||
function MyApp({ Component, pageProps }) { | ||
useEffect(() => { | ||
ionDefineCustomElements(window) | ||
}) | ||
return ( | ||
<ion-app> | ||
<ion-header translucent> | ||
<ion-toolbar> | ||
<ion-title>Next.js with Ionic</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content fullscreen> | ||
<Component {...pageProps} /> | ||
</ion-content> | ||
<ion-footer> | ||
<ion-toolbar> | ||
<ion-title>Footer</ion-title> | ||
</ion-toolbar> | ||
</ion-footer> | ||
</ion-app> | ||
) | ||
} | ||
|
||
export default MyApp |
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,32 @@ | ||
import Image from 'next/image' | ||
|
||
export default function Home() { | ||
return ( | ||
<ion-grid> | ||
<ion-row> | ||
{new Array(8).fill('').map((k, i) => ( | ||
<ion-col key={i} size="3"> | ||
<ion-card> | ||
<Image | ||
src="/cat.jpg" | ||
alt="Picture of the author" | ||
width={500} | ||
height={500} | ||
/> | ||
<ion-card-header> | ||
<ion-card-subtitle>Destination</ion-card-subtitle> | ||
<ion-card-title>Madison, WI</ion-card-title> | ||
</ion-card-header> | ||
<ion-card-content> | ||
<ion-icon name="pin" slot="start"></ion-icon> | ||
Keep close to Nature's heart... and break clear away, once in | ||
awhile, and climb a mountain or spend a week in the woods. Wash | ||
your spirit clean. | ||
</ion-card-content> | ||
</ion-card> | ||
</ion-col> | ||
))} | ||
</ion-row> | ||
</ion-grid> | ||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": false, | ||
"forceConsistentCasingInFileNames": true, | ||
"noEmit": true, | ||
"esModuleInterop": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve" | ||
}, | ||
"include": ["next-env.d.ts", "ionic.d.ts", "**/*.ts", "**/*.tsx"], | ||
"exclude": ["node_modules"] | ||
} |