@nx/rollup 23.3.0-pr.37068.f95e11e → 23.3.0-rc.0

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 CHANGED
@@ -12,7 +12,7 @@
12
12
  [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](<>)
13
13
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
14
14
  [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
15
- [![Nx Sandboxing](https://staging.nx.app/workspaces/62d013ea0852fe0a2df74438/sandbox-badge.svg)](https://nx.dev/docs/features/ci-features/sandboxing)
15
+ [![Hours saved](https://img.shields.io/endpoint?url=https%3A%2F%2Fstaging.nx.app%2Fnx-cloud%2Fbadge%2F62d013ea0852fe0a2df74438%2Fhours-saved.json)](https://nx.dev/nx-cloud)
16
16
 
17
17
  </div>
18
18
 
@@ -0,0 +1,10 @@
1
+ import type * as TypeScript from 'typescript';
2
+ /**
3
+ * Returns TypeScript with a `createWatchProgram` whose programs clear the
4
+ * timers they armed when they are closed.
5
+ *
6
+ * TypeScript's `close()` does not cancel a pending program-update timer.
7
+ * If it fires after close, it can recreate file watchers and keep a
8
+ * one-shot Rollup process alive.
9
+ */
10
+ export declare function clearTimersOnClose(ts: typeof TypeScript): typeof TypeScript;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clearTimersOnClose = clearTimersOnClose;
4
+ /**
5
+ * Returns TypeScript with a `createWatchProgram` whose programs clear the
6
+ * timers they armed when they are closed.
7
+ *
8
+ * TypeScript's `close()` does not cancel a pending program-update timer.
9
+ * If it fires after close, it can recreate file watchers and keep a
10
+ * one-shot Rollup process alive.
11
+ */
12
+ function clearTimersOnClose(ts) {
13
+ return Object.create(ts, {
14
+ createWatchProgram: {
15
+ value(host) {
16
+ const pending = new Set();
17
+ const { setTimeout: schedule, clearTimeout: cancel } = host;
18
+ if (schedule && cancel) {
19
+ host.setTimeout = (callback, ms, ...args) => {
20
+ const timer = schedule(() => {
21
+ pending.delete(timer);
22
+ callback(...args);
23
+ }, ms);
24
+ pending.add(timer);
25
+ return timer;
26
+ };
27
+ host.clearTimeout = (timer) => {
28
+ pending.delete(timer);
29
+ cancel(timer);
30
+ };
31
+ }
32
+ const program = ts.createWatchProgram(host);
33
+ const close = program.close;
34
+ program.close = () => {
35
+ close.call(program);
36
+ pending.forEach((timer) => cancel(timer));
37
+ pending.clear();
38
+ };
39
+ return program;
40
+ },
41
+ },
42
+ });
43
+ }
@@ -19,6 +19,7 @@ const generate_package_json_1 = require("../package-json/generate-package-json")
19
19
  const swc_1 = require("../swc");
20
20
  const get_project_node_1 = require("./get-project-node");
21
21
  const normalize_options_1 = require("./normalize-options");
22
+ const watch_program_timers_1 = require("./watch-program-timers");
22
23
  // These use require because the ES import isn't correct.
23
24
  const commonjs = require('@rollup/plugin-commonjs');
24
25
  const image = require('@rollup/plugin-image');
@@ -173,6 +174,7 @@ dependencies) {
173
174
  : finalConfig.output.dir;
174
175
  return require('@rollup/plugin-typescript')({
175
176
  tsconfig: tsConfigPath,
177
+ typescript: (0, watch_program_timers_1.clearTimersOnClose)(ts),
176
178
  compilerOptions: {
177
179
  ...tsCompilerOptions,
178
180
  composite: false,
@@ -19,6 +19,10 @@ function ensureDependencies(tree, options) {
19
19
  'swc-loader': versions_1.swcLoaderVersion,
20
20
  }, undefined, true);
21
21
  case 'babel':
22
+ // core-js' install script only prints a funding message.
23
+ (0, internal_1.acknowledgeBuildScripts)(tree, (0, devkit_1.detectPackageManager)(tree.root), {
24
+ 'core-js': false,
25
+ });
22
26
  return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
23
27
  'core-js': versions_1.coreJsVersion, // needed for preset-env to work
24
28
  tslib: versions_1.tsLibVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/rollup",
3
- "version": "23.3.0-pr.37068.f95e11e",
3
+ "version": "23.3.0-rc.0",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -77,6 +77,8 @@
77
77
  }
78
78
  },
79
79
  "dependencies": {
80
+ "@nx/devkit": "23.3.0-rc.0",
81
+ "@nx/js": "23.3.0-rc.0",
80
82
  "@phenomnomnominal/tsquery": "~6.2.0",
81
83
  "@rollup/plugin-babel": "^6.0.4",
82
84
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -90,9 +92,7 @@
90
92
  "picomatch": "4.0.4",
91
93
  "postcss": "^8.4.38",
92
94
  "postcss-modules": "^6.0.1",
93
- "tslib": "^2.3.0",
94
- "@nx/devkit": "23.3.0-pr.37068.f95e11e",
95
- "@nx/js": "23.3.0-pr.37068.f95e11e"
95
+ "tslib": "^2.3.0"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "rollup": "^3.0.0 || ^4.0.0"
@@ -103,8 +103,8 @@
103
103
  }
104
104
  },
105
105
  "devDependencies": {
106
- "source-map-js": "^1.2.0",
107
- "nx": "23.3.0-pr.37068.f95e11e"
106
+ "nx": "23.3.0-rc.0",
107
+ "source-map-js": "^1.2.0"
108
108
  },
109
109
  "publishConfig": {
110
110
  "access": "public"
@@ -0,0 +1,18 @@
1
+ <p style="text-align: center;">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
+ <img alt="Nx - Smart Monorepos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
7
+
8
+ {{links}}
9
+
10
+ <hr>
11
+
12
+ # Nx: Smart Monorepos · Fast Builds
13
+
14
+ Get to green PRs in half the time. Nx optimizes your builds, scales your CI, and fixes failed PRs. Built for developers and AI agents.
15
+
16
+ This package is a [Rollup plugin for Nx](https://nx.dev/nx-api/rollup).
17
+
18
+ {{content}}