-
Notifications
You must be signed in to change notification settings - Fork 19
migrate to typescript #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
colbyfayock
merged 18 commits into
cloudinary-community:main
from
matiasfha:migrate-to-ts
Sep 6, 2023
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0879913
translate to typescript
matiasfha 60f1683
migration step 2
matiasfha eca602e
compile and build process
matiasfha 5d3f74b
enable tests
matiasfha e0fdda0
fix configurations
matiasfha 09f1377
ignore dist folder
matiasfha be1382e
add prettier to the demo
matiasfha 892b649
set demo as workspace, run lint and format from root
matiasfha 8fd42f7
use semi-colons
matiasfha ab22ebd
use workspaces to run from root
matiasfha c7b5c05
remove dist from vc
matiasfha 05cfb49
fix build
matiasfha 292b456
clean non-required commented code
matiasfha ae9c067
use mock env vars
matiasfha e890fe9
use mock cloudinary.uploader call
matiasfha 8c11d1d
Update netlify.toml
matiasfha db3ce21
compiling post-install
colbyfayock 0cabed5
commenting local plugin
colbyfayock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| demo | ||
| node_modules | ||
This file contains hidden or 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,26 @@ | ||
| module.exports = { | ||
| env: { | ||
| browser: true, | ||
| es2022: true, | ||
| }, | ||
| parser: '@typescript-eslint/parser', | ||
| parserOptions: { | ||
| ecmaVersion: 'latest', | ||
| sourceType: 'module', | ||
| }, | ||
| plugins: ['@typescript-eslint'], | ||
| extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], | ||
| overrides: [ | ||
| { | ||
| env: { | ||
| node: true, | ||
| }, | ||
| files: ['.eslintrc.{js,cjs}'], | ||
| }, | ||
| ], | ||
| rules: { | ||
| '@typescript-eslint/no-unused-vars': 'error', | ||
| // to enforce using type for object type definitions, can be type or interface | ||
| '@typescript-eslint/consistent-type-definitions': ['error', 'type'], | ||
| }, | ||
| } |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -2,4 +2,5 @@ node_modules | |
| .env | ||
| # Local Netlify folder | ||
| .netlify | ||
| _next | ||
| _next | ||
| dist | ||
This file contains hidden or 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 @@ | ||
| demo | ||
colbyfayock marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| node_modules | ||
This file contains hidden or 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,5 @@ | ||
| { | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "arrowParens": "avoid" | ||
| } |
This file contains hidden or 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,5 @@ | ||
| process.env.CLOUDINARY_CLOUD_NAME="testcloud" | ||
| process.env.CLOUDINARY_API_KEY="791111111111111" | ||
| process.env.CLOUDINARY_API_SECRET="B1CoYVwbgSZ-Bpk_Firy8jB2480" | ||
| process.env.CLOUDINARY_API_SECRET="ThisIsTheSe-Cre_tAPIKEY_800" | ||
| process.env.NETLIFY_HOST="test.netlify.app" |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| "extends": "next/core-web-vitals" | ||
| "extends": ["next/core-web-vitals", "prettier"] | ||
| } |
This file contains hidden or 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,5 @@ | ||
| module.exports = { | ||
| semi: true, | ||
| singleQuote: true, | ||
| trailingComma: 'all', | ||
| }; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,45 @@ | ||
| import '../../styles/globals.css'; | ||
| import Image from 'next/image'; | ||
| import styles from '../../styles/Home.module.css'; | ||
|
|
||
| import images from '../../data/images.json'; | ||
|
|
||
| export default function Home() { | ||
| return ( | ||
| <div className={styles.container}> | ||
| <main className={styles.main}> | ||
| <h1 className={styles.title}>Cloudinary Netlify Plugin</h1> | ||
|
|
||
| <ul className={styles.grid}> | ||
| {images.map((image) => { | ||
| return ( | ||
| <li key={image.src}> | ||
| <img | ||
| src={image.src} | ||
| width={image.width} | ||
| height={image.height} | ||
| alt={image.title} | ||
| /> | ||
| </li> | ||
| ); | ||
| })} | ||
| </ul> | ||
|
|
||
| <ul className={styles.grid}> | ||
| {images.map((image) => { | ||
| return ( | ||
| <li key={image.src}> | ||
| <Image | ||
| src={image.src} | ||
| width={image.width} | ||
| height={image.height} | ||
| alt={image.title} | ||
| /> | ||
| </li> | ||
| ); | ||
| })} | ||
| </ul> | ||
| </main> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| export const metadata = { | ||
| title: 'Next.js', | ||
| description: 'Generated by Next.js', | ||
| } | ||
| }; | ||
|
|
||
| export default function RootLayout({ children }) { | ||
| return ( | ||
| return ( | ||
| <html lang="en"> | ||
| <body>{children}</body> | ||
| </html> | ||
| ) | ||
| ); | ||
| } |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -47,4 +47,4 @@ | |
| "src": "/images/waterfall.jpeg", | ||
| "title": "Waterfall" | ||
| } | ||
| ] | ||
| ] | ||
This file contains hidden or 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,6 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
| /// <reference types="next/navigation-types/compat/navigation" /> | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /** @type {import('next').NextConfig} */ | ||
| const nextConfig = { | ||
| reactStrictMode: true, | ||
| } | ||
| }; | ||
|
|
||
| module.exports = nextConfig | ||
| module.exports = nextConfig; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.