Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
fail-fast: false
matrix:
broccoli-version: ["0.16.9", "1", "2", "3"]
broccoli-version: ["1", "2", "3"]
# when github updates their latest 24.x to include this patch number we can remove the specific version here
node-version: [14.x, 16.x, 18.x, 20.x, 22.x, 24.13.1]

Expand All @@ -77,7 +77,7 @@ jobs:
strategy:
fail-fast: false
matrix:
broccoli-version: ["0.16.9", "1", "2", "3", "4"]
broccoli-version: ["1", "2", "3", "4"]

steps:
- uses: actions/checkout@v6
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@
"test": "tsc && mocha",
"watch": "tsc --watch"
},
"resolutions": {
"quick-temp": "0.1.8"
},
"dependencies": {
"broccoli-node-api": "^1.7.0",
"broccoli-output-wrapper": "^3.2.5",
"fs-merger": "^3.2.1",
"promise-map-series": "^0.3.0",
"quick-temp": "^0.1.8",
"symlink-or-copy": "^1.3.1"
},
"devDependencies": {
Expand Down
6 changes: 0 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 0 additions & 45 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
CallbackObject,
} from 'broccoli-node-api';

import type { MapSeriesIterator, PluginOptions } from './interfaces';

Check warning on line 9 in src/index.ts

View workflow job for this annotation

GitHub Actions / lint

'MapSeriesIterator' is defined but never used

import ReadCompat from './read_compat.js';
import { FSOutput } from 'broccoli-output-wrapper';

// @ts-expect-error the types are declared wrong upstream here
Expand Down Expand Up @@ -67,8 +66,6 @@
private _volatile: boolean;
private _trackInputChanges: boolean;
private _instantiationError: Error;
private _readCompatError?: Error;
private _readCompat?: ReadCompat | false;
private rebuild?: () => void;

__broccoliFeatures__: FeatureSet;
Expand Down Expand Up @@ -118,8 +115,6 @@
this._volatile = !!options.volatile;
this._trackInputChanges = !!options.trackInputChanges;

this._checkOverrides();

// For future extensibility, we version the API using feature flags
this.__broccoliFeatures__ = BROCCOLI_FEATURES;
}
Expand Down Expand Up @@ -168,18 +163,6 @@
return FSFACADE.get(this).output;
}

private _checkOverrides() {
if (typeof this.rebuild === 'function') {
throw new Error('For compatibility, plugins must not define a plugin.rebuild() function');
}
if (this.read !== Plugin.prototype.read) {
throw new Error('For compatibility, plugins must not define a plugin.read() function');
}
if (this.cleanup !== Plugin.prototype.cleanup) {
throw new Error('For compatibility, plugins must not define a plugin.cleanup() function');
}
}

// The Broccoli builder calls plugin.__broccoliGetInfo__
__broccoliGetInfo__(
builderFeatures: FeatureSet = { persistentOutputFlag: true, sourceDirectories: true }
Expand Down Expand Up @@ -291,32 +274,4 @@
build(): Promise<void> | void {
throw new Error('Plugin subclasses must implement a .build() function');
}

// Compatibility code so plugins can run on old, .read-based Broccoli:
read(readTree: MapSeriesIterator<InputNode>): Promise<string> | undefined {
if (this._readCompat == null) {
try {
this._initializeReadCompat(); // call this.__broccoliGetInfo__()
} catch (err) {
// Prevent trying to initialize again on next .read
this._readCompat = false;
// Remember error so we can throw it on all subsequent .read calls
this._readCompatError = err as unknown as Error;
}
}

if (this._readCompatError != null) throw this._readCompatError;

if (this._readCompat) {
return this._readCompat.read(readTree);
}
}

async cleanup(): Promise<void> {
if (this._readCompat) return this._readCompat.cleanup();
}

private _initializeReadCompat() {
this._readCompat = new ReadCompat(this);
}
}
125 changes: 0 additions & 125 deletions src/read_compat.ts

This file was deleted.

Loading
Loading