Skip to content

Commit 54f65d7

Browse files
committed
Initialize Documentation Repository
0 parents  commit 54f65d7

File tree

73 files changed

+4853
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4853
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
5+
xcuserdata/
6+
DerivedData/
7+
.swiftpm/config/registries.json
8+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
9+
.netrc
10+
/docs/*
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
github:
2+
rm -rf docs/
3+
DOCC_HTML_DIR=ThirdParty/docc-render-artifact/dist swift package --allow-writing-to-directory ./docs generate-documentation --disable-indexing --target WebKit --output-path ./docs --transform-for-static-hosting --hosting-base-path "/webkit/Documentation"
4+
5+
preview:
6+
DOCC_HTML_DIR=ThirdParty/docc-render-artifact/dist swift package --disable-sandbox preview-documentation --product WebKit
7+
8+
docc:
9+
rm -rf docs/
10+
xcodebuild docbuild -scheme WebKit -destination 'platform=macOS' -derivedDataPath ./docs

Package.resolved

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// swift-tools-version: 5.6
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "WebKit",
8+
platforms: [
9+
.macOS(.v10_13)
10+
],
11+
products: [
12+
// Products define the executables and libraries a package produces, and make them visible to other packages.
13+
.library(
14+
name: "WebKit",
15+
targets: ["WebKit"]),
16+
],
17+
dependencies: [
18+
// Dependencies declare other packages that this package depends on.
19+
// .package(url: /* package url */, from: "1.0.0"),
20+
.package(url: "https://github.com/apple/swift-docc-plugin", branch: "main"),
21+
],
22+
targets: [
23+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
24+
// Targets can depend on other targets in this package, and on products in packages this package depends on.
25+
.target(
26+
name: "WebKit",
27+
dependencies: []),
28+
]
29+
)

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# WebKit Documentation
2+
3+
This repository contains the documentation for the WebKit Project.
4+
5+
## Build Documentation
6+
7+
### Preview Documentation Locally
8+
```
9+
make preview
10+
```
11+
12+
### Docc Archive (Xcode)
13+
```
14+
make docc
15+
```
16+
17+
### GitHub Release
18+
```
19+
make github
20+
```

Sources/WebKit/EmptyFile.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// We require an empty file here.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing
2+
3+
The contributing guidelines outlined here are for a future GitHub based workflow. Up-to-date WebKit contribution guidelines are best outlined in our ReadMe.
4+
5+
## Checking Out WebKit
6+
7+
WebKit can be checked out via GitHub's https remote with:
8+
```
9+
git clone https://github.com/WebKit/WebKit.git WebKit
10+
```
11+
12+
Or, if a [ssh key](https://github.com/settings/keys) has already been added to your GitHub profile:
13+
```
14+
git clone [email protected]:WebKit/WebKit.git WebKit
15+
```
16+
17+
For more information about alternate WebKit remotes, consult [Alternate Remotes](/WebKit/WebKit/wiki/Git-Config#Alternate-Remotes)
18+
19+
## Setup
20+
21+
### git-webkit
22+
23+
WebKit provides a number of scripts in [Tools/Scripts](https://github.com/WebKit/WebKit/tree/main/Tools/Scripts) to aid in development. We recommend putting [Tools/Scripts](https://github.com/WebKit/WebKit/tree/main/Tools/Scripts) on your `PATH`. In particular, if [Tools/Scripts](https://github.com/WebKit/WebKit/tree/main/Tools/Scripts) is integrated into your `PATH`, the [git-webkit](https://github.com/WebKit/WebKit/tree/main/Tools/Scripts/git-webkit) script, which provides various programs for interaction with the WebKit repository, can be invoked as `git webkit`.
24+
25+
### git-webkit setup
26+
27+
The `setup` sub-command of [git-webkit](https://github.com/WebKit/WebKit/tree/main/Tools/Scripts/git-webkit) configures your local WebKit checkout for contributing code to the WebKit project. This script will occasionally prompt the user for input. The script does the following:
28+
29+
* Set your [name](/WebKit/WebKit/wiki/Git-Config#username) and [email address](/WebKit/WebKit/wiki/Git-Config#useremail) for the WebKit repository
30+
* [Make Objective-C diffs easier to digest](/WebKit/WebKit/wiki/Git-Config#diff)
31+
* Setup a commit message generator
32+
* Set an [editor for commit messages](/WebKit/WebKit/wiki/Git-Config#coreeditor)
33+
* Store a [GitHub API token](https://github.com/settings/tokens) in your system credential store
34+
* Configure `git` to use the [GitHub API token](https://github.com/settings/tokens) when prompted for credentials, if using the HTTPS remote
35+
* Create a [user owned fork](/WebKit/WebKit/wiki/Git-Config#Forking) of the WebKit repository
36+
37+
### git-webkit setup-git-svn
38+
39+
As long as WebKit has Subversion as its source of truth, and a contributor wishes to commit directly from their GitHub checkout, it is necessary to configure `git svn` with `git-webkit setup-git-svn`.
40+
41+
## Contributing Code
42+
43+
https://webkit.org/contributing-code/ outlines how to build and test WebKit along with code style guidelines and testing policies.
44+
45+
Once a bug has been prepared and a code change drafted locally, contributors should run `git-webkit pr` to automatically generate a pull request. That script will do a few things:
46+
47+
* Create a `eng/` prefixed pull-request branch, if needed (e.g. `eng/constants-buffer` branch)
48+
* Create a commit with locally modified files, if needed
49+
* Rebase the pull-request branch against the latest version of its parent branch
50+
* Push the pull-request branch to a user's personal fork of the project
51+
* Create (or update) a pull-request to merge to the parent branch in WebKit
52+
53+
Note that the same process is used to update an already published pull-request. For a detailed breakdown on the expected format of WebKit pull requests, see [Pull Requests](/WebKit/WebKit/wiki/Pull-Requests).
54+
55+
## Code Review
56+
57+
### Updating a PR
58+
59+
Make sure you're on the right branch. Make the necessary changes in your source tree. When you're ready, run `git-webkit pr` again to update the PR.
60+
61+
Before being landed by a [committer](https://github.com/orgs/WebKit/teams/committers), code must be reviewed by a [reviewer](https://github.com/orgs/WebKit/teams/reviewers). After a change is approved (sometimes through an `r+` or `r=me` in pull-request comments), it's the responsibility of the commit author to be sure that the change will not fail any EWS queues, this is not automatically enforced for most queues to speed up development.
62+
63+
## Landing Changes
64+
65+
### Merge-Queue
66+
67+
To land a pull request, add the [`merge-queue`](https://github.com/WebKit/WebKit/labels?q=merge-queue) or [`unsafe-merge-queue`](https://github.com/WebKit/WebKit/labels?q=unfsafe-merge-queue) label to your pull request. These labels will put your pull request into the [Merge-Queue](https://ews-build.webkit.org/#/builders/74) and [Unsafe-Merge-Queue](https://ews-build.webkit.org/#/builders/75), respectively, which will commit your pull request to the WebKit repository
68+
69+
[Unsafe-Merge-Queue](https://ews-build.webkit.org/#/builders/75) inserts reviewer information into a commit's message and modified change logs. We then check to ensure that a pull request has been reviewed by checking the commit message before landing the change. [Unsafe-Merge-Queue](https://ews-build.webkit.org/#/builders/75) _does not_ validate that a pull request builds.
70+
71+
Along with the actions performed by [Unsafe-Merge-Queue](https://ews-build.webkit.org/#/builders/75), [Merge-Queue](https://ews-build.webkit.org/#/builders/74) will validate that a pull request builds and run layout tests before landing the change.
72+
73+
### git-webkit land
74+
75+
_Landing should be achieved via merge-queue, this outlines the current behavior of `git-webkit land`_
76+
77+
To land a change, run `git-webkit land` from the branch to be landed. Note that only a [committer](https://github.com/orgs/WebKit/teams/committers) has the privileges to commit a change to the WebKit repository. `git-webkit land` does the following:
78+
79+
* Check to ensure a pull-request is approved and not blocked
80+
* Insert reviewer names into the commit message
81+
* Rebase the pull-request against its parent branch
82+
* [Canonicalize](https://github.com/WebKit/WebKit/wiki/Source-Control#canonicalization) the commits to be landed
83+
* Push changes to [svn.webkit.org](https://svn.webkit.org/repository/webkit/)
84+
* Wait for the GitHub mirror to pick up [svn.webkit.org](https://svn.webkit.org/repository/webkit/) changes
85+
* Update the pull-request with the landed commit
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Git Config
2+
3+
The WebKit project outlines a simplified recommended setup. This section outlines in greater detail other configuration options certain contributors may prefer.
4+
5+
## Remotes
6+
7+
### Alternate Remotes
8+
9+
The WebKit project currently has 5 different remotes:
10+
11+
- [github.com/WebKit/WebKit](https://github.com/WebKit/WebKit)
12+
- [svn.webkit.org](https://svn.webkit.org/repository/webkit/)
13+
- [git.webkit.org (https)](https://git.webkit.org/?p=WebKit.git;a=summary)
14+
- [git.webkit.org (http)](https://git.webkit.org/?p=WebKit.git;a=summary)
15+
- [github.com/WebKit/WebKit-http](https://github.com/WebKit/WebKit-http)
16+
17+
The first remote, [github.com/WebKit/WebKit](https://github.com/WebKit/WebKit), is an actively maintained `git` mirror of [svn.webkit.org](https://svn.webkit.org/repository/webkit/) that will soon become the canonical home of the WebKit project. We strongly recommend that all contributors use this remote for routine development.
18+
19+
The second remote, [svn.webkit.org](https://svn.webkit.org/repository/webkit/), is the current canonical remote for the WebKit project. If a contributor is contributing to the WebKit project on a release branch, this is the remote they should be using. Note that this remote is Subversion, not git.
20+
21+
[git.webkit.org (https)](https://git.webkit.org/?p=WebKit.git;a=summary) is a deprecated `git` mirror of [svn.webkit.org](https://svn.webkit.org/repository/webkit/). This mirror is maintained, but commit authorship is incorrect. This means that the shas of commits in this repository _do not_ match those from [github.com/WebKit/WebKit](https://github.com/WebKit/WebKit). This remote is sufficient for patch workflows, but contributors relying on it should migrate to [github.com/WebKit/WebKit](https://github.com/WebKit/WebKit) as we start using pull requests.
22+
23+
[git.webkit.org (http)](https://git.webkit.org/?p=WebKit.git;a=summary) and [github.com/WebKit/WebKit-http](https://github.com/WebKit/WebKit-http) the same repository but served in different locations. This remote is no longer maintained and should not be relied on.
24+
25+
### Forking
26+
27+
Since `git` is a decentralized version control system, a local copy can work with any remote that has the same set of shas. GitHub pull requests take advantage of this. After running [`git-webkit setup`](/WebKit/WebKit/wiki/Contributing#setup), the `.git/config` in the local WebKit repository should look something like this:
28+
29+
```
30+
[remote "origin"]
31+
url = https://github.com/WebKit/WebKit.git
32+
fetch = +refs/heads/*:refs/remotes/origin/*
33+
[remote "<username>"]
34+
url = https://github.com/<username>/WebKit.git
35+
fetch = +refs/heads/*:refs/remotes/<username>/*
36+
[remote "fork"]
37+
url = https://github.com/<username>/WebKit.git
38+
fetch = +refs/heads/*:refs/remotes/fork/*
39+
```
40+
41+
Now, if a contributor runs `git push fork eng/some-branch`, `eng/some-branch` will be pushed to the remote `fork`, which should correspond to that contributor's personal fork of the WebKit project on GitHub. Likewise, running `git checkout remotes/fork/eng/some-branch` will checkout `eng/some-branch` according to that contributor's `fork` remote.
42+
43+
[`git-webkit setup`](/WebKit/WebKit/wiki/Contributing#setup) also configures a remote with a contributors GitHub username. This is because if other contributors would like to checkout code from a pull request which they do not own, contributors will need to add this:
44+
45+
```
46+
[remote "<username>"]
47+
url = https://github.com/<username>/WebKit.git
48+
fetch = +refs/heads/*:refs/remotes/<username>/*
49+
```
50+
51+
to their `.git/config` and run `git checkout remotes/<username>/eng/some-branch`. This is what `git-webkit checkout pr-#` and EWS machines do to retrieve a contributor's change.
52+
53+
## Configuration Options
54+
55+
[`git-webkit setup`](/WebKit/WebKit/wiki/Contributing#setup) automatically sets or prompts the contributor to define a number of `git` configuration options. Most contributors should use the defaults recommended by [`git-webkit setup`](/WebKit/WebKit/wiki/Contributing#setup). This section defines, in detail, what an option does and why the WebKit project recommends a certain setting.
56+
57+
### user.email
58+
59+
Prompts:
60+
```
61+
Set '<email>' as the git user email for this repository
62+
Enter git user email for this repository:
63+
```
64+
65+
The `user.email` option is usually configured globally, and will become the contact information in `git` when authoring or committing a change. This is also the part of a commit that GitHub uses when attributing commits to specific users. The email a contributor defines here should be one of that contributor's emails in GitHub so that changes are correctly attributed to the contributor.
66+
67+
The WebKit project asks contributors to define this value for their WebKit repository specifically because a contributor's reported email may change over time, and may even differ between machines. [`git-webkit setup`'s](/WebKit/WebKit/wiki/Contributing#setup) prompt is an effort to make contributors think about what their reported contact information for this specific checkout should be.
68+
69+
Note that the author and committer listed in a `git` commit can easily be spoofed, so `user.email` plays no part in authentication. It is strictly for communication to other contributors.
70+
71+
### user.name
72+
73+
Prompts:
74+
```
75+
Set '<name>' as the git user name for this repository
76+
Enter git user name for this repository:
77+
```
78+
79+
The `user.name` option is usually configured globally, and will become the listed name in `git` when authoring or committing a change. The name a contributor defines here should be one that individual expects other contributors to use when interacting with them.
80+
81+
Note that the author and committer listed in a `git` commit can easily be spoofed, so `user.name` plays no part in authentication. It is strictly for communication to other contributors.
82+
83+
### pull.rebase
84+
85+
When a contributor is updating a branch from a remote, a local branch may have commits that do not exist on the remote. This usually happens when a contributor is committing local changes. `git` supports "rebasing" and "merging" in these cases.
86+
87+
"rebasing" means updating the local branch reference to match the remote and then re-applying local commits on top of the tip of the updated branch. For changes which are small relative to the size of the repository, this is the cleanest method of applying local changes to an updated branch.
88+
89+
"merging" means creating a new "merge commit" which has both the most recent commit from the newly updated remote and the most recent local commit as its parents. This technique is useful if the number and magnitude of local commits are large relative to the size of the repository. Note that many project explicitly ban pushing merge commits because they can make bisection and reasoning about continuous integration difficult.
90+
91+
The `pull.rebase` configuration will automatically use a `rebase` workflow when running `git pull`. The WebKit project strongly recommends a `rebase` workflow and does not allow merge commits on `main` and other protected branches.
92+
93+
### color.status/color.diff/color.branch
94+
95+
Prompts:
96+
```
97+
Auto-color status, diff, and branch for this repository?
98+
```
99+
100+
Applies coloring to various `git` commands, most notably `git log` and `git diff`. A number of `git-webkit` commands also use this configuration setting when deciding when to display color. Most users will want to use `auto`, although contributors who are colorblind may wish to either customize these colors or disable them completely.
101+
102+
### diff.*
103+
104+
`diff` options will apply to different file types and modify the output of `git diff` to be more human-readable.
105+
106+
### core.editor
107+
108+
Prompts:
109+
```
110+
Pick a commit message editor for this repository:
111+
1) [default]
112+
2) Sublime
113+
3) vi
114+
4) open
115+
```
116+
117+
When creating or editing commit messages, `git` will invoke an external editor. By default on most systems, this is `vi`. The `core.editor` option lets a user of `git` change what editor they would like to use globally or within a repository. Note that the invocation of the editor should block until the user closes the editor.
118+
119+
### merge.*
120+
121+
`git` does basic automatic conflict resolution, but certain types of files may be difficult to resolve with what `git` provides. Specifying a `merge.driver` for a category of files can help automatically resolve conflicts in these files when running `git` commands, most notable, `git pull`. This is most common with frequently changing versioning files or ChangeLogs.
122+
123+
### svn-remote
124+
125+
This configuration options pairs a local branch in a contributor's checkout to a subversion branch on a specified remote. This configuration is required to use `git svn` commands. Note that `git-webkit find` allows a pure `git` checkout to reason about Subversion revisions without specifying an `svn-remote` for the branch containing the revision in question.
126+
127+
## WebKit Options
128+
129+
[`git-webkit`] respects a few options that are specific to the `webkitscmpy` library. [`git-webkit setup`](/WebKit/WebKit/wiki/Contributing#setup) does automatically configure some of these, [`metadata/project_config`](/WebKit/WebKit/blob/main/metadata/project_config) also contains a few default values for the project.
130+
131+
### webkitscmpy.pull-request
132+
133+
When responding to review feedback, contributors can either append commits to their original changes or force push and overwrite existing commits. `git-webkit pull-request` supports both workflows, and the `webkitscmpy.pull-request` option can be set to either `overwrite` or `append` to control which workflow `git-webkit` assumes a contributor is using.
134+
135+
### webkitscmpy.history
136+
137+
Prompts:
138+
```
139+
Would you like to create new branches to retain history when you overwrite
140+
a pull request branch?
141+
1) [when-user-owned]
142+
2) disabled
143+
3) always
144+
4) never
145+
```
146+
147+
Managing pull requests often involves force pushing. This may result in historical changes being lost as a contributor responds to feedback. `git-webkit` supports saving old branches for the duration of a pull request. Some projects may wish to aggressively disable this option with `never` because contributors do not own user-specific forks. `when-user-owned` is generally considered the default option, which will create history branches only when a contributor owns a remote fork and is using the `overwrite` workflow.
148+

0 commit comments

Comments
 (0)