Skip to content

Commit 086a19d

Browse files
authored
separate docs:build (#970)
1 parent 3f0f3c2 commit 086a19d

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.github/workflows/deploy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- if: steps.cache-data.outputs.cache-hit == 'true'
3636
run: find docs/.observablehq/cache examples/*/docs/.observablehq/cache -type f -exec touch {} +
3737
- run: yarn build
38+
- run: yarn docs:build
3839
- name: Build example "api"
3940
run: yarn --frozen-lockfile && yarn build
4041
working-directory: examples/api

docs/contributing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ yarn
1111
Next start the local preview server:
1212

1313
```sh
14-
yarn dev
14+
yarn docs:dev
1515
```
1616

1717
Lastly visit <http://127.0.0.1:3000>.
@@ -21,7 +21,7 @@ The local preview server restarts automatically if you edit any of the TypeScrip
2121
To generate the static site:
2222

2323
```sh
24-
yarn build
24+
yarn docs:build
2525
```
2626

2727
This creates the `dist` folder. View the site using your preferred web server, such as:

docs/telemetry.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ We never collect identifying or sensitive information, such as environment varia
5454
Setting the `OBSERVABLE_TELEMETRY_DISABLE` environment variable to `true` disables telemetry collection entirely. For example:
5555

5656
```sh
57-
OBSERVABLE_TELEMETRY_DISABLE=true yarn build
57+
OBSERVABLE_TELEMETRY_DISABLE=true npm run build
5858
```
5959

6060
Setting the `OBSERVABLE_TELEMETRY_DEBUG` environment variable to `true` also disables telemetry collection, instead printing telemetry data to stderr. Use this to inspect what telemetry data would be collected.

package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@
2020
},
2121
"scripts": {
2222
"dev": "rimraf --glob docs/themes.md docs/theme/*.md && (tsx watch docs/theme/generate-themes.ts & tsx watch --no-warnings=ExperimentalWarning ./src/bin/observable.ts preview --no-open)",
23-
"build:mocha": "rimraf build.test && node build.js --sourcemap --outdir=build.test \"{src,test}/**/*.{ts,js,css}\" --ignore \"test/input/**\" --ignore \"test/output/**\" --ignore \"test/preview/dashboard/**\" --ignore \"**/*.d.ts\" && cp -r templates build.test",
24-
"build": "yarn rebuild-themes && rimraf dist && tsx --no-warnings=ExperimentalWarning ./src/bin/observable.ts build",
25-
"deploy": "yarn rebuild-themes && tsx --no-warnings=ExperimentalWarning ./src/bin/observable.ts deploy",
26-
"rebuild-themes": "rimraf --glob docs/themes.md docs/theme/*.md && tsx docs/theme/generate-themes.ts",
23+
"docs:themes": "rimraf --glob docs/themes.md docs/theme/*.md && tsx docs/theme/generate-themes.ts",
24+
"docs:build": "yarn docs:themes && rimraf dist && tsx --no-warnings=ExperimentalWarning ./src/bin/observable.ts build",
25+
"docs:deploy": "yarn docs:themes && tsx --no-warnings=ExperimentalWarning ./src/bin/observable.ts deploy",
26+
"build": "rimraf build && node build.js --outdir=build --outbase=src \"src/**/*.{ts,js,css}\" --ignore \"**/*.d.ts\"",
2727
"test": "concurrently npm:test:mocha npm:test:tsc npm:test:lint npm:test:prettier",
2828
"test:coverage": "c8 --check-coverage --lines 80 --per-file yarn test:mocha",
29-
"test:mocha": "yarn build:mocha && rimraf --glob test/.observablehq/cache test/input/build/*/.observablehq/cache && cross-env OBSERVABLE_TELEMETRY_DISABLE=1 TZ=America/Los_Angeles mocha -p \"build.test/test/**/*-test.js\"",
30-
"test:mocha:serial": "yarn build:mocha && rimraf --glob test/.observablehq/cache test/input/build/*/.observablehq/cache && cross-env OBSERVABLE_TELEMETRY_DISABLE=1 TZ=America/Los_Angeles mocha \"build.test/test/**/*-test.js\"",
29+
"test:build": "rimraf build.test && node build.js --sourcemap --outdir=build.test \"{src,test}/**/*.{ts,js,css}\" --ignore \"test/input/**\" --ignore \"test/output/**\" --ignore \"test/preview/dashboard/**\" --ignore \"**/*.d.ts\" && cp -r templates build.test",
30+
"test:mocha": "yarn test:build && rimraf --glob test/.observablehq/cache test/input/build/*/.observablehq/cache && cross-env OBSERVABLE_TELEMETRY_DISABLE=1 TZ=America/Los_Angeles mocha -p \"build.test/test/**/*-test.js\"",
31+
"test:mocha:serial": "yarn test:build && rimraf --glob test/.observablehq/cache test/input/build/*/.observablehq/cache && cross-env OBSERVABLE_TELEMETRY_DISABLE=1 TZ=America/Los_Angeles mocha \"build.test/test/**/*-test.js\"",
3132
"test:lint": "eslint src test --max-warnings=0",
3233
"test:prettier": "prettier --check src test",
3334
"test:tsc": "tsc --noEmit",
3435
"observable": "tsx --no-warnings=ExperimentalWarning ./src/bin/observable.ts",
35-
"prepublishOnly": "rimraf build && node build.js --outdir=build --outbase=src \"src/**/*.{ts,js,css}\" --ignore \"**/*.d.ts\""
36+
"prepublishOnly": "yarn build"
3637
},
3738
"c8": {
3839
"all": true,

0 commit comments

Comments
 (0)