@normed/bundle 2.0.0 → 2.0.3
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/CHANGELOG.md +8 -0
- package/README.md +35 -0
- package/bundles/bin/cli.d.ts +1 -0
- package/bundles/bin/cli.js +107 -62611
- package/bundles/bin/cli.js.map +1 -0
- package/bundles/builders.d.ts +3 -0
- package/bundles/builders.js +187 -0
- package/bundles/builders.js.map +1 -0
- package/bundles/bundle.d.ts +3 -0
- package/bundles/bundle.js +90 -0
- package/bundles/bundle.js.map +1 -0
- package/bundles/clean.d.ts +2 -0
- package/bundles/clean.js +15 -0
- package/bundles/clean.js.map +1 -0
- package/bundles/dirs.d.ts +9 -0
- package/bundles/dirs.js +37 -0
- package/bundles/dirs.js.map +1 -0
- package/bundles/entrypoints.d.ts +4 -0
- package/bundles/entrypoints.js +99 -0
- package/bundles/entrypoints.js.map +1 -0
- package/bundles/errors.d.ts +3 -0
- package/bundles/errors.js +10 -0
- package/bundles/errors.js.map +1 -0
- package/bundles/es-build.plugins.d.ts +11 -0
- package/bundles/es-build.plugins.js +66 -0
- package/bundles/es-build.plugins.js.map +1 -0
- package/bundles/index.d.ts +5 -0
- package/bundles/index.js +11 -62551
- package/bundles/index.js.map +1 -0
- package/bundles/log.d.ts +8 -0
- package/bundles/log.js +77 -0
- package/bundles/log.js.map +1 -0
- package/bundles/types.d.ts +43 -0
- package/bundles/types.js +3 -0
- package/bundles/types.js.map +1 -0
- package/bundles/utils.d.ts +37 -0
- package/bundles/utils.js +155 -0
- package/bundles/utils.js.map +1 -0
- package/package.json +16 -13
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 2.0.3
|
|
2
|
+
|
|
3
|
+
* MINOR: Adds color
|
|
4
|
+
* MINOR: Bumps dependencies
|
|
5
|
+
* MINOR: Uses bundle's own log function for logging in cli rather than console.log/error
|
|
6
|
+
* MINOR: Fixes build to support ES202 and less types
|
|
7
|
+
* MINOR: Correctly handles escaping Windows paths during substitution
|
|
8
|
+
* MINOR: Alters build logs to have relative paths only
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Premise
|
|
2
|
+
|
|
3
|
+
A used-in-production proof of concept bundler, `@normed/bundle` bundles with output directory structure as *the* first class citizen. Given files in a source directory (defaults to `src`) it transpiles and bundles the entrypoints into the destination directory (defaults to `bundles`). The twist is that any file containing the pre-prefix `static` is automatically an entrypoint, and aside from stripping the pre-prefix and transforming the prefix (ie. `ts` -> `js`) the relative structure remains the same.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
in: out:
|
|
9
|
+
src/ bundles/
|
|
10
|
+
├─ api.ts |
|
|
11
|
+
├─ logger.ts |
|
|
12
|
+
├─ index.static.ts ├─ index.js
|
|
13
|
+
├─ public/ ├─ public/
|
|
14
|
+
├─ base.style.less |
|
|
15
|
+
├─ favicon.static.ico ├─ favicon.ico
|
|
16
|
+
├─ index.static.less ├─ index.css
|
|
17
|
+
├─ index.static.pug ├─ index.html
|
|
18
|
+
├─ index.static.ts ├─ index.js
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
# Things to note
|
|
22
|
+
|
|
23
|
+
The following global javascript variables are available in most environments:
|
|
24
|
+
* `__filename` and `__dirname` - refers to the executing bundle filename/dirname
|
|
25
|
+
The following additional variables provided by `@normed/bundle`, and do not exist by default if not built by `@normed/bundle`:
|
|
26
|
+
* `__source_filename` and `__source_dirname` - refer to the original source files absolute filename/dirname
|
|
27
|
+
* `__source_relative_filename` and `__source_relative_dirname` - refer to the original source files filename/direnation relative to the source directory
|
|
28
|
+
|
|
29
|
+
The current version of `@normed/bundle` is built on top of es-build for speed.
|
|
30
|
+
|
|
31
|
+
# Development
|
|
32
|
+
|
|
33
|
+
## build pipeline
|
|
34
|
+
|
|
35
|
+
`@normed/bundle` is bootstrapped by being built from typescript to javascript first (using `tsc`, output to `dist`), then using the javascript output to build the original source (output to `bundles-a`), then using that output to build the original source again (output to `bundles`), and finally the last two outputs are compared to ensure they are the same.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|