Skip to content

Commit

Permalink
Merge branch 'main' into renovate/actions-upload-artifact-digest
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Jan 24, 2025
2 parents d460c0b + 0a4e62c commit bcf0165
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 95 deletions.
4 changes: 4 additions & 0 deletions .changesets/11920.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- fix(cli): Pin TailwindCSS to v3 (#11920) by @Tobbe

Pinning TW to v3 for our `yarn rw setup ui tailwind` command until we've added
support for TW v4
2 changes: 1 addition & 1 deletion packages/api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"devDependencies": {
"@redwoodjs/framework-tools": "workspace:*",
"@types/aws-lambda": "8.10.145",
"@types/lodash": "4.17.13",
"@types/lodash": "4.17.14",
"@types/qs": "6.9.16",
"@types/split2": "4.2.3",
"@types/yargs": "17.0.33",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"devDependencies": {
"@redwoodjs/framework-tools": "workspace:*",
"@types/dotenv-defaults": "^2.0.4",
"@types/lodash": "4.17.13",
"@types/lodash": "4.17.14",
"@types/pascalcase": "1.0.3",
"@types/semver": "^7",
"@types/yargs": "17.0.33",
Expand Down
34 changes: 20 additions & 14 deletions packages/cli/src/commands/setup/ui/libraries/tailwindcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const handler = async ({ force, install }) => {
const webWorkspacePackages = [
'postcss',
'postcss-loader',
'tailwindcss',
'tailwindcss@^3.4.17',
'autoprefixer',
]

Expand All @@ -138,12 +138,18 @@ export const handler = async ({ force, install }) => {
task: async () => {
const yarnVersion = await execa('yarn', ['--version'])
const isYarnV1 = yarnVersion.stdout.trim().startsWith('1')
await execa('yarn', [
'add',
'-D',
...(isYarnV1 ? ['-W'] : []),
...projectPackages,
])
await execa(
'yarn',
[
'add',
'-D',
...(isYarnV1 ? ['-W'] : []),
...projectPackages,
],
{
cwd: rwPaths.base,
},
)
},
},
],
Expand All @@ -160,13 +166,13 @@ export const handler = async ({ force, install }) => {
{
title: `Install ${webWorkspacePackages.join(', ')}`,
task: async () => {
await execa('yarn', [
'workspace',
'web',
'add',
'-D',
...webWorkspacePackages,
])
await execa(
'yarn',
['workspace', 'web', 'add', '-D', ...webWorkspacePackages],
{
cwd: rwPaths.base,
},
)
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"devDependencies": {
"@redwoodjs/framework-tools": "workspace:*",
"@types/lodash": "4.17.13",
"@types/lodash": "4.17.14",
"publint": "0.2.12",
"tsx": "4.19.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@redwoodjs/realtime": "workspace:*",
"@types/aws-lambda": "8.10.145",
"@types/jsonwebtoken": "9.0.7",
"@types/lodash": "4.17.13",
"@types/lodash": "4.17.14",
"@types/uuid": "10.0.0",
"@whatwg-node/fetch": "0.9.21",
"jest": "29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ogimage-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"ts-toolbelt": "9.6.0",
"tsx": "4.19.2",
"typescript": "5.6.2",
"vite": "5.4.8",
"vite": "5.4.12",
"vitest": "2.0.5"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@types/node": "20.17.10",
"tsx": "4.19.2",
"typescript": "5.6.2",
"vite": "5.4.8"
"vite": "5.4.12"
},
"peerDependencies": {
"@redwoodjs/project-config": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/structure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@babel/cli": "7.25.7",
"@babel/core": "^7.22.20",
"@types/fs-extra": "11.0.4",
"@types/lodash": "4.17.13",
"@types/lodash": "4.17.14",
"@types/node": "20.17.10",
"@types/vscode": "1.96.0",
"typescript": "5.6.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"react": "19.0.0-rc-f2df5694-20240916",
"react-server-dom-webpack": "19.0.0-rc-f2df5694-20240916",
"rimraf": "6.0.1",
"vite": "5.4.8",
"vite": "5.4.12",
"vite-plugin-cjs-interop": "2.1.4",
"vite-plugin-node-polyfills": "0.22.0",
"ws": "8.18.0",
Expand Down
14 changes: 5 additions & 9 deletions tasks/test-project/codemods/models.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-env node, es6*/

const post = `model Post {
export const post = `model Post {
id Int @id @default(autoincrement())
title String
body String
Expand All @@ -9,15 +7,15 @@ const post = `model Post {
createdAt DateTime @default(now())
}`

const contact = `model Contact {
export const contact = `model Contact {
id Int @id @default(autoincrement())
name String
email String
message String
createdAt DateTime @default(now())
}`

const user = `model User {
export const user = `model User {
id Int @id @default(autoincrement())
email String @unique
hashedPassword String
Expand All @@ -29,7 +27,7 @@ const user = `model User {
posts Post[]
}`

const produce = `model Produce {
export const produce = `model Produce {
id String @id @default(cuid())
name String @unique
quantity Int
Expand All @@ -48,11 +46,9 @@ const produce = `model Produce {
stallId String
}`

const stall = `model Stall {
export const stall = `model Stall {
id String @id @default(cuid())
name String
stallNumber String @unique
produce Produce[]
}`

module.exports = { post, contact, user, produce, stall }
14 changes: 7 additions & 7 deletions tasks/test-project/rebuild-fragments-test-project-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
copyFrameworkPackages,
} from './frameworkLinking'
import { webTasks, apiTasks, fragmentsTasks } from './tui-tasks'
import { isAwaitable } from './typing'
import { isAwaitable, isTuiError } from './typing'
import type { TuiTaskDef } from './typing'
import {
getExecaOptions as utilGetExecaOptions,
Expand Down Expand Up @@ -140,13 +140,16 @@ async function tuiTask({ step, title, content, task, parent }: TuiTaskDef) {
'stdout:\n' + e.stdout + '\n\n' + 'stderr:\n' + e.stderr,
)
} else {
const message = isTuiError(e) ? e.message : ''

tui.displayError(
'Failed ' + title.toLowerCase().replace('...', ''),
e.message,
message || '',
)
}

process.exit(e.exitCode)
const exitCode = isTuiError(e) ? e.exitCode : undefined
process.exit(exitCode)
}

if (isAwaitable(promise)) {
Expand Down Expand Up @@ -197,11 +200,8 @@ async function tuiTask({ step, title, content, task, parent }: TuiTaskDef) {
/**
* Function that returns a string to show when skipping the task, or just
* true|false to indicate whether the task should be skipped or not.
*
* @param {string} startStep
* @param {string} currentStep
*/
function skipFn(startStep, currentStep) {
function skipFn(startStep: string, currentStep: string) {
const startStepNrs = startStep.split('.').map((s) => parseInt(s, 10))
const currentStepNrs = currentStep.split('.').map((s) => parseInt(s, 10))

Expand Down
14 changes: 7 additions & 7 deletions tasks/test-project/rebuild-test-project-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
copyFrameworkPackages,
} from './frameworkLinking'
import { webTasks, apiTasks } from './tui-tasks'
import { isAwaitable } from './typing'
import { isAwaitable, isTuiError } from './typing'
import type { TuiTaskDef } from './typing'
import {
getExecaOptions as utilGetExecaOptions,
Expand Down Expand Up @@ -140,13 +140,16 @@ async function tuiTask({ step, title, content, task, parent }: TuiTaskDef) {
'stdout:\n' + e.stdout + '\n\n' + 'stderr:\n' + e.stderr,
)
} else {
const message = isTuiError(e) ? e.message : ''

tui.displayError(
'Failed ' + title.toLowerCase().replace('...', ''),
e.message,
message || '',
)
}

process.exit(e.exitCode)
const exitCode = isTuiError(e) ? e.exitCode : undefined
process.exit(exitCode)
}

if (isAwaitable(promise)) {
Expand Down Expand Up @@ -197,11 +200,8 @@ async function tuiTask({ step, title, content, task, parent }: TuiTaskDef) {
/**
* Function that returns a string to show when skipping the task, or just
* true|false to indicate whether the task should be skipped or not.
*
* @param {string} startStep
* @param {string} currentStep
*/
function skipFn(startStep, currentStep) {
function skipFn(startStep: string, currentStep: string) {
const startStepNrs = startStep.split('.').map((s) => parseInt(s, 10))
const currentStepNrs = currentStep.split('.').map((s) => parseInt(s, 10))

Expand Down
1 change: 0 additions & 1 deletion tasks/test-project/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ async function apiTasks(outputPath, { verbose, linkWithLatestFwBuild }) {
await execa(
'yarn rw g dbAuth --no-webauthn --username-label=username --password-label=password',
[],
execaOptions,
)

// update directive in contacts.sdl.ts
Expand Down
Loading

0 comments on commit bcf0165

Please sign in to comment.