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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import { ViteNodeRunnerOptions } from 'vite-node';
import { ViteNodeRunner } from 'vite-node/client';
import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.tN5KGIih.js';
import vm from 'node:vm';
import * as _vitest_mocker from '@vitest/mocker';
import { MockedModuleType } from '@vitest/mocker';
import { P as PendingSuiteMock, b as MockFactory, a as MockOptions } from './chunks/mocker.cRtM890J.js';
import '@vitest/runner';
import './chunks/config.Cy0C388Z.js';
import '@vitest/pretty-format';
import '@vitest/snapshot';
import '@vitest/snapshot/environment';
import './chunks/environment.LoooBwUu.js';

declare class FileMap {
private fsCache;
private fsBufferCache;
readFileAsync(path: string): Promise<string>;
readFile(path: string): string;
readBuffer(path: string): Buffer;
}

interface ModuleEvaluateOptions {
timeout?: vm.RunningScriptOptions['timeout'] | undefined;
breakOnSigint?: vm.RunningScriptOptions['breakOnSigint'] | undefined;
}
type ModuleLinker = (specifier: string, referencingModule: VMModule, extra: {
assert: object;
}) => VMModule | Promise<VMModule>;
type ModuleStatus = 'unlinked' | 'linking' | 'linked' | 'evaluating' | 'evaluated' | 'errored';
declare class VMModule {
dependencySpecifiers: readonly string[];
error: any;
identifier: string;
context: vm.Context;
namespace: object;
status: ModuleStatus;
evaluate(options?: ModuleEvaluateOptions): Promise<void>;
link(linker: ModuleLinker): Promise<void>;
}

interface ExternalModulesExecutorOptions {
context: vm.Context;
fileMap: FileMap;
packageCache: Map<string, any>;
transform: RuntimeRPC['transform'];
interopDefault?: boolean;
viteClientModule: Record<string, unknown>;
}
declare class ExternalModulesExecutor {
#private;
private options;
private cjs;
private esm;
private vite;
private context;
private fs;
private resolvers;
constructor(options: ExternalModulesExecutorOptions);
import(identifier: string): Promise<object>;
require(identifier: string): any;
createRequire(identifier: string): NodeRequire;
importModuleDynamically: (specifier: string, referencer: VMModule) => Promise<VMModule>;
resolveModule: (specifier: string, referencer: string) => Promise<VMModule>;
resolve(specifier: string, parent: string): string;
private findNearestPackageData;
private wrapCoreSynteticModule;
private wrapCommonJsSynteticModule;
private getModuleInformation;
private createModule;
private get isNetworkSupported();
}

interface MockContext {
/**
* When mocking with a factory, this refers to the module that imported the mock.
*/
callstack: null | string[];
}
declare class VitestMocker {
executor: VitestExecutor;
static pendingIds: PendingSuiteMock[];
private spyModule?;
private primitives;
private filterPublicKeys;
private registries;
private mockContext;
constructor(executor: VitestExecutor);
private get root();
private get moduleCache();
private get moduleDirectories();
initializeSpyModule(): Promise<void>;
private getMockerRegistry;
reset(): void;
private deleteCachedItem;
private isModuleDirectory;
getSuiteFilepath(): string;
private createError;
private resolvePath;
resolveMocks(): Promise<void>;
private callFunctionMock;
getMockContext(): MockContext;
getMockPath(dep: string): string;
getDependencyMock(id: string): _vitest_mocker.MockedModule | undefined;
normalizePath(path: string): string;
resolveMockPath(mockPath: string, external: string | null): string | null;
mockObject(object: Record<string | symbol, any>, mockExports?: Record<string | symbol, any>, behavior?: MockedModuleType): Record<string | symbol, any>;
unmockPath(path: string): void;
mockPath(originalId: string, path: string, external: string | null, mockType: MockedModuleType | undefined, factory: MockFactory | undefined): void;
importActual<T>(rawId: string, importer: string, callstack?: string[] | null): Promise<T>;
importMock(rawId: string, importee: string): Promise<any>;
requestWithMock(url: string, callstack: string[]): Promise<any>;
queueMock(id: string, importer: string, factoryOrOptions?: MockFactory | MockOptions): void;
queueUnmock(id: string, importer: string): void;
}

interface ExecuteOptions extends ViteNodeRunnerOptions {
moduleDirectories?: string[];
state: WorkerGlobalState;
context?: vm.Context;
externalModulesExecutor?: ExternalModulesExecutor;
}
declare class VitestExecutor extends ViteNodeRunner {
options: ExecuteOptions;
mocker: VitestMocker;
externalModules?: ExternalModulesExecutor;
private primitives;
constructor(options: ExecuteOptions);
protected getContextPrimitives(): {
Object: typeof Object;
Reflect: typeof Reflect;
Symbol: typeof Symbol;
};
get state(): WorkerGlobalState;
shouldResolveId(id: string, _importee?: string | undefined): boolean;
originalResolveUrl(id: string, importer?: string): Promise<[url: string, fsPath: string]>;
resolveUrl(id: string, importer?: string): Promise<[url: string, fsPath: string]>;
protected runModule(context: Record<string, any>, transformed: string): Promise<void>;
importExternalModule(path: string): Promise<any>;
dependencyRequest(id: string, fsPath: string, callstack: string[]): Promise<any>;
prepareContext(context: Record<string, any>): Record<string, any>;
}

export { VitestExecutor };
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import ElseBlock from './ElseBlock.js';
import Expression from './shared/Expression.js';
import AbstractBlock from './shared/AbstractBlock.js';
import { unpack_destructuring } from './shared/Context.js';
import compiler_errors from '../compiler_errors.js';
import get_const_tags from './shared/get_const_tags.js';

/** @extends AbstractBlock<'EachBlock'> */
export default class EachBlock extends AbstractBlock {
/** @type {import('./shared/Expression.js').default} */
expression;

/** @type {import('estree').Node} */
context_node;

/** @type {string} */
iterations;

/** @type {string} */
index;

/** @type {string} */
context;

/** @type {import('./shared/Expression.js').default} */
key;

/** @type {import('./shared/TemplateScope.js').default} */
scope;

/** @type {import('./shared/Context.js').Context[]} */
contexts;

/** @type {import('./ConstTag.js').default[]} */
const_tags;

/** @type {boolean} */
has_animation;
/** */
has_binding = false;
/** */
has_index_binding = false;

/** @type {Map<string, import('estree').Node>} */
context_rest_properties;

/** @type {import('./ElseBlock.js').default} */
else;

/**
* @param {import('../Component.js').default} component
* @param {import('estree').Node} parent
* @param {import('./shared/TemplateScope.js').default} scope
* @param {import('../../interfaces.js').TemplateNode} info
*/
constructor(component, parent, scope, info) {
super(component, parent, scope, info);
this.cannot_use_innerhtml();
this.not_static_content();
this.expression = new Expression(component, this, scope, info.expression);
this.context = info.context.name || 'each'; // TODO this is used to facilitate binding; currently fails with destructuring
this.context_node = info.context;
this.index = info.index;
this.scope = scope.child();
this.context_rest_properties = new Map();
this.contexts = [];
unpack_destructuring({
contexts: this.contexts,
node: info.context,
scope,
component,
context_rest_properties: this.context_rest_properties
});
this.contexts.forEach((context) => {
if (context.type !== 'DestructuredVariable') return;
this.scope.add(context.key.name, this.expression.dependencies, this);
});
if (this.index) {
// index can only change if this is a keyed each block
const dependencies = info.key ? this.expression.dependencies : new Set([]);
this.scope.add(this.index, dependencies, this);
}
this.key = info.key ? new Expression(component, this, this.scope, info.key) : null;
this.has_animation = false;
[this.const_tags, this.children] = get_const_tags(info.children, component, this, this);
if (this.has_animation) {
this.children = this.children.filter(
(child) => !is_empty_node(child) && !is_comment_node(child)
);
if (this.children.length !== 1) {
const child = this.children.find(
(child) => !!(/** @type {import('./Element.js').default} */ (child).animation)
);
component.error(
/** @type {import('./Element.js').default} */ (child).animation,
compiler_errors.invalid_animation_sole
);
return;
}
}
this.warn_if_empty_block();
this.else = info.else ? new ElseBlock(component, this, this.scope, info.else) : null;
}
}

/** @param {import('./interfaces.js').INode} node */
function is_empty_node(node) {
return node.type === 'Text' && node.data.trim() === '';
}

/** @param {import('./interfaces.js').INode} node */
function is_comment_node(node) {
return node.type === 'Comment';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export { aB as BaseReporter, ar as BasicReporter, aL as BenchmarkBuiltinReporters, aK as BenchmarkReportsMap, aG as BuiltinReporterOptions, aF as BuiltinReporters, as as DefaultReporter, at as DotReporter, aD as FileDiagnostic, au as GithubActionsReporter, av as HangingProcessReporter, ax as JUnitReporter, aH as JsonAssertionResult, aw as JsonReporter, aI as JsonTestResult, aJ as JsonTestResults, q as Reporter, aE as ReportersMap, ay as TapFlatReporter, az as TapReporter, a4 as TaskOptions, a2 as TestCase, a5 as TestCollection, a6 as TestDiagnostic, aC as TestFile, N as TestModule, Z as TestProject, a7 as TestResult, a8 as TestResultFailed, a9 as TestResultPassed, aa as TestResultSkipped, a3 as TestSuite, aA as VerboseReporter } from './chunks/reporters.nr4dxCkA.js';
import '@vitest/runner';
import './chunks/environment.LoooBwUu.js';
import 'node:stream';
import 'vite';
import '@vitest/utils';
import './chunks/config.Cy0C388Z.js';
import '@vitest/pretty-format';
import '@vitest/snapshot';
import '@vitest/snapshot/environment';
import 'vite-node';
import 'chai';
import '@vitest/utils/source-map';
import 'vite-node/client';
import 'vite-node/server';
import './chunks/benchmark.geERunq4.js';
import '@vitest/runner/utils';
import 'tinybench';
import '@vitest/snapshot/manager';
import 'node:fs';
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
type Pathname = string

interface TestResult {
ignored: boolean
unignored: boolean
}

export interface Ignore {
/**
* Adds one or several rules to the current manager.
* @param {string[]} patterns
* @returns IgnoreBase
*/
add(patterns: string | Ignore | readonly (string | Ignore)[]): this

/**
* Filters the given array of pathnames, and returns the filtered array.
* NOTICE that each path here should be a relative path to the root of your repository.
* @param paths the array of paths to be filtered.
* @returns The filtered array of paths
*/
filter(pathnames: readonly Pathname[]): Pathname[]

/**
* Creates a filter function which could filter
* an array of paths with Array.prototype.filter.
*/
createFilter(): (pathname: Pathname) => boolean

/**
* Returns Boolean whether pathname should be ignored.
* @param {string} pathname a path to check
* @returns boolean
*/
ignores(pathname: Pathname): boolean

/**
* Returns whether pathname should be ignored or unignored
* @param {string} pathname a path to check
* @returns TestResult
*/
test(pathname: Pathname): TestResult
}

export interface Options {
ignorecase?: boolean
// For compatibility
ignoreCase?: boolean
allowRelativePaths?: boolean
}

/**
* Creates new ignore manager.
*/
declare function ignore(options?: Options): Ignore

declare namespace ignore {
export function isPathValid (pathname: string): boolean
}

export default ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "turbo",
"version": "2.8.17",
"description": "Turborepo is a high-performance build system for JavaScript and TypeScript codebases.",
"homepage": "https://turborepo.dev",
"bugs": "https://github.com/vercel/turborepo/issues",
"license": "MIT",
"repository": "https://github.com/vercel/turborepo",
"bin": {
"turbo": "./bin/turbo"
},
"files": [
"bin",
"schema.json"
],
"main": "./bin/turbo",
"optionalDependencies": {
"turbo-darwin-64": "2.8.17",
"turbo-darwin-arm64": "2.8.17",
"turbo-linux-64": "2.8.17",
"turbo-linux-arm64": "2.8.17",
"turbo-windows-64": "2.8.17",
"turbo-windows-arm64": "2.8.17"
},
"scripts": {
"postversion": "node bump-version.js"
}
}
Loading
Loading