Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cli-application/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ Now we map our new template in `.athennarc.json`:
{
"templates": {
...
"repository": "./src/resources/templates/repository.edge"
"repository": "./resources/templates/repository.edge"
...
}
}
Expand Down
7 changes: 4 additions & 3 deletions docs/getting-started/athennarc-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,10 @@ resolve the paths of your application:
"seeders": "src/database/seeders",
"migrations": "src/database/migrations",
"lang": "src/lang",
"resources": "src/resources",
"views": "src/resources/views",
"locales": "src/resources/locales",
"resources": "resources",
"views": "resources/views",
"locales": "resources/locales",
"apiResources": "src/resources",
"providers": "src/providers",
"facades": "src/facades",
"routes": "src/routes",
Expand Down
26 changes: 13 additions & 13 deletions docs/rest-api-application/web-application.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ With this option set, SSR will be turn on into your application.
This defines where Vite needs to look when compiling your server
entrypoint files.

Default: `src/resources/app/app.tsx`
Default: `resources/app/app.tsx`

#### ssrBuildDirectory

Expand Down Expand Up @@ -166,7 +166,7 @@ function to the `styleAttributes` option.
export default {
vite: {
styleAttributes: ({ src, url }) => {
if (src === 'src/resources/css/admin.css') {
if (src === 'resources/css/admin.css') {
return {
'data-turbo-track': 'reload'
}
Expand Down Expand Up @@ -198,7 +198,7 @@ accepts an array of entrypoints and returns the script and the link tags.
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@vite(['src/resources/js/app.ts'])
@vite(['resources/js/app.ts'])
</head>
<body>

Expand Down Expand Up @@ -236,11 +236,11 @@ during development.
- Return a URL pointing to the output filename during production.

```html
<link rel="stylesheet" href="{{ asset('src/resources/css/app.css') }}">
<link rel="stylesheet" href="{{ asset('resources/css/app.css') }}">
```

```html title="Output in development"
<link rel="stylesheet" href="http://localhost:5173/src/resources/css/app.css">
<link rel="stylesheet" href="http://localhost:5173/resources/css/app.css">
```

```html title="Output in production"
Expand All @@ -256,7 +256,7 @@ Therefore, you will have to notify Vite about the existence of these
assets using its [Glob imports](https://vite.dev/guide/features.html#glob-import) API.

In the following example, we ask Vite to process all the files within the
`src/resources/img` directory. This code should be written within an entry point file:
`resources/img` directory. This code should be written within an entry point file:

```typescript
import.meta.glob(['../img/**'])
Expand All @@ -265,7 +265,7 @@ import.meta.glob(['../img/**'])
Now you can reference the images within your Edge templates as follows:

```html
<img src="{{ asset('src/resources/img/hero.jpg') }}" />
<img src="{{ asset('resources/img/hero.jpg') }}" />
```

## Enabling HMR with React
Expand All @@ -281,7 +281,7 @@ written before you include the entrypoints using the `@vite` tag.
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@viteReactRefresh()
@vite(['src/resources/js/app.ts'])
@vite(['resources/js/app.ts'])
</head>
<body>

Expand All @@ -300,7 +300,7 @@ import athenna from '@athenna/vite/plugins/client'
export default defineConfig({
plugins: [
athenna({
entrypoints: ["src/resources/js/app.ts"],
entrypoints: ["resources/js/app.ts"],
}),
react() 👈
]
Expand Down Expand Up @@ -341,8 +341,8 @@ import athenna from '@athenna/vite/plugins/client'
export default defineConfig({
plugins: [
athenna({
entrypoints: ['src/resources/js/app.ts'],
reloads: ['src/resources/views/**/*.edge'],
entrypoints: ['resources/js/app.ts'],
reloads: ['resources/views/**/*.edge'],
assetsUrl: 'https://cdn.example.com/',
}),
]
Expand Down Expand Up @@ -386,7 +386,7 @@ export default {
vite: {
// ...

ssrEntrypoint: 'src/resources/app/app.tsx',
ssrEntrypoint: 'resources/app/app.tsx',
ssrBuildDirectory: Path.public('assets/server')
}
}
Expand Down Expand Up @@ -468,7 +468,7 @@ In case you want to import other components beside the entrypoint
you can use the `loadComponent()` method:

```typescript
const { createApp } = await React.loadComponent('src/resources/app/app.tsx')
const { createApp } = await React.loadComponent('resources/app/app.tsx')
```

## Manifest file
Expand Down
38 changes: 29 additions & 9 deletions docs/the-basics/helpers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4263,7 +4263,7 @@ Merge the project root path with `Path.dirs.resources`:
```typescript
import { Path } from '@athenna/common'

console.log(Path.resources()) // /home/user/athenna-project/src/resources
console.log(Path.resources()) // /home/user/athenna-project/resources
```

#### `Path::setResources()`
Expand All @@ -4276,24 +4276,44 @@ import { Path } from '@athenna/common'
Path.setResources('resources/app')
```

#### `Path::routes()`
#### `Path::resources()`

Merge the project root path with `Path.dirs.resources`:

```typescript
import { Path } from '@athenna/common'

console.log(Path.resources()) // /home/user/athenna-project/resources
```

#### `Path::setResources()`

Set the `Path.dirs.resources` value:

```typescript
import { Path } from '@athenna/common'

Path.setResources('resources/app')
```

#### `Path::apiResources()`

Merge the project root path with `Path.dirs.routes`:
Merge the project root path with `Path.dirs.apiResources`:

```typescript
import { Path } from '@athenna/common'

console.log(Path.routes()) // /home/user/athenna-project/src/routes
console.log(Path.apiResources()) // /home/user/athenna-project/src/resources
```

#### `Path::setRoutes()`
#### `Path::setApiResources()`

Set the `Path.dirs.routes` value:
Set the `Path.dirs.apiResources` value:

```typescript
import { Path } from '@athenna/common'

Path.setRoutes('routes/app')
Path.setApiResources('resources/app')
```

#### `Path::storage()`
Expand Down Expand Up @@ -4363,7 +4383,7 @@ Merge the project root path with `Path.dirs.views`:
```typescript
import { Path } from '@athenna/common'

console.log(Path.views()) // /home/user/athenna-project/src/resources/views
console.log(Path.views()) // /home/user/athenna-project/resources/views
```

#### `Path::setViews()`
Expand Down Expand Up @@ -4423,7 +4443,7 @@ Merge the project root path with `Path.dirs.locales`:
```typescript
import { Path } from '@athenna/common'

console.log(Path.locales()) // /home/user/athenna-project/src/resources/locales
console.log(Path.locales()) // /home/user/athenna-project/resources/locales
```

#### `Path::setLocales()`
Expand Down
Loading