Skip to content

Commit

Permalink
[prettierx] chore: website -> x-unsupported/website
Browse files Browse the repository at this point in the history
rename website -> x-unsupported/website

(in prettierx-rebase-branch-001)

should help restore website build which was removed from
default branch of prettierX

keeping website for test build only at this point

The website directory may be moved back to top-level and supported by
prettierX at some point in the future.
  • Loading branch information
Christopher J. Brody committed Jun 29, 2021
1 parent c4c4fc8 commit faec4fe
Show file tree
Hide file tree
Showing 245 changed files with 38 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ insert_final_newline = true
indent_size = 4
insert_final_newline = false

[website/blog/*.md]
[x-unsupported/website/blog/*.md]
trim_trailing_whitespace = false

[tests/{**/__snapshots__/*, tests/format/**/*}]
Expand Down
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
/coverage/
/dist/
**/node_modules/**
/website/build/
/website/static/playground.js
/website/static/lib/
/x-unsupported/website/build/
/x-unsupported/website/static/playground.js
/x-unsupported/website/static/lib/
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/test*.*
/.vscode
/dist
/website/node_modules
/website/build
/website/i18n
/website/static/playground.js
/website/static/lib
/x-unsupported/website/node_modules
/x-unsupported/website/build
/x-unsupported/website/i18n
/x-unsupported/website/static/playground.js
/x-unsupported/website/static/lib
.DS_Store
/coverage
.idea
Expand Down
12 changes: 6 additions & 6 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,11 @@
"!tests/**/jsfmt.spec.js",
"*.{log,svg,snap,png}",
"test*.*",
"website/data/users.yml",
"website/build/**",
"website/playground/codeSamples.js",
"website/pages/googlefe164a33bda4034b.html",
"website/static/lib/**",
"website/static/playground.js"
"x-unsupported/website/data/users.yml",
"x-unsupported/website/build/**",
"x-unsupported/website/playground/codeSamples.js",
"x-unsupported/website/pages/googlefe164a33bda4034b.html",
"x-unsupported/website/static/lib/**",
"x-unsupported/website/static/playground.js"
]
}
8 changes: 5 additions & 3 deletions scripts/build-docs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ shell.config.fatal = true;

const { __dirname, require } = createEsmUtils(import.meta);
const rootDir = path.join(__dirname, "..");
const docs = path.join(rootDir, "website/static/lib");
// [prettierx] website is now in x-unsupported/subdirectory
const docs = path.join(rootDir, "x-unsupported/website/static/lib");

function pipe(string) {
return new shell.ShellString(string);
Expand Down Expand Up @@ -61,8 +62,9 @@ fs.writeFileSync(
);

// --- Site ---
shell.cd("website");
shell.echo("Building website...");
// [prettierx] website is now in x-unsupported/subdirectory
shell.cd("x-unsupported/website");
shell.echo("Building x-unsupported/website...");
shell.exec("yarn install");

shell.exec("yarn build");
Expand Down
3 changes: 2 additions & 1 deletion scripts/draft-blog-post.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
} from "./utils/changelog.mjs";

const { __dirname, require } = createEsmUtils(import.meta);
const blogDir = path.join(__dirname, "../website/blog");
// [prettierx] website is now in x-unsupported subdirectory
const blogDir = path.join(__dirname, "../x-unsupported/website/blog");
const introTemplateFile = path.join(
changelogUnreleasedDirPath,
"BLOG_POST_INTRO_TEMPLATE.md"
Expand Down
3 changes: 2 additions & 1 deletion scripts/release/steps/update-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ function getBlogPostInfo(version) {
const day = String(date.getDate()).padStart(2, "0");

return {
file: `website/blog/${year}-${month}-${day}-${version}.md`,
// [prettierx] website is now in x-unsupported/subdirectory
file: `x-unsupported/website/blog/${year}-${month}-${day}-${version}.md`,
path: `blog/${year}/${month}/${day}/${version}.html`,
};
}
Expand Down
6 changes: 4 additions & 2 deletions scripts/release/steps/update-dependents-count.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ async function update() {
);
}

processFile("website/pages/en/index.js", (content) =>
// [prettierx] website is now in x-unsupported/subdirectory
processFile("x-unsupported/website/pages/en/index.js", (content) =>
content
.replace(
/(<strong data-placeholder="dependent-npm">)(.*?)(<\/strong>)/,
Expand All @@ -49,9 +50,10 @@ async function update() {

const isUpdated = await logPromise(
"Checking if dependents count has been updated",
// [prettierx] website is now in x-unsupported/subdirectory
async () =>
(await runGit(["diff", "--name-only"])).stdout ===
"website/pages/en/index.js"
"x-unsupported/website/pages/en/index.js"
);

if (isUpdated) {
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/__tests__/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const path = require("path");
const globby = require("globby");
const { projectRoot } = require("../env");
const coreOptions = require("../../../src/main/core-options");
const codeSamples = require("../../../website/playground/codeSamples").default;
// [prettierx] website is now in x-unsupported/subdirectory
const codeSamples =
require("../../../x-unsupported/website/playground/codeSamples").default;

const parserNames = coreOptions.options.parser.choices.map(
({ value }) => value
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"docs/",
"scripts/",
"tests/",
"website/"
"x-unsupported/website/"
]
}
File renamed without changes.
12 changes: 6 additions & 6 deletions website/README.md → x-unsupported/website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ https://prettier.io/

To build for the current branch, use `PULL_REQUEST=true yarn build-docs`. Otherwise, a release version of Prettier from `node_modules` is used.

2. Switch to the `website` directory and start the development server:
2. Switch to the `x-unsupported/website` directory and start the development server:

```sh
cd website
cd x-unsupported/website
yarn start
```

Expand All @@ -36,7 +36,7 @@ Images and other static assets are placed inside the `static` directory: `static

## Playground

The Playground is not integrated with the Docusaurus infrastructure. Its UI (`website/playground/`) is built separately with webpack configured to put the resulting bundle in Docusaurus’s `static` directory. The `yarn start` command (in `website/`) concurrently starts both Docusaurus’s local server and webpack in the watch mode for the Playground.
The Playground is not integrated with the Docusaurus infrastructure. Its UI (`x-unsupported/website/playground/`) is built separately with webpack configured to put the resulting bundle in Docusaurus’s `static` directory. The `yarn start` command (in `x-unsupported/website/`) concurrently starts both Docusaurus’s local server and webpack in the watch mode for the Playground.

Another part of the Playground is a web worker where formatting happens. It’s not managed by webpack and resides directly in `static/worker.js`. It expects to find the [UMD bundles of Prettier](https://prettier.io/docs/en/browser.html) in `static/lib/`. That’s why running `yarn build-docs` or `PULL_REQUEST=true yarn build-docs` in the project root is a required step.

Expand All @@ -59,11 +59,11 @@ next: doc2 # next doc on the sidebar for navigation
---
```

The docs from `docs/` are published to `https://prettier.io/docs/en/next/` and are considered to be the docs of the next (not yet released) version of Prettier. When a release happens, the docs from `docs/` are copied to the `website/versioned_docs/version-stable` directory, whose content is published to `https://prettier.io/docs/en`.
The docs from `docs/` are published to `https://prettier.io/docs/en/next/` and are considered to be the docs of the next (not yet released) version of Prettier. When a release happens, the docs from `docs/` are copied to the `x-unsupported/website/versioned_docs/version-stable` directory, whose content is published to `https://prettier.io/docs/en`.

## Blog

The `website/blog` directory contains blog posts written in Markdown. Their front matter should follow this example:
The `x-unsupported/website/blog` directory contains blog posts written in Markdown. Their front matter should follow this example:

```yaml
title: Blog Post Title
Expand All @@ -76,4 +76,4 @@ In the blog post, you should include a line `<!--truncate-->`. This determines u

## Static Build

To create a static build of the website, run `yarn build` (in `website/`). The result will be put in `website/build/`.
To create a static build of the website, run `yarn build` (in `x-unsupported/website/`). The result will be put in `x-unsupported/website/build/`.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit faec4fe

Please sign in to comment.