Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0.4.0 #177

Merged
merged 71 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
7b52817
FDS-133 Add initial dangerfile, Github Action, and CascaraBot
brianespinosa Feb 16, 2021
0469ce9
Fix step name
brianespinosa Feb 16, 2021
763ca3c
Update our Danger action
brianespinosa Feb 17, 2021
ba76d31
Try setting both tokens
brianespinosa Feb 17, 2021
908e276
Update Danger version
brianespinosa Feb 17, 2021
9431c51
Dangerfile test modified
brianespinosa Feb 17, 2021
6a8b649
Define danger
brianespinosa Feb 17, 2021
0e05e7c
Merge branch 'develop' of github.com:Espressive/cascara into feature/…
brianespinosa Feb 17, 2021
cbd272d
assignees
brianespinosa Feb 17, 2021
411ad6c
fixed name in modified
brianespinosa Feb 17, 2021
cc4c697
Disable other actions not being used
brianespinosa Feb 17, 2021
ce49af1
Update how we are writing the dangerfile
brianespinosa Feb 17, 2021
7483e66
Rename
brianespinosa Feb 17, 2021
3a53b66
dependency rules
brianespinosa Feb 17, 2021
fac131b
Add more files changed test cases
brianespinosa Feb 18, 2021
db34a1b
Fix test cases for files
brianespinosa Feb 18, 2021
9dfc84a
Dependencies test
brianespinosa Feb 18, 2021
ac63c12
Dangerfile warning
brianespinosa Feb 23, 2021
bab668b
Merge branch 'develop' into feature/FDS-133-dangerfile
brianespinosa Feb 23, 2021
f082cc9
Types for section
brianespinosa Feb 23, 2021
db06c84
Merge branch 'feature/FDS-133-dangerfile' of github.com:Espressive/ca…
brianespinosa Feb 23, 2021
ff48017
Update readme, change index
brianespinosa Feb 24, 2021
aaaa629
Add additional types for action events on PR
brianespinosa Feb 24, 2021
5b8300f
Fix action syntax
brianespinosa Feb 24, 2021
ef73fae
again fix syntax
brianespinosa Feb 24, 2021
12ead4f
Add Jira linking to Danger
brianespinosa Feb 24, 2021
a2a2ea7
remove danger plugin
brianespinosa Feb 24, 2021
e15718e
Merge branch 'develop' into feature/FDS-133-dangerfile
brianespinosa Feb 24, 2021
97d3a53
Merge pull request #161 from Espressive/main
brianespinosa Feb 24, 2021
11e1e2f
fix(ActionsMenu): do not remove 'name' prop from ...rest
Feb 25, 2021
8c695f3
chore(modules): take all Test ID code out of our modules and props th…
Feb 25, 2021
466311a
Merge pull request #162 from Espressive/feature/FDS-140
brianespinosa Feb 26, 2021
4f5ac81
Merge branch 'develop' into feature/FDS-133-dangerfile
brianespinosa Feb 26, 2021
c9d3cbc
Merge branch 'develop' into feature/FDS-135
brianespinosa Feb 26, 2021
baba623
Merge pull request #152 from Espressive/feature/FDS-133-dangerfile
brianespinosa Feb 26, 2021
d8969c7
Merge branch 'develop' into feature/FDS-135
brianespinosa Feb 26, 2021
7aa1e9d
Merge pull request #163 from Espressive/feature/FDS-135
brianespinosa Feb 26, 2021
4108e36
chore(release): publish
brianespinosa Feb 26, 2021
a260b20
Rename eslint config for scoped use
brianespinosa Mar 2, 2021
46459f7
Eslint rules ported and docs updated, rules erroring currently commented
brianespinosa Mar 2, 2021
fd19430
Fix package.json sorting
brianespinosa Mar 2, 2021
e09ffab
Merge pull request #167 from Espressive/feature/FDS-143-new-eslint-co…
brianespinosa Mar 2, 2021
8c42b88
chore(release): publish
brianespinosa Mar 2, 2021
2d732a9
feat(Conditional Actions): Table conditional actions PoC #1
Feb 27, 2021
7427878
feat(Table) conditional actions
Mar 2, 2021
2cd3e76
FDS-145 Resolve all `import` plugin eslint rules
brianespinosa Mar 2, 2021
f420dba
Use workspace resolutions for Cascara
brianespinosa Mar 3, 2021
b4e0264
docs(Table) conditional actions
Mar 3, 2021
a4b2099
Use new `prepare` script instead of `prepublish` to make sure Cascara…
brianespinosa Mar 3, 2021
14af151
Do not store ALL of our node_modules as artifacts, you idiot!
brianespinosa Mar 3, 2021
45c9d5e
Make sure we are running prepare on any packages that will be needed …
brianespinosa Mar 3, 2021
95cd3a2
Update husky to fix the package.json
brianespinosa Mar 3, 2021
7a761ac
Merge pull request #165 from Espressive/feature/fds-142
brianespinosa Mar 3, 2021
298162b
Merge branch 'develop' into feature/FDS-145-eslint-import
brianespinosa Mar 3, 2021
3ebb96b
Merge pull request #168 from Espressive/feature/FDS-145-eslint-import
brianespinosa Mar 3, 2021
6df72dc
chore(FDS-146) Resolve eslint `prefer-` prefixed errors
brianespinosa Mar 3, 2021
bbe31e7
chore(FDS-151): Resolve some eslint react rules (button type, display…
brianespinosa Mar 3, 2021
e60fdc1
Merge pull request #169 from Espressive/feature/FDS-146-eslint-prefer
brianespinosa Mar 3, 2021
f7a62a1
Merge branch 'develop' of github.com:Espressive/cascara into feature/…
brianespinosa Mar 3, 2021
60f7650
Merge pull request #171 from Espressive/feature/FDS-151-eslint-some-r…
brianespinosa Mar 3, 2021
0e0d503
chore(FDS-152): Set up autosquash
brianespinosa Mar 3, 2021
ac98421
disable auto squash action
brianespinosa Mar 3, 2021
b2d4e63
chore(FDS-149): Resolve eslint `no-` prefixed errors and `multiline-c…
brianespinosa Mar 3, 2021
4a6d358
squash back
brianespinosa Mar 3, 2021
62ed64f
Merge branch 'develop' of github.com:Espressive/cascara into develop
brianespinosa Mar 3, 2021
a559b41
Use an autoupdate action instead
brianespinosa Mar 4, 2021
69af5d8
comment about auto update
brianespinosa Mar 4, 2021
12a18b7
chore(FDS-147) - fix eslint 'react/prop-types' and 'react/forbid-prop…
lordpixel Mar 4, 2021
ce14cb4
chore(FDS-155): React.memo and useCallback example (#176)
brianespinosa Mar 5, 2021
f6e3980
chore(FDS-153) - Fix remaining eslint rule errors (#175)
lordpixel Mar 5, 2021
53a446a
chore(release): publish
brianespinosa Mar 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ jobs:
- checkout
- node/install-packages:
pkg-manager: yarn
- run:
name: Prepare Packages
command: yarn workspaces run prepare
- store_artifacts:
path: ./node_modules/@espressive/cascara # check to see why we do not have @espressive/cascara
- save_cache:
key: cascara-MONOREPO_INSTALLED-{{ .Revision }}
paths:
Expand Down
5 changes: 5 additions & 0 deletions .danger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Danger JS

[Danger.js](https://danger.systems/js/) is being used to evaluate the most common issues we have with our pull requests. Instead of making developers ask for corrections in titles, description changes stating why dependencies were added, etc... we can instead automate checks for these items so developers can spend time evaluating code instead of evaluating if people are following our process.

The goal is to have the team slowly add rules and tests over time to improve common, repetitive PR tasks.
66 changes: 66 additions & 0 deletions .danger/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { danger, warn, fail, message } from 'danger';

// Git specific values
const modifiedFiles = danger.git.modified_files;
const newFiles = danger.git.created_files;
const changedFiles = [...modifiedFiles, ...newFiles];

// Github specific values
const github = {
description: danger.github.pr.body,
assignee: danger.github.pr.assignee,
};

// Changed file evaluations
const changed = {
fixtures: modifiedFiles.filter((file) => file.includes('fixture.js')),
packages: changedFiles.filter((file) => file.includes('package.json')),
snapshots: modifiedFiles.filter((file) => file.includes('test.snap')),
};

// PR description sections
const descSection = {
dependencies: '### Dependencies',
snapshots: '### Snapshots',
};

// Evaluates the description to see if it contains a particular section
const hasDescriptionSection = (section: keyof typeof descSection) =>
github.description.includes(descSection[section]);

// No PR is too small to include a description of why you made a change
if (github.description.length < 10) {
warn('Please include a description of your PR changes.');
}

// Check that someone has been assigned to this PR
if (github.assignee === null) {
warn(
'Please assign someone to merge this PR, and optionally include people who should review.'
);
}

// Check if we are modifying any Cosmos fixtures
if (changed.fixtures) {
for (let file of changed.fixtures) {
message(`**${file}**: This fixture has been changed.`, file);
}
}

// Check if we are updating or adding any package dependencies
if (changed.packages && !hasDescriptionSection('dependencies')) {
for (let file of changed.packages) {
fail(
`Please add a '${descSection.dependencies}' section to explain the reason we are changing dependencies.`
);
}
}

// Check if we are modifying any Jest snapshots
if (changed.snapshots && !hasDescriptionSection('snapshots')) {
for (let file of changed.snapshots) {
fail(
`Please add a '${descSection.snapshots}' section to explain the reason we are changing snapshots.`
);
}
}
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// We should almost definitely not be adding rules here. Instead, we should be modifying rules in our eslint-config-espressive package

module.exports = {
extends: '@espressive/eslint-config-espressive',
extends: ['@espressive', 'prettier'], // prettier must be last so we override any rules that potentially conflict with Prettier
overrides: [
{
files: ['**/next-*/**/*', 'docs/**/*'],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This action will update any of our PRs that are out of date with their target branch.
# tibdex/auto-update@v1 will only log the issue if there is a failure, usually due to conflicts
# https://github.com/tibdex/auto-update/issues/2

name: Auto-update
on:
push:
# If pull requests are always based on the same branches, only triggering the workflow when these branches receive new commits will minimize the workflow execution.
branches:
- develop
- main

jobs:
Auto:
name: Auto-update
runs-on: ubuntu-18.04
steps:
- uses: tibdex/auto-update@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Uncomment to ignore pull requests without the specified label.
# label: auto-update
27 changes: 27 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Danger JS'
on:
pull_request:
types:
[
assigned,
edited,
labeled,
opened,
reopened,
synchronize,
unassigned,
unlabeled,
]

jobs:
danger:
name: Danger JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Dangerfile
uses: danger/danger-js@10.6.2
with:
args: '--dangerfile .danger/index.ts'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"editor.wordWrap": "on",
"editor.wrappingIndent": "same"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"autoSnippet.snippets": [
{
"pattern": "**/[A-Z]*.js",
Expand Down
14 changes: 11 additions & 3 deletions app-tests/_templates/next-template/src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import pt from 'prop-types';

import '@espressive/legacy-css';

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
const propTypes = {
Component: pt.element,
// eslint-disable-next-line react/forbid-prop-types -- We do not know what the object params might be in this case
pageProps: pt.object,
};

const MyApp = ({ Component, pageProps }) => <Component {...pageProps} />;

MyApp.propTypes = propTypes;

export default MyApp;
4 changes: 3 additions & 1 deletion app-tests/_templates/next-template/src/pages/api/hello.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction

export default (req, res) => {
const hello = (req, res) => {
res.statusCode = 200;
res.json({ name: 'John Doe' });
};

export default hello;
6 changes: 4 additions & 2 deletions app-tests/_templates/next-template/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Head from 'next/head';
import pkg from '../../package';
import styles from '../styles/Home.module.css';

export default function Home() {
const Home = () => {
return (
<div className={styles.container}>
<Head>
Expand All @@ -17,4 +17,6 @@ export default function Home() {
</main>
</div>
);
}
};

export default Home;
14 changes: 11 additions & 3 deletions app-tests/next-button/src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import pt from 'prop-types';

import '@espressive/legacy-css';

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
const propTypes = {
Component: pt.element,
// eslint-disable-next-line react/forbid-prop-types -- We do not know what the object params might be in this case
pageProps: pt.object,
};

const MyApp = ({ Component, pageProps }) => <Component {...pageProps} />;

MyApp.propTypes = propTypes;

export default MyApp;
4 changes: 3 additions & 1 deletion app-tests/next-button/src/pages/api/hello.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction

export default (req, res) => {
const hello = (req, res) => {
res.statusCode = 200;
res.json({ name: 'John Doe' });
};

export default hello;
6 changes: 4 additions & 2 deletions app-tests/next-button/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styles from '../styles/Home.module.css';

import { Button } from '@espressive/cascara';

export default function Home() {
const Home = () => {
return (
<div className={styles.container}>
<Head>
Expand All @@ -19,4 +19,6 @@ export default function Home() {
</main>
</div>
);
}
};

export default Home;
14 changes: 11 additions & 3 deletions app-tests/next-layout-admin/src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import pt from 'prop-types';

import '@espressive/legacy-css';

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
const propTypes = {
Component: pt.element,
// eslint-disable-next-line react/forbid-prop-types -- We do not know what the object params might be in this case
pageProps: pt.object,
};

const MyApp = ({ Component, pageProps }) => <Component {...pageProps} />;

MyApp.propTypes = propTypes;

export default MyApp;
4 changes: 3 additions & 1 deletion app-tests/next-layout-admin/src/pages/api/hello.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction

export default (req, res) => {
const hello = (req, res) => {
res.statusCode = 200;
res.json({ name: 'John Doe' });
};

export default hello;
6 changes: 4 additions & 2 deletions app-tests/next-layout-admin/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import pkg from '../../package';

import { Admin } from '@espressive/cascara';

export default function Home() {
const Home = () => {
return (
<Admin>
<Head>
Expand All @@ -20,4 +20,6 @@ export default function Home() {
<Admin.Main>{'Admin.Main'}</Admin.Main>
</Admin>
);
}
};

export default Home;
35 changes: 20 additions & 15 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
modules: false,
loose: true,
},
],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-optional-chaining',
['@babel/plugin-proposal-class-properties', { loose: true }],
],
env: {
// Jest
test: {
Expand All @@ -23,4 +8,24 @@ module.exports = {
],
},
},
plugins: [
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-optional-chaining',
[
'@babel/plugin-proposal-class-properties',
{
loose: true,
},
],
],
presets: [
[
'@babel/preset-env',
{
loose: true,
modules: false,
},
],
'@babel/preset-react',
],
};
9 changes: 5 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "docs",
"version": "0.3.2",
"version": "0.4.0",
"private": true,
"scripts": {
"start": "next-remote-watch ../packages/cascara",
"build": "next build"
"build": "next build",
"prepare": "echo 'No prepare scripts for this package'"
},
"dependencies": {
"@espressive/cascara": "file:../packages/cascara",
"@espressive/legacy-css": "file:../utils/legacy-css",
"@espressive/cascara": "^0.4.0",
"@espressive/legacy-css": "^2.0.4",
"framer-motion": "2.5.5",
"next": "10.0.5",
"next-mdx-remote": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Asciagram/Asciagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Asciagram = ({
<details
{...rest}
className={
rest?.className ? styles.Details + ' ' + rest.className : styles.Details
rest?.className ? `${styles.Details} ${rest.className}` : styles.Details
}
open={isInitialOpen}
>
Expand Down
Loading