Skip to content

Commit 572eb54

Browse files
committed
Renaming the _site directory to site.
1 parent 734fe65 commit 572eb54

19 files changed

+62
-62
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,36 +124,36 @@ npx astrical init <directory> [options]
124124

125125
#### `dev`
126126

127-
Starts the development server in ephemeral mode. It constructs a temporary build environment in `_site` and runs the Astro dev server with Hot Module Replacement (HMR).
127+
Starts the development server in ephemeral mode. It constructs a temporary build environment in `site` and runs the Astro dev server with Hot Module Replacement (HMR).
128128

129129
**Usage:**
130130
```bash
131131
npx astrical dev
132132
```
133133

134134
**What it does:**
135-
1. **Prepares** the `_site` directory by mounting `src/core`, `src/modules`, and content.
135+
1. **Prepares** the `site` directory by mounting `src/core`, `src/modules`, and content.
136136
2. **Starts** the Astro development server (accessible at `http://localhost:4321` by default).
137137
3. **Watches** for changes in your project and updates the ephemeral build automatically.
138138

139139
---
140140

141141
#### `build`
142142

143-
Compiles the project for production. It assembles the final site structure in `_site` and generates static assets.
143+
Compiles the project for production. It assembles the final site structure in `site` and generates static assets.
144144

145145
**Usage:**
146146
```bash
147147
npx astrical build
148148
```
149149

150150
**What it does:**
151-
1. **Cleans** the `_site` directory to ensure a fresh build.
152-
2. **Copies** all necessary source files (`src/core`, `src/modules`, `src/content`, `public`) into `_site`.
153-
3. **Runs** `astro build` to generate the production output in `_site/dist`.
151+
1. **Cleans** the `site` directory to ensure a fresh build.
152+
2. **Copies** all necessary source files (`src/core`, `src/modules`, `src/content`, `public`) into `site`.
153+
3. **Runs** `astro build` to generate the production output in `site/dist`.
154154

155155
**Output:**
156-
- A production-ready static site in `_site/dist`.
156+
- A production-ready static site in `site/dist`.
157157

158158
---
159159

@@ -170,7 +170,7 @@ npx astrical preview
170170
- You must run `astrical build` first.
171171

172172
**What it does:**
173-
- Starts a local web server serving the static files from `_site/dist`.
173+
- Starts a local web server serving the static files from `site/dist`.
174174

175175
---
176176

@@ -184,7 +184,7 @@ npx astrical clean
184184
```
185185

186186
**What it does:**
187-
- Deletes `_site`, `dist`, and `node_modules/.vite`.
187+
- Deletes `site`, `dist`, and `node_modules/.vite`.
188188

189189
---
190190

src/commands/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class BuildCommand extends BaseCommand {
1313
return;
1414
}
1515

16-
const siteDir = path.resolve(this.projectRoot, '_site');
16+
const siteDir = path.resolve(this.projectRoot, 'site');
1717

1818
try {
1919
logger.debug(`Preparing environment at: ${this.projectRoot}`);

src/commands/clean.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class CleanCommand extends BaseCommand {
1818
path.join(coreDir, 'node_modules'),
1919
path.join(coreDir, 'dist'),
2020
'node_modules',
21-
'_site'
21+
'site'
2222
];
2323

2424
for (const target of targets) {

src/commands/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class DevCommand extends BaseCommand {
1515
return;
1616
}
1717

18-
const siteDir = path.resolve(this.projectRoot, '_site');
18+
const siteDir = path.resolve(this.projectRoot, 'site');
1919

2020
this.info('Initializing ephemeral build environment...');
2121

src/commands/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class PreviewCommand extends BaseCommand {
1515
return;
1616
}
1717

18-
const siteDir = path.resolve(this.projectRoot, '_site');
18+
const siteDir = path.resolve(this.projectRoot, 'site');
1919
const distDir = path.join(siteDir, 'dist');
2020

2121
logger.debug('Preview paths:', { siteDir, distDir });

src/commands/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default class RunCommand extends BaseCommand {
3232
}
3333

3434
await linkEnvironment(this.projectRoot!);
35-
const siteDir = path.resolve(this.projectRoot!, '_site');
35+
const siteDir = path.resolve(this.projectRoot!, 'site');
3636

3737
logger.debug('Run command context:', { script, args: scriptArgs, siteDir });
3838

src/utils/environment.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import fs from 'fs-extra';
33
import path from 'path';
44

55
export async function linkEnvironment(projectRoot: string) {
6-
const siteDir = path.resolve(projectRoot, '_site');
6+
const siteDir = path.resolve(projectRoot, 'site');
77
const srcDir = path.resolve(projectRoot, 'src');
88
const coreDir = path.resolve(srcDir, 'core');
99
const modulesDir = path.resolve(srcDir, 'modules');
@@ -13,10 +13,10 @@ export async function linkEnvironment(projectRoot: string) {
1313

1414
logger.debug('Preparing environment paths:', { siteDir, srcDir });
1515

16-
// 1. Ensure _site exists (recreate it cleanly to remove old links)
16+
// 1. Ensure site exists (recreate it cleanly to remove old links)
1717
await fs.remove(siteDir);
1818

19-
// 2. Symlink Core -> _site
19+
// 2. Symlink Core -> site
2020
if (await fs.pathExists(coreDir)) {
2121
await fs.ensureSymlink(coreDir, siteDir, 'junction');
2222
} else {
@@ -54,7 +54,7 @@ export async function linkEnvironment(projectRoot: string) {
5454

5555

5656
export async function copyEnvironment(projectRoot: string) {
57-
const siteDir = path.resolve(projectRoot, '_site');
57+
const siteDir = path.resolve(projectRoot, 'site');
5858
const srcDir = path.resolve(projectRoot, 'src');
5959
const coreDir = path.resolve(srcDir, 'core');
6060
const modulesDir = path.resolve(srcDir, 'modules');
@@ -64,7 +64,7 @@ export async function copyEnvironment(projectRoot: string) {
6464

6565
logger.debug('Build paths resolved:', { siteDir, srcDir, coreDir, modulesDir, contentDir, publicDir });
6666

67-
// 1. Clean _site
67+
// 1. Clean site
6868
logger.debug(`Cleaning site directory: ${siteDir}`);
6969
await fs.remove(siteDir);
7070
await fs.ensureDir(siteDir);

test/e2e/lifecycle.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ if (args[0] === 'build') {
152152
const cleanResult = await runCLI(['clean'], projectDir, { env });
153153

154154
expect(cleanResult.exitCode).toBe(0);
155-
expect(fs.existsSync(path.join(projectDir, '_site'))).toBe(false);
155+
expect(fs.existsSync(path.join(projectDir, 'site'))).toBe(false);
156156

157157
}, 120000); // Long timeout for full chain
158158
});

test/integration/commands/build.integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ describe('BuildCommand Integration', () => {
6464

6565
await command.run({});
6666

67-
// 1. Verify _site assembly
68-
const siteDir = path.join(projectDir, '_site');
67+
// 1. Verify site assembly
68+
const siteDir = path.join(projectDir, 'site');
6969
expect(fs.existsSync(siteDir)).toBe(true);
7070
expect(fs.existsSync(path.join(siteDir, 'index.astro'))).toBe(true);
7171
expect(fs.existsSync(path.join(siteDir, 'content', 'config.ts'))).toBe(true);
@@ -76,7 +76,7 @@ describe('BuildCommand Integration', () => {
7676
expect(execMock).toHaveBeenCalledWith(
7777
expect.stringContaining('npm run build'),
7878
expect.objectContaining({
79-
cwd: expect.stringContaining('_site')
79+
cwd: expect.stringContaining('site')
8080
}),
8181
expect.anything()
8282
);

test/integration/commands/clean.integration.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ describe('CleanCommand Integration', () => {
1111
beforeEach(async () => {
1212
tempDir = await createTempDir('clean-integration-');
1313
// Setup initial state
14-
await fs.ensureDir(path.join(tempDir, '_site'));
15-
await fs.outputFile(path.join(tempDir, '_site', 'index.html'), '<html></html>');
14+
await fs.ensureDir(path.join(tempDir, 'site'));
15+
await fs.outputFile(path.join(tempDir, 'site', 'index.html'), '<html></html>');
1616
await fs.ensureDir(path.join(tempDir, 'node_modules'));
1717
await fs.outputFile(path.join(tempDir, 'node_modules', 'pkg.json'), '{}');
1818
});
@@ -21,7 +21,7 @@ describe('CleanCommand Integration', () => {
2121
if (tempDir) await fs.remove(tempDir);
2222
});
2323

24-
it('should remove _site and node_modules directories', async () => {
24+
it('should remove site and node_modules directories', async () => {
2525
const cli = new CLI({ commandName: 'astrical' });
2626
const command = new CleanCommand(cli);
2727

@@ -31,7 +31,7 @@ describe('CleanCommand Integration', () => {
3131

3232
await command.run({});
3333

34-
expect(fs.existsSync(path.join(tempDir, '_site'))).toBe(false);
34+
expect(fs.existsSync(path.join(tempDir, 'site'))).toBe(false);
3535
expect(fs.existsSync(path.join(tempDir, 'node_modules'))).toBe(false);
3636
} finally {
3737
process.chdir(originalCwd);

0 commit comments

Comments
 (0)