Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature-#7787' into feature-redw…
Browse files Browse the repository at this point in the history
  • Loading branch information
ageddesi committed Apr 10, 2023
2 parents 3205163 + a1eb336 commit cf714e6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/docs/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ A canary release is published to npm every time a PR is merged to the `main` bra
| Option | Description |
| :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--dry-run, -d` | Check for outdated packages without upgrading |
| `--tag, -t` | Choices are "canary", "rc", or a specific version (e.g. "0.19.3"). WARNING: Unstable releases in the case of "canary" and "rc", which will force upgrade packages to the most recent release of the specified tag. |
| `--tag, -t` | Choices are "rc", "canary", "latest", "next", "experimental", or a specific version (e.g. "0.19.3"). WARNING: Unstable releases in the case of "canary", "rc", "next", and "experimental". And "canary" releases include breaking changes often requiring codemods if upgrading a project. |
**Example**
Expand Down
8 changes: 3 additions & 5 deletions packages/cli/src/commands/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const builder = (yargs) => {
.option('tag', {
alias: 't',
description:
'[choices: "canary", "rc", or specific-version (see example below)] WARNING: "canary" and "rc" tags are unstable releases!',
'[choices: "latest", "rc", "next", "canary", "experimental", or a specific-version (see example below)] WARNING: "canary", "rc" and "experimental" are unstable releases! And "canary" releases include breaking changes often requiring codemods if upgrading a project.',
requiresArg: true,
type: 'string',
coerce: validateTag,
Expand Down Expand Up @@ -67,16 +67,14 @@ const SEMVER_REGEX =
/(?<=^v?|\sv?)(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*)(?:\.(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*))*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?(?=$|\s)/i
export const validateTag = (tag) => {
const isTagValid =
tag === 'rc' ||
tag === 'canary' ||
tag === 'latest' ||
['rc', 'canary', 'latest', 'next', 'experimental'].includes(tag) ||
SEMVER_REGEX.test(tag)

if (!isTagValid) {
// Stop execution
throw new Error(
c.error(
'Invalid tag supplied. Supported values: rc, canary, latest, or valid semver version\n'
"Invalid tag supplied. Supported values: 'rc', 'canary', 'latest', 'next', 'experimental', or a valid semver version\n"
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/internal/src/build/babel/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const getWebSideOverrides = (
) => {
const overrides = [
{
test: /.+Cell.(js|tsx)$/,
test: /.+Cell.(js|tsx|jsx)$/,
plugins: [require('../babelPlugins/babel-plugin-redwood-cell').default],
},
// Automatically import files in `./web/src/pages/*` in to
Expand Down
2 changes: 1 addition & 1 deletion packages/prerender/src/runPrerender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function insertChunkLoadingScript(
const chunkPath = buildManifest[`${route?.pageIdentifier}.js`]

if (!chunkPath) {
throw new Error('Could not found chunk for ' + route?.pageIdentifier)
throw new Error('Could not find chunk for ' + route?.pageIdentifier)
}

indexHtmlTree('head').prepend(
Expand Down

0 comments on commit cf714e6

Please sign in to comment.