@powerlines/plugin-unimport 0.1.36 → 0.1.38

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.js CHANGED
@@ -1,7 +1,7 @@
1
- import {LogLevelLabel}from'@storm-software/config-tools/types';import {throttle}from'@stryke/helpers/throttle';import {StormJSON}from'@stryke/json/storm-json';import {joinPaths}from'@stryke/path/join';import f from'defu';import {createUnimport}from'unimport';export*from'./types';/*****************************************
1
+ import {LogLevelLabel}from'@storm-software/config-tools/types';import {throttle}from'@stryke/helpers/throttle';import {StormJSON}from'@stryke/json/storm-json';import {joinPaths}from'@stryke/path/join';import h from'defu';import {createUnimport}from'unimport';export*from'./types';/*****************************************
2
2
  *
3
3
  * ⚡ Built by Storm Software
4
4
  *
5
5
  *****************************************/
6
6
 
7
- var g=Object.defineProperty;var e=(r,t)=>g(r,"name",{value:t,configurable:true});const d=e(r=>({name:"unimport",config(){return {unimport:f(r,{commentsDisable:["@unimport-disable","@unimport-ignore","@imports-disable","@imports-ignore","@powerlines-disable","@powerlines-ignore"],commentsDebug:["@unimport-debug","@imports-debug","@powerlines-debug"],injectAtEnd:true})}},async configResolved(){const{injectImports:t,init:i,...o}=createUnimport(this.config.unimport);this.unimport={...o},this.unimport.dumpImports=throttle(async()=>{this.log(LogLevelLabel.TRACE,"Dumping import file...");const s=await this.unimport.getImports();this.log(LogLevelLabel.TRACE,`Writing imports-dump JSON file: ${joinPaths(this.dataPath,"imports-dump.json")}`);const n=StormJSON.stringify(s);n.trim()!==this.unimport.lastImportsDump?.trim()&&(this.unimport.lastImportsDump=n,await this.fs.writeFile(joinPaths(this.dataPath,"imports-dump.json"),n,{mode:"fs"}));},1e3),this.unimport.injectImports=async(s,n,a)=>{const m=await t(s,n,a);return m.s.hasChanged()&&await this.unimport.dumpImports(),m},this.unimport.init=async()=>{await i(),await this.unimport.dumpImports();},await this.unimport.init();},async transform(t,i){const o=await this.unimport.injectImports(t,i);return o.s.hasChanged()?{id:i,code:o.s.toString(),map:o.s.generateMap({source:i,includeContent:true,hires:true})}:null}}),"plugin");var N=d;export{N as default,d as plugin};
7
+ var g=Object.defineProperty;var e=(r,t)=>g(r,"name",{value:t,configurable:true});const d=e(r=>({name:"unimport",config(){return {unimport:h(r,{commentsDisable:["@unimport-disable","@unimport-ignore","@imports-disable","@imports-ignore","@powerlines-disable","@powerlines-ignore"],commentsDebug:["@unimport-debug","@imports-debug","@powerlines-debug"],injectAtEnd:true})}},async configResolved(){const{injectImports:t,init:i,...o}=createUnimport(this.config.unimport);this.unimport={...o},this.unimport.dumpImports=throttle(async()=>{this.log(LogLevelLabel.TRACE,"Dumping import file...");const s=await this.unimport.getImports();this.log(LogLevelLabel.TRACE,`Writing imports-dump JSON file: ${joinPaths(this.dataPath,"imports-dump.json")}`);const n=StormJSON.stringify(s);n.trim()!==this.unimport.lastImportsDump?.trim()&&(this.unimport.lastImportsDump=n,await this.fs.write(joinPaths(this.dataPath,"imports-dump.json"),n));},1e3),this.unimport.injectImports=async(s,n,a)=>{const m=await t(s,n,a);return m.s.hasChanged()&&await this.unimport.dumpImports(),m},this.unimport.init=async()=>{await i(),await this.unimport.dumpImports();},await this.unimport.init();},async transform(t,i){const o=await this.unimport.injectImports(t,i);return o.s.hasChanged()?{id:i,code:o.s.toString(),map:o.s.generateMap({source:i,includeContent:true,hires:true})}:null}}),"plugin");var N=d;export{N as default,d as plugin};
@@ -1,4 +1,4 @@
1
- export { b as UnimportContext, U as UnimportPluginContext, a as UnimportPluginOptions, d as UnimportPluginResolvedConfig, c as UnimportPluginUserConfig, _ as __ΩUnimportContext, h as __ΩUnimportPluginContext, e as __ΩUnimportPluginOptions, g as __ΩUnimportPluginResolvedConfig, f as __ΩUnimportPluginUserConfig } from '../index-CjTCgphq.cjs';
1
+ export { b as UnimportContext, U as UnimportPluginContext, a as UnimportPluginOptions, d as UnimportPluginResolvedConfig, c as UnimportPluginUserConfig, _ as __ΩUnimportContext, h as __ΩUnimportPluginContext, e as __ΩUnimportPluginOptions, g as __ΩUnimportPluginResolvedConfig, f as __ΩUnimportPluginUserConfig } from '../index-BjBLRAJg.cjs';
2
2
  import '@storm-software/build-tools/types';
3
3
  import '@storm-software/config-tools/types';
4
4
  import '@storm-software/config/types';
@@ -14,7 +14,6 @@ import 'semver';
14
14
  import 'ts-morph';
15
15
  import 'unplugin';
16
16
  import '@stryke/fs/resolve';
17
- import 'node:fs';
18
17
  import '@stryke/types/tsconfig';
19
18
  import 'typescript';
20
19
  import '@stryke/types/array';
@@ -1,4 +1,4 @@
1
- export { b as UnimportContext, U as UnimportPluginContext, a as UnimportPluginOptions, d as UnimportPluginResolvedConfig, c as UnimportPluginUserConfig, _ as __ΩUnimportContext, h as __ΩUnimportPluginContext, e as __ΩUnimportPluginOptions, g as __ΩUnimportPluginResolvedConfig, f as __ΩUnimportPluginUserConfig } from '../index-CjTCgphq.js';
1
+ export { b as UnimportContext, U as UnimportPluginContext, a as UnimportPluginOptions, d as UnimportPluginResolvedConfig, c as UnimportPluginUserConfig, _ as __ΩUnimportContext, h as __ΩUnimportPluginContext, e as __ΩUnimportPluginOptions, g as __ΩUnimportPluginResolvedConfig, f as __ΩUnimportPluginUserConfig } from '../index-BjBLRAJg.js';
2
2
  import '@storm-software/build-tools/types';
3
3
  import '@storm-software/config-tools/types';
4
4
  import '@storm-software/config/types';
@@ -14,7 +14,6 @@ import 'semver';
14
14
  import 'ts-morph';
15
15
  import 'unplugin';
16
16
  import '@stryke/fs/resolve';
17
- import 'node:fs';
18
17
  import '@stryke/types/tsconfig';
19
18
  import 'typescript';
20
19
  import '@stryke/types/array';
@@ -1,4 +1,4 @@
1
- export { b as UnimportContext, U as UnimportPluginContext, a as UnimportPluginOptions, d as UnimportPluginResolvedConfig, c as UnimportPluginUserConfig, _ as __ΩUnimportContext, h as __ΩUnimportPluginContext, e as __ΩUnimportPluginOptions, g as __ΩUnimportPluginResolvedConfig, f as __ΩUnimportPluginUserConfig } from '../index-CjTCgphq.cjs';
1
+ export { b as UnimportContext, U as UnimportPluginContext, a as UnimportPluginOptions, d as UnimportPluginResolvedConfig, c as UnimportPluginUserConfig, _ as __ΩUnimportContext, h as __ΩUnimportPluginContext, e as __ΩUnimportPluginOptions, g as __ΩUnimportPluginResolvedConfig, f as __ΩUnimportPluginUserConfig } from '../index-BjBLRAJg.cjs';
2
2
  import 'unimport';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
@@ -15,7 +15,6 @@ import 'semver';
15
15
  import 'ts-morph';
16
16
  import 'unplugin';
17
17
  import '@stryke/fs/resolve';
18
- import 'node:fs';
19
18
  import '@stryke/types/tsconfig';
20
19
  import 'typescript';
21
20
  import '@stryke/types/array';
@@ -1,4 +1,4 @@
1
- export { b as UnimportContext, U as UnimportPluginContext, a as UnimportPluginOptions, d as UnimportPluginResolvedConfig, c as UnimportPluginUserConfig, _ as __ΩUnimportContext, h as __ΩUnimportPluginContext, e as __ΩUnimportPluginOptions, g as __ΩUnimportPluginResolvedConfig, f as __ΩUnimportPluginUserConfig } from '../index-CjTCgphq.js';
1
+ export { b as UnimportContext, U as UnimportPluginContext, a as UnimportPluginOptions, d as UnimportPluginResolvedConfig, c as UnimportPluginUserConfig, _ as __ΩUnimportContext, h as __ΩUnimportPluginContext, e as __ΩUnimportPluginOptions, g as __ΩUnimportPluginResolvedConfig, f as __ΩUnimportPluginUserConfig } from '../index-BjBLRAJg.js';
2
2
  import 'unimport';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
@@ -15,7 +15,6 @@ import 'semver';
15
15
  import 'ts-morph';
16
16
  import 'unplugin';
17
17
  import '@stryke/fs/resolve';
18
- import 'node:fs';
19
18
  import '@stryke/types/tsconfig';
20
19
  import 'typescript';
21
20
  import '@stryke/types/array';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-unimport",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to add imports to source code automatically via unimport.",
6
6
  "repository": {
@@ -99,23 +99,23 @@
99
99
  "files": ["dist/**/*"],
100
100
  "keywords": ["unimport", "powerlines", "storm-software", "powerlines-plugin"],
101
101
  "dependencies": {
102
- "@stryke/path": "^0.21.1",
103
- "@stryke/helpers": "^0.9.9",
104
- "@stryke/fs": "^0.33.3",
105
- "@stryke/json": "^0.9.10",
106
- "@stryke/type-checks": "^0.3.17",
107
- "@stryke/types": "^0.10.7",
102
+ "@stryke/path": "^0.21.2",
103
+ "@stryke/helpers": "^0.9.10",
104
+ "@stryke/fs": "^0.33.4",
105
+ "@stryke/json": "^0.9.11",
106
+ "@stryke/type-checks": "^0.3.18",
107
+ "@stryke/types": "^0.10.8",
108
108
  "defu": "^6.1.4",
109
109
  "jiti": "^2.6.1",
110
110
  "unimport": "^5.5.0",
111
- "powerlines": "^0.24.8",
111
+ "powerlines": "^0.25.0",
112
112
  "magic-string": "^0.30.21"
113
113
  },
114
114
  "devDependencies": {
115
- "@powerlines/nx": "^0.10.36",
116
- "@powerlines/plugin-plugin": "^0.11.44",
115
+ "@powerlines/nx": "^0.10.38",
116
+ "@powerlines/plugin-plugin": "^0.11.46",
117
117
  "@types/node": "^24.10.1"
118
118
  },
119
119
  "publishConfig": { "access": "public" },
120
- "gitHead": "235b04eef51bd5f6833c21dd5a04434127cdea34"
120
+ "gitHead": "acb1d0727c31f10519b7a59d73d245e6949414d3"
121
121
  }