Skip to content

Commit d790dcd

Browse files
initial
0 parents  commit d790dcd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1328
-0
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# http://editorconfig.org
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.json]
12+
insert_final_newline = ignore
13+
14+
[**.min.js]
15+
indent_style = ignore
16+
insert_final_newline = ignore
17+
18+
[MakeFile]
19+
indent_style = space
20+
21+
[*.md]
22+
trim_trailing_whitespace = false

.github/lock.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
ignoreUnless: { { STALE_BOT } }
3+
---
4+
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
5+
6+
# Number of days of inactivity before a closed issue or pull request is locked
7+
daysUntilLock: 60
8+
9+
# Skip issues and pull requests created before a given timestamp. Timestamp must
10+
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
11+
skipCreatedBefore: false
12+
13+
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
14+
exemptLabels: ['Type: Security']
15+
16+
# Label to add before locking, such as `outdated`. Set to `false` to disable
17+
lockLabel: false
18+
19+
# Comment to post before locking. Set to `false` to disable
20+
lockComment: >
21+
This thread has been automatically locked since there has not been
22+
any recent activity after it was closed. Please open a new issue for
23+
related bugs.
24+
25+
# Assign `resolved` as the reason for locking. Set to `false` to disable
26+
setLockReason: false

.github/stale.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
ignoreUnless: { { STALE_BOT } }
3+
---
4+
# Number of days of inactivity before an issue becomes stale
5+
daysUntilStale: 60
6+
7+
# Number of days of inactivity before a stale issue is closed
8+
daysUntilClose: 7
9+
10+
# Issues with these labels will never be considered stale
11+
exemptLabels:
12+
- 'Type: Security'
13+
14+
# Label to use when marking an issue as stale
15+
staleLabel: 'Status: Abandoned'
16+
17+
# Comment to post when marking an issue as stale. Set to `false` to disable
18+
markComment: >
19+
This issue has been automatically marked as stale because it has not had
20+
recent activity. It will be closed if no further activity occurs. Thank you
21+
for your contributions.
22+
23+
# Comment to post when closing a stale issue. Set to `false` to disable
24+
closeComment: false

.github/workflows/test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: test
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
typecheck:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Install
13+
run: npm install
14+
- name: Run typecheck
15+
run: npm run typecheck
16+
17+
tests:
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
os: [ubuntu-latest, windows-latest]
22+
node-version:
23+
- 20.10.0
24+
- 21.x
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v1
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
- name: Install
32+
run: npm install
33+
- name: Run tests
34+
run: npm test
35+
windows:
36+
runs-on: windows-latest
37+
strategy:
38+
matrix:
39+
node-version:
40+
- 20.10.0
41+
- 21.x
42+
steps:
43+
- uses: actions/checkout@v2
44+
- name: Use Node.js ${{ matrix.node-version }}
45+
uses: actions/setup-node@v1
46+
with:
47+
node-version: ${{ matrix.node-version }}
48+
- name: Install
49+
run: npm install
50+
- name: Run tests
51+
run: npm test

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules
2+
coverage
3+
.DS_STORE
4+
.nyc_output
5+
.idea
6+
.vscode/
7+
*.sublime-project
8+
*.sublime-workspace
9+
*.log
10+
build
11+
dist
12+
yarn.lock
13+
shrinkwrap.yaml
14+
package-lock.json

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
docs
3+
coverage
4+
*.html

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# The MIT License
2+
3+
Copyright (c) 2023
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# AdonisJS Modules
2+
3+
This package provides a module-based architecture for AdonisJS, inspired by the popular Laravel modules package. It enables developers to structure their AdonisJS applications using a modular approach, organizing features into individual modules.
4+
5+
## Installation
6+
7+
To install the package, run the following command:
8+
9+
```bash
10+
npm install adonisjs-modules
11+
```
12+
13+
## Configuration
14+
15+
After installing the package, configure it by running:
16+
17+
```bash
18+
node ace configure adonisjs-modules
19+
```
20+
21+
This will set up the necessary files and make the commands available to you.
22+
23+
## Creating a Module
24+
25+
To create a new module, run:
26+
27+
```bash
28+
node ace module:make <module_name>
29+
```
30+
31+
Replace `<module_name>` with the actual name of the module you want to create.
32+
33+
## Using a Module
34+
35+
If you want to set a module as the default module, run:
36+
37+
```bash
38+
node ace module:use <module_name>
39+
```
40+
41+
If you don’t set a default module, you will be required to pass the `--module=<module_name>` flag with each command you execute.
42+
43+
## Available Commands
44+
45+
Once the package is configured, you can use the following commands to generate various module components. To see the list of available commands, run:
46+
47+
```bash
48+
node ace module:make <component> [--module=<module_name>]
49+
```
50+
51+
Where `<component>` can be one of the following:
52+
53+
To see the full list you should run
54+
```bash
55+
node ace list module
56+
```
57+
58+
### Example
59+
60+
To create a new controller inside a specific module:
61+
62+
```bash
63+
node ace module:make-controller user --module=blog
64+
```
65+
66+
If you have already set `blog` as the default module, you can simply run:
67+
68+
```bash
69+
node ace module:make-controller user
70+
```
71+
72+
## Inspired by Laravel Modules
73+
74+
This package is inspired by the [Laravel Modules package](https://github.com/nWidart/laravel-modules), which offers a similar approach for structuring Laravel applications.
75+
76+
## Like the Package? Star It! ⭐
77+
78+
If you find this package useful, please consider giving it a star on GitHub. It helps others discover it and motivates continued development.

bin/test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { assert } from '@japa/assert'
2+
import { configure, processCLIArgs, run } from '@japa/runner'
3+
4+
processCLIArgs(process.argv.splice(2))
5+
6+
configure({
7+
files: ['tests/**/*.spec.ts'],
8+
plugins: [assert()],
9+
})
10+
11+
run()

0 commit comments

Comments
 (0)