powerlines 0.7.0 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerlines",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "description": "The \"any framework\" framework that simplifies modern dev tool usage, generates virtual (or actual) code modules, and improves DX across the board.",
6
6
  "repository": {
@@ -70,18 +70,18 @@
70
70
  "default": "./dist/define-config.js"
71
71
  }
72
72
  },
73
- "./create-plugin": {
73
+ "./extend-plugin": {
74
74
  "import": {
75
- "types": "./dist/create-plugin.d.ts",
76
- "default": "./dist/create-plugin.js"
75
+ "types": "./dist/extend-plugin.d.ts",
76
+ "default": "./dist/extend-plugin.js"
77
77
  },
78
78
  "require": {
79
- "types": "./dist/create-plugin.d.cts",
80
- "default": "./dist/create-plugin.cjs"
79
+ "types": "./dist/extend-plugin.d.cts",
80
+ "default": "./dist/extend-plugin.cjs"
81
81
  },
82
82
  "default": {
83
- "types": "./dist/create-plugin.d.ts",
84
- "default": "./dist/create-plugin.js"
83
+ "types": "./dist/extend-plugin.d.ts",
84
+ "default": "./dist/extend-plugin.js"
85
85
  }
86
86
  },
87
87
  "./types": {
@@ -489,7 +489,6 @@
489
489
  "@farmfe/core": "^1.7.11",
490
490
  "@nuxt/kit": "^4.1.1",
491
491
  "@nuxt/schema": "^4.1.1",
492
- "@powerlines/tsdoc": "*",
493
492
  "@rspack/cli": "^1.5.0",
494
493
  "@rspack/core": "^1.5.0",
495
494
  "astro": "^5.13.5",
@@ -511,7 +510,6 @@
511
510
  "@nuxt/schema": { "optional": true },
512
511
  "@rspack/cli": { "optional": true },
513
512
  "@rspack/core": { "optional": true },
514
- "@powerlines/tsdoc": { "optional": false },
515
513
  "astro": { "optional": true },
516
514
  "esbuild": { "optional": true },
517
515
  "next": { "optional": true },
@@ -614,5 +612,5 @@
614
612
  "typescript": "^5.9.3"
615
613
  },
616
614
  "publishConfig": { "access": "public" },
617
- "gitHead": "39b3b5a165f9c443558bcd792a4dc1ca456f94f2"
615
+ "gitHead": "0e181730de1a48ab982b8eb133b36fc5c8be40be"
618
616
  }
@@ -1,105 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- var apiExtractor = require('@microsoft/api-extractor');
5
- var logger = require('@storm-software/config-tools/logger');
6
- var exists = require('@stryke/fs/exists');
7
- var readFile = require('@stryke/fs/read-file');
8
- var writeFile = require('@stryke/fs/write-file');
9
- var joinPaths = require('@stryke/path/join-paths');
10
-
11
- var __defProp = Object.defineProperty;
12
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
13
- var currentWorkingDir = process.argv[2] || process.cwd();
14
- async function extractRuntimeDts(runtime) {
15
- const runtimeTypesFilePath = joinPaths.joinPaths(currentWorkingDir, "dist", "runtime-types", "esm");
16
- logger.writeInfo(`powerlines@build-runtime-types: Running API Extractor for ${runtime} runtime at ${runtimeTypesFilePath}`, {
17
- logLevel: "all"
18
- });
19
- const mainEntryPointFilePath = joinPaths.joinPaths(runtimeTypesFilePath, runtime === "shared" ? "index.d.ts" : joinPaths.joinPaths(runtime, "index.d.ts"));
20
- if (!exists.existsSync(mainEntryPointFilePath)) {
21
- throw new Error(`Could not resolve powerlines/runtime-types package location: ${mainEntryPointFilePath} does not exist.`);
22
- }
23
- const untrimmedFilePath = joinPaths.joinPaths(runtimeTypesFilePath, "..", `${runtime}.d.ts`);
24
- const extractorResult = apiExtractor.Extractor.invoke(apiExtractor.ExtractorConfig.prepare({
25
- configObject: {
26
- mainEntryPointFilePath,
27
- apiReport: {
28
- enabled: false,
29
- // `reportFileName` is not been used. It's just to fit the requirement of API Extractor.
30
- reportFileName: "report.api.md"
31
- },
32
- docModel: {
33
- enabled: false
34
- },
35
- dtsRollup: {
36
- enabled: true,
37
- untrimmedFilePath
38
- },
39
- tsdocMetadata: {
40
- enabled: false
41
- },
42
- compiler: {
43
- tsconfigFilePath: joinPaths.joinPaths(currentWorkingDir, "tsconfig.json")
44
- },
45
- projectFolder: currentWorkingDir,
46
- newlineKind: "lf"
47
- },
48
- configObjectFullPath: void 0,
49
- packageJsonFullPath: joinPaths.joinPaths(currentWorkingDir, "package.json")
50
- }), {
51
- localBuild: true,
52
- showVerboseMessages: true
53
- });
54
- if (!extractorResult.succeeded) {
55
- throw new Error(`API Extractor completed with ${extractorResult.errorCount} errors and ${extractorResult.warningCount} warnings when processing powerlines/runtime-types package.`);
56
- }
57
- const dtsFileContent = await readFile.readFile(untrimmedFilePath);
58
- await writeFile.writeFile(untrimmedFilePath, dtsFileContent.replace(/\s*export.*__Ω.*;/g, "").replace(/^export\s*\{\s*\}\s*$/gm, "").replace(/^export\s*(?:declare\s*)?interface\s*/gm, "interface ").replace(/^export\s*(?:declare\s*)?type\s*/gm, "type ").replace(/^export\s*(?:declare\s*)?const\s*/gm, "declare const ").replace(/: Storage(?:_\d+)?;$/gm, ': import("unstorage").Storage<import("unstorage").StorageValue>;'));
59
- logger.writeSuccess(`powerlines@build-runtime-types: Generated TypeScript declaration file for ${runtime} runtime.`, {
60
- logLevel: "all"
61
- });
62
- }
63
- __name(extractRuntimeDts, "extractRuntimeDts");
64
- var postinstallTimeout = setTimeout(() => {
65
- logger.writeError("powerlines@build-runtime-types: Timeout reached.", {
66
- logLevel: "all"
67
- });
68
- process.exit(0);
69
- }, 3e4);
70
- (async () => {
71
- const start = /* @__PURE__ */ new Date();
72
- try {
73
- await Promise.all([
74
- extractRuntimeDts("shared"),
75
- extractRuntimeDts("node"),
76
- extractRuntimeDts("browser")
77
- ]);
78
- logger.writeSuccess("powerlines@build-runtime-types: All runtime type declarations extracted successfully.", {
79
- logLevel: "all"
80
- });
81
- } catch (e) {
82
- logger.writeError(`powerlines@build-runtime-types: Exception occurred - ${e?.message}`, {
83
- logLevel: "all"
84
- });
85
- } finally {
86
- const end = /* @__PURE__ */ new Date();
87
- logger.writeDebug(`powerlines@build-runtime-types: Process took ${end.getTime() - start.getTime()}ms`, {
88
- logLevel: "all"
89
- });
90
- clearTimeout(postinstallTimeout);
91
- process.exit(0);
92
- }
93
- })();
94
- process.on("uncaughtException", (e) => {
95
- logger.writeFatal(`powerlines@build-runtime-types: Uncaught Exception occurred - ${e.message}`, {
96
- logLevel: "all"
97
- });
98
- process.exit(0);
99
- });
100
- process.on("unhandledRejection", (e) => {
101
- logger.writeFatal(`powerlines@build-runtime-types: Unhandled Rejection occurred - ${e?.message}`, {
102
- logLevel: "all"
103
- });
104
- process.exit(0);
105
- });