repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/service-worker/src/ServiceWorkerRuntime.js | packages/runtimes/service-worker/src/ServiceWorkerRuntime.js | // @flow
import {Runtime} from '@parcel/plugin';
import {urlJoin} from '@parcel/utils';
export default (new Runtime({
apply({bundle, bundleGraph}) {
if (bundle.env.context !== 'service-worker') {
return [];
}
let asset = bundle.traverse((node, _, actions) => {
if (
node.type === 'dep... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/hmr/src/HMRRuntime.js | packages/runtimes/hmr/src/HMRRuntime.js | // @flow strict-local
import {Runtime} from '@parcel/plugin';
import fs from 'fs';
import path from 'path';
// Without this, the hmr-runtime.js is transpiled with the React Refresh swc transform because it
// lives in `/app/packages/runtimes/...` and thus the `config` in the JSTransformer is actually the
// user's pa... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/hmr/src/loaders/hmr-runtime.js | packages/runtimes/hmr/src/loaders/hmr-runtime.js | // @flow
/* global HMR_HOST, HMR_PORT, HMR_SERVER_PORT, HMR_ENV_HASH, HMR_SECURE, HMR_USE_SSE, chrome, browser, __parcel__import__, __parcel__importScripts__, ServiceWorkerGlobalScope */
/*::
import type {
HMRAsset,
HMRMessage,
} from '@parcel/reporter-dev-server/src/HMRServer.js';
interface ParcelRequire {
(str... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/JSRuntime.js | packages/runtimes/js/src/JSRuntime.js | // @flow strict-local
import type {
BundleGraph,
BundleGroup,
Dependency,
Environment,
PluginOptions,
NamedBundle,
RuntimeAsset,
} from '@parcel/types';
import {Runtime} from '@parcel/plugin';
import {relativeBundlePath, urlJoin, getImportMap} from '@parcel/utils';
import path from 'path';
import nullth... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/get-worker-url.js | packages/runtimes/js/src/helpers/get-worker-url.js | module.exports = function loadWorker(workerUrl, origin, isESM) {
if (origin === self.location.origin) {
// If the worker bundle's url is on the same origin as the document,
// use the worker bundle's own url.
return workerUrl;
} else {
// Otherwise, create a blob URL which loads the worker bundle wi... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/cacheLoader.js | packages/runtimes/js/src/helpers/cacheLoader.js | let cachedBundles = {};
let cachedPreloads = {};
let cachedPrefetches = {};
function getCache(type) {
switch (type) {
case 'preload':
return cachedPreloads;
case 'prefetch':
return cachedPrefetches;
default:
return cachedBundles;
}
}
module.exports = function cacheLoader(loader, type... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/worker/wasm-loader.js | packages/runtimes/js/src/helpers/worker/wasm-loader.js | const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function loadWASMBundle(bundle) {
return fetch(bundle)
.then(function (res) {
if (WebAssembly.instantiateStreaming) {
return WebAssembly.instantiateStreaming(res);
} else {
return res.arrayBuffer().then(functi... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/worker/js-loader.js | packages/runtimes/js/src/helpers/worker/js-loader.js | /* global __parcel__importScripts__:readonly*/
const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function loadJSBundle(bundle) {
return new Promise(function (resolve, reject) {
try {
__parcel__importScripts__(bundle);
resolve();
} catch (e) {
reject(e);
}
});... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/node/node-loader.js | packages/runtimes/js/src/helpers/node/node-loader.js | const url = require('url');
const {createRequire} = require('module');
module.exports = function loadNodeModule(bundle) {
let path = url.fileURLToPath(bundle);
let require = createRequire(path);
return require(path);
};
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/node/css-loader.js | packages/runtimes/js/src/helpers/node/css-loader.js | // loading a CSS style is a no-op in Node.js
module.exports = function loadCSSBundle() {
return Promise.resolve();
};
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/node/wasm-loader.js | packages/runtimes/js/src/helpers/node/wasm-loader.js | const fs = require('fs');
const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function loadWASMBundle(bundle) {
return new Promise(function (resolve, reject) {
fs.readFile(__dirname + bundle, function (err, data) {
if (err) {
reject(err);
} else {
resolve(data.... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/node/js-loader.js | packages/runtimes/js/src/helpers/node/js-loader.js | const fs = require('fs');
const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function loadJSBundle(bundle) {
return new Promise(function (resolve, reject) {
fs.readFile(__dirname + bundle, 'utf8', function (err, data) {
if (err) {
reject(err);
} else {
// wait... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/node/html-loader.js | packages/runtimes/js/src/helpers/node/html-loader.js | const fs = require('fs');
const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function loadHTMLBundle(bundle) {
return new Promise(function (resolve, reject) {
fs.readFile(__dirname + bundle, 'utf8', function (err, data) {
if (err) {
reject(err);
} else {
// wa... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/browser/import-polyfill.js | packages/runtimes/js/src/helpers/browser/import-polyfill.js | const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function importModule(bundle) {
return new Promise((resolve, reject) => {
// Add a global function to handle when the script loads.
let globalName = `i${('' + Math.random()).slice(2)}`;
global[globalName] = m => {
resolve(m... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/browser/css-loader.js | packages/runtimes/js/src/helpers/browser/css-loader.js | const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function loadCSSBundle(bundle) {
return new Promise(function (resolve, reject) {
if (typeof document === 'undefined') {
return resolve();
}
var link = document.createElement('link');
link.rel = 'stylesheet';
link.h... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/browser/wasm-loader.js | packages/runtimes/js/src/helpers/browser/wasm-loader.js | const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function loadWASMBundle(bundle) {
return fetch(bundle)
.then(function (res) {
if (WebAssembly.instantiateStreaming) {
return WebAssembly.instantiateStreaming(res);
} else {
return res.arrayBuffer().then(functi... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/browser/preload-loader.js | packages/runtimes/js/src/helpers/browser/preload-loader.js | const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function preloadJSBundle(
bundle,
priority,
isModule,
) {
var link = document.createElement('link');
link.charset = 'utf-8';
link.rel = isModule ? 'modulepreload' : 'preload';
link.href = bundle;
if (priority) {
link.as = p... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/browser/js-loader.js | packages/runtimes/js/src/helpers/browser/js-loader.js | const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function loadJSBundle(bundle) {
return new Promise(function (resolve, reject) {
// Don't insert the same script twice (e.g. if it was already in the HTML)
let existingScripts = document.getElementsByTagName('script');
let isCurre... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/browser/prefetch-loader.js | packages/runtimes/js/src/helpers/browser/prefetch-loader.js | const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function prefetchJSBundle(bundle, priority) {
var link = document.createElement('link');
link.rel = 'prefetch';
link.href = bundle;
if (priority) {
link.as = priority;
}
document.getElementsByTagName('head')[0].appendChild(lin... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/js/src/helpers/browser/html-loader.js | packages/runtimes/js/src/helpers/browser/html-loader.js | const cacheLoader = require('../cacheLoader');
module.exports = cacheLoader(function loadHTMLBundle(bundle) {
return fetch(bundle).then(function (res) {
return res.text();
});
});
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/rsc/rsc-helpers.jsx | packages/runtimes/rsc/rsc-helpers.jsx | /* eslint-env browser */
/* eslint-disable react/react-in-jsx-scope */
/* @jsxRuntime automatic */
export function createResourcesProxy(module, esModule, resources, bootstrapScript) {
if (typeof module === 'function') {
return createResourcesValueProxy(module, resources, bootstrapScript);
}
return new Pro... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/runtimes/rsc/src/RSCRuntime.js | packages/runtimes/rsc/src/RSCRuntime.js | // @flow strict-local
import {Runtime} from '@parcel/plugin';
import nullthrows from 'nullthrows';
import {
urlJoin,
normalizeSeparators,
relativeBundlePath,
getImportMap,
} from '@parcel/utils';
import path from 'path';
import {hashString} from '@parcel/rust';
export default (new Runtime({
async loadConfig... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/eslint-plugin/index.js | packages/dev/eslint-plugin/index.js | 'use strict';
module.exports = {
rules: {
'no-self-package-imports': require('./src/rules/no-self-package-imports'),
},
};
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/eslint-plugin/src/utils.js | packages/dev/eslint-plugin/src/utils.js | 'use strict';
const path = require('path');
function isStaticRequireOrResolve(node) {
return isStaticRequire(node) || isStaticResolve(node);
}
/*
* Detects whether a node is a call expression matching `require('foo')`,
* `require.resolve('foo')`, etc.
*
* `isStaticRequire` and `isStaticResolve` each combine ch... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/eslint-plugin/src/rules/no-self-package-imports.js | packages/dev/eslint-plugin/src/rules/no-self-package-imports.js | /*
* Prevents requiring/importing modules by package name within the same package.
* e.g. `require('@parcel/core/foo')` while in `@parcel/core/bar` should be
* `require('./foo')`.
*
* This can easily happen accidentally while refactoring across the monorepo.
* Since yarn links all modules in its root `node_... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/eslint-plugin/test/utils.test.js | packages/dev/eslint-plugin/test/utils.test.js | 'use strict';
const assert = require('assert');
const path = require('path');
const {parse} = require('@babel/eslint-parser');
const readPkgUp = require('read-pkg-up');
const {
isStaticRequire,
isStaticResolve,
relativePathForRequire,
} = require('../src/utils');
const pkgInfo = readPkgUp.sync({cwd: __dirname}... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/eslint-plugin/test/rules/no-self-package-imports.test.js | packages/dev/eslint-plugin/test/rules/no-self-package-imports.test.js | 'use strict';
const {RuleTester} = require('eslint');
const rule = require('../../src/rules/no-self-package-imports');
const message =
'Do not require a module by package name within the same package.';
const filename = __filename;
new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOption... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/query/src/cli.js | packages/dev/query/src/cli.js | // @flow strict-local
/* eslint-disable no-console, monorepo/no-internal-import */
import type {ContentGraph, ContentKey, NodeId} from '@parcel/graph';
import type {BundleGraphEdgeType} from '@parcel/core/src/BundleGraph';
import type {AssetGraphNode, BundleGraphNode} from '@parcel/core/src/types';
import path from 'p... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/query/src/index.js | packages/dev/query/src/index.js | // @flow strict-local
/* eslint-disable no-console, monorepo/no-internal-import */
import type {ContentKey, NodeId} from '@parcel/graph';
import type {PackagedBundleInfo} from '@parcel/core/src/types';
import fs from 'fs';
import path from 'path';
import v8 from 'v8';
import nullthrows from 'nullthrows';
import invari... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/query/src/bin.js | packages/dev/query/src/bin.js | #!/usr/bin/env node
'use strict';
if (
process.env.PARCEL_BUILD_ENV !== 'production' ||
process.env.PARCEL_SELF_BUILD
) {
require('@parcel/babel-register');
}
const run = require('./cli').run;
require('v8-compile-cache');
run(process.argv.slice(2));
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/query/src/deep-imports.js | packages/dev/query/src/deep-imports.js | // @flow
/* eslint-disable monorepo/no-internal-import */
import typeof AssetGraph from '@parcel/core/src/AssetGraph.js';
import typeof BundleGraph, {
bundleGraphEdgeTypes,
} from '@parcel/core/src/BundleGraph.js';
import typeof RequestTracker, {
RequestGraph,
} from '@parcel/core/src/RequestTracker.js';
import typ... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/parcel-link/bin.js | packages/dev/parcel-link/bin.js | #! /usr/bin/env node
// @flow strict-local
/* eslint-disable no-console */
'use strict';
// $FlowFixMe[untyped-import]
require('@parcel/babel-register');
let program = require('./src/cli').createProgram();
(async function main() {
try {
await program.parseAsync();
} catch (e) {
console.error(e);
pr... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/parcel-link/src/cli.js | packages/dev/parcel-link/src/cli.js | // @flow strict-local
/* eslint-disable no-console */
import type {LinkCommandOptions} from './link';
import type {UnlinkCommandOptions} from './unlink';
// $FlowFixMe[untyped-import]
import {version} from '../package.json';
import {createLinkCommand} from './link';
import {createUnlinkCommand} from './unlink';
impo... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/parcel-link/src/unlink.js | packages/dev/parcel-link/src/unlink.js | // @flow strict-local
import type {CmdOptions} from './utils';
import type {FileSystem} from '@parcel/fs';
import {ParcelLinkConfig} from './ParcelLinkConfig';
import {
cleanupBin,
cleanupNodeModules,
execSync,
findParcelPackages,
fsWrite,
mapNamespacePackageAliases,
} from './utils';
import path from 'p... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/parcel-link/src/index.js | packages/dev/parcel-link/src/index.js | // @flow strict-local
export type {ProgramOptions} from './cli';
export type {LinkOptions} from './link';
export type {UnlinkOptions} from './unlink';
export {createProgram} from './cli';
export {link} from './link';
export {unlink} from './unlink';
export {ParcelLinkConfig} from './ParcelLinkConfig';
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/parcel-link/src/link.js | packages/dev/parcel-link/src/link.js | // @flow strict-local
import type {CmdOptions} from './utils';
import type {FileSystem} from '@parcel/fs';
import {ParcelLinkConfig} from './ParcelLinkConfig';
import {
findParcelPackages,
mapNamespacePackageAliases,
cleanupBin,
cleanupNodeModules,
fsWrite,
fsSymlink,
} from './utils';
import nullthrows ... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/parcel-link/src/ParcelLinkConfig.js | packages/dev/parcel-link/src/ParcelLinkConfig.js | // @flow
import type {FileSystem} from '@parcel/fs';
import {globSync} from '@parcel/utils';
import assert from 'assert';
import nullthrows from 'nullthrows';
import path from 'path';
const LOCK_FILE_NAMES = ['yarn.lock', 'package-lock.json', 'pnpm-lock.yaml'];
const SCM_FILE_NAMES = ['.git', '.hg'];
export class ... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/parcel-link/src/utils.js | packages/dev/parcel-link/src/utils.js | // @flow strict-local
import assert from 'assert';
import child_process from 'child_process';
import path from 'path';
import type {FileSystem} from '@parcel/fs';
export type CmdOptions = {|
appRoot: string,
packageRoot: string,
dryRun: boolean,
fs: FileSystem,
log: (...data: mixed[]) => void,
|};
export ... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/write-commit.js | packages/dev/repl/write-commit.js | // @flow
const child_process = require('child_process');
const path = require('path');
const fs = require('fs');
let file = path.join(__dirname, 'commit');
let oldCommit = fs.existsSync(file) && fs.readFileSync(file, 'utf8').trim();
const newCommit = child_process
// .execSync('git merge-base v2 HEAD', {encoding: ... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/codemirror.js | packages/dev/repl/src/codemirror.js | import {useRef, useEffect, useState, useCallback, memo} from 'react';
import {EditorView} from '@codemirror/view';
import {Compartment, EditorState} from '@codemirror/state';
import {setDiagnostics} from '@codemirror/lint';
let readOnlyCompartment = new Compartment();
export function createState(value, extensions) {... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/index.js | packages/dev/repl/src/index.js | // @flow
import {Fragment, useEffect, useState, useReducer, useRef} from 'react';
import {createRoot} from 'react-dom/client';
// $FlowFixMe
import {Panel, PanelGroup, PanelResizeHandle} from 'react-resizable-panels';
import {useMedia} from 'react-use';
// $FlowFixMe
import parcelLogo from 'url:./assets/logo.svg';
// ... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/sw.js | packages/dev/repl/src/sw.js | /* eslint-disable no-restricted-globals */
// @flow strict
import nullthrows from 'nullthrows';
let isSafari =
/Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);
let lastHMRStream;
type ClientId = string;
type ParentId = string;
let sendToIFrame = new Map<ClientId, (data: string) => void>(... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/components/Preview.js | packages/dev/repl/src/components/Preview.js | // @flow
import {useRef, useState} from 'react';
import {usePromise} from './helper';
export function Preview({clientID}: {|clientID: Promise<string>|}): any {
let [clientIDResolved] = usePromise(clientID);
let url =
clientIDResolved && `/__repl_dist/index.html?parentId=${clientIDResolved}`;
let [popover, se... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/components/state.js | packages/dev/repl/src/components/state.js | // @flow
import type {REPLOptions, CodeMirrorDiagnostic} from '../utils';
import {ASSET_PRESETS, FS, join, type FSMap} from '../utils/assets';
import path from 'path';
import nullthrows from 'nullthrows';
// const isSafari = navigator.vendor.includes('Apple Computer');
export const DEFAULT_OPTIONS: REPLOptions = {
... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/components/FileBrowser.js | packages/dev/repl/src/components/FileBrowser.js | // @flow
import path from 'path';
import {EditableField} from './helper';
import {downloadZIP} from '../utils';
function join(a, ...b) {
return path.join(a || '/', ...b);
}
function FileBrowserEntry({
name,
prefix,
directory = false,
isEntry,
isEditing,
collapsed,
children,
dispatch,
...rest
}) {
... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/components/index.js | packages/dev/repl/src/components/index.js | // @flow
export * from './Editor.js';
export * from './FileBrowser.js';
export * from './helper.js';
export * from './Options.js';
export * from './Preview.js';
export * from './state.js';
// export * from './SourceMapVisualizer.js';
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/components/Editor.js | packages/dev/repl/src/components/Editor.js | // @flow
import {useCallback, useMemo, memo} from 'react';
import path from 'path';
import {CodemirrorEditor} from '../codemirror';
import {
EditorView,
drawSelection,
highlightActiveLine,
highlightSpecialChars,
keymap,
lineNumbers,
rectangularSelection,
} from '@codemirror/view';
import {EditorState} f... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/components/Options.js | packages/dev/repl/src/components/Options.js | // @flow
import type {State} from './';
import type {REPLOptions} from '../utils';
import fs from 'fs';
import path from 'path';
import {getDefaultTargetEnv} from '../utils';
let commit = fs
.readFileSync(path.join(__dirname, '../../commit'), 'utf8')
.trim();
export function Options({
state,
dispatch,
dis... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/components/helper.js | packages/dev/repl/src/components/helper.js | // @flow
import type {BundleOutputError} from '../parcel/ParcelWorker';
import {useCallback, useState, useEffect, useRef, memo} from 'react';
import {ctrlKey} from '../utils';
import renderGraph from '../graphs/index.js';
import {ASSET_PRESETS, extractZIP} from '../utils';
import {type FSMap} from '../utils/assets';
/*... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/utils/assets.js | packages/dev/repl/src/utils/assets.js | // @flow
import path from 'path';
import nullthrows from 'nullthrows';
import type {REPLOptions} from './';
export type CodeMirrorDiagnostic = {|
from: number,
to: number,
severity: 'info' | 'warning' | 'error',
source: string,
message: string,
stack: ?string,
|};
export function join(a: string, ...b: Arr... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/utils/index.js | packages/dev/repl/src/utils/index.js | // @flow
import JSZip from 'jszip';
import {type FSMap} from './assets';
export * from './assets';
export * from './options';
export function nthIndex(str: string, pat: string, n: number): number {
var length = str.length,
i = -1;
while (n-- && i++ < length) {
i = str.indexOf(pat, i);
if (i < 0) break... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/utils/options.js | packages/dev/repl/src/utils/options.js | // @flow
import type {PackageJSON} from '@parcel/types';
export type REPLOptions = {|
entries: [],
minify: boolean,
scopeHoist: boolean,
sourceMaps: boolean,
publicUrl: string,
targetType: 'node' | 'browsers',
targetEnv: null | string,
outputFormat: null | 'esmodule' | 'commonjs' | 'global',
mode: 'p... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/graphs/index.js | packages/dev/repl/src/graphs/index.js | // @flow
import {wrap} from 'comlink';
let worker;
export default (() =>
(worker =
worker ??
wrap(
// $FlowFixMe
new Worker(new URL('./worker.js', import /*:: ("") */.meta.url), {
name: 'Parcel Graph Renderer',
type: 'module',
}),
).render): () => Promise<(dot: string) ... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/graphs/worker.js | packages/dev/repl/src/graphs/worker.js | import {expose, proxy} from 'comlink';
import dot from '@mischnic/dot-svg';
import WASM_URL from 'url:@mischnic/dot-svg/dist/index-browser.wasm';
const render = dot(() => WASM_URL);
expose({
render: proxy((...a) => render.then(f => f(...a))),
});
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/parcel/BrowserPackageManager.js | packages/dev/repl/src/parcel/BrowserPackageManager.js | // @flow
import type {FilePath, DependencySpecifier, SemverRange} from '@parcel/types';
import type {FileSystem} from '@parcel/fs';
import type {
PackageManager,
Invalidations,
ResolveResult,
} from '@parcel/package-manager';
import {registerSerializableClass} from '@parcel/core';
// $FlowFixMe[untyped-import]
im... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/parcel/yarn.js | packages/dev/repl/src/parcel/yarn.js | // @flow
import type {REPLOptions} from '../utils';
import type {MemoryFS} from '@parcel/fs';
import {openDB} from 'idb';
import {Buffer} from 'buffer';
// $FlowFixMe
import {run} from '@mischnic/yarn-browser';
let previousDependencies: ?$PropertyType<REPLOptions, 'dependencies'>;
function shouldRunYarn(
oldDeps: ?... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/parcel/ExtendedMemoryFS.js | packages/dev/repl/src/parcel/ExtendedMemoryFS.js | // @flow
import type {FilePath} from '@parcel/types';
import {MemoryFS, FSError, makeShared, File} from '@parcel/fs';
import path from 'path';
import {registerSerializableClass} from '@parcel/core';
const {Buffer} = require('buffer');
const CONSTANTS = {
O_RDONLY: 0,
O_WRONLY: 1,
O_RDWR: 2,
S_IFMT: 61440,
S... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/parcel/index.js | packages/dev/repl/src/parcel/index.js | // @flow
import type {FS, REPLOptions} from '../utils';
import type {BundleOutput} from './ParcelWorker';
import {proxy, wrap, transfer} from 'comlink';
const worker = wrap(
// $FlowFixMe
new Worker(new URL('./ParcelWorker.js', import /*:: ("") */.meta.url), {
name: 'Parcel Worker Main',
type: 'module',
... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/src/parcel/ParcelWorker.js | packages/dev/repl/src/parcel/ParcelWorker.js | // @flow
import type {Diagnostic} from '@parcel/diagnostic';
import type {FSList, CodeMirrorDiagnostic, REPLOptions} from '../utils';
import type {MemoryFS} from '@parcel/fs';
import type {BuildSuccessEvent} from '@parcel/types';
import type WorkerFarm from '@parcel/workers';
import {expose, proxy} from 'comlink';
imp... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/SimplePackageInstaller/untar.js | packages/dev/repl/SimplePackageInstaller/untar.js | //@flow
import {inflate} from '@mischnic/pako';
function gunzip(arrayBuffer) {
return inflate(arrayBuffer);
}
function bufferSliceNull(view, offset, length) {
const data = view.slice(offset, offset + length);
for (let i = 0; i < data.length; i++) {
if (data[i] === 0) return data.slice(0, i);
}
return d... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/repl/SimplePackageInstaller/index.js | packages/dev/repl/SimplePackageInstaller/index.js | // @flow
import type {FilePath} from '@parcel/types';
import type {FileSystem} from '@parcel/fs';
import type {PackageInstaller, ModuleRequest} from '@parcel/package-manager';
import fetch from 'isomorphic-fetch';
import path from 'path';
import semver from 'semver';
import untar from './untar.js';
async function fin... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/bundle-stats-cli/src/cli.js | packages/dev/bundle-stats-cli/src/cli.js | /* eslint-disable no-console, monorepo/no-internal-import */
// @flow strict-local
import type {PackagedBundle} from '@parcel/types';
import type {ParcelOptions} from '@parcel/core/src/types';
import type {commander$Command} from 'commander';
// $FlowFixMe[untyped-import]
import {version} from '../package.json';
impo... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/bundle-stats-cli/src/bin.js | packages/dev/bundle-stats-cli/src/bin.js | #! /usr/bin/env node
'use strict';
if (
process.env.PARCEL_BUILD_ENV !== 'production' ||
process.env.PARCEL_SELF_BUILD
) {
require('@parcel/babel-register');
}
const cli = require('./cli');
cli.command.parse();
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/bundle-stats-cli/src/deep-imports.js | packages/dev/bundle-stats-cli/src/deep-imports.js | // @flow
/* eslint-disable monorepo/no-internal-import */
import typeof {loadGraphs} from '@parcel/query/src/index.js';
import typeof {getBundleStats} from '@parcel/reporter-bundle-stats/src/BundleStatsReporter';
import typeof {PackagedBundle as PackagedBundleClass} from '@parcel/core/src/public/Bundle';
module.export... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/babel-preset/index.js | packages/dev/babel-preset/index.js | module.exports = api => {
let name = api.caller(caller => caller && caller.name);
if (name === 'parcel') {
return {
presets: [require('@babel/preset-flow')],
plugins: [
// Inline the value of PARCEL_BUILD_ENV during self builds.
// Parcel does not do this itself for node targets...
... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/babel-register/index.js | packages/dev/babel-register/index.js | const parcelBabelPreset = require('@parcel/babel-preset');
const path = require('path');
require('@babel/register')({
cwd: path.join(__dirname, '../../..'),
ignore: [
filepath => filepath.includes(path.sep + 'node_modules' + path.sep),
// Don't run babel over ignore integration tests fixtures.
// These... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/babel-register/babel-plugin-module-translate.js | packages/dev/babel-register/babel-plugin-module-translate.js | const resolve = require('resolve');
const path = require('path');
function resolveSource(specifier, from) {
return resolve.sync(specifier, {
basedir: path.dirname(from),
packageFilter(pkg) {
if (pkg.name.startsWith('@parcel/') && pkg.name !== '@parcel/watcher') {
if (pkg.source) {
pkg... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/eslint-config-browser/index.js | packages/dev/eslint-config-browser/index.js | module.exports = {
extends: '@parcel/eslint-config',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 5,
},
env: {
browser: true,
},
rules: {
'no-console': 'off',
'no-global-assign': 'warn',
'no-unused-vars': 'off',
},
};
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/esm-fuzzer/index.js | packages/dev/esm-fuzzer/index.js | import {MemoryFS} from '@parcel/fs';
import assert from 'assert';
import path from 'path';
const runESM = require('./runESM');
const parcel = require('./parcel');
const generateExample = require('./generateExample');
async function run(example) {
let inputFS = new MemoryFS(parcel.workerFarm);
let nativeOutput = ... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/esm-fuzzer/generateExample.js | packages/dev/esm-fuzzer/generateExample.js | // @flow strict-local
const invariant = require('assert');
const nullthrows = require('nullthrows');
const t = require('@babel/types');
const template = require('@babel/template');
const {default: generate} = require('@babel/generator');
// $FlowFixMe
const {nanoid} = require('nanoid');
/*::
import type {Template} fro... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/esm-fuzzer/runESM.js | packages/dev/esm-fuzzer/runESM.js | 'use strict';
const vm = require('vm');
const path = require('path');
const nativeFS = require('fs');
module.exports = async function runESM({
entries,
globals,
fs = nativeFS,
externalModules = {},
}) {
const context = vm.createContext(globals ?? {});
const cache = new Map();
function load(specifier, re... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/esm-fuzzer/parcel.js | packages/dev/esm-fuzzer/parcel.js | import Parcel, {createWorkerFarm} from '@parcel/core';
import {NodeFS, MemoryFS, OverlayFS} from '@parcel/fs';
import path from 'path';
const DIST_DIR = path.join(__dirname, './dist');
module.exports = async function({
inputFS,
entries,
outputFormat = 'esmodule',
externalModules,
}) {
let outputFS = new Mem... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/esm-fuzzer/writeExample.js | packages/dev/esm-fuzzer/writeExample.js | const fs = require('fs');
const path = require('path');
const EXAMPLE = {
/*...*/
};
let BASEDIR = '...';
for (let [name, code] of Object.entries(EXAMPLE.files)) {
fs.writeFileSync(path.join(BASEDIR, 'src', name), code);
}
console.log(`parcel2 build ${EXAMPLE.entries.join(' ')}`);
| javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/dev/eslint-config/index.js | packages/dev/eslint-config/index.js | module.exports = {
extends: [
'eslint:recommended',
'plugin:flowtype/recommended',
'plugin:monorepo/recommended',
'plugin:react/recommended',
'prettier',
],
parser: '@babel/eslint-parser',
plugins: ['@parcel', 'flowtype', 'import', 'monorepo', 'react', 'mocha'],
parserOptions: {
ecmaVe... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/image/src/ImageOptimizer.js | packages/optimizers/image/src/ImageOptimizer.js | // @flow
import path from 'path';
import process from 'process';
import {Optimizer} from '@parcel/plugin';
import {blobToBuffer} from '@parcel/utils';
import {md} from '@parcel/diagnostic';
import {optimizeImage} from '@parcel/rust';
export default (new Optimizer({
async optimize({bundle, contents, logger}) {
if... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/blob-url/src/BlobURLOptimizer.js | packages/optimizers/blob-url/src/BlobURLOptimizer.js | // @flow strict-local
import {Optimizer} from '@parcel/plugin';
import {blobToString} from '@parcel/utils';
export default (new Optimizer({
async optimize({contents}) {
// Inspired by webpack's worker plugin:
// https://github.com/webpack-contrib/worker-loader/blob/b82585a1ddb8ae295fd4b1c302bca6b162665de2/s... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/css/src/CSSOptimizer.js | packages/optimizers/css/src/CSSOptimizer.js | // @flow strict-local
import SourceMap from '@parcel/source-map';
import {Optimizer} from '@parcel/plugin';
// $FlowFixMe - init for browser build.
import init, {
transform,
transformStyleAttribute,
browserslistToTargets,
} from 'lightningcss';
import {blobToBuffer} from '@parcel/utils';
import browserslist from... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/cssnano/src/CSSNanoOptimizer.js | packages/optimizers/cssnano/src/CSSNanoOptimizer.js | // @flow strict-local
import SourceMap from '@parcel/source-map';
import {Optimizer} from '@parcel/plugin';
import postcss from 'postcss';
import cssnano from 'cssnano';
import type {CSSNanoOptions} from 'cssnano'; // TODO the type is based on cssnano 4
export default (new Optimizer({
async loadConfig({config}) {
... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/esbuild/src/ESBuildOptimizer.js | packages/optimizers/esbuild/src/ESBuildOptimizer.js | // @flow
import {transform} from 'esbuild';
import {Optimizer} from '@parcel/plugin';
import {blobToString, normalizePath} from '@parcel/utils';
import SourceMap from '@parcel/source-map';
import path from 'path';
import invariant from 'assert';
export default (new Optimizer({
async optimize({contents, map, bundle,... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/html/src/HTMLOptimizer.js | packages/optimizers/html/src/HTMLOptimizer.js | // @flow strict-local
import {Optimizer} from '@parcel/plugin';
import {blobToBuffer, convertSVGOConfig} from '@parcel/utils';
import {optimizeHtml} from '@parcel/rust';
import path from 'path';
export default (new Optimizer({
async loadConfig({config, options}) {
let userConfig = await config.getConfigFrom(
... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/svgo/src/SVGOOptimizer.js | packages/optimizers/svgo/src/SVGOOptimizer.js | // @flow
import {Optimizer} from '@parcel/plugin';
import ThrowableDiagnostic, {
errorToDiagnostic,
md,
generateJSONCodeHighlights,
} from '@parcel/diagnostic';
import {blobToString, detectSVGOVersion} from '@parcel/utils';
import path from 'path';
export default (new Optimizer({
async loadConfig({config, log... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/data-url/src/DataURLOptimizer.js | packages/optimizers/data-url/src/DataURLOptimizer.js | // @flow strict-local
import {Optimizer} from '@parcel/plugin';
import {blobToBuffer} from '@parcel/utils';
import mime from 'mime';
import {isBinaryFile} from 'isbinaryfile';
const fixedEncodeURIComponent = (str: string): string => {
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
return '%' ... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/swc/src/SwcOptimizer.js | packages/optimizers/swc/src/SwcOptimizer.js | // @flow
import nullthrows from 'nullthrows';
import {transform} from '@swc/core';
import {Optimizer} from '@parcel/plugin';
import {blobToString, stripAnsi} from '@parcel/utils';
import SourceMap from '@parcel/source-map';
import ThrowableDiagnostic, {escapeMarkdown} from '@parcel/diagnostic';
import path from 'path'... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/inline-requires/src/InlineRequires.js | packages/optimizers/inline-requires/src/InlineRequires.js | // @flow strict-local
import {Optimizer} from '@parcel/plugin';
import {parse, print} from '@swc/core';
import {RequireInliningVisitor} from './RequireInliningVisitor';
import nullthrows from 'nullthrows';
import SourceMap from '@parcel/source-map';
let assetPublicIdsWithSideEffects = null;
type BundleConfig = {|
a... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/inline-requires/src/RequireInliningVisitor.js | packages/optimizers/inline-requires/src/RequireInliningVisitor.js | // @flow strict-local
import type {NamedBundle, PluginLogger} from '@parcel/types';
import type {
CallExpression,
VariableDeclaration,
FunctionExpression,
ParenthesisExpression,
Span,
Identifier,
} from '@swc/core';
import {Visitor} from '@swc/core/Visitor';
import nullthrows from 'nullthrows';
type Visit... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/inline-requires/test/RequireInliningVisitor.test.js | packages/optimizers/inline-requires/test/RequireInliningVisitor.test.js | import {parse, print} from '@swc/core';
import {RequireInliningVisitor} from '../src/RequireInliningVisitor';
import assert from 'assert';
import logger from '@parcel/logger';
async function testRequireInliningVisitor(src, sideEffects) {
const ast = await parse(src, {});
const assetPublicIdsWithSideEffects = new S... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/htmlnano/src/svgMappings.js | packages/optimizers/htmlnano/src/svgMappings.js | // @flow
// Based on parse5: https://github.com/inikulin/parse5/blob/252819607421a5741cf745bb60c404f023531b0d/packages/parse5/lib/common/foreign-content.js#L54
export const SVG_TAG_NAMES: {|[string]: string|} = {
altglyph: 'altGlyph',
altglyphdef: 'altGlyphDef',
altglyphitem: 'altGlyphItem',
animatecolor: 'ani... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/htmlnano/src/HTMLNanoOptimizer.js | packages/optimizers/htmlnano/src/HTMLNanoOptimizer.js | // @flow strict-local
import type {PostHTMLNode} from 'posthtml';
import htmlnano from 'htmlnano';
import {
md,
generateJSONCodeHighlights,
errorToDiagnostic,
} from '@parcel/diagnostic';
import {Optimizer} from '@parcel/plugin';
import {detectSVGOVersion, blobToString} from '@parcel/utils';
import posthtml from... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/terser/src/TerserOptimizer.js | packages/optimizers/terser/src/TerserOptimizer.js | // @flow
import nullthrows from 'nullthrows';
import {minify} from 'terser';
import {Optimizer} from '@parcel/plugin';
import {blobToString} from '@parcel/utils';
import SourceMap from '@parcel/source-map';
import ThrowableDiagnostic, {escapeMarkdown} from '@parcel/diagnostic';
import path from 'path';
export defaul... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/optimizers/svg/src/SVGOptimizer.js | packages/optimizers/svg/src/SVGOptimizer.js | // @flow strict-local
import {Optimizer} from '@parcel/plugin';
import {blobToBuffer, convertSVGOConfig} from '@parcel/utils';
import {optimizeSvg} from '@parcel/rust';
export default (new Optimizer({
async loadConfig({config, options}) {
let configFile = await config.getConfig([
'svgo.config.js',
's... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/validators/eslint/src/EslintValidator.js | packages/validators/eslint/src/EslintValidator.js | // @flow
import {Validator} from '@parcel/plugin';
import {type DiagnosticCodeFrame, escapeMarkdown} from '@parcel/diagnostic';
import eslint from 'eslint';
import invariant from 'assert';
// For eslint <8.0.0
let cliEngine = null;
// For eslint >=8.0.0
let eslintEngine = null;
export default (new Validator({
async... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/validators/typescript/src/TypeScriptValidator.js | packages/validators/typescript/src/TypeScriptValidator.js | // @flow
import type {
Asset,
ConfigResult,
PluginOptions,
ValidateResult,
} from '@parcel/types';
import type {LanguageService, Diagnostic} from 'typescript'; // eslint-disable-line import/no-extraneous-dependencies
import path from 'path';
import ts from 'typescript';
import {type DiagnosticCodeFrame, escape... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/packagers/webextension/src/WebExtensionPackager.js | packages/packagers/webextension/src/WebExtensionPackager.js | // @flow strict-local
import assert from 'assert';
import nullthrows from 'nullthrows';
import {Packager} from '@parcel/plugin';
import {replaceURLReferences, relativeBundlePath} from '@parcel/utils';
export default (new Packager({
async package({bundle, bundleGraph}) {
let assets = [];
bundle.traverseAsset... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/packagers/react-static/src/ReactStaticPackager.js | packages/packagers/react-static/src/ReactStaticPackager.js | // @flow
import type {
Asset,
Async,
Blob,
BundleGraph,
Dependency,
NamedBundle,
Meta,
} from '@parcel/types';
import {blobToString, PromiseQueue, urlJoin} from '@parcel/utils';
import fs from 'fs';
import Module from 'module';
import {Packager} from '@parcel/plugin';
import path from 'path';
import {Reso... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/packagers/css/src/CSSPackager.js | packages/packagers/css/src/CSSPackager.js | // @flow
import type {Root} from 'postcss';
import type {Asset, Dependency} from '@parcel/types';
import typeof PostCSS from 'postcss';
// $FlowFixMe - init for browser build.
import init, {bundleAsync} from 'lightningcss';
import invariant from 'assert';
import nullthrows from 'nullthrows';
import SourceMap from '@p... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/packagers/xml/src/XMLPackager.js | packages/packagers/xml/src/XMLPackager.js | // @flow
import type {Bundle, BundleGraph, NamedBundle} from '@parcel/types';
import assert from 'assert';
import {Packager} from '@parcel/plugin';
import {
blobToString,
replaceInlineReferences,
replaceURLReferences,
} from '@parcel/utils';
import {DOMParser, XMLSerializer} from '@xmldom/xmldom';
export defaul... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/packagers/raw-url/src/RawUrlPackager.js | packages/packagers/raw-url/src/RawUrlPackager.js | // @flow strict-local
import assert from 'assert';
import {Packager} from '@parcel/plugin';
import {replaceURLReferences} from '@parcel/utils';
export default (new Packager({
async package({bundle, bundleGraph}) {
let assets = [];
bundle.traverseAssets(asset => {
assets.push(asset);
});
asser... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/packagers/raw/src/RawPackager.js | packages/packagers/raw/src/RawPackager.js | // @flow strict-local
import assert from 'assert';
import {Packager} from '@parcel/plugin';
export default (new Packager({
package({bundle}) {
let assets = [];
bundle.traverseAssets(asset => {
assets.push(asset);
});
assert.equal(assets.length, 1, 'Raw bundles must only contain one asset');
... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/packagers/wasm/src/wasm-sourcemap.js | packages/packagers/wasm/src/wasm-sourcemap.js | /* eslint-disable */
// Modified version of https://github.com/oasislabs/wasm-sourcemap/blob/77242f93ebd010cf69515d988b984244a119dd9d/index.js
// Modifications Copyright 2019 Oasis Labs
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following cond... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
parcel-bundler/parcel | https://github.com/parcel-bundler/parcel/blob/73f691d67d22482440babb2d1846b7da2160f7cc/packages/packagers/wasm/src/WasmPackager.js | packages/packagers/wasm/src/WasmPackager.js | // @flow strict-local
import assert from 'assert';
import {Packager} from '@parcel/plugin';
import * as wasmmap from './wasm-sourcemap';
export default (new Packager({
async package({bundle, getSourceMapReference}) {
let assets = [];
bundle.traverseAssets(asset => {
assets.push(asset);
});
as... | javascript | MIT | 73f691d67d22482440babb2d1846b7da2160f7cc | 2026-01-04T14:58:42.192224Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.