-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pr-firebase-fix
- Loading branch information
Showing
50 changed files
with
1,255 additions
and
531 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "0.28.1", | ||
"version": "0.28.4", | ||
"npmClient": "yarn", | ||
"useWorkspaces": true, | ||
"command": { | ||
|
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
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
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
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
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
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,23 @@ | ||
import jwt from 'jsonwebtoken' | ||
|
||
import { verifyAuth0Token } from './auth0' | ||
|
||
jest.mock('jsonwebtoken', () => ({ | ||
verify: jest.fn(), | ||
decode: jest.fn(), | ||
})) | ||
|
||
test('verify, and not decode, should be called in production', () => { | ||
const { NODE_ENV } = process.env | ||
process.env.NODE_ENV = 'production' | ||
process.env.AUTH0_DOMAIN = 'redwoodjs.com' | ||
process.env.AUTH0_AUDIENCE = 'michael bolton' | ||
|
||
// @ts-expect-error Ingore this error. | ||
verifyAuth0Token({}) | ||
|
||
expect(jwt.decode).not.toBeCalled() | ||
expect(jwt.verify).toBeCalled() | ||
|
||
process.env.NODE_ENV = NODE_ENV | ||
}) |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@redwoodjs/auth", | ||
"version": "0.28.1", | ||
"version": "0.28.4", | ||
"files": [ | ||
"dist" | ||
], | ||
|
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
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,76 @@ | ||
import path from 'path' | ||
|
||
import chalk from 'chalk' | ||
import Listr from 'listr' | ||
|
||
import { | ||
getInstalledRedwoodVersion, | ||
getPaths, | ||
saveRemoteFileToDisk, | ||
} from 'src/lib' | ||
import c from 'src/lib/colors' | ||
|
||
export const command = 'tsconfig' | ||
|
||
export const description = 'Setup tsconfig for web and api sides' | ||
|
||
export const builder = (yargs) => { | ||
yargs.option('force', { | ||
alias: 'f', | ||
default: false, | ||
description: 'Overwrite existing tsconfig.json files', | ||
type: 'boolean', | ||
}) | ||
} | ||
|
||
export const handler = async ({ force }) => { | ||
const installedRwVersion = getInstalledRedwoodVersion() | ||
const GITHUB_VERSION_TAG = installedRwVersion.match('canary') | ||
? 'main' | ||
: `v${installedRwVersion}` | ||
|
||
const CRWA_TEMPLATE_URL = `https://raw.githubusercontent.com/redwoodjs/redwood/${GITHUB_VERSION_TAG}/packages/create-redwood-app/template` | ||
|
||
const tasks = new Listr([ | ||
{ | ||
title: 'Creating tsconfig in web', | ||
task: () => { | ||
const webConfigPath = path.join(getPaths().web.base, 'tsconfig.json') | ||
|
||
const templateUrl = `${CRWA_TEMPLATE_URL}/web/tsconfig.json` | ||
|
||
return saveRemoteFileToDisk(templateUrl, webConfigPath, { | ||
overwriteExisting: force, | ||
}) | ||
}, | ||
}, | ||
{ | ||
title: 'Creating tsconfig in api', | ||
task: () => { | ||
const webConfigPath = path.join(getPaths().api.base, 'tsconfig.json') | ||
|
||
const templateUrl = `${CRWA_TEMPLATE_URL}/api/tsconfig.json` | ||
|
||
return saveRemoteFileToDisk(templateUrl, webConfigPath, { | ||
overwriteExisting: force, | ||
}) | ||
}, | ||
}, | ||
{ | ||
title: 'One more thing...', | ||
task: (_ctx, task) => { | ||
task.title = `One more thing...\n | ||
${c.green('Quick link to the docs on configuring TypeScript')} | ||
${chalk.hex('#e8e8e8')('https://redwoodjs.com/docs/typescript')} | ||
` | ||
}, | ||
}, | ||
]) | ||
|
||
try { | ||
await tasks.run() | ||
} catch (e) { | ||
console.error(c.error(e.message)) | ||
process.exit(e?.exitCode || 1) | ||
} | ||
} |
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
Oops, something went wrong.