Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
refactor build setup to use pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
IMax153 committed Oct 20, 2022
1 parent c321605 commit 16017c7
Show file tree
Hide file tree
Showing 84 changed files with 6,434 additions and 9,708 deletions.
6 changes: 6 additions & 0 deletions .changeset/yellow-needles-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@effect/printer": minor
"@effect/printer-ansi": minor
---

remove tsplus/stdlib in favor of fp-ts/data
3 changes: 2 additions & 1 deletion .github/changeset-version.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { execSync } = require("node:child_process");

execSync("npm install -g pnpm");
execSync("npx changeset version");
execSync("YARN_ENABLE_IMMUTABLE_INSTALLS=false node .yarn/releases/yarn-3.2.1.cjs");
execSync("pnpm install --lockfile-only");
40 changes: 0 additions & 40 deletions .github/workflows/branch.yml

This file was deleted.

60 changes: 33 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,55 @@
name: Main CI
name: Main Flow

on:
push:
branches:
- main
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.17.1]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 16.x
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Install
run: |
npm install -g yarn
yarn
env:
CI: "true"
- name: Build
run: |
yarn build
env:
CI: "true"
- name: Check Circular Dependencies
run: |
yarn circular
env:
CI: "true"
- name: Test
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2.0.1
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
yarn test --run
env:
CI: "true"
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install
- run: pnpm build
- run: pnpm test
- name: Create Version PR or Publish to NPM
if: github.repository == 'fp-ts/core'
id: changesets
uses: changesets/action@v1
with:
version: node .github/changeset-version.cjs
publish: yarn release
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.EFFECT_BOT_NPM }}
46 changes: 46 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PR Flow

on:
pull_request:
branches:
- 'main'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.17.1]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2.0.1
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install
- run: pnpm build
- run: pnpm test
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tasks:
- init: yarn && yarn build
- init: pnpm install && pnpm build
github:
prebuilds:
addCheck: true
Expand Down
31 changes: 4 additions & 27 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"typescript.enablePromptUseWorkspaceTsdk": true,
"editor.formatOnSave": true,
"eslint.format.enable": true,
"explorer.sortOrder": "mixed",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
Expand All @@ -17,32 +19,7 @@
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"files.exclude": {
//"**/.yarn*": true,
//"**/.*.js": true,
//"**/.swc": true,
//"**/.changeset": true,
//"**/yarn.lock": true,
//"**/.*rc": true,
//"**/.*config": true,
//"**/.git*": true,
//"**/.npmignore*": true,
//"**/.husky": true,
//"**/LICENSE.*": true,
//"**/lerna.json": true,
//"**/jest.config.js": true,
},
"prettier.disableLanguages": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"eslint.validate": [
"markdown",
"javascript",
"typescript"
],
"eslint.validate": ["markdown", "javascript", "typescript"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
Expand Down
8 changes: 4 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
{
"label": "clean",
"type": "shell",
"command": "yarn clean",
"command": "pnpm clean",
"isBackground": false,
"problemMatcher": []
},
{
"label": "build-watch",
"type": "shell",
"command": "yarn build-watch",
"command": "pnpm build-watch",
"problemMatcher": [
"$tsc-watch"
],
Expand All @@ -27,7 +27,7 @@
{
"label": "build",
"type": "shell",
"command": "yarn build",
"command": "pnpm build",
"problemMatcher": [],
"isBackground": false
},
Expand All @@ -37,7 +37,7 @@
"build-watch"
],
"type": "shell",
"command": "yarn test",
"command": "pnpm test",
"problemMatcher": []
}
]
Expand Down
18 changes: 0 additions & 18 deletions .yarn/patches/eslint-plugin-codegen-npm-0.16.1-87770191cd

This file was deleted.

363 changes: 0 additions & 363 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

This file was deleted.

786 changes: 0 additions & 786 deletions .yarn/releases/yarn-3.2.1.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarnrc.yml

This file was deleted.

14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
## Welcome to Effect-TS - Printer [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/Effect-TS/printer)
[![Main CI](https://github.com/Effect-TS/printer/actions/workflows/main.yml/badge.svg)](https://github.com/Effect-TS/printer/actions/workflows/main.yml)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/Effect-TS/printer)

Please follow up to: [https://github.com/Effect-TS/printer/tree/master/packages/printer](https://github.com/Effect-TS/printer/tree/master/packages/printer)
# Effect-TS - Pretty Printer

## Install
This repository contains packages related to pretty-printing that are compatible with the Effect-TS ecosystem.

We recommend the usage of `yarn` and if you have `yarn workspaces` that handles by default hoisting of dependencies:

```sh
yarn add @tsplus/stdlib
```
- [`@effect/printer`](./packages/printer): a general module which defines a pretty printer for formatting text in a flexible and convenient way
- [`@effect/printer-ansi`](./packages/printer-ansi): a module containing a renderer suitable for displaying documents on ANSI-compatible terminals

## Acknowledgements

Expand Down
28 changes: 12 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
{
"name": "effect",
"private": true,
"repository": "https://github.com/Effect-TS/printer.git",
"repository": {
"type": "git",
"url": "https://github.com/Effect-TS/printer.git"
},
"workspaces": [
"packages/*"
],
"scripts": {
"changeset": "changeset",
"release": "changeset publish",
"clean": "ultra -r clean && rimraf tsconfig.tsbuildinfo",
"build": "ultra -r -b build-pack",
"build": "pnpm build-all && ultra -r -b build-pack",
"build-all": "tsc -b tsconfig.json",
"build-watch": "tsc -b tsconfig.json --watch",
"circular": "yarn org:madge --ts-config ./tsconfig.madge.json --circular --no-color --no-spinner --warning packages/*/build/esm packages/*/build/test packages/*/build/examples",
"circular": "madge --ts-config ./tsconfig.madge.json --circular --no-color --no-spinner --warning packages/*/build/esm packages/*/build/test packages/*/build/examples",
"test": "vitest",
"autofix": "ultra -r autofix",
"lint": "ultra -r lint",
"tc": "ultra -r tc",
"postinstall": "tsplus-install",
"org:rimraf": "cd $INIT_CWD && rimraf",
"org:tsc": "cd $INIT_CWD && tsc",
"org:eslint": "cd $INIT_CWD && eslint",
"org:concurrently": "cd $INIT_CWD && concurrently",
"org:build-utils": "cd $INIT_CWD && build-utils",
"org:babel": "cd $INIT_CWD && babel",
"org:madge": "cd $INIT_CWD && madge"
"postinstall": "tsplus-install"
},
"packageManager": "yarn@3.2.1",
"devDependencies": {
"@babel/cli": "^7.18.10",
"@babel/core": "^7.19.1",
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
"@changesets/changelog-github": "^0.4.6",
"@changesets/cli": "^2.24.4",
"@effect-ts/build-utils": "0.40.5",
"@effect-ts/build-utils": "0.40.3",
"@effect-ts/core": "^0.60.4",
"@effect/printer": "workspace:^",
"@effect/printer-ansi": "workspace:^",
Expand All @@ -50,7 +45,6 @@
"cpx": "^1.5.0",
"eslint": "^8.23.1",
"eslint-import-resolver-typescript": "^3.5.1",
"eslint-plugin-codegen": "0.16.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
Expand All @@ -63,7 +57,9 @@
"vite": "^3.1.3",
"vitest": "0.23.4"
},
"resolutions": {
"eslint-plugin-codegen": "patch:eslint-plugin-codegen@npm:0.16.1#.yarn/patches/eslint-plugin-codegen-npm-0.16.1-87770191cd"
"pnpm": {
"patchedDependencies": {
"@effect-ts/build-utils@0.40.3": "patches/@effect-ts__build-utils@0.40.3.patch"
}
}
}
Loading

0 comments on commit 16017c7

Please sign in to comment.