@visulima/packem 1.18.2 → 1.18.4
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/CHANGELOG.md +17 -0
- package/README.md +39 -0
- package/dist/cli/index.mjs +187 -0
- package/dist/config/index.cjs +1 -1
- package/dist/config/index.d.cts +2 -13
- package/dist/config/index.d.mts +2 -13
- package/dist/config/index.d.ts +2 -13
- package/dist/config/index.mjs +1 -1
- package/dist/config/utils/load-package-json.d.cts +8 -0
- package/dist/{utils → config/utils}/load-package-json.d.mts +2 -2
- package/dist/config/utils/load-package-json.d.ts +8 -0
- package/dist/config/utils/load-packem-config.d.mts +7 -0
- package/dist/config/utils/load-preset.d.mts +4 -0
- package/dist/config/utils/load-tsconfig.d.cts +7 -0
- package/dist/config/utils/load-tsconfig.d.mts +5 -0
- package/dist/config/utils/load-tsconfig.d.ts +7 -0
- package/dist/index.cjs +125 -0
- package/dist/index.d.cts +53 -0
- package/dist/index.d.mts +53 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.mjs +131 -0
- package/dist/packem/index.d.cts +1 -6
- package/dist/packem/index.d.mts +1 -6
- package/dist/packem/index.d.ts +1 -6
- package/dist/packem_shared/constants-CR0qfKZx.cjs +1 -0
- package/dist/packem_shared/{constants-DSQIKVQe.mjs → constants-CwJdgxph.mjs} +1 -1
- package/dist/rollup/plugins/esbuild/index.cjs +1 -1
- package/dist/rollup/plugins/esbuild/index.mjs +1 -1
- package/dist/rollup/plugins/oxc/oxc-transformer.cjs +1 -1
- package/dist/rollup/plugins/oxc/oxc-transformer.mjs +2 -2
- package/dist/rollup/plugins/sucrase/index.cjs +1 -1
- package/dist/rollup/plugins/sucrase/index.mjs +1 -1
- package/dist/rollup/plugins/swc/swc-plugin.cjs +1 -1
- package/dist/rollup/plugins/swc/swc-plugin.mjs +1 -1
- package/dist/types.d.cts +12 -1
- package/dist/types.d.mts +12 -1
- package/dist/types.d.ts +12 -1
- package/package.json +10 -10
- package/dist/cli.mjs +0 -187
- package/dist/hooks/preset/auto.d.cts +0 -5
- package/dist/hooks/preset/auto.d.ts +0 -5
- package/dist/hooks/preset/utils/infer-entries.d.cts +0 -14
- package/dist/hooks/preset/utils/infer-entries.d.ts +0 -14
- package/dist/hooks/preset/utils/overwrite-with-publish-config.d.cts +0 -6
- package/dist/hooks/preset/utils/overwrite-with-publish-config.d.ts +0 -6
- package/dist/hooks/preset/utils/resolve-preset.d.cts +0 -6
- package/dist/hooks/preset/utils/resolve-preset.d.mts +0 -4
- package/dist/hooks/preset/utils/resolve-preset.d.ts +0 -6
- package/dist/packem/index.cjs +0 -125
- package/dist/packem/index.mjs +0 -131
- package/dist/packem_shared/constants-C98jAkyM.cjs +0 -1
- package/dist/utils/find-packem-file.d.cts +0 -4
- package/dist/utils/find-packem-file.d.ts +0 -4
- package/dist/utils/load-package-json.d.cts +0 -8
- package/dist/utils/load-package-json.d.ts +0 -8
- /package/dist/{commands → cli/commands}/add.d.mts +0 -0
- /package/dist/{commands → cli/commands}/build.d.mts +0 -0
- /package/dist/{commands → cli/commands}/init.d.mts +0 -0
- /package/dist/{commands → cli/commands}/utils/css-loader-dependencies.d.mts +0 -0
- /package/dist/{cli.d.mts → cli/index.d.mts} +0 -0
- /package/dist/{hooks → config}/preset/auto.d.mts +0 -0
- /package/dist/{hooks → config}/preset/utils/infer-entries.d.mts +0 -0
- /package/dist/{hooks → config}/preset/utils/overwrite-with-publish-config.d.mts +0 -0
- /package/dist/{utils → config/utils}/find-packem-file.d.mts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## @visulima/packem [1.18.4](https://github.com/visulima/packem/compare/@visulima/packem@1.18.3...@visulima/packem@1.18.4) (2025-01-27)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **packem:** major codebase restructuring and improvements ([f71710e](https://github.com/visulima/packem/commit/f71710eb9b11ab1fc480bffa7db9a4f7e9487cb7))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* fixed package.json exports ([c585ff5](https://github.com/visulima/packem/commit/c585ff54733564726617d80afabdeea595524155))
|
|
10
|
+
* fixed test, after pnpm audit fix ([a659751](https://github.com/visulima/packem/commit/a659751324028856634d56629b4fa8d8612b60cf))
|
|
11
|
+
|
|
12
|
+
## @visulima/packem [1.18.3](https://github.com/visulima/packem/compare/@visulima/packem@1.18.2...@visulima/packem@1.18.3) (2025-01-25)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* added exclude rule for node_modules and dist to the auto preset ([84ad8ae](https://github.com/visulima/packem/commit/84ad8ae276118f06ed606e69189829dc905e7eb5))
|
|
17
|
+
|
|
1
18
|
## @visulima/packem [1.18.2](https://github.com/visulima/packem/compare/@visulima/packem@1.18.1...@visulima/packem@1.18.2) (2025-01-25)
|
|
2
19
|
|
|
3
20
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -495,6 +495,45 @@ This will replace all instances of `process.env.NODE_ENV` with `'production'` an
|
|
|
495
495
|
packem build --env.NODE_ENV=production
|
|
496
496
|
```
|
|
497
497
|
|
|
498
|
+
## Programmatic Usage
|
|
499
|
+
|
|
500
|
+
You can use Packem programmatically in your Node.js applications without the CLI:
|
|
501
|
+
|
|
502
|
+
```typescript
|
|
503
|
+
import { packem } from '@visulima/packem';
|
|
504
|
+
|
|
505
|
+
// Basic usage
|
|
506
|
+
await packem('./src', {
|
|
507
|
+
mode: 'build',
|
|
508
|
+
environment: 'production'
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
// With custom options
|
|
512
|
+
await packem('./src', {
|
|
513
|
+
mode: 'build',
|
|
514
|
+
environment: 'development',
|
|
515
|
+
declaration: true,
|
|
516
|
+
minify: true,
|
|
517
|
+
sourcemap: true,
|
|
518
|
+
logger: {
|
|
519
|
+
// Custom logger options
|
|
520
|
+
level: 'debug'
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
The `packem` function accepts the following parameters:
|
|
526
|
+
- `rootDirectory` (string): The root directory of your project to bundle
|
|
527
|
+
- `options` (PackemOptions): Configuration options that extend the BuildConfig interface
|
|
528
|
+
- `mode`: The build mode ('build' | 'watch')
|
|
529
|
+
- `environment`: The target environment ('development' | 'production')
|
|
530
|
+
- `declaration`: Enable/disable TypeScript declaration file generation
|
|
531
|
+
- `minify`: Enable/disable code minification
|
|
532
|
+
- `sourcemap`: Enable/disable source map generation
|
|
533
|
+
- `logger`: Logger configuration options
|
|
534
|
+
|
|
535
|
+
For more detailed configuration options, refer to the [Configuration](#configuration) section.
|
|
536
|
+
|
|
498
537
|
## Validators
|
|
499
538
|
|
|
500
539
|
### Package.json Validation
|