-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update icons with new design (#20338)
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com> Co-authored-by: Zachary Williams <ZachJW34@gmail.com>
- Loading branch information
1 parent
031e66d
commit 9f624b4
Showing
48 changed files
with
357 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './dist/icons' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./dist/icons') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "@packages/icons", | ||
"version": "0.0.0-development", | ||
"description": "Cypress Icons", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "scripts/build.sh", | ||
"postbuild": "ts-node ./src/ico.ts", | ||
"test": "NODE_ENV=test mocha", | ||
"test-watch": "NODE_ENV=test mocha --watch", | ||
"prepublish": "npm run build", | ||
"release": "releaser" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^8.0.3", | ||
"@types/to-ico": "^1.1.1", | ||
"chai": "^4.2.0", | ||
"mocha": "^8.1.3", | ||
"to-ico": "^1.1.5" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/cypress-io/cypress-icons.git" | ||
}, | ||
"homepage": "https://github.com/cypress-io/cypress-icons#readme", | ||
"author": "Brian Mann", | ||
"bugs": { | ||
"url": "https://github.com/cypress-io/cypress-icons/issues" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Cypress Icons | ||
|
||
The latest versions of the icons. | ||
The public API will always reference these files. | ||
|
||
`./dist` is not checked into source control. | ||
|
||
## API | ||
|
||
```js | ||
const icons = require("@cypress/icons") | ||
|
||
// get the absolute path to default favicon | ||
icons.getPathToFavicon("favicon-blue.ico") | ||
// => /Users/.../dist/favicon/favicon-blue.ico | ||
|
||
// get the absolute path to icon | ||
icons.getPathToIcon("icon_32x32@2x.png") | ||
// => /Users/.../dist/icons/icon_32x32@2x.png | ||
``` | ||
|
||
## Architecture detail | ||
|
||
To build the MacOS icons you have to use the `iconutil` command line tool installed. | ||
This command line tool is only installed on MacOS. | ||
|
||
If you are not on MacOS, the building of this icon will simply be skipped. | ||
If you are not on MacOS, the building of this icon will be skipped instead of erroring. | ||
|
||
## Developing | ||
|
||
All the icons are in the assets directory. | ||
|
||
```bash | ||
## run build to dump to ./dist | ||
yarn build | ||
``` | ||
|
||
## Testing | ||
|
||
```bash | ||
yarn test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
rm -rf dist && mkdir dist && mkdir dist/icons | ||
yarn tsc -p ./tsconfig.build.json | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
iconutil -c icns assets/cypress.iconset -o dist/icons/cypress.icns | ||
fi | ||
cp -r assets/* dist | ||
mv dist/cypress.iconset/* dist/icons | ||
rm -r dist/cypress.iconset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import fs from 'fs' | ||
import toIco from 'to-ico' | ||
|
||
const files = [ | ||
fs.readFileSync('./assets/icons/icon_16x16.png'), | ||
fs.readFileSync('./assets/icons/icon_24x24.png'), | ||
fs.readFileSync('./assets/icons/icon_32x32.png'), | ||
fs.readFileSync('./assets/icons/icon_48x48.png'), | ||
fs.readFileSync('./assets/icons/icon_64x64.png'), | ||
fs.readFileSync('./assets/icons/icon_128x128.png'), | ||
fs.readFileSync('./assets/icons/icon_256x256.png'), | ||
] | ||
|
||
toIco(files).then((buf) => { | ||
fs.writeFileSync('./dist/icons/cypress.ico', buf) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import path from 'path' | ||
|
||
const dist = [__dirname, '..', 'dist'] | ||
|
||
function distPath (...args: string[]) { | ||
return path.join.apply(path, dist.concat([...args])) | ||
} | ||
|
||
export const getPathToFavicon = (filename: string) => { | ||
return distPath('favicon', filename) | ||
} | ||
|
||
export const getPathToIcon = (filename: string) => { | ||
return distPath('icons', filename) | ||
} | ||
|
||
export const getPathToLogo = (filename: string) => { | ||
return distPath('logo', filename) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { expect } from 'chai' | ||
import * as icons from '../src/icons' | ||
|
||
const cwd = process.cwd() | ||
|
||
describe('Cypress Icons', function () { | ||
it('returns path to favicon', function () { | ||
expect(icons.getPathToFavicon('favicon-red.ico')).to.eq(`${cwd }/dist/favicon/favicon-red.ico`) | ||
}) | ||
|
||
it('returns path to icon', function () { | ||
expect(icons.getPathToIcon('cypress.icns')).to.eq(`${cwd }/dist/icons/cypress.icns`) | ||
}) | ||
|
||
it('returns path to logo', function () { | ||
expect(icons.getPathToLogo('cypress-bw.png')).to.eq(`${cwd }/dist/logo/cypress-bw.png`) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"files": [ | ||
"./src/icons.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "../ts/tsconfig.json", | ||
"compilerOptions": { | ||
"strict": true, | ||
"allowJs": false, | ||
"noImplicitAny": true, | ||
"noUnusedLocals": false, | ||
"resolveJsonModule": true, | ||
"experimentalDecorators": true, | ||
"noUncheckedIndexedAccess": true, | ||
"importsNotUsedAsValues": "error", | ||
"outDir": "dist", | ||
"declaration": true | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9f624b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
9f624b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
9f624b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
win32 x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally: