diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index cff22d8..f00b060 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -61,6 +61,5 @@ jobs: - name: Install Playwright Browsers run: pnpm playwright install --with-deps - name: Test - # `|| true`` is necessary for now. It's looks like a bug : lucid seems to always throws an error when exiting + # `|| true`` is necessary for now. It's looks like a bug: lucid seems to always throws an error when exiting run: FORCE_COLOR=1 NODE_ENV=test pnpm test || true - diff --git a/.github/workflows/on-push-to-main.yml b/.github/workflows/on-push-to-main.yml index 6b104c4..6b7a624 100644 --- a/.github/workflows/on-push-to-main.yml +++ b/.github/workflows/on-push-to-main.yml @@ -10,7 +10,7 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - #### Checks jobs / Lint, typecheck, test + #### Checks jobs/Lint, typecheck, test checks: name: Checks uses: ./.github/workflows/checks.yml diff --git a/README.md b/README.md index 7ac0909..c244603 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,17 @@ This is the source code of the [AdonisJS Packages](https://adonisjs.com/packages - [BentoCache](https://bentocache.julr.dev/) - [Japa](https://japa.dev/) -If you are looking for a good starting point to learn AdonisJS, then this repo may be a good starting point for you. It is a simple website, but it covers a lot of concepts like : +If you are looking for a good starting point to learn AdonisJS, then this repo may be a good starting point for you. It is a simple website, but it covers a lot of concepts like: - How we can super easily build a monolithic application using AdonisJS, InertiaJS and VueJS and still have a SPA feeling. No state management, routing, API calls, loading spinners, error management needed front-end side. -- IoC container and Dependency injection using AdonisJS. For example, we leverage them to easily test our controller and comands without having to fetch real data from NPM and Github APIs -- Developping custom commands with pretty prompts and spinners using AdonisJS Ace -- Testing commands, controllers, and service using IoC container, Api Client, and Inertia test helpers +- IoC container and Dependency injection using AdonisJS. For example, we leverage them to easily test our controller and commands without having to fetch real data from npm and GitHub APIs +- Developing custom commands with pretty prompts and spinners using AdonisJS Ace +- Testing commands, controllers, and service using IoC container, API Client, and Inertia test helpers - [End-to-end testing](./tests/browser/) using Playwright -- [Dockerizing the application](./Dockerfile) in order to make it easy to deploy -- Github Actions CI/CD : we use Github Actions to run our [tests, check linting, type checking](.github/workflows/checks.yml) and [build the application image](.github/workflows/on-push-to-main.yml) before deploying it to our server -- Caching using Bentocache : instead of calling the NPM and Github APIs on each request, we use a 2-layer ( Memory + Sqlite ) cache system to store the data and refresh it only when needed. See [./config/cache.ts](./config/cache.ts) for more details. -- How to setup Vite / Eslint ( [Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new) ) / Prettier / Tsconfig +- [Dockerize the application](./Dockerfile) in order to make it easy to deploy +- GitHub Actions CI/CD: we use GitHub Actions to run our [tests, check linting, type checking](.github/workflows/checks.yml) and [build the application image](.github/workflows/on-push-to-main.yml) before deploying it to our server +- Caching using BentoCache: instead of calling the npm and GitHub APIs on each request, we use a 2-layer (Memory + SQLite) cache system to store the data and refresh it only when needed. See [./config/cache.ts](./config/cache.ts) for more details. +- How to setup Vite/ESLint ([Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new))/Prettier/TSconfig - Payload validation using VineJS ## Contributions diff --git a/app/services/package_fetcher.ts b/app/services/package_fetcher.ts index 053d819..b2851f1 100644 --- a/app/services/package_fetcher.ts +++ b/app/services/package_fetcher.ts @@ -1,5 +1,5 @@ /** - * Responsible for fetching package details from NPM and Github + * Responsible for fetching package details from npm and GitHub */ export class PackageFetcher { /** @@ -11,7 +11,7 @@ export class PackageFetcher { } /** - * Fetch given package details from NPM + * Fetch given package details from npm */ async fetchNpmPkg(name: string) { const result = await fetch(`http://registry.npmjs.org/${name}`).then((res) => res.json()) @@ -29,7 +29,7 @@ export class PackageFetcher { } /** - * Fetch github stars from github REST Api + * Fetch github stars from github REST API */ async fetchGithubStars(repo: string) { // See https://github.com/adonisjs/road-to-v6/issues/38 to understand @@ -46,7 +46,7 @@ export class PackageFetcher { /** * Fetch package.json file from github repository - * @param repository Github repository name in format username/repo-name + * @param repository GitHub repository name in format username/repo-name * @param branch Branch to fetch the package.json file from */ fetchGithubPkg(repository: string, branch = 'main') { @@ -56,7 +56,7 @@ export class PackageFetcher { /** * Fetch README.md file from github repository - * @param repository Github repository name in format username/repo-name + * @param repository GitHub repository name in format username/repo-name * @param branch Branch to fetch the README.md file from */ fetchReadme(repository: string, branch = 'main') { diff --git a/app/services/packages_fetcher.ts b/app/services/packages_fetcher.ts index a674251..113608e 100644 --- a/app/services/packages_fetcher.ts +++ b/app/services/packages_fetcher.ts @@ -136,7 +136,7 @@ export class PackagesFetcher { */ async fetchPackages(options: PackagesFilters = {}) { /** - * Get list of packages with their NPM/Github stats + * Get list of packages with their npm/GitHub stats */ const limit = pLimit(10) const categoriesWithCount = this.#getCategories(this.packagesList) diff --git a/commands/add_package.ts b/commands/add_package.ts index a47e4c6..8b9780c 100644 --- a/commands/add_package.ts +++ b/commands/add_package.ts @@ -79,7 +79,7 @@ export default class AddPackage extends BaseCommand { */ async #promptForPackageName(githubPkg: Record) { return await this.prompt.ask( - 'What is the package name ? This name will be displayed on the website.', + 'What is the package name? This name will be displayed on the website.', { name: 'name', hint: 'e.g. AdonisJS Prometheus', @@ -147,7 +147,7 @@ export default class AddPackage extends BaseCommand { this.ui .sticker() - .add('🎊 Package info collected successfully and saved to :') + .add('🎊 Package info collected successfully and saved to:') .add('') .add(this.ui.colors.cyan(`./content/packages/${this.#package.name}.yml`)) .add('') diff --git a/config/cache.ts b/config/cache.ts index a8b2f70..7a72593 100644 --- a/config/cache.ts +++ b/config/cache.ts @@ -12,14 +12,14 @@ const cacheConfig = defineConfig({ earlyExpiration: 0.9, /** - * We gonna wait for 300ms MAX for the Npm/Github API to respond. + * We gonna wait for 300ms MAX for the npm/GitHub API to respond. * Otherwise we gonna fallback to the old value and let the * API respond in the background and update the cache */ timeouts: { soft: '300ms' }, /** - * Cache each response for 1 day. This is okay since NPM / Github + * Cache each response for 1 day. This is okay since npm/GitHub * stats are not something that is absolutely required to be * real-time */ @@ -28,7 +28,7 @@ const cacheConfig = defineConfig({ /** * Grace period is 2 hours. Meaning, we gonna keep serving the * old value for 2 hours, if we are unable to fetch the new - * value from the API ( Rate limit, Github / NPM down etc... ? ) + * value from the API (Rate limit, GitHub/npm down etc...?) */ gracePeriod: { enabled: true, diff --git a/content/categories.ts b/content/categories.ts index 7afe663..bf4bbb9 100644 --- a/content/categories.ts +++ b/content/categories.ts @@ -25,7 +25,7 @@ export const categories = [ color: 'bg-cyan5 group-hover:bg-cyan5', }, { - label: 'Devtools', + label: 'DevTools', icon: 'i-carbon-code', color: 'bg-indigo5 group-hover:bg-indigo5', }, diff --git a/content/packages/adonisjs-crud-generator.yml b/content/packages/adonisjs-crud-generator.yml index 6008583..85fc310 100644 --- a/content/packages/adonisjs-crud-generator.yml +++ b/content/packages/adonisjs-crud-generator.yml @@ -6,7 +6,7 @@ github: https://github.com/Shagital/adonisjs-crud-generator website: https://github.com/Shagital/adonisjs-crud-generator npm: '@shagital/adonisjs-crud-generator' learn_more: '' -category: Devtools +category: DevTools type: 3rd-party maintainers: - name: djunehor diff --git a/content/packages/ally-gitlab.yml b/content/packages/ally-gitlab.yml index 4769fa9..2cafc0d 100644 --- a/content/packages/ally-gitlab.yml +++ b/content/packages/ally-gitlab.yml @@ -1,5 +1,5 @@ name: ally-gitlab -description: A Gitlab driver of AdonisJS Ally +description: A GitLab driver of AdonisJS Ally repo: rubenmoya/adonis-ally-gitlab npm: adonis-ally-gitlab icon: gitlab.png diff --git a/content/packages/autoswagger.yml b/content/packages/autoswagger.yml index 3e2fe7e..68cdf54 100644 --- a/content/packages/autoswagger.yml +++ b/content/packages/autoswagger.yml @@ -6,7 +6,7 @@ icon: swagger.png github: https://github.com/ad-on-is/adonis-autoswagger website: https://github.com/ad-on-is/adonis-autoswagger learn_more: '' -category: Devtools +category: DevTools type: 3rd-party maintainers: - name: ad-on-is diff --git a/content/packages/edge-vscode.yml b/content/packages/edge-vscode.yml index 6224853..8ae174a 100644 --- a/content/packages/edge-vscode.yml +++ b/content/packages/edge-vscode.yml @@ -1,6 +1,6 @@ -name: Edge Vscode -category: Devtools -description: Official Vscode extension for Edge.js +name: Edge VS Code +category: DevTools +description: Official VS Code extension for Edge.js icon: 'edge.jpeg' compatibility: adonis: ^5.0.0 diff --git a/content/packages/eslint.yml b/content/packages/eslint.yml index 2b99f91..0a8ccd0 100644 --- a/content/packages/eslint.yml +++ b/content/packages/eslint.yml @@ -1,12 +1,12 @@ name: eslint -description: ESlint rules for AdonisJs applications and addons +description: ESLint rules for AdonisJs applications and addons repo: adonisjs-community/eslint-plugin-adonis#develop npm: eslint-plugin-adonis icon: eslint.png github: https://github.com/adonisjs-community/eslint-plugin-adonis website: https://github.com/adonisjs-community/eslint-plugin-adonis learn_more: '' -category: Devtools +category: DevTools type: official maintainers: - name: adonisjs-community diff --git a/content/packages/mix-asset.yml b/content/packages/mix-asset.yml index 8408067..ce51c94 100644 --- a/content/packages/mix-asset.yml +++ b/content/packages/mix-asset.yml @@ -6,7 +6,7 @@ icon: mix.png github: https://github.com/wahyubucil/adonis-mix-asset website: https://github.com/wahyubucil/adonis-mix-asset learn_more: '' -category: Devtools +category: DevTools type: 3rd-party maintainers: - name: wahyubucil diff --git a/content/packages/sail.yml b/content/packages/sail.yml index 02de636..c50755d 100644 --- a/content/packages/sail.yml +++ b/content/packages/sail.yml @@ -6,7 +6,7 @@ icon: sail.png github: https://github.com/Julien-R44/adonis-sail website: https://github.com/Julien-R44/adonis-sail learn_more: '' -category: Devtools +category: DevTools type: 3rd-party maintainers: - name: Julien-R44 diff --git a/content/packages/socket.io.yml b/content/packages/socket.io.yml index c237572..02a44c6 100644 --- a/content/packages/socket.io.yml +++ b/content/packages/socket.io.yml @@ -1,5 +1,5 @@ name: socket.io -description: Websocket provider using Socket.io +description: WebSocket provider using Socket.IO repo: ruby184/adonis-socket.io npm: '@ruby184/adonis-socket.io' icon: 'socketio.png' diff --git a/content/packages/swagger.yml b/content/packages/swagger.yml index 21ac125..a20be69 100644 --- a/content/packages/swagger.yml +++ b/content/packages/swagger.yml @@ -6,7 +6,7 @@ icon: swagger.png github: https://github.com/reg2005/adonis5-swagger website: https://github.com/reg2005/adonis5-swagger learn_more: '' -category: Devtools +category: DevTools type: 3rd-party maintainers: - name: reg2005 diff --git a/content/packages/vscode-extension.yml b/content/packages/vscode-extension.yml index 3bf373e..2f9f893 100644 --- a/content/packages/vscode-extension.yml +++ b/content/packages/vscode-extension.yml @@ -6,7 +6,7 @@ github: https://github.com/Julien-R44/adonis-vscode-extension website: >- https://marketplace.visualstudio.com/items?itemName=jripouteau.adonis-vscode-extension learn_more: '' -category: Devtools +category: DevTools type: official maintainers: - name: Julien Ripouteau diff --git a/resources/components/socials.vue b/resources/components/socials.vue index 9aa2c97..5199f42 100644 --- a/resources/components/socials.vue +++ b/resources/components/socials.vue @@ -3,8 +3,8 @@ - - + + diff --git a/resources/pages/package/components/links.vue b/resources/pages/package/components/links.vue index e903412..ff584eb 100644 --- a/resources/pages/package/components/links.vue +++ b/resources/pages/package/components/links.vue @@ -24,7 +24,7 @@ defineProps<{ :href="`https://www.npmjs.com/package/${package.npm}`" > - NPM package + npm package - + diff --git a/tests/functional/commands/add_package.spec.ts b/tests/functional/commands/add_package.spec.ts index d302f54..1a396bd 100644 --- a/tests/functional/commands/add_package.spec.ts +++ b/tests/functional/commands/add_package.spec.ts @@ -15,8 +15,8 @@ function swapPackageFetcher(options: { githubResponse?: any; npmResponse?: any } if (options.githubResponse) return options.githubResponse return { name: 'github-package-name', - description: 'Github package description', - author: { name: 'Github package author' }, + description: 'GitHub package description', + author: { name: 'GitHub package author' }, } } @@ -24,7 +24,7 @@ function swapPackageFetcher(options: { githubResponse?: any; npmResponse?: any } if (options.npmResponse) return options.npmResponse return { time: { created: '2022-01-01', modified: '2023-01-01' }, - description: 'Npm package description', + description: 'npm package description', } } } @@ -57,7 +57,7 @@ test.group('[Commands] Add Package', (group) => { name: 'test-package', github: 'https://github.com/owner/repo/tree/main', website: 'https://github.com/owner/repo/tree/main', - description: 'Github package description', + description: 'GitHub package description', npm: 'github-package-name', compatibility: { adonis: '^5.0.0' }, firstReleaseAt: '2022-01-01', diff --git a/types/packages.ts b/types/packages.ts index 259fb77..00a848d 100644 --- a/types/packages.ts +++ b/types/packages.ts @@ -31,12 +31,12 @@ export type PackageInfo = { description: string /** - * Github repository, formatted as `owner/repo#branch` + * GitHub repository, formatted as `owner/repo#branch` */ repo: string /** - * NPM package name + * npm package name */ npm?: string @@ -47,7 +47,7 @@ export type PackageInfo = { icon?: string /** - * Github repository URL + * GitHub repository URL */ github: string @@ -77,22 +77,22 @@ export type PackageInfo = { keywords?: string[] /** - * Number of stars on Github + * Number of stars on GitHub */ stars: number /** - * Monthly downloads from NPM + * Monthly downloads from npm */ downloads: number /** - * First release date on NPM + * First release date on npm */ firstReleaseAt?: string /** - * Last release date on NPM + * Last release date on npm */ lastReleaseAt?: string }