{"id":19528899,"url":"https://github.com/adonisjs/pkg-starter-kit","last_synced_at":"2025-04-26T11:33:44.192Z","repository":{"id":201184977,"uuid":"627741985","full_name":"adonisjs/pkg-starter-kit","owner":"adonisjs","description":"AdonisJS starter kit to create a new package","archived":false,"fork":false,"pushed_at":"2024-06-19T05:13:03.000Z","size":38,"stargazers_count":26,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-06-19T12:51:45.888Z","etag":null,"topics":["starter-kit"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/adonisjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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},"funding":{"github":"thetutlage"}},"created_at":"2023-04-14T05:26:19.000Z","updated_at":"2024-06-19T05:13:07.000Z","dependencies_parsed_at":"2024-03-10T09:41:06.453Z","dependency_job_id":null,"html_url":"https://github.com/adonisjs/pkg-starter-kit","commit_stats":null,"previous_names":["adonisjs/pkg-starter-kit"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adonisjs%2Fpkg-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adonisjs%2Fpkg-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adonisjs%2Fpkg-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adonisjs%2Fpkg-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adonisjs","download_url":"https://codeload.github.com/adonisjs/pkg-starter-kit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224033019,"owners_count":17244520,"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":["starter-kit"],"created_at":"2024-11-11T01:20:39.213Z","updated_at":"2025-04-26T11:33:44.186Z","avatar_url":"https://github.com/adonisjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/thetutlage"],"categories":[],"sub_categories":[],"readme":"# AdonisJS package starter kit\n\n\u003e A boilerplate for creating AdonisJS packages\n\nThis repo provides you with a starting point for creating AdonisJS packages. Of course, you can create a package from scratch with your folder structure and workflow. However, using this starter kit can speed up the process, as you have fewer decisions to make.\n\n## Setup\n\n- Clone the repo on your computer, or use `giget` to download this repo without the Git history.\n  ```sh\n  npx giget@latest gh:adonisjs/pkg-starter-kit\n  ```\n- Install dependencies.\n- Update the `package.json` file and define the `name`, `description`, `keywords`, and `author` properties.\n- The repo is configured with an MIT license. Feel free to change that if you are not publishing under the MIT license.\n\n## Folder structure\n\nThe starter kit mimics the folder structure of the official packages. Feel free to rename files and folders as per your requirements.\n\n```\n├── providers\n├── src\n├── bin\n├── stubs\n├── configure.ts\n├── index.ts\n├── LICENSE.md\n├── package.json\n├── README.md\n├── tsconfig.json\n├── tsnode.esm.js\n```\n\n- The `configure.ts` file exports the `configure` hook to configure the package using the `node ace configure` command.\n- The `index.ts` file is the main entry point of the package.\n- The `tsnode.esm.js` file runs TypeScript code using TS-Node + SWC. Please read the code comment in this file to learn more.\n- The `bin` directory contains the entry point file to run Japa tests.\n- Learn more about [the `providers` directory](./providers/README.md).\n- Learn more about [the `src` directory](./src/README.md).\n- Learn more about [the `stubs` directory](./stubs/README.md).\n\n### File system naming convention\n\nWe use `snake_case` naming conventions for the file system. The rule is enforced using ESLint. However, turn off the rule and use your preferred naming conventions.\n\n## Peer dependencies\n\nThe starter kit has a peer dependency on `@adonisjs/core@6`. Since you are creating a package for AdonisJS, you must make it against a specific version of the framework core.\n\nIf your package needs Lucid to be functional, you may install `@adonisjs/lucid` as a development dependency and add it to the list of `peerDependencies`.\n\nAs a rule of thumb, packages installed in the user application should be part of the `peerDependencies` of your package and not the main dependency.\n\nFor example, if you install `@adonisjs/core` as a main dependency, then essentially, you are importing a separate copy of `@adonisjs/core` and not sharing the one from the user application. Here is a great article explaining [peer dependencies](https://blog.bitsrc.io/understanding-peer-dependencies-in-javascript-dbdb4ab5a7be).\n\n## Published files\n\nInstead of publishing your repo's source code to npm, you must cherry-pick files and folders to publish only the required files.\n\nThe cherry-picking uses the `files` property inside the `package.json` file. By default, we publish the following files and folders.\n\n```json\n{\n  \"files\": [\"build/src\", \"build/providers\", \"build/stubs\", \"build/index.d.ts\", \"build/index.js\"]\n}\n```\n\nIf you create additional folders or files, mention them inside the `files` array.\n\n## Exports\n\n[Node.js Subpath exports](https://nodejs.org/api/packages.html#subpath-exports) allows you to define the exports of your package regardless of the folder structure. This starter kit defines the following exports.\n\n```json\n{\n  \"exports\": {\n    \".\": \"./build/index.js\",\n    \"./types\": \"./build/src/types.js\"\n  }\n}\n```\n\n- The dot `.` export is the main export.\n- The `./types` exports all the types defined inside the `./build/src/types.js` file (the compiled output).\n\nFeel free to change the exports as per your requirements.\n\n## Testing\n\nWe configure the [Japa test runner](https://japa.dev/) with this starter kit. Japa is used in AdonisJS applications as well. Just run one of the following commands to execute tests.\n\n- `npm run test`: This command will first lint the code using ESlint and then run tests and report the test coverage using [c8](https://github.com/bcoe/c8).\n- `npm run quick:test`: Runs only the tests without linting or coverage reporting.\n\nThe starter kit also has a Github workflow file to run tests using Github Actions. The tests are executed against `Node.js 20.x` and `Node.js 21.x` versions on both Linux and Windows. Feel free to edit the workflow file in the `.github/workflows` directory.\n\n## TypeScript workflow\n\n- The starter kit uses [tsc](https://www.typescriptlang.org/docs/handbook/compiler-options.html) for compiling the TypeScript to JavaScript when publishing the package.\n- [TS-Node](https://typestrong.org/ts-node/) and [SWC](https://swc.rs/) are used to run tests without compiling the source code.\n- The `tsconfig.json` file is extended from [`@adonisjs/tsconfig`](https://github.com/adonisjs/tooling-config/tree/main/packages/typescript-config) and uses the `NodeNext` module system. Meaning the packages are written using ES modules.\n- You can perform type checking without compiling the source code using the `npm run type check` script.\n\nFeel free to explore the `tsconfig.json` file for all the configured options.\n\n## ESLint and Prettier setup\n\nThe starter kit configures ESLint and Prettier\nusing our [shared config](https://github.com/adonisjs/tooling-config/tree/main/packages).\nESLint configuration is stored within the `eslint.config.js` file.\nPrettier configuration is stored within the `package.json` file.\nFeel free to change the configuration, use custom plugins, or remove both tools altogether.\n\n## Using Stale bot\n\nThe [Stale bot](https://github.com/apps/stale) is a Github application that automatically marks issues and PRs as stale and closes after a specific duration of inactivity.\n\nFeel free to delete the `.github/stale.yml` and `.github/lock.yml` files if you decide not to use the Stale bot.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadonisjs%2Fpkg-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadonisjs%2Fpkg-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadonisjs%2Fpkg-starter-kit/lists"}