Skip to content

Commit

Permalink
Merge pull request #94 from heybokeh/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
madeleineostoja authored Jul 11, 2024
2 parents b02e7a3 + b6b86df commit 6d101dd
Show file tree
Hide file tree
Showing 29 changed files with 5,165 additions and 10,697 deletions.
68 changes: 53 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,62 @@
name: tests
name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
uses: pnpm/action-setup@v3
with:
version: latest
run_install: true
- name: Lint
run: |
export NODE_OPTIONS=--max_old_space_size=4096
pnpm lint
test-unit:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
uses: pnpm/action-setup@v3
with:
version: latest
run_install: true
- name: Unit Tests
run: pnpm test

build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
uses: pnpm/action-setup@v3
with:
version: latest
run_install: true
- name: Build
run: pnpm build

5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
node_modules

# Dist
/pollen.css
/index.js
/index.d.ts
/utils
/dist

# Runtime
coverage
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm test
npx lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{ts}": ["prettier --write", "eslint --quiet"]
}
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"singleQuote": true,
"trailingComma": "none",
"overrides": [
{
Expand Down
2 changes: 1 addition & 1 deletion @types/map-obj.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module 'map-obj';
declare module "map-obj";
2 changes: 1 addition & 1 deletion @types/pollen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import modules from '../src/modules';
import modules from "../src/modules";
type ModuleName = keyof typeof modules;

export type CustomModule = {
Expand Down
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ Pollen's design tokens can be used to build any project. They're easy to customi

```js
module.exports = (pollen) => ({
output: './pollen.css',
output: "./pollen.css",
modules: {
...pollen,
color: {
...pollen.colors,
bg: 'white',
text: 'var(--color-black)'
bg: "white",
text: "var(--color-black)"
}
},
media: {
'(prefers-color-scheme: dark)': {
"(prefers-color-scheme: dark)": {
color: {
bg: 'var(--color-black)',
text: 'white'
bg: "var(--color-black)",
text: "white"
}
}
}
Expand Down
58 changes: 58 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import prettier from "eslint-config-prettier";
import ts from "typescript-eslint";
import globals from "globals";

export default [
...ts.configs.recommended,
prettier,
{
ignores: ["**/node_modules/**", "**/*.js"]
},
{
files: ["**/*.ts"],
languageOptions: {
globals: {
...globals.browser,
...globals.nodeBuiltin
}
},
rules: {
curly: "warn",
"default-case-last": "warn",
eqeqeq: "error",
"no-array-constructor": "error",
"no-console": "warn",
"no-else-return": "warn",
"no-multi-assign": "error",
"no-nested-ternary": "error",
"no-param-reassign": "error",
"no-return-assign": "warn",
"no-sequences": "error",
"no-template-curly-in-string": "warn",
"no-throw-literal": "error",
"no-undef-init": "warn",
"no-unneeded-ternary": "warn",
"no-unused-private-class-members": "warn",
"no-useless-rename": "warn",
"no-var": "error",
"prefer-const": "off", // Messes with $props runes
"prefer-promise-reject-errors": "warn",
"prefer-template": "warn",
radix: "warn",
"require-yield": "warn",
"spaced-comment": "warn",
yoda: ["error", "never", { exceptRange: true }],
"one-var": ["error", "never"],
"@typescript-eslint/no-empty-object-type": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_"
}
]
}
}
];
Loading

0 comments on commit 6d101dd

Please sign in to comment.