jiek 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- package/{tests/fixtures/node_modules/.pnpm/@jiek+loader-esbuild@1.0.0_esbuild@0.20.2/node_modules/@jiek/loader-esbuild/LICENSE → LICENSE} +1 -1
- package/package.json +4 -1
- package/src/commands/build.ts +0 -91
- package/src/commands/publish.ts +0 -79
- package/src/index.ts +0 -6
- package/src/inner.ts +0 -11
- package/src/merge-package-json.ts +0 -19
- package/src/rollup/index.ts +0 -162
- package/src/rollup/plugins/globals.ts +0 -34
- package/src/rollup/plugins/skip.ts +0 -23
- package/src/rollup/utils/commonOptions.ts +0 -9
- package/src/rollup/utils/externalResolver.ts +0 -11
- package/src/rollup/utils/globalResolver.ts +0 -24
- package/src/rollup/utils/withMinify.ts +0 -16
- package/tests/build.spec.ts +0 -28
- package/tests/fixtures/node_modules/.bin/jiek +0 -17
- package/tests/fixtures/node_modules/.jiek/jiek+test-foo.rollup.config.js +0 -31
- package/tests/fixtures/node_modules/.modules.yaml +0 -95
- package/tests/fixtures/node_modules/.pnpm/@esbuild+darwin-arm64@0.20.2/node_modules/@esbuild/darwin-arm64/README.md +0 -3
- package/tests/fixtures/node_modules/.pnpm/@esbuild+darwin-arm64@0.20.2/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
- package/tests/fixtures/node_modules/.pnpm/@esbuild+darwin-arm64@0.20.2/node_modules/@esbuild/darwin-arm64/package.json +0 -20
- package/tests/fixtures/node_modules/.pnpm/@jiek+loader-esbuild@1.0.0_esbuild@0.20.2/node_modules/@jiek/loader-esbuild/loader.js +0 -3
- package/tests/fixtures/node_modules/.pnpm/@jiek+loader-esbuild@1.0.0_esbuild@0.20.2/node_modules/@jiek/loader-esbuild/package.json +0 -8
- package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/LICENSE +0 -20
- package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/README.md +0 -481
- package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/package.json +0 -59
- package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js +0 -269
- package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js +0 -274
- package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js +0 -10
- package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js +0 -263
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/LICENSE +0 -21
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/README.md +0 -50
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/dist/loader.d.ts +0 -3
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/dist/loader.js +0 -15
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/dist/node.d.ts +0 -23
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/dist/node.js +0 -4926
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/loader.js +0 -1
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/node_modules/.bin/esbuild +0 -14
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/package.json +0 -46
- package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/register.js +0 -3
- package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/LICENSE.md +0 -21
- package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/README.md +0 -3
- package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/bin/esbuild +0 -0
- package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/install.js +0 -288
- package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.d.ts +0 -703
- package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.js +0 -2436
- package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/node_modules/.bin/esbuild +0 -14
- package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/package.json +0 -46
- package/tests/fixtures/node_modules/.pnpm/lock.yaml +0 -291
- package/tests/fixtures/node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js +0 -162
- package/tests/fixtures/node_modules/.pnpm/ms@2.1.2/node_modules/ms/license.md +0 -21
- package/tests/fixtures/node_modules/.pnpm/ms@2.1.2/node_modules/ms/package.json +0 -37
- package/tests/fixtures/node_modules/.pnpm/ms@2.1.2/node_modules/ms/readme.md +0 -60
- package/tests/fixtures/node_modules/.pnpm/node_modules/.bin/esbuild +0 -14
- package/tests/fixtures/package.json +0 -8
- package/tests/fixtures/packages/bar/package.json +0 -4
- package/tests/fixtures/packages/foo/dist/index.d.ts +0 -3
- package/tests/fixtures/packages/foo/dist/index.esm.d.ts +0 -3
- package/tests/fixtures/packages/foo/dist/index.esm.js +0 -6
- package/tests/fixtures/packages/foo/dist/index.esm.js.map +0 -1
- package/tests/fixtures/packages/foo/dist/index.esm.min.js +0 -2
- package/tests/fixtures/packages/foo/dist/index.esm.min.js.map +0 -1
- package/tests/fixtures/packages/foo/dist/index.iife.js +0 -15
- package/tests/fixtures/packages/foo/dist/index.iife.js.map +0 -1
- package/tests/fixtures/packages/foo/dist/index.iife.min.js +0 -2
- package/tests/fixtures/packages/foo/dist/index.iife.min.js.map +0 -1
- package/tests/fixtures/packages/foo/dist/index.umd.js +0 -16
- package/tests/fixtures/packages/foo/dist/index.umd.js.map +0 -1
- package/tests/fixtures/packages/foo/dist/index.umd.min.js +0 -2
- package/tests/fixtures/packages/foo/dist/index.umd.min.js.map +0 -1
- package/tests/fixtures/packages/foo/package.json +0 -7
- package/tests/fixtures/packages/foo/src/index.ts +0 -3
- package/tests/fixtures/pnpm-workspace.yaml +0 -2
- package/tests/publish.spec.ts +0 -31
@@ -1,263 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Module dependencies.
|
3
|
-
*/
|
4
|
-
|
5
|
-
const tty = require('tty');
|
6
|
-
const util = require('util');
|
7
|
-
|
8
|
-
/**
|
9
|
-
* This is the Node.js implementation of `debug()`.
|
10
|
-
*/
|
11
|
-
|
12
|
-
exports.init = init;
|
13
|
-
exports.log = log;
|
14
|
-
exports.formatArgs = formatArgs;
|
15
|
-
exports.save = save;
|
16
|
-
exports.load = load;
|
17
|
-
exports.useColors = useColors;
|
18
|
-
exports.destroy = util.deprecate(
|
19
|
-
() => {},
|
20
|
-
'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
|
21
|
-
);
|
22
|
-
|
23
|
-
/**
|
24
|
-
* Colors.
|
25
|
-
*/
|
26
|
-
|
27
|
-
exports.colors = [6, 2, 3, 4, 5, 1];
|
28
|
-
|
29
|
-
try {
|
30
|
-
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
31
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
32
|
-
const supportsColor = require('supports-color');
|
33
|
-
|
34
|
-
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
35
|
-
exports.colors = [
|
36
|
-
20,
|
37
|
-
21,
|
38
|
-
26,
|
39
|
-
27,
|
40
|
-
32,
|
41
|
-
33,
|
42
|
-
38,
|
43
|
-
39,
|
44
|
-
40,
|
45
|
-
41,
|
46
|
-
42,
|
47
|
-
43,
|
48
|
-
44,
|
49
|
-
45,
|
50
|
-
56,
|
51
|
-
57,
|
52
|
-
62,
|
53
|
-
63,
|
54
|
-
68,
|
55
|
-
69,
|
56
|
-
74,
|
57
|
-
75,
|
58
|
-
76,
|
59
|
-
77,
|
60
|
-
78,
|
61
|
-
79,
|
62
|
-
80,
|
63
|
-
81,
|
64
|
-
92,
|
65
|
-
93,
|
66
|
-
98,
|
67
|
-
99,
|
68
|
-
112,
|
69
|
-
113,
|
70
|
-
128,
|
71
|
-
129,
|
72
|
-
134,
|
73
|
-
135,
|
74
|
-
148,
|
75
|
-
149,
|
76
|
-
160,
|
77
|
-
161,
|
78
|
-
162,
|
79
|
-
163,
|
80
|
-
164,
|
81
|
-
165,
|
82
|
-
166,
|
83
|
-
167,
|
84
|
-
168,
|
85
|
-
169,
|
86
|
-
170,
|
87
|
-
171,
|
88
|
-
172,
|
89
|
-
173,
|
90
|
-
178,
|
91
|
-
179,
|
92
|
-
184,
|
93
|
-
185,
|
94
|
-
196,
|
95
|
-
197,
|
96
|
-
198,
|
97
|
-
199,
|
98
|
-
200,
|
99
|
-
201,
|
100
|
-
202,
|
101
|
-
203,
|
102
|
-
204,
|
103
|
-
205,
|
104
|
-
206,
|
105
|
-
207,
|
106
|
-
208,
|
107
|
-
209,
|
108
|
-
214,
|
109
|
-
215,
|
110
|
-
220,
|
111
|
-
221
|
112
|
-
];
|
113
|
-
}
|
114
|
-
} catch (error) {
|
115
|
-
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
116
|
-
}
|
117
|
-
|
118
|
-
/**
|
119
|
-
* Build up the default `inspectOpts` object from the environment variables.
|
120
|
-
*
|
121
|
-
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
122
|
-
*/
|
123
|
-
|
124
|
-
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
125
|
-
return /^debug_/i.test(key);
|
126
|
-
}).reduce((obj, key) => {
|
127
|
-
// Camel-case
|
128
|
-
const prop = key
|
129
|
-
.substring(6)
|
130
|
-
.toLowerCase()
|
131
|
-
.replace(/_([a-z])/g, (_, k) => {
|
132
|
-
return k.toUpperCase();
|
133
|
-
});
|
134
|
-
|
135
|
-
// Coerce string value into JS value
|
136
|
-
let val = process.env[key];
|
137
|
-
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
138
|
-
val = true;
|
139
|
-
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
140
|
-
val = false;
|
141
|
-
} else if (val === 'null') {
|
142
|
-
val = null;
|
143
|
-
} else {
|
144
|
-
val = Number(val);
|
145
|
-
}
|
146
|
-
|
147
|
-
obj[prop] = val;
|
148
|
-
return obj;
|
149
|
-
}, {});
|
150
|
-
|
151
|
-
/**
|
152
|
-
* Is stdout a TTY? Colored output is enabled when `true`.
|
153
|
-
*/
|
154
|
-
|
155
|
-
function useColors() {
|
156
|
-
return 'colors' in exports.inspectOpts ?
|
157
|
-
Boolean(exports.inspectOpts.colors) :
|
158
|
-
tty.isatty(process.stderr.fd);
|
159
|
-
}
|
160
|
-
|
161
|
-
/**
|
162
|
-
* Adds ANSI color escape codes if enabled.
|
163
|
-
*
|
164
|
-
* @api public
|
165
|
-
*/
|
166
|
-
|
167
|
-
function formatArgs(args) {
|
168
|
-
const {namespace: name, useColors} = this;
|
169
|
-
|
170
|
-
if (useColors) {
|
171
|
-
const c = this.color;
|
172
|
-
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
173
|
-
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
174
|
-
|
175
|
-
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
176
|
-
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
177
|
-
} else {
|
178
|
-
args[0] = getDate() + name + ' ' + args[0];
|
179
|
-
}
|
180
|
-
}
|
181
|
-
|
182
|
-
function getDate() {
|
183
|
-
if (exports.inspectOpts.hideDate) {
|
184
|
-
return '';
|
185
|
-
}
|
186
|
-
return new Date().toISOString() + ' ';
|
187
|
-
}
|
188
|
-
|
189
|
-
/**
|
190
|
-
* Invokes `util.format()` with the specified arguments and writes to stderr.
|
191
|
-
*/
|
192
|
-
|
193
|
-
function log(...args) {
|
194
|
-
return process.stderr.write(util.format(...args) + '\n');
|
195
|
-
}
|
196
|
-
|
197
|
-
/**
|
198
|
-
* Save `namespaces`.
|
199
|
-
*
|
200
|
-
* @param {String} namespaces
|
201
|
-
* @api private
|
202
|
-
*/
|
203
|
-
function save(namespaces) {
|
204
|
-
if (namespaces) {
|
205
|
-
process.env.DEBUG = namespaces;
|
206
|
-
} else {
|
207
|
-
// If you set a process.env field to null or undefined, it gets cast to the
|
208
|
-
// string 'null' or 'undefined'. Just delete instead.
|
209
|
-
delete process.env.DEBUG;
|
210
|
-
}
|
211
|
-
}
|
212
|
-
|
213
|
-
/**
|
214
|
-
* Load `namespaces`.
|
215
|
-
*
|
216
|
-
* @return {String} returns the previously persisted debug modes
|
217
|
-
* @api private
|
218
|
-
*/
|
219
|
-
|
220
|
-
function load() {
|
221
|
-
return process.env.DEBUG;
|
222
|
-
}
|
223
|
-
|
224
|
-
/**
|
225
|
-
* Init logic for `debug` instances.
|
226
|
-
*
|
227
|
-
* Create a new `inspectOpts` object in case `useColors` is set
|
228
|
-
* differently for a particular `debug` instance.
|
229
|
-
*/
|
230
|
-
|
231
|
-
function init(debug) {
|
232
|
-
debug.inspectOpts = {};
|
233
|
-
|
234
|
-
const keys = Object.keys(exports.inspectOpts);
|
235
|
-
for (let i = 0; i < keys.length; i++) {
|
236
|
-
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
237
|
-
}
|
238
|
-
}
|
239
|
-
|
240
|
-
module.exports = require('./common')(exports);
|
241
|
-
|
242
|
-
const {formatters} = module.exports;
|
243
|
-
|
244
|
-
/**
|
245
|
-
* Map %o to `util.inspect()`, all on a single line.
|
246
|
-
*/
|
247
|
-
|
248
|
-
formatters.o = function (v) {
|
249
|
-
this.inspectOpts.colors = this.useColors;
|
250
|
-
return util.inspect(v, this.inspectOpts)
|
251
|
-
.split('\n')
|
252
|
-
.map(str => str.trim())
|
253
|
-
.join(' ');
|
254
|
-
};
|
255
|
-
|
256
|
-
/**
|
257
|
-
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
258
|
-
*/
|
259
|
-
|
260
|
-
formatters.O = function (v) {
|
261
|
-
this.inspectOpts.colors = this.useColors;
|
262
|
-
return util.inspect(v, this.inspectOpts);
|
263
|
-
};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) EGOIST <0x142857@gmail.com> (https://egoist.sh)
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# esbuild-register
|
2
|
-
|
3
|
-
[![npm version](https://badgen.net/npm/v/esbuild-register)](https://npm.im/esbuild-register) [![npm downloads](https://badgen.net/npm/dm/esbuild-register)](https://npm.im/esbuild-register)
|
4
|
-
|
5
|
-
## Install
|
6
|
-
|
7
|
-
```bash
|
8
|
-
npm i esbuild esbuild-register -D
|
9
|
-
# Or Yarn
|
10
|
-
yarn add esbuild esbuild-register --dev
|
11
|
-
# Or pnpm
|
12
|
-
pnpm add esbuild esbuild-register -D
|
13
|
-
```
|
14
|
-
|
15
|
-
## Usage
|
16
|
-
|
17
|
-
```bash
|
18
|
-
node -r esbuild-register file.ts
|
19
|
-
```
|
20
|
-
|
21
|
-
It will use `jsxFactory`, `jsxFragmentFactory` and `target` options from your `tsconfig.json`
|
22
|
-
|
23
|
-
### Experimental loader support
|
24
|
-
|
25
|
-
When using in a project with `type: "module"` in `package.json`, you need the `--loader` flag to load TypeScript files:
|
26
|
-
|
27
|
-
```bash
|
28
|
-
node --loader esbuild-register/loader -r esbuild-register ./file.ts
|
29
|
-
```
|
30
|
-
|
31
|
-
## Programmatic Usage
|
32
|
-
|
33
|
-
```ts
|
34
|
-
const { register } = require('esbuild-register/dist/node')
|
35
|
-
|
36
|
-
const { unregister } = register({
|
37
|
-
// ...options
|
38
|
-
})
|
39
|
-
|
40
|
-
// Unregister the require hook if you don't need it anymore
|
41
|
-
unregister()
|
42
|
-
```
|
43
|
-
|
44
|
-
## Sponsors
|
45
|
-
|
46
|
-
[![sponsors](https://sponsors-images.egoist.dev/sponsors.svg)](https://github.com/sponsors/egoist)
|
47
|
-
|
48
|
-
## License
|
49
|
-
|
50
|
-
MIT © [EGOIST](https://egoist.dev)
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/loader.ts
|
2
|
-
var extensionsRegex = /\.(ts|tsx|mts|cts)$/;
|
3
|
-
async function load(url, context, defaultLoad) {
|
4
|
-
if (extensionsRegex.test(url)) {
|
5
|
-
const {source} = await defaultLoad(url, {format: "module"});
|
6
|
-
return {
|
7
|
-
format: "commonjs",
|
8
|
-
source
|
9
|
-
};
|
10
|
-
}
|
11
|
-
return defaultLoad(url, context, defaultLoad);
|
12
|
-
}
|
13
|
-
|
14
|
-
|
15
|
-
exports.load = load;
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { TransformOptions } from 'esbuild';
|
2
|
-
|
3
|
-
declare type LOADERS = 'js' | 'jsx' | 'ts' | 'tsx';
|
4
|
-
declare const FILE_LOADERS: Record<string, LOADERS>;
|
5
|
-
declare type EXTENSIONS = keyof typeof FILE_LOADERS;
|
6
|
-
interface RegisterOptions extends TransformOptions {
|
7
|
-
extensions?: EXTENSIONS[];
|
8
|
-
/**
|
9
|
-
* Auto-ignore node_modules. Independent of any matcher.
|
10
|
-
* @default true
|
11
|
-
*/
|
12
|
-
hookIgnoreNodeModules?: boolean;
|
13
|
-
/**
|
14
|
-
* A matcher function, will be called with path to a file. Should return truthy if the file should be hooked, falsy otherwise.
|
15
|
-
*/
|
16
|
-
hookMatcher?(fileName: string): boolean;
|
17
|
-
}
|
18
|
-
declare function register(esbuildOptions?: RegisterOptions): {
|
19
|
-
unregister(): void;
|
20
|
-
};
|
21
|
-
declare type Register = ReturnType<typeof register>;
|
22
|
-
|
23
|
-
export { Register, register };
|