Skip to content

Commit

Permalink
chore: Release next versions (#58)
Browse files Browse the repository at this point in the history
* feat: release rollup-plugin-imagetools
* feat: split directives into image tools-core
  • Loading branch information
JonasKruckenberg authored Apr 12, 2021
1 parent 5cb83bb commit 4fb8686
Show file tree
Hide file tree
Showing 237 changed files with 8,865 additions and 5,943 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

github: [JonasKruckenberg]
open_collective: # Replace with a single Open Collective username
custom: ["https://paypal.me/jonaskruckie"]
custom: ["https://paypal.me/jonaskruckie"]
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
interval: "daily"
33 changes: 24 additions & 9 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Generate Coverage
on:
push:
branches:
- main
- master
- next

jobs:
Expand All @@ -12,15 +12,30 @@ jobs:
- uses: actions/checkout@v2
with:
lfs: true
- name: Use Node.js
uses: actions/setup-node@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: yarn
- name: Generate coverage report
run: yarn coverage > coverage.json
- name: Upload report
run: node_modules/.bin/codecov --disable=gcov
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
CI: true
run: yarn coverage
- name: Upload imagetools-core Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: imagetools-core
files: 'packages/core/coverage/coverage-final.json'

- name: Upload vite-imagetools Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: vite-imagetools
files: 'packages/vite/coverage/coverage-final.json'

- name: Upload rollup-plugin-imagetools Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: rollup-plugin-imagetools
files: 'packages/rollup/coverage/coverage-final.json'
39 changes: 35 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,52 @@ name: Release
on:
push:
branches: ["main", "next"]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 15.x]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"
lfs: true
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install deps
run: yarn
- name: Run unit tests
run: yarn test

release:
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"
lfs: true
- uses: actions/setup-node@v1
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-node@v2
with:
node-version: "14"
- run: yarn
- run: yarn test
- run: yarn build
- name: create npmrc file
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Configure CI Git User
run: |
git config --global user.email iterpre@protonmail.com
git config --global user.name JonasKruckenberg
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
run: yarn release --no-verify-access
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
dist
.DS_Store
coverage
.DS_STORE
coverage
yarn-error.log
**/debug
14 changes: 0 additions & 14 deletions .releaserc.yml

This file was deleted.

72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributing

Hey! Thanks for considering to contribute to this project! We have some tips and tricks to get you started:

## Project Setup

This repository is a monorepo using yarn workspaces and lerna.<br>
The folder structure is a following:

```
┠─ docs:
┃ Documentation that is common to all packages.
┠─ examples:
┃ Example projects showing the real-word usage of imagetools.
┖─ packages
┠─ core:
┃ Holds all transforms and common utility functions needed for builtools integrations.
┖─ vite:
The integration with the vite frontend builtool.
```

## Running Tests

Running `yarn test`from the top level runs all tests for all packages, if your only interested in running tests for a single package cd into that directory and run `yarn test` there.

## Pull Request Guidelines

- All pull requests should be made against the `main` branch. (Not yet applicable)

- Make sure tests pass!

- Commit messages follow the [conventional commits style](). This helps generating changelogs and ensuring proper versioning.

- When adding transforms,

- does your use case absolutely require a new transform to be added or can it be archived some other way?

- make sure the functions don't have any side-effects and don't keep state between invocations.

- add a section to the specification explaining you transform

## Integrations

Imagetools is written to be easily adaptable to different buildtools and environment, here are a few tips to get you started:

- Read the specification

The user facing api has been designed to be interchangeable, so users can easily switch their existing project using an image processing server to use imagetools or vice-versa! That's why [the specificatio](docs/spec.md) clearly states what transformations and behaviour an Implementation must support to be compatible. You should reference this document to make sure your Integration is compatible with all others.

- Imagetools-core exposes commonly used utility funtions

To make your life easier imagetools-core provides utility functions for the common tasks like generating cache keys, loading images etc. Have a look at the [api docs]()!

- Use buildtool specific systems

Users expect their buildtools output to be consistent, so you should always choose the system provided by the builtools rather than building your own. This includes warnings (e.g. rollup and vite have the `this.warn` function) and caching.

- Avoid caching on disk

Images are big in comparison to other assets in a website, so you should be very careful when caching images on disk since the cache will - most likely - quickly baloon in size and no one likes that!
Since transformations are deterministic (meaning they produce the same image given the same config) you should leverage the browsers or builtools cache whenever possible.

- Link to this repository

Whenever you build an something with imagetools-core, make sure to link back to this repository. This will allow your users to read the docs provided by this repo. If your integration is popular or for a popular buildtool you can also ask to have your package moven into this monorepo, so your code stays maintained.

- Reexport the directives when possible

both vite-imagetools and rollup-plugin-imagetools reexport all builtin directives, so users can create their own directives using the builtins as building blocks. You should - whenever possible - also do the same so users can profit from the extensible nature of imagetools.
Loading

0 comments on commit 4fb8686

Please sign in to comment.