summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/commonjs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata/commonjs')
-rw-r--r--cli/tests/testdata/commonjs/data.json3
-rw-r--r--cli/tests/testdata/commonjs/example.js11
-rw-r--r--cli/tests/testdata/commonjs/node_modules/colorette/index.cjs74
-rw-r--r--cli/tests/testdata/commonjs/node_modules/colorette/index.js75
-rw-r--r--cli/tests/testdata/commonjs/node_modules/colorette/package.json23
-rw-r--r--cli/tests/testdata/commonjs/node_modules/imports_exports/import_export.js6
-rw-r--r--cli/tests/testdata/commonjs/node_modules/imports_exports/import_polyfill.js3
-rw-r--r--cli/tests/testdata/commonjs/node_modules/imports_exports/package.json17
-rw-r--r--cli/tests/testdata/commonjs/node_modules/imports_exports/require_export.cjs6
-rw-r--r--cli/tests/testdata/commonjs/node_modules/imports_exports/require_polyfill.js3
-rw-r--r--cli/tests/testdata/commonjs/node_modules/left-pad/README.md41
-rw-r--r--cli/tests/testdata/commonjs/node_modules/left-pad/index.js54
-rw-r--r--cli/tests/testdata/commonjs/node_modules/left-pad/package.json68
-rw-r--r--cli/tests/testdata/commonjs/package.json17
14 files changed, 0 insertions, 401 deletions
diff --git a/cli/tests/testdata/commonjs/data.json b/cli/tests/testdata/commonjs/data.json
deleted file mode 100644
index f2a886f39..000000000
--- a/cli/tests/testdata/commonjs/data.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "hello": "world"
-}
diff --git a/cli/tests/testdata/commonjs/example.js b/cli/tests/testdata/commonjs/example.js
deleted file mode 100644
index d2f89d3f0..000000000
--- a/cli/tests/testdata/commonjs/example.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-// deno-lint-ignore no-undef
-const processMod = require("process");
-const osMod = require("node:os");
-console.log("process.pid", processMod.pid);
-console.log("os.EOL", osMod.EOL);
-const leftPad = require("left-pad");
-const json = require("./data");
-console.log(json);
-console.log(leftPad("foo", 5)); // => " foo"
-console.log("main module", processMod.mainModule.filename);
diff --git a/cli/tests/testdata/commonjs/node_modules/colorette/index.cjs b/cli/tests/testdata/commonjs/node_modules/colorette/index.cjs
deleted file mode 100644
index 0590d668d..000000000
--- a/cli/tests/testdata/commonjs/node_modules/colorette/index.cjs
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright Jorge Bucaran. All rights reserved. MIT license.
-let enabled = !("NO_COLOR" in process.env) &&
- ("FORCE_COLOR" in process.env ||
- process.platform === "win32" ||
- (process.stdout != null &&
- process.stdout.isTTY &&
- process.env.TERM &&
- process.env.TERM !== "dumb"));
-
-const raw = (open, close, searchRegex, replaceValue) =>
- (s) =>
- enabled
- ? open +
- (~(s += "").indexOf(close, 4) // skip opening \x1b[
- ? s.replace(searchRegex, replaceValue)
- : s) +
- close
- : s;
-
-const init = (open, close) => {
- return raw(
- `\x1b[${open}m`,
- `\x1b[${close}m`,
- new RegExp(`\\x1b\\[${close}m`, "g"),
- `\x1b[${open}m`,
- );
-};
-
-exports.options = Object.defineProperty({}, "enabled", {
- get: () => enabled,
- set: (value) => (enabled = value),
-});
-
-exports.reset = init(0, 0);
-exports.bold = raw("\x1b[1m", "\x1b[22m", /\x1b\[22m/g, "\x1b[22m\x1b[1m");
-exports.dim = raw("\x1b[2m", "\x1b[22m", /\x1b\[22m/g, "\x1b[22m\x1b[2m");
-exports.italic = init(3, 23);
-exports.underline = init(4, 24);
-exports.inverse = init(7, 27);
-exports.hidden = init(8, 28);
-exports.strikethrough = init(9, 29);
-exports.black = init(30, 39);
-exports.red = init(31, 39);
-exports.green = init(32, 39);
-exports.yellow = init(33, 39);
-exports.blue = init(34, 39);
-exports.magenta = init(35, 39);
-exports.cyan = init(36, 39);
-exports.white = init(37, 39);
-exports.gray = init(90, 39);
-exports.bgBlack = init(40, 49);
-exports.bgRed = init(41, 49);
-exports.bgGreen = init(42, 49);
-exports.bgYellow = init(43, 49);
-exports.bgBlue = init(44, 49);
-exports.bgMagenta = init(45, 49);
-exports.bgCyan = init(46, 49);
-exports.bgWhite = init(47, 49);
-exports.blackBright = init(90, 39);
-exports.redBright = init(91, 39);
-exports.greenBright = init(92, 39);
-exports.yellowBright = init(93, 39);
-exports.blueBright = init(94, 39);
-exports.magentaBright = init(95, 39);
-exports.cyanBright = init(96, 39);
-exports.whiteBright = init(97, 39);
-exports.bgBlackBright = init(100, 49);
-exports.bgRedBright = init(101, 49);
-exports.bgGreenBright = init(102, 49);
-exports.bgYellowBright = init(103, 49);
-exports.bgBlueBright = init(104, 49);
-exports.bgMagentaBright = init(105, 49);
-exports.bgCyanBright = init(106, 49);
-exports.bgWhiteBright = init(107, 49);
diff --git a/cli/tests/testdata/commonjs/node_modules/colorette/index.js b/cli/tests/testdata/commonjs/node_modules/colorette/index.js
deleted file mode 100644
index 6e83866f3..000000000
--- a/cli/tests/testdata/commonjs/node_modules/colorette/index.js
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright Jorge Bucaran. All rights reserved. MIT license.
-// deno-lint-ignore-file no-undef no-control-regex
-let enabled = !("NO_COLOR" in process.env) &&
- ("FORCE_COLOR" in process.env ||
- process.platform === "win32" ||
- (process.stdout != null &&
- process.stdout.isTTY &&
- process.env.TERM &&
- process.env.TERM !== "dumb"));
-
-const raw = (open, close, searchRegex, replaceValue) =>
- (s) =>
- enabled
- ? open +
- (~(s += "").indexOf(close, 4) // skip opening \x1b[
- ? s.replace(searchRegex, replaceValue)
- : s) +
- close
- : s;
-
-const init = (open, close) => {
- return raw(
- `\x1b[${open}m`,
- `\x1b[${close}m`,
- new RegExp(`\\x1b\\[${close}m`, "g"),
- `\x1b[${open}m`,
- );
-};
-
-export const options = Object.defineProperty({}, "enabled", {
- get: () => enabled,
- set: (value) => (enabled = value),
-});
-
-export const reset = init(0, 0);
-export const bold = raw("\x1b[1m", "\x1b[22m", /\x1b\[22m/g, "\x1b[22m\x1b[1m");
-export const dim = raw("\x1b[2m", "\x1b[22m", /\x1b\[22m/g, "\x1b[22m\x1b[2m");
-export const italic = init(3, 23);
-export const underline = init(4, 24);
-export const inverse = init(7, 27);
-export const hidden = init(8, 28);
-export const strikethrough = init(9, 29);
-export const black = init(30, 39);
-export const red = init(31, 39);
-export const green = init(32, 39);
-export const yellow = init(33, 39);
-export const blue = init(34, 39);
-export const magenta = init(35, 39);
-export const cyan = init(36, 39);
-export const white = init(37, 39);
-export const gray = init(90, 39);
-export const bgBlack = init(40, 49);
-export const bgRed = init(41, 49);
-export const bgGreen = init(42, 49);
-export const bgYellow = init(43, 49);
-export const bgBlue = init(44, 49);
-export const bgMagenta = init(45, 49);
-export const bgCyan = init(46, 49);
-export const bgWhite = init(47, 49);
-export const blackBright = init(90, 39);
-export const redBright = init(91, 39);
-export const greenBright = init(92, 39);
-export const yellowBright = init(93, 39);
-export const blueBright = init(94, 39);
-export const magentaBright = init(95, 39);
-export const cyanBright = init(96, 39);
-export const whiteBright = init(97, 39);
-export const bgBlackBright = init(100, 49);
-export const bgRedBright = init(101, 49);
-export const bgGreenBright = init(102, 49);
-export const bgYellowBright = init(103, 49);
-export const bgBlueBright = init(104, 49);
-export const bgMagentaBright = init(105, 49);
-export const bgCyanBright = init(106, 49);
-export const bgWhiteBright = init(107, 49);
diff --git a/cli/tests/testdata/commonjs/node_modules/colorette/package.json b/cli/tests/testdata/commonjs/node_modules/colorette/package.json
deleted file mode 100644
index fdca1aa24..000000000
--- a/cli/tests/testdata/commonjs/node_modules/colorette/package.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "author": {
- "name": "Jorge Bucaran"
- },
- "description": "Color your terminal using pure idiomatic JavaScript.",
- "exports": {
- "./package.json": "./package.json",
- ".": {
- "require": "./index.cjs",
- "import": "./index.js"
- }
- },
- "license": "MIT",
- "main": "index.cjs",
- "module": "index.js",
- "name": "colorette",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/jorgebucaran/colorette.git"
- },
- "type": "module",
- "version": "1.2.1"
-}
diff --git a/cli/tests/testdata/commonjs/node_modules/imports_exports/import_export.js b/cli/tests/testdata/commonjs/node_modules/imports_exports/import_export.js
deleted file mode 100644
index 3ebd222ea..000000000
--- a/cli/tests/testdata/commonjs/node_modules/imports_exports/import_export.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import dep from "#dep";
-
-export default {
- bar: "bar",
- dep,
-};
diff --git a/cli/tests/testdata/commonjs/node_modules/imports_exports/import_polyfill.js b/cli/tests/testdata/commonjs/node_modules/imports_exports/import_polyfill.js
deleted file mode 100644
index 76716a3ef..000000000
--- a/cli/tests/testdata/commonjs/node_modules/imports_exports/import_polyfill.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export default {
- polyfill: "import",
-};
diff --git a/cli/tests/testdata/commonjs/node_modules/imports_exports/package.json b/cli/tests/testdata/commonjs/node_modules/imports_exports/package.json
deleted file mode 100644
index 5d26359db..000000000
--- a/cli/tests/testdata/commonjs/node_modules/imports_exports/package.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "version": "1.0.0",
- "name": "imports_exports",
- "main": "./require_export.cjs",
- "imports": {
- "#dep": {
- "import": "./import_polyfill.js",
- "require": "./require_polyfill.js"
- }
- },
- "exports": {
- ".": {
- "import": "./import_export.js",
- "require": "./require_export.cjs"
- }
- }
-}
diff --git a/cli/tests/testdata/commonjs/node_modules/imports_exports/require_export.cjs b/cli/tests/testdata/commonjs/node_modules/imports_exports/require_export.cjs
deleted file mode 100644
index 48923b8d8..000000000
--- a/cli/tests/testdata/commonjs/node_modules/imports_exports/require_export.cjs
+++ /dev/null
@@ -1,6 +0,0 @@
-const dep = require("#dep");
-
-module.exports = {
- foo: "foo",
- dep,
-};
diff --git a/cli/tests/testdata/commonjs/node_modules/imports_exports/require_polyfill.js b/cli/tests/testdata/commonjs/node_modules/imports_exports/require_polyfill.js
deleted file mode 100644
index 1023fd65c..000000000
--- a/cli/tests/testdata/commonjs/node_modules/imports_exports/require_polyfill.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- polyfill: "require",
-};
diff --git a/cli/tests/testdata/commonjs/node_modules/left-pad/README.md b/cli/tests/testdata/commonjs/node_modules/left-pad/README.md
deleted file mode 100644
index 0e70d461e..000000000
--- a/cli/tests/testdata/commonjs/node_modules/left-pad/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-## left-pad
-
-String left pad
-
-[![Build Status][travis-image]][travis-url]
-
-## Install
-
-```bash
-$ npm install left-pad
-```
-
-## Usage
-
-```js
-const leftPad = require("left-pad");
-
-leftPad("foo", 5);
-// => " foo"
-
-leftPad("foobar", 6);
-// => "foobar"
-
-leftPad(1, 2, "0");
-// => "01"
-
-leftPad(17, 5, 0);
-// => "00017"
-```
-
-**NOTE:** The third argument should be a single `char`. However the module
-doesn't throw an error if you supply more than one `char`s. See
-[#28](https://github.com/stevemao/left-pad/pull/28).
-
-**NOTE:** Characters having code points outside of
-[BMP plan](https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane)
-are considered a two distinct characters. See
-[#58](https://github.com/stevemao/left-pad/issues/58).
-
-[travis-image]: https://travis-ci.org/stevemao/left-pad.svg?branch=master
-[travis-url]: https://travis-ci.org/stevemao/left-pad
diff --git a/cli/tests/testdata/commonjs/node_modules/left-pad/index.js b/cli/tests/testdata/commonjs/node_modules/left-pad/index.js
deleted file mode 100644
index a439e91de..000000000
--- a/cli/tests/testdata/commonjs/node_modules/left-pad/index.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// deno-lint-ignore-file
-
-/* This program is free software. It comes without any warranty, to
- * the extent permitted by applicable law. You can redistribute it
- * and/or modify it under the terms of the Do What The Fuck You Want
- * To Public License, Version 2, as published by Sam Hocevar. See
- * http://www.wtfpl.net/ for more details. */
-"use strict";
-module.exports = leftPad;
-
-var cache = [
- "",
- " ",
- " ",
- " ",
- " ",
- " ",
- " ",
- " ",
- " ",
- " ",
-];
-
-function leftPad(str, len, ch) {
- // convert `str` to a `string`
- str = str + "";
- // `len` is the `pad`'s length now
- len = len - str.length;
- // doesn't need to pad
- if (len <= 0) return str;
- // `ch` defaults to `' '`
- if (!ch && ch !== 0) ch = " ";
- // convert `ch` to a `string` cuz it could be a number
- ch = ch + "";
- // cache common use cases
- if (ch === " " && len < 10) return cache[len] + str;
- // `pad` starts with an empty string
- var pad = "";
- // loop
- while (true) {
- // add `ch` to `pad` if `len` is odd
- if (len & 1) pad += ch;
- // divide `len` by 2, ditch the remainder
- len >>= 1;
- // "double" the `ch` so this operation count grows logarithmically on `len`
- // each time `ch` is "doubled", the `len` would need to be "doubled" too
- // similar to finding a value in binary search tree, hence O(log(n))
- if (len) ch += ch;
- // `len` is 0, exit the loop
- else break;
- }
- // pad `str`!
- return pad + str;
-}
diff --git a/cli/tests/testdata/commonjs/node_modules/left-pad/package.json b/cli/tests/testdata/commonjs/node_modules/left-pad/package.json
deleted file mode 100644
index 57be04271..000000000
--- a/cli/tests/testdata/commonjs/node_modules/left-pad/package.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- "_from": "left-pad",
- "_id": "left-pad@1.3.0",
- "_inBundle": false,
- "_integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==",
- "_location": "/left-pad",
- "_phantomChildren": {},
- "_requested": {
- "type": "tag",
- "registry": true,
- "raw": "left-pad",
- "name": "left-pad",
- "escapedName": "left-pad",
- "rawSpec": "",
- "saveSpec": null,
- "fetchSpec": "latest"
- },
- "_requiredBy": [
- "#USER",
- "/"
- ],
- "_resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz",
- "_shasum": "5b8a3a7765dfe001261dde915589e782f8c94d1e",
- "_spec": "left-pad",
- "_where": "/Users/kun/Projects/Deno/deno/std/node/tests",
- "author": {
- "name": "azer"
- },
- "bugs": {
- "url": "https://github.com/stevemao/left-pad/issues"
- },
- "bundleDependencies": false,
- "deprecated": "use String.prototype.padStart()",
- "description": "String left pad",
- "devDependencies": {
- "benchmark": "^2.1.0",
- "fast-check": "0.0.8",
- "tape": "*"
- },
- "homepage": "https://github.com/stevemao/left-pad#readme",
- "keywords": [
- "leftpad",
- "left",
- "pad",
- "padding",
- "string",
- "repeat"
- ],
- "license": "WTFPL",
- "main": "index.js",
- "maintainers": [
- {
- "name": "Cameron Westland",
- "email": "camwest@gmail.com"
- }
- ],
- "name": "left-pad",
- "repository": {
- "url": "git+ssh://git@github.com/stevemao/left-pad.git",
- "type": "git"
- },
- "scripts": {
- "bench": "node perf/perf.js",
- "test": "node test"
- },
- "types": "index.d.ts",
- "version": "1.3.0"
-}
diff --git a/cli/tests/testdata/commonjs/package.json b/cli/tests/testdata/commonjs/package.json
deleted file mode 100644
index 9ce08a900..000000000
--- a/cli/tests/testdata/commonjs/package.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "example",
- "version": "0.0.1",
- "description": "",
- "main": "example.js",
- "dependencies": {
- "colorette": "1.2.1",
- "left-pad": "1.3.0",
- "imports_exports": "1.0.0"
- },
- "devDependencies": {},
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "",
- "license": "ISC"
-}