Unverified Commit 382b79bc authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[sourcemaps] Consistent cursor columns (#81375)

Co-authored-by: 's avatarNiklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
parent a04a5efe
......@@ -57,7 +57,7 @@ async function getSourceFrame(
input: any,
fileName: any,
compilation: any
): Promise<{ frame: string; lineNumber: string; column: string }> {
): Promise<{ frame: string; line1: string; column1: string }> {
try {
const loc =
input.loc || input.dependencies.map((d: any) => d.loc).filter(Boolean)[0]
......@@ -83,21 +83,21 @@ async function getSourceFrame(
arguments: [],
file: fileName,
methodName: '',
lineNumber: loc.start.line,
line1: loc.start.line,
// loc is 0-based but columns in stack frames are 1-based.
column: (loc.start.column ?? 0) + 1,
column1: (loc.start.column ?? 0) + 1,
},
})
return {
frame: result?.originalCodeFrame ?? '',
lineNumber: result?.originalStackFrame?.lineNumber?.toString() ?? '',
column: result?.originalStackFrame?.column?.toString() ?? '',
line1: result?.originalStackFrame?.line1?.toString() ?? '',
column1: result?.originalStackFrame?.column1?.toString() ?? '',
}
}
} catch {}
return { frame: '', lineNumber: '', column: '' }
return { frame: '', line1: '', column1: '' }
}
function getFormattedFileName(
......@@ -141,7 +141,7 @@ export async function getNotFoundError(
}
try {
const { frame, lineNumber, column } = await getSourceFrame(
const { frame, line1, column1 } = await getSourceFrame(
input,
fileName,
compilation
......@@ -181,8 +181,8 @@ export async function getNotFoundError(
const formattedFileName = getFormattedFileName(
fileName,
module,
lineNumber,
column
line1,
column1
)
return new SimpleWebpackError(formattedFileName, message)
......
......@@ -34,16 +34,16 @@ const frame = {
file: './app/page.tsx',
methodName: 'MyComponent',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
ignored: false,
},
sourceStackFrame: {
file: './app/page.tsx',
methodName: 'MyComponent',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
},
error: false as const,
reason: null,
......
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import type { OriginalStackFrame } from '../../../shared/stack-frame'
import { HotlinkedText } from '../hot-linked-text'
......@@ -11,14 +10,14 @@ export const CallStackFrame: React.FC<{
}> = function CallStackFrame({ frame }) {
// TODO: ability to expand resolved frames
const f: StackFrame = frame.originalStackFrame ?? frame.sourceStackFrame
const f = frame.originalStackFrame ?? frame.sourceStackFrame
const hasSource = Boolean(frame.originalCodeFrame)
const open = useOpenInEditor(
hasSource
? {
file: f.file,
lineNumber: f.lineNumber,
column: f.column,
line1: f.line1 ?? 1,
column1: f.column1 ?? 1,
}
: undefined
)
......
......@@ -33,16 +33,16 @@ const frame = {
file: './app/page.tsx',
methodName: 'MyComponent',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
ignored: false,
},
sourceStackFrame: {
file: './app/page.tsx',
methodName: 'MyComponent',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
},
originalCodeFrame: 'export default function MyComponent() {',
error: false as const,
......
......@@ -17,8 +17,8 @@ const baseStackFrame = {
file: './app/page.tsx',
methodName: 'Home',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
}
export const SimpleCodeFrame: Story = {
......
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import { useMemo } from 'react'
import { HotlinkedText } from '../hot-linked-text'
import { getFrameSource } from '../../../shared/stack-frame'
import { getFrameSource, type StackFrame } from '../../../shared/stack-frame'
import { useOpenInEditor } from '../../utils/use-open-in-editor'
import { ExternalIcon } from '../../icons/external'
import { FileIcon } from '../../icons/file'
......@@ -11,7 +10,10 @@ import {
parseLineNumberFromCodeFrameLine,
} from './parse-code-frame'
export type CodeFrameProps = { stackFrame: StackFrame; codeFrame: string }
export type CodeFrameProps = {
stackFrame: StackFrame
codeFrame: string
}
export function CodeFrame({ stackFrame, codeFrame }: CodeFrameProps) {
const parsedLineStates = useMemo(() => {
......@@ -27,8 +29,8 @@ export function CodeFrame({ stackFrame, codeFrame }: CodeFrameProps) {
const open = useOpenInEditor({
file: stackFrame.file,
lineNumber: stackFrame.lineNumber,
column: stackFrame.column,
line1: stackFrame.line1 ?? 1,
column1: stackFrame.column1 ?? 1,
})
const fileExtension = stackFrame?.file?.split('.').pop()
......
......@@ -9,8 +9,8 @@ describe('parse line numbers', () => {
const input = {
stackFrame: {
file: 'app/page.tsx',
lineNumber: 2,
column: 9,
line1: 2,
column1: 9,
methodName: 'Page',
arguments: [],
ignored: false,
......@@ -61,8 +61,8 @@ describe('parse line numbers', () => {
const input = {
stackFrame: {
file: 'app/page.tsx',
lineNumber: 6,
column: 7,
line1: 6,
column1: 7,
methodName: 'Page',
arguments: [],
},
......
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import Anser, { type AnserJsonEntry } from 'next/dist/compiled/anser'
import stripAnsi from 'next/dist/compiled/strip-ansi'
import type { StackFrame } from '../../../shared/stack-frame'
// Strip leading spaces out of the code frame
export function formatCodeFrame(codeFrame: string) {
......@@ -77,19 +77,19 @@ export function parseLineNumberFromCodeFrameLine(
stackFrame: StackFrame
) {
let lineNumberToken: AnserJsonEntry | undefined
let lineNumber: string | undefined
let line1: string | undefined
// parse line number from line first 2 tokens
// e.g. ` > 1 | const foo = 'bar'` => `1`, first token is `1 |`
// e.g. ` 2 | const foo = 'bar'` => `2`. first 2 tokens are ' ' and ' 2 |'
if (line[0]?.content === '>' || line[0]?.content === ' ') {
lineNumberToken = line[1]
lineNumber = lineNumberToken?.content?.replace('|', '')?.trim()
line1 = lineNumberToken?.content?.replace('|', '')?.trim()
}
// When the line number is possibly undefined, it can be just the non-source code line
// e.g. the ^ sign can also take a line, we skip rendering line number for it
return {
lineNumber,
isErroredLine: lineNumber === stackFrame.lineNumber?.toString(),
lineNumber: line1,
isErroredLine: line1 === stackFrame.line1?.toString(),
}
}
......@@ -33,16 +33,16 @@ const frame = {
file: './app/page.tsx',
methodName: 'MyComponent',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
ignored: false,
},
sourceStackFrame: {
file: './app/page.tsx',
methodName: 'MyComponent',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
},
originalCodeFrame: 'export default function MyComponent() {',
error: false as const,
......
......@@ -11,8 +11,8 @@ type EditorLinkProps = {
export function EditorLink({ file, location }: EditorLinkProps) {
const open = useOpenInEditor({
file,
lineNumber: location?.line ?? 1,
column: location?.column ?? 0,
line1: location?.line ?? 1,
column1: location?.column ?? 1,
})
return (
......
......@@ -3,7 +3,7 @@ import * as React from 'react'
import { HotlinkedText } from '../hot-linked-text'
import { EditorLink } from './editor-link'
import { ExternalIcon } from '../../icons/external'
import { getFrameSource } from '../../../shared/stack-frame'
import { getFrameSource, type StackFrame } from '../../../shared/stack-frame'
import { useOpenInEditor } from '../../utils/use-open-in-editor'
import { FileIcon } from '../../icons/file'
......@@ -22,8 +22,8 @@ function getFile(lines: string[]) {
fileName: hasLocation ? fileName : contentFileName,
location: hasLocation
? {
line: parsedLine,
column: parsedColumn,
line1: parsedLine,
column1: parsedColumn,
}
: undefined,
}
......@@ -74,18 +74,19 @@ export const Terminal: React.FC<TerminalProps> = function Terminal({
})
}, [source])
console.log({ file })
const open = useOpenInEditor({
file: file?.fileName,
lineNumber: file?.location?.line ?? 1,
column: file?.location?.column ?? 0,
line1: file?.location?.line1 ?? 1,
column1: file?.location?.column1 ?? 1,
})
const stackFrame = {
const stackFrame: StackFrame = {
file: file?.fileName ?? null,
methodName: '',
arguments: [],
lineNumber: file?.location?.line ?? null,
column: file?.location?.column ?? null,
line1: file?.location?.line1 ?? null,
column1: file?.location?.column1 ?? null,
}
const fileExtension = stackFrame?.file?.split('.').pop()
......
......@@ -98,8 +98,8 @@ export const WithHydrationWarning: Story = {
file: 'app/page.tsx',
methodName: 'Home',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
},
},
]),
......
import type { OverlayState } from '../../shared'
import type { OverlayDispatch } from '../../shared'
import type { OverlayDispatch, OverlayState } from '../../shared'
import type { StackFrame } from '../../../shared/stack-frame'
import { useMemo, useState, useEffect } from 'react'
import {
getErrorByType,
type ReadyRuntimeError,
} from '../../utils/get-error-by-type'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import type { ComponentStackFrame } from '../../utils/parse-component-stack'
import { usePersistentCacheErrorDetection } from '../../components/errors/error-overlay-toolbar/restart-server-button'
......
......@@ -15,16 +15,16 @@ const sourceStackFrame = {
file: 'app/page.tsx',
methodName: 'Home',
arguments: [],
lineNumber: 2,
column: 9,
line1: 2,
column1: 9,
}
const originalStackFrame = {
file: 'app/page.tsx',
methodName: 'Home',
arguments: [],
lineNumber: 2,
column: 9,
line1: 2,
column1: 9,
ignored: false,
}
......@@ -33,16 +33,16 @@ const frame = {
file: './app/page.tsx',
methodName: 'MyComponent',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
ignored: false,
},
sourceStackFrame: {
file: './app/page.tsx',
methodName: 'MyComponent',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
},
originalCodeFrame: 'export default function MyComponent() {',
error: false,
......@@ -66,8 +66,8 @@ export const errors: SupportedErrorEvent[] = [
{
file: 'app/page.tsx',
component: 'Home',
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
canOpenInEditor: true,
},
],
......@@ -76,8 +76,8 @@ export const errors: SupportedErrorEvent[] = [
file: 'app/page.tsx',
methodName: 'Home',
arguments: [],
lineNumber: 10,
column: 5,
line1: 10,
column1: 5,
},
],
type: 'runtime',
......
export type ComponentStackFrame = {
canOpenInEditor: boolean
component: string
file?: string
lineNumber?: number
column?: number
file: string | null
line1: number | null
column1: number | null
}
enum LocationType {
......@@ -42,8 +42,7 @@ function parseStackFrameLocation(
/^(webpack-internal:\/\/\/|file:\/\/)(\(.*\)\/)?/,
''
)
const [, file, lineNumber, column] =
modulePath?.match(/^(.+):(\d+):(\d+)/) ?? []
const [, file, line1, column1] = modulePath?.match(/^(.+):(\d+):(\d+)/) ?? []
switch (locationType) {
case LocationType.FILE:
......@@ -51,8 +50,8 @@ function parseStackFrameLocation(
return {
canOpenInEditor: true,
file,
lineNumber: lineNumber ? Number(lineNumber) : undefined,
column: column ? Number(column) : undefined,
line1: line1 ? Number(line1) : null,
column1: column1 ? Number(column1) : null,
}
// When the location is a URL we only show the file
// TODO: Resolve http(s) URLs through sourcemaps
......@@ -62,6 +61,9 @@ function parseStackFrameLocation(
default: {
return {
canOpenInEditor: false,
file: null,
line1: null,
column1: null,
}
}
}
......@@ -83,6 +85,9 @@ export function parseComponentStack(
componentStackFrames.push({
canOpenInEditor: false,
component,
file: null,
line1: null,
column1: null,
})
continue
}
......
......@@ -2,20 +2,20 @@ import { useCallback } from 'react'
export function useOpenInEditor({
file,
lineNumber,
column,
line1,
column1,
}: {
file?: string | null
lineNumber?: number | null
column?: number | null
line1?: number | null
column1?: number | null
} = {}) {
const openInEditor = useCallback(() => {
if (file == null || lineNumber == null || column == null) return
if (file == null || line1 == null || column1 == null) return
const params = new URLSearchParams()
params.append('file', file)
params.append('lineNumber', String(lineNumber))
params.append('column', String(column))
params.append('line1', String(line1))
params.append('column1', String(column1))
self
.fetch(
......@@ -27,12 +27,12 @@ export function useOpenInEditor({
() => {},
(cause) => {
console.error(
`Failed to open file "${file} (${lineNumber}:${column})" in your editor. Cause:`,
`Failed to open file "${file} (${line1}:${column1})" in your editor. Cause:`,
cause
)
}
)
}, [file, lineNumber, column])
}, [file, line1, column1])
return openInEditor
}
......@@ -144,8 +144,8 @@ const WINDOWS_FILE_NAME_ACCESS_LIST =
function getArgumentsForLineNumber(
editor: string,
fileName: string,
lineNumber: number,
colNumber: number
line1: number,
column1: number
): string[] {
const editorBasename = path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '')
switch (editorBasename) {
......@@ -155,30 +155,30 @@ function getArgumentsForLineNumber(
case 'subl':
case 'sublime':
case 'sublime_text': {
return [fileName + ':' + lineNumber + ':' + colNumber]
return [fileName + ':' + line1 + ':' + column1]
}
case 'wstorm':
case 'charm': {
return [fileName + ':' + lineNumber]
return [fileName + ':' + line1]
}
case 'notepad++': {
return ['-n' + lineNumber, '-c' + colNumber, fileName]
return ['-n' + line1, '-c' + column1, fileName]
}
case 'vim':
case 'nvim':
case 'mvim':
case 'joe':
case 'gvim': {
return ['+' + lineNumber, fileName]
return ['+' + line1, fileName]
}
case 'emacs':
case 'emacsclient': {
return ['+' + lineNumber + ':' + colNumber, fileName]
return ['+' + line1 + ':' + column1, fileName]
}
case 'rmate':
case 'mate':
case 'mine': {
return ['--line', lineNumber.toString(), fileName]
return ['--line', line1.toString(), fileName]
}
case 'code':
case 'Code':
......@@ -187,7 +187,7 @@ function getArgumentsForLineNumber(
case 'Code - Insiders':
case 'vscodium':
case 'VSCodium': {
return ['-g', fileName + ':' + lineNumber + ':' + colNumber]
return ['-g', fileName + ':' + line1 + ':' + column1]
}
case 'appcode':
case 'clion':
......@@ -206,7 +206,7 @@ function getArgumentsForLineNumber(
case 'goland64':
case 'rider':
case 'rider64': {
return ['--line', lineNumber.toString(), fileName]
return ['--line', line1.toString(), fileName]
}
default: {
// For all others, drop the lineNumber until we have
......@@ -315,11 +315,7 @@ export function escapeApplescriptStringFragment(input: string): string {
return input.replaceAll(/[\\"]/g, (original) => `\\${original}`)
}
export function launchEditor(
fileName: string,
lineNumber: number,
colNumber: number
) {
export function launchEditor(fileName: string, line1: number, column1: number) {
if (!fs.existsSync(fileName)) {
return
}
......@@ -327,14 +323,14 @@ export function launchEditor(
// Sanitize lineNumber to prevent malicious use on win32
// via: https://github.com/nodejs/node/blob/c3bb4b1aa5e907d489619fb43d233c3336bfc03d/lib/child_process.js#L333
// and it should be a positive integer
if (!(Number.isInteger(lineNumber) && lineNumber > 0)) {
if (!(Number.isInteger(line1) && line1 > 0)) {
return
}
// colNumber is optional, but should be a positive integer too
// default is 1
if (!(Number.isInteger(colNumber) && colNumber > 0)) {
colNumber = 1
if (!(Number.isInteger(column1) && column1 > 0)) {
column1 = 1
}
let [editor, ...args] = guessEditor()
......@@ -385,9 +381,9 @@ export function launchEditor(
return
}
if (lineNumber) {
if (line1) {
args = args.concat(
getArgumentsForLineNumber(editor, fileName, lineNumber, colNumber)
getArgumentsForLineNumber(editor, fileName, line1, column1)
)
} else {
args.push(fileName)
......@@ -433,8 +429,8 @@ export function launchEditor(
// Open the file in editor if exists, otherwise return an error
export async function openFileInEditor(
filePath: string,
line: number,
col: number
line1: number,
column1: number
) {
const result = {
found: false,
......@@ -446,7 +442,7 @@ export async function openFileInEditor(
)
if (existed) {
try {
launchEditor(filePath, line, col)
launchEditor(filePath, line1, column1)
result.found = true
} catch (err) {
result.error = err as Error
......
import type { StackFrame } from 'stacktrace-parser'
import { codeFrameColumns } from 'next/dist/compiled/babel/code-frame'
import isInternal from '../../shared/lib/is-internal'
import type { StackFrame } from '../../server/lib/parse-stack'
import { ignoreListAnonymousStackFramesIfSandwiched as ignoreListAnonymousStackFramesIfSandwichedGeneric } from '../../server/lib/source-maps'
export type { StackFrame }
export interface IgnorableStackFrame extends StackFrame {
ignored: boolean
}
export interface OriginalStackFramesRequest {
frames: StackFrame[]
isServer: boolean
......@@ -58,7 +64,7 @@ export function ignoreListAnonymousStackFramesIfSandwiched(
* @note It ignores Next.js/React internals, as these can often be huge bundled files.
*/
export function getOriginalCodeFrame(
frame: StackFrame,
frame: IgnorableStackFrame,
source: string | null,
colors: boolean = process.stdout.isTTY
): string | null {
......@@ -71,9 +77,9 @@ export function getOriginalCodeFrame(
{
start: {
// 1-based, but -1 means start line without highlighting
line: frame.lineNumber ?? -1,
line: frame.line1 ?? -1,
// 1-based, but 0 means whole line without column highlighting
column: frame.column ?? 0,
column: frame.column1 ?? 0,
},
},
{ forceColor: colors }
......
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import type {
OriginalStackFrameResponse,
OriginalStackFrameResponseResult,
OriginalStackFramesRequest,
StackFrame,
} from '../server/shared'
import {
isWebpackInternalResource,
formatFrameSourceFile,
} from './webpack-module-path'
export type { StackFrame }
export interface ResolvedOriginalStackFrame extends OriginalStackFrameResponse {
error: false
reason: null
......@@ -157,14 +159,14 @@ export function getFrameSource(frame: StackFrame): string {
}
}
if (!isWebpackInternalResource(frame.file) && frame.lineNumber != null) {
if (!isWebpackInternalResource(frame.file) && frame.line1 != null) {
// We don't need line and column numbers for anonymous sources because
// there's no entrypoint for the location anyway.
if (str && frame.file !== '<anonymous>') {
if (frame.column != null) {
str += ` (${frame.lineNumber}:${frame.column})`
if (frame.column1 != null) {
str += ` (${frame.line1}:${frame.column1})`
} else {
str += ` (${frame.lineNumber})`
str += ` (${frame.line1})`
}
}
}
......
import type { StackFrame } from 'stacktrace-parser'
import { getOriginalStackFrames as getOriginalStackFramesWebpack } from '../middleware-webpack'
import { getOriginalStackFrames as getOriginalStackFramesTurbopack } from '../middleware-turbopack'
import type { Project } from '../../../build/swc/types'
import { dim } from '../../../lib/picocolors'
import { parseStack } from '../../lib/parse-stack'
import { parseStack, type StackFrame } from '../../lib/parse-stack'
import path from 'path'
import { LRUCache } from '../../lib/lru-cache'
......@@ -244,8 +243,8 @@ export async function getSourceMappedStackFrames(
function formatStackFrame(frame: StackFrame): string {
const functionName = frame.methodName || '<anonymous>'
const location =
frame.file && frame.lineNumber
? `${frame.file}:${frame.lineNumber}${frame.column ? `:${frame.column}` : ''}`
frame.file && frame.line1
? `${frame.file}:${frame.line1}${frame.column1 ? `:${frame.column1}` : ''}`
: frame.file || '<unknown>'
return ` at ${functionName} (${location})`
......
......@@ -2,14 +2,15 @@ import type { IncomingMessage, ServerResponse } from 'http'
import {
getOriginalCodeFrame,
ignoreListAnonymousStackFramesIfSandwiched,
type IgnorableStackFrame,
type OriginalStackFrameResponse,
type OriginalStackFramesRequest,
type OriginalStackFramesResponse,
type StackFrame,
} from '../../next-devtools/server/shared'
import { middlewareResponse } from '../../next-devtools/server/middleware-response'
import path from 'path'
import { openFileInEditor } from '../../next-devtools/server/launch-editor'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import {
SourceMapConsumer,
type NullableMappedPosition,
......@@ -34,9 +35,10 @@ function shouldIgnorePath(modulePath: string): boolean {
)
}
type IgnorableStackFrame = StackFrame & { ignored: boolean }
const currentSourcesByFile: Map<string, Promise<string | null>> = new Map()
/**
* @returns 1-based lines and 1-based columns
*/
async function batchedTraceSource(
project: Project,
frame: TurbopackStackFrame
......@@ -54,8 +56,8 @@ async function batchedTraceSource(
return {
frame: {
file,
lineNumber: frame.line ?? 0,
column: frame.column ?? 0,
line1: frame.line ?? null,
column1: frame.column ?? null,
methodName: frame.methodName ?? '<unknown>',
ignored: true,
arguments: [],
......@@ -71,8 +73,8 @@ async function batchedTraceSource(
return {
frame: {
file,
lineNumber: frame.line ?? 0,
column: frame.column ?? 0,
line1: frame.line ?? null,
column1: frame.column ?? null,
methodName: frame.methodName ?? '<unknown>',
ignored: shouldIgnorePath(file),
arguments: [],
......@@ -104,10 +106,10 @@ async function batchedTraceSource(
}
// TODO: get ignoredList from turbopack source map
const ignorableFrame = {
const ignorableFrame: IgnorableStackFrame = {
file: sourceFrame.file,
lineNumber: sourceFrame.line ?? 0,
column: sourceFrame.column ?? 0,
line1: sourceFrame.line ?? null,
column1: sourceFrame.column ?? null,
methodName:
// We ignore the sourcemapped name since it won't be the correct name.
// The callsite will point to the column of the variable name instead of the
......@@ -148,10 +150,10 @@ function createStackFrames(
return {
file,
methodName: frame.methodName ?? '<unknown>',
line: frame.lineNumber ?? 0,
column: frame.column ?? 0,
line: frame.line1 ?? undefined,
column: frame.column1 ?? undefined,
isServer,
} satisfies TurbopackStackFrame
}
})
.filter((f): f is TurbopackStackFrame => f !== undefined)
}
......@@ -168,14 +170,14 @@ function createStackFrame(
return {
file,
methodName: searchParams.get('methodName') ?? '<unknown>',
line: parseInt(searchParams.get('lineNumber') ?? '0', 10) || 0,
column: parseInt(searchParams.get('column') ?? '0', 10) || 0,
line: parseInt(searchParams.get('line1') ?? '0', 10) || undefined,
column: parseInt(searchParams.get('column1') ?? '0', 10) || undefined,
isServer: searchParams.get('isServer') === 'true',
} satisfies TurbopackStackFrame
}
}
/**
* @returns 1-based lines and 0-based columns
* @returns 1-based lines and 1-based columns
*/
async function nativeTraceSource(
frame: TurbopackStackFrame
......@@ -230,8 +232,8 @@ async function nativeTraceSource(
if (traced !== null) {
const { originalPosition, sourceContent } = traced
const applicableSourceMap = findApplicableSourceMapPayload(
frame.line ?? 0,
frame.column ?? 0,
(frame.line ?? 1) - 1,
(frame.column ?? 1) - 1,
sourceMapPayload
)
......@@ -263,9 +265,10 @@ async function nativeTraceSource(
frame.methodName
?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')
?.replace('__webpack_exports__.', '') || '<unknown>',
column: (originalPosition.column ?? 0) + 1,
file: originalPosition.source,
lineNumber: originalPosition.line ?? 0,
line1: originalPosition.line,
column1:
originalPosition.column === null ? null : originalPosition.column + 1,
// TODO: c&p from async createOriginalStackFrame but why not frame.arguments?
arguments: [],
ignored,
......@@ -309,10 +312,10 @@ async function createOriginalStackFrame(
return {
originalStackFrame: {
arguments: traced.frame.arguments,
column: traced.frame.column,
file: normalizedStackFrameLocation,
line1: traced.frame.line1,
column1: traced.frame.column1,
ignored: traced.frame.ignored,
lineNumber: traced.frame.lineNumber,
methodName: traced.frame.methodName,
},
originalCodeFrame: getOriginalCodeFrame(traced.frame, traced.source),
......
......@@ -2,7 +2,6 @@ import { findSourceMap, type SourceMap } from 'module'
import path from 'path'
import { fileURLToPath, pathToFileURL } from 'url'
import { SourceMapConsumer } from 'next/dist/compiled/source-map08'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import { getSourceMapFromFile } from './get-source-map-from-file'
import {
devirtualizeReactServerURL,
......@@ -15,6 +14,8 @@ import { openFileInEditor } from '../../next-devtools/server/launch-editor'
import {
getOriginalCodeFrame,
ignoreListAnonymousStackFramesIfSandwiched,
type StackFrame,
type IgnorableStackFrame,
type OriginalStackFrameResponse,
type OriginalStackFramesRequest,
type OriginalStackFramesResponse,
......@@ -42,10 +43,6 @@ function shouldIgnoreSource(sourceURL: string): boolean {
type IgnoredSources = Array<{ url: string; ignored: boolean }>
export interface IgnorableStackFrame extends StackFrame {
ignored: boolean
}
type SourceAttributes = {
sourcePosition: NullableMappedPosition
sourceContent: string | null
......@@ -92,7 +89,7 @@ function getSourcePath(source: string) {
*/
async function findOriginalSourcePositionAndContent(
sourceMap: ModernSourceMapPayload,
position: { lineNumber: number | null; column: number | null }
position: { line1: number | null; column1: number | null }
): Promise<SourceAttributes | null> {
let consumer: SourceMapConsumer
try {
......@@ -109,9 +106,9 @@ async function findOriginalSourcePositionAndContent(
try {
const sourcePosition = consumer.originalPositionFor({
line: position.lineNumber ?? 1,
line: position.line1 ?? 1,
// 0-based columns out requires 0-based columns in.
column: (position.column ?? 1) - 1,
column: (position.column1 ?? 1) - 1,
})
if (!sourcePosition.source) {
......@@ -241,8 +238,8 @@ export async function createOriginalStackFrame({
const traced: IgnorableStackFrame = {
file: resolvedFilePath,
lineNumber: sourcePosition.line,
column: (sourcePosition.column ?? 0) + 1,
line1: sourcePosition.line,
column1: sourcePosition.column === null ? null : sourcePosition.column + 1,
methodName:
// We ignore the sourcemapped name since it won't be the correct name.
// The callsite will point to the column of the variable name instead of the
......@@ -290,8 +287,8 @@ async function getSourceMapFromCompilation(
async function getSource(
frame: {
file: string | null
lineNumber: number | null
column: number | null
line1: number | null
column1: number | null
},
options: {
getCompilations: () => webpack.Compilation[]
......@@ -317,8 +314,8 @@ async function getSource(
return {
type: 'file',
sourceMap: findApplicableSourceMapPayload(
frame.lineNumber ?? 0,
frame.column ?? 0,
(frame.line1 ?? 1) - 1,
(frame.column1 ?? 1) - 1,
sourceMapPayload
)!,
......@@ -504,8 +501,8 @@ async function getOriginalStackFrame({
// This stack frame is used for the one that couldn't locate the source or source mapped frame
const defaultStackFrame: IgnorableStackFrame = {
file: defaultNormalizedStackFrameLocation,
lineNumber: frame.lineNumber,
column: frame.column ?? 1,
line1: frame.line1,
column1: frame.column1,
methodName: frame.methodName,
ignored: shouldIgnoreSource(filename),
arguments: [],
......@@ -578,11 +575,7 @@ export function getOverlayMiddleware(options: {
isServer,
isEdgeServer,
isAppDirectory,
frames: frames.map((frame) => ({
...frame,
lineNumber: frame.lineNumber ?? 0,
column: frame.column ?? 0,
})),
frames,
clientStats,
serverStats,
edgeServerStats,
......@@ -596,8 +589,8 @@ export function getOverlayMiddleware(options: {
const frame = {
file: searchParams.get('file') as string,
methodName: searchParams.get('methodName') as string,
lineNumber: parseInt(searchParams.get('lineNumber') ?? '0', 10) || 0,
column: parseInt(searchParams.get('column') ?? '0', 10) || 0,
line1: parseInt(searchParams.get('line1') ?? '1', 10) || 1,
column1: parseInt(searchParams.get('column1') ?? '1', 10) || 1,
arguments: searchParams.getAll('arguments').filter(Boolean),
} satisfies StackFrame
......@@ -622,8 +615,8 @@ export function getOverlayMiddleware(options: {
)
openEditorResult = await openFileInEditor(
filePath,
frame.lineNumber,
frame.column ?? 1
frame.line1,
frame.column1 ?? 1
)
}
if (openEditorResult.error) {
......@@ -674,8 +667,8 @@ export function getSourceMapMiddleware(options: {
{
file: filename,
// Webpack doesn't use Index Source Maps
lineNumber: null,
column: null,
line1: null,
column1: null,
},
{
getCompilations: () => {
......
import { parse } from 'next/dist/compiled/stacktrace-parser'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
const regexNextStatic = /\/_next(\/static\/.+)/
export interface StackFrame {
file: string | null
methodName: string
arguments: string[]
/** 1-based */
line1: number | null
/** 1-based */
column1: number | null
}
export function parseStack(
stack: string,
distDir = process.env.__NEXT_DIST_DIR
......@@ -40,6 +49,12 @@ export function parseStack(
}
}
} catch {}
return frame
return {
file: frame.file,
line1: frame.lineNumber,
column1: frame.column,
methodName: frame.methodName,
arguments: frame.arguments,
}
})
}
......@@ -58,6 +58,8 @@ export function sourceMapIgnoreListsEverything(
/**
* Finds the sourcemap payload applicable to a given frame.
* Equal to the input unless an Index Source Map is used.
* @param line0 - The line number of the frame, 0-based.
* @param column0 - The column number of the frame, 0-based.
*/
export function findApplicableSourceMapPayload(
line0: number,
......
......@@ -3,14 +3,13 @@ import * as path from 'path'
import * as url from 'url'
import type * as util from 'util'
import { SourceMapConsumer as SyncSourceMapConsumer } from 'next/dist/compiled/source-map'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import {
type ModernSourceMapPayload,
findApplicableSourceMapPayload,
ignoreListAnonymousStackFramesIfSandwiched as ignoreListAnonymousStackFramesIfSandwichedGeneric,
sourceMapIgnoreListsEverything,
} from './lib/source-maps'
import { parseStack } from './lib/parse-stack'
import { parseStack, type StackFrame } from './lib/parse-stack'
import { getOriginalCodeFrame } from '../next-devtools/server/shared'
import { workUnitAsyncStorage } from './app-render/work-unit-async-storage.external'
import { dim } from '../lib/picocolors'
......@@ -30,7 +29,7 @@ export function setBundlerFindSourceMapImplementation(
bundlerFindSourceMapPayload = findSourceMapImplementation
}
interface IgnoreableStackFrame extends StackFrame {
interface IgnorableStackFrame extends StackFrame {
ignored: boolean
}
......@@ -39,31 +38,36 @@ type SourceMapCache = Map<
null | { map: SyncSourceMapConsumer; payload: ModernSourceMapPayload }
>
function frameToString(frame: StackFrame): string {
let sourceLocation = frame.lineNumber !== null ? `:${frame.lineNumber}` : ''
if (frame.column !== null && sourceLocation !== '') {
sourceLocation += `:${frame.column}`
function frameToString(
methodName: string | null,
sourceURL: string | null,
line1: number | null,
column1: number | null
): string {
let sourceLocation = line1 !== null ? `:${line1}` : ''
if (column1 !== null && sourceLocation !== '') {
sourceLocation += `:${column1}`
}
let fileLocation: string | null
if (
frame.file !== null &&
frame.file.startsWith('file://') &&
URL.canParse(frame.file)
sourceURL !== null &&
sourceURL.startsWith('file://') &&
URL.canParse(sourceURL)
) {
// If not relative to CWD, the path is ambiguous to IDEs and clicking will prompt to select the file first.
// In a multi-app repo, this leads to potentially larger file names but will make clicking snappy.
// There's no tradeoff for the cases where `dir` in `next dev [dir]` is omitted
// since relative to cwd is both the shortest and snappiest.
fileLocation = path.relative(process.cwd(), url.fileURLToPath(frame.file))
} else if (frame.file !== null && frame.file.startsWith('/')) {
fileLocation = path.relative(process.cwd(), frame.file)
fileLocation = path.relative(process.cwd(), url.fileURLToPath(sourceURL))
} else if (sourceURL !== null && sourceURL.startsWith('/')) {
fileLocation = path.relative(process.cwd(), sourceURL)
} else {
fileLocation = frame.file
fileLocation = sourceURL
}
return frame.methodName
? ` at ${frame.methodName} (${fileLocation}${sourceLocation})`
return methodName
? ` at ${methodName} (${fileLocation}${sourceLocation})`
: ` at ${fileLocation}${sourceLocation}`
}
......@@ -100,7 +104,7 @@ interface SourcemappableStackFrame extends StackFrame {
}
interface SourceMappedFrame {
stack: IgnoreableStackFrame
stack: IgnorableStackFrame
// DEV only
code: string | null
}
......@@ -110,11 +114,11 @@ function createUnsourcemappedFrame(
): SourceMappedFrame {
return {
stack: {
arguments: frame.arguments,
column: frame.column,
file: frame.file,
lineNumber: frame.lineNumber,
line1: frame.line1,
column1: frame.column1,
methodName: frame.methodName,
arguments: frame.arguments,
ignored: shouldIgnoreListGeneratedFrame(frame.file),
},
code: null,
......@@ -123,7 +127,7 @@ function createUnsourcemappedFrame(
function ignoreListAnonymousStackFramesIfSandwiched(
sourceMappedFrames: Array<{
stack: IgnoreableStackFrame
stack: IgnorableStackFrame
code: string | null
}>
) {
......@@ -148,7 +152,7 @@ function getSourcemappedFrameIfPossible(
sourceMapCache: SourceMapCache,
inspectOptions: util.InspectOptions
): {
stack: IgnoreableStackFrame
stack: IgnorableStackFrame
code: string | null
} {
const sourceMapCacheEntry = sourceMapCache.get(frame.file)
......@@ -222,13 +226,13 @@ function getSourcemappedFrameIfPossible(
}
const sourcePosition = sourceMapConsumer.originalPositionFor({
column: frame.column ?? 0,
line: frame.lineNumber ?? 1,
column: (frame.column1 ?? 1) - 1,
line: frame.line1 ?? 1,
})
const applicableSourceMap = findApplicableSourceMapPayload(
frame.lineNumber ?? 0,
frame.column ?? 0,
(frame.line1 ?? 1) - 1,
(frame.column1 ?? 1) - 1,
sourceMapPayload
)
let ignored =
......@@ -238,9 +242,9 @@ function getSourcemappedFrameIfPossible(
return {
stack: {
arguments: frame.arguments,
column: frame.column,
file: frame.file,
lineNumber: frame.lineNumber,
line1: frame.line1,
column1: frame.column1,
methodName: frame.methodName,
ignored: ignored || shouldIgnoreListGeneratedFrame(frame.file),
},
......@@ -267,7 +271,7 @@ function getSourcemappedFrameIfPossible(
ignored = applicableSourceMap.ignoreList?.includes(sourceIndex) ?? false
}
const originalFrame: IgnoreableStackFrame = {
const originalFrame: IgnorableStackFrame = {
// We ignore the sourcemapped name since it won't be the correct name.
// The callsite will point to the column of the variable name instead of the
// name of the enclosing function.
......@@ -275,9 +279,9 @@ function getSourcemappedFrameIfPossible(
methodName: frame.methodName
?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')
?.replace('__webpack_exports__.', ''),
column: sourcePosition.column,
file: sourcePosition.source,
lineNumber: sourcePosition.line,
line1: sourcePosition.line,
column1: sourcePosition.column + 1,
// TODO: c&p from async createOriginalStackFrame but why not frame.arguments?
arguments: [],
ignored,
......@@ -343,7 +347,7 @@ function parseAndSourceMap(
const sourceMapCache: SourceMapCache = new Map()
const sourceMappedFrames: Array<{
stack: IgnoreableStackFrame
stack: IgnorableStackFrame
code: string | null
}> = []
let sourceFrame: null | string = null
......@@ -352,11 +356,11 @@ function parseAndSourceMap(
sourceMappedFrames.push({
code: null,
stack: {
arguments: frame.arguments,
column: frame.column,
file: frame.file,
lineNumber: frame.lineNumber,
line1: frame.line1,
column1: frame.column1,
methodName: frame.methodName,
arguments: frame.arguments,
ignored: false,
},
})
......@@ -390,9 +394,25 @@ function parseAndSourceMap(
const frame = sourceMappedFrames[i]
if (!frame.stack.ignored) {
sourceMappedStack += '\n' + frameToString(frame.stack)
sourceMappedStack +=
'\n' +
frameToString(
frame.stack.methodName,
frame.stack.file,
frame.stack.line1,
frame.stack.column1
)
} else if (showIgnoreListed) {
sourceMappedStack += '\n' + dim(frameToString(frame.stack))
sourceMappedStack +=
'\n' +
dim(
frameToString(
frame.stack.methodName,
frame.stack.file,
frame.stack.line1,
frame.stack.column1
)
)
}
}
......
......@@ -1159,41 +1159,25 @@ describe('ReactRefreshLogBox app', () => {
)
const { browser } = sandbox
if (isTurbopack) {
// TODO(veil): investigate the column number is off by 1 between turbo and webpack
await expect(browser).toDisplayRedbox(`
{
"description": "This is an error from an anonymous function",
"environmentLabel": "Server",
"label": "Runtime Error",
"source": "app/page.js (4:13) @ <anonymous>
> 4 | throw new Error("This is an error from an anonymous function");
| ^",
"stack": [
"<anonymous> app/page.js (4:13)",
"Page app/page.js (5:6)",
],
}
`)
} else {
await expect(browser).toDisplayRedbox(`
{
"description": "This is an error from an anonymous function",
"environmentLabel": "Server",
"label": "Runtime Error",
"source": "app/page.js (4:13) @ eval
> 4 | throw new Error("This is an error from an anonymous function");
| ^",
"stack": [
"eval app/page.js (4:13)",
"Page app/page.js (5:5)",
],
}
`)
}
// TODO(veil): Turbopack uses correct name
// TODO(veil): Column of 2nd frame should be 7
await expect(browser).toDisplayRedbox(`
{
"description": "This is an error from an anonymous function",
"environmentLabel": "Server",
"label": "Runtime Error",
"source": "app/page.js (4:13) @ ${isTurbopack ? '<anonymous>' : 'eval'}
> 4 | throw new Error("This is an error from an anonymous function");
| ^",
"stack": [
"${isTurbopack ? '<anonymous>' : 'eval'} app/page.js (4:13)",
"Page app/page.js (5:${isTurbopack ? '6' : '5'})",
],
}
`)
})
test('should hide unrelated frames in stack trace with nodejs internal calls', async () => {
it('should hide unrelated frames in stack trace with nodejs internal calls', async () => {
await using sandbox = await createSandbox(
next,
new Map([
......@@ -1209,35 +1193,19 @@ describe('ReactRefreshLogBox app', () => {
)
const { browser } = sandbox
if (isTurbopack) {
await expect(browser).toDisplayRedbox(`
{
"description": "Invalid URL",
"environmentLabel": "Server",
"label": "Runtime TypeError",
"source": "app/page.js (2:3) @ Page
> 2 | new URL("/", "invalid");
| ^",
"stack": [
"Page app/page.js (2:3)",
],
}
`)
} else {
await expect(browser).toDisplayRedbox(`
{
"description": "Invalid URL",
"environmentLabel": "Server",
"label": "Runtime TypeError",
"source": "app/page.js (2:3) @ Page
> 2 | new URL("/", "invalid");
| ^",
"stack": [
"Page app/page.js (2:3)",
],
}
`)
}
await expect(browser).toDisplayRedbox(`
{
"description": "Invalid URL",
"environmentLabel": "Server",
"label": "Runtime TypeError",
"source": "app/page.js (2:3) @ Page
> 2 | new URL("/", "invalid");
| ^",
"stack": [
"Page app/page.js (2:3)",
],
}
`)
})
test('Server component errors should open up in fullscreen', async () => {
......
......@@ -3,7 +3,7 @@ import { outdent } from 'outdent'
import { FileRef, nextTestSetup } from 'e2e-utils'
describe('Error overlay - RSC runtime errors', () => {
const { isTurbopack, next } = nextTestSetup({
const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'rsc-runtime-errors')),
})
......@@ -51,36 +51,19 @@ describe('Error overlay - RSC runtime errors', () => {
const browser = await next.browser('/client')
// TODO(veil): Inconsistent cursor position
if (isTurbopack) {
await expect(browser).toDisplayRedbox(`
{
"description": "\`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context",
"environmentLabel": null,
"label": "Runtime Error",
"source": "app/client/page.js (4:15) @ Page
> 4 | callServerApi()
| ^",
"stack": [
"Page app/client/page.js (4:15)",
],
}
`)
} else {
await expect(browser).toDisplayRedbox(`
{
"description": "\`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context",
"environmentLabel": null,
"label": "Runtime Error",
"source": "app/client/page.js (4:16) @ Page
> 4 | callServerApi()
| ^",
"stack": [
"Page app/client/page.js (4:16)",
],
}
`)
}
await expect(browser).toDisplayRedbox(`
{
"description": "\`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context",
"environmentLabel": null,
"label": "Runtime Error",
"source": "app/client/page.js (4:16) @ Page
> 4 | callServerApi()
| ^",
"stack": [
"Page app/client/page.js (4:16)",
],
}
`)
})
it('should show source code for jsx errors from server component', async () => {
......
......@@ -96,9 +96,9 @@ describe('Dynamic IO Dev Errors', () => {
`\nError: Route "/no-accessed-data": ` +
`A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. ` +
`See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense` +
'\n at Page (<FIXME-file-protocol>/app/no-accessed-data/page.js:1:30)' +
'\n at Page (<FIXME-file-protocol>/app/no-accessed-data/page.js:1:31)' +
'\n> 1 | export default async function Page() {' +
'\n | ^' +
'\n | ^' +
'\n 2 | await new Promise((r) => setTimeout(r, 200))' +
'\n 3 | return <p>Page</p>' +
'\n 4 | }'
......@@ -108,9 +108,9 @@ describe('Dynamic IO Dev Errors', () => {
`\nError: Route "/no-accessed-data": ` +
`A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. ` +
`See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense` +
'\n at Page (app/no-accessed-data/page.js:1:30)' +
'\n at Page (app/no-accessed-data/page.js:1:31)' +
'\n> 1 | export default async function Page() {' +
'\n | ^' +
'\n | ^' +
'\n 2 | await new Promise((r) => setTimeout(r, 200))' +
'\n 3 | return <p>Page</p>' +
'\n 4 | }'
......
......@@ -54,7 +54,7 @@ describe('error-ignored-frames', () => {
if (isTurbopack) {
expect(defaultStack).toMatchInlineSnapshot(`
"at <unknown> (app/interleaved/page.tsx (7:11))
at Page (app/interleaved/page.tsx (6:35))"
at Page (app/interleaved/page.tsx (6:36))"
`)
} else {
expect(defaultStack).toMatchInlineSnapshot(`
......
import { nextTestSetup } from 'e2e-utils'
describe('server-navigation-error', () => {
const { isTurbopack, next } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
})
......@@ -9,69 +9,37 @@ describe('server-navigation-error', () => {
it('should error on navigation API redirect', async () => {
const browser = await next.browser('/pages/redirect')
if (isTurbopack) {
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/pages/redirect.tsx (4:11) @ Page
> 4 | redirect('/')
| ^",
"stack": [
"Page pages/pages/redirect.tsx (4:11)",
],
}
`)
} else {
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/pages/redirect.tsx (4:11) @ Page
> 4 | redirect('/')
| ^",
"stack": [
"Page pages/pages/redirect.tsx (4:11)",
],
}
`)
}
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/pages/redirect.tsx (4:11) @ Page
> 4 | redirect('/')
| ^",
"stack": [
"Page pages/pages/redirect.tsx (4:11)",
],
}
`)
})
it('should error on navigation API notFound', async () => {
const browser = await next.browser('/pages/not-found')
if (isTurbopack) {
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/pages/not-found.tsx (4:11) @ Page
> 4 | notFound()
| ^",
"stack": [
"Page pages/pages/not-found.tsx (4:11)",
],
}
`)
} else {
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/pages/not-found.tsx (4:11) @ Page
> 4 | notFound()
| ^",
"stack": [
"Page pages/pages/not-found.tsx (4:11)",
],
}
`)
}
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/pages/not-found.tsx (4:11) @ Page
> 4 | notFound()
| ^",
"stack": [
"Page pages/pages/not-found.tsx (4:11)",
],
}
`)
})
})
......@@ -81,71 +49,37 @@ describe('server-navigation-error', () => {
// FIXME: the first request to middleware error load didn't show the redbox, need one more reload
await browser.refresh()
// TODO(veil): investigate the column number is off by 1 between turbo and webpack
if (isTurbopack) {
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "middleware.ts (8:12) @ middleware
> 8 | redirect('/')
| ^",
"stack": [
"middleware middleware.ts (8:12)",
],
}
`)
} else {
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "middleware.ts (8:13) @ middleware
> 8 | redirect('/')
| ^",
"stack": [
"middleware middleware.ts (8:13)",
],
}
`)
}
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "middleware.ts (8:13) @ middleware
> 8 | redirect('/')
| ^",
"stack": [
"middleware middleware.ts (8:13)",
],
}
`)
})
it('should error on navigation API not-found', async () => {
const browser = await next.browser('/middleware/not-found')
// TODO(veil): investigate the column number is off by 1 between turbo and webpack
if (isTurbopack) {
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "middleware.ts (6:12) @ middleware
> 6 | notFound()
| ^",
"stack": [
"middleware middleware.ts (6:12)",
],
}
`)
} else {
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "middleware.ts (6:13) @ middleware
> 6 | notFound()
| ^",
"stack": [
"middleware middleware.ts (6:13)",
],
}
`)
}
await expect(browser).toDisplayRedbox(`
{
"description": "Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "middleware.ts (6:13) @ middleware
> 6 | notFound()
| ^",
"stack": [
"middleware middleware.ts (6:13)",
],
}
`)
})
})
})
......@@ -2,7 +2,7 @@ import { nextTestSetup } from 'e2e-utils'
import { assertNoRedbox } from '../../../lib/next-test-utils'
describe('use-cache-errors', () => {
const { isTurbopack, next } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
})
const isRspack = Boolean(process.env.NEXT_RSPACK)
......@@ -18,25 +18,7 @@ describe('use-cache-errors', () => {
it('should show a runtime error when calling the incorrectly used cache function', async () => {
const browser = await next.browser('/')
await browser.elementById('action-button').click()
if (isTurbopack) {
// TODO(veil): Inconsistent cursor position
await expect(browser).toDisplayRedbox(`
{
"description": "Attempted to call useStuff() from the server but useStuff is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.",
"environmentLabel": "Cache",
"label": "Runtime Error",
"source": "app/module-with-use-cache.ts (16:17) @ useCachedStuff
> 16 | return useStuff()
| ^",
"stack": [
"<FIXME-file-protocol>",
"useCachedStuff app/module-with-use-cache.ts (16:17)",
"Page app/page.tsx (22:10)",
],
}
`)
} else if (isRspack) {
if (isRspack) {
// TODO: the source is missing and the stack leaks rspack internals
await expect(browser).toDisplayRedbox(`
{
......
......@@ -35,16 +35,16 @@ describe('middleware - development errors', () => {
isTurbopack
? '\n ⨯ Error: boom' +
// TODO(veil): Sourcemap to original name i.e. "default"
'\n at __TURBOPACK__default__export__ (middleware.js:3:14)' +
'\n at __TURBOPACK__default__export__ (middleware.js:3:15)' +
'\n 1 |'
: '\n ⨯ Error: boom' +
'\n at default (middleware.js:3:14)' +
'\n at default (middleware.js:3:15)' +
'\n 1 |'
)
expect(stripAnsi(next.cliOutput)).toContain(
'' +
"\n> 3 | throw new Error('boom')" +
'\n | ^'
'\n | ^'
)
})
......@@ -117,19 +117,19 @@ describe('middleware - development errors', () => {
expect(stripAnsi(next.cliOutput)).toContain(
isTurbopack
? ' ⨯ unhandledRejection: Error: async boom!' +
'\n at throwError (middleware.js:4:14)' +
'\n at throwError (middleware.js:4:15)' +
// TODO(veil): Sourcemap to original name i.e. "default"
'\n at __TURBOPACK__default__export__ (middleware.js:7:8)' +
'\n at __TURBOPACK__default__export__ (middleware.js:7:9)' +
"\n 2 | import { NextResponse } from 'next/server'"
: '\n ⨯ unhandledRejection: Error: async boom!' +
'\n at throwError (middleware.js:4:14)' +
'\n at default (middleware.js:7:8)' +
'\n at throwError (middleware.js:4:15)' +
'\n at default (middleware.js:7:9)' +
"\n 2 | import { NextResponse } from 'next/server'"
)
expect(stripAnsi(next.cliOutput)).toContain(
'' +
"\n> 4 | throw new Error('async boom!')" +
'\n | ^'
'\n | ^'
)
})
......@@ -172,15 +172,15 @@ describe('middleware - development errors', () => {
expect(stripAnsi(next.cliOutput)).toContain(
isTurbopack
? '\n ⨯ Error [ReferenceError]: test is not defined' +
'\n at eval (middleware.js:4:8)' +
'\n at <unknown> (middleware.js:4:8)' +
'\n at eval (middleware.js:4:9)' +
'\n at <unknown> (middleware.js:4:9)' +
// TODO(veil): Should be sourcemapped
'\n at __TURBOPACK__default__export__ ('
: '\n ⨯ Error [ReferenceError]: test is not defined' +
// TODO(veil): Redundant and not clickable
'\n at eval (file://webpack-internal:///(middleware)/./middleware.js)' +
'\n at eval (middleware.js:4:8)' +
'\n at default (middleware.js:4:8)' +
'\n at eval (middleware.js:4:9)' +
'\n at default (middleware.js:4:9)' +
"\n 2 | import { NextResponse } from 'next/server'"
)
expect(stripAnsi(next.cliOutput)).toContain(
......@@ -191,7 +191,7 @@ describe('middleware - development errors', () => {
'\n at __TURBOPACK__default__export__ ('
: "\n ⚠ DynamicCodeEvaluationWarning: Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime" +
'\nLearn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation' +
'\n at default (middleware.js:4:8)' +
'\n at default (middleware.js:4:9)' +
"\n 2 | import { NextResponse } from 'next/server'"
)
})
......@@ -273,7 +273,7 @@ describe('middleware - development errors', () => {
// TODO: Should be anonymous method without a method name
'\n at <unknown> (middleware.js:3)' +
// TODO: Should be ignore-listed
'\n at eval (middleware.js:3:12)' +
'\n at eval (middleware.js:3:13)' +
'\n at (middleware)/./middleware.js (.next/server/middleware.js:18:1)' +
'\n at __webpack_require__ '
)
......@@ -306,7 +306,7 @@ describe('middleware - development errors', () => {
> 3 | throw new Error('booooom!')
| ^",
"stack": [
"<unknown> middleware.js (3:0)",
"<unknown> middleware.js (3)",
"eval middleware.js (3:13)",
"<FIXME-next-dist-dir>",
"<FIXME-next-dist-dir>",
......
......@@ -33,11 +33,11 @@ describe('dynamic-io', () => {
/console: This is a console page
/console: not a template { foo: 'just-some-object' }
Error: /console: test
at ConsolePage (app/console/page.tsx:5:16)
at ConsolePage (app/console/page.tsx:5:17)
  3 | console.log('/console: This is a console page')
 4 | console.warn('/console: not a template', { foo: 'just-some-object' })
> 5 | console.error(new Error('/console: test'))
 | ^
 | ^
 6 | console.assert(
 7 | false,
 8 | '/console: This is an assert message with a %s',
......@@ -46,11 +46,11 @@ describe('dynamic-io', () => {
/console: This is a console page
/console: not a template { foo: 'just-some-object' }
Error: /console: test
at ConsolePage (app/console/page.tsx:5:16)
at ConsolePage (app/console/page.tsx:5:17)
3 | console.log('/console: This is a console page')
4 | console.warn('/console: not a template', { foo: 'just-some-object' })
> 5 | console.error(new Error('/console: test'))
| ^
| ^
6 | console.assert(
7 | false,
8 | '/console: This is an assert message with a %s',
......@@ -59,11 +59,11 @@ describe('dynamic-io', () => {
/console: This is a console page
/console: not a template { foo: 'just-some-object' }
Error: /console: test
at ConsolePage (app/console/page.tsx:5:16)
at ConsolePage (app/console/page.tsx:5:17)
3 | console.log('/console: This is a console page')
4 | console.warn('/console: not a template', { foo: 'just-some-object' })
> 5 | console.error(new Error('/console: test'))
| ^
| ^
6 | console.assert(
7 | false,
8 | '/console: This is an assert message with a %s',
......
......@@ -30,11 +30,11 @@ describe('app-dir - server source maps edge runtime', () => {
})
expect(normalizeCliOutput(next.cliOutput.slice(outputIndex))).toContain(
'\nError: rsc-error-log' +
'\n at logError (app/rsc-error-log/page.js:2:16)' +
'\n at Page (app/rsc-error-log/page.js:6:2)' +
'\n at logError (app/rsc-error-log/page.js:2:17)' +
'\n at Page (app/rsc-error-log/page.js:6:3)' +
'\n 1 | function logError() {' +
"\n> 2 | console.error(new Error('rsc-error-log'))" +
'\n | ^' +
'\n | ^' +
'\n 3 | }' +
'\n 4 |' +
'\n 5 | export default function Page() { {' +
......@@ -59,12 +59,12 @@ describe('app-dir - server source maps edge runtime', () => {
const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex))
expect(cliOutput).toContain(
'\n ⨯ Error: ssr-throw' +
'\n at throwError (app/ssr-throw/page.js:4:8)' +
'\n at Page (app/ssr-throw/page.js:8:2)' +
'\n at throwError (app/ssr-throw/page.js:4:9)' +
'\n at Page (app/ssr-throw/page.js:8:3)' +
'\n 2 |' +
'\n 3 | function throwError() {' +
"\n> 4 | throw new Error('ssr-throw')" +
'\n | ^' +
'\n | ^' +
'\n 5 | }' +
'\n 6 |' +
'\n 7 | export default function Page() { {' +
......@@ -89,11 +89,11 @@ describe('app-dir - server source maps edge runtime', () => {
const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex))
expect(cliOutput).toContain(
'\n ⨯ Error: rsc-throw' +
'\n at throwError (app/rsc-throw/page.js:2:8)' +
'\n at Page (app/rsc-throw/page.js:6:2)' +
'\n at throwError (app/rsc-throw/page.js:2:9)' +
'\n at Page (app/rsc-throw/page.js:6:3)' +
'\n 1 | function throwError() {' +
"\n> 2 | throw new Error('rsc-throw')" +
'\n | ^' +
'\n | ^' +
'\n 3 | }' +
'\n 4 |' +
'\n 5 | export default function Page() { {' +
......
......@@ -48,32 +48,19 @@ describe('use-cache-close-over-function', () => {
const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex))
expect(cliOutput).toContain(
isTurbopack
? 'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' +
'\n [function fn]' +
'\n ^^^^^^^^^^^' +
'\n at createCachedFn (app/client/page.tsx:8:2)' +
'\n at Page (app/client/page.tsx:15:27)' +
'\n 6 | }' +
'\n 7 |' +
'\n> 8 | return async () => {' +
'\n | ^' +
"\n 9 | 'use cache'" +
'\n 10 | return Math.random() + fn()' +
'\n 11 | }'
: '' +
'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' +
'\n [function fn]' +
'\n ^^^^^^^^^^^' +
'\n at createCachedFn (app/client/page.tsx:8:2)' +
'\n at Page (app/client/page.tsx:15:27)' +
'\n 6 | }' +
'\n 7 |' +
'\n> 8 | return async () => {' +
'\n | ^' +
"\n 9 | 'use cache'" +
'\n 10 | return Math.random() + fn()' +
'\n 11 | }'
'' +
'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' +
'\n [function fn]' +
'\n ^^^^^^^^^^^' +
'\n at createCachedFn (app/client/page.tsx:8:3)' +
'\n at Page (app/client/page.tsx:15:28)' +
'\n 6 | }' +
'\n 7 |' +
'\n> 8 | return async () => {' +
'\n | ^' +
"\n 9 | 'use cache'" +
'\n 10 | return Math.random() + fn()' +
'\n 11 | }'
)
})
......@@ -111,22 +98,22 @@ describe('use-cache-close-over-function', () => {
'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' +
'\n [function fn]' +
'\n ^^^^^^^^^^^' +
'\n at createCachedFn (app/server/page.tsx:6:2)' +
'\n at createCachedFn (app/server/page.tsx:6:3)' +
// TODO(veil): Should be source-mapped.
'\n at [project]'
: '' +
'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' +
'\n [function fn]' +
'\n ^^^^^^^^^^^' +
'\n at createCachedFn (app/server/page.tsx:6:2)' +
'\n at eval (app/server/page.tsx:12:23)' +
'\n at createCachedFn (app/server/page.tsx:6:3)' +
'\n at eval (app/server/page.tsx:12:24)' +
// TODO(veil): Should be source-mapped.
'\n at <unknown> (rsc)'
)
expect(cliOutput).toContain(
'' +
'\n> 6 | return async () => {' +
'\n | ^' +
'\n | ^' +
"\n 7 | 'use cache'"
)
})
......
......@@ -74,7 +74,7 @@ describe('use-cache-hanging-inputs', () => {
`)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at eval (app/search-params/page.tsx:3:15)`)
at eval (app/search-params/page.tsx:3:16)`)
}
}, 180_000)
})
......@@ -124,7 +124,7 @@ describe('use-cache-hanging-inputs', () => {
`)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at eval (app/search-params-caught/page.tsx:1:0)`)
at eval (app/search-params-caught/page.tsx:1:1)`)
}
}, 180_000)
})
......@@ -191,7 +191,7 @@ describe('use-cache-hanging-inputs', () => {
`)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at eval (app/uncached-promise/page.tsx:10:12)`)
at eval (app/uncached-promise/page.tsx:10:13)`)
}
}, 180_000)
})
......@@ -245,7 +245,7 @@ describe('use-cache-hanging-inputs', () => {
`)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at eval (app/uncached-promise-nested/page.tsx:16:0)`)
at eval (app/uncached-promise-nested/page.tsx:16:1)`)
}
}, 180_000)
})
......@@ -300,7 +300,7 @@ describe('use-cache-hanging-inputs', () => {
`)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage}
at eval (app/bound-args/page.tsx:13:14)`)
at eval (app/bound-args/page.tsx:13:15)`)
}
}, 180_000)
})
......
......@@ -92,7 +92,7 @@ describe('use-cache-standalone-search-params', () => {
`)
expect(cliOutput).toContain(`Error: ${expectedErrorMessage}
at Page (app/search-params-caught/page.tsx:11:4)`)
at Page (app/search-params-caught/page.tsx:11:5)`)
})
it('should also show an error after the second reload', async () => {
......
......@@ -4,7 +4,7 @@ import { check } from 'next-test-utils'
import stripAnsi from 'strip-ansi'
describe('fetch failures have good stack traces in edge runtime', () => {
const { isTurbopack, next, isNextStart, isNextDev, skipped } = nextTestSetup({
const { next, isNextStart, isNextDev, skipped } = nextTestSetup({
files: __dirname,
// don't have access to runtime logs on deploy
skipDeployment: true,
......@@ -31,36 +31,36 @@ describe('fetch failures have good stack traces in edge runtime', () => {
expect(stripAnsi(next.cliOutput.slice(outputIndex))).toContain(
'' +
'\n ⨯ Error [TypeError]: fetch failed' +
'\n at anotherFetcher (src/fetcher.js:6:15)' +
'\n at fetcher (src/fetcher.js:2:15)' +
'\n at anotherFetcher (src/fetcher.js:6:16)' +
'\n at fetcher (src/fetcher.js:2:16)' +
'\n at UnknownDomainEndpoint (pages/api/unknown-domain.js:6:16)' +
'\n 4 |' +
'\n 5 | async function anotherFetcher(...args) {' +
'\n> 6 | return await fetch(...args)' +
'\n | ^' +
'\n | ^' +
'\n 7 | }' +
'\n 8 |' +
// TODO(veil): Why double error?
'\n ⨯ Error [TypeError]: fetch failed'
)
// TODO(veil): Why column off by one?
// Turbopack produces incorrect mappings in the sourcemap.
// eslint-disable-next-line jest/no-standalone-expect
await expect(browser).toDisplayRedbox(`
{
"description": "fetch failed",
"environmentLabel": null,
"label": "Runtime TypeError",
"source": "src/fetcher.js (6:16) @ anotherFetcher
> 6 | return await fetch(...args)
| ^",
"stack": [
"anotherFetcher src/fetcher.js (6:16)",
"fetcher src/fetcher.js (2:16)",
"UnknownDomainEndpoint pages/api/unknown-domain.js (6:${isTurbopack ? 15 : 16})",
],
}
`)
{
"description": "fetch failed",
"environmentLabel": null,
"label": "Runtime TypeError",
"source": "src/fetcher.js (6:16) @ anotherFetcher
> 6 | return await fetch(...args)
| ^",
"stack": [
"anotherFetcher src/fetcher.js (6:16)",
"fetcher src/fetcher.js (2:16)",
"UnknownDomainEndpoint pages/api/unknown-domain.js (6:16)",
],
}
`)
}
}
)
......
......@@ -82,10 +82,11 @@ describe('build-output-prerender', () => {
// TODO(veil): Why is the location incomplete unless we enable --no-mangling?
expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(`
"Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
at c (turbopack:///[project]/app/client/page.tsx:5:0)
at c (bundler:///app/client/page.tsx:5:1)
3 | export default function Page() {
4 | return <p>Current time: {new Date().toISOString()}</p>
> 5 | }
| ^
6 |
To get a more detailed stack trace and pinpoint the issue, try one of the following:
- Start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error.
......@@ -201,61 +202,32 @@ describe('build-output-prerender', () => {
})
it('shows all prerender errors with readable stacks and code frames', async () => {
if (isTurbopack) {
expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(`
"Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
at Page (turbopack:///[project]/app/client/page.tsx:4:27)
2 |
3 | export default function Page() {
> 4 | return <p>Current time: {new Date().toISOString()}</p>
| ^
5 | }
6 |
To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error.
Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Route "/server" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random
at Page (turbopack:///[project]/app/server/page.tsx:13:26)
11 | await cachedDelay()
12 |
> 13 | return <p>Random: {Math.random()}</p>
| ^
14 | }
15 |
To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/server" in your browser to investigate the error.
Error occurred prerendering page "/server". Read more: https://nextjs.org/docs/messages/prerender-error
> Export encountered errors on following paths:
/client/page: /client
/server/page: /server"
`)
} else {
expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(`
"Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
at Page (webpack:///app/client/page.tsx:4:27)
2 |
3 | export default function Page() {
> 4 | return <p>Current time: {new Date().toISOString()}</p>
| ^
5 | }
6 |
To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error.
Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Route "/server" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random
at Page (webpack:///app/server/page.tsx:13:26)
11 | await cachedDelay()
12 |
> 13 | return <p>Random: {Math.random()}</p>
| ^
14 | }
15 |
To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/server" in your browser to investigate the error.
Error occurred prerendering page "/server". Read more: https://nextjs.org/docs/messages/prerender-error
expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(`
"Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
at Page (bundler:///app/client/page.tsx:4:28)
2 |
3 | export default function Page() {
> 4 | return <p>Current time: {new Date().toISOString()}</p>
| ^
5 | }
6 |
To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error.
Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Route "/server" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random
at Page (bundler:///app/server/page.tsx:13:27)
11 | await cachedDelay()
12 |
> 13 | return <p>Random: {Math.random()}</p>
| ^
14 | }
15 |
To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/server" in your browser to investigate the error.
Error occurred prerendering page "/server". Read more: https://nextjs.org/docs/messages/prerender-error
> Export encountered errors on following paths:
/client/page: /client
/server/page: /server"
`)
}
> Export encountered errors on following paths:
/client/page: /client
/server/page: /server"
`)
})
})
})
......@@ -442,7 +414,11 @@ function getPrerenderOutput(cliOutput: string): string {
if (foundPrerenderingLine && !line.includes('Generating static pages')) {
lines.push(
line.replace(/at \w+ \(.next[^)]+\)/, 'at x (<next-dist-dir>)')
line
.replace(/at \w+ \(.next[^)]+\)/, 'at x (<next-dist-dir>)')
// TODO(veil): Bundler protocols should not appear in stackframes.
.replace('webpack:///', 'bundler:///')
.replace('turbopack:///[project]/', 'bundler:///')
)
}
}
......
......@@ -93,26 +93,29 @@ impl ReferencedAssetIdent {
ctxt,
export,
} => {
let ns = Ident::new(
namespace_ident.as_str().into(),
span,
ctxt.unwrap_or_default(),
);
if let Some(export) = export {
Either::Right(MemberExpr {
span,
obj: Box::new(Expr::Ident(ns)),
obj: Box::new(Expr::Ident(Ident::new(
namespace_ident.as_str().into(),
DUMMY_SP,
ctxt.unwrap_or_default(),
))),
prop: MemberProp::Computed(ComputedPropName {
span,
span: DUMMY_SP,
expr: Box::new(Expr::Lit(Lit::Str(Str {
span,
span: DUMMY_SP,
value: export.as_str().into(),
raw: None,
}))),
}),
})
} else {
Either::Left(ns)
Either::Left(Ident::new(
namespace_ident.as_str().into(),
span,
ctxt.unwrap_or_default(),
))
}
}
}
......@@ -125,13 +128,13 @@ impl ReferencedAssetIdent {
Expr::Seq(SeqExpr {
exprs: vec![
Box::new(Expr::Lit(Lit::Num(Number {
span,
span: DUMMY_SP,
value: 0.0,
raw: None,
}))),
Box::new(member.into()),
],
span,
span: DUMMY_SP,
})
} else {
member.into()
......
......@@ -3,11 +3,11 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}},
{"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,gPAAA,CAAA,IAAG,IAAI;AAQP,gPAAA,CAAA,IAAG,IAAI"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,gPAAA,CAAA,IAAG,IAAI"}},
{"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG"}},
{"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,qPAAG,IAAI;AAQP,qPAAG,IAAI"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,qPAAG,IAAI"}},
{"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,qPAAG;AAQf,QAAQ,GAAG,CAAC,qPAAG;AAQf,QAAQ,GAAG,CAAC,qPAAG"}},
{"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}},
{"offset": {"line": 63, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}},
{"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}},
{"offset": {"line": 91, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/index.js"],"sourcesContent":["import { fakeCat } from './module'\n\nconsole.log(fakeCat)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,mPAAA,CAAA,UAAO"}}]
{"offset": {"line": 91, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/index.js"],"sourcesContent":["import { fakeCat } from './module'\n\nconsole.log(fakeCat)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,8PAAO"}}]
}
\ No newline at end of file
......@@ -3,10 +3,10 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}},
{"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,uPAAA,CAAA,IAAG,IAAI;AAQP,uPAAA,CAAA,IAAG,IAAI"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,uPAAA,CAAA,IAAG,IAAI"}},
{"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,uPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,uPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,uPAAA,CAAA,IAAG"}},
{"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,4PAAG,IAAI;AAQP,4PAAG,IAAI"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,4PAAG,IAAI"}},
{"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,4PAAG;AAQf,QAAQ,GAAG,CAAC,4PAAG;AAQf,QAAQ,GAAG,CAAC,4PAAG"}},
{"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}},
{"offset": {"line": 63, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}},
{"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/index.js"],"sourcesContent":["import { cat as c, dogRef, initialCat, getChimera } from './lib'\n\nconsole.log(c)\n\n// TODO: Execution\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,uPAAA,CAAA,MAAC,GAEb,kBAAkB"}}]
{"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/index.js"],"sourcesContent":["import { cat as c, dogRef, initialCat, getChimera } from './lib'\n\nconsole.log(c)\n\n// TODO: Execution\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,8PAAC,GAEb,kBAAkB"}}]
}
\ No newline at end of file
......@@ -3,10 +3,10 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}},
{"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,gPAAA,CAAA,IAAG,IAAI;AAQP,gPAAA,CAAA,IAAG,IAAI"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,gPAAA,CAAA,IAAG,IAAI"}},
{"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG"}},
{"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,qPAAG,IAAI;AAQP,qPAAG,IAAI"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,qPAAG,IAAI"}},
{"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,qPAAG;AAQf,QAAQ,GAAG,CAAC,qPAAG;AAQf,QAAQ,GAAG,CAAC,qPAAG"}},
{"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}},
{"offset": {"line": 63, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}},
{"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/index.js"],"sourcesContent":["import { cat as c } from './lib'\n\nconsole.log(c)\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,gPAAA,CAAA,MAAC"}}]
{"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/index.js"],"sourcesContent":["import { cat as c } from './lib'\n\nconsole.log(c)\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,uPAAC"}}]
}
\ No newline at end of file
......@@ -3,8 +3,8 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}},
{"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,yPAAA,CAAA,IAAG,IAAI;AAQP,yPAAA,CAAA,IAAG,IAAI"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,yPAAA,CAAA,IAAG,IAAI"}},
{"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,yPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,yPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,yPAAA,CAAA,IAAG"}},
{"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,8PAAG,IAAI;AAQP,8PAAG,IAAI"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,8PAAG,IAAI"}},
{"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,8PAAG;AAQf,QAAQ,GAAG,CAAC,8PAAG;AAQf,QAAQ,GAAG,CAAC,8PAAG"}},
{"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/index.js"],"sourcesContent":["import './lib'\n"],"names":[],"mappings":";AAAA"}}]
}
\ No newline at end of file
......@@ -3,6 +3,6 @@
"sources": [],
"sections": [
{"offset": {"line": 6, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/shared.js"],"sourcesContent":["// shared package\n"],"names":[],"mappings":"AAAA,iBAAiB"}},
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/index.js"],"sourcesContent":["import { bar } from 'bar'\nimport './shared'\n\nbar(true)\n\nimport('./import').then(({ foo }) => {\n foo(true)\n})\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,CAAA,GAAA,yNAAA,CAAA,MAAG,AAAD,EAAE;AAEJ,kLAAmB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE;IAC9B,IAAI;AACN"}},
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/index.js"],"sourcesContent":["import { bar } from 'bar'\nimport './shared'\n\nbar(true)\n\nimport('./import').then(({ foo }) => {\n foo(true)\n})\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,IAAA,gOAAG,EAAC;AAEJ,kLAAmB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE;IAC9B,IAAI;AACN"}},
{"offset": {"line": 24, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/node_modules/bar/index.js"],"sourcesContent":["export function bar(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/import.js"],"sourcesContent":["import { foo } from 'foo'\nimport { bar } from 'bar'\nimport './shared'\n\nfoo(true)\nbar(true)\n"],"names":[],"mappings":";AAAA;AACA;AACA;;;;AAEA,CAAA,GAAA,yNAAA,CAAA,MAAG,AAAD,EAAE;AACJ,CAAA,GAAA,yNAAA,CAAA,MAAG,AAAD,EAAE"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/import.js"],"sourcesContent":["import { foo } from 'foo'\nimport { bar } from 'bar'\nimport './shared'\n\nfoo(true)\nbar(true)\n"],"names":[],"mappings":";AAAA;AACA;AACA;;;;AAEA,IAAA,gOAAG,EAAC;AACJ,IAAA,gOAAG,EAAC"}},
{"offset": {"line": 18, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/node_modules/foo/index.js"],"sourcesContent":["export function foo(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -3,6 +3,6 @@
"sources": [],
"sections": [
{"offset": {"line": 6, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/shared.js"],"sourcesContent":["// shared package\n"],"names":[],"mappings":"AAAA,iBAAiB"}},
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/index.js"],"sourcesContent":["import { bar } from 'bar'\nimport './shared'\n\nbar(true)\n\nimport('./import').then(({ foo }) => {\n foo(true)\n})\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,CAAA,GAAA,+NAAA,CAAA,MAAG,AAAD,EAAE;AAEJ,wLAAmB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE;IAC9B,IAAI;AACN"}},
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/index.js"],"sourcesContent":["import { bar } from 'bar'\nimport './shared'\n\nbar(true)\n\nimport('./import').then(({ foo }) => {\n foo(true)\n})\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,IAAA,sOAAG,EAAC;AAEJ,wLAAmB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE;IAC9B,IAAI;AACN"}},
{"offset": {"line": 24, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/node_modules/bar/index.js"],"sourcesContent":["export function bar(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/import.js"],"sourcesContent":["import { foo } from 'foo'\nimport { bar } from 'bar'\nimport './shared'\n\nfoo(true)\nbar(true)\n"],"names":[],"mappings":";AAAA;AACA;AACA;;;;AAEA,CAAA,GAAA,+NAAA,CAAA,MAAG,AAAD,EAAE;AACJ,CAAA,GAAA,+NAAA,CAAA,MAAG,AAAD,EAAE"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/import.js"],"sourcesContent":["import { foo } from 'foo'\nimport { bar } from 'bar'\nimport './shared'\n\nfoo(true)\nbar(true)\n"],"names":[],"mappings":";AAAA;AACA;AACA;;;;AAEA,IAAA,sOAAG,EAAC;AACJ,IAAA,sOAAG,EAAC"}},
{"offset": {"line": 18, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/node_modules/foo/index.js"],"sourcesContent":["export function foo(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/input/index.js"],"sourcesContent":["import { foo } from 'foo'\n\nfoo(true)\n"],"names":[],"mappings":";AAAA;;AAEA,CAAA,GAAA,qNAAA,CAAA,MAAG,AAAD,EAAE"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/input/index.js"],"sourcesContent":["import { foo } from 'foo'\n\nfoo(true)\n"],"names":[],"mappings":";AAAA;;AAEA,IAAA,4NAAG,EAAC"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/input/node_modules/foo/index.js"],"sourcesContent":["export function foo(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/index.js"],"sourcesContent":["#!/usr/bin/env node\n\nimport { foo } from 'foo'\n\nfoo(true)\n"],"names":[],"mappings":";AAEA;;AAEA,CAAA,GAAA,qNAAA,CAAA,MAAG,AAAD,EAAE"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/index.js"],"sourcesContent":["#!/usr/bin/env node\n\nimport { foo } from 'foo'\n\nfoo(true)\n"],"names":[],"mappings":";AAEA;;AAEA,IAAA,4NAAG,EAAC"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/node_modules/foo/index.js"],"sourcesContent":["#!/usr/bin/env node\n\nexport function foo(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/Actions.js"],"sourcesContent":["// import() doesn't care about whether a module is an async module or not\nconst UserApi = import('./UserAPI.js')\n\nexport const CreateUserAction = async (name) => {\n console.log('Creating user', name)\n // These are normal awaits, because they are in an async function\n const { createUser } = await UserApi\n await createUser(name)\n}\n\n// You can place import() where you like\n// Placing it at top-level will start loading and evaluating on\n// module evaluation.\n// see CreateUserAction above\n// Here: Connecting to the DB starts when the application starts\n// Placing it inside of an (async) function will start loading\n// and evaluating when the function is called for the first time\n// which basically makes it lazy-loaded.\n// see AlternativeCreateUserAction below\n// Here: Connecting to the DB starts when AlternativeCreateUserAction\n// is called\nexport const AlternativeCreateUserAction = async (name) => {\n const { createUser } = await import('./UserAPI.js')\n await createUser(name)\n}\n\n// Note: Using await import() at top-level doesn't make much sense\n// except in rare cases. It will import modules sequentially.\n"],"names":[],"mappings":"AAAA,yEAAyE;;;;;AACzE,MAAM;AAEC,MAAM,mBAAmB,OAAO;IACrC,QAAQ,GAAG,CAAC,iBAAiB;IAC7B,iEAAiE;IACjE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM;IAC7B,MAAM,WAAW;AACnB;AAaO,MAAM,8BAA8B,OAAO;IAChD,MAAM,EAAE,UAAU,EAAE,GAAG;IACvB,MAAM,WAAW;AACnB,EAEA,kEAAkE;CAClE,mEAAmE"}},
{"offset": {"line": 27, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/index.js"],"sourcesContent":["import { CreateUserAction } from './Actions.js'\n;(async () => {\n await CreateUserAction('John')\n console.log('created user John')\n})()\n"],"names":[],"mappings":";AAAA;;AACC,CAAC;IACA,MAAM,CAAA,GAAA,8MAAA,CAAA,mBAAgB,AAAD,EAAE;IACvB,QAAQ,GAAG,CAAC;AACd,CAAC"}}]
{"offset": {"line": 27, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/index.js"],"sourcesContent":["import { CreateUserAction } from './Actions.js'\n;(async () => {\n await CreateUserAction('John')\n console.log('created user John')\n})()\n"],"names":[],"mappings":";AAAA;;AACC,CAAC;IACA,MAAM,IAAA,kOAAgB,EAAC;IACvB,QAAQ,GAAG,CAAC;AACd,CAAC"}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/db-connection.js"],"sourcesContent":["const connectToDB = async (url) => {\n console.log('connecting to db', url)\n await new Promise((r) => setTimeout(r, 1000))\n}\n\n// This is a top-level-await\nawait connectToDB('my-sql://example.com')\n\nexport const dbCall = async (data) => {\n console.log('dbCall', data)\n // This is a normal await, because it's in an async function\n await new Promise((r) => setTimeout(r, 100))\n return 'fake data'\n}\n\nexport const close = () => {\n console.log('closes the DB connection')\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,cAAc,OAAO;IACzB,QAAQ,GAAG,CAAC,oBAAoB;IAChC,MAAM,IAAI,QAAQ,CAAC,IAAM,WAAW,GAAG;AACzC;AAEA,4BAA4B;AAC5B,MAAM,YAAY;AAEX,MAAM,SAAS,OAAO;IAC3B,QAAQ,GAAG,CAAC,UAAU;IACtB,4DAA4D;IAC5D,MAAM,IAAI,QAAQ,CAAC,IAAM,WAAW,GAAG;IACvC,OAAO;AACT;AAEO,MAAM,QAAQ;IACnB,QAAQ,GAAG,CAAC;AACd"}},
{"offset": {"line": 33, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/UserAPI.js"],"sourcesContent":["import { dbCall } from './db-connection.js'\n\nexport const createUser = async (name) => {\n const command = `CREATE USER ${name}`\n // This is a normal await, because it's in an async function\n await dbCall({ command })\n}\n"],"names":[],"mappings":";;;AAAA;;;;;;AAEO,MAAM,aAAa,OAAO;IAC/B,MAAM,UAAU,CAAC,YAAY,EAAE,MAAM;IACrC,4DAA4D;IAC5D,MAAM,CAAA,GAAA,uNAAA,CAAA,SAAM,AAAD,EAAE;QAAE;IAAQ;AACzB"}}]
{"offset": {"line": 33, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/UserAPI.js"],"sourcesContent":["import { dbCall } from './db-connection.js'\n\nexport const createUser = async (name) => {\n const command = `CREATE USER ${name}`\n // This is a normal await, because it's in an async function\n await dbCall({ command })\n}\n"],"names":[],"mappings":";;;AAAA;;;;;;AAEO,MAAM,aAAa,OAAO;IAC/B,MAAM,UAAU,CAAC,YAAY,EAAE,MAAM;IACrC,4DAA4D;IAC5D,MAAM,IAAA,iOAAM,EAAC;QAAE;IAAQ;AACzB"}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/style.module.css [test] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"module-style\": \"style-module__cu3fEW__module-style\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}},
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/index.js"],"sourcesContent":["import style from './style.module.css'\n\nconsole.log(style, import('./style.module.css'))\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,+MAAA,CAAA,UAAK"}}]
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/index.js"],"sourcesContent":["import style from './style.module.css'\n\nconsole.log(style, import('./style.module.css'))\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,0NAAK"}}]
}
\ No newline at end of file
......@@ -3,6 +3,6 @@
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.module.css [test] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"another-composed-module-style\": \"style-module__Iu_hLa__another-composed-module-style\" + \" \" + __turbopack_context__.i(\"[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css [test] (css module)\")[\"foo-module-style\"],\n \"composed-module-style\": \"style-module__Iu_hLa__composed-module-style\" + \" \" + __turbopack_context__.i(\"[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css [test] (css module)\")[\"foo-module-style\"],\n \"inner\": \"style-module__Iu_hLa__inner\",\n \"module-style\": \"style-module__Iu_hLa__module-style\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA"}},
{"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/index.js"],"sourcesContent":["import 'foo/style.css'\nimport 'foo'\nimport './style.css'\nimport fooStyle from 'foo/style.module.css'\nimport style from './style.module.css'\n\nconsole.log(style, fooStyle, import('foo'))\n"],"names":[],"mappings":";AAGA;AACA;;;;;;AAEA,QAAQ,GAAG,CAAC,oMAAA,CAAA,UAAK,EAAE,2NAAA,CAAA,UAAQ"}},
{"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/index.js"],"sourcesContent":["import 'foo/style.css'\nimport 'foo'\nimport './style.css'\nimport fooStyle from 'foo/style.module.css'\nimport style from './style.module.css'\n\nconsole.log(style, fooStyle, import('foo'))\n"],"names":[],"mappings":";AAGA;AACA;;;;;;AAEA,QAAQ,GAAG,CAAC,+MAAK,EAAE,sOAAQ"}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css [test] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"foo-module-style\": \"style-module__CEkn7G__foo-module-style\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/input/style.module.css [test] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"module-style\": \"style-module__3oVw9q__module-style\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}},
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/input/index.js"],"sourcesContent":["import style from './style.module.css'\nimport './style.css'\n\nconsole.log(style, import('./style.module.css'), import('./style.css'))\n"],"names":[],"mappings":";AAAA;;;AAGA,QAAQ,GAAG,CAAC,6MAAA,CAAA,UAAK"}}]
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/input/index.js"],"sourcesContent":["import style from './style.module.css'\nimport './style.css'\n\nconsole.log(style, import('./style.module.css'), import('./style.css'))\n"],"names":[],"mappings":";AAAA;;;AAGA,QAAQ,GAAG,CAAC,wNAAK"}}]
}
\ No newline at end of file
{"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/input/style.module.css [test] (css module)","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/input/index.js"],"sourcesContent":["__turbopack_context__.v({\n \"inner\": \"style-module__1v6dfa__inner\",\n \"module-style\": \"style-module__1v6dfa__module-style\",\n});\n","import './style.css'\nimport style from './style.module.css'\n\nconsole.log(style)\n"],"names":[],"mappings":"iRAAA,EAAA,CAAA,CAAA,CACA,MAAA,8BACA,eAAA,oCACA,6ICAA,QAAQ,GAAG,CAFX,AAEY,EAFZ,CAAA,CAAA,yHAEY,OAAK,yEAAL"}
\ No newline at end of file
{"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/input/style.module.css [test] (css module)","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/input/index.js"],"sourcesContent":["__turbopack_context__.v({\n \"inner\": \"style-module__1v6dfa__inner\",\n \"module-style\": \"style-module__1v6dfa__module-style\",\n});\n","import './style.css'\nimport style from './style.module.css'\n\nconsole.log(style)\n"],"names":[],"mappings":"iRAAA,EAAA,CAAA,CAAA,CACA,MAAA,8BACA,eAAA,oCACA,6ICAA,QAAQ,GAAG,CAFX,AAEY,EAFZ,CAAA,CAAA,yHAEY,OAAK"}
\ No newline at end of file
......@@ -2,5 +2,5 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-request/very-dynamic/input/index.js"],"sourcesContent":["import child_process from 'node:child_process'\nimport fs, { readFileSync } from 'node:fs'\n\nconst unknown = Math.random()\n\nchild_process.spawnSync(unknown)\nchild_process.spawnSync('node', unknown)\nchild_process.spawnSync('node', [unknown, unknown])\n\nrequire(unknown)\n\nimport(unknown)\n\nfs.readFileSync(unknown)\nreadFileSync(unknown)\n\nnew URL(unknown, import.meta.url)\n"],"names":[],"mappings":";AAAA;AACA;;;;;;;;AAEA,MAAM,UAAU,KAAK,MAAM;AAE3B,mDAAA,CAAA,UAAa,CAAC,SAAS,CAAC;AACxB,mDAAA,CAAA,UAAa,CAAC,SAAS,CAAC,QAAQ;AAChC,mDAAA,CAAA,UAAa,CAAC,SAAS,CAAC,QAAQ;IAAC;IAAS;CAAQ;;;;;;;;;;;AAMlD,wCAAA,CAAA,UAAE,CAAC,YAAY,CAAC;AAChB,CAAA,GAAA,wCAAA,CAAA,eAAY,AAAD,EAAE;AAEb,IAAI,IAAI,SAAS,8BAAY,GAAG"}}]
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-request/very-dynamic/input/index.js"],"sourcesContent":["import child_process from 'node:child_process'\nimport fs, { readFileSync } from 'node:fs'\n\nconst unknown = Math.random()\n\nchild_process.spawnSync(unknown)\nchild_process.spawnSync('node', unknown)\nchild_process.spawnSync('node', [unknown, unknown])\n\nrequire(unknown)\n\nimport(unknown)\n\nfs.readFileSync(unknown)\nreadFileSync(unknown)\n\nnew URL(unknown, import.meta.url)\n"],"names":[],"mappings":";AAAA;AACA;;;;;;;;AAEA,MAAM,UAAU,KAAK,MAAM;AAE3B,8DAAa,CAAC,SAAS,CAAC;AACxB,8DAAa,CAAC,SAAS,CAAC,QAAQ;AAChC,8DAAa,CAAC,SAAS,CAAC,QAAQ;IAAC;IAAS;CAAQ;;;;;;;;;;;AAMlD,mDAAE,CAAC,YAAY,CAAC;AAChB,IAAA,wDAAY,EAAC;AAEb,IAAI,IAAI,SAAS,8BAAY,GAAG"}}]
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo
;
;
;
const StyledButton = /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$styled$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__["default"])("button", {
const StyledButton = (0, /*#__PURE__*/ __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$styled$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__["default"])("button", {
target: "e14dbx1z0"
})("background:blue;");
function ClassNameButton({ children }) {
......
......@@ -2,7 +2,7 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js"],"sourcesContent":["/** @jsxImportSource @emotion/react */\n\nimport { jsx } from '@emotion/react'\nimport styled from '@emotion/styled'\n\nconst StyledButton = styled.button`\n background: blue;\n`\n\nfunction ClassNameButton({ children }) {\n return (\n <button\n className={css`\n background: blue;\n `}\n >\n {children}\n </button>\n )\n}\n\nconsole.log(StyledButton, ClassNameButton)\n"],"names":[],"mappings":"AAAA,oCAAoC;;AAEpC;AACA;;;;AAEA,MAAM,6BAAe,CAAA,GAAA,wMAAA,CAAA,UAAM,AAAD;;;AAI1B,SAAS,gBAAgB,EAAE,QAAQ,EAAE;IACnC,qBACE,uOAAC;QACC,WAAW,GAAG,CAAC;;MAEf,CAAC;kBAEA;;;;;;AAGP;AAEA,QAAQ,GAAG,CAAC,cAAc"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js"],"sourcesContent":["/** @jsxImportSource @emotion/react */\n\nimport { jsx } from '@emotion/react'\nimport styled from '@emotion/styled'\n\nconst StyledButton = styled.button`\n background: blue;\n`\n\nfunction ClassNameButton({ children }) {\n return (\n <button\n className={css`\n background: blue;\n `}\n >\n {children}\n </button>\n )\n}\n\nconsole.log(StyledButton, ClassNameButton)\n"],"names":[],"mappings":"AAAA,oCAAoC;;AAEpC;AACA;;;;AAEA,MAAM,iCAAe,mNAAM;;;AAI3B,SAAS,gBAAgB,EAAE,QAAQ,EAAE;IACnC,qBACE,uOAAC;QACC,WAAW,GAAG,CAAC;;MAEf,CAAC;kBAEA;;;;;;AAGP;AAEA,QAAQ,GAAG,CAAC,cAAc"}},
{"offset": {"line": 32, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/jsx-dev-runtime.js"],"sourcesContent":["export function jsxDEV() {\n return 'purposefully empty stub for @emotion/react/jsx-dev-runtime.js'\n}\n"],"names":[],"mappings":";;;AAAO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}},
{"offset": {"line": 42, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/index.js"],"sourcesContent":["export function jsx() {\n return 'purposefully empty stub for @emotion/react/index.js'\n}\n"],"names":[],"mappings":";;;AAAO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}},
{"offset": {"line": 53, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/styled/index.js"],"sourcesContent":["\"purposefully empty stub\";\n\"@emtion/styled/index.js\";\n"],"names":[],"mappings":"AAAA;AACA","ignoreList":[0]}}]
......
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/table.js"],"sourcesContent":["export const Table = () => {\n return 'table'\n}\n"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ;IACnB,OAAO;AACT"}},
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/index.js"],"sourcesContent":["import { Table } from './table'\n\nexport function Table() {\n console.log(Table)\n}\n"],"names":[],"mappings":";;;AAAA;;AAEO,SAAS;IACd,QAAQ,GAAG,CAAC,6MAAA,CAAA,QAAK;AACnB"}}]
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/index.js"],"sourcesContent":["import { Table } from './table'\n\nexport function Table() {\n console.log(Table)\n}\n"],"names":[],"mappings":";;;AAAA;;AAEO,SAAS;IACd,QAAQ,GAAG,CAAC,sNAAK;AACnB"}}]
}
\ No newline at end of file
......@@ -2,5 +2,5 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/index.js"],"sourcesContent":["import pkg from './package.json'\nconsole.log(pkg.name)\nimport invalid from './invalid.json'\nconsole.log(invalid['this-is'])\n"],"names":[],"mappings":";AAAA;AAEA;;AADA,QAAQ,GAAG,CAAC,6KAAA,CAAA,UAAG,CAAC,IAAI;;AAEpB,QAAQ,GAAG,CAAC,6KAAA,CAAA,UAAO,CAAC,UAAU"}}]
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/index.js"],"sourcesContent":["import pkg from './package.json'\nconsole.log(pkg.name)\nimport invalid from './invalid.json'\nconsole.log(invalid['this-is'])\n"],"names":[],"mappings":";AAAA;AAEA;;AADA,QAAQ,GAAG,CAAC,wLAAG,CAAC,IAAI;;AAEpB,QAAQ,GAAG,CAAC,wLAAO,CAAC,UAAU"}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/input/posts.ts"],"sourcesContent":["export default {\n js: true,\n}\n"],"names":[],"mappings":";;;uCAAe;IACb,IAAI;AACN"}},
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/input/index.js"],"sourcesContent":["import posts from './posts'\n\nconsole.log(posts.js)\nif (!posts.js) {\n process.exit(1)\n}\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,8LAAA,CAAA,UAAK,CAAC,EAAE;AACpB,IAAI,CAAC,8LAAA,CAAA,UAAK,CAAC,EAAE,EAAE;IACb,QAAQ,IAAI,CAAC;AACf"}}]
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/input/index.js"],"sourcesContent":["import posts from './posts'\n\nconsole.log(posts.js)\nif (!posts.js) {\n process.exit(1)\n}\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,yMAAK,CAAC,EAAE;AACpB,IAAI,CAAC,yMAAK,CAAC,EAAE,EAAE;IACb,QAAQ,IAAI,CAAC;AACf"}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/input/vercel.mjs"],"sourcesContent":["export default 'turbopack'\n"],"names":[],"mappings":";;;uCAAe"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/input/index.js"],"sourcesContent":["import img from './vercel.mjs'\nconsole.log(img)\n\nimport('./vercel.mjs').then(console.log)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,mNAAA,CAAA,UAAG;AAEf,4LAAuB,IAAI,CAAC,QAAQ,GAAG"}}]
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/input/index.js"],"sourcesContent":["import img from './vercel.mjs'\nconsole.log(img)\n\nimport('./vercel.mjs').then(console.log)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,8NAAG;AAEf,4LAAuB,IAAI,CAAC,QAAQ,GAAG"}}]
}
\ No newline at end of file
......@@ -2,5 +2,5 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 8, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static/input/index.js"],"sourcesContent":["import img from \"./vercel.svg\";\nconsole.log(img);\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,+LAAA,CAAA,UAAG"}}]
{"offset": {"line": 8, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static/input/index.js"],"sourcesContent":["import img from \"./vercel.svg\";\nconsole.log(img);\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,0MAAG"}}]
}
\ No newline at end of file
......@@ -3,6 +3,6 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/foo.js"],"sourcesContent":["export default 'foo'\n"],"names":[],"mappings":";;;uCAAe"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/nested/index.js"],"sourcesContent":["import foo from '#foo'\nexport default foo\n"],"names":[],"mappings":";;;AAAA;;uCACe,mNAAA,CAAA,UAAG"}},
{"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/index.js"],"sourcesContent":["import foo from './nested'\n\nconsole.log(foo)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,+NAAA,CAAA,UAAG"}}]
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/nested/index.js"],"sourcesContent":["import foo from '#foo'\nexport default foo\n"],"names":[],"mappings":";;;AAAA;;uCACe,8NAAG"}},
{"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/index.js"],"sourcesContent":["import foo from './nested'\n\nconsole.log(foo)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,0OAAG"}}]
}
\ No newline at end of file
......@@ -7,5 +7,5 @@
{"offset": {"line": 21, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/pat.js"],"sourcesContent":["export default 'pat'\n"],"names":[],"mappings":";;;uCAAe"}},
{"offset": {"line": 29, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/import.mjs"],"sourcesContent":["export default 'import'\n"],"names":[],"mappings":";;;uCAAe"}},
{"offset": {"line": 38, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/require.cjs"],"sourcesContent":["module.exports = 'require'\n"],"names":[],"mappings":"AAAA,OAAO,OAAO,GAAG"}},
{"offset": {"line": 43, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/index.js"],"sourcesContent":["import foo from '#foo'\nimport dep from '#dep'\nimport pattern from '#pattern/pat.js'\nimport conditionalImport from '#conditional'\nconst conditionalRequire = require('#conditional')\n\nconsole.log(foo, dep, pattern, conditionalImport, conditionalRequire)\n"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;;;;;AACA,MAAM;AAEN,QAAQ,GAAG,CAAC,yMAAA,CAAA,UAAG,EAAE,kNAAA,CAAA,UAAG,EAAE,yMAAA,CAAA,UAAO,EAAE,6MAAA,CAAA,UAAiB,EAAE"}}]
{"offset": {"line": 43, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/index.js"],"sourcesContent":["import foo from '#foo'\nimport dep from '#dep'\nimport pattern from '#pattern/pat.js'\nimport conditionalImport from '#conditional'\nconst conditionalRequire = require('#conditional')\n\nconsole.log(foo, dep, pattern, conditionalImport, conditionalRequire)\n"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;;;;;AACA,MAAM;AAEN,QAAQ,GAAG,CAAC,oNAAG,EAAE,6NAAG,EAAE,oNAAO,EAAE,wNAAiB,EAAE"}}]
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/index.js"],"sourcesContent":["import { local } from 'lib'\n\nlocal()\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,CAAA,GAAA,gRAAA,CAAA,QAAK,AAAD"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/index.js"],"sourcesContent":["import { local } from 'lib'\n\nlocal()\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,IAAA,yRAAK"}},
{"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/node_modules/lib/unused.js"],"sourcesContent":["export function unusedStar() {}\n"],"names":[],"mappings":";AAAO,SAAS,cAAc","ignoreList":[0]}},
{"offset": {"line": 20, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/node_modules/lib/unused-star.js"],"sourcesContent":["export function unused() {}\n"],"names":[],"mappings":";AAAO,SAAS,UAAU","ignoreList":[0]}},
{"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/node_modules/lib/index.js"],"sourcesContent":["export { unused } from './unused.js'\nexport * from './unused-star.js'\n\nfunction local() {\n console.log('This is a local function')\n}\nfunction localUnused() {\n console.log('This is a local unused function')\n}\n\nexport { local, localUnused }\n"],"names":[],"mappings":";;;AAAA;AACA;;;AAEA,SAAS;IACP,QAAQ,GAAG,CAAC;AACd;AACA,SAAS;IACP,QAAQ,GAAG,CAAC;AACd","ignoreList":[0]}}]
......
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/input/index.js"],"sourcesContent":["import { a0 } from 'lib'\n\nconsole.log(a0)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,uSAAA,CAAA,KAAE"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/input/index.js"],"sourcesContent":["import { a0 } from 'lib'\n\nconsole.log(a0)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,6SAAE"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/input/node_modules/lib/a.js"],"sourcesContent":["export const a = 'a'\nexport const a_unused = 'a_unused'\n"],"names":[],"mappings":";;;AAAO,MAAM,IAAI;AACV,MAAM,WAAW","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["import { getCat } from 'lib'\n\nconsole.log(`I like ${getCat()}`)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,CAAC,OAAO,EAAE,CAAA,GAAA,gQAAA,CAAA,SAAM,AAAD,KAAK"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["import { getCat } from 'lib'\n\nconsole.log(`I like ${getCat()}`)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,CAAC,OAAO,EAAE,IAAA,0QAAM,KAAI"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/input/node_modules/lib/index.js"],"sourcesContent":["\nlet cat = \"cat\";\nlet dog = \"dog\";\n\nexport function getChimera() {\n return cat + dog;\n}\n\nexport function getCat() {\n return cat;\n}\n\nexport function getDog() {\n return dog;\n}\n\n"],"names":[],"mappings":";;;AACA,IAAI,MAAM;AACV,IAAI,MAAM;AAEH,SAAS;IACd,OAAO,MAAM;AACf;AAEO,SAAS;IACd,OAAO;AACT;AAEO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/input/index.js"],"sourcesContent":["import { spawn } from 'child_process'\n\nconst program = ['ls']\nconst proc = spawn(program[0], ['-la'])\n"],"names":[],"mappings":";AAAA;;AAEA,MAAM,UAAU;IAAC;CAAK;AACtB,MAAM,OAAO,CAAA,GAAA,oOAAA,CAAA,QAAK,AAAD,EAAE,OAAO,CAAC,EAAE,EAAE;IAAC;CAAM"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/input/index.js"],"sourcesContent":["import { spawn } from 'child_process'\n\nconst program = ['ls']\nconst proc = spawn(program[0], ['-la'])\n"],"names":[],"mappings":";AAAA;;AAEA,MAAM,UAAU;IAAC;CAAK;AACtB,MAAM,OAAO,IAAA,6OAAK,EAAC,OAAO,CAAC,EAAE,EAAE;IAAC;CAAM"}},
{"offset": {"line": 18, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/input/node_modules/child_process/index.js"],"sourcesContent":["export function spawn(cmd, args) {\n //\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,MAAM,GAAG,EAAE,IAAI;AAC7B,EAAE;AACJ","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/input/index.js"],"sourcesContent":["import { spawn } from 'child_process'\n\nlet x = spawn(process.argv[0], ['-e', \"console.log('foo');\"])\n"],"names":[],"mappings":";AAAA;;AAEA,IAAI,IAAI,CAAA,GAAA,sOAAA,CAAA,QAAK,AAAD,EAAE,QAAQ,IAAI,CAAC,EAAE,EAAE;IAAC;IAAM;CAAsB"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/input/index.js"],"sourcesContent":["import { spawn } from 'child_process'\n\nlet x = spawn(process.argv[0], ['-e', \"console.log('foo');\"])\n"],"names":[],"mappings":";AAAA;;AAEA,IAAI,IAAI,IAAA,+OAAK,EAAC,QAAQ,IAAI,CAAC,EAAE,EAAE;IAAC;IAAM;CAAsB"}},
{"offset": {"line": 16, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/input/node_modules/child_process/index.js"],"sourcesContent":["export function spawn(cmd, args) {\n //\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,MAAM,GAAG,EAAE,IAAI;AAC7B,EAAE;AACJ","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 6, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/shared.js"],"sourcesContent":["module.exports = 'shared'\n"],"names":[],"mappings":"AAAA,OAAO,OAAO,GAAG"}},
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/a.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/b.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/c.js"],"sourcesContent":["import shared from './shared.js'\n\nconsole.log('a', shared)\n","import './a.js'\nimport shared from './shared.js'\n\nconsole.log('a', shared)\n","import './b.js'\nimport shared from './shared.js'\n\nconsole.log('c', shared)\n"],"names":[],"mappings":";;;;;;;;;AAAA;;AAEA,QAAQ,GAAG,CAAC,KAAK,wNAAA,CAAA,UAAM;;;;ACCvB,QAAQ,GAAG,CAAC,KAAK,yNAAA,CAAA,UAAM;;;;ACAvB,QAAQ,GAAG,CAAC,KAAK,yNAAA,CAAA,UAAM"}}]
{"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/a.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/b.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/c.js"],"sourcesContent":["import shared from './shared.js'\n\nconsole.log('a', shared)\n","import './a.js'\nimport shared from './shared.js'\n\nconsole.log('a', shared)\n","import './b.js'\nimport shared from './shared.js'\n\nconsole.log('c', shared)\n"],"names":[],"mappings":";;;;;;;;;AAAA;;AAEA,QAAQ,GAAG,CAAC,KAAK,mOAAM;;;;ACCvB,QAAQ,GAAG,CAAC,KAAK,oOAAM;;;;ACAvB,QAAQ,GAAG,CAAC,KAAK,oOAAM"}}]
}
\ No newline at end of file
......@@ -2,5 +2,5 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/x/inner.js"],"sourcesContent":["import big from '../big'\nconsole.log('x', big)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,KAAK,yNAAA,CAAA,UAAG"}}]
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/x/inner.js"],"sourcesContent":["import big from '../big'\nconsole.log('x', big)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,KAAK,oOAAG"}}]
}
\ No newline at end of file
......@@ -2,5 +2,5 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/y/inner.js"],"sourcesContent":["import big from '../big'\nconsole.log('y', big)\n"],"names":[],"mappings":";;;;;AAAA;;AACA,QAAQ,GAAG,CAAC,KAAK,yNAAA,CAAA,UAAG"}}]
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/y/inner.js"],"sourcesContent":["import big from '../big'\nconsole.log('y', big)\n"],"names":[],"mappings":";;;;;AAAA;;AACA,QAAQ,GAAG,CAAC,KAAK,oOAAG"}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"file":"turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/sourcemapped.js","sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/sourcemapped.ts"],"sourceRoot":"","sourcesContent":["// Compile with pnpm tsc turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map-merged/input/sourcemapped.ts --sourceMap --inlineSources --target esnext\n// tsc compile errors can be ignored\ntype Fn<T> = () => T\nexport function runExternalSourceMapped<T>(fn: Fn<T>): T {\n return fn()\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,uBAAuB,CAAI,EAAS;IAClD,OAAO,EAAE,EAAE,CAAA;AACb,CAAC"}},
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/index.js"],"sourcesContent":["import { runExternalSourceMapped } from './sourcemapped.js'\n\nrunExternalSourceMapped()\n"],"names":[],"mappings":";AAAA;;AAEA,CAAA,GAAA,0NAAA,CAAA,0BAAuB,AAAD"}}]
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/index.js"],"sourcesContent":["import { runExternalSourceMapped } from './sourcemapped.js'\n\nrunExternalSourceMapped()\n"],"names":[],"mappings":";AAAA;;AAEA,IAAA,qPAAuB"}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/input/index.js"],"sourcesContent":["import styled from 'styled-components'\n\nconst MyButton = styled.button`\n background: blue;\n`\n\nconsole.log(MyButton)\n"],"names":[],"mappings":";AAAA;;AAEA,MAAM,WAAW,yMAAA,CAAA,UAAM,CAAC,MAAM;;;EAAA,CAAC;;AAE/B,CAAC;AAED,QAAQ,GAAG,CAAC"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/input/index.js"],"sourcesContent":["import styled from 'styled-components'\n\nconst MyButton = styled.button`\n background: blue;\n`\n\nconsole.log(MyButton)\n"],"names":[],"mappings":";AAAA;;AAEA,MAAM,WAAW,oNAAM,CAAC,MAAM;;;EAAA,CAAC;;AAE/B,CAAC;AAED,QAAQ,GAAG,CAAC"}},
{"offset": {"line": 20, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/styled-components/index.js"],"sourcesContent":["\"purposefully empty stub\";\n\"styled-components/index.js\"\n"],"names":[],"mappings":"AAAA;AACA","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/packages/component/index.js"],"sourcesContent":["export default function MyApp() {\n return <div>App</div>\n}\n"],"names":[],"mappings":";;;;;AAAe,SAAS;IACtB,qBAAO,0NAAC;kBAAI;;;;;;AACd"}},
{"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/packages/app/index.js"],"sourcesContent":["import MyApp from 'component'\nimport ThirdPartyComponent from 'third_party_component'\n\nconsole.log(MyApp, ThirdPartyComponent)\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,QAAQ,GAAG,CAAC,wOAAA,CAAA,UAAK,EAAE,wPAAA,CAAA,UAAmB"}},
{"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/packages/app/index.js"],"sourcesContent":["import MyApp from 'component'\nimport ThirdPartyComponent from 'third_party_component'\n\nconsole.log(MyApp, ThirdPartyComponent)\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,QAAQ,GAAG,CAAC,mPAAK,EAAE,mQAAmB"}},
{"offset": {"line": 33, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/react/jsx-dev-runtime.js"],"sourcesContent":["export function jsxDEV() {\n return 'purposefully empty stub for react/jsx-dev-runtime.js'\n}\n"],"names":[],"mappings":";;;AAAO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}},
{"offset": {"line": 43, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/node_modules/third_party_component/index.js"],"sourcesContent":["export default function ThirdPartyComponent() {\n return <div>Should not be transformed</div>;\n}\n"],"names":[],"mappings":";;;AAAe,SAAS;IACtB,QAAQ,IAAI,yBAAyB,EAAE;AACzC","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/input/prop.js"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/input/index.js"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,8MAAA,CAAA,OAAS,EAAE,8MAAA,CAAA,OAAQ,EAAE,8MAAA,CAAA,OAAK"}}]
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/input/index.js"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,sNAAS,EAAE,sNAAQ,EAAE,sNAAK"}}]
}
\ No newline at end of file
......@@ -3,6 +3,6 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/input/prop.ts"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nimport * as bar from 'bar'\n\nconsole.log(globalFoo, localFoo, atFoo, bar)\n"],"names":[],"mappings":";AAAA;AAIA;;;;;AAEA,QAAQ,GAAG,CAAC,8MAAA,CAAA,OAAS,EAAE,8MAAA,CAAA,OAAQ,EAAE,8MAAA,CAAA,OAAK,EAAE"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nimport * as bar from 'bar'\n\nconsole.log(globalFoo, localFoo, atFoo, bar)\n"],"names":[],"mappings":";AAAA;AAIA;;;;;AAEA,QAAQ,GAAG,CAAC,sNAAS,EAAE,sNAAQ,EAAE,sNAAK,EAAE"}},
{"offset": {"line": 25, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/input/node_modules/bar/index.js"],"sourcesContent":["export const bar = 'bar';\n"],"names":[],"mappings":";;;AAAO,MAAM,MAAM","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module-full-path/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,mMAAA,CAAA,OAAS,EAAE,mMAAA,CAAA,OAAQ,EAAE,mMAAA,CAAA,OAAK"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module-full-path/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,2MAAS,EAAE,2MAAQ,EAAE,2MAAK"}},
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/tsconfig-mod/prop.ts"],"sourcesContent":["export const prop = 1;\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,mMAAA,CAAA,OAAS,EAAE,mMAAA,CAAA,OAAQ,EAAE,mMAAA,CAAA,OAAK"}},
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,2MAAS,EAAE,2MAAQ,EAAE,2MAAK"}},
{"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/tsconfig-mod/prop.ts"],"sourcesContent":["export const prop = 1;\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO","ignoreList":[0]}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/input/prop.ts"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,iOAAA,CAAA,OAAS,EAAE,iOAAA,CAAA,OAAQ,EAAE,iOAAA,CAAA,OAAK"}}]
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,yOAAS,EAAE,yOAAQ,EAAE,yOAAK"}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/input/prop.ts"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,gOAAA,CAAA,OAAS,EAAE,gOAAA,CAAA,OAAQ,EAAE,gOAAA,CAAA,OAAK"}}]
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,wOAAS,EAAE,wOAAQ,EAAE,wOAAK"}}]
}
\ No newline at end of file
......@@ -3,5 +3,5 @@
"sources": [],
"sections": [
{"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/input/prop.ts"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,8MAAA,CAAA,OAAS,EAAE,8MAAA,CAAA,OAAQ,EAAE,8MAAA,CAAA,OAAK"}}]
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,sNAAS,EAAE,sNAAQ,EAAE,sNAAK"}}]
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment