@nullvoxpopuli/ember-rolldown 2.7.0 → 2.8.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/README.md +138 -98
- package/dist/app-reexports.d.ts +36 -26
- package/dist/app-reexports.d.ts.map +1 -1
- package/dist/app-reexports.js +21 -15
- package/dist/app-reexports.js.map +1 -1
- package/dist/index.d.ts +88 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +351 -201
- package/dist/index.js.map +1 -1
- package/dist/plugin-like-BmC0mYXP.d.ts +30 -0
- package/dist/plugin-like-BmC0mYXP.d.ts.map +1 -0
- package/index.ts +66 -28
- package/package.json +2 -2
- package/src/app-reexports.test.ts +4 -3
- package/src/app-reexports.ts +37 -27
- package/src/babel.test.ts +10 -5
- package/src/babel.ts +117 -72
- package/src/bundle.test.ts +149 -0
- package/src/bundle.ts +71 -0
- package/src/config.ts +42 -18
- package/src/dts.test.ts +42 -26
- package/src/externals.test.ts +16 -11
- package/src/externals.ts +45 -28
- package/src/isolated-declarations.ts +56 -43
- package/src/plugin-like.ts +18 -15
- package/src/published-types.test.ts +18 -13
- package/src/transform.test.ts +26 -17
- package/src/transform.ts +68 -48
- package/dist/plugin-like-CBvGkzCB.d.ts +0 -27
- package/dist/plugin-like-CBvGkzCB.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
import { t as RolldownPluginLike } from "./plugin-like-
|
|
1
|
+
import { t as RolldownPluginLike } from "./plugin-like-BmC0mYXP.js";
|
|
2
2
|
import { Transform } from "babel-plugin-ember-template-compilation";
|
|
3
3
|
import { PluginItem } from "@babel/core";
|
|
4
4
|
//#region src/babel.d.ts
|
|
5
5
|
interface BabelOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Compile templates to the wire format instead of `precompileTemplate`.
|
|
8
|
+
*
|
|
9
|
+
* For a build that bundles its own ember-source.
|
|
10
|
+
* The wire format is private between one template compiler and one
|
|
11
|
+
* glimmer runtime of the same version, so this is only safe when both
|
|
12
|
+
* ship together.
|
|
13
|
+
*
|
|
14
|
+
* The compiler is ember-source's own, resolved from the package.
|
|
15
|
+
*
|
|
16
|
+
* Set by `ember({ bundle: true })`.
|
|
17
|
+
* Only applies without a babel config file.
|
|
18
|
+
*/
|
|
19
|
+
bundle?: boolean;
|
|
6
20
|
babelHelpers?: "bundled" | "runtime" | "inline" | "external";
|
|
7
21
|
/**
|
|
8
22
|
* The babel config file to use.
|
|
9
23
|
*
|
|
10
|
-
* - `undefined`: auto-detect.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
24
|
+
* - `undefined`: auto-detect.
|
|
25
|
+
* A `babel.publish.config.*` (in the package root or `config/`) wins,
|
|
26
|
+
* because this is a publish build.
|
|
27
|
+
* Otherwise babel's own config resolution applies (see `detectConfigFile`).
|
|
13
28
|
* - a string: use that config file.
|
|
14
29
|
* - `false`: ignore config files entirely.
|
|
15
30
|
*
|
|
16
|
-
* Without a config file, templates, decorators, and TypeScript are still
|
|
17
|
-
*
|
|
31
|
+
* Without a config file, templates, decorators, and TypeScript are still handled
|
|
32
|
+
* (see `defaultPlugins`).
|
|
18
33
|
*/
|
|
19
34
|
configFile?: string | false;
|
|
20
35
|
/**
|
|
@@ -22,17 +37,20 @@ interface BabelOptions {
|
|
|
22
37
|
*/
|
|
23
38
|
plugins?: PluginItem[];
|
|
24
39
|
/**
|
|
25
|
-
* Template AST transforms
|
|
26
|
-
*
|
|
40
|
+
* Template AST transforms passed to the default
|
|
41
|
+
* `babel-plugin-ember-template-compilation` entry.
|
|
42
|
+
* e.g. ember-scoped-css's `scopedCSS.template()`
|
|
27
43
|
*
|
|
28
|
-
* Only valid without a babel config file
|
|
29
|
-
* `babel-plugin-ember-template-compilation` yourself,
|
|
30
|
-
* belong there.
|
|
44
|
+
* Only valid without a babel config file.
|
|
45
|
+
* With your own config, you list `babel-plugin-ember-template-compilation` yourself,
|
|
46
|
+
* so its `transforms` belong there.
|
|
31
47
|
*/
|
|
32
48
|
templateTransforms?: Transform[];
|
|
33
49
|
/**
|
|
34
|
-
* Opt additional files into babel (see maybeBabel's `filter`).
|
|
35
|
-
*
|
|
50
|
+
* Opt additional files into babel (see maybeBabel's `filter`).
|
|
51
|
+
*
|
|
52
|
+
* Use this to cover addons that ship code needing babel
|
|
53
|
+
* (e.g. `ember-concurrency`).
|
|
36
54
|
*/
|
|
37
55
|
filter?: {
|
|
38
56
|
include: {
|
|
@@ -45,35 +63,70 @@ interface BabelOptions {
|
|
|
45
63
|
//#region index.d.ts
|
|
46
64
|
interface Config {
|
|
47
65
|
/**
|
|
48
|
-
*
|
|
66
|
+
* Build a self-contained package instead of a library.
|
|
67
|
+
*
|
|
68
|
+
* `false` (the default) builds a library for Ember apps:
|
|
69
|
+
* - ember, the package's dependencies, and its peerDependencies stay external
|
|
70
|
+
* - templates are shipped as `precompileTemplate` calls,
|
|
71
|
+
* for the consuming app to compile
|
|
72
|
+
*
|
|
73
|
+
* `true` builds an artifact that runs on any page, such as a custom element:
|
|
74
|
+
* - ember-source, `@glimmer/component`, `decorator-transforms`,
|
|
75
|
+
* and every other dependency are bundled in
|
|
76
|
+
* - templates are compiled to the wire format with that same ember-source
|
|
77
|
+
* - declarations bundle their type imports as well
|
|
78
|
+
*
|
|
79
|
+
* Which ember-source build is bundled follows the export conditions:
|
|
80
|
+
* - production by default
|
|
81
|
+
* - development with `resolve.conditionNames: ["development"]`
|
|
82
|
+
*/
|
|
83
|
+
bundle?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Options for the babel step.
|
|
86
|
+
* See `BabelOptions`.
|
|
49
87
|
*/
|
|
50
88
|
babel?: BabelOptions;
|
|
51
89
|
}
|
|
52
90
|
/**
|
|
53
|
-
* A batteries-included plugin for building Ember v2 libraries (addons)
|
|
54
|
-
* rolldown
|
|
91
|
+
* A batteries-included plugin for building Ember v2 libraries (addons)
|
|
92
|
+
* with rolldown, or with tsdown (which is built on rolldown).
|
|
93
|
+
*
|
|
94
|
+
* It bundles everything needed to compile `.gts` / `.gjs` and
|
|
95
|
+
* template-tag (`<template>`) source into publishable output:
|
|
96
|
+
*
|
|
97
|
+
* - `emberConfig()`
|
|
98
|
+
* applies sensible tsdown defaults for a library build
|
|
99
|
+
* (sourcemaps, `clean`, `dts`, `.js` / `.d.ts` extensions, quiet logging).
|
|
100
|
+
* Anything you set explicitly still wins.
|
|
101
|
+
*
|
|
102
|
+
* - `emberIsolatedDeclarations()`
|
|
103
|
+
* errors when a tsconfig.json is present without `isolatedDeclarations: true`.
|
|
104
|
+
* That is the only declaration pipeline that can see compiled template-tag modules.
|
|
105
|
+
*
|
|
106
|
+
* - `emberExternals()`
|
|
107
|
+
* keeps your dependencies, peerDependencies, and the ember virtual packages external,
|
|
108
|
+
* so consuming apps resolve them.
|
|
109
|
+
*
|
|
110
|
+
* - `emberBundle()`
|
|
111
|
+
* bundle mode only, in place of `emberExternals()`.
|
|
112
|
+
* Aliases the ember virtual packages into ember-source,
|
|
113
|
+
* whose export conditions pick the build to bundle.
|
|
55
114
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
115
|
+
* - `emberTransform()`
|
|
116
|
+
* preprocesses `<template>` via content-tag,
|
|
117
|
+
* and maps `.gts` / `.gjs` to `.ts` / `.js` so rolldown can understand them.
|
|
58
118
|
*
|
|
59
|
-
* - `
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* ember virtual packages external, so consuming apps resolve them.
|
|
67
|
-
* - `emberTransform()` — preprocesses `<template>` via content-tag and maps
|
|
68
|
-
* `.gts`/`.gjs` to `.ts`/`.js` so rolldown can understand them.
|
|
69
|
-
* - `emberBabel()` — runs babel (template compilation, decorators, type
|
|
70
|
-
* stripping) with `babelHelpers: "bundled"`, but only on the files that
|
|
71
|
-
* actually need it (via `maybeBabel`); everything else stays on the fast
|
|
72
|
-
* native transform. The library's own `babel.config.js` is used when it
|
|
73
|
-
* exists; no config file is required.
|
|
119
|
+
* - `emberBabel()`
|
|
120
|
+
* runs babel (template compilation, decorators, type stripping)
|
|
121
|
+
* with `babelHelpers: "bundled"`.
|
|
122
|
+
* Only the files that need it go through babel (via `maybeBabel`).
|
|
123
|
+
* Everything else stays on the fast native transform.
|
|
124
|
+
* The library's own `babel.config.js` is used when it exists.
|
|
125
|
+
* No config file is required.
|
|
74
126
|
*
|
|
75
|
-
* Usage in `tsdown.config.js
|
|
76
|
-
* `rolldown` for a `rolldown.config.js`
|
|
127
|
+
* Usage in `tsdown.config.js`.
|
|
128
|
+
* Import `defineConfig` from `tsdown` (or from `rolldown` for a `rolldown.config.js`)
|
|
129
|
+
* so it carries the correct types:
|
|
77
130
|
*
|
|
78
131
|
* ```js
|
|
79
132
|
* import { defineConfig } from "tsdown";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/babel.ts","../index.ts"],"mappings":";;;;UAWiB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/babel.ts","../index.ts"],"mappings":";;;;UAWiB;;;;;;;;;;;;;;EAcf;EACA;;;;;;;;;;;;;;EAcA;;;;EAIA,UAAU;;;;;;;;;;EAUV,qBAAqB;;;;;;;EAOrB;IACE;MACE;MACA,gBAAgB;;;;;;UCxDZ;;;;;;;;;;;;;;;;;;;EAmBR;;;;;EAKA,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsDM,MAAM,SAAQ,SAAc"}
|