@visulima/packem 1.0.8 → 1.1.0
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 +12 -0
- package/README.md +16 -0
- package/dist/{typedoc/index.d.ts → builder/typedoc/generate-reference-documentation.d.cts} +1 -1
- package/dist/{typedoc/index.d.mts → builder/typedoc/generate-reference-documentation.d.mts} +1 -1
- package/dist/{typedoc/index.d.cts → builder/typedoc/generate-reference-documentation.d.ts} +1 -1
- package/dist/builder/typedoc/index.cjs +3 -0
- package/dist/builder/typedoc/index.d.cts +5 -0
- package/dist/builder/typedoc/index.d.mts +3 -0
- package/dist/builder/typedoc/index.d.ts +5 -0
- package/dist/builder/typedoc/index.mjs +5 -0
- package/dist/cli.mjs +66 -60
- package/dist/commands/add.d.mts +3 -0
- package/dist/create-bundler.cjs +60 -62
- package/dist/create-bundler.mjs +63 -65
- package/dist/packem_shared/create-or-update-key-storage-BxGi6kMH.mjs +3 -0
- package/dist/packem_shared/create-or-update-key-storage-DslhcsTU.cjs +3 -0
- package/dist/rollup/plugins/esbuild/types.d.cts +2 -1
- package/dist/rollup/plugins/esbuild/types.d.mts +2 -1
- package/dist/rollup/plugins/esbuild/types.d.ts +2 -1
- package/dist/types.d.cts +5 -1
- package/dist/types.d.mts +5 -1
- package/dist/types.d.ts +5 -1
- package/dist/utils/find-packem-file.d.cts +4 -0
- package/dist/utils/find-packem-file.d.mts +2 -0
- package/dist/utils/find-packem-file.d.ts +4 -0
- package/package.json +63 -35
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## @visulima/packem [1.1.0](https://github.com/visulima/packem/compare/@visulima/packem@1.0.9...@visulima/packem@1.1.0) (2024-10-22)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* add command to install optional features & builder option ([#40](https://github.com/visulima/packem/issues/40)) ([2d64af9](https://github.com/visulima/packem/commit/2d64af92f0c3a5bd864da9dc4d5540cbbaa4fb31))
|
|
6
|
+
|
|
7
|
+
## @visulima/packem [1.0.9](https://github.com/visulima/packem/compare/@visulima/packem@1.0.8...@visulima/packem@1.0.9) (2024-10-21)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* updated @babel/parser, @rollup/plugin-commonjs, @rollup/plugin-dynamic-import-vars, [@visulima](https://github.com/visulima) packages, jiti, magic-string, mlly, typedoc and oxc-parser ([73d5a93](https://github.com/visulima/packem/commit/73d5a93cb503464b7e8718d426b090e53c32f986))
|
|
12
|
+
|
|
1
13
|
## @visulima/packem [1.0.8](https://github.com/visulima/packem/compare/@visulima/packem@1.0.7...@visulima/packem@1.0.8) (2024-10-05)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -469,6 +469,22 @@ packem build --env.NODE_ENV=production
|
|
|
469
469
|
|
|
470
470
|
## TypeDoc
|
|
471
471
|
|
|
472
|
+
### Installation
|
|
473
|
+
|
|
474
|
+
To generate api documentation for your project, you need to install `typedoc` to your project.
|
|
475
|
+
|
|
476
|
+
```sh
|
|
477
|
+
npm exec packem add typedoc
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
```sh
|
|
481
|
+
yarn exec packem add typedoc
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
```sh
|
|
485
|
+
pnpm exec packem add typedoc
|
|
486
|
+
```
|
|
487
|
+
|
|
472
488
|
To generate documentation for your project, you can use the `--typedoc` flag.
|
|
473
489
|
|
|
474
490
|
```sh
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Pail } from "@visulima/pail";
|
|
2
|
-
import type { BuildEntry, TypeDocumentOptions } from "
|
|
2
|
+
import type { BuildEntry, TypeDocumentOptions } from "../../types.d.cts";
|
|
3
3
|
declare const generateReferenceDocumentation: (options: TypeDocumentOptions, entries: BuildEntry[], outputDirectory: string, logger: Pail) => Promise<void>;
|
|
4
4
|
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Pail } from "@visulima/pail";
|
|
2
|
-
import type { BuildEntry, TypeDocumentOptions } from "
|
|
2
|
+
import type { BuildEntry, TypeDocumentOptions } from "../../types.d.mts";
|
|
3
3
|
declare const generateReferenceDocumentation: (options: TypeDocumentOptions, entries: BuildEntry[], outputDirectory: string, logger: Pail) => Promise<void>;
|
|
4
4
|
export default generateReferenceDocumentation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Pail } from "@visulima/pail";
|
|
2
|
-
import type { BuildEntry, TypeDocumentOptions } from "
|
|
2
|
+
import type { BuildEntry, TypeDocumentOptions } from "../../types.d.ts";
|
|
3
3
|
declare const generateReferenceDocumentation: (options: TypeDocumentOptions, entries: BuildEntry[], outputDirectory: string, logger: Pail) => Promise<void>;
|
|
4
4
|
|
|
5
5
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var E=Object.create;var y=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var m=(e,o)=>y(e,"name",{value:o,configurable:!0});var _=(e,o,t,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of P(o))!b.call(e,r)&&r!==t&&y(e,r,{get:()=>o[r],enumerable:!(c=A(o,r))||c.enumerable});return e};var n=(e,o,t)=>(t=e!=null?E($(e)):{},_(o||!e||!e.__esModule?y(t,"default",{value:e,enumerable:!0}):t,e));const C=require("@visulima/colorize"),h=require("@visulima/path"),k=require("../../packem_shared/create-or-update-key-storage-DslhcsTU.cjs"),R=require("node:fs"),f=require("@visulima/fs"),j=require("typedoc");var D=Object.defineProperty,F=m((e,o)=>D(e,"name",{value:o,configurable:!0}),"m");const S=F(async(e,o,t,c)=>{if(o.length===0)return;const{format:r,marker:i,output:x,plugin:w,readmePath:s,...v}=e;if(r==="inline"&&s===void 0)throw new Error("The `readmePath` option is required when using the `inline` format.");const q=o.map(u=>u.input),l=await j.Application.bootstrapWithPlugins({...v,compilerOptions:{allowJs:!0,declaration:!1,declarationMap:!1,esModuleInterop:!0,module:99,moduleResolution:100,noEmit:!0,noImplicitAny:!1,skipLibCheck:!0,sourceMap:!1,target:99,...v.compilerOptions},entryPoints:q,hideGenerator:!0,plugin:[...w??[],require.resolve("@ckeditor/typedoc-plugins/lib/module-fixer"),require.resolve("@ckeditor/typedoc-plugins/lib/symbol-fixer"),require.resolve("@ckeditor/typedoc-plugins/lib/interface-augmentation-fixer"),require.resolve("@ckeditor/typedoc-plugins/lib/event-inheritance-fixer"),require.resolve("@ckeditor/typedoc-plugins/lib/purge-private-api-docs"),require.resolve("@ckeditor/typedoc-plugins/lib/tag-error"),require.resolve("@ckeditor/typedoc-plugins/lib/tag-event"),require.resolve("@ckeditor/typedoc-plugins/lib/tag-observable"),require.resolve("typedoc-plugin-rename-defaults"),...r==="inline"||r==="markdown"?["typedoc-plugin-markdown"]:[]],...r==="inline"?{hideBreadcrumbs:!0,hidePageHeader:!0,navigation:!1,outputFileStrategy:"modules",useCodeBlocks:!0}:{}},[]),d=await l.convert();if(d&&(await(r==="json"?l.generateJson(d,t):l.generateDocs(d,t)),r==="inline")){if(i===void 0)throw new Error("The `marker` option is required when using the `inline` format.");const u=R.readdirSync(t,{withFileTypes:!0}).filter(a=>a.isFile());let g="";for(const a of u)a.name==="README.md"&&o.length>1||(g+=f.readFileSync(h.join(t,a.name)).replaceAll(`<!-- ${i}`,`<!-- _REPLACE_${i}`).replaceAll("<!-- ${marker}",`<!-- _REPLACE_\\${i}`));if(g!==""){const a=f.readFileSync(s),p=k.g(a,i,`
|
|
2
|
+
`+g);if(!p){c.error({message:`Could not find the typedoc marker: <!-- ${i} --><!-- /${i} --> in ${s}`,prefix:"typedoc"});return}if(a===p)return;p&&f.writeFileSync(s,p.replaceAll(`<!-- _REPLACE_${i}`,`<!-- ${i}`).replaceAll(`<!-- _REPLACE_\\${i}`,"<!-- ${marker}"),{overwrite:!0})}}},"generateReferenceDocumentation");var L=Object.defineProperty,O=m((e,o)=>L(e,"name",{value:o,configurable:!0}),"r");const M=O(async(e,o,t,c)=>{if(e.options.typedoc&&e.options.typedoc.format!==void 0){let r="unknown";e.pkg.dependencies?.typedoc?r=e.pkg.dependencies.typedoc:e.pkg.devDependencies?.typedoc&&(r=e.pkg.devDependencies.typedoc),o&&k.d("typedoc",o,e.logger,!0),c&&e.logger.raw(`
|
|
3
|
+
`),e.logger.info({message:"Using "+C.cyan("typedoc")+" "+r+" to generate reference documentation",prefix:"typedoc"}),await e.hooks.callHook("typedoc:before",e);let i=h.join(e.options.rootDir,"api-docs");e.options.typedoc.format==="inline"&&o&&(i=h.join(o,"typedoc")),e.options.typedoc.output&&(i=e.options.typedoc.output),await S(e.options.typedoc,e.options.entries,i,e.logger),await e.hooks.callHook("typedoc:done",e)}},"builder");module.exports=M;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var k=Object.defineProperty;var m=(e,o)=>k(e,"name",{value:o,configurable:!0});import{cyan as w}from"@visulima/colorize";import{join as g}from"@visulima/path";import{g as E,d as q}from"../../packem_shared/create-or-update-key-storage-BxGi6kMH.mjs";import{readdirSync as A}from"node:fs";import{readFileSync as y,writeFileSync as P}from"@visulima/fs";import{Application as $}from"typedoc";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
2
|
+
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
3
|
+
var b=Object.defineProperty,_=m((e,o)=>b(e,"name",{value:o,configurable:!0}),"m");const C=_(async(e,o,n,l)=>{if(o.length===0)return;const{format:i,marker:r,output:F,plugin:v,readmePath:a,...f}=e;if(i==="inline"&&a===void 0)throw new Error("The `readmePath` option is required when using the `inline` format.");const h=o.map(d=>d.input),s=await $.bootstrapWithPlugins({...f,compilerOptions:{allowJs:!0,declaration:!1,declarationMap:!1,esModuleInterop:!0,module:99,moduleResolution:100,noEmit:!0,noImplicitAny:!1,skipLibCheck:!0,sourceMap:!1,target:99,...f.compilerOptions},entryPoints:h,hideGenerator:!0,plugin:[...v??[],require.resolve("@ckeditor/typedoc-plugins/lib/module-fixer"),require.resolve("@ckeditor/typedoc-plugins/lib/symbol-fixer"),require.resolve("@ckeditor/typedoc-plugins/lib/interface-augmentation-fixer"),require.resolve("@ckeditor/typedoc-plugins/lib/event-inheritance-fixer"),require.resolve("@ckeditor/typedoc-plugins/lib/purge-private-api-docs"),require.resolve("@ckeditor/typedoc-plugins/lib/tag-error"),require.resolve("@ckeditor/typedoc-plugins/lib/tag-event"),require.resolve("@ckeditor/typedoc-plugins/lib/tag-observable"),require.resolve("typedoc-plugin-rename-defaults"),...i==="inline"||i==="markdown"?["typedoc-plugin-markdown"]:[]],...i==="inline"?{hideBreadcrumbs:!0,hidePageHeader:!0,navigation:!1,outputFileStrategy:"modules",useCodeBlocks:!0}:{}},[]),c=await s.convert();if(c&&(await(i==="json"?s.generateJson(c,n):s.generateDocs(c,n)),i==="inline")){if(r===void 0)throw new Error("The `marker` option is required when using the `inline` format.");const d=A(n,{withFileTypes:!0}).filter(t=>t.isFile());let u="";for(const t of d)t.name==="README.md"&&o.length>1||(u+=y(g(n,t.name)).replaceAll(`<!-- ${r}`,`<!-- _REPLACE_${r}`).replaceAll("<!-- ${marker}",`<!-- _REPLACE_\\${r}`));if(u!==""){const t=y(a),p=E(t,r,`
|
|
4
|
+
`+u);if(!p){l.error({message:`Could not find the typedoc marker: <!-- ${r} --><!-- /${r} --> in ${a}`,prefix:"typedoc"});return}if(t===p)return;p&&P(a,p.replaceAll(`<!-- _REPLACE_${r}`,`<!-- ${r}`).replaceAll(`<!-- _REPLACE_\\${r}`,"<!-- ${marker}"),{overwrite:!0})}}},"generateReferenceDocumentation");var R=Object.defineProperty,D=m((e,o)=>R(e,"name",{value:o,configurable:!0}),"r");const T=D(async(e,o,n,l)=>{if(e.options.typedoc&&e.options.typedoc.format!==void 0){let i="unknown";e.pkg.dependencies?.typedoc?i=e.pkg.dependencies.typedoc:e.pkg.devDependencies?.typedoc&&(i=e.pkg.devDependencies.typedoc),o&&q("typedoc",o,e.logger,!0),l&&e.logger.raw(`
|
|
5
|
+
`),e.logger.info({message:"Using "+w("typedoc")+" "+i+" to generate reference documentation",prefix:"typedoc"}),await e.hooks.callHook("typedoc:before",e);let r=g(e.options.rootDir,"api-docs");e.options.typedoc.format==="inline"&&o&&(r=g(o,"typedoc")),e.options.typedoc.output&&(r=e.options.typedoc.output),await C(e.options.typedoc,e.options.entries,r,e.logger),await e.hooks.callHook("typedoc:done",e)}},"builder");export{T as default};
|