chore: remove examples/externalPlugins.js and pluginLoader.ts, update imports to .js
Deleted `examples/externalPlugins.js` and `pluginLoader.ts` as they are no longer used. Updated all `.ts` imports to `.js` across the codebase. Added `MemberOf` to `VerbType` and filtered disabled augmentations in `executeAugmentationPipeline`. Updated documentation to reflect new augmentation registration process. Removed deprecated `allowImportingTsExtensions` from `tsconfig.json`.
This commit is contained in:
parent
7d2b695ea0
commit
203b669203
22 changed files with 1063 additions and 541 deletions
81
examples/webpack.config.js
Normal file
81
examples/webpack.config.js
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/**
|
||||
* Example webpack configuration for using the Brainy augmentation registry
|
||||
*
|
||||
* This example shows how to configure webpack to automatically discover and register
|
||||
* augmentations at build time.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const { createAugmentationRegistryPlugin } = require('../dist/index.js');
|
||||
|
||||
module.exports = {
|
||||
// Entry point for the application
|
||||
entry: './src/index.js',
|
||||
|
||||
// Output configuration
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: 'bundle.js',
|
||||
},
|
||||
|
||||
// Module rules for processing different file types
|
||||
module: {
|
||||
rules: [
|
||||
// Process JavaScript files with babel
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Process TypeScript files
|
||||
{
|
||||
test: /\.ts$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'ts-loader'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// Resolve file extensions
|
||||
resolve: {
|
||||
extensions: ['.js', '.ts']
|
||||
},
|
||||
|
||||
// Plugins
|
||||
plugins: [
|
||||
// Augmentation Registry Plugin
|
||||
// This plugin will automatically discover and register augmentations
|
||||
// from files that match the specified pattern
|
||||
createAugmentationRegistryPlugin({
|
||||
// Pattern to match files containing augmentations
|
||||
// This will match any file ending with 'augmentation.js' or 'augmentation.ts'
|
||||
pattern: /augmentation\.(js|ts)$/,
|
||||
|
||||
// Options for the loader
|
||||
options: {
|
||||
// Automatically initialize augmentations after loading
|
||||
autoInitialize: true,
|
||||
|
||||
// Log debug information during loading
|
||||
debug: true
|
||||
}
|
||||
})
|
||||
],
|
||||
|
||||
// Development server configuration
|
||||
devServer: {
|
||||
static: {
|
||||
directory: path.join(__dirname, 'public'),
|
||||
},
|
||||
compress: true,
|
||||
port: 9000,
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue