@sektek/generator-js
v0.17.6
Published
JS/TS project generator for scaffolding new SEKTEK projects
Readme
@sektek/generator-js
JS/TS project generator for scaffolding new SEKTEK projects, driven by
@sektek/gen. Layered on top of
@sektek/generator-base.
BaseGenerator extends @sektek/generator's CoreGenerator directly and sets
package = '@sektek/js'; its default options set packageScope: 'sektek', author,
license: 'UNLICENSED', private: true. Sub-generators:
app— the entrypoint; composes@sektek/base:app,@sektek/base:devcontainer,base-package,gitconfig,eslint, and, whenlanguage: 'typescript',typescript. Also composes a test framework based ontestFramework('mocha'(default),'vitest', or'none'to skip test tooling entirely):mochaunlesstestFrameworkis exactly'vitest'or'none'. Composesdependencieslast, after every other dependency-writing sub-generator, so a caller-pinned version wins over whatever version those sub-generators resolve for an overlapping package name.base-package— writespackage.jsonand, forlanguage: 'javascript', a plain-JS entrypoint (no test file — that's the composed test-framework generator's job, notbase-package's).dependencies— adds user-supplieddependencies/devDependencies(each apackage-nameorpackage-name@versionstring, e.g.'lodash'or'[email protected]'; scoped packages supported, e.g.'@scope/[email protected]') topackage.json. Not prompted for interactively — CLI/config-file only.gitconfig— composes@sektek/base:gitconfig, then layers JS-specific.gitignorerules.lib— a library variant ofapp: identical composition (same sub-generators, sametestFramework/languagehandling), butdestinationMode()targetslibs/<project>when run inside an npm workspace whoseworkspacesfield includeslibs/*, or./<project>standalone otherwise — same fallbackappuses when it isn't nested in a workspace.typescript— writestsconfig.json/tsconfig.build.json(itscompilerOptions.typesreflectstestFramework) and a TS entrypoint (likewise no test file of its own).eslint— writeseslint.config.js, composingprettier.prettier— writes.prettierrc.js/.prettierignore.mocha— writes.mocharc.cjs/.mocharc.min.cjs(and, for TypeScript,.nycrc.jsontoo) plus a chai/BDD-styleindex.spec.ts/index.spec.jsentrypoint.vitest— writesvitest.config.ts(one config for both JS and TS projects) plus anindex.spec.ts/index.spec.jsentrypoint using vitest's ownexpectwith chai-style BDD assertions.workspace— the root-level, npm-workspaces variant ofapp.
Installation
npm install @sektek/generator-js