Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
danoc committed Jan 25, 2019
0 parents commit 1a77cf1
Show file tree
Hide file tree
Showing 702 changed files with 84,190 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> 1% in US
last 2 versions
ie 11
not dead
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
extends: [
'airbnb',
// Prettier must come last
'prettier',
'prettier/react',
],
plugins: ['jest'],
env: {
browser: true,
node: true,
'jest/globals': true,
},
rules: {
// Has many false positives in monorepos
'import/no-extraneous-dependencies': 'off',
// Disabled because some packages contain subcomponents. Our documentation system currently
// requires that they be defined in one file.
'react/no-multi-comp': 'off',
},
overrides: [
{
files: ['packages/**/*'],
rules: {
// Disabled because rollup requires us to be explicit about the file extension.
// https://github.com/rollup/rollup/issues/1052#issuecomment-260065475
'import/extensions': 'off',
},
},
],
};
166 changes: 166 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
dist
tmp
aws.json
www/public
.cache
packages/thumbprint-icons/www

# Created by https://www.gitignore.io/api/osx,node,intellij+all

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Ruby plugin and RubyMine
/.rakeTasks

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


# End of https://www.gitignore.io/api/osx,node,intellij+all
8 changes: 8 additions & 0 deletions .jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"testMatch": ["<rootDir>/packages/**/?(*.)test.js?(x)"],
"setupTestFrameworkScriptFile": "./.jest.setup.js",
"snapshotSerializers": ["enzyme-to-json/serializer"],
"moduleNameMapper": {
"\\.(css|scss)$": "identity-obj-proxy"
}
}
9 changes: 9 additions & 0 deletions .jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

configure({ adapter: new Adapter() });

beforeAll(() => {
// Stub `window.scroll` since Jest will fail otherwise. This may change in the future.
global.scroll = () => true;
});
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/carbon
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
coverage
yarn.lock
dist
tmp
svg
.git
.cache
# Ignore `dist` files created by the Thumbprint documentation.
www/public
www/.cache
# Prevent Yarn and Prettier from conflicting.
package.json
4 changes: 4 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
printWidth: 100
tabWidth: 4
trailingComma: all
singleQuote: true
69 changes: 69 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Contributing to Thumbprint

The Design Systems team welcomes contributions from all developers at Thumbtack. These contributions can range from small bug reports to brand new components and initiatives.

Here are a few ways to get started:

## File a bug or request a feature

Providing feedback is the easiest way to contribute to Thumbprint. You can do this by [creating an issue on GitHub](https://github.com/thumbtack/thumbprint/issues).

If you're a Thumbtack employee, you can also post on [#design-systems](https://teamsanfrancisco.slack.com/messages/C7FLM0ZGU/details/) for quick help.

## Contribute code to Thumbprint

There are two ways to contribute code back to Thumbprint:

1. **Tackle open GitHub issues:** Issues labeled as “[good first issue](https://github.com/thumbtack/thumbprint/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)” or “[help wanted](https://github.com/thumbtack/thumbprint/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)” are perfect for contributors that want to tackle small tasks.
2. **Propose and create a new component:** Creating a component allows contributors to dive-deep into component API design, testing, accessibility, and documentation. Please [create a GitHub issue](https://github.com/thumbtack/thumbprint/issues) to propose a new component. If the component is a good candidate for Thumbprint, we’ll schedule a kick-off meeting to discuss next steps.

Not sure if the component should be reusable? Take a look at the “[Where should a React component live](https://docs.google.com/a/thumbtack.com/document/d/1-EGijB_3mc49T_CSzWowNfhEKlwiTdZh8tqIx6URZys/edit?usp=sharing)” RFC (internal only).

## Developing Thumbprint locally

Use the following commands to run the Thumbprint documentation:

```bash
git clone [email protected]:thumbtack/thumbprint.git
cd thumbprint
node -v # This must be 8.x
yarn -v # This must be >= 1.4.2
yarn
yarn start
```

Then open http://localhost:8090/ to see the docs. We use the documentation the development environment for Thumbprint.

### Submitting a pull request

Here are a few things to keep in mind when creating a pull request:

- **Testing:** Run `yarn test` locally to ensure that the build will pass. If the command fails because of [Jest snapshot tests](https://facebook.github.io/jest/docs/en/snapshot-testing.html), you will have to run `yarn test:jest -u` to update the snapshots. Review the changes to the snapshots to ensure that they are intended and include them in the code review.
- **Changelog:**
- Most changes within `packages/`require updates to the package's `CHANGELOG.md` file. You can skip modifying the changelog if your commit only modifies this [list of ignored files](https://github.com/thumbtack/thumbprint/blob/master/lerna.json).
- Our changelogs follow the “[Keep a Changelog](http://keepachangelog.com/en/1.0.0/)” specification. Our version numbers follow [Semantic Versioning](https://semver.org/).
- You should not include the package’s new version number as part of your commit. That is done in the release process.

### Creating a new package

Create a new folder in `packages` with the following structure:

```
├── CHANGELOG.md
├── README.mdx # Examples in documentation pages
├── index.jsx # Component definition (for React)
├── package.json
└── test.jsx
```

This is an example of a Thumbprint package that uses React. Thumbprint packages that ship SCSS contain a `_index.scss` file instead of `index.js`.

Thumbprint follows a [traditional GitHub workflow](https://guides.github.com/introduction/flow/). This means that you should work in a feature branch and submit a pull request when ready for code review.

**Tip:** Reference other packages to understand how each file works.

### Releasing Thumbprint packages

[Learn how to release the Thumbprint packages and documentation](https://github.com/thumbtack/thumbprint/blob/master/RELEASING.md). This process is done by [Thumbprint maintainers](https://github.com/orgs/thumbtack/teams/design-systems/members) after your code has merged into `master`.

As always, reach out to [#design-systems](https://teamsanfrancisco.slack.com/messages/C7FLM0ZGU/details/) (internal to Thumbtack employees) if you have questions or feedback.
7 changes: 7 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
Here are a few tips for creating Thumbprint issues:
* Use a descriptive title
* Include screenshots or videos when possible
* Let us know if the issue is blocking your work
-->
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Thumbprint

[Thumbprint](https://thumbprint.design/) is a collection of UI components, icons, and design tokens for use in Thumbtack projects. Though its primary purpose to support Thumbtack projects, we have open-sourced it for those interested in how we build and manage our documentation and code.

![](https://raw.githubusercontent.com/dbader/readme-template/master/header.png)

## Technology

We have leaned on a variety of tools to build and maintain Thumbprint. Among those currently in use...

- React and Sass for components.
- [Design tokens](https://thumbprint.design/tokens/) for UI consistency.
- Custom [functional CSS](https://www.mikecr.it/ramblings/functional-css/) library called [Atomic](https://thumbprint.design/atomic/) for layout.
- [lerna](https://lernajs.io/) for managing the packages
- [jest](https://jestjs.io/) for snapshot testing
- [npm](https://www.npmjs.com/) for publishing.
- [Gatsby](https://www.gatsbyjs.org/) with [mdx](https://github.com/mdx-js/mdx) for our documentation.

## Contributing

If you'd like to contribute to the design system, take at look at our (guidelines)[https://thumbprint.design/overview/contributing/]. If you work at thumbtack.com, please join the #design-system Slack channel and let us know what you'd like to work on.

We also maintain a [CONTRIBUTING.md](CONTRIBUTING.md) file that contains developer-specific instructions for contributing code to Thumbprint.

## Meta

The primary maintainers of Thumbprint:

- Dan O’Connor [email protected]
- Tom Genoni [email protected]
Loading

0 comments on commit 1a77cf1

Please sign in to comment.