Skip to content

Commit

Permalink
Prepare release of Bemuse v47.0.0 (#571)
Browse files Browse the repository at this point in the history
Prepare release of Bemuse v47.0.0
  • Loading branch information
dtinth committed Sep 29, 2019
2 parents 48d7330 + 7bad53b commit 28f9c4a
Show file tree
Hide file tree
Showing 14 changed files with 379 additions and 332 deletions.
40 changes: 33 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,33 @@
[@hajimehoshi]: https://github.com/hajimehoshi
[@nekokan]: https://github.com/Nekokan

## v46.0.0 (2019-09-12)
## v47.0.0-pre.201909291634

### New stuff

- Add support for `?archive` query flag
([requested](https://twitter.com/Nekokan_Server/status/1173186650865713153) by
[@Nekokan]) [#568], by [@dtinth]

### Internals

- Updated some dependencies in response to
[GitHub security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies).
[#567], by [@dtinth]

### Improvements

- Fixed a CHANGELOG formatting issue where changelog text is broken into
multiple lines when viewed in Bemuse. [#569], by [@dtinth]
- Minor CHANGELOG update: Removed trailing .0.0 in version number. [#570], by
[@dtinth]

[#567]: https://github.com/bemusic/bemuse/pull/567
[#568]: https://github.com/bemusic/bemuse/pull/568
[#569]: https://github.com/bemusic/bemuse/pull/569
[#570]: https://github.com/bemusic/bemuse/pull/570

## v46 (2019-09-12)

### New stuff

Expand All @@ -36,7 +62,7 @@
[#553]: https://github.com/bemusic/bemuse/pull/553
[#554]: https://github.com/bemusic/bemuse/pull/554

## v45.1.0 (2019-09-02)
## v45.1 (2019-09-02)

### Internals

Expand All @@ -45,7 +71,7 @@

[#549]: https://github.com/bemusic/bemuse/pull/549

## v45.0.0 (2019-08-31)
## v45 (2019-08-31)

### New stuff

Expand All @@ -67,7 +93,7 @@
[#546]: https://github.com/bemusic/bemuse/pull/546
[#547]: https://github.com/bemusic/bemuse/pull/547

## v44.5.0 (2019-08-30)
## v44.5 (2019-08-30)

### Internals

Expand All @@ -78,7 +104,7 @@

[#544]: https://github.com/bemusic/bemuse/pull/544

## v44.4.0 (2019-08-29)
## v44.4 (2019-08-29)

### New stuff

Expand All @@ -92,7 +118,7 @@
[#541]: https://github.com/bemusic/bemuse/pull/541
[#542]: https://github.com/bemusic/bemuse/pull/542

## v44.3.0 (2019-08-29)
## v44.3 (2019-08-29)

### Internals

Expand All @@ -116,7 +142,7 @@

[#536]: https://github.com/bemusic/bemuse/pull/536

## v44.1.0 (2019-08-29)
## v44.1 (2019-08-29)

### New stuff

Expand Down
2 changes: 1 addition & 1 deletion bin/strip-changelog-pre-version-postfix
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ const data = fs.readFileSync('CHANGELOG.md', 'utf8')
const date = new Date().toJSON().split('T')[0]
fs.writeFileSync(
'CHANGELOG.md',
data.replace(/(## v[\d.]+)-pre\.\d+/g, `$1 (${date})`)
data.replace(/(## v[\d.]+?)(?:\.0)?(?:\.0)?-pre\.\d+/g, `$1 (${date})`)
)
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bemuse",
"version": "46.0.0",
"version": "47.0.0-pre.201909291634",
"description": "BEAT☆MUSIC☆SEQUENCE, a web-based music game of the future",
"main": "index.js",
"private": true,
Expand Down Expand Up @@ -145,14 +145,14 @@
"web-audio-test-api": "^0.5.2",
"webpack": "4.20.2",
"webpack-dev-middleware": "^3.4.0",
"webpack-dev-server": "3.1.9",
"webpack-dev-server": "3.1.11",
"worker-loader": "^2.0.0",
"yn": "^1.3.0"
},
"dependencies": {
"audio-context": "^1.0.3",
"auth0-js": "^9.8.0",
"axios": "^0.17.1",
"axios": "^0.18.1",
"baconjs": "^0.7.95",
"bemuse-indexer": "^45.1.0",
"bemuse-notechart": "^45.1.0",
Expand Down
27 changes: 27 additions & 0 deletions src/app/PreloadedCustomBMS.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { getPreloadArchiveFlag } from './query-flags'

let pending: string | null = String(getPreloadArchiveFlag() || '') || null

/**
* Returns `true` if there is a pending archive to be downloaded.
*
* @see https://github.com/bemusic/bemuse/pull/568
*/
export function hasPendingArchiveToLoad() {
return !!pending
}

/**
* Returns the URL to the pending archive to be downloaded.
* This function can be called once.
* After the URL is consumed, the pending URL is cleared.
*
* @see https://github.com/bemusic/bemuse/pull/568
*/
export function consumePendingArchiveURL() {
try {
return pending
} finally {
pending = null
}
}
2 changes: 1 addition & 1 deletion src/app/game-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function launch({
invariant(options, 'Options must be passed!')

// initialize the loading specification
// TODO: Create an object at the end instead of building object from blank.
// TODO: Create the LoadSpec object at the end instead of building object from blank.
let loadSpec: LoadSpec = {} as any
loadSpec.songId = song.id

Expand Down
14 changes: 14 additions & 0 deletions src/app/io/CustomSongsIO.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import * as ReduxState from '../redux/ReduxState'
import { createIO } from 'impure'

import DndResources from '../../resources/dnd-resources'
import {
downloadFileEntryFromURL,
CustomSongResources,
} from '../../resources/custom-song-resources'
import { getIPFSResources } from '../../resources/ipfs-resources'

export function handleCustomSongFolderDrop(event) {
Expand All @@ -13,6 +17,16 @@ export function handleCustomSongFolderDrop(event) {
})
}

export function handleCustomSongURLLoad(url) {
return createIO(async ({ store, customSongLoader }) => {
const resources = new CustomSongResources({
getFiles: async log => [await downloadFileEntryFromURL(url, log)],
})
const initialLog = ['Loading from ' + url]
return loadCustomSong(resources, initialLog, { store, customSongLoader })
})
}

export function handleClipboardPaste(e) {
return createIO(async ({ store, customSongLoader }) => {
let match
Expand Down
29 changes: 25 additions & 4 deletions src/app/query-flags.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
import query from 'bemuse/utils/query'

/**
* The `?server` flag specifies a URL to a Bemuse custom music server.
*
* @see https://bemuse.ninja/project/docs/music-server.html
*/
export function getMusicServer() {
return query.BEMUSE_MUSIC_SERVER || query.server
}

export function getInitialGrepString() {
return query.grep
/**
* The `?archive` flag specifies a URL to a BMS archive file to be downloaded when the player enters the game.
*
* @see https://github.com/bemusic/bemuse/pull/568
* @see https://twitter.com/Nekokan_Server/status/1173186650865713153
*/
export function getPreloadArchiveFlag() {
return query.archive
}

export function getTimeSynchroServer() {
return query.BEMUSE_TIMESYNCHRO_SERVER
/**
* The `?grep` flag specifies the initials search text to be pre-filled when the player enters the music selection screen.
*/
export function getInitialGrepString() {
return query.grep
}

/**
* The `?song` flag specifies the title of the song to be pre-selected when the player enters the music selection screen.
*/
export function getInitiallySelectedSong() {
return query.song
}

export function getTimeSynchroServer() {
return query.BEMUSE_TIMESYNCHRO_SERVER
}
14 changes: 12 additions & 2 deletions src/app/ui/CustomBMS.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import * as Analytics from '../analytics'
import * as CustomSongsIO from '../io/CustomSongsIO'
import * as ReduxState from '../redux/ReduxState'
import connectIO from '../../impure-react/connectIO'
import {
hasPendingArchiveToLoad,
consumePendingArchiveURL,
} from '../PreloadedCustomBMS'

const enhance = compose(
connect(state => ({
Expand All @@ -19,6 +23,7 @@ const enhance = compose(
connectIO({
onFileDrop: () => event => CustomSongsIO.handleCustomSongFolderDrop(event),
onPaste: () => e => CustomSongsIO.handleClipboardPaste(e),
loadFromURL: () => url => CustomSongsIO.handleCustomSongURLLoad(url),
})
)

Expand All @@ -28,6 +33,7 @@ class CustomBMS extends React.Component {
onFileDrop: PropTypes.func,
onPaste: PropTypes.func,
onSongLoaded: PropTypes.func,
loadFromURL: PropTypes.func,
}

constructor(props) {
Expand All @@ -37,6 +43,11 @@ class CustomBMS extends React.Component {

componentDidMount() {
window.addEventListener('paste', this.handlePaste)
if (hasPendingArchiveToLoad()) {
this.props.loadFromURL(consumePendingArchiveURL()).then(song => {
if (this.props.onSongLoaded) this.props.onSongLoaded(song)
})
}
}

componentWillUnmount() {
Expand Down Expand Up @@ -109,8 +120,7 @@ class CustomBMS extends React.Component {
this.setState({ hover: false })
Analytics.send('CustomBMS', 'drop')
e.preventDefault()
const promise = this.props.onFileDrop(e.nativeEvent)
promise.then(song => {
this.props.onFileDrop(e.nativeEvent).then(song => {
if (this.props.onSongLoaded) this.props.onSongLoaded(song)
})
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/ui/MusicSelectScene.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { connect } from 'react-redux'
import { connect as connectToLegacyStore } from 'bemuse/flux'
import { createSelector, createStructuredSelector } from 'reselect'
import { shouldShowOptions } from 'bemuse/devtools/query-flags'
import { hasPendingArchiveToLoad } from '../PreloadedCustomBMS'

import * as Analytics from '../analytics'
import * as MusicSearchIO from '../io/MusicSearchIO'
Expand Down Expand Up @@ -100,7 +101,7 @@ class MusicSelectScene extends React.PureComponent {
super(props)
this.state = {
optionsVisible: shouldShowOptions(),
customBMSVisible: false,
customBMSVisible: hasPendingArchiveToLoad(),
unofficialDisclaimerVisible: false,
inSong: false,
authenticationPopupVisible: false,
Expand Down
2 changes: 1 addition & 1 deletion src/game/display/player-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class PlayerDisplay {

export default PlayerDisplay

// TODO: MOVE THIS TO bemuse-notechart
// TODO: MOVE THIS (getKeyMode) TO bemuse-notechart
//
function getKeyMode(notechart, scratch) {
const usedColumns = {}
Expand Down
Loading

0 comments on commit 28f9c4a

Please sign in to comment.