Skip to content

Commit

Permalink
Merge pull request #2 from APSPhysics/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Justin Wilkerson authored Aug 27, 2020
2 parents 50afd98 + d4785fa commit df7df5f
Show file tree
Hide file tree
Showing 17 changed files with 4,342 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ node_modules
CHANGELOG.md
.prettierrc
.eslintrc
test-react-app

1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line functional/immutable-data
module.exports = {
extends: [
"react-app", // See below
Expand Down
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "@apsphysics/eslint-config",
"version": "0.0.3",
"version": "0.0.2",
"description": "ESLint configurations for immutable React & TypeScript projects.",
"author": "APSPhysics",
"main": "index.js",
"scripts": {
"lint": "eslint ."
"ci": "npm run lint && npm run format",
"format": "prettier --write *.js",
"lint": "eslint *.js",
"publish": "np --no-publish"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -40,6 +43,7 @@
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-functional": "^3.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-immutable": ">=1.0.0",
"eslint-plugin-jest": "^22.17.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.1",
Expand All @@ -56,8 +60,10 @@
"eslint": ">=7.5.0",
"eslint-config-prettier": ">=6.11.0",
"eslint-config-react-app": "^5.2.1",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-functional": "^3.0.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-immutable": ">=1.0.0",
"eslint-plugin-import": ">=2.22.0",
"eslint-plugin-jest": ">=23.18.0",
"eslint-plugin-jsx-a11y": ">=6.3.1",
"eslint-plugin-prettier": ">=3.1.4",
Expand Down
3 changes: 3 additions & 0 deletions test-react-app/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["../index.js"]
}
4 changes: 4 additions & 0 deletions test-react-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.DS_Store
dist
*.local
3 changes: 3 additions & 0 deletions test-react-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is a simple React/TypeScript app used to test the linting rules during development.

This app is not included in the published build.
12 changes: 12 additions & 0 deletions test-react-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions test-react-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "test-react-app",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint ."
},
"dependencies": {
"@pika/react": "^16.13.1",
"@pika/react-dom": "^16.13.1",
"@types/react": "^16.9.48",
"@types/react-dom": "^16.9.8"
},
"devDependencies": {
"vite": "^1.0.0-rc.1",
"vite-plugin-react": "^3.0.0"
}
}
42 changes: 42 additions & 0 deletions test-react-app/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

button {
font-size: calc(10px + 2vmin);
}
34 changes: 34 additions & 0 deletions test-react-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React, { useState } from "react";
import logo from "./logo.svg";
import "./App.css";

function App() {
const [count, setCount] = useState(0);

return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>Hello Vite + React!</p>
<p>
<button onClick={() => setCount(count => count + 1)}>
count is: {count}
</button>
</p>
<p>
Edit <code>App.jsx</code> and save to test HMR updates.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}

export default App;
13 changes: 13 additions & 0 deletions test-react-app/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
7 changes: 7 additions & 0 deletions test-react-app/src/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions test-react-app/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
13 changes: 13 additions & 0 deletions test-react-app/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// @ts-check
const reactPlugin = require("vite-plugin-react");

/**
* @type { import('vite').UserConfig }
*/
const config = {
jsx: "react",
plugins: [reactPlugin],
};

// eslint-disable-next-line functional/immutable-data
module.exports = config;
Loading

0 comments on commit df7df5f

Please sign in to comment.