GithubHelp home page GithubHelp logo

estruyf / vscode-typescript-exportallmodules Goto Github PK

View Code? Open in Web Editor NEW
37.0 2.0 10.0 7.59 MB

VSCode extension which generates an `index.ts`barrel file with all the module exports from the current directory

Home Page: https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-typescript-exportallmodules

License: MIT License

TypeScript 100.00%
typescript folder-listener

vscode-typescript-exportallmodules's Introduction

TypeScript Barrel Generator

Visual Studio Marketplace Number of installs Ratings Buy me a coffee

❓ Why

Working with TypeScript? Want to make your TypeScript imports cleaner? Use this extension to easily export all modules to a barrel index.ts file.

Info: A "barrel" is a way to rollup exports from several modules into a single convenient module. The barrel itself is a module file that re-exports selected exports of other modules.

Example:

// folder/index.ts
export * from './foo';
export * from './bar';

✨ Functionalities

The extension allows you to manually or automatically export the modules to a barrel file. For the automatic way, you first have to create a listener for the folder for which you want to create the automated export.

In both the manual and automatic way, an index.ts file will be created with a reference to all the folder/files in the current directory.

Info: If there are folders/files you want to get excluded from the export, you can do this by right-clicking on the folder/file and clicking on the TypeScript: Exclude folder/file from export.

Create from the current file directory

By using the Barrel Generator: Export all modules from the current file directory command, you can create a barrel file from the current file path its directory.

Info: If you want, you can add your own keybinding to this command to make it easier to trigger.

Manual creation

Manual module export

Module creation by listener

Export listener

Info: When a folder listener is added, it will be visible in the TypeScript - Export Listeners view. By clicking on the folder names, you will automatically open the index.ts file.

Removing a listener

Folder listeners can be removed by right-clicking on the folder name in the TypeScript - Export View.

Remove a folder listener

Excluding folder(s)/file(s)

If there are specific folders or files you want to exclude from your module, you can do this by right-clicking on the file, and click on the TypeScript: Exclude folder/file from export menu action.

Excluding folder

Excluding file

Include previously excluded folder(s)/file(s)

When you already excluded a folder or file, and want to include these again into your module export, you can do this from the TypeScript - Export View. Under the Excluded folders & files section, right-click on the folder or file to include and click Include to export.

Include to export

⚙️ Configuration / Settings

The extension makes use of the following settings:

Setting Description Type Default
exportall.config.namedExports Specifies if you want to use named exports in the barrel file. boolean false
exportall.config.includeFoldersToExport Specifies if folder (which contain a index.ts file) will also be included in the module export. boolean true
exportall.config.exclude Specify which files you want to exclude the index.ts file. Works on the whole filename or part of the filename. string[] ['.test.', '.spec.']
exportall.config.folderListener Specify the relative paths for the folder listeners. This will make it possible to automatically generate the module export once a file gets added/updated/removed within the specified folder.

To listen to sub-folders, you can include the directory wildcard ** to the path.
string[] []
exportall.config.relExclusion Specify the relative folder/file paths to exclude from the export. string[] []
exportall.config.semis Specify if you want to enable/disable the usage of semis in the barrel file. boolean true
exportall.config.quote Specify the character that you want to use as the quoting character; typically ' or ". string '
exportall.config.message Specify the message that you want to use in the generated barrel file. The message will be added at the top. string

Config settings example

💪 Contribute

Experiencing any issues, or got feedback to share? Feel free to raise this in the issue list of the repo: issues.

TypeScript Barrel Generator

🔑 License

MIT



vscode-typescript-exportallmodules's People

Contributors

dependabot[bot] avatar estruyf avatar mrheault avatar robinblomberg avatar rveldpaus avatar yarnaimo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vscode-typescript-exportallmodules's Issues

Don't write to file if contents would be the same

It seems the index files are touched each time a change is made in the watched subdirectories, even if the contents are the same. This causes file watchers to trigger and restart/hot-reload the process. I've got a temporary workaround by having it ignore all index.ts files, which works, but now I need to restart my process every time I add, move or rename a file.

Would it be possible to not write to the index.ts file if its contents are unchanged?

Request: Ability to exclude directory but include all subdirectories

I need to be able to automatically generate indexes for every subfolder in a directory, but not generate an index for that directory itself. The pattern I am trying to create is the ability to import from @/directory/subdirectory, rather than just '@/directory'.

The folder structure I am using is something like this:

[src]
	[features]
		[feature-1]
			file1.tsx
			file2.tsx
			index.ts <-AUTO GENERATED
		[/feature-1]
		[feature-2]
			file1.tsx
			file2.tsx
			index.ts <-AUTO GENERATED
		[/feature-2]
		index.ts <-CURRENTLY AUTO GENERATED, NOT WANTED
	[/features]
[/src]

Is there some way of handling this that I am missing? Right now, I am trying to listen to ["/src/features/**"] and use relExclusion on ["/src/features"], but that doesn't work.

Add handling of default exports

It would be nice if files with /^export default/ exported that member as export { default as ${fileWithoutExtension} } from './${fileWithoutExtension}'.

Customize the export method of specific files

For example, for .vue files, we allow exporting in this way export { default as Component } from 'Component.vue', it may look like this in the configuration

{
  '*.vue': {
    all: true,
    default: 'filename' // 'filename' | 'camel-filename' | 'capitalize-filename'
  }
}

it will get an export result like

export * from 'Component.vue'
export { default as Component } from 'Component.vue'

Please document Include and tsconfig.json details

There's no problem generating /src/Components/index.ts for any /src/Components/x.tsx.

I can't figure out the proper import statements in /src/App.tsx.
Should we use import * (no-no per other tickets here) ?
Should we `import MyComponent from "./Components" ?

And we need to understand how this relates to tsconfig.json:

"compilerOptions": {
  "baseUrl": "src",
  "target": "ES2020" /** any min/max target? **/,
  "paths": {
      "*": [ /** anything here? (path deprecated?) **/ ]
  ...
 }, 
"include": ["src" /** anything else here? **/ ]

Is there anything else in tsconfig.json that is relevant?

Thanks!

Not working anymore : Cannot find module 'date-fns'

Hello,

The extension stopped to work recently. Menu entries are presents in the explorer view, but nothing happens when clicking on it.

Current installed version is 2.6.0.

Switching back to 2.5.0 restores the behavior.

In the VS code extension host logs I can see:

... other extension stuff ...

2023-08-31 11:38:15.320 [info] ExtensionService#_doActivateExtension eliostruyf.vscode-typescript-exportallmodules, startup: false, activationEvent: 'onStartupFinished'
2023-08-31 11:38:15.363 [error] Activating extension eliostruyf.vscode-typescript-exportallmodules failed due to an error:
2023-08-31 11:38:15.363 [error] Error: Cannot find module 'date-fns'
Require stack:
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\helpers\logger.js
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\commands\ExportAll.js
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\extension.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
- 
	at Module._resolveFilename (node:internal/modules/cjs/loader:1010:15)
	at s._resolveFilename (node:electron/js2c/utility_init:2:2740)
	at Module._load (node:internal/modules/cjs/loader:858:27)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\helpers\logger.js:5:20)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\commands\ExportAll.js:18:18)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\extension.js:14:21)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at require (node:internal/modules/cjs/helpers:102:18)
	at Function.i [as __$__nodeRequire] (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:5:98)
	at r.rb (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:26597)
	at async Promise.all (index 0)
    
... other extension stuff ...


2023-08-31 11:40:21.517 [info] ExtensionService#_doActivateExtension eliostruyf.vscode-typescript-exportallmodules, startup: false, activationEvent: 'onStartupFinished'
2023-08-31 11:40:21.556 [error] Activating extension eliostruyf.vscode-typescript-exportallmodules failed due to an error:
2023-08-31 11:40:21.556 [error] Error: Cannot find module 'date-fns'
Require stack:
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\helpers\logger.js
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\commands\ExportAll.js
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\extension.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
- 
	at Module._resolveFilename (node:internal/modules/cjs/loader:1010:15)
	at s._resolveFilename (node:electron/js2c/utility_init:2:2740)
	at Module._load (node:internal/modules/cjs/loader:858:27)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\helpers\logger.js:5:20)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\commands\ExportAll.js:18:18)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\extension.js:14:21)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at require (node:internal/modules/cjs/helpers:102:18)
	at Function.i [as __$__nodeRequire] (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:5:98)
	at r.rb (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:26597)
	at async Promise.all (index 0)
	
... other extension stuff ...

2023-08-31 11:46:00.155 [info] ExtensionService#_doActivateExtension eliostruyf.vscode-typescript-exportallmodules, startup: false, activationEvent: 'onStartupFinished'
2023-08-31 11:46:00.181 [error] Activating extension eliostruyf.vscode-typescript-exportallmodules failed due to an error:
2023-08-31 11:46:00.181 [error] Error: Cannot find module 'date-fns'
Require stack:
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\helpers\logger.js
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\commands\ExportAll.js
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\extension.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
- 
	at Module._resolveFilename (node:internal/modules/cjs/loader:1010:15)
	at s._resolveFilename (node:electron/js2c/utility_init:2:2740)
	at Module._load (node:internal/modules/cjs/loader:858:27)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\helpers\logger.js:5:20)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\commands\ExportAll.js:18:18)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\extension.js:14:21)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at require (node:internal/modules/cjs/helpers:102:18)
	at Function.i [as __$__nodeRequire] (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:5:98)
	at r.rb (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:26597)
	at async Promise.all (index 0)

... other extension stuff ...	

2023-08-31 11:50:33.218 [info] ExtensionService#_doActivateExtension eliostruyf.vscode-typescript-exportallmodules, startup: false, activationEvent: 'onStartupFinished'

... other extension stuff ...

2023-08-31 11:51:52.338 [info] ExtensionService#_doActivateExtension eliostruyf.vscode-typescript-exportallmodules, startup: false, activationEvent: 'onStartupFinished'
2023-08-31 11:51:52.371 [error] Activating extension eliostruyf.vscode-typescript-exportallmodules failed due to an error:
2023-08-31 11:51:52.371 [error] Error: Cannot find module 'date-fns'
Require stack:
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\helpers\logger.js
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\commands\ExportAll.js
- c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\extension.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
- 
	at Module._resolveFilename (node:internal/modules/cjs/loader:1010:15)
	at s._resolveFilename (node:electron/js2c/utility_init:2:2740)
	at Module._load (node:internal/modules/cjs/loader:858:27)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\helpers\logger.js:5:20)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\commands\ExportAll.js:18:18)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at g (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:647)
	at Object.<anonymous> (c:\Users\steve\.vscode\extensions\eliostruyf.vscode-typescript-exportallmodules-2.6.0\out\extension.js:14:21)
	at u._compile (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1271)
	at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
	at Module.load (node:internal/modules/cjs/loader:1058:32)
	at Module._load (node:internal/modules/cjs/loader:893:12)
	at f._load (node:electron/js2c/asar_bundle:2:13330)
	at o._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
	at f._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
	at C._load (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
	at Module.require (node:internal/modules/cjs/loader:1082:19)
	at require (node:internal/modules/cjs/helpers:102:18)
	at Function.i [as __$__nodeRequire] (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:5:98)
	at r.rb (c:\Users\steve\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:26597)
	at async Promise.all (index 0)

Shortcut Key Command to Generate for Current Selection

Would be great to support a shortcut key which generates a barrel for the currently selected file / folder in explorer view.

Might be able to help contribute something if you can give a tip on where I may need to start for something like this.

Appreciate the plugin!

Unable to resolve filesystem provider with relative file path 'c/... on "Export all modules"

After update from 2.7.0 to 2.9.0 "Export all modules" command from VSCode file explorer is not working anymore. In output it sends message error : "Unable to resolve filesystem provider with relative file path 'c/...' ". If I change extension version back to 2.7.0 it solves problem. Tested it on Windows 10 and 11 and tried to downgrade VSCode but only extension downgrade solved issue.

about wildcards

Hi bro, just wanna ask if the folderListener support path wildcards?
Looks like it's not supoort "src/**/" if I want to watch directories nested to all levels under src/

dont use star exports

Coming from a python background, star exports are a no no...

it's fine for small projects,

but for massive monorepos, this starts to chew into the editors discovery time...

🛑 bad

export * from './lol/sucks/to/be/you/this/is/my/entire/app';
✅ good
export { 
 All,
 The,
 Things,
 In,
 My,
 App,
 Are,
 Listed,
 Here,
 As,
 These,
 Exports
} from './lol/sucks/to/be/you/this/is/my/entire/app';

Remove additional newline at end of generated index

Currently (v2.7.0), when an index generates, it contains a second new-line at the end of the file:

export * from './a';
export * from './b';

This drives my eslint bananas, but because the plugin is generating it automatically, I can't delete the extra line in the VSCode; I have to either delete it in another editor or remove it with eslint --fix.

I have observed this behavior when a folder has an listener and and one or more excluded files.

It does not export enum

Hi, just found this extension which seems really helpful, just noticed it does not export enums, so just want to report it :)
Thanks :)
image

feat: Add setting for adding banner to generated barrels

This setting should allow the generated barrel file to have a nice banner.
For example index.ts

// THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)

export * from './application.entity';
export * from './banks.entity';

Add an option to add a ".js" suffix to exports

Hi,

When targeting native ES6 modules, a TS import from a file needs to end with ".js", even if the file does not exists yet.
VS Code seems to be aware of this and can automatically use this pattern when suggesting imports.

For example, this tool tries to solve the issue: https://github.com/Zoltu/typescript-transformer-append-js-extension
TypeScript issue: microsoft/TypeScript#16577

It would be nice to have an option to append the ".js" in the generated index.ts files.

Thanks for your work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.