@parcel/parcel3 0.0.7 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/bin/parcel3 +16 -11
- package/package.json +11 -10
- package/src/esmodule-helpers.js +0 -37
- package/src/mdx-components.jsx +0 -24
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-present Devon Govett
|
|
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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://parceljs.org/" target="_blank">
|
|
3
|
+
<img alt="Parcel" src="https://user-images.githubusercontent.com/19409/135924939-03845d0b-e7bb-414b-89b6-e627dfa9f614.png" width="749">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
[](#backers) [](#sponsors)
|
|
8
|
+
[](https://www.npmjs.com/package/parcel)
|
|
9
|
+
[](https://www.npmjs.com/package/parcel)
|
|
10
|
+
[](https://discord.gg/XSCzqGRuvr)
|
|
11
|
+
[](https://twitter.com/parceljs)
|
|
12
|
+
|
|
13
|
+
**NOTE: This is Parcel v3 (currently in alpha).**
|
|
14
|
+
|
|
15
|
+
Parcel is a batteries-included build tool for the web. It combines a great out-of-the-box development experience with a scalable architecture that can take your project from just getting started to massive production application.
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- 😍 **Batteries included** – Parcel supports many languages and file types out of the box, from web technologies like HTML, CSS, and JavaScript, to assets like images, fonts, videos, and more. It has a built-in dev server with hot reloading, beautiful error diagnostics, and much more. No configuration needed!
|
|
20
|
+
- ⚡️ **Lightning fast** – Parcel is written in Rust for native performance, taking advantage of all of the cores on your machine. Extend it with native plugins written in Rust, Go, Swift, or any language that supports the C ABI.
|
|
21
|
+
- 🚀 **Automatic production optimization** – Parcel optimizes your whole app for production automatically. This includes tree-shaking and minifying your JavaScript, CSS, and HTML, resizing and optimizing images, content hashing, automatic code splitting, and much more.
|
|
22
|
+
- 🎯 **Ship for any target** – Parcel automatically transforms your code for your target environments. From modern and legacy browser support, to zero config JSX and TypeScript compilation, Parcel makes it easy to build for any target – or many!
|
|
23
|
+
- 🌍 **Scalable** – Parcel requires zero configuration to get started. But as your application grows and your build requirements become more complex, it's possible to extend Parcel in just about every way. A simple configuration format and powerful native and JavaScript plugin system means Parcel can support projects of any size or complexity.
|
|
24
|
+
|
|
25
|
+
## Getting Started
|
|
26
|
+
|
|
27
|
+
See the following guides in our documentation on how to get started with Parcel.
|
|
28
|
+
|
|
29
|
+
* [Building a webapp with Parcel](https://v3.parceljs.org/getting-started/webapp/)
|
|
30
|
+
* [Building a library with Parcel](https://v3.parceljs.org/getting-started/library/)
|
|
31
|
+
* [Migrating from Parcel v2](https://v3.parceljs.org/getting-started/migration/)
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
Read the docs at https://v3.parceljs.org/docs/.
|
|
36
|
+
|
|
37
|
+
## Community
|
|
38
|
+
|
|
39
|
+
- ❓ Ask questions on [GitHub Discussions](https://github.com/parcel-bundler/parcel/discussions).
|
|
40
|
+
- 💬 Join the community on [Discord](https://discord.gg/XSCzqGRuvr).
|
|
41
|
+
- 📣 Stay up to date on new features and announcements on [Twitter](https://twitter.com/parceljs).
|
|
42
|
+
|
|
43
|
+
## Contributors
|
|
44
|
+
|
|
45
|
+
This project exists thanks to all the people who contribute. [[Contribute]](CONTRIBUTING.md).
|
|
46
|
+
<a href="https://github.com/parcel-bundler/parcel/graphs/contributors"><img src="https://opencollective.com/parcel/contributors.svg?width=890" title="contributors" alt="contributors" /></a>
|
|
47
|
+
|
|
48
|
+
## Backers
|
|
49
|
+
|
|
50
|
+
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/parcel#backer)]
|
|
51
|
+
|
|
52
|
+
<a href="https://opencollective.com/parcel#backers" target="_blank"><img src="https://opencollective.com/parcel/backers.svg?width=890"></a>
|
|
53
|
+
|
|
54
|
+
## Sponsors
|
|
55
|
+
|
|
56
|
+
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/parcel#sponsor)]
|
|
57
|
+
|
|
58
|
+
<a href="https://opencollective.com/parcel/sponsor/0/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/0/avatar.svg"></a>
|
|
59
|
+
<a href="https://opencollective.com/parcel/sponsor/1/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/1/avatar.svg"></a>
|
|
60
|
+
<a href="https://opencollective.com/parcel/sponsor/2/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/2/avatar.svg"></a>
|
|
61
|
+
<a href="https://opencollective.com/parcel/sponsor/3/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/3/avatar.svg"></a>
|
|
62
|
+
<a href="https://opencollective.com/parcel/sponsor/4/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/4/avatar.svg"></a>
|
|
63
|
+
<a href="https://opencollective.com/parcel/sponsor/5/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/5/avatar.svg"></a>
|
|
64
|
+
<a href="https://opencollective.com/parcel/sponsor/6/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/6/avatar.svg"></a>
|
|
65
|
+
<a href="https://opencollective.com/parcel/sponsor/7/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/7/avatar.svg"></a>
|
|
66
|
+
<a href="https://opencollective.com/parcel/sponsor/8/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/8/avatar.svg"></a>
|
|
67
|
+
<a href="https://opencollective.com/parcel/sponsor/9/website" target="_blank"><img src="https://opencollective.com/parcel/sponsor/9/avatar.svg"></a>
|
package/bin/parcel3
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Shipped as `bin/
|
|
5
|
+
* Shipped as `bin/parcel` in the `parcel` package, and as `bin/parcel3` in
|
|
6
|
+
* `@parcel/parcel3`, which exists so Parcel 3 can be installed beside Parcel 2.
|
|
7
|
+
* Parcel itself is a native executable, published one
|
|
6
8
|
* platform package per target and pulled in through optionalDependencies, so all
|
|
7
9
|
* this file does is hand off to whichever one npm installed for this host.
|
|
8
10
|
*
|
|
9
11
|
* It also tries to take itself out of the loop. Starting Node costs ~30ms on
|
|
10
|
-
* every single
|
|
12
|
+
* every single invocation, which is a large tax on a tool whose whole
|
|
11
13
|
* point is being fast, so on the first run it rewrites the `node_modules/.bin`
|
|
12
14
|
* entry that launched it into a launcher that execs the binary without Node.
|
|
13
15
|
* See `launcher` for why that launcher looks the way it does.
|
|
@@ -19,13 +21,16 @@
|
|
|
19
21
|
const fs = require('fs');
|
|
20
22
|
const path = require('path');
|
|
21
23
|
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The command, which is also the `node_modules/.bin` entry `optimize` rewrites.
|
|
26
|
+
* Taken from this file's own name, so both packages can ship it unchanged.
|
|
27
|
+
*/
|
|
28
|
+
const NAME = path.basename(__filename);
|
|
24
29
|
|
|
25
|
-
/** Prefix of the platform packages
|
|
30
|
+
/** Prefix of the platform packages, which both packages depend on. */
|
|
26
31
|
const PLATFORM_PACKAGE = '@parcel/parcel3';
|
|
27
32
|
|
|
28
|
-
const EXECUTABLE = process.platform === 'win32' ? '
|
|
33
|
+
const EXECUTABLE = process.platform === 'win32' ? 'parcel.exe' : 'parcel';
|
|
29
34
|
|
|
30
35
|
/**
|
|
31
36
|
* The platform packages that could serve this host, best first.
|
|
@@ -75,7 +80,7 @@ if (binPath == null) {
|
|
|
75
80
|
process.stderr.write(
|
|
76
81
|
`Parcel could not find the "${
|
|
77
82
|
candidates()[0]
|
|
78
|
-
}" package, which would hold the
|
|
83
|
+
}" package, which would hold the Parcel ` +
|
|
79
84
|
`binary for ${process.platform} ${process.arch}.\n\n` +
|
|
80
85
|
`Either Parcel publishes no binary for this platform, or the one it does publish was not ` +
|
|
81
86
|
`installed: it comes in through optionalDependencies, so --no-optional and --omit=optional ` +
|
|
@@ -93,7 +98,7 @@ run();
|
|
|
93
98
|
*
|
|
94
99
|
* Only an entry that can be proven to refer to this file is ever touched, the
|
|
95
100
|
* write goes through a temp file and an atomic rename, and every failure leaves
|
|
96
|
-
* the entry alone - a slow
|
|
101
|
+
* the entry alone - a slow Parcel is fine, a broken one is not.
|
|
97
102
|
*/
|
|
98
103
|
function optimize() {
|
|
99
104
|
// Windows generates .cmd and .ps1 shims with `node` baked in at install time,
|
|
@@ -104,10 +109,10 @@ function optimize() {
|
|
|
104
109
|
try {
|
|
105
110
|
const stat = fs.lstatSync(entry);
|
|
106
111
|
if (stat.isSymbolicLink()) {
|
|
107
|
-
// npm and Yarn: .bin
|
|
112
|
+
// npm and Yarn: the .bin entry is a symlink to this file.
|
|
108
113
|
if (fs.realpathSync(entry) !== __filename) continue;
|
|
109
114
|
} else if (stat.isFile()) {
|
|
110
|
-
// pnpm: .bin
|
|
115
|
+
// pnpm: the .bin entry is a generated sh wrapper that runs `node <this>`.
|
|
111
116
|
if (!wrapsThisFile(fs.readFileSync(entry, 'utf8'))) continue;
|
|
112
117
|
} else {
|
|
113
118
|
continue;
|
|
@@ -128,7 +133,7 @@ function wrapsThisFile(contents) {
|
|
|
128
133
|
return contents.includes(tail) && contents.includes('node');
|
|
129
134
|
}
|
|
130
135
|
|
|
131
|
-
/** Every `.bin
|
|
136
|
+
/** Every `.bin` entry that could have launched this file. */
|
|
132
137
|
function* binEntries() {
|
|
133
138
|
// What the kernel was handed, before symlinks were resolved: npm and Yarn
|
|
134
139
|
// launch us through the .bin symlink itself.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcel/parcel3",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -12,19 +12,20 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"bin",
|
|
15
|
-
"
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
16
17
|
],
|
|
17
18
|
"engines": {
|
|
18
19
|
"node": ">= 18"
|
|
19
20
|
},
|
|
20
21
|
"optionalDependencies": {
|
|
21
|
-
"@parcel/parcel3-darwin-arm64": "0.0.
|
|
22
|
-
"@parcel/parcel3-win32-arm64": "0.0.
|
|
23
|
-
"@parcel/parcel3-linux-arm64": "0.0.
|
|
24
|
-
"@parcel/parcel3-linux-arm64-musl": "0.0.
|
|
25
|
-
"@parcel/parcel3-darwin-x64": "0.0.
|
|
26
|
-
"@parcel/parcel3-win32-x64": "0.0.
|
|
27
|
-
"@parcel/parcel3-linux-x64": "0.0.
|
|
28
|
-
"@parcel/parcel3-linux-x64-musl": "0.0.
|
|
22
|
+
"@parcel/parcel3-darwin-arm64": "3.0.0-alpha.1",
|
|
23
|
+
"@parcel/parcel3-win32-arm64": "3.0.0-alpha.1",
|
|
24
|
+
"@parcel/parcel3-linux-arm64": "3.0.0-alpha.1",
|
|
25
|
+
"@parcel/parcel3-linux-arm64-musl": "3.0.0-alpha.1",
|
|
26
|
+
"@parcel/parcel3-darwin-x64": "3.0.0-alpha.1",
|
|
27
|
+
"@parcel/parcel3-win32-x64": "3.0.0-alpha.1",
|
|
28
|
+
"@parcel/parcel3-linux-x64": "3.0.0-alpha.1",
|
|
29
|
+
"@parcel/parcel3-linux-x64-musl": "3.0.0-alpha.1"
|
|
29
30
|
}
|
|
30
31
|
}
|
package/src/esmodule-helpers.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
exports.interopDefault = function (a) {
|
|
2
|
-
return a && a.__esModule ? a : {default: a};
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
exports.defineInteropFlag = function (a) {
|
|
6
|
-
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
exports.exportAll = function (source, dest) {
|
|
10
|
-
Object.keys(source).forEach(function (key) {
|
|
11
|
-
if (
|
|
12
|
-
key === 'default' ||
|
|
13
|
-
key === '__esModule' ||
|
|
14
|
-
Object.prototype.hasOwnProperty.call(dest, key)
|
|
15
|
-
) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
Object.defineProperty(dest, key, {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
configurable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return source[key];
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
return dest;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
exports.export = function (dest, destName, get) {
|
|
32
|
-
Object.defineProperty(dest, destName, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
configurable: true,
|
|
35
|
-
get: get,
|
|
36
|
-
});
|
|
37
|
-
};
|
package/src/mdx-components.jsx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/* @jsxRuntime automatic */
|
|
2
|
-
/* eslint-disable react/prop-types */
|
|
3
|
-
/* eslint-disable react/react-in-jsx-scope */
|
|
4
|
-
|
|
5
|
-
function CodeBlock({lang, children, render}) {
|
|
6
|
-
return (
|
|
7
|
-
<>
|
|
8
|
-
<pre>
|
|
9
|
-
<code className={lang ? `language-${lang}` : undefined}>
|
|
10
|
-
{children}
|
|
11
|
-
</code>
|
|
12
|
-
</pre>
|
|
13
|
-
{render}
|
|
14
|
-
</>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const components = {
|
|
19
|
-
CodeBlock,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export function useMDXComponents() {
|
|
23
|
-
return components;
|
|
24
|
-
}
|