Skip to content

Commit

Permalink
📦 v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sondregj authored Oct 4, 2019
2 parents 3e0710b + 04b0222 commit 6be8bb9
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Node.js Package

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm test
- run: npm run build

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
scope: '@sondregj'
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sondregj/conway",
"version": "1.0.0",
"version": "1.0.1",
"description": "Cellular Automata in TypeScript",
"author": "Sondre Gjellestad <[email protected]> (https://sondregjellestad.space)",
"homepage": "https://github.com/sondregj/conway#readme",
Expand All @@ -20,7 +20,7 @@
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags",
"prepublishOnly": "npm test && npm run lint && npm run build"
"prepublishOnly": "npm ci && npm test && npm run lint && npm run build"
},
"bugs": {
"url": "https://github.com/sondregj/conway/issues"
Expand Down
4 changes: 2 additions & 2 deletions src/advance.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BoardTick, RuleFunction } from './types'
import { BoardTick } from './types'

import { conwayRules } from './rules'

export const advance: BoardTick = (board, rules: RuleFunction = conwayRules) => ({
export const advance: BoardTick = (board, rules = conwayRules) => ({
cells: board.cells.map((row, yIndex) =>
row
.map((cell, xIndex) => rules(board, cell, xIndex, yIndex))
Expand Down

0 comments on commit 6be8bb9

Please sign in to comment.