-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '10.0-release' into tgriesser/fix/UNIFY-676
- Loading branch information
Showing
49 changed files
with
359 additions
and
55 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
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("[email protected]") | ||
// => /Users/.../dist/icons/[email protected] | ||
``` | ||
|
||
## 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
Oops, something went wrong.