Skip to content

Commit

Permalink
chore: fix case and space before and after ponctuation (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Ripouteau <[email protected]>
  • Loading branch information
Barbapapazes and Julien-R44 authored Dec 30, 2023
1 parent c92756f commit 412f344
Show file tree
Hide file tree
Showing 22 changed files with 51 additions and 51 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion .github/workflows/on-push-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions app/services/package_fetcher.ts
Original file line number Diff line number Diff line change
@@ -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 {
/**
Expand All @@ -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())
Expand All @@ -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
Expand All @@ -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') {
Expand All @@ -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') {
Expand Down
2 changes: 1 addition & 1 deletion app/services/packages_fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions commands/add_package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class AddPackage extends BaseCommand {
*/
async #promptForPackageName(githubPkg: Record<string, any>) {
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',
Expand Down Expand Up @@ -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('')
Expand Down
6 changes: 3 additions & 3 deletions config/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion content/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
2 changes: 1 addition & 1 deletion content/packages/adonisjs-crud-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/packages/ally-gitlab.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/packages/autoswagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions content/packages/edge-vscode.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions content/packages/eslint.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/packages/mix-asset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/packages/sail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/packages/socket.io.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion content/packages/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/packages/vscode-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions resources/components/socials.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<a href="https://twitter.com/adonisframework" aria-label="Twitter">
<i class="i-fa6-brands-x-twitter inline-block" aria-label="Twitter Icon" />
</a>
<a href="https://github.com/adonisjs" aria-label="Github">
<i class="i-fa6-brands-github inline-block" aria-label="Github Icon" />
<a href="https://github.com/adonisjs" aria-label="GitHub">
<i class="i-fa6-brands-github inline-block" aria-label="GitHub Icon" />
</a>
<a href="https://discord.gg/vDcEjq6" aria-label="Discord">
<i class="i-fa6-brands-discord inline-block" aria-label="Discord Icon" />
Expand Down
5 changes: 3 additions & 2 deletions resources/pages/package/components/links.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defineProps<{
:href="`https://www.npmjs.com/package/${package.npm}`"
>
<i class="i-mdi-npm-variant-outline inline-block" />
<span>NPM package</span>
<span>npm package</span>
</a>
<a
v-if="package.website"
Expand All @@ -38,4 +38,5 @@ defineProps<{
</div>
</template>

<style scoped></style>
<style scoped>

Check warning on line 41 in resources/pages/package/components/links.vue

View workflow job for this annotation

GitHub Actions / Checks / lint

Delete `⏎`
</style>
8 changes: 4 additions & 4 deletions tests/functional/commands/add_package.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ 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' },
}
}

async fetchNpmPkg() {
if (options.npmResponse) return options.npmResponse
return {
time: { created: '2022-01-01', modified: '2023-01-01' },
description: 'Npm package description',
description: 'npm package description',
}
}
}
Expand Down Expand Up @@ -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',
Expand Down
14 changes: 7 additions & 7 deletions types/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**

Check failure on line 38 in types/packages.ts

View workflow job for this annotation

GitHub Actions / Checks / lint

Comments should not begin with a lowercase character
* NPM package name
* npm package name
*/
npm?: string

Expand All @@ -47,7 +47,7 @@ export type PackageInfo = {
icon?: string

/**
* Github repository URL
* GitHub repository URL
*/
github: string

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 412f344

Please sign in to comment.