{"id":21971779,"url":"https://github.com/cristopher1/generator-esmodules-generator","last_synced_at":"2025-04-28T12:10:55.328Z","repository":{"id":206851954,"uuid":"716649037","full_name":"cristopher1/generator-esmodules-generator","owner":"cristopher1","description":"Yeoman generator to create yeoman generators based in ES Modules.","archived":false,"fork":false,"pushed_at":"2024-04-04T00:24:15.000Z","size":680,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T07:38:07.666Z","etag":null,"topics":["es6","generator","yeoman","yeoman-generator"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/generator-esmodules-generator","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cristopher1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-09T15:22:05.000Z","updated_at":"2024-07-07T20:59:31.000Z","dependencies_parsed_at":"2023-11-15T01:28:00.035Z","dependency_job_id":"2fcf115f-268b-4b63-8602-bea7ca95fe39","html_url":"https://github.com/cristopher1/generator-esmodules-generator","commit_stats":null,"previous_names":["cristopher1/generator-esmodules-generator"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristopher1%2Fgenerator-esmodules-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristopher1%2Fgenerator-esmodules-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristopher1%2Fgenerator-esmodules-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristopher1%2Fgenerator-esmodules-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cristopher1","download_url":"https://codeload.github.com/cristopher1/generator-esmodules-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311332,"owners_count":21569009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["es6","generator","yeoman","yeoman-generator"],"created_at":"2024-11-29T14:55:49.482Z","updated_at":"2025-04-28T12:10:55.308Z","avatar_url":"https://github.com/cristopher1.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eWelcome to generator-esmodules-generator 👋\u003c/h1\u003e\n\u003cp\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/version-1.0.3-blue.svg?cacheSeconds=2592000\" /\u003e\n  \u003ca href=\"https://github.com/cristopher1/generator-esmodules-generator#readme\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/cristopher1/generator-esmodules-generator/graphs/commit-activity\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Maintenance\" src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/cristopher1/generator-esmodules-generator/blob/master/LICENSE\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/github/license/cristopher1/generator-esmodules-generator\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e Yeoman generator to create yeoman generators based in ES Modules.\n\n### What's changed? See [generator-esmodules-generator releases](https://github.com/cristopher1/generator-esmodules-generator/releases)\n\n### 🏠 [Homepage](https://github.com/cristopher1/generator-esmodules-generator)\n\nThe `generator-esmodules-generator` provides a structure to create a yeoman generator using ES Modules.\n\nThe structure created by this generator includes:\n\n- [Jest](https://jestjs.io/)\n- [Babel](https://babeljs.io/) with [@babel/cli](https://babeljs.io/docs/babel-cli), [@babel/core](https://babeljs.io/docs/babel-core),\n  [@babel/plugin-transform-runtime](https://babeljs.io/docs/babel-plugin-transform-runtime), [@babel/preset-env](https://babeljs.io/docs/babel-preset-env),\n  [@babel/runtime-corejs3](https://www.npmjs.com/package/@babel/runtime-corejs3) and [core-js](https://www.npmjs.com/package/core-js)\n- [Eslint](https://eslint.org/) with [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier), [eslint-config-standard](https://www.npmjs.com/package/eslint-config-standard),\n  [eslint-plugin-jest](https://www.npmjs.com/package/eslint-plugin-jest), [eslint-plugin-jsdoc](https://www.npmjs.com/package/eslint-plugin-jsdoc), etc.\n- [Prettier](https://prettier.io/) with [prettier-plugin-jsdoc](https://www.npmjs.com/package/prettier-plugin-jsdoc)\n- [Lint-staged](https://www.npmjs.com/package/lint-staged)\n- [Faker](https://fakerjs.dev/)\n- [Commitlint](https://commitlint.js.org/#/)\n- [Readme-md-generator](https://github.com/kefranabg/readme-md-generator)\n- [Husky](https://www.npmjs.com/package/husky)\n- Others\n\nExample of a generator created by `generator-esmodules-generator`:\n\n![esmodules-generator](https://github.com/cristopher1/generator-esmodules-generator/assets/21159930/325b033a-7f57-4e4c-979b-68b3a4370314)\n\n### [Index](#index)\n\n- [Installation](#installation)\n- [Prerequisites](#prerequisites)\n- [Arguments and options](#arguments-and-options)\n- [Generators included](#generators-included)\n- [The configuration files](#configuration-files)\n- [The question: Do you want to automatically run the scripts that configure the package, then installing the dependencies?](#configuring-the-project-automatically)\n- [The scripts in package.json](#scripts)\n- [Getting To Know Yeoman](#know-yeoman)\n- [Author](#author)\n- [Contributing](#contributing)\n- [Show your support](#support)\n- [License](#license)\n\n## \u003ca id=\"installation\"\u003e\u003c/a\u003e Installation\n\nFirst, install [Yeoman](http://yeoman.io) and generator-esmodules-generator using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).\n\n```bash\nnpm install -g yo\nnpm install -g generator-esmodules-generator\n```\n\nThen generate your new project:\n\n```bash\nyo esmodules-generator generator_name\n```\n\n## \u003ca id=\"prerequisites\"\u003e\u003c/a\u003e Prerequisites\n\nFirst, you must create a folder, then you enter it using the terminal. Finally you runs.\n\n```bash\nyo esmodules-generator generator_test\n```\n\nExample:\n\n```console\nPS C:\\Users\\...\\generator_es6\u003e yo esmodules-generator generator_test\n```\n\n## \u003ca id=\"arguments-and-options\"\u003e\u003c/a\u003e Arguments and options\n\nThe generator-esmodules-generator include only an argument called **generatorName** and it is required:\n\nFor example: If you want to create a new generator called generator_test (generatorName = generator_test), you should use:\n\n```bash\nyo esmodules-generator generator_test\n```\n\nThe generator-esmodules-generator include various options, these are:\n\n| option               |  value  |  default   | description                                                                                                                   | example                                                                                  |\n| :------------------- | :-----: | :--------: | :---------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------- |\n| onlyTerminal         | Boolean |   false    | If this option is used, the yeoman prompts will not be used when there are missing options.                                   | `yo esmodules-generator generator_name --onlyTerminal`                                   |\n| generatorDescription | String  |     ''     | Description used into package.json                                                                                            | `yo esmodules-generator generator_name --generatorDescription=description`               |\n| generatorKeywords    | String  |     ''     | Generator keywords (comman to split)                                                                                          | `yo esmodules-generator generator_name --generatorKeywords=keyword1,keyword2,keyword3`   |\n| license              | String  | NO_LICENSE | Any lincese accepted by generator-license, for example: Apache-2.0, MIT, MPL-2.0 BSD-2-Clause-FreeBSD, BSD-3-Clause, ISC, etc | `yo esmodules-generator generator_name --license=MIT`                                    |\n| authorName           | String  |     ''     | Author's name                                                                                                                 | `yo esmodules-generator generator_name --authorName=author`                              |\n| authorEmail          | String  |     ''     | Author's email                                                                                                                | `yo esmodules-generator generator_name --authorEmail=author@gmail.com`                   |\n| authorHomepage       | String  |     ''     | Author's homepage                                                                                                             | `yo esmodules-generator generator_name --authorHomepage=www.authorhomepage.com`          |\n| urlRepository        | String  |     ''     | Github repository url                                                                                                         | `yo esmodules-generator generator_name --urlRepository=urlrepository`                    |\n| generatorHomePageUrl | String  |     ''     | Project homepage url                                                                                                          | `yo esmodules-generator generator_name --generatorHomePageUrl=www.generatorHomePage.com` |\n| runGitInit           | Boolean |   false    | Run git init automatically, then installing the dependencies                                                                  | `yo esmodules-generator generator_name --runGitInit`                                     |\n| runPackageScripts    | Boolean |   false    | Run the scripts that configure the package, then installing the dependencies                                                  | `yo esmodules-generator generator_name --runPackageScripts`                              |\n\n## \u003ca id=\"generators-included\"\u003e\u003c/a\u003e Generators included\n\nThe generators included are:\n\n`esmodules-generator:app` used by `yo esmodules-generator`: It is the generator used by default.\n\n`esmodules-generator:subgenerator`: It is used to create and exports subgenerators into the generator created by `yo esmodules-generator`.\n\nWhen to enter in the folder where you creates your generator using `yo esmodules-generator`, you can use the following commands:\n\n- `yo esmodules-generator:subgenerator subGeneratorName --create`: Creates a subgenerator with name subGeneratorName.\n\n- `yo esmodules-generator:subgenerator subGeneratorName --exports`: Exports subGeneratoName. It adds to exports field (package.json)\n  the properties types (exports the declaration files) and import (exports the subgenerator as ES Modules).\n\n  Example:\n\n  In default package.json created by `esmodules-generator`\n\n  ```json\n  \"exports\": {\n    \".\": {\n      \"types\": \"./dist/types/generators/app/index.d.ts\",\n      \"import\": \"./dist/generators/app/index.js\"\n    },\n    \"./app\": {\n      \"types\": \"./dist/types/generators/app/index.d.ts\",\n      \"import\": \"./dist/generators/app/index.js\"\n    }\n  }\n  ```\n\n  The `--create` and `--exports` options can be combined.\n\n  ```console\n  PS C:\\Users\\...\\generator_es6\u003e yo esmodules-generator:subgenerator subapp --create --exports\n  ```\n\n  package.json\n\n  ```json\n  \"exports\": {\n    \".\": {\n      \"types\": \"./dist/types/generators/app/index.d.ts\",\n      \"import\": \"./dist/generators/app/index.js\"\n    },\n    \"./app\": {\n      \"types\": \"./dist/types/generators/app/index.d.ts\",\n      \"import\": \"./dist/generators/app/index.js\"\n    },\n    \"./subapp\": {\n      \"types\": \"./dist/types/generators/subapp/index.d.ts\",\n      \"import\": \"./dist/generators/subapp/index.js\"\n    }\n  },\n  ```\n\n## \u003ca id=\"configuration-files\"\u003e\u003c/a\u003e The configuration files\n\nThe configuration files included are:\n\n- Eslint: `.eslintignore` (the files and directories ignored by eslint) and `.eslintrc.json` (configuration used by eslint).\n- Git: `.gitignore` (the files and directories ignored by git).\n- Lint-staged: `.lintstagedrc.json` (configuration used by lint-staged).\n- Prettier: `.prettierignore` (the files and directories ignored by prettier) and `.prettierrc.json` (configuration used by prettier).\n- Babel: `babel.config.json` (configuration used by babel):\n\n  - The `env.buildESmodules` contains the configuration used to transpile the source code to es6.\n\n- Commitlint: `commitlint.config.js` (configuration used by commitlint).\n\n- Jest: `jest.config.js` (configuration used by jest).\n\n- TypeScript: `tsconfig.json` (configuration used by TypeScript compiler).\n\n## \u003ca id=\"configuring-the-project-automatically\"\u003e\u003c/a\u003e The question: Do you want to automatically run the scripts that configure the package, then installing the dependencies?\n\nWhen you selects the true value, the following scripts ubicated in the package.json are executed:\n\n- `init`\n- `documentation:create`\n- `format:fix`\n- `test`\n- `build`\n\nIf you selects the false value, you must run `npm run init` obligatory.\n\n## \u003ca id=\"scripts\"\u003e\u003c/a\u003e The scripts in package.json\n\nThe more important scripts added into the package.json created by this generator are:\n\n- `\"init\"`: Runs the commands necessary to initialize the package, for example `init:husky`.\n- `\"documentation:create\"`: Creates documentation using readme-md-generator.\n- `\"format\"`: Checks the format using prettier.\n- `\"format:fix\"`: Fixes the format using prettier.\n- `\"format:build-stage\"` and `\"format:build-stage:fix\"`: similar to `\"format\"` and `\"format:fix\"`. They used when the `npm run build` is called.\n- `\"lint\"`: static code analysis using eslint.\n- `\"lint:fix\"`: Fixes the code using eslint.\n- `\"lint:build-stage\"` and `\"lint:build-stage:fix\"`: similar to `\"lint\"` and `\"lint:fix\"`. They are used when the `npm run build` is called.\n- `\"build:tsc\"`: Generates .d.ts files using the TypeScript compilator. It is used when the `npm run build` is called.\n- `\"build:es6\"`: Transpiles the source code to es6 using babel.\n- `\"build\"`: Generates the dist folder that contains the generators folder (it contains the source code transpiled to es6) and types folder (it contains the declaration files). If you want to manually test your generator you should use `npm link` and `npm run build`. See [yeoman Running the generator](https://yeoman.io/authoring/)\n- `\"prepublishOnly\"`: Used before publishing your package using `npm publish`. Runs `npm run build`.\n- `\"test\"`: Runs the tests using jest.\n- `\"commitlint\"`: Runs commitlint. It is used into .husky/commit-msg file. It is called by the commit-msg hook. See [git hook](https://www.atlassian.com/git/tutorials/git-hooks#:~:text=The%20commit%2Dmsg%20hook%20is,file%20that%20contains%20the%20message.).\n- `\"lint-staged\"`: Runs lint-staged. It is used into .husky/pre-commit file. It is called by the pre-commit hook. See [git hook](https://www.atlassian.com/git/tutorials/git-hooks#:~:text=The%20commit%2Dmsg%20hook%20is,file%20that%20contains%20the%20message.).\n- `\"quality-check\"`: Runs `npm run format \u0026\u0026 npm run lint \u0026\u0026 npm run test`. It is used into .husky/pre-push file. It is called by the pre-push hook See [git hook](https://www.atlassian.com/git/tutorials/git-hooks#:~:text=The%20commit%2Dmsg%20hook%20is,file%20that%20contains%20the%20message.).\n\n## \u003ca id=\"know-yeoman\"\u003e\u003c/a\u003e Getting To Know Yeoman\n\n- Yeoman has a heart of gold.\n- Yeoman is a person with feelings and opinions, but is very easy to work with.\n- Yeoman can be too opinionated at times but is easily convinced not to be.\n- Feel free to [learn more about Yeoman](http://yeoman.io/).\n\n## \u003ca id=\"author\"\u003e\u003c/a\u003e Author\n\n👤 **Cristopher Jiménez**\n\n- Github: [@cristopher1](https://github.com/cristopher1)\n\n## \u003ca id=\"contributing\"\u003e\u003c/a\u003e 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\u003cbr /\u003eFeel free to check [issues page](https://github.com/cristopher1/generator-esmodules-generator/issues).\n\n## \u003ca id=\"support\"\u003e\u003c/a\u003e Show your support\n\nGive a ⭐️ if this project helped you!\n\n## \u003ca id=\"license\"\u003e\u003c/a\u003e 📝 License\n\nCopyright © 2023 [Cristopher Jiménez](https://github.com/cristopher1).\u003cbr /\u003e\nThis project is [MIT](https://github.com/cristopher1/generator-esmodules-generator/blob/master/LICENSE) licensed.\n\n---\n\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristopher1%2Fgenerator-esmodules-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcristopher1%2Fgenerator-esmodules-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristopher1%2Fgenerator-esmodules-generator/lists"}