code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
run (callback) {
while (true) {
if (this.#state === parserStates.INFO) {
// If there aren't enough bytes to parse the payload length, etc.
if (this.#byteOffset < 2) {
return callback()
}
const buffer = this.consume(2)
this.#info.fin = (buffer[0] & 0x80) !== ... | Runs whenever a new chunk is received.
Callback is called whenever there are no more chunks buffering,
or not enough bytes are buffered to parse. | run | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
parseCloseBody (onlyCode, data) {
// https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
/** @type {number|undefined} */
let code
if (data.length >= 2) {
// _The WebSocket Connection Close Code_ is
// defined as the status code (Section 7.4) contained in the first Close
// con... | @see https://dom.spec.whatwg.org/#concept-event-fire
@param {string} e
@param {EventTarget} target
@param {EventInit | undefined} eventInitDict | parseCloseBody | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get closingInfo () {
return this.#info.closeInfo
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
@param {import('./websocket').WebSocket} ws
@param {number} type Opcode
@param {Buffer} data application data | closingInfo | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isEstablished (ws) {
// If the server's response is validated as provided for above, it is
// said that _The WebSocket Connection is Established_ and that the
// WebSocket Connection is in the OPEN state.
return ws[kReadyState] === states.OPEN
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
@param {import('./websocket').WebSocket} ws
@param {number} type Opcode
@param {Buffer} data application data | isEstablished | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isClosing (ws) {
// Upon either sending or receiving a Close control frame, it is said
// that _The WebSocket Closing Handshake is Started_ and that the
// WebSocket connection is in the CLOSING state.
return ws[kReadyState] === states.CLOSING
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
@param {import('./websocket').WebSocket} ws
@param {number} type Opcode
@param {Buffer} data application data | isClosing | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isClosed (ws) {
return ws[kReadyState] === states.CLOSED
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
@param {import('./websocket').WebSocket} ws
@param {number} type Opcode
@param {Buffer} data application data | isClosed | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function isValidStatusCode (code) {
if (code >= 1000 && code < 1015) {
return (
code !== 1004 && // reserved
code !== 1005 && // "MUST NOT be set as a status code"
code !== 1006 // "MUST NOT be set as a status code"
)
}
return code >= 3000 && code <= 4999
} | @param {string} url
@param {string|string[]} protocols | isValidStatusCode | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
function failWebsocketConnection (ws, reason) {
const { [kController]: controller, [kResponse]: response } = ws
controller.abort()
if (response?.socket && !response.socket.destroyed) {
response.socket.destroy()
}
if (reason) {
fireEvent('error', ws, ErrorEvent, {
error: new Error(reason)
... | @param {string} url
@param {string|string[]} protocols | failWebsocketConnection | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
close (code = undefined, reason = undefined) {
webidl.brandCheck(this, WebSocket)
if (code !== undefined) {
code = webidl.converters['unsigned short'](code, { clamp: true })
}
if (reason !== undefined) {
reason = webidl.converters.USVString(reason)
}
// 1. If code is present, but ... | @see https://websockets.spec.whatwg.org/#dom-websocket-close
@param {number|undefined} code
@param {string|undefined} reason | close | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get readyState () {
webidl.brandCheck(this, WebSocket)
// The readyState getter steps are to return this's ready state.
return this[kReadyState]
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | readyState | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get bufferedAmount () {
webidl.brandCheck(this, WebSocket)
return this.#bufferedAmount
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | bufferedAmount | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get url () {
webidl.brandCheck(this, WebSocket)
// The url getter steps are to return this's url, serialized.
return URLSerializer(this[kWebSocketURL])
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | url | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get extensions () {
webidl.brandCheck(this, WebSocket)
return this.#extensions
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | extensions | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get protocol () {
webidl.brandCheck(this, WebSocket)
return this.#protocol
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | protocol | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get onopen () {
webidl.brandCheck(this, WebSocket)
return this.#events.open
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | onopen | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onopen (fn) {
webidl.brandCheck(this, WebSocket)
if (this.#events.open) {
this.removeEventListener('open', this.#events.open)
}
if (typeof fn === 'function') {
this.#events.open = fn
this.addEventListener('open', fn)
} else {
this.#events.open = null
}
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | onopen | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get onerror () {
webidl.brandCheck(this, WebSocket)
return this.#events.error
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | onerror | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onerror (fn) {
webidl.brandCheck(this, WebSocket)
if (this.#events.error) {
this.removeEventListener('error', this.#events.error)
}
if (typeof fn === 'function') {
this.#events.error = fn
this.addEventListener('error', fn)
} else {
this.#events.error = null
}
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | onerror | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get onclose () {
webidl.brandCheck(this, WebSocket)
return this.#events.close
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | onclose | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onclose (fn) {
webidl.brandCheck(this, WebSocket)
if (this.#events.close) {
this.removeEventListener('close', this.#events.close)
}
if (typeof fn === 'function') {
this.#events.close = fn
this.addEventListener('close', fn)
} else {
this.#events.close = null
}
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | onclose | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get onmessage () {
webidl.brandCheck(this, WebSocket)
return this.#events.message
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | onmessage | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set onmessage (fn) {
webidl.brandCheck(this, WebSocket)
if (this.#events.message) {
this.removeEventListener('message', this.#events.message)
}
if (typeof fn === 'function') {
this.#events.message = fn
this.addEventListener('message', fn)
} else {
this.#events.message = nul... | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | onmessage | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
get binaryType () {
webidl.brandCheck(this, WebSocket)
return this[kBinaryType]
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | binaryType | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
set binaryType (type) {
webidl.brandCheck(this, WebSocket)
if (type !== 'blob' && type !== 'arraybuffer') {
this[kBinaryType] = 'blob'
} else {
this[kBinaryType] = type
}
} | @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol | binaryType | javascript | vercel/next.js | .github/actions/next-integration-stat/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-integration-stat/dist/index.js | MIT |
async linkPackages({
repoDir,
nextSwcVersion: nextSwcVersionSpecified,
parentSpan,
}) {
if (!parentSpan) {
// Not all callers provide a parent span
parentSpan = mockSpan()
}
/** @type {Map<string, string>} */
const pkgPaths = new Map()
/** @type {Map<s... | Runs `pnpm pack` on each package in the `packages` folder of the provided `repoDir`
@param {{ repoDir: string, nextSwcVersion: null | string }} options Required options
@returns {Promise<Map<string, string>>} List packages key is the package name, value is the path to the packed tar file.' | linkPackages | javascript | vercel/next.js | .github/actions/next-stats-action/src/prepare/repo-setup.js | https://github.com/vercel/next.js/blob/master/.github/actions/next-stats-action/src/prepare/repo-setup.js | MIT |
constructor(command, opts) {
this.serialize = defaultSerializer;
this.deserialize = opts?.automaticDeserialization === void 0 || opts.automaticDeserialization ? opts?.deserialize ?? parseResponse : (x) => x;
this.command = command.map((c) => this.serialize(c));
if (opts?.latencyLogging) {
const or... | Create a new command instance.
You can define a custom `deserialize` function. By default we try to deserialize as json. | constructor | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
length() {
return this.commands.length;
} | Returns the length of pipeline before the execution | length | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
chain(command) {
this.commands.push(command);
return this;
} | Pushes a command into the pipeline and returns a chainable instance of the
pipeline | chain | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
get json() {
return {
/**
* @see https://redis.io/commands/json.arrappend
*/
arrappend: (...args) => this.chain(new JsonArrAppendCommand(args, this.commandOptions)),
/**
* @see https://redis.io/commands/json.arrindex
*/
arrindex: (...args) => this.chain(new JsonAr... | @see https://redis.io/commands/?group=json | json | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
constructor(redis, script) {
this.redis = redis;
this.sha1 = this.digest(script);
this.script = script;
} | @see https://redis.io/commands/json.type | constructor | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
async eval(keys, args) {
return await this.redis.eval(this.script, keys, args);
} | Send an `EVAL` command to redis. | eval | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
async evalsha(keys, args) {
return await this.redis.evalsha(this.sha1, keys, args);
} | Calculates the sha1 hash of the script and then calls `EVALSHA`. | evalsha | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
async exec(keys, args) {
const res = await this.redis.evalsha(this.sha1, keys, args).catch(async (error) => {
if (error instanceof Error && error.message.toLowerCase().includes("noscript")) {
return await this.redis.eval(this.script, keys, args);
}
throw error;
});
return res;
} | Optimistically try to run `EVALSHA` first.
If the script is not loaded in redis, it will fall back and try again with `EVAL`.
Following calls will be able to use the cached script | exec | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
digest(s) {
return import_enc_hex.default.stringify((0, import_sha1.default)(s));
} | Compute the sha1 hash of the script and return its hex representation. | digest | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
constructor(client, opts) {
this.client = client;
this.opts = opts;
this.enableTelemetry = opts?.enableTelemetry ?? true;
if (opts?.readYourWrites === false) {
this.client.readYourWrites = false;
}
this.enableAutoPipelining = opts?.enableAutoPipelining ?? true;
} | Create a new redis client
@example
```typescript
const redis = new Redis({
url: "<UPSTASH_REDIS_REST_URL>",
token: "<UPSTASH_REDIS_REST_TOKEN>",
});
``` | constructor | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
get readYourWritesSyncToken() {
return this.client.upstashSyncToken;
} | Create a new redis client
@example
```typescript
const redis = new Redis({
url: "<UPSTASH_REDIS_REST_URL>",
token: "<UPSTASH_REDIS_REST_TOKEN>",
});
``` | readYourWritesSyncToken | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
set readYourWritesSyncToken(session) {
this.client.upstashSyncToken = session;
} | Create a new redis client
@example
```typescript
const redis = new Redis({
url: "<UPSTASH_REDIS_REST_URL>",
token: "<UPSTASH_REDIS_REST_TOKEN>",
});
``` | readYourWritesSyncToken | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
get json() {
return {
/**
* @see https://redis.io/commands/json.arrappend
*/
arrappend: (...args) => new JsonArrAppendCommand(args, this.opts).exec(this.client),
/**
* @see https://redis.io/commands/json.arrindex
*/
arrindex: (...args) => new JsonArrIndexCommand(a... | Create a new redis client
@example
```typescript
const redis = new Redis({
url: "<UPSTASH_REDIS_REST_URL>",
token: "<UPSTASH_REDIS_REST_TOKEN>",
});
``` | json | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
createScript(script) {
return new Script(this, script);
} | Technically this is not private, we can hide it from intellisense by doing this | createScript | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
constructor(configOrRequester) {
if ("request" in configOrRequester) {
super(configOrRequester);
return;
}
if (!configOrRequester.url) {
console.warn(
`[Upstash Redis] The 'url' property is missing or undefined in your Redis config.`
);
} else if (configOrRequester.url.st... | Create a new redis client by providing a custom `Requester` implementation
@example
```ts
import { UpstashRequest, Requester, UpstashResponse, Redis } from "@upstash/redis"
const requester: Requester = {
request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
// ...
}
}
const re... | constructor | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
static fromEnv(config) {
if (process.env === void 0) {
throw new TypeError(
'[Upstash Redis] Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead'
);
}
const url = process.env.UPSTASH_R... | Create a new Upstash Redis instance from environment variables.
Use this to automatically load connection secrets from your environment
variables. For instance when using the Vercel integration.
This tries to load `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from
your environment using `process.env`. | fromEnv | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
async *scanIterator(options) {
let cursor = "0";
let keys;
do {
[cursor, keys] = await this.scan(cursor, options);
for (const key of keys) {
yield key;
}
} while (cursor !== "0");
} | Same as `scan` but returns an AsyncIterator to allow iteration via `for await`. | scanIterator | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
async *hscanIterator(key, options) {
let cursor = "0";
let items;
do {
[cursor, items] = await this.hscan(key, cursor, options);
for (const item of items) {
yield item;
}
} while (cursor !== "0");
} | Same as `hscan` but returns an AsyncIterator to allow iteration via `for await`. | hscanIterator | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
async *sscanIterator(key, options) {
let cursor = "0";
let items;
do {
[cursor, items] = await this.sscan(key, cursor, options);
for (const item of items) {
yield item;
}
} while (cursor !== "0");
} | Same as `sscan` but returns an AsyncIterator to allow iteration via `for await`. | sscanIterator | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
async *zscanIterator(key, options) {
let cursor = "0";
let items;
do {
[cursor, items] = await this.zscan(key, cursor, options);
for (const item of items) {
yield item;
}
} while (cursor !== "0");
} | Same as `zscan` but returns an AsyncIterator to allow iteration via `for await`. | zscanIterator | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
function createClient(config) {
return new VercelKV({
// The Next.js team recommends no value or `default` for fetch requests's `cache` option
// upstash/redis defaults to `no-store`, so we enforce `default`
cache: "default",
enableAutoPipelining: true,
...config
});
} | Same as `zscan` but returns an AsyncIterator to allow iteration via `for await`. | createClient | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
get(target, prop, receiver) {
if (prop === "then" || prop === "parse") {
return Reflect.get(target, prop, receiver);
}
if (!_kv) {
if (!process.env.KV_REST_API_URL || !process.env.KV_REST_API_TOKEN) {
throw new Error(
"@vercel/kv: Missing required environment vari... | Same as `zscan` but returns an AsyncIterator to allow iteration via `for await`. | get | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
get(target, prop) {
if (!_kv) {
if (!process.env.KV_REST_API_URL || !process.env.KV_REST_API_TOKEN) {
throw new Error(
"@vercel/kv: Missing required environment variables KV_REST_API_URL and KV_REST_API_TOKEN"
);
}
_kv = createClient({
url: process... | Same as `zscan` but returns an AsyncIterator to allow iteration via `for await`. | get | javascript | vercel/next.js | .github/actions/upload-turboyet-data/dist/index.js | https://github.com/vercel/next.js/blob/master/.github/actions/upload-turboyet-data/dist/index.js | MIT |
TinaProvider = ({ children }) => {
return <TinaCMS {...tinaConfig}>{children}</TinaCMS>;
} | @private Do not import this directly, please import the dynamic provider instead | TinaProvider | javascript | vercel/next.js | examples/cms-tina/.tina/components/TinaProvider.js | https://github.com/vercel/next.js/blob/master/examples/cms-tina/.tina/components/TinaProvider.js | MIT |
TinaProvider = ({ children }) => {
return <TinaCMS {...tinaConfig}>{children}</TinaCMS>;
} | @private Do not import this directly, please import the dynamic provider instead | TinaProvider | javascript | vercel/next.js | examples/cms-tina/.tina/components/TinaProvider.js | https://github.com/vercel/next.js/blob/master/examples/cms-tina/.tina/components/TinaProvider.js | MIT |
async function createCouchbaseCluster() {
if (cached.conn) {
return cached.conn;
}
cached.conn = await couchbase.connect(
"couchbase://" +
COUCHBASE_ENDPOINT +
(IS_CLOUD_INSTANCE === "true"
? "?ssl=no_verify&console_log_level=5"
: ""),
{
username: COUCHBASE_USER,
... | Global is used here to maintain a cached connection across hot reloads
in development. This prevents connections growing exponentially
during API Route usage. | createCouchbaseCluster | javascript | vercel/next.js | examples/with-couchbase/util/couchbase.js | https://github.com/vercel/next.js/blob/master/examples/with-couchbase/util/couchbase.js | MIT |
async function connectToDatabase() {
const cluster = await createCouchbaseCluster();
const bucket = cluster.bucket(COUCHBASE_BUCKET);
const collection = bucket.defaultCollection();
let dbConnection = {
cluster,
bucket,
collection,
};
return dbConnection;
} | Global is used here to maintain a cached connection across hot reloads
in development. This prevents connections growing exponentially
during API Route usage. | connectToDatabase | javascript | vercel/next.js | examples/with-couchbase/util/couchbase.js | https://github.com/vercel/next.js/blob/master/examples/with-couchbase/util/couchbase.js | MIT |
function getKnex() {
if (!cached.instance) cached.instance = knex(config);
return cached.instance;
} | Global is used here to ensure the connection
is cached across hot-reloads in development
see https://github.com/vercel/next.js/discussions/12229#discussioncomment-83372 | getKnex | javascript | vercel/next.js | examples/with-knex/knex/index.js | https://github.com/vercel/next.js/blob/master/examples/with-knex/knex/index.js | MIT |
function MyApp({ Component, pageProps }) {
return (
/* Here we call NextSeo and pass our default configuration to it */
<>
<DefaultSeo {...SEO} />
<Component {...pageProps} />
</>
);
} | Using a custom _app.js with next-seo you can set default SEO
that will apply to every page. Full info on how the default works
can be found here: https://github.com/garmeeh/next-seo#default-seo-configuration | MyApp | javascript | vercel/next.js | examples/with-next-seo/pages/_app.js | https://github.com/vercel/next.js/blob/master/examples/with-next-seo/pages/_app.js | MIT |
async function createUser({ username, password }) {
// Here you should create the user and save the salt and hashed password (some dbs may have
// authentication methods that will do it for you so you don't have to worry about it):
const salt = crypto.randomBytes(16).toString("hex");
const hash = crypto
.pb... | User methods. The example doesn't contain a DB, but for real applications you must use a
db here, such as MongoDB, Fauna, SQL, etc. | createUser | javascript | vercel/next.js | examples/with-passport/lib/user.js | https://github.com/vercel/next.js/blob/master/examples/with-passport/lib/user.js | MIT |
async function findUser({ username }) {
// This is an in memory store for users, there is no data persistence without a proper DB
return users.find((user) => user.username === username);
} | User methods. The example doesn't contain a DB, but for real applications you must use a
db here, such as MongoDB, Fauna, SQL, etc. | findUser | javascript | vercel/next.js | examples/with-passport/lib/user.js | https://github.com/vercel/next.js/blob/master/examples/with-passport/lib/user.js | MIT |
function validatePassword(user, inputPassword) {
const inputHash = crypto
.pbkdf2Sync(inputPassword, user.salt, 1000, 64, "sha512")
.toString("hex");
const passwordsMatch = user.hash === inputHash;
return passwordsMatch;
} | User methods. The example doesn't contain a DB, but for real applications you must use a
db here, such as MongoDB, Fauna, SQL, etc. | validatePassword | javascript | vercel/next.js | examples/with-passport/lib/user.js | https://github.com/vercel/next.js/blob/master/examples/with-passport/lib/user.js | MIT |
create(context) {
function checkRequireCall(node) {
// Check if this is a require() call
if (
node.type !== 'CallExpression' ||
node.callee.type !== 'Identifier' ||
node.callee.name !== 'require' ||
node.arguments.length !== 1 ||
node.arguments[0].type !== 'Litera... | ESLint rule: typechecked-require
Ensures every require(source) call is cast to typeof import(source)
Source: https://v0.dev/chat/eslint-cast-imports-CDvQ3iWC1Mo | create | javascript | vercel/next.js | packages/eslint-plugin-internal/src/eslint-typechecked-require.js | https://github.com/vercel/next.js/blob/master/packages/eslint-plugin-internal/src/eslint-typechecked-require.js | MIT |
function checkRequireCall(node) {
// Check if this is a require() call
if (
node.type !== 'CallExpression' ||
node.callee.type !== 'Identifier' ||
node.callee.name !== 'require' ||
node.arguments.length !== 1 ||
node.arguments[0].type !== 'Literal'
) {
r... | ESLint rule: typechecked-require
Ensures every require(source) call is cast to typeof import(source)
Source: https://v0.dev/chat/eslint-cast-imports-CDvQ3iWC1Mo | checkRequireCall | javascript | vercel/next.js | packages/eslint-plugin-internal/src/eslint-typechecked-require.js | https://github.com/vercel/next.js/blob/master/packages/eslint-plugin-internal/src/eslint-typechecked-require.js | MIT |
fix(fixer) {
// importSource as source of truth since that's what's typechecked
// and will be changed by automated refactors.
const newCast = `(require('${importSource}') as typeof import('${importSource}'))`
return fixer.replaceText(parent, newCa... | ESLint rule: typechecked-require
Ensures every require(source) call is cast to typeof import(source)
Source: https://v0.dev/chat/eslint-cast-imports-CDvQ3iWC1Mo | fix | javascript | vercel/next.js | packages/eslint-plugin-internal/src/eslint-typechecked-require.js | https://github.com/vercel/next.js/blob/master/packages/eslint-plugin-internal/src/eslint-typechecked-require.js | MIT |
fix(fixer) {
const newCast = `(require('${requireSource}') as typeof import('${requireSource}'))`
return fixer.replaceText(parent, newCast)
} | ESLint rule: typechecked-require
Ensures every require(source) call is cast to typeof import(source)
Source: https://v0.dev/chat/eslint-cast-imports-CDvQ3iWC1Mo | fix | javascript | vercel/next.js | packages/eslint-plugin-internal/src/eslint-typechecked-require.js | https://github.com/vercel/next.js/blob/master/packages/eslint-plugin-internal/src/eslint-typechecked-require.js | MIT |
fix(fixer) {
const newCast = `(require('${requireSource}') as typeof import('${requireSource}'))`
return fixer.replaceText(node, newCast)
} | ESLint rule: typechecked-require
Ensures every require(source) call is cast to typeof import(source)
Source: https://v0.dev/chat/eslint-cast-imports-CDvQ3iWC1Mo | fix | javascript | vercel/next.js | packages/eslint-plugin-internal/src/eslint-typechecked-require.js | https://github.com/vercel/next.js/blob/master/packages/eslint-plugin-internal/src/eslint-typechecked-require.js | MIT |
externalHandler = ({ context, request, getResolve }, callback) => {
;(async () => {
if (
request.match(
/next[/\\]dist[/\\]compiled[/\\](babel|webpack|source-map|semver|jest-worker|stacktrace-parser|@ampproject\/toolbox-optimizer)/
)
) {
callback(null, 'commonjs ' + req... | @param {Object} options
@param {boolean} options.dev
@param {boolean} options.turbo
@param {keyof typeof bundleTypes} options.bundleType
@param {boolean} options.experimental
@param {Partial<webpack.Configuration>} options.rest
@returns {webpack.Configuration} | externalHandler | javascript | vercel/next.js | packages/next/next-runtime.webpack-config.js | https://github.com/vercel/next.js/blob/master/packages/next/next-runtime.webpack-config.js | MIT |
externalHandler = ({ context, request, getResolve }, callback) => {
;(async () => {
if (
request.match(
/next[/\\]dist[/\\]compiled[/\\](babel|webpack|source-map|semver|jest-worker|stacktrace-parser|@ampproject\/toolbox-optimizer)/
)
) {
callback(null, 'commonjs ' + req... | @param {Object} options
@param {boolean} options.dev
@param {boolean} options.turbo
@param {keyof typeof bundleTypes} options.bundleType
@param {boolean} options.experimental
@param {Partial<webpack.Configuration>} options.rest
@returns {webpack.Configuration} | externalHandler | javascript | vercel/next.js | packages/next/next-runtime.webpack-config.js | https://github.com/vercel/next.js/blob/master/packages/next/next-runtime.webpack-config.js | MIT |
function calculateUniquePort(dev, turbo, experimental, bundleType) {
const devOffset = dev ? 1000 : 0
const turboOffset = turbo ? 200 : 0
const experimentalOffset = experimental ? 40 : 0
let bundleTypeOffset
switch (bundleType) {
case 'app':
bundleTypeOffset = 1
break
case 'pages':
... | @param {Object} options
@param {boolean} options.dev
@param {boolean} options.turbo
@param {keyof typeof bundleTypes} options.bundleType
@param {boolean} options.experimental
@param {Partial<webpack.Configuration>} options.rest
@returns {webpack.Configuration} | calculateUniquePort | javascript | vercel/next.js | packages/next/next-runtime.webpack-config.js | https://github.com/vercel/next.js/blob/master/packages/next/next-runtime.webpack-config.js | MIT |
async function server(task, opts) {
await task
.source('src/server/**/!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/server')
} | /!(*.test).+(js|ts|tsx|json)')
.swc('server', { dev: opts.dev })
.target('dist/lib')
}
export async function lib_esm(task, opts) {
await task
.source('src/lib/* | server | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function server_esm(task, opts) {
await task
.source('src/server/**/!(*.test).+(js|mts|ts|tsx)')
.swc('server', { dev: opts.dev, esm: true })
.target('dist/esm/server')
} | /!(*.test).+(js|ts|tsx|json)')
.swc('server', { dev: opts.dev })
.target('dist/lib')
}
export async function lib_esm(task, opts) {
await task
.source('src/lib/* | server_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function api_esm(task, opts) {
await task
.source('src/api/**/*.+(js|mts|ts|tsx)')
.swc('server', { dev: opts.dev, esm: true })
.target('dist/api')
.target('dist/esm/api')
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/server')
}
export async function server_esm(task, opts) {
await task
.source('src/server/* | api_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function nextbuild(task, opts) {
await task
.source('src/build/**/*.+(js|ts|tsx)', {
ignore: [
'**/fixture/**',
'**/tests/**',
'**/jest/**',
'**/*.test.d.ts',
'**/*.test.+(js|ts|tsx)',
],
})
.swc('server', { dev: opts.dev })
.target('dist/build... | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/server')
}
export async function server_esm(task, opts) {
await task
.source('src/server/* | nextbuild | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function next_devtools_entrypoint(task, opts) {
await task
.source('src/next-devtools/dev-overlay.shim.ts')
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools')
} | /!(*.test|*.stories).+(js|ts|tsx|woff2)')
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/client')
}
export async function client_esm(task, opts) {
await task
.source('src/client/* | next_devtools_entrypoint | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function next_devtools_server(task, opts) {
await task
.source(
'src/next-devtools/server/**/!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools/server')
} | /!(*.test|*.stories).+(js|ts|tsx|woff2)')
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/client')
}
export async function client_esm(task, opts) {
await task
.source('src/client/* | next_devtools_server | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function next_devtools_server_esm(task, opts) {
await task
.source(
'src/next-devtools/server/**/!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, esm: true })
.target('dist/esm/next-devtools/server')
} | /!(*.test|*.stories).+(js|ts|tsx|woff2)')
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/client')
}
export async function client_esm(task, opts) {
await task
.source('src/client/* | next_devtools_server_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function next_devtools_shared(task, opts) {
await task
.source(
'src/next-devtools/shared/**/!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools/shared')
} | /!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools/server')
}
export async function next_devtools_server_esm(task, opts) {
await task
.source(
'src/next-devtools/server/* | next_devtools_shared | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function next_devtools_shared_esm(task, opts) {
await task
.source(
'src/next-devtools/shared/**/!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, esm: true })
.target('dist/esm/next-devtools/shared')
} | /!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools/server')
}
export async function next_devtools_server_esm(task, opts) {
await task
.source(
'src/next-devtools/server/* | next_devtools_shared_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function next_devtools_userspace(task, opts) {
await task
.source(
'src/next-devtools/userspace/**/!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools/userspace')
} | /!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools/shared')
}
export async function next_devtools_shared_esm(task, opts) {
await task
.source(
'src/next-devtools/shared/* | next_devtools_userspace | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function next_devtools_userspace_esm(task, opts) {
await task
.source(
'src/next-devtools/userspace/**/!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, esm: true })
.target('dist/esm/next-devtools/userspace')
} | /!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools/shared')
}
export async function next_devtools_shared_esm(task, opts) {
await task
.source(
'src/next-devtools/shared/* | next_devtools_userspace_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function nextbuildstatic(task, opts) {
await task
.source('src/export/**/!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
} | /!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools/userspace')
}
export async function next_devtools_userspace_esm(task, opts) {
await task
.source(
'src/next-devtools/userspace/* | nextbuildstatic | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/**/!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev, esm: true })
.target('dist/esm/export')
} | /!(*.test|*.stories).+(js|ts|tsx|woff2)'
)
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/next-devtools/userspace')
}
export async function next_devtools_userspace_esm(task, opts) {
await task
.source(
'src/next-devtools/userspace/* | nextbuildstatic_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function pages_app(task, opts) {
await task
.source('src/pages/_app.tsx')
.swc('client', {
dev: opts.dev,
interopClientDefaultExport: true,
})
.target('dist/pages')
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | pages_app | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function pages_error(task, opts) {
await task
.source('src/pages/_error.tsx')
.swc('client', {
dev: opts.dev,
interopClientDefaultExport: true,
})
.target('dist/pages')
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | pages_error | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function pages_document(task, opts) {
await task
.source('src/pages/_document.tsx')
.swc('server', {
dev: opts.dev,
})
.target('dist/pages')
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | pages_document | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function pages_app_esm(task, opts) {
await task
.source('src/pages/_app.tsx')
.swc('client', {
dev: opts.dev,
esm: true,
})
.target('dist/esm/pages')
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | pages_app_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function pages_error_esm(task, opts) {
await task
.source('src/pages/_error.tsx')
.swc('client', {
dev: opts.dev,
esm: true,
})
.target('dist/esm/pages')
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | pages_error_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function pages_document_esm(task, opts) {
await task
.source('src/pages/_document.tsx')
.swc('server', {
dev: opts.dev,
esm: true,
})
.target('dist/esm/pages')
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | pages_document_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function pages(task, opts) {
await task.parallel(['pages_app', 'pages_error', 'pages_document'], opts)
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | pages | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function pages_esm(task, opts) {
await task.parallel(
['pages_app_esm', 'pages_error_esm', 'pages_document_esm'],
opts
)
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | pages_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function telemetry(task, opts) {
await task
.source('src/telemetry/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/telemetry')
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | telemetry | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function trace(task, opts) {
await task
.source('src/trace/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/trace')
} | /!(*.test).+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/export')
}
// export is a reserved keyword for functions
export async function nextbuildstatic_esm(task, opts) {
await task
.source('src/export/* | trace | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function diagnostics(task, opts) {
await task
.source('src/diagnostics/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/diagnostics')
} | /*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/telemetry')
}
export async function trace(task, opts) {
await task
.source('src/trace/* | diagnostics | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function build(task, opts) {
await task.serial(
['precompile', 'compile', 'check_error_codes', 'generate_types'],
opts
)
} | /*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/telemetry')
}
export async function trace(task, opts) {
await task
.source('src/trace/* | build | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function generate_types(task, opts) {
const watchmode = opts.dev
const typesPromise = execa(
'pnpm',
[
'run',
'types',
...(watchmode ? ['--watch', '--preserveWatchOutput'] : []),
],
{ stdio: 'inherit' }
)
// In watch-mode the process never completes i.e. the Promise never... | /*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/telemetry')
}
export async function trace(task, opts) {
await task
.source('src/trace/* | generate_types | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function check_error_codes(task, opts) {
try {
await execa.command('pnpm -w run check-error-codes', {
stdio: 'inherit',
})
} catch (err) {
if (process.env.CI) {
await execa.command(
'echo check_error_codes FAILED: There are new errors introduced but no corresponding error codes... | /*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/telemetry')
}
export async function trace(task, opts) {
await task
.source('src/trace/* | check_error_codes | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function shared(task, opts) {
await task
.source('src/shared/**/*.+(js|ts|tsx)', {
ignore: [
'src/shared/**/{amp,config,constants,dynamic,app-dynamic,head,runtime-config}.+(js|ts|tsx)',
'**/*.test.d.ts',
'**/*.test.+(js|ts|tsx)',
],
})
.swc('client', { dev: opts.d... | /*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev })
.target('dist/telemetry')
}
export async function trace(task, opts) {
await task
.source('src/trace/* | shared | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function shared_esm(task, opts) {
await task
.source('src/shared/**/*.+(js|ts|tsx)', {
ignore: [
'src/shared/**/{amp,config,constants,dynamic,app-dynamic,head,runtime-config}.+(js|ts|tsx)',
'**/*.test.d.ts',
'**/*.test.+(js|ts|tsx)',
],
})
.swc('client', { dev: op... | /{amp,config,constants,dynamic,app-dynamic,head,runtime-config}.+(js|ts|tsx)',
'* | shared_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function shared_re_exported(task, opts) {
await task
.source(
'src/shared/**/{amp,config,constants,dynamic,app-dynamic,head,runtime-config}.+(js|ts|tsx)',
{
ignore: ['**/*.test.d.ts', '**/*.test.+(js|ts|tsx)'],
}
)
.swc('client', { dev: opts.dev, interopClientDefaultExport:... | /*.+(js|ts|tsx)', {
ignore: [
'src/shared/* | shared_re_exported | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function shared_re_exported_esm(task, opts) {
await task
.source(
'src/shared/**/{amp,config,constants,app-dynamic,dynamic,head}.+(js|ts|tsx)',
{
ignore: ['**/*.test.d.ts', '**/*.test.+(js|ts|tsx)'],
}
)
.swc('client', {
dev: opts.dev,
esm: true,
})
.tar... | /{amp,config,constants,dynamic,app-dynamic,head,runtime-config}.+(js|ts|tsx)',
{
ignore: ['* | shared_re_exported_esm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function server_wasm(task, opts) {
await task.source('src/server/**/*.+(wasm)').target('dist/server')
} | /{amp,config,constants,app-dynamic,dynamic,head}.+(js|ts|tsx)',
{
ignore: ['* | server_wasm | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function experimental_testing(task, opts) {
await task
.source('src/experimental/testing/**/!(*.test).+(js|ts|tsx)')
.swc('server', {
dev: opts.dev,
})
.target('dist/experimental/testing')
} | /{amp,config,constants,app-dynamic,dynamic,head}.+(js|ts|tsx)',
{
ignore: ['* | experimental_testing | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function experimental_testmode(task, opts) {
await task
.source('src/experimental/testmode/**/!(*.test).+(js|ts|tsx)')
.swc('server', {
dev: opts.dev,
})
.target('dist/experimental/testmode')
} | /*.+(wasm)').target('dist/server')
}
export async function experimental_testing(task, opts) {
await task
.source('src/experimental/testing/* | experimental_testmode | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
async function release(task) {
await task.clear('dist').start('build')
} | /*.+(wasm)').target('dist/server')
}
export async function experimental_testing(task, opts) {
await task
.source('src/experimental/testing/* | release | javascript | vercel/next.js | packages/next/taskfile.js | https://github.com/vercel/next.js/blob/master/packages/next/taskfile.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.