Skip to content

Commit c807a19

Browse files
committed
fix!: rename the _fresh build folder to .fresh (BREAKING)
1 parent 647d6f9 commit c807a19

23 files changed

Lines changed: 84 additions & 59 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ jobs:
3333
if: github.repository_owner == 'denoland'
3434
with:
3535
project: "fresh"
36-
entrypoint: "./www/_fresh/server.js"
36+
entrypoint: "./www/.fresh/server.js"
3737
root: "."

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_fresh/
1+
.fresh/
22
.vite/
33
vendor/
44
node_modules/

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"release": "deno run -A tools/release.ts"
1717
},
1818
"exclude": [
19-
"**/_fresh/*",
19+
"**/.fresh/*",
2020
"**/tmp/*",
2121
"*/tests_OLD/**",
2222
"**/vite.config.ts.*",

docs/canary/concepts/builder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const builder = new Builder({
3434
// The path to your server entry point. (Default: `<root>/main.ts`)
3535
serverEntry?: string;
3636
// Where to write generated files when doing a production build.
37-
// (default: `<root>/_fresh/`)
37+
// (default: `<root>/.fresh/`)
3838
outDir?: string;
3939
// Path to static file directory. (Default: `<root>/static/`)
4040
staticDir?: string;

docs/canary/deployment/deno-compile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ platform without requiring Deno to be installed.
1111
# Build your app first
1212
$ deno task build
1313
# Generate self-contained executable
14-
deno compile --include static --include _fresh --include deno.json -A my-app _fresh/compiled-entry.js
14+
deno compile --include static --include .fresh --include deno.json -A my-app .fresh/compiled-entry.js
1515
```
1616

1717
The compiled entry supports two environment variables out of the box:

docs/canary/deployment/docker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ WORKDIR /app
2525

2626
COPY . .
2727
RUN deno task build
28-
RUN deno cache _fresh/server.js
28+
RUN deno cache .fresh/server.js
2929

3030
EXPOSE 8000
3131

32-
CMD ["serve", "-A", "_fresh/server.js"]
32+
CMD ["serve", "-A", ".fresh/server.js"]
3333
```
3434

3535
To build your Docker image inside of a Git repository:

docs/canary/deployment/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ deno task build
1111
deno run -A dev.ts build
1212
```
1313

14-
Once completed, it will have created a `_fresh` folder in the project directory
14+
Once completed, it will have created a `.fresh` folder in the project directory
1515
which contains the optimized assets.
1616

17-
> [info]: The `_fresh` folder should not be committed to git. Exclude it via
17+
> [info]: The `.fresh` folder should not be committed to git. Exclude it via
1818
> `.gitignore`.
1919
>
2020
> ```gitignore .gitignore
2121
> # Ignore fresh build directory
22-
> _fresh/
22+
> .fresh/
2323
> ```
2424
2525
## Running a production build
@@ -29,7 +29,7 @@ To run Fresh in production mode, run the `start` task:
2929
```sh Terminal
3030
deno task start
3131
# or
32-
deno serve -A _fresh/server.js
32+
deno serve -A .fresh/server.js
3333
```
3434
35-
Fresh will automatically pick up the optimized assets in the `_fresh` directory.
35+
Fresh will automatically pick up the optimized assets in the `.fresh` directory.

docs/canary/examples/migration-guide.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,43 @@ To launch Fresh in production mode:
130130

131131
```diff
132132
- deno run -A main.ts
133-
+ deno serve -A _fresh/server.js
133+
+ deno serve -A .fresh/server.js
134134
```
135135

136136
You'll likely have that command inside your `deno.json` as a task. Update it
137137
accordingly.
138138

139139
```diff deno.json
140140
{
141-
"tasks":
141+
"tasks": {
142142
"dev": "deno run -A dev.ts",
143143
"build": "deno run -A dev.ts build",
144144
- "preview": "deno run -A main.ts"
145-
+ "preview": "deno serve -A _fresh/server.js"
146-
}
145+
+ "preview": "deno serve -A .fresh/server.js"
146+
}
147147
}
148148
```
149149

150+
## Update ignored files
151+
152+
The default folder for build assets changed from `<root>/_fresh` to
153+
`<root>/.fresh`. Thus, the `.gitignore` files should be updated to change the
154+
path.
155+
156+
```diff .gitignore
157+
# Fresh build directory
158+
+ .fresh/
159+
- _fresh/
160+
```
161+
162+
It's also possible to keep `_fresh` if preferred by updating the `dev.ts`
163+
`Builder` configuration.
164+
165+
```diff dev.ts
166+
- const builder = new Builder();
167+
+ const builder = new Builder({ outDir: "_fresh" });
168+
```
169+
150170
## Removal of `<Head>` component
151171

152172
The `<Head>` component was used in Fresh 1.x to add additional tags to the

docs/latest/concepts/ahead-of-time-builds.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,31 @@ deno task build
2929
deno run -A dev.ts build
3030
```
3131

32-
This will create a `_fresh` folder in the project directory. That folder
32+
This will create a `.fresh` folder in the project directory. That folder
3333
contains the optimized assets and a `snapshot.json` file which includes some
3434
metadata for Fresh.
3535

3636
Any other static files generated by plugins will be stored in the
37-
`_fresh/static` subfolder. They will be served the same as other
37+
`.fresh/static` subfolder. They will be served the same as other
3838
[static files](/docs/concepts/static-files.md).
3939

40-
> [info]: The `_fresh` folder should not be committed to the repository. Add an
40+
> [info]: The `.fresh` folder should not be committed to the repository. Add an
4141
> entry in the `.gitignore` file to ensure that it is not committed. Create that
4242
> file at the root of your git repository if not present.
4343
>
4444
> ```gitignore .gitignore
4545
> # Ignore fresh build directory
46-
> _fresh/
46+
> .fresh/
4747
> ```
4848
4949
## Running Fresh with optimized assets
5050
5151
When Fresh is started in non-development mode (usually via `main.ts`), Fresh
52-
will automatically pick up optimized assets when a `_fresh` folder exists. If
52+
will automatically pick up optimized assets when a `.fresh` folder exists. If
5353
found, Fresh will print the following message to the terminal:
5454
5555
```sh Terminal output
56-
Using snapshot found at /path/to/project/_fresh
56+
Using snapshot found at /path/to/project/.fresh
5757
```
5858
5959
## Deploying an optimized Fresh project

docs/latest/concepts/deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ platform without requiring Deno to be installed.
7777

7878
```sh Terminal
7979
$ deno task build
80-
$ deno compile --include static --include _fresh --include deno.json -A main.ts
80+
$ deno compile --include static --include .fresh --include deno.json -A main.ts
8181
```
8282

8383
[aws-container-registry]: https://docs.aws.amazon.com/AmazonECS/latest/userguide/create-container-image.html#create-container-image-push-ecr

0 commit comments

Comments
 (0)