Skip to content

Commit

Permalink
Merge pull request #701 from bemusic/release-train/proposed
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth authored Oct 11, 2021
2 parents af7eecf + 87e2e0e commit bc77b6e
Show file tree
Hide file tree
Showing 239 changed files with 2,306 additions and 1,756 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ rules:
import/no-unresolved: off
import/export: off
import/named: off
no-use-before-define: off
import/no-webpack-loader-syntax: off
overrides:
- files:
- '**/*.ts'
- '**/*.tsx'
rules:
no-undef: off
no-unused-vars: off
no-use-before-define: off
no-redeclare: off
no-useless-constructor: off
18 changes: 9 additions & 9 deletions .github/workflows/todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
name: Collect TODO
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set GitHub auth
run: |
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git"
- name: Collect TODO
uses: dtinth/todo-actions@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TODO_ACTIONS_MONGO_URL: ${{ secrets.TODO_ACTIONS_MONGO_URL }}
- uses: actions/checkout@master
- name: Set GitHub auth
run: |
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git"
- name: Collect TODO
uses: dtinth/todo-actions@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TODO_ACTIONS_MONGO_URL: ${{ secrets.TODO_ACTIONS_MONGO_URL }}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,21 @@
[@pnkapadia64]: https://github.com/pnkapadia64
[@tsfreddie]: https://github.com/TsFreddie
[@vishal5251]: https://github.com/vishal5251
[@dimitrov-d]: https://github.com/dimitrov-d
[@s-pace]: https://github.com/s-pace

## v49.0.1-pre.202110111207

### Internals

- Improved the code readability of custom songs folder feature. [#699], by
[@dimitrov-d]
- Prepare the codebase for implementing the detection of removed custom song
folder and upgraded Prettier to v2. [#700], by [@dtinth]

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

## v49 (2021-10-09)

### New stuff
Expand Down
7 changes: 2 additions & 5 deletions bemuse/config/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@ function applyKarmaConfig(config) {
return config
}

export const generateWebConfig = flowRight(
applyWebConfig,
generateBaseConfig
)
export const generateWebConfig = flowRight(applyWebConfig, generateBaseConfig)

export const generateKarmaConfig = flowRight(
applyKarmaConfig,
Expand All @@ -259,7 +256,7 @@ export default generateWebConfig()

function CompileProgressPlugin() {
const gauge = new Gauge()
return new webpack.ProgressPlugin(function(percentage, message) {
return new webpack.ProgressPlugin(function (percentage, message) {
if (percentage === 1) gauge.hide()
else gauge.show(message, percentage)
})
Expand Down
2 changes: 1 addition & 1 deletion bemuse/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ require('./node-environment')
require('gulp').registry(require('undertaker-forward-reference')())
require('glob')
.sync('./tasks/*.js')
.forEach(function(file) {
.forEach(function (file) {
require(file)
})
2 changes: 1 addition & 1 deletion bemuse/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('./node-environment')
if (!process.env.NODE_ENV) process.env.NODE_ENV = 'test'
process.env.CHROME_BIN = require('puppeteer').executablePath()

module.exports = function(config) {
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha'],
Expand Down
2 changes: 1 addition & 1 deletion bemuse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/react-dom": "16",
"@types/webpack-env": "^1.14.0",
"@types/wicg-file-system-access": "^2020.9.4",
"@typescript-eslint/parser": "^2.0.0",
"@typescript-eslint/parser": "^4.33.0",
"autoprefixer": "^9.1.5",
"body-parser": "^1.18.3",
"brfs": "^1.6.1",
Expand Down
2 changes: 1 addition & 1 deletion bemuse/src/app/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as Options from './entities/Options'
import getLR2Score from './interactors/getLR2Score'
import getNonMissedDeltas from './interactors/getNonMissedDeltas'

let ga = window.ga || function() {}
let ga = window.ga || function () {}
const startTime = Date.now()
const sid = ObjectID.generate()

Expand Down
8 changes: 4 additions & 4 deletions bemuse/src/app/entities/Collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import * as LoadState from './LoadState'

export const initialState = Immutable.Map()

export const beginLoading = url => state =>
export const beginLoading = (url) => (state) =>
state.set(url, LoadState.initLoading())

export const completeLoading = (url, data) => state =>
export const completeLoading = (url, data) => (state) =>
state.update(url, LoadState.completeWithValue(data))

export const errorLoading = (url, error) => state =>
export const errorLoading = (url, error) => (state) =>
state.update(url, LoadState.errorWithReason(error))

export const getCollectionByUrl = url => state => state.get(url)
export const getCollectionByUrl = (url) => (state) => state.get(url)
2 changes: 1 addition & 1 deletion bemuse/src/app/entities/Collections.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as LoadState from './LoadState'

import { given, shouldEqual } from 'circumstance'

describe('Collections', function() {
describe('Collections', function () {
it('should receive collection data', () =>
given(Collections.initialState)
.when(Collections.beginLoading('https://test-server/'))
Expand Down
21 changes: 12 additions & 9 deletions bemuse/src/app/entities/LoadState.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ import u from 'updeep'

// Initializers
export const initLoading = () => ({ status: 'loading' })
export const initCompletedWithValue = value => ({ status: 'completed', value })
export const initCompletedWithValue = (value) => ({
status: 'completed',
value,
})

// Queries
export const isLoading = state => state.status === 'loading'
export const isCompleted = state => state.status === 'completed'
export const isError = state => state.status === 'error'
export const value = state => state.value
export const error = state => isError(state) && state.error
export const isLoading = (state) => state.status === 'loading'
export const isCompleted = (state) => state.status === 'completed'
export const isError = (state) => state.status === 'error'
export const value = (state) => state.value
export const error = (state) => isError(state) && state.error

// State Updaters
export const beginLoading = state => initLoading()
export const beginLoading = (state) => initLoading()

export const completeWithValue = value =>
export const completeWithValue = (value) =>
u({
status: 'completed',
value: () => value,
})

export const errorWithReason = error =>
export const errorWithReason = (error) =>
u({
status: 'error',
error: () => error,
Expand Down
4 changes: 2 additions & 2 deletions bemuse/src/app/entities/LoadState.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as LoadState from './LoadState'

import { given, shouldEqual } from 'circumstance'

describe('LoadState', function() {
describe('LoadState', function () {
it('initLoading should be loading', () =>
given(LoadState.initLoading()).then(LoadState.isLoading, shouldEqual(true)))
it('completeWithValue should turn it into completed', () =>
Expand All @@ -18,4 +18,4 @@ describe('LoadState', function() {
.and(LoadState.error, errorMessage, shouldEqual('x')))
})

const errorMessage = error => error.message
const errorMessage = (error) => error.message
12 changes: 6 additions & 6 deletions bemuse/src/app/entities/MusicSearchText.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import u from 'updeep'

// Initializers
export const initWithText = text => ({
export const initWithText = (text) => ({
staged: text,
committed: text,
})
Expand All @@ -10,10 +10,10 @@ export const initWithText = text => ({
export const initialState = initWithText('')

// Queries
export const searchText = state => state.committed
export const inputText = state => state.staged
export const searchText = (state) => state.committed
export const inputText = (state) => state.staged

// Updaters
export const handleTextType = text => u({ staged: text })
export const handleDebounce = state => ({ ...state, committed: state.staged })
export const setText = text => () => initWithText(text)
export const handleTextType = (text) => u({ staged: text })
export const handleDebounce = (state) => ({ ...state, committed: state.staged })
export const setText = (text) => () => initWithText(text)
2 changes: 1 addition & 1 deletion bemuse/src/app/entities/MusicSearchText.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as MusicSearchText from './MusicSearchText'
import { given, shouldEqual } from 'circumstance'

describe('MusicSearchText', function() {
describe('MusicSearchText', function () {
it('is initially blank', () =>
given(MusicSearchText.initialState)
.then(MusicSearchText.searchText, shouldEqual(''))
Expand Down
8 changes: 4 additions & 4 deletions bemuse/src/app/entities/MusicSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ export const initialState = {
}

// Queries
export const selectedSongGivenSongs = songs => state => {
export const selectedSongGivenSongs = (songs) => (state) => {
const song = _.find(songs, { id: state.selectedSongId })
if (song) return song
return songs[0]
}
export const selectedChartGivenCharts = charts => state => {
export const selectedChartGivenCharts = (charts) => (state) => {
charts = charts || []
const chart = _.find(charts, { file: state.selectedChartId })
if (chart) return chart
return _.minBy(charts, chart =>
return _.minBy(charts, (chart) =>
Math.abs(chart.info.level - state.selectedChartLevel)
)
}

// Updater
export const selectSong = songId =>
export const selectSong = (songId) =>
u({
selectedSongId: songId,
})
Expand Down
8 changes: 4 additions & 4 deletions bemuse/src/app/entities/MusicSelection.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as MusicSelection from './MusicSelection'
import { given, shouldEqual } from 'circumstance'

describe('MusicSelection', function() {
describe('MusicSelection', function () {
it('allows selecting song', () =>
given(MusicSelection.initialState)
.when(MusicSelection.selectSong('song1'))
Expand All @@ -25,9 +25,9 @@ describe('MusicSelection', function() {
it('should allow selecting chart', () =>
given(MusicSelection.initialState)
.when(MusicSelection.selectChart('song1', 'chart1.bml', 8))
.then(state => state.selectedSongId, shouldEqual('song1'))
.and(state => state.selectedChartId, shouldEqual('chart1.bml'))
.and(state => state.selectedChartLevel, shouldEqual(8)))
.then((state) => state.selectedSongId, shouldEqual('song1'))
.and((state) => state.selectedChartId, shouldEqual('chart1.bml'))
.and((state) => state.selectedChartLevel, shouldEqual(8)))

const givenSelectedChart = given(MusicSelection.initialState).and(
MusicSelection.selectChart('song1', 'chart1.bml', 8)
Expand Down
Loading

0 comments on commit bc77b6e

Please sign in to comment.