Skip to content

Commit

Permalink
Merge pull request #238 from primer/release-8.1.0
Browse files Browse the repository at this point in the history
Release 8.1.0
  • Loading branch information
shawnbot committed Aug 30, 2018
2 parents cbf33c9 + fd92766 commit cad47f9
Show file tree
Hide file tree
Showing 25 changed files with 304 additions and 228 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Expand Up @@ -9,5 +9,4 @@ package-lock.json
vendor

# Ignore build/export artifacts
build/
lib/octicons_gem/lib/data.json
lib/**/build/
25 changes: 15 additions & 10 deletions .travis.yml
Expand Up @@ -5,26 +5,31 @@ node_js:
script:
- npm test

before_script:
# XXX this is a fix for nokogiri building on Travis
- npm run bootstrap

after_success:
# Setup rubygems creds
- curl -u $RUBYGEMS_USER:$RUBYGEMS_PW https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
- curl -u "$RUBYGEMS_USER:$RUBYGEMS_PW" https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
- chmod 0600 ~/.gem/credentials
# this will short-circuit the publish step if it fails to interpolate $NPM_API_KEY
- npm config set "//registry.npmjs.org/:_authToken=\${NPM_API_KEY}"
- script/after_success

deploy:
# publish "final" releases on master
- provider: script
script: script/release
# publish release candidates from any branch beginning with "release"
- on:
condition: $TRAVIS_BRANCH =~ ^release
all_branches: true
tags: false
provider: script
script:
- script/release-candidate
skip_cleanup: true
on:

# publish "final" releases on master
- on:
branch: master
tags: false
provider: script
script: script/release
skip_cleanup: true

notifications:
slack: 'github:4OisIoqZYyMlWcw3hFtZgbmh'
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -21,7 +21,7 @@ The octicons node.js library is the main JavaScript library. With [a JavaScript
| Package | Version |
|---|---|
| **[octicons](/lib/octicons_node)** <br />Node.js package with Javascript API | [![npm version](https://img.shields.io/npm/v/octicons.svg)](https://www.npmjs.org/package/octicons) |
| **[@github/octicons-react](/lib/octicons_react)** <br />React octicons components | [![npm version](https://img.shields.io/npm/v/%40github%2Focticons-react.svg)](https://www.npmjs.org/package/%40github%2Focticons-react) |
| **[@githubprimer/octicons-react](/lib/octicons_react)** <br />React octicons components | [![npm version](https://img.shields.io/npm/v/@githubprimer/octicons-react.svg)](https://www.npmjs.org/package/@githubprimer/octicons-react) |

### Ruby

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -7,5 +7,5 @@
"lib/octicons_jekyll",
"lib/octicons_react"
],
"version": "8.0.0"
"version": "8.1.0"
}
2 changes: 1 addition & 1 deletion lib/octicons_gem/lib/octicons/version.rb
@@ -1,3 +1,3 @@
module Octicons
VERSION = "8.0.0".freeze
VERSION = "8.1.0".freeze
end
4 changes: 2 additions & 2 deletions lib/octicons_gem/package.json
@@ -1,10 +1,10 @@
{
"name": "octicons_gem",
"version": "8.0.0",
"version": "8.1.0",
"description": "Don't install",
"scripts": {
"postinstall": "bundle install --path vendor/bundle",
"prepare": "cp -R ../build ./lib/",
"prepare": "cp -R ../build ./lib",
"version": "../../script/rubyversion ./lib/octicons/version.rb",
"prepublishOnly": "../../script/notify pending && ../../script/gem_publish",
"publish": "../../script/notify success",
Expand Down
4 changes: 2 additions & 2 deletions lib/octicons_helper/Gemfile
Expand Up @@ -8,6 +8,6 @@ gem "rails"
group :development, :test do
gem "minitest"
gem "rake"
gem "rubocop"
gem "rubocop-github"
gem "rubocop", "0.50"
gem "rubocop-github", "0.5.0"
end
2 changes: 1 addition & 1 deletion lib/octicons_helper/lib/octicons_helper/version.rb
@@ -1,3 +1,3 @@
module OcticonsHelper
VERSION = "8.0.0".freeze
VERSION = "8.1.0".freeze
end
2 changes: 1 addition & 1 deletion lib/octicons_helper/octicons_helper.gemspec
Expand Up @@ -13,6 +13,6 @@ Gem::Specification.new do |s|

s.require_paths = ["lib"]

s.add_dependency "octicons", "8.0.0"
s.add_dependency "octicons", "8.1.0"
s.add_dependency "rails"
end
5 changes: 3 additions & 2 deletions lib/octicons_helper/package.json
@@ -1,10 +1,11 @@
{
"name": "octicons_helper",
"version": "8.0.0",
"version": "8.1.0",
"description": "A rails helper that makes including svg Octicons simple.",
"scripts": {
"version": "../../script/rubyversion ./lib/octicons_helper/version.rb",
"postinstall": "bundle install --path vendor/bundle",
"prepare": "echo '(no prepare needed here)'",
"prepublishOnly": "../../script/notify pending && ../../script/gem_publish",
"publish": "../../script/notify success",
"test": "bundle exec rubocop && bundle exec rake"
Expand All @@ -21,6 +22,6 @@
"rubygems": "octicons_helper",
"homepage": "https://github.com/primer/octicons#readme",
"dependencies": {
"octicons_gem": "8.0.0"
"octicons_gem": "8.1.0"
}
}
2 changes: 1 addition & 1 deletion lib/octicons_jekyll/jekyll-octicons.gemspec
Expand Up @@ -14,5 +14,5 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.add_dependency "jekyll", "~> 3.1"
s.add_dependency "octicons", "8.0.0"
s.add_dependency "octicons", "8.1.0"
end
2 changes: 1 addition & 1 deletion lib/octicons_jekyll/lib/jekyll-octicons/version.rb
Expand Up @@ -3,6 +3,6 @@ module Liquid; class Tag; end; end

module Jekyll
class Octicons < Liquid::Tag
VERSION = "8.0.0".freeze
VERSION = "8.1.0".freeze
end
end
4 changes: 2 additions & 2 deletions lib/octicons_jekyll/package.json
@@ -1,6 +1,6 @@
{
"name": "jekyll-octicons",
"version": "8.0.0",
"version": "8.1.0",
"description": "A jekyll liquid plugin that makes including svg Octicons simple.",
"scripts": {
"version": "../../script/rubyversion ./lib/jekyll-octicons/version.rb",
Expand All @@ -21,6 +21,6 @@
"rubygems": "jekyll-octicons",
"homepage": "https://github.com/primer/octicons#readme",
"dependencies": {
"octicons_gem": "8.0.0"
"octicons_gem": "8.1.0"
}
}
2 changes: 1 addition & 1 deletion lib/octicons_node/package.json
@@ -1,6 +1,6 @@
{
"version": "8.0.0",
"name": "octicons",
"version": "8.1.0",
"description": "A scalable set of icons handcrafted with <3 by GitHub.",
"homepage": "https://octicons.github.com",
"author": "GitHub Inc.",
Expand Down
2 changes: 1 addition & 1 deletion lib/octicons_react/README.md
Expand Up @@ -67,7 +67,7 @@ import React from 'react'
import Octicon, {getIconByName} from '@githubprimer/octicons-react'

export default function OcticonByName({name, ...props}) {
return <Octicon {...props} icon={getIcon(name)} />
return <Octicon {...props} icon={getIconByName(name)} />
}
```

Expand Down
8 changes: 5 additions & 3 deletions lib/octicons_react/package.json
@@ -1,6 +1,6 @@
{
"name": "@githubprimer/octicons-react",
"version": "8.0.0",
"version": "8.1.0",
"description": "A scalable set of icons handcrafted with <3 by GitHub.",
"homepage": "https://octicons.github.com",
"author": "GitHub, Inc.",
Expand All @@ -10,12 +10,14 @@
"types": "dist/index.d.ts",
"repository": "primer/octicons",
"scripts": {
"pretest": "npm run lint && npm run ts-test",
"build": "script/build.js && script/types.js",
"pretest": "npm run lint",
"ts-test": "tsc -P ts-tests",
"test": "jest",
"posttest": "npm run ts-test",
"start": "NODE_ENV=production next",
"lint": "eslint src pages script",
"prepare": "script/build.js && script/types.js && npm run rollup",
"prepare": "npm run build && npm run rollup",
"prepublishOnly": "../../script/notify pending",
"preversion": "npm run prepare",
"publish": "../../script/notify success",
Expand Down
8 changes: 5 additions & 3 deletions lib/octicons_react/script/build.js
Expand Up @@ -7,6 +7,8 @@ const srcDir = resolve(__dirname, '../src/__generated__')
const iconsFile = join(srcDir, 'icons.js')
const typesFile = join(srcDir, 'icons.d.ts')

const GENERATED_HEADER = '/* THIS FILE IS GENERATED. DO NOT EDIT IT. */'

function CamelCase(str) {
return str.replace(/(^|-)([a-z])/g, (_, __, c) => c.toUpperCase())
}
Expand Down Expand Up @@ -38,7 +40,7 @@ ${name}.size = [${width}, ${height}]

function writeIcons(file) {
const count = icons.length
const code = `/* THIS FILE IS GENERATED. DO NOT EDIT IT. */
const code = `${GENERATED_HEADER}
import React from 'react'
${icons.map(({code}) => code).join('\n')}
Expand All @@ -64,7 +66,7 @@ export {

function writeTypes(file) {
const count = icons.length
const code = `/* THIS FILE IS GENERATED. DO NOT EDIT IT. */
const code = `${GENERATED_HEADER}
import * as React from 'react'
type Icon<
Expand All @@ -81,7 +83,7 @@ declare const iconsByName: iconsByName
declare function getIconByName<T extends keyof iconsByName>(
name: T
): IconsByName[T];
): iconsByName[T];
declare function getIconByName(name: string): Icon | undefined
export {
Expand Down
13 changes: 8 additions & 5 deletions lib/octicons_react/script/types.js
Expand Up @@ -10,14 +10,17 @@ const destDir = resolve(__dirname, '../dist')
const iconsDest = join(destDir, 'icons.d.ts')
const indexDest = join(destDir, 'index.d.ts')

fse.copy(iconsSrc, iconsDest).catch(die)
fse
.readFile(indexSrc, 'utf8')
.then(content => content.replace(/.\/__generated__\//g, './'))
.then(fse.writeFile.bind(fse, indexDest))
.copy(iconsSrc, iconsDest)
.then(() => {
return fse
.readFile(indexSrc, 'utf8')
.then(content => content.replace(/.\/__generated__\//g, './'))
.then(content => fse.writeFile(indexDest, content, 'utf8'))
})
.catch(die)

function die(err) {
console.error(err.stack)
process.exit(1)
process.exitCode = 1
}
5 changes: 4 additions & 1 deletion package.json
@@ -1,6 +1,7 @@
{
"private": true,
"scripts": {
"postinstall": "npm run bootstrap",
"bootstrap": "script/export && lerna bootstrap",
"test": "ava tests/*.js && lerna run test",
"bump": "lerna publish --exact --skip-npm --since \"v$(npm info octicons version)\""
Expand All @@ -11,11 +12,13 @@
"devDependencies": {
"ava": "^0.22.0",
"commit-status": "^4.3.0",
"fs-extra": "^5.0.0",
"execa": "^1.0.0",
"fs-extra": "^7.0.0",
"got": "^8.3.0",
"js-yaml": "^3.11.0",
"lerna": "2.9.0",
"ora": "^2.0.0",
"p-queue": "^2.4.2",
"svgo": "^1.0.5"
}
}
19 changes: 0 additions & 19 deletions script/after_success

This file was deleted.

5 changes: 1 addition & 4 deletions script/bootstrap
@@ -1,5 +1,2 @@
#!/bin/bash
set -e

npm i
npm run bootstrap
npm install

0 comments on commit cad47f9

Please sign in to comment.