Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configurations/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compileOnSave": false,
"compilerOptions": {
"lib": ["ES2020"],
"target": "ES2020",
"lib": ["ES2024"],
"target": "ES2024",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
"@octokit/rest": "22.0.1",
"@shopify/eslint-plugin-cli": "file:packages/eslint-plugin-cli",
"@shopify/generate-docs": "1.2.3",
"@types/node": "18.19.130",
"@types/node": "22.20.1",
"@typescript-eslint/parser": "8.56.1",
"@vitest/coverage-istanbul": "^3.2.7",
"bugsnag-build-reporter": "^2.0.0",
"commander": "^9.4.0",
"esbuild": "0.28.1",
"eslint-plugin-jsdoc": "50.8.0",
"eslint": "^9.39.5",
"eslint-plugin-jsdoc": "50.8.0",
"execa": "^7.2.0",
"fast-glob": "3.3.3",
"find-up": "^6.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-kit/src/public/node/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ describe('cli', () => {
test('exits if running an old Node version', async () => {
const launchCLI = vi.fn()
const outputMock = mockAndCaptureOutput()
const run = runCLI({moduleURL: 'test', development: false}, launchCLI, [], {}, {node: '17.9'} as any)
const run = runCLI({moduleURL: 'test', development: false}, launchCLI, [], {}, {node: '20.10'} as any)
await expect(run).rejects.toThrow()
expect(outputMock.output()).toMatchInlineSnapshot(`
"╭─ error ──────────────────────────────────────────────────────────────────────╮
│ │
│ Upgrade to a supported Node version now. │
│ │
│ Node 17 has reached end-of-life and poses security risks. When you upgrade │
│ Node 20 has reached end-of-life and poses security risks. When you upgrade │
│ to a supported version [1], you'll be able to use Shopify CLI without │
│ interruption. │
│ │
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-kit/src/public/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function exitIfOldNodeVersion(versions: NodeJS.ProcessVersions = process.v
const nodeVersion = versions.node
const nodeMajorVersion = Number(nodeVersion.split('.')[0])

const currentSupportedNodeVersion = 18
const currentSupportedNodeVersion = 22
if (nodeMajorVersion < currentSupportedNodeVersion) {
const {renderError} = await import('./ui.js')
renderError({
Expand Down
3 changes: 0 additions & 3 deletions packages/cli-kit/src/public/node/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ export abstract class FatalError extends Error {
* Those usually represent unexpected scenarios that we can't handle and that usually require some action from the developer.
*/
export class AbortError extends FatalError {
nextSteps?: TokenItem<InlineToken>[]
customSections?: AlertCustomSection[]

constructor(
message: TokenItem | OutputMessage,
tryMessage: TokenItem | OutputMessage | null = null,
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@iarna/toml": "2.2.5",
"@playwright/test": "^1.61.1",
"@shopify/toml-patch": "0.3.0",
"@types/node": "18.19.130",
"@types/node": "22.20.1",
"dotenv": "16.6.1",
"execa": "^7.2.0",
"node-pty": "^1.0.0",
Expand Down
28 changes: 0 additions & 28 deletions packages/theme/src/cli/polyfills/promiseWithResolvers.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/theme/src/cli/utilities/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('errors', () => {

beforeEach(() => {
// Use a more reliable mock that throws an error
vi.spyOn(process, 'exit').mockImplementation((code?: number): never => {
vi.spyOn(process, 'exit').mockImplementation((code?: string | number | null): never => {
throw new Error(`Process exit with code ${code}`)
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {createHostValidationHandler} from './host-validation.js'
import {uploadTheme} from '../theme-uploader.js'
import {renderTasksToStdErr} from '../theme-ui.js'
import {renderThrownError} from '../errors.js'
import {promiseWithResolvers} from '../../polyfills/promiseWithResolvers.js'

import {createApp, defineEventHandler, defineLazyEventHandler, toNodeListener, handleCors} from 'h3'
import {fetchChecksums} from '@shopify/cli-kit/node/themes/api'
Expand All @@ -23,7 +22,7 @@ export function setupDevServer(theme: Theme, ctx: DevServerContext) {
promise: backgroundJobPromise,
resolve: resolveBackgroundJob,
reject: rejectBackgroundJob,
} = promiseWithResolvers<void>()
} = Promise.withResolvers<void>()

const watcherPromise = setupInMemoryTemplateWatcher(theme, ctx)
const envSetup = ensureThemeEnvironmentSetup(theme, ctx, rejectBackgroundJob)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('pollRemoteJsonChanges', async () => {
vi.mocked(fetchChecksums).mockResolvedValue(updatedRemoteChecksums)

// Mock process.exit with a function that throws instead of actually exiting
vi.spyOn(process, 'exit').mockImplementation((code?: number): never => {
vi.spyOn(process, 'exit').mockImplementation((code?: string | number | null): never => {
throw new Error(`Process exit with code ${code}`)
})

Expand Down
Loading
Loading