@animus-ui/unplugin 0.1.26 → 0.1.27
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/{core-zGWPVkIb.cjs → core-B-uObifz.cjs} +20 -46
- package/dist/{core-CrtP5_Sj.mjs → core-vnpaY35A.mjs} +21 -47
- package/dist/core.d.ts.map +1 -1
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.mjs +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +2 -2
|
@@ -260,19 +260,18 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
260
260
|
session.assetClassification = hostAssets;
|
|
261
261
|
session.loadExpander = hostLoadExpander;
|
|
262
262
|
session.hostResolve = hostResolver;
|
|
263
|
-
session.
|
|
263
|
+
session.delivery = {
|
|
264
|
+
...session.delivery,
|
|
265
|
+
systemPropsModuleId: _animus_ui_extract_session.TURBOPACK_SYSTEM_PROPS_ID
|
|
266
|
+
};
|
|
264
267
|
session.structuralExclude = (0, _animus_ui_extract_pipeline.outputExclusions)(root, hostOutputTargets());
|
|
265
268
|
session.aliasesFromTsconfig = true;
|
|
266
269
|
state.key = session.key;
|
|
267
270
|
try {
|
|
268
271
|
await session.runFullPipeline();
|
|
269
272
|
} catch (error) {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
...session.systemDependencyPaths,
|
|
273
|
-
...session.systemMissingPaths,
|
|
274
|
-
(0, node_path.join)(root, "tsconfig.json")
|
|
275
|
-
];
|
|
273
|
+
const plan = session.watchPlan();
|
|
274
|
+
state.watchPaths = [...plan.files, ...plan.missing];
|
|
276
275
|
throw error;
|
|
277
276
|
}
|
|
278
277
|
state.sessionDir = (0, _animus_ui_extract_session.getSessionArtifactDir)(session.key);
|
|
@@ -286,61 +285,36 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
286
285
|
state.redirectTargets = new Set(state.kitRedirects.values());
|
|
287
286
|
state.externalPackageDirs = [...session.externalPackageDirs];
|
|
288
287
|
state.analyzedFiles = [...analyzed.keys()].map((key) => (0, node_path.resolve)(root, key));
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
288
|
+
const plan = session.watchPlan();
|
|
289
|
+
state.watchPaths = [.../* @__PURE__ */ new Set([
|
|
290
|
+
...state.analyzedFiles,
|
|
291
|
+
...plan.files,
|
|
292
|
+
...plan.missing
|
|
293
|
+
])];
|
|
295
294
|
state.transformFile = (0, _animus_ui_extract_session.engineApi)(session.key).transformFile;
|
|
296
295
|
});
|
|
297
296
|
}
|
|
298
|
-
/**
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
|
|
303
|
-
* environment under one name) waits for that build's end, so each build
|
|
304
|
-
* ends only its own generation, once, in buildEnd. webpack-like hosts run
|
|
305
|
-
* one compile at a time and are not tracked. */
|
|
306
|
-
const openBuilds = /* @__PURE__ */ new Map();
|
|
307
|
-
const singleEnvironment = { name: "build" };
|
|
297
|
+
/** The Rollup family's environment builds: a Vite buildApp can build
|
|
298
|
+
* environments in parallel on one plugin instance, sharing one pipeline
|
|
299
|
+
* and one Session. webpack-like hosts run one compile at a time and are
|
|
300
|
+
* not tracked. */
|
|
301
|
+
const builds = new _animus_ui_extract_session.EnvironmentBuilds();
|
|
308
302
|
const tracksEnvironments = meta.framework === "rollup" || meta.framework === "rolldown" || meta.framework === "vite";
|
|
309
303
|
function environmentOf(context) {
|
|
310
|
-
return hasEnvironment(context) ? context.environment :
|
|
304
|
+
return hasEnvironment(context) ? context.environment : builds.single;
|
|
311
305
|
}
|
|
312
306
|
/** Opens this hook's environment build once no build under its name is
|
|
313
307
|
* open; whether another environment's build is open, whose pipeline this
|
|
314
308
|
* build shares. */
|
|
315
309
|
async function openEnvironmentBuild(context) {
|
|
316
310
|
if (!tracksEnvironments) return false;
|
|
317
|
-
|
|
318
|
-
for (;;) {
|
|
319
|
-
const open = openBuilds.get(environment.name);
|
|
320
|
-
if (open === void 0) break;
|
|
321
|
-
await open.ended;
|
|
322
|
-
}
|
|
323
|
-
let end = () => {};
|
|
324
|
-
const ended = new Promise((settle) => {
|
|
325
|
-
end = settle;
|
|
326
|
-
});
|
|
327
|
-
openBuilds.set(environment.name, {
|
|
328
|
-
environment,
|
|
329
|
-
ended,
|
|
330
|
-
end
|
|
331
|
-
});
|
|
332
|
-
return openBuilds.size > 1;
|
|
311
|
+
return builds.open(environmentOf(context));
|
|
333
312
|
}
|
|
334
313
|
/** Ends this hook's environment build; whether none is left open. Only
|
|
335
314
|
* the build that opened an entry ends it. */
|
|
336
315
|
function closeEnvironmentBuild(context) {
|
|
337
316
|
if (!tracksEnvironments) return true;
|
|
338
|
-
|
|
339
|
-
const open = openBuilds.get(environment.name);
|
|
340
|
-
if (open === void 0 || open.environment !== environment) return false;
|
|
341
|
-
openBuilds.delete(environment.name);
|
|
342
|
-
open.end();
|
|
343
|
-
return openBuilds.size === 0;
|
|
317
|
+
return builds.end(environmentOf(context));
|
|
344
318
|
}
|
|
345
319
|
async function joinPipeline() {
|
|
346
320
|
await pipelineStarted;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimusConfigError, BUILT_IN_EXTENSION_POLICY, DiagnosticFailure, ENGINE_TRANSFORM_EXTENSIONS, analysedOutputs, assertKnownOptionKeys, assertSupportedEngine, builtInAssetClassification, droppedExtensionMessage, esbuildAssetClassification, esbuildExtensionPolicy, esbuildOutputTargets, isEngineTransformExtension, isPathWithinRoot, keepsKitSourceEffects, mergeOutputTargets, noOutputTargets, outputExclusions, resolveMode, rollupExtensionPolicy, rollupOutputTargets, servedFiles, viteAssetClassification, viteExtensionPolicy, viteHostExpander, viteOutputTargets, webpackExtensionPolicy, webpackHostExpander, webpackOutputTargets } from "@animus-ui/extract/pipeline";
|
|
2
|
-
import { ANIMUS_CSS_MODULE_ID, ExtractionSession, SESSION_ASSETS_DIR, TURBOPACK_SYSTEM_PROPS_ID, collectSessionAssets, createBuildId, engineApi, getAnalyzedHashes, getManifestJson, getSessionArtifactDir, getSharedCss, getSharedSystemProps } from "@animus-ui/extract/session";
|
|
2
|
+
import { ANIMUS_CSS_MODULE_ID, EnvironmentBuilds, ExtractionSession, SESSION_ASSETS_DIR, TURBOPACK_SYSTEM_PROPS_ID, collectSessionAssets, createBuildId, engineApi, getAnalyzedHashes, getManifestJson, getSessionArtifactDir, getSharedCss, getSharedSystemProps } from "@animus-ui/extract/session";
|
|
3
3
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { dirname, join, relative, resolve } from "node:path";
|
|
5
5
|
//#region src/options.ts
|
|
@@ -260,19 +260,18 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
260
260
|
session.assetClassification = hostAssets;
|
|
261
261
|
session.loadExpander = hostLoadExpander;
|
|
262
262
|
session.hostResolve = hostResolver;
|
|
263
|
-
session.
|
|
263
|
+
session.delivery = {
|
|
264
|
+
...session.delivery,
|
|
265
|
+
systemPropsModuleId: TURBOPACK_SYSTEM_PROPS_ID
|
|
266
|
+
};
|
|
264
267
|
session.structuralExclude = outputExclusions(root, hostOutputTargets());
|
|
265
268
|
session.aliasesFromTsconfig = true;
|
|
266
269
|
state.key = session.key;
|
|
267
270
|
try {
|
|
268
271
|
await session.runFullPipeline();
|
|
269
272
|
} catch (error) {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
...session.systemDependencyPaths,
|
|
273
|
-
...session.systemMissingPaths,
|
|
274
|
-
join(root, "tsconfig.json")
|
|
275
|
-
];
|
|
273
|
+
const plan = session.watchPlan();
|
|
274
|
+
state.watchPaths = [...plan.files, ...plan.missing];
|
|
276
275
|
throw error;
|
|
277
276
|
}
|
|
278
277
|
state.sessionDir = getSessionArtifactDir(session.key);
|
|
@@ -286,61 +285,36 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
286
285
|
state.redirectTargets = new Set(state.kitRedirects.values());
|
|
287
286
|
state.externalPackageDirs = [...session.externalPackageDirs];
|
|
288
287
|
state.analyzedFiles = [...analyzed.keys()].map((key) => resolve(root, key));
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
288
|
+
const plan = session.watchPlan();
|
|
289
|
+
state.watchPaths = [.../* @__PURE__ */ new Set([
|
|
290
|
+
...state.analyzedFiles,
|
|
291
|
+
...plan.files,
|
|
292
|
+
...plan.missing
|
|
293
|
+
])];
|
|
295
294
|
state.transformFile = engineApi(session.key).transformFile;
|
|
296
295
|
});
|
|
297
296
|
}
|
|
298
|
-
/**
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
|
|
303
|
-
* environment under one name) waits for that build's end, so each build
|
|
304
|
-
* ends only its own generation, once, in buildEnd. webpack-like hosts run
|
|
305
|
-
* one compile at a time and are not tracked. */
|
|
306
|
-
const openBuilds = /* @__PURE__ */ new Map();
|
|
307
|
-
const singleEnvironment = { name: "build" };
|
|
297
|
+
/** The Rollup family's environment builds: a Vite buildApp can build
|
|
298
|
+
* environments in parallel on one plugin instance, sharing one pipeline
|
|
299
|
+
* and one Session. webpack-like hosts run one compile at a time and are
|
|
300
|
+
* not tracked. */
|
|
301
|
+
const builds = new EnvironmentBuilds();
|
|
308
302
|
const tracksEnvironments = meta.framework === "rollup" || meta.framework === "rolldown" || meta.framework === "vite";
|
|
309
303
|
function environmentOf(context) {
|
|
310
|
-
return hasEnvironment(context) ? context.environment :
|
|
304
|
+
return hasEnvironment(context) ? context.environment : builds.single;
|
|
311
305
|
}
|
|
312
306
|
/** Opens this hook's environment build once no build under its name is
|
|
313
307
|
* open; whether another environment's build is open, whose pipeline this
|
|
314
308
|
* build shares. */
|
|
315
309
|
async function openEnvironmentBuild(context) {
|
|
316
310
|
if (!tracksEnvironments) return false;
|
|
317
|
-
|
|
318
|
-
for (;;) {
|
|
319
|
-
const open = openBuilds.get(environment.name);
|
|
320
|
-
if (open === void 0) break;
|
|
321
|
-
await open.ended;
|
|
322
|
-
}
|
|
323
|
-
let end = () => {};
|
|
324
|
-
const ended = new Promise((settle) => {
|
|
325
|
-
end = settle;
|
|
326
|
-
});
|
|
327
|
-
openBuilds.set(environment.name, {
|
|
328
|
-
environment,
|
|
329
|
-
ended,
|
|
330
|
-
end
|
|
331
|
-
});
|
|
332
|
-
return openBuilds.size > 1;
|
|
311
|
+
return builds.open(environmentOf(context));
|
|
333
312
|
}
|
|
334
313
|
/** Ends this hook's environment build; whether none is left open. Only
|
|
335
314
|
* the build that opened an entry ends it. */
|
|
336
315
|
function closeEnvironmentBuild(context) {
|
|
337
316
|
if (!tracksEnvironments) return true;
|
|
338
|
-
|
|
339
|
-
const open = openBuilds.get(environment.name);
|
|
340
|
-
if (open === void 0 || open.environment !== environment) return false;
|
|
341
|
-
openBuilds.delete(environment.name);
|
|
342
|
-
open.end();
|
|
343
|
-
return openBuilds.size === 0;
|
|
317
|
+
return builds.end(environmentOf(context));
|
|
344
318
|
}
|
|
345
319
|
async function joinPipeline() {
|
|
346
320
|
await pipelineStarted;
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EACV,UAAU,EAQV,WAAW,EACZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAEV,UAAU,EACX,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAIV,eAAe,EAChB,MAA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,CAAC,GAAG,EAAE,MAAM,KAAK,IACmB,GAC9C,IAAI,CAKN;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACxB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASzD;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,MAAM,GAAG,IAAI,CAGf;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,GAAG,EAAE;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,CACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,KACjB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9C;wEACoE;IACpE,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACA,MAAM,GAAG,IAAI,CAgBf;AAwSD,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C,qBAAqB,GAAG,SAAS,CA8tBlC,CAAC"}
|
package/dist/esbuild.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-B-uObifz.cjs");
|
|
6
6
|
//#region src/esbuild.ts
|
|
7
7
|
const animusEsbuild = (0, require("unplugin").createEsbuildPlugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/esbuild.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-B-uObifz.cjs");
|
|
6
6
|
//#region src/index.ts
|
|
7
7
|
const animusUnplugin = (0, require("unplugin").createUnplugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/index.mjs
CHANGED
package/dist/rollup.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-B-uObifz.cjs");
|
|
6
6
|
//#region src/rollup.ts
|
|
7
7
|
const animusRollup = (0, require("unplugin").createRollupPlugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/rollup.mjs
CHANGED
package/dist/rspack.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-B-uObifz.cjs");
|
|
6
6
|
//#region src/rspack.ts
|
|
7
7
|
const animusRspack = (0, require("unplugin").createRspackPlugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/rspack.mjs
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-B-uObifz.cjs");
|
|
6
6
|
//#region src/webpack.ts
|
|
7
7
|
const animusWebpack = (0, require("unplugin").createWebpackPlugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/unplugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "Animus transform host for non-plugin bundlers — unplugin-based rollup/esbuild/rspack/webpack entry points over the one extraction session",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animus",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"compile": "tsc --noEmit"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@animus-ui/extract": "0.1.
|
|
60
|
+
"@animus-ui/extract": "0.1.27",
|
|
61
61
|
"unplugin": "^3.3.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|