Skip to content

Commit

Permalink
Split ospec, drop mithril-stream boilerplate
Browse files Browse the repository at this point in the history
I'm keeping the source code for ospec for *now*, but this is deprecated
with a runtime warning on load. We've not documented it for a while, but
since I previously had people try the internal version, I need to be a
little more proactive in pushing people over to the separate npm
version. (It's actually up to date now.)
  • Loading branch information
dead-claudia committed Mar 16, 2020
1 parent 39c08f9 commit 87bd6e6
Show file tree
Hide file tree
Showing 73 changed files with 130 additions and 225 deletions.
3 changes: 0 additions & 3 deletions .github/CODE_OF_CONDUCT.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/feature-or-enhancement.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ assignees: isiahmeadows
Optional: Provide the exact version of Mithril you're experiencing issues with.
This could matter, even if it's really old like version 0.1.0. Do note that bugs
in older versions are commonly fixed in newer versions and that newer versions
do end up with a lot more features than older versions, so it's unlikely we'll
are much more actively maintained than older versions, so it's unlikely we'll
add new features to older versions like 0.1.x.
-->
**Mithril version:**

<!--
Optional: Provide the name and version of both the browser and operating system
you're running Mithril on. If it's multiple, feel free to list multiple. This
could matter, even if it's super ancient like IE 6 on Windows XP.
Optional: Provide the name and version of both the platform (Chrome, Node, etc.)
and operating system you're running Mithril on. If it's multiple, feel free to
list multiple. This could matter, even if it's super ancient like IE 6 on
Windows XP.
-->
**Browser and OS:**
**Platform and OS:**

<!--
Optional: Provide a link to your project, if it happens to be open source or if
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
- [ ] I have read the **CONTRIBUTING** document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [ ] I have updated `docs/change-log.md`
- [ ] I have updated `docs/changelog.md`
2 changes: 1 addition & 1 deletion api/tests/test-mountRedraw.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict"

// Low-priority TODO: remove the dependency on the renderer here.
var o = require("../../ospec/ospec")
var o = require("ospec")
var components = require("../../test-utils/components")
var domMock = require("../../test-utils/domMock")
var throttleMocker = require("../../test-utils/throttleMock")
Expand Down
2 changes: 1 addition & 1 deletion api/tests/test-router.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict"

// Low-priority TODO: remove the dependency on the renderer here.
var o = require("../../ospec/ospec")
var o = require("ospec")
var browserMock = require("../../test-utils/browserMock")
var throttleMocker = require("../../test-utils/throttleMock")

Expand Down
2 changes: 1 addition & 1 deletion api/tests/test-routerGetSet.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict"

// Low-priority TODO: remove the dependency on the renderer here.
var o = require("../../ospec/ospec")
var o = require("ospec")
var callAsync = require("../../test-utils/callAsync")
var browserMock = require("../../test-utils/browserMock")
var throttleMocker = require("../../test-utils/throttleMock")
Expand Down
25 changes: 23 additions & 2 deletions docs/change-log.md → docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
- [v1.x changelog](https://mithril.js.org/archive/v1.1.7/change-log.html)
- [v1.x docs](https://mithril.js.org/archive/v1.1.7/index.html)
- [v0.2 docs](https://mithril.js.org/archive/v0.2.5/index.html)
- [`ospec` change log](https://github.com/MithrilJS/mithril.js/blob/master/ospec/change-log.md)
- [`mithril/stream` change log](https://github.com/MithrilJS/mithril.js/blob/master/stream/change-log.md)
- [`ospec` change log](https://github.com/MithrilJS/ospec/blob/master/changelog.md)
- [`mithril-stream` change log](#mithril-stream-change-log)

---

Expand All @@ -20,6 +20,8 @@
*Note for later: release as semver-minor.*
PSA: changes to [`mithril/stream`](stream.md) are now specified in this change log. I've also moved the old
- Reduced package download size substantially by removing the archive of previous releases' documentation. ([#2561](https://github.com/MithrilJS/mithril.js/pull/2561) [@cztomsik](https://github.com/cztomsik))
- Improved error messages in multiple places. ([#2536](https://github.com/MithrilJS/mithril.js/pull/2536) [@isiahmeadows](https://github.com/isiahmeadows))
- The redraw reentrancy check was moved from `m.mount` to `m.render` and its error message was updated accordingly. ([#2536](https://github.com/MithrilJS/mithril.js/pull/2536) [@isiahmeadows](https://github.com/isiahmeadows))
Expand Down Expand Up @@ -179,3 +181,22 @@ _2019-07-24_
- docs: clarify valid key usage ([#2452](https://github.com/MithrilJS/mithril.js/pull/2452) [@isiahmeadows](https://github.com/isiahmeadows))
- route: don't pollute globals ([#2453](https://github.com/MithrilJS/mithril.js/pull/2453) [@isiahmeadows](https://github.com/isiahmeadows))
- request: track xhr replacements correctly ([#2455](https://github.com/MithrilJS/mithril.js/pull/2455) [@isiahmeadows](https://github.com/isiahmeadows))

## `mithril-stream` change log

Formerly, `mithril/stream` was available standalone as the package `mithril-stream`, but this package has been deprecated and is no longer updated. The changelog for that package prior to being merged back into Mithril proper is below.

### 2.0.0
_2019-02-07_

- when a stream conditionally returns HALT, dependant stream will also end ([#2200](https://github.com/MithrilJS/mithril.js/pull/2200), [#2369](https://github.com/MithrilJS/mithril.js/pull/2369))
- Add `stream.lift` as a user-friendly alternative to `merge -> map` or `combine` ([#1944](https://github.com/MithrilJS/mithril.js/issues/1944))
- renamed HALT to SKIP ([#2207](https://github.com/MithrilJS/mithril.js/pull/2207))
- rewrote implementation ([#2207](https://github.com/MithrilJS/mithril.js/pull/2207))
- Removed `valueOf` & `toString` methods ([#2150](https://github.com/MithrilJS/mithril.js/pull/2150))
- fixed `stream.end` propagation ([#2369](https://github.com/MithrilJS/mithril.js/pull/2369))

### 1.1.0
_2017-07-13_

- Move the "use strict" directive inside the IIFE [#1831](https://github.com/MithrilJS/mithril.js/issues/1831) ([#1893](https://github.com/MithrilJS/mithril.js/pull/1893))
2 changes: 1 addition & 1 deletion docs/nav-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
- [Code of Conduct](code-of-conduct.md)
- Misc
- [Framework comparison](framework-comparison.md)
- [Change log/Migration](change-log.md)
- [Change log/Migration](changelog.md)
- [v1 Documentation](https://mithril.js.org/archive/v1.1.7/)
- [v0.2 Documentation](https://mithril.js.org/archive/v0.2.5/)
71 changes: 5 additions & 66 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

- [Releasing a new Mithril version](#releasing-a-new-mithril-version)
- [Updating mithril.js.org](#updating-mithriljsorg)
- [Releasing a new ospec version](#releasing-a-new-ospec-version)

## Releasing a new Mithril version

Expand All @@ -18,7 +17,7 @@ $ git pull --rebase mithriljs next
```

2. Determine patch level of the change
3. Update information in `docs/change-log.md` to match reality of the new version being prepared for release.
3. Update information in `docs/changelog.md` to match reality of the new version being prepared for release.
- Don't forget to add today's date under the version heading!
4. Replace all existing references to `mithril@next` to `mithril` if moving from a release candidate to stable.
- Note: if making an initial release candidate, don't forget to move all the playground snippets to pull from `mithril@next`!
Expand Down Expand Up @@ -96,11 +95,11 @@ $ git push mithriljs next

### Update the GitHub release

16. The GitHub Release will require a manual description & title to be added. I suggest coming up with a fun title & then copying the `docs/change-log.md` entry for the build.
16. The GitHub Release will require a manual description & title to be added. I suggest coming up with a fun title & then copying the `docs/changelog.md` entry for the build.

## Updating mithril.js.org

Fixes to documentation can land whenever, updates to the site are published via Travis.
Fixes to documentation can land whenever, updates to the site are built and published via `scripts/update-docs.js`.

```bash
# These steps assume that MithrilJS/mithril.js is a git remote named "mithriljs"
Expand All @@ -115,69 +114,9 @@ $ git checkout next -- ./docs

# Manually ensure that no new feature docs were added

$ git push mithriljs
$ node scripts/update-docs
```

After the Travis build completes the updated docs should appear on https://mithril.js.org in a few minutes.
After the docs build completes, the updated docs should appear on https://mithril.js.org in a few minutes.

**Note:** When updating the stable version with a release candidate out, ***make sure to update the index + navigation to point to the new stable version!!!***

## Releasing a new ospec version

1. Ensure your local branch is up to date

```bash
$ git checkout next
$ git pull --rebase mithriljs next
```

2. Determine patch level of the change
3. Update `version` field in `ospec/package.json` to match new version being prepared for release.
4. Update `ospec/change-log.md` to match new version being prepared for release.
- Don't forget to add today's date under the version heading!
5. Commit changes to `next`

```
$ git add .
$ git commit -m "chore(ospec): ospec@<version>"
# Push to your branch
$ git push
# Push to MithrilJS/mithril.js
$ git push mithriljs next
```

### Merge from `next` to `master`

5. Switch to `master` and make sure it's up to date

```bash
$ git checkout master
$ git pull --rebase mithriljs master
```

6. merge `next` on top of it

```bash
$ git checkout next -- ./ospec
$ git add .
$ git commit -m "chore(ospec): ospec@<version>"
```

7. Ensure the tests are passing!

### Publish the release

8. Push the changes to `MithrilJS/mithril.js`

```bash
$ git push mithriljs master
```

9. Publish the changes to npm **from the `/ospec` folder**. That bit is important to ensure you don't accidentally ship a new Mithril release!

```bash
$ cd ./ospec
$ npm publish
```
6 changes: 6 additions & 0 deletions ospec/ospec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
if (typeof module !== "undefined") module["exports"] = m()
else window.o = m()
})(function init(name) {
console.warn(
"Please switch to the `ospec` package to remove this warning and see " +
"the most recent features. Using the `ospec` bundled within Mithril " +
"is deprecated, and it will be removed in the next major release."
)

var spec = {}, subjects = [], results, only = [], ctx = spec, start, stack = 0, nextTickish, hasProcess = typeof process === "object", hasOwn = ({}).hasOwnProperty
var ospecFileName = getStackName(ensureStackTrace(new Error), /[\/\\](.*?):\d+:\d+/), timeoutStackName
var globalTimeout = noTimeoutRightNow
Expand Down
4 changes: 4 additions & 0 deletions ospec/tests/test-ospec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ var o, callAsync
if (typeof require !== "undefined") {
/* eslint-disable global-require */
callAsync = require("../../test-utils/callAsync")
var warn = console.warn
// Let's drop the warning to leave the console a little less noisy.
console.warn = function() {}
o = require("../ospec")
console.warn = warn
/* eslint-enable global-require */
} else {
callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout
Expand Down
31 changes: 14 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Leo Horie",
"license": "MIT",
"unpkg": "mithril.min.js",
"repository": "MithrilJS/mithril.js",
"repository": "github:MithrilJS/mithril.js",
"scripts": {
"precommit": "lint-staged",
"watch": "run-p watch:**",
Expand All @@ -24,7 +24,7 @@
"perf": "node performance/test-perf.js",
"pretest": "npm run lint",
"test": "run-s test:js",
"test:js": "node ospec/bin/ospec",
"test:js": "ospec",
"cover": "istanbul cover --print both ospec/bin/ospec",
"release": "npm version -m 'v%s'",
"version": "npm run build && git add mithril.js mithril.min.js stream.js stream.min.js README.md"
Expand All @@ -45,6 +45,7 @@
"marked": "^0.7.0",
"minimist": "^1.2.0",
"npm-run-all": "^4.1.5",
"ospec": "^4.0.1",
"pinpoint": "^1.1.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
Expand All @@ -61,5 +62,7 @@
"git add"
]
},
"dependencies": {}
"dependencies": {
"ospec": "*"
}
}
2 changes: 1 addition & 1 deletion pathname/tests/test-buildPathname.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict"

var o = require("../../ospec/ospec")
var o = require("ospec")
var buildPathname = require("../../pathname/build")

o.spec("buildPathname", function() {
Expand Down
Loading

0 comments on commit 87bd6e6

Please sign in to comment.