@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/dist/index.d.ts CHANGED
@@ -1,20 +1,35 @@
1
- import { t as RolldownPluginLike } from "./plugin-like-CBvGkzCB.js";
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. A `babel.publish.config.*` (in the package root
11
- * or `config/`) wins, because this is a publish build; otherwise babel's own
12
- * config resolution applies (see `detectConfigFile`).
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
- * handled (see `defaultPlugins`).
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 (e.g. ember-scoped-css's `scopedCSS.template()`)
26
- * passed to the default `babel-plugin-ember-template-compilation` entry.
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: with your own config, you list
29
- * `babel-plugin-ember-template-compilation` yourself, so its `transforms`
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`). Use this to
35
- * cover addons that ship code needing babel (e.g. `ember-concurrency`).
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
- * Options for the babel step; see `BabelOptions`.
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) with
54
- * rolldown (or tsdown, which is built on 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
- * It bundles everything needed to compile `.gts`/`.gjs` and template-tag
57
- * (`<template>`) source into publishable output:
115
+ * - `emberTransform()`
116
+ * preprocesses `<template>` via content-tag,
117
+ * and maps `.gts` / `.gjs` to `.ts` / `.js` so rolldown can understand them.
58
118
  *
59
- * - `emberConfig()` — applies sensible tsdown defaults for a library build
60
- * (sourcemaps, `clean`, `dts`, `.js`/`.d.ts` extensions, quiet logging);
61
- * anything you set explicitly still wins.
62
- * - `emberIsolatedDeclarations()` — errors when a tsconfig.json is present
63
- * without `isolatedDeclarations: true` (required: it is the only
64
- * declaration pipeline that can see compiled template-tag modules).
65
- * - `emberExternals()` — keeps your dependencies, peerDependencies, and the
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` (import `defineConfig` from `tsdown` — or from
76
- * `rolldown` for a `rolldown.config.js` — so it carries the correct types):
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";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/babel.ts","../index.ts"],"mappings":";;;;UAWiB;EACf;;;;;;;;;;;;;EAaA;;;;EAIA,UAAU;;;;;;;;;EASV,qBAAqB;;;;;EAKrB;IACE;MACE;MACA,gBAAgB;;;;;;UCvCZ;;;;EAIR,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCM,MAAM,SAAQ,SAAc"}
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"}