Skip to content

Commit 254ee50

Browse files
authored
dist shuffle (#972)
1 parent 086a19d commit 254ee50

File tree

16 files changed

+38
-41
lines changed

16 files changed

+38
-41
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
test/build
12
test/input
23
test/output

.github/workflows/deploy.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,11 @@ jobs:
7171
working-directory: examples/plot
7272
env:
7373
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74-
- run: mkdir dist/examples && for i in examples/*; do if [ -d $i/dist ]; then mv -v $i/dist dist/examples/$(basename $i); fi; done
74+
- run: mkdir docs/.observablehq/dist/examples && for i in examples/*; do if [ -d $i/dist ]; then mv -v $i/dist docs/.observablehq/dist/examples/$(basename $i); fi; done
7575
- uses: cloudflare/pages-action@1
7676
with:
7777
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
7878
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
7979
projectName: framework
80-
directory: dist
80+
directory: docs/.observablehq/dist
8181
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
82-
# TODO: This doesn't include the examples. How can we fix that?
83-
# TODO: Re-enable deploy to Observable
84-
# - name: Deploy to Observable
85-
# run: yarn deploy -m "$(git log -1 --pretty=%s)"
86-
# env:
87-
# OBSERVABLE_TOKEN: ${{ secrets.OBSERVABLE_API_TOKEN }}

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
**/.observablehq/cache/
22
.DS_Store
33
.env
4-
/build.test/
5-
/build/
64
/coverage/
75
/dist/
6+
/docs/.observablehq/dist/
87
/docs/theme/*.md
98
/docs/themes.md
9+
/test/build/
1010
/test/output/**/*-changed.*
1111
/test/output/build/**/*-changed/
1212
node_modules/

docs/contributing.md

+3-3
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 docs:dev
14+
yarn dev
1515
```
1616

1717
Lastly visit <http://127.0.0.1:3000>.
@@ -24,10 +24,10 @@ To generate the static site:
2424
yarn docs:build
2525
```
2626

27-
This creates the `dist` folder. View the site using your preferred web server, such as:
27+
This creates the `docs/.observablehq/dist` folder. View the site using your preferred web server, such as:
2828

2929
```sh
30-
http-server dist
30+
http-server docs/.observablehq/dist
3131
```
3232

3333
This documentation site is built on GitHub using Observable Framework; see the [deploy workflow](https://github.com/observablehq/framework/blob/main/.github/workflows/deploy.yml). Please open a pull request if you’d like to contribute. Contributors are expected to follow our [code of conduct](https://github.com/observablehq/.github/blob/master/CODE_OF_CONDUCT.md). 🙏

examples/api/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"dev": "observable preview",
55
"build": "rm -rf dist && observable build",
6-
"postinstall": "ln -sf ../../../../build/bin/observable.js node_modules/.bin/observable"
6+
"postinstall": "ln -sf ../../../../dist/bin/observable.js node_modules/.bin/observable"
77
},
88
"dependencies": {
99
"@observablehq/framework": "link:../.."

examples/chess/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"dev": "observable preview",
55
"build": "rm -rf dist && observable build",
6-
"postinstall": "ln -sf ../../../../build/bin/observable.js node_modules/.bin/observable"
6+
"postinstall": "ln -sf ../../../../dist/bin/observable.js node_modules/.bin/observable"
77
},
88
"dependencies": {
99
"@observablehq/framework": "link:../..",

examples/eia/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"dev": "observable preview",
55
"build": "rm -rf dist && observable build",
6-
"postinstall": "ln -sf ../../../../build/bin/observable.js node_modules/.bin/observable"
6+
"postinstall": "ln -sf ../../../../dist/bin/observable.js node_modules/.bin/observable"
77
},
88
"dependencies": {
99
"@observablehq/framework": "link:../..",

examples/google-analytics/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"dev": "observable preview",
55
"build": "rm -rf dist && observable build",
6-
"postinstall": "ln -sf ../../../../build/bin/observable.js node_modules/.bin/observable"
6+
"postinstall": "ln -sf ../../../../dist/bin/observable.js node_modules/.bin/observable"
77
},
88
"dependencies": {
99
"@google-analytics/data": "^4.3.0",

examples/hello-world/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"dev": "observable preview",
55
"build": "rm -rf dist && observable build",
6-
"postinstall": "ln -sf ../../../../build/bin/observable.js node_modules/.bin/observable"
6+
"postinstall": "ln -sf ../../../../dist/bin/observable.js node_modules/.bin/observable"
77
},
88
"dependencies": {
99
"@observablehq/framework": "link:../.."

examples/mortgage-rates/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"dev": "observable preview",
55
"build": "rm -rf dist && observable build",
6-
"postinstall": "ln -sf ../../../../build/bin/observable.js node_modules/.bin/observable"
6+
"postinstall": "ln -sf ../../../../dist/bin/observable.js node_modules/.bin/observable"
77
},
88
"dependencies": {
99
"@observablehq/framework": "link:../..",

examples/penguin-classification/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"dev": "observable preview",
55
"build": "rm -rf dist && observable build",
6-
"postinstall": "ln -sf ../../../../build/bin/observable.js node_modules/.bin/observable"
6+
"postinstall": "ln -sf ../../../../dist/bin/observable.js node_modules/.bin/observable"
77
},
88
"dependencies": {
99
"@observablehq/framework": "link:../.."

examples/plot/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"dev": "observable preview",
55
"build": "rm -rf dist && observable build",
6-
"postinstall": "ln -sf ../../../../build/bin/observable.js node_modules/.bin/observable"
6+
"postinstall": "ln -sf ../../../../dist/bin/observable.js node_modules/.bin/observable"
77
},
88
"dependencies": {
99
"@observablehq/framework": "link:../..",

observablehq.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export default {
2+
output: "docs/.observablehq/dist",
23
title: "Observable Framework",
34
pages: [
45
{name: "Getting started", path: "/getting-started"},

package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@
1111
"url": "https://github.com/observablehq/framework.git"
1212
},
1313
"files": [
14-
"build/**/*.js",
15-
"build/**/*.css",
14+
"dist/**/*.js",
15+
"dist/**/*.css",
1616
"templates"
1717
],
1818
"bin": {
19-
"observable": "build/bin/observable.js"
19+
"observable": "dist/bin/observable.js"
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)",
2323
"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",
24+
"docs:build": "yarn docs:themes && rimraf docs/.observablehq/dist && tsx --no-warnings=ExperimentalWarning ./src/bin/observable.ts build",
2525
"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\"",
26+
"build": "rimraf dist && node build.js --outdir=dist --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: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\"",
29+
"test:build": "rimraf test/build && node build.js --sourcemap --outdir=test/build \"{src,test}/**/*.{ts,js,css}\" --ignore \"test/input/**\" --ignore \"test/output/**\" --ignore \"test/preview/dashboard/**\" --ignore \"**/*.d.ts\" && cp -r templates test/build",
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 \"test/build/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 \"test/build/test/**/*-test.js\"",
3232
"test:lint": "eslint src test --max-warnings=0",
3333
"test:prettier": "prettier --check src test",
3434
"test:tsc": "tsc --noEmit",
@@ -38,14 +38,14 @@
3838
"c8": {
3939
"all": true,
4040
"include": [
41-
"build.test/src/**/*.js"
41+
"test/build/src/**/*.js"
4242
],
4343
"exclude": [
44-
"build.test/src/bin/",
45-
"build.test/src/client/",
46-
"build.test/src/convert.js",
47-
"build.test/src/observableApiConfig.js",
48-
"build.test/src/preview.js"
44+
"test/build/src/bin/",
45+
"test/build/src/client/",
46+
"test/build/src/convert.js",
47+
"test/build/src/observableApiConfig.js",
48+
"test/build/src/preview.js"
4949
],
5050
"reporter": [
5151
"text",

test/files-test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import {getClientPath, getStylePath, maybeStat, prepareOutput, visitFiles, visit
55

66
describe("getClientPath(entry)", () => {
77
it("returns the relative path to the specified source", () => {
8-
assert.strictEqual(getClientPath("main.js"), "build.test/src/client/main.js");
9-
assert.strictEqual(getClientPath("./main.js"), "build.test/src/client/main.js");
10-
assert.strictEqual(getClientPath("stdlib/resize.js"), "build.test/src/client/stdlib/resize.js");
11-
assert.strictEqual(getClientPath("./stdlib/resize.js"), "build.test/src/client/stdlib/resize.js");
8+
assert.strictEqual(getClientPath("main.js"), "test/build/src/client/main.js");
9+
assert.strictEqual(getClientPath("./main.js"), "test/build/src/client/main.js");
10+
assert.strictEqual(getClientPath("stdlib/resize.js"), "test/build/src/client/stdlib/resize.js");
11+
assert.strictEqual(getClientPath("./stdlib/resize.js"), "test/build/src/client/stdlib/resize.js");
1212
});
1313
});
1414

1515
describe("geStylePath(entry)", () => {
1616
it("returns the relative path to the specified style", () => {
17-
assert.strictEqual(getStylePath("default.css"), "build.test/src/style/default.css");
17+
assert.strictEqual(getStylePath("default.css"), "test/build/src/style/default.css");
1818
});
1919
});
2020

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"observablehq:search": ["./src/client/search.js"]
1313
}
1414
},
15-
"include": ["src/**/*", "docs/**/*", "test/**/*"]
15+
"include": ["src/**/*", "docs/**/*", "test/**/*"],
16+
"exclude": ["test/build/**/*"]
1617
}

0 commit comments

Comments
 (0)