Skip to content

Commit 247c9db

Browse files
committed
docs: update copy
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 017e2cf commit 247c9db

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

docs/contributing/moving_packages.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ cp -R lib/node_modules/@stdlib/stats/base/dmax lib/node_modules/@stdlib/stats/st
6464

6565
Next, update the contents of the new package, which is likely to include the following:
6666

67-
- The package name (`package.json`, `lib/index.js`, `README.md`, and any other files which include the name of the original package.
67+
- The package name, as found in files, such as `package.json`, `lib/index.js`, `README.md`, and any other files which include the name of the original package.
6868

6969
- If a package contains `src` and `include` directories,
7070

71-
- update the directory tree according to the path of the new package (e.g., `include/stdlib/stats/base/dmax` would become `include/stdlib/stats/strided/dmax`).
71+
- update the `include` directory tree according to the path of the new package (e.g., `include/stdlib/stats/base/dmax` would become `include/stdlib/stats/strided/dmax`).
7272
- update header guards within header files in the `include` directory (e.g., `STDLIB_STATS_BASE_DMAX` would become `STDLIB_STATS_STRIDED_DMAX`).
7373

7474
There may be other contents needing updating, so be sure to carefully inspect package contents.
@@ -91,7 +91,7 @@ make install-node-addons NODE_ADDONS_PATTERN="stats/strided/dmax"
9191

9292
To ensure that the new package works as intended, run the package's unit tests and other quality control commands.
9393

94-
#### Unit tests
94+
#### a. Unit tests
9595

9696
```bash
9797
make test TESTS_FILTER=".*/path/to/new/package/.*"
@@ -103,7 +103,7 @@ For example,
103103
make test TESTS_FILTER=".*/stats/strided/dmax/.*"
104104
```
105105

106-
#### Examples
106+
#### b. Examples
107107

108108
```bash
109109
make examples EXAMPLES_FILTER=".*/path/to/new/package/.*"
@@ -127,7 +127,7 @@ For example,
127127
make examples-c EXAMPLES_FILTER=".*/stats/strided/dmax/.*"
128128
```
129129

130-
#### Benchmarks
130+
#### c. Benchmarks
131131

132132
```bash
133133
make benchmark BENCHMARKS_FILTER=".*/path/to/new/package/.*"
@@ -177,7 +177,7 @@ Ref: https://github.com/stdlib-js/stdlib/issues/4797
177177

178178
### 6. Remove the export of the original package from its parent namespace
179179

180-
Next, open the `lib/index.js` file found in the parent namespace of the original package (e.g., `lib/node_modules/@stdlib/stats/base/lib/index.js`.
180+
Next, open the `lib/index.js` file found in the parent namespace of the original package (e.g., `lib/node_modules/@stdlib/stats/base/lib/index.js`).
181181

182182
If that file includes an exported symbol from the original package, remove it. For example,
183183

@@ -212,13 +212,13 @@ In your commit message, you should include a `BREAKING_CHANGE`, migration instru
212212
```text
213213
remove: remove `dmax` from namespace
214214
215-
This commit removes the `dmax` symbol from the `stats/base`
215+
This commit removes the `dmax` symbol from the `@stdlib/stats/base`
216216
namespace due to a package migration.
217217
218218
BREAKING CHANGE: remove `dmax`
219219
220220
To migrate, users should access the same symbol via the
221-
`stats/strided` namespace.
221+
`@stdlib/stats/strided` namespace.
222222
```
223223

224224
### 8. Update paths using a global find-and-replace
@@ -227,13 +227,13 @@ Next, perform a global find-and-replace to migrate all `require` (and `import`)
227227

228228
For example, the following `require` statement
229229

230-
```text
230+
```javascript
231231
var dmax = require( 'stats/base/dmax' );
232232
```
233233

234234
should become
235235

236-
```text
236+
```javascript
237237
var dmax = require( 'stats/strided/dmax' );
238238
```
239239

@@ -246,27 +246,33 @@ A couple of very important notes to keep in mind when performing a global find-a
246246

247247
There are three packages where we do **not** want to update `require` paths.
248248

249-
- The original package. The original package should remain working and keeps its original paths.
250-
- The global error database. The global error database is an append-only log. We need to avoid invalidating any existing references.
251-
- The REPL databases. Given the high velocity of stdlib development, updating these databases will create merge conflicts, which do not need to be immediately resolved. We can avoid the hassle of needing to rectify these conflicts by deferring to stdlib's daily cron job which automatically maintains and updates these databases.
249+
- **The original package.** The original package should remain working and keep its original paths.
250+
- **The global error database.** The global error database is an append-only log. We need to avoid invalidating any existing references.
251+
- **The REPL databases.** Given the high velocity of stdlib development, updating these databases will create merge conflicts, which do not need to be immediately resolved. We can avoid the hassle of needing to rectify these conflicts by deferring to stdlib's daily cron job which automatically maintains and updates these databases.
252252

253253
To dismiss any changes made to the above, run the following command
254254

255255
```bash
256-
git checkout -- ./lib/node_modules/@stdlib/path/to/original/package && git checkout -- ./lib/node_modules/@stdlib/error && git checkout -- ./lib/node_modules/@stdlib/repl/**/data && git status
256+
git checkout -- ./lib/node_modules/@stdlib/path/to/original/package && \
257+
git checkout -- ./lib/node_modules/@stdlib/error && \
258+
git checkout -- ./lib/node_modules/@stdlib/repl/**/data && \
259+
git status
257260
```
258261

259262
For example,
260263

261264
```bash
262-
git checkout -- ./lib/node_modules/@stdlib/stats/base/dmax && git checkout -- ./lib/node_modules/@stdlib/error && git checkout -- ./lib/node_modules/@stdlib/repl/**/data && git status
265+
git checkout -- ./lib/node_modules/@stdlib/stats/base/dmax && \
266+
git checkout -- ./lib/node_modules/@stdlib/error && \
267+
git checkout -- ./lib/node_modules/@stdlib/repl/**/data && \
268+
git status
263269
```
264270

265271
After running the above, double-check the results of `git status` to check that the list of changed files matches expectation.
266272

267273
### 10. Commit changes
268274

269-
Now that you've cleaned up the path updates, commit the changes to your branch.
275+
Now that you've cleaned up paths, commit the changes to your branch.
270276

271277
```bash
272278
git add . && git commit
@@ -344,8 +350,8 @@ If you made these changes on a fork, you should open a pull request against the
344350

345351
- A pull request should **only** migrate a single package. Please do **not** open pull request which attempts to migrate multiple packages at the same time.
346352
- Notice that every commit includes a `Ref:` link back to the RFC issue on the main project repository. This is useful for providing additional context regarding changes, especially those involving deprecations.
347-
- Provided you have properly setup your local repository (see the [contributing][stdlib-contributing] and [development][stdlib-development] guides), linting will be performed after every commit, and, prior to pushing changes to a remote repository, affected unit tests, examples, and benchmarks should automatically run. Depending on how widely used the original package was throughout stdlib, these quality control steps may take considerable time, and it is possible that unrelated lint errors may be flagged. If possible, address any failures, restage the changes, and attempt to commit or push again. Note that resolution of failures, may require amending previous commits.
348-
- As mentioned above, be **very careful** when performing global find-and-replace. It can be easy to mistakenly update non-applicable paths, thus breaking packages and all downstream dependents. You've been warned.
353+
- Provided you have properly setup your local repository (see the [contributing][stdlib-contributing] and [development][stdlib-development] guides), linting will be performed after every commit, and, prior to pushing changes to a remote repository, affected unit tests, examples, and benchmarks should automatically run. Depending on how widely used the original package was throughout stdlib, these quality control steps may take considerable time, and it is possible that unrelated lint errors may be flagged. If possible, address any failures, restage the changes, and attempt to commit or push again. Note that resolution of failures may require amending previous commits.
354+
- As mentioned above, be **very careful** when performing a global find-and-replace. It can be easy to mistakenly update non-applicable paths, thus breaking packages and all downstream dependents. You've been warned.
349355

350356
* * *
351357

@@ -359,16 +365,16 @@ The following is a checklist you can use when performing a package migration:
359365
- [ ] Updated include directories in the new package.
360366
- [ ] Updated header guards in the new package.
361367
- [ ] Compiled native code and ran unit tests for the new package.
362-
- [ ] Committed the new package to the migration branch.
368+
- [ ] Committed the new package to a migration branch, with a link to any relevant public GitHub issues.
363369
- [ ] Removed the export of the original package from its parent namespace (if applicable).
364-
- [ ] Committed the changes to the parent namespace (if applicable).
370+
- [ ] Committed the changes to the parent namespace (if applicable), with a link to any relevant public GitHub issues and with user migration instructions.
365371
- [ ] Updated `require` paths across the project to refer to the new package.
366372
- [ ] Discarded any path changes to the original package.
367373
- [ ] Discarded any path changes to the `@stdlib/error` namespace.
368-
- [ ] Discarded any path changes to the `@stdlib/repl/**/data` database files.
369-
- [ ] Committed path updates.
374+
- [ ] Discarded any path changes to `@stdlib/repl/**/data` database files.
375+
- [ ] Committed path updates, with a link to any relevant public GitHub issues.
370376
- [ ] Removed the original package.
371-
- [ ] Committed removal of the original package.
377+
- [ ] Committed removal of the original package, with a link to any relevant public GitHub issues and with user migration instructions.
372378
- [ ] Resolved any encountered lint errors or test failures when committing and/or pushing changes.
373379
- [ ] Opened a pull request which performs one and only one package migration.
374380
- [ ] The pull request includes at most `4` commits.
@@ -388,15 +394,15 @@ When reviewing a pull request involving a package migration, one should do the f
388394
3. Inspect each commit for the following:
389395

390396
- `feat`: should only add the new package. Ensure that all `require` paths have been updated and correctly refer to the new package. Ensure that any `include` directories have been renamed. Ensure that header guards have been updated.
391-
- `remove`: should only remove the symbol from the original package.
392-
- `refactor`: check as many files as possible, ensuring a wide cross-section of affected files, to ensure that the updated paths correctly point to the new package.
397+
- `remove`: should only remove the symbol from the parent namespace of the original package.
398+
- `refactor`: should only update paths, but may include lint fixes if these were encountered while committing. Check as many files as possible in order to obtain a wide cross-section of affected files and ensure that the updated paths correctly point to the new package. Verify that affected packages do **not** include the original package, error databases, or REPL databases.
393399
- `remove`: should only remove the original package.
394400

395401
If there exists a public issue associated with the migration, ensure that each commit refers to that public issue with a `ref:` Git trailer.
396402

397403
Ensure that each `remove` commit message body includes a `BREAKING CHANGE` section, along with migration steps.
398404

399-
4. If the pull request has merge conflicts, inspect the conflicts and determine whether you can easily resolve. If the conflicts cannot be resolved, you'll likely need to block the pull request from being merged. If they can be resolve, go ahead and resolve them, creating a merge commit.
405+
4. If the pull request has merge conflicts, inspect the conflicts and determine whether you can easily resolve. If the conflicts cannot be resolved, you'll likely need to block the pull request from being merged. If they can be resolved, go ahead and resolve them, creating a merge commit.
400406

401407
5. If everything looks okay, approve the pull request changes.
402408

@@ -417,6 +423,7 @@ When reviewing a pull request involving a package migration, one should do the f
417423
- Select "Rebase and merge".
418424
- Confirm that you wish to perform the operation.
419425
- Merge.
426+
- Disable "Allow rebase merging" on GitHub in repository settings. Our default merge setting should be "Squash and merge", and we do not want to mistakenly perform rebase commits in future PRs.
420427
- Finished.
421428

422429
<section class="links">

0 commit comments

Comments
 (0)