adonis-atlas 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -69
- package/build/configure.d.ts +2 -0
- package/build/configure.js +25 -15
- package/build/index.d.ts +10 -0
- package/build/index.js +10 -28
- package/build/src/atlas.d.ts +7 -0
- package/build/src/atlas.js +10 -0
- package/build/src/atlas.js.map +1 -0
- package/build/src/client/app.d.ts +1 -0
- package/build/src/client/app.js +13 -0
- package/build/src/client/app.js.map +1 -0
- package/build/src/client/boot.d.ts +1 -0
- package/build/src/client/boot.js +16 -0
- package/build/src/client/boot.js.map +1 -0
- package/build/src/commands/commands.json +27 -0
- package/build/src/commands/main.d.ts +4 -0
- package/build/src/commands/main.js +20 -0
- package/build/src/commands/main.js.map +1 -0
- package/build/src/commands/make_resource.d.ts +9 -0
- package/build/src/commands/make_resource.js +29 -0
- package/build/src/commands/make_resource.js.map +1 -0
- package/build/src/define_config.d.ts +2 -0
- package/build/src/define_config.js +4 -0
- package/build/src/define_config.js.map +1 -0
- package/build/src/fields/boolean.d.ts +4 -0
- package/build/src/fields/boolean.js +5 -0
- package/build/src/fields/boolean.js.map +1 -0
- package/build/src/fields/date_time.d.ts +4 -0
- package/build/src/fields/date_time.js +5 -0
- package/build/src/fields/date_time.js.map +1 -0
- package/build/src/fields/email.d.ts +5 -0
- package/build/src/fields/email.js +9 -0
- package/build/src/fields/email.js.map +1 -0
- package/build/src/fields/field.d.ts +20 -0
- package/build/src/fields/field.js +57 -0
- package/build/src/fields/field.js.map +1 -0
- package/build/src/fields/index.d.ts +7 -0
- package/build/src/fields/index.js +8 -0
- package/build/src/fields/index.js.map +1 -0
- package/build/src/fields/number.d.ts +4 -0
- package/build/src/fields/number.js +5 -0
- package/build/src/fields/number.js.map +1 -0
- package/build/src/fields/password.d.ts +5 -0
- package/build/src/fields/password.js +8 -0
- package/build/src/fields/password.js.map +1 -0
- package/build/src/fields/text.d.ts +4 -0
- package/build/src/fields/text.js +5 -0
- package/build/src/fields/text.js.map +1 -0
- package/build/src/http/controllers/resource_controller.d.ts +16 -0
- package/build/src/http/controllers/resource_controller.js +284 -0
- package/build/src/http/controllers/resource_controller.js.map +1 -0
- package/build/src/http/register_routes.d.ts +2 -0
- package/build/src/http/register_routes.js +27 -0
- package/build/src/http/register_routes.js.map +1 -0
- package/build/src/http/resource_query_builder.d.ts +21 -0
- package/build/src/http/resource_query_builder.js +45 -0
- package/build/src/http/resource_query_builder.js.map +1 -0
- package/build/src/http/validate_resource.d.ts +3 -0
- package/build/src/http/validate_resource.js +29 -0
- package/build/src/http/validate_resource.js.map +1 -0
- package/build/src/providers/atlas_provider.d.ts +7 -0
- package/build/src/providers/atlas_provider.js +26 -0
- package/build/src/providers/atlas_provider.js.map +1 -0
- package/build/src/resource.d.ts +19 -0
- package/build/src/resource.js +19 -0
- package/build/src/resource.js.map +1 -0
- package/build/src/resource_registry.d.ts +7 -0
- package/build/src/resource_registry.js +13 -0
- package/build/src/resource_registry.js.map +1 -0
- package/build/src/types.d.ts +12 -0
- package/build/src/types.js +2 -0
- package/build/src/types.js.map +1 -0
- package/build/stubs/main.d.ts +1 -0
- package/build/stubs/main.js +3 -0
- package/build/stubs/main.js.map +1 -0
- package/package.json +21 -11
- package/build/chunk-7QVYU63E.js +0 -7
- package/build/chunk-7QVYU63E.js.map +0 -1
- package/build/client/app.js +0 -20
- package/build/client/app.js.map +0 -1
- package/build/client/boot.js +0 -23
- package/build/client/boot.js.map +0 -1
- package/build/commands/main.js +0 -9
- package/build/commands/main.js.map +0 -1
- package/build/commands/make_resource.js +0 -42
- package/build/commands/make_resource.js.map +0 -1
- package/build/configure.js.map +0 -1
- package/build/index.js.map +0 -1
- package/build/providers/atlas_provider.js +0 -56
- package/build/providers/atlas_provider.js.map +0 -1
- package/stubs/config.stub +0 -18
- package/stubs/main.ts +0 -3
- package/stubs/resource.stub +0 -25
- /package/build/{client → src/client}/resources/components/DataTable.vue +0 -0
- /package/build/{client → src/client}/resources/components/FormField.vue +0 -0
- /package/build/{client → src/client}/resources/components/Layout.vue +0 -0
- /package/build/{client → src/client}/resources/components/Pagination.vue +0 -0
- /package/build/{client → src/client}/resources/components/SearchBar.vue +0 -0
- /package/build/{client → src/client}/resources/components/fields/BooleanField.vue +0 -0
- /package/build/{client → src/client}/resources/components/fields/DateTimeField.vue +0 -0
- /package/build/{client → src/client}/resources/components/fields/EmailField.vue +0 -0
- /package/build/{client → src/client}/resources/components/fields/NumberField.vue +0 -0
- /package/build/{client → src/client}/resources/components/fields/PasswordField.vue +0 -0
- /package/build/{client → src/client}/resources/components/fields/TextField.vue +0 -0
- /package/build/{client → src/client}/resources/css/atlas.css +0 -0
- /package/build/{client → src/client}/resources/pages/atlas/Create.vue +0 -0
- /package/build/{client → src/client}/resources/pages/atlas/Edit.vue +0 -0
- /package/build/{client → src/client}/resources/pages/atlas/Index.vue +0 -0
package/README.md
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
# Adonis Atlas
|
|
2
2
|
|
|
3
|
-
A modern
|
|
3
|
+
A modern admin panel for AdonisJS 6. Built with Vue 3, Inertia.js, and custom CSS — no Tailwind required.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- 🚀 **Zero-Config Frontend
|
|
8
|
-
- 🌑 **Dark
|
|
9
|
-
- 🛠 **Resource Generator
|
|
10
|
-
- ⚡️ **Powered
|
|
11
|
-
- 🔌 **
|
|
7
|
+
- 🚀 **Zero-Config Frontend** — Ships a pre-built UI, no Vue boilerplate needed
|
|
8
|
+
- 🌑 **Dark Theme** — Beautiful dark mode by default
|
|
9
|
+
- 🛠 **Resource Generator** — `node ace make:atlas:resource User` scaffolds CRUD instantly
|
|
10
|
+
- ⚡️ **Inertia Powered** — SPA-like experience without the complexity
|
|
11
|
+
- 🔌 **Configurable** — Mount at `/atlas`, `/admin`, or anywhere you like
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
### 1. Install
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
18
|
pnpm add adonis-atlas
|
|
17
|
-
|
|
19
|
+
|
|
20
|
+
# Peer dependencies
|
|
21
|
+
pnpm add vue @inertiajs/vue3
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. Configure
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
node ace configure adonis-atlas
|
|
18
28
|
```
|
|
19
29
|
|
|
20
|
-
|
|
30
|
+
This automatically:
|
|
31
|
+
- Registers the provider and commands in `adonisrc.ts`
|
|
32
|
+
- Creates `config/atlas.ts` with default settings
|
|
21
33
|
|
|
22
|
-
###
|
|
34
|
+
### 3. Set Up Vite
|
|
23
35
|
|
|
24
|
-
Atlas
|
|
25
|
-
Update your `vite.config.ts`:
|
|
36
|
+
Atlas ships a pre-built frontend entry point. Update your `vite.config.ts`:
|
|
26
37
|
|
|
27
38
|
```typescript
|
|
28
39
|
import { defineConfig } from 'vite'
|
|
@@ -31,78 +42,35 @@ import adonisjs from '@adonisjs/vite/client'
|
|
|
31
42
|
export default defineConfig({
|
|
32
43
|
plugins: [
|
|
33
44
|
adonisjs({
|
|
34
|
-
/**
|
|
35
|
-
* Use the Atlas boot file as your entry point
|
|
36
|
-
*/
|
|
37
45
|
entrypoints: ['adonis-atlas/boot'],
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Reload on Edge template changes
|
|
41
|
-
*/
|
|
42
46
|
reload: ['resources/views/**/*.edge'],
|
|
43
47
|
}),
|
|
44
48
|
],
|
|
45
49
|
})
|
|
46
50
|
```
|
|
47
51
|
|
|
48
|
-
###
|
|
49
|
-
|
|
50
|
-
By default, Atlas **automatically registers its routes** during the boot process. You don't have to do anything!
|
|
51
|
-
|
|
52
|
-
Default paths:
|
|
53
|
-
- Dashboard: `/atlas/*`
|
|
54
|
-
- API: `/atlas/api/*`
|
|
52
|
+
### 4. Configure Shield
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
If you want to change the prefix, update your `config/atlas.ts` (created during `node ace configure adonis-atlas`):
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
export default defineConfig({
|
|
61
|
-
prefix: '/admin',
|
|
62
|
-
})
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
#### Manual Registration (Optional)
|
|
66
|
-
If you need full control (e.g. adding custom middleware), disable auto-mounting in `config/atlas.ts`:
|
|
67
|
-
|
|
68
|
-
```typescript
|
|
69
|
-
export default defineConfig({
|
|
70
|
-
mountRoutes: false,
|
|
71
|
-
})
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Then register them manually in `start/routes.ts`:
|
|
75
|
-
|
|
76
|
-
```typescript
|
|
77
|
-
import { registerAtlasRoutes } from 'adonis-atlas'
|
|
78
|
-
|
|
79
|
-
registerAtlasRoutes('/custom-admin')
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### 3. Configure Shield (Security)
|
|
83
|
-
|
|
84
|
-
Since Atlas uses its own API endpoints, you need to exclude them from CSRF protection in `config/shield.ts`.
|
|
54
|
+
If you use `@adonisjs/shield`, exclude Atlas API routes from CSRF protection in `config/shield.ts`:
|
|
85
55
|
|
|
86
56
|
```typescript
|
|
87
57
|
export const csrf = {
|
|
88
58
|
enabled: true,
|
|
89
|
-
exceptRoutes: (ctx) =>
|
|
90
|
-
// Exclude Atlas API routes
|
|
91
|
-
return ctx.request.url().includes('/api/')
|
|
92
|
-
},
|
|
59
|
+
exceptRoutes: (ctx) => ctx.request.url().startsWith('/atlas/api/'),
|
|
93
60
|
enableXsrfCookie: true,
|
|
94
61
|
methods: ['POST', 'PUT', 'PATCH', 'DELETE'],
|
|
95
62
|
}
|
|
96
63
|
```
|
|
97
64
|
|
|
98
|
-
|
|
65
|
+
### 5. Create a Resource
|
|
99
66
|
|
|
100
|
-
|
|
67
|
+
```bash
|
|
68
|
+
node ace make:atlas:resource User
|
|
69
|
+
```
|
|
101
70
|
|
|
102
|
-
|
|
71
|
+
This generates `app/atlas/resources/user_resource.ts`. Define your fields:
|
|
103
72
|
|
|
104
73
|
```typescript
|
|
105
|
-
// app/atlas/resources/user_resource.ts
|
|
106
74
|
import { Resource } from 'adonis-atlas'
|
|
107
75
|
import { TextField, EmailField, DateTimeField } from 'adonis-atlas'
|
|
108
76
|
import User from '#models/user'
|
|
@@ -114,16 +82,16 @@ export default class UserResource extends Resource {
|
|
|
114
82
|
fields() {
|
|
115
83
|
return [
|
|
116
84
|
TextField.make('id').sortable(),
|
|
117
|
-
|
|
85
|
+
|
|
118
86
|
TextField.make('fullName')
|
|
119
87
|
.label('Full Name')
|
|
120
88
|
.sortable()
|
|
121
89
|
.rules('required', 'max:255'),
|
|
122
|
-
|
|
90
|
+
|
|
123
91
|
EmailField.make('email')
|
|
124
92
|
.sortable()
|
|
125
93
|
.rules('required', 'email'),
|
|
126
|
-
|
|
94
|
+
|
|
127
95
|
DateTimeField.make('createdAt')
|
|
128
96
|
.label('Joined')
|
|
129
97
|
.sortable(),
|
|
@@ -132,19 +100,68 @@ export default class UserResource extends Resource {
|
|
|
132
100
|
}
|
|
133
101
|
```
|
|
134
102
|
|
|
135
|
-
###
|
|
103
|
+
### 6. Register the Resource
|
|
136
104
|
|
|
137
|
-
Register
|
|
105
|
+
Register resources in a preload file or service provider:
|
|
138
106
|
|
|
139
107
|
```typescript
|
|
140
108
|
import app from '@adonisjs/core/services/app'
|
|
141
|
-
import { ResourceRegistry } from 'adonis-atlas'
|
|
142
109
|
import UserResource from '#app/atlas/resources/user_resource'
|
|
143
110
|
|
|
144
111
|
const registry = await app.container.make('atlas.registry')
|
|
145
112
|
registry.register('user', UserResource)
|
|
146
113
|
```
|
|
147
114
|
|
|
115
|
+
That's it! Visit `/atlas/user` to see your admin panel.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
The `config/atlas.ts` file controls Atlas behavior:
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
import { defineConfig } from 'adonis-atlas'
|
|
125
|
+
|
|
126
|
+
export default defineConfig({
|
|
127
|
+
// Route prefix (default: '/atlas')
|
|
128
|
+
prefix: '/atlas',
|
|
129
|
+
|
|
130
|
+
// Auto-mount routes via provider (default: true)
|
|
131
|
+
mountRoutes: true,
|
|
132
|
+
})
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Manual Route Registration
|
|
136
|
+
|
|
137
|
+
If you need full control (e.g. adding middleware), disable auto-mounting:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
// config/atlas.ts
|
|
141
|
+
export default defineConfig({
|
|
142
|
+
mountRoutes: false,
|
|
143
|
+
})
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Then register manually in `start/routes.ts`:
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
import { registerAtlasRoutes } from 'adonis-atlas'
|
|
150
|
+
|
|
151
|
+
registerAtlasRoutes('/custom-admin')
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Available Fields
|
|
155
|
+
|
|
156
|
+
| Field | Description |
|
|
157
|
+
|-------|-------------|
|
|
158
|
+
| `TextField` | Standard text input |
|
|
159
|
+
| `EmailField` | Email input with validation |
|
|
160
|
+
| `NumberField` | Numeric input |
|
|
161
|
+
| `BooleanField` | Toggle/checkbox |
|
|
162
|
+
| `PasswordField` | Password input (hidden in index) |
|
|
163
|
+
| `DateTimeField` | Date/time display and input |
|
|
164
|
+
|
|
148
165
|
## License
|
|
149
166
|
|
|
150
167
|
MIT
|
package/build/configure.js
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { stubsRoot } from './stubs/main.js';
|
|
2
|
+
export async function configure(command) {
|
|
3
|
+
const codemods = await command.createCodemods();
|
|
4
|
+
await codemods.updateRcFile((rc) => {
|
|
5
|
+
rc.addProvider('adonis-atlas/atlas_provider');
|
|
6
|
+
rc.addCommand('adonis-atlas/commands');
|
|
7
|
+
});
|
|
8
|
+
await codemods.makeUsingStub(stubsRoot, 'config.stub', {});
|
|
9
|
+
command.logger.log('');
|
|
10
|
+
command.logger.log(command.colors.cyan('╭────────────────────────────────────────────╮'));
|
|
11
|
+
command.logger.log(command.colors.cyan('│') + command.colors.bold(' Next steps ') + command.colors.cyan('│'));
|
|
12
|
+
command.logger.log(command.colors.cyan('├────────────────────────────────────────────┤'));
|
|
13
|
+
command.logger.log(command.colors.cyan('│') + ' ' + command.colors.cyan('│'));
|
|
14
|
+
command.logger.log(command.colors.cyan('│') + ' 1. Update ' + command.colors.yellow('vite.config.ts') + ' entrypoints: ' + command.colors.cyan('│'));
|
|
15
|
+
command.logger.log(command.colors.cyan('│') + ' ' + command.colors.cyan('│'));
|
|
16
|
+
command.logger.log(command.colors.cyan('│') + command.colors.dim(' entrypoints: [\'adonis-atlas/boot\']') + ' ' + command.colors.cyan('│'));
|
|
17
|
+
command.logger.log(command.colors.cyan('│') + ' ' + command.colors.cyan('│'));
|
|
18
|
+
command.logger.log(command.colors.cyan('│') + ' 2. Exclude Atlas API from CSRF in ' + command.colors.cyan('│'));
|
|
19
|
+
command.logger.log(command.colors.cyan('│') + ' ' + command.colors.yellow('config/shield.ts') + ': ' + command.colors.cyan('│'));
|
|
20
|
+
command.logger.log(command.colors.cyan('│') + ' ' + command.colors.cyan('│'));
|
|
21
|
+
command.logger.log(command.colors.cyan('│') + command.colors.dim(' exceptRoutes: (ctx) =>') + ' ' + command.colors.cyan('│'));
|
|
22
|
+
command.logger.log(command.colors.cyan('│') + command.colors.dim(' ctx.request.url().includes(\'/api/\')') + ' ' + command.colors.cyan('│'));
|
|
23
|
+
command.logger.log(command.colors.cyan('│') + ' ' + command.colors.cyan('│'));
|
|
24
|
+
command.logger.log(command.colors.cyan('╰────────────────────────────────────────────╯'));
|
|
25
|
+
command.logger.log('');
|
|
12
26
|
}
|
|
13
|
-
__name(configure, "configure");
|
|
14
|
-
export {
|
|
15
|
-
configure
|
|
16
|
-
};
|
|
17
27
|
//# sourceMappingURL=configure.js.map
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import './src/types.js';
|
|
2
|
+
export { Atlas } from './src/atlas.js';
|
|
3
|
+
export { Resource } from './src/resource.js';
|
|
4
|
+
export { ResourceRegistry } from './src/resource_registry.js';
|
|
5
|
+
export * from './src/fields/index.js';
|
|
6
|
+
export { registerAtlasRoutes } from './src/http/register_routes.js';
|
|
7
|
+
export * from './src/http/resource_query_builder.js';
|
|
8
|
+
export { defineConfig } from './src/define_config.js';
|
|
9
|
+
export { configure } from './configure.js';
|
|
10
|
+
export { stubsRoot } from './stubs/main.js';
|
package/build/index.js
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
} from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
export * from "./src/http/resource_query_builder.js";
|
|
12
|
-
import { default as default2 } from "./commands/make_resource.js";
|
|
13
|
-
import { default as default3 } from "./providers/atlas_provider.js";
|
|
14
|
-
import { configure } from "./configure.js";
|
|
15
|
-
function defineConfig(config) {
|
|
16
|
-
return config;
|
|
17
|
-
}
|
|
18
|
-
__name(defineConfig, "defineConfig");
|
|
19
|
-
export {
|
|
20
|
-
Atlas,
|
|
21
|
-
default3 as AtlasProvider,
|
|
22
|
-
default2 as MakeResource,
|
|
23
|
-
Resource,
|
|
24
|
-
ResourceRegistry,
|
|
25
|
-
configure,
|
|
26
|
-
defineConfig,
|
|
27
|
-
registerAtlasRoutes
|
|
28
|
-
};
|
|
1
|
+
import './src/types.js';
|
|
2
|
+
export { Atlas } from './src/atlas.js';
|
|
3
|
+
export { Resource } from './src/resource.js';
|
|
4
|
+
export { ResourceRegistry } from './src/resource_registry.js';
|
|
5
|
+
export * from './src/fields/index.js';
|
|
6
|
+
export { registerAtlasRoutes } from './src/http/register_routes.js';
|
|
7
|
+
export * from './src/http/resource_query_builder.js';
|
|
8
|
+
export { defineConfig } from './src/define_config.js';
|
|
9
|
+
export { configure } from './configure.js';
|
|
10
|
+
export { stubsRoot } from './stubs/main.js';
|
|
29
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ApplicationService } from '@adonisjs/core/types';
|
|
2
|
+
import { ResourceRegistry } from './resource_registry.js';
|
|
3
|
+
export declare class Atlas {
|
|
4
|
+
protected app: ApplicationService;
|
|
5
|
+
constructor(app: ApplicationService);
|
|
6
|
+
registry(): Promise<ResourceRegistry>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas.js","sourceRoot":"","sources":["../../src/atlas.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,KAAK;IACM;IAAtB,YAAsB,GAAuB;QAAvB,QAAG,GAAH,GAAG,CAAoB;IAAI,CAAC;IAKlD,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAA8B,CAAA;IAC/E,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveAtlasPage(name: string): Promise<unknown>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const atlasPages = {
|
|
2
|
+
'atlas/Index': () => import('./resources/pages/atlas/Index.vue'),
|
|
3
|
+
'atlas/Create': () => import('./resources/pages/atlas/Create.vue'),
|
|
4
|
+
'atlas/Edit': () => import('./resources/pages/atlas/Edit.vue'),
|
|
5
|
+
};
|
|
6
|
+
export function resolveAtlasPage(name) {
|
|
7
|
+
const loader = atlasPages[name];
|
|
8
|
+
if (!loader) {
|
|
9
|
+
throw new Error(`Atlas page not found: ${name}. Available: ${Object.keys(atlasPages).join(', ')}`);
|
|
10
|
+
}
|
|
11
|
+
return loader();
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/client/app.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,GAA2C;IACzD,aAAa,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,mCAAmC,CAAC;IAChE,cAAc,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,oCAAoC,CAAC;IAClE,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,kCAAkC,CAAC;CAC/D,CAAA;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;IAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,yBAAyB,IAAI,gBAAgB,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClF,CAAA;IACH,CAAC;IACD,OAAO,MAAM,EAAE,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './resources/css/atlas.css';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './resources/css/atlas.css';
|
|
2
|
+
import { createApp, h } from 'vue';
|
|
3
|
+
import { createInertiaApp } from '@inertiajs/vue3';
|
|
4
|
+
import { resolveAtlasPage } from './app.js';
|
|
5
|
+
const appName = import.meta.env.VITE_APP_NAME || 'Adonis Atlas';
|
|
6
|
+
createInertiaApp({
|
|
7
|
+
progress: { color: '#5468FF' },
|
|
8
|
+
title: (title) => `${title} - ${appName}`,
|
|
9
|
+
resolve: (name) => resolveAtlasPage(name),
|
|
10
|
+
setup({ el, App, props, plugin }) {
|
|
11
|
+
createApp({ render: () => h(App, props) })
|
|
12
|
+
.use(plugin)
|
|
13
|
+
.mount(el);
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=boot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../../src/client/boot.ts"],"names":[],"mappings":"AAKA,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE3C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,IAAI,cAAc,CAAA;AAE/D,gBAAgB,CAAC;IACf,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;IAE9B,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,KAAK,MAAM,OAAO,EAAE;IAIjD,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC;IAEjD,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAsD;QAClF,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC;aACvC,GAAG,CAAC,MAAM,CAAC;aACX,KAAK,CAAC,EAAE,CAAC,CAAA;IACd,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": [
|
|
3
|
+
{
|
|
4
|
+
"commandName": "make:atlas:resource",
|
|
5
|
+
"description": "Create a new Atlas resource class",
|
|
6
|
+
"help": "",
|
|
7
|
+
"namespace": "make",
|
|
8
|
+
"aliases": [],
|
|
9
|
+
"flags": [],
|
|
10
|
+
"args": [
|
|
11
|
+
{
|
|
12
|
+
"name": "name",
|
|
13
|
+
"argumentName": "name",
|
|
14
|
+
"required": true,
|
|
15
|
+
"description": "The name of the resource (e.g. User)",
|
|
16
|
+
"type": "string"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"options": {
|
|
20
|
+
"startApp": true,
|
|
21
|
+
"allowUnknownFlags": true
|
|
22
|
+
},
|
|
23
|
+
"filePath": "make_resource.js"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"version": 1
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
let commandsMetaData;
|
|
3
|
+
export async function getMetaData() {
|
|
4
|
+
if (commandsMetaData) {
|
|
5
|
+
return commandsMetaData;
|
|
6
|
+
}
|
|
7
|
+
const commandsIndex = await readFile(new URL('./commands.json', import.meta.url), 'utf-8');
|
|
8
|
+
commandsMetaData = JSON.parse(commandsIndex).commands;
|
|
9
|
+
return commandsMetaData;
|
|
10
|
+
}
|
|
11
|
+
export async function getCommand(metaData) {
|
|
12
|
+
const commands = await getMetaData();
|
|
13
|
+
const command = commands.find(({ commandName }) => metaData.commandName === commandName);
|
|
14
|
+
if (!command) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const { default: commandConstructor } = await import(new URL(command.filePath, import.meta.url).href);
|
|
18
|
+
return commandConstructor;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/commands/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,IAAI,gBAAqB,CAAA;AAKzB,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,IAAI,gBAAgB,EAAE,CAAC;QACrB,OAAO,gBAAgB,CAAA;IACzB,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,QAAQ,CAClC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAC3C,OAAO,CACR,CAAA;IACD,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAA;IAErD,OAAO,gBAAgB,CAAA;AACzB,CAAC;AAKD,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAiC;IAChE,MAAM,QAAQ,GAAG,MAAM,WAAW,EAAE,CAAA;IACpC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAC3B,CAAC,EAAE,WAAW,EAA2B,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,KAAK,WAAW,CACnF,CAAA;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAClD,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAChD,CAAA;IACD,OAAO,kBAAkB,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '@adonisjs/core/ace';
|
|
2
|
+
import { CommandOptions } from '@adonisjs/core/types/ace';
|
|
3
|
+
export default class MakeResource extends BaseCommand {
|
|
4
|
+
static commandName: string;
|
|
5
|
+
static description: string;
|
|
6
|
+
name: string;
|
|
7
|
+
static options: CommandOptions;
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { BaseCommand, args } from '@adonisjs/core/ace';
|
|
11
|
+
import { stubsRoot } from '../../stubs/main.js';
|
|
12
|
+
export default class MakeResource extends BaseCommand {
|
|
13
|
+
static commandName = 'make:atlas:resource';
|
|
14
|
+
static description = 'Create a new Atlas resource class';
|
|
15
|
+
static options = {
|
|
16
|
+
startApp: true,
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
const codemods = await this.createCodemods();
|
|
20
|
+
await codemods.makeUsingStub(stubsRoot, 'resource.stub', {
|
|
21
|
+
name: this.name,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
__decorate([
|
|
26
|
+
args.string({ description: 'The name of the resource (e.g. User)' }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], MakeResource.prototype, "name", void 0);
|
|
29
|
+
//# sourceMappingURL=make_resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"make_resource.js","sourceRoot":"","sources":["../../../src/commands/make_resource.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW;IACnD,MAAM,CAAC,WAAW,GAAG,qBAAqB,CAAA;IAC1C,MAAM,CAAC,WAAW,GAAG,mCAAmC,CAAA;IAKxD,MAAM,CAAC,OAAO,GAAmB;QAC/B,QAAQ,EAAE,IAAI;KACf,CAAA;IAED,KAAK,CAAC,GAAG;QACP,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAA;QAE5C,MAAM,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,eAAe,EAAE;YACvD,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAA;IACJ,CAAC;;AAZO;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;;0CACjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define_config.js","sourceRoot":"","sources":["../../src/define_config.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,YAAY,CAAC,MAAmB;IAC9C,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src/fields/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,OAAO,OAAQ,SAAQ,KAAK;IACzB,SAAS,GAAG,cAAc,CAAA;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date_time.js","sourceRoot":"","sources":["../../../src/fields/date_time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,OAAO,QAAS,SAAQ,KAAK;IAC1B,SAAS,GAAG,eAAe,CAAA;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../src/fields/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,OAAO,KAAM,SAAQ,IAAI;IACtB,SAAS,GAAG,YAAY,CAAA;IAE/B,YAAY,IAAY,EAAE,KAAc;QACtC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LucidRow } from '@adonisjs/lucid/types/model';
|
|
2
|
+
export declare abstract class Field {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
sortable: boolean;
|
|
6
|
+
searchable: boolean;
|
|
7
|
+
rules: string[];
|
|
8
|
+
component: string;
|
|
9
|
+
constructor(name: string, label?: string);
|
|
10
|
+
static make(name: string, label?: string): any;
|
|
11
|
+
validation(rules: string[]): this;
|
|
12
|
+
sortableWith(): this;
|
|
13
|
+
searchableWith(): this;
|
|
14
|
+
value: unknown;
|
|
15
|
+
resolve(model: LucidRow): this;
|
|
16
|
+
fill(model: LucidRow, value: unknown): void;
|
|
17
|
+
format(value: unknown): unknown;
|
|
18
|
+
toJson(): Record<string, unknown>;
|
|
19
|
+
protected humanize(str: string): string;
|
|
20
|
+
}
|