{"_id":"@html_first/js_lib_template","_rev":"81-efe06aab52294edd50fbb6e0c9d1475f","name":"@html_first/js_lib_template","dist-tags":{"latest":"2.0.17"},"versions":{"2.0.16":{"name":"@html_first/js_lib_template","version":"2.0.16","keywords":["javascript","typescript","library creation helper","templating"],"author":{"name":"hakim_jazuli"},"license":"MIT","_id":"@html_first/js_lib_template@2.0.16","maintainers":[{"name":"hakim_jazuli","email":"m.hakim.jazuli@gmail.com"}],"homepage":"https://github.com/hakimjazuli/js_lib_template#readme","bugs":{"url":"https://github.com/hakimjazuli/js_lib_template/issues"},"dist":{"shasum":"ab8af694d8d391290c158ae24ced4248ffc38810","tarball":"https://registry.npmjs.org/@html_first/js_lib_template/-/js_lib_template-2.0.16.tgz","fileCount":11,"integrity":"sha512-4Lnigy6mWrgRAnZtD8h243r0QnRvZmHmgMB5rwupaR/IgGJS4xpJkOgxMKQbZfnK82K8s6n/iVEpEH1Ao2iO7Q==","signatures":[{"sig":"MEUCIQC3wnBMQmziBgnA0vuNqchnFSY7r9P20ssqILH4zLEWmwIgS9R+N1J+X8QtzOthJHHV5AcPV9GzA24o/eGI6QRF8NQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44458},"main":"index.mjs","type":"module","types":"./types/index.d.mts","module":"index.mjs","gitHead":"0f137c76304a2161c00cb7a46973846a920dad12","scripts":{"dev":"concurrently \"bun --watch ./dev/index.mjs\" \"bun tsc --watch\""},"_npmUser":{"name":"hakim_jazuli","email":"m.hakim.jazuli@gmail.com"},"repository":{"url":"git+https://github.com/hakimjazuli/js_lib_template.git","type":"git"},"_npmVersion":"10.9.0","description":"an opionated js library single file exporter","directories":{},"sideEffects":false,"_nodeVersion":"20.13.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"chokidar":"^3.6.0","typescript":"^5.0.0","concurrently":"^9.0.0","@html_first/simple_queue":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/js_lib_template_2.0.16_1738838909224_0.06365573859842732","host":"s3://npm-registry-packages-npm-production"},"deprecated":"deep type js fix"},"2.0.17":{"name":"@html_first/js_lib_template","version":"2.0.17","keywords":["javascript","typescript","library creation helper","templating"],"author":{"name":"hakim_jazuli"},"license":"MIT","_id":"@html_first/js_lib_template@2.0.17","maintainers":[{"name":"hakim_jazuli","email":"m.hakim.jazuli@gmail.com"}],"homepage":"https://github.com/hakimjazuli/js_lib_template#readme","bugs":{"url":"https://github.com/hakimjazuli/js_lib_template/issues"},"dist":{"shasum":"5a7e3a3f580b04eb488c3bd7c0e772faf001b205","tarball":"https://registry.npmjs.org/@html_first/js_lib_template/-/js_lib_template-2.0.17.tgz","fileCount":11,"integrity":"sha512-tbbd2dGpJ5AGvKTOE28Ax52NnZ4gTUISlaic9raULW3NYmJUJ40rcHHluw04qGMGO26+9zp+F+9dBKAK+8V9bA==","signatures":[{"sig":"MEYCIQCWkKfHEVG9LQ99+g+ku7e/V2593eg9iQsCtLOdUZJiGQIhAJbYAImc8Eb04kmTAEOIYav+tN3G9ko0B6sd1jQ/Qiy1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44401},"main":"index.mjs","type":"module","types":"./types/index.d.mts","module":"index.mjs","gitHead":"e9f58cbccfd9a20a6f5987ee0e4238cd3d0652a3","scripts":{"dev":"concurrently 'bun --watch ./dev/index.mjs' 'bun tsc --watch'"},"_npmUser":{"name":"hakim_jazuli","actor":{"name":"hakim_jazuli","type":"user","email":"m.hakim.jazuli@gmail.com"},"email":"m.hakim.jazuli@gmail.com"},"repository":{"url":"git+https://github.com/hakimjazuli/js_lib_template.git","type":"git"},"_npmVersion":"10.9.0","description":"an opionated js library single file exporter","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"chokidar":"^3.6.0","typescript":"^5.0.0","concurrently":"^9.0.0","@html_first/simple_queue":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/js_lib_template_2.0.17_1750699833024_0.48311387976615183","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2024-09-11T08:45:29.802Z","modified":"2025-06-23T17:31:25.015Z","0.8.0":"2024-09-11T08:45:30.134Z","0.8.1":"2024-09-11T09:05:18.975Z","0.8.2":"2024-09-11T09:37:10.525Z","0.8.3":"2024-09-11T10:11:44.903Z","0.8.4":"2024-09-11T10:20:08.020Z","1.0.0":"2024-09-12T00:03:20.917Z","1.0.1":"2024-09-12T02:20:35.173Z","1.1.0":"2024-09-14T22:13:52.573Z","1.2.0":"2024-09-15T02:00:32.306Z","1.3.0":"2024-09-15T10:07:45.662Z","1.3.1":"2024-09-15T10:21:58.149Z","1.3.2":"2024-09-15T11:17:17.852Z","1.3.3":"2024-09-15T14:26:25.631Z","1.3.4":"2024-09-15T16:13:16.030Z","1.3.5":"2024-09-16T12:48:32.150Z","1.3.6":"2024-09-17T00:54:02.884Z","1.3.7":"2024-09-17T00:57:03.504Z","1.3.8":"2024-09-17T02:09:10.701Z","1.3.9":"2024-10-19T16:09:43.020Z","1.3.10":"2024-10-19T16:13:18.094Z","1.3.11":"2024-10-26T14:49:18.896Z","1.3.12":"2024-11-19T09:30:38.177Z","1.3.13":"2024-11-20T01:38:33.288Z","2.0.0":"2024-11-25T10:48:27.143Z","2.0.1":"2024-11-25T10:55:29.494Z","2.0.2":"2024-11-25T15:50:12.409Z","2.0.3":"2024-11-25T16:28:57.203Z","2.0.4":"2024-11-25T16:33:09.630Z","2.0.5":"2024-11-25T16:45:41.209Z","2.0.6":"2024-11-25T16:47:20.530Z","2.0.7":"2024-11-25T17:37:51.900Z","2.0.8":"2024-11-26T03:19:49.459Z","2.0.9":"2024-11-26T03:22:53.206Z","2.0.10":"2024-11-26T03:28:24.346Z","2.0.11":"2024-11-26T03:33:36.915Z","2.0.12":"2024-11-26T03:37:05.080Z","2.0.13":"2024-12-17T00:31:51.909Z","2.0.14":"2025-01-09T15:38:41.682Z","2.0.15":"2025-02-05T01:31:53.591Z","2.0.16":"2025-02-06T10:48:29.400Z","2.0.17":"2025-06-23T17:30:33.232Z"},"bugs":{"url":"https://github.com/hakimjazuli/js_lib_template/issues"},"author":{"name":"hakim_jazuli"},"license":"MIT","homepage":"https://github.com/hakimjazuli/js_lib_template#readme","keywords":["javascript","typescript","library creation helper","templating"],"repository":{"url":"git+https://github.com/hakimjazuli/js_lib_template.git","type":"git"},"description":"an opionated js library single file exporter","maintainers":[{"name":"hakim_jazuli","email":"m.hakim.jazuli@gmail.com"}],"readme":"## HOW TO INSTALL\n```shell\nnpm i @html_first/js_lib_template --save-dev\n```\nor\n```shell\nbun i @html_first/js_lib_template -D\n```\nor any npm dependency management cli\n## singleton_instantiate_to_run\n- class prefixed with \"__\", are:\n> - `singleton`, can only be instantiated once;\n> - call `run` method of the instance, to starts the watcher to autogenerate the documentation;\n## exported-api-and-type-list\n- [__JSDev](#__jsdev)\n- [__PHPDev](#__phpdev)\n- [core](#core)\n<h2 id=\"__jsdev\">__JSDev</h2>\n\n- `extended` from [core](#core)\r- [singleton_instantiate_to_run](#singleton_instantiate_to_run);\r- `fileName` contains `.type.` detects `@`+`typedef` + ... + `fileName`;\r- supports nested folders;\r- targets [`'*.mjs'`, `'*.ts'`, `'*.mts'`] `files`;\r- `instantiate` class API to watch for file changes;\r- the exported API should contains match literally:\r```js\r/**\r * @param {string} exportName\r * @returns {string[]}\r */\rexportPatterns = (exportName) => [\r\t`export class ${exportName}`,\r\t`export const ${exportName}`,\r\t`export function ${exportName}`,\r];\r```\r- doesn't support `var` or `let`, for semantics;\r- supports for [`\"*.mjs\"`, `\"*.ts\",` `\"*.mts\"`];\r- `fileName` contains `.type.` detects `@`+`typedef` + ... +  `fileName`;\r- additional base setup for js developement:\r> - generate `types`;\r```js\r// tsconfig.js\r{\r\"compilerOptions\": {\r\t\"allowJs\": true,\r\t\"declaration\": true,\r\t\"emitDeclarationOnly\": true,\r\t\"outDir\": \"./types\",\r\t\"module\": \"ESNext\",\r\t\"target\": \"ES2020\",\r\t\"moduleResolution\": \"node\",\r\t\"esModuleInterop\": true,\r\t\"skipLibCheck\": true,\r\t\"baseUrl\": \".\"\r},\r\"include\": [filePathOptionValue]\r}\r```\r> - generation script\r```js\r// package.json\r{\r...\r\"main\": \"index.mjs\",\r\"types\": \"./types/index.d.mts\",\r\"module\": \"index.mjs\",\r\"type\": \"module\",\r...\r\"scripts\": {\r\t\"dev\": \"concurrently \\\"bun --watch ./dev/index.mjs\\\" \\\"bun tsc --watch\\\"\"\r},\r...\r}\r```\r- with type definition it can also check for:\r> - if there are any name colision, as we don't support aliases exports;\r> - allow your library user to set `skiplibChecks: false` on their `typescript` configuration;\r\n\n*) <sub>[go to exported list](#exported-api-and-type-list)</sub>\n\n<h2 id=\"__phpdev\">__PHPDev</h2>\n\n- `extended` from [core](#core)\r- [singleton_instantiate_to_run](#singleton_instantiate_to_run);\r- `fileName` contains `.type.` detects `@`+`see` + ... + `fileName`;\r- using class instantiation, generate single `markdown` documentation for `PHP`;\r> - on comment after `@see` throught the end of comment will be added;\r- supports nesting;\r- additional base setup;\r- example file setting:\r```js\r// ./dev/index.mjs\r// @ts-check\rimport { __PHPDev } from '@html_first/js_lib_template';\rnew __PHPDev({\r folderPath: './src',\r readMePath: './README.md',\r  description: ['## HOW TO INSTALL','```shell','composer require author/package-name','```'].\r}).run();\r```\r- saving script for convenience:\r```js\r// package.json\r{\r...\r\"scripts\": {\r...\r\t\"dev\": \"bun --watch ./dev/index.mjs\"\r...\r},\r}\r...\r```\r- starts watching:\r```shell\rbun dev\r// or\rnpm run dev\r```\r\n\n*) <sub>[go to exported list](#exported-api-and-type-list)</sub>\n\n<h2 id=\"core\">core</h2>\n\n- class template for `auto document/export generator`;\r> - extended class must call super on it's constructor\r```js\rexport class MyClass extends {\r\tconstructor(){\r \t\tsuper({ ...coreOptions });\r\t\t// ...\r\t}\r\t// ...\r\t// also you need to override any method and property prefixed with \"_\"\r}\r```\r- constructor argument:\r```js\r/**\r * @typedef {Object} coreOptions\r * @property {string} [coreOptions.filePath]\r * - realtive path from wroking directory\r * @property {string} [coreOptions.folderPath]\r * - realtive path from wroking directory\r * @property {string} [coreOptions.readMePath]\r * - realtive path from wroking directory\r * @property {string} [coreOptions.tableOfContentTitle]\r * @property {string[]} [coreOptions.copyright]\r * @property {string[]} [coreOptions.description]\r * @property {import('chokidar').WatchOptions} [coreOptions.option]\r */\r```\r-  we use chokidar for watching changes:\r> - refer the options to [chokidar github](https://github.com/paulmillr/chokidar)\r- in essence this class is a collection of method to help to do the above points, incase of you want to create your own `documentation/export generator` calling `this.createHandler`;\r- file content detection uses `string.includes`, as I cannot get arround `regex` to allow me to use `$` as export name;\r- `README.md` auto export rules:\r> - has `description`;\r> - in case you want to render empty string use [`blank`];\r> - detectes the first `commentBlock` with `description`;\r> - automatically turns string after last `description` of that `commentBlock` until end of the `commentBlock`;\r> - `upperCase` OR `symbol`;\r> - `fileName` match with `exportedName`;\r> - `special export`:\r> - `fileName` contains `.type.`:\r> > only works on `language` that have `type` supports, where `declaring` and `assigning` `types` can be done on different `file`:\r> > - will detect depends on the `handler` `@`+`coreInstance._typedefIdentifier` ... + `filename`;\r> - `fileName` contains `.export.`:\r> > - use to bypass `upperCase` rule:\r- links:\r> - auto named `h2` tag `id`, it match the `fileName` in `lowerCase`;\r> - in this `autoExported` case `__JSDev` can be refered as `#__jsdev`;\r> - use `namedExport` extracted files from `this.getListFilesNestedDetails` method;\r> - run `thisInstance.run();` to start the watcher;\r!!!WARNING\r- copy out:\r> - filePath: default `./index.mjs`,\r> - readMePath: default `./README.md`,\r> - folderPath: default `./src/*`,\r> - `typescript` `outDir` or `package.json` `types`: default `./types/*`,\r- of any file you might need to be unmodified, before fully knowing what this library will modify...\r\n\n*) <sub>[go to exported list](#exported-api-and-type-list)</sub>\n","readmeFilename":"README.md"}