Skip to content

Commit

Permalink
chore: migarte w3-store from ucanto branch (#62)
Browse files Browse the repository at this point in the history
* chore: migarte w3-store from ucanto branch

* chore: update pnpm lockfile

* fix: drop ts references

* fix: typechcecking

* fix: typo in sigv4 workflow

* fix: sigv4 tests

* fix: add typescript dep

* fix: add back sigv4 project ref

* fix: types
  • Loading branch information
Gozala authored Sep 16, 2022
1 parent 77f745c commit 35092a5
Show file tree
Hide file tree
Showing 42 changed files with 3,306 additions and 39 deletions.
4 changes: 3 additions & 1 deletion .github/release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"packages": {
"packages/access": {},
"packages/access-api": {},
"packages/wallet": {}
"packages/wallet": {},
"packages/store": {},
"packages/sigv4": {}
}
}
4 changes: 3 additions & 1 deletion .github/release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"packages/access": "0.2.0",
"packages/wallet": "0.3.0",
"packages/access-api": "0.4.0"
"packages/access-api": "0.4.0",
"packages/sigv4": "1.0.0",
"packages/store": "1.1.0"
}
78 changes: 78 additions & 0 deletions .github/workflows/sigv4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: web3-storage/sigv4

on:
workflow_dispatch:
push:
branches:
- main
- master
paths:
- 'packages/sigv4/**'
pull_request:
branches:
- main
- master
paths:
- 'packages/sigv4/**'
jobs:
check:
name: Typecheck
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 16
project:
- sigv4
steps:
- uses: actions/checkout@v2

- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
uses: pnpm/action-setup@v2.0.1
id: pnpm-install
with:
version: 7
run_install: true

- name: Typecheck
uses: gozala/typescript-error-reporter-action@v1.0.8
with:
project: packages/${{matrix.project}}/tsconfig.json
test:
name: Test
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version:
- 16
os:
- ubuntu-latest
project:
- sigv4

steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
uses: pnpm/action-setup@v2.0.1
id: pnpm-install
with:
version: 7
run_install: true

- name: Test (Node)
run: pnpm run --if-present --dir packages/${{matrix.project}} test:node

- name: Test (Web)
run: pnpm run --if-present --dir packages/${{matrix.project}} test:web
78 changes: 78 additions & 0 deletions .github/workflows/w3-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: w3-store

on:
workflow_dispatch:
push:
branches:
- main
- master
paths:
- 'packages/sigv4/**'
- 'packages/store/**'
pull_request:
branches:
- main
- master
paths:
- 'packages/sigv4/**'
- 'packages/store/**'
- '.github/workflows/w3-store.yml'
jobs:
check:
name: Typecheck
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 16
project:
- store
steps:
- uses: actions/checkout@v2

- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
uses: pnpm/action-setup@v2.0.1
id: pnpm-install
with:
version: 7
run_install: true

- name: Typecheck
uses: gozala/typescript-error-reporter-action@v1.0.8
with:
project: packages/${{matrix.project}}/tsconfig.json
test:
name: Test
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version:
- 16
os:
- ubuntu-latest
project:
- store

steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
uses: pnpm/action-setup@v2.0.1
id: pnpm-install
with:
version: 7
run_install: true

- name: Test (Node)
run: pnpm run --if-present --dir packages/${{matrix.project}} test:node
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
"format": "prettier --write '**/*.{js,ts,yml,json}' --ignore-path .gitignore",
"format:check": "prettier --check '**/*.{js,ts,yml,json}' --ignore-path .gitignore",
"clean": "rm -rf docs node_modules pnpm-lock.yaml packages/*/{pnpm-lock.yaml,coverage,.nyc_output,dist,node_modules,.next}",
"lint": "pnpm -r run lint",
"test": "pnpm -r run test"
"lint": "pnpm -r --if-present run lint",
"test": "pnpm -r --if-present run test",
"check": "pnpm -r --if-present run check"
},
"devDependencies": {
"lint-staged": "^13.0.3",
"prettier": "2.7.1",
"simple-git-hooks": "^2.8.0",
"wrangler": "^2.0.28"
"wrangler": "^2.0.28",
"typescript": "^4.8.3"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
Expand Down
1 change: 1 addition & 0 deletions packages/access-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"deploy": "wrangler publish",
"dev": "miniflare --watch --debug --env ../../.env --wrangler-env dev",
"build": "scripts/cli.js build",
"check": "tsc --build",
"test": "tsc --build && ava --serial"
},
"author": "Hugo Dias <hugomrdias@gmail.com> (hugodias.me)",
Expand Down
1 change: 1 addition & 0 deletions packages/access/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"scripts": {
"lint": "tsc && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"build": "tsc --build",
"check": "tsc --build",
"test": "mocha",
"testw": "watch 'pnpm test' src test --interval 1",
"rc": "npm version prerelease --preid rc"
Expand Down
9 changes: 9 additions & 0 deletions packages/sigv4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

## 1.0.0 (2022-06-24)


### Bug Fixes

* test test script names ([a830151](https://www.github.com/web3-storage/ucanto/commit/a8301516104a7b04240cf90f480b89c08dfcd585))
* **w3:** post merge regressions ([fd0de92](https://www.github.com/web3-storage/ucanto/commit/fd0de924b2a5f3534480c2307264076e482df7bd))
67 changes: 67 additions & 0 deletions packages/sigv4/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "@web3-storage/sigv4",
"version": "1.0.0",
"main": "src/index.js",
"types": "dist/src/index.d.ts",
"typedocMain": "dist/src/index.js",
"type": "module",
"license": "MIT",
"repository": {
"url": "web3-storage/upload-protocol",
"directory": "packages/sigv4"
},
"exports": {
".": "./src/index.js"
},
"scripts": {
"check": "tsc --build",
"lint": "tsc && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,md,yml,json}' --ignore-path ../../.gitignore",
"test:node": "DOTENV_CONFIG_PATH=../../.env mocha -r dotenv/config",
"test:web": "pw-test test",
"testw": "watch 'pnpm test' src test --interval 1"
},
"files": [
"src",
"dist/src/*.d.ts",
"dist/src/*.d.ts.map"
],
"dependencies": {
"@noble/hashes": "^1.0.0"
},
"devDependencies": {
"@types/mocha": "^9.1.1",
"@types/chai": "^4.3.3",
"@types/node": "^18.7.18",
"@web-std/fetch": "^4.1.0",
"assert": "^2.0.0",
"delay": "^5.0.0",
"dotenv": "^16.0.0",
"mocha": "^9.2.2",
"chai": "^4.3.6",
"playwright-test": "^8.1.1",
"watch": "^1.0.2"
},
"eslintConfig": {
"extends": [
"./node_modules/hd-scripts/eslint/index.js"
],
"ignorePatterns": [
"pw-test.config.cjs"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"env": {
"mocha": true
}
},
"eslintIgnore": [
"node_modules",
"coverage",
"dist",
"docs"
],
"engines": {
"node": ">= 14.0.0"
}
}
17 changes: 17 additions & 0 deletions packages/sigv4/pw-test.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const path = require('path')
const dotenv = require('dotenv')

dotenv.config({
path: path.join(__dirname, '../../.env'),
})

/** @type {import('playwright-test').RunnerOptions} */
module.exports = {
buildConfig: {
define: {
S3_ACCESS_KEY_ID: JSON.stringify(process.env.S3_ACCESS_KEY_ID),
S3_SECRET_ACCESS_KEY: JSON.stringify(process.env.S3_SECRET_ACCESS_KEY),
S3_BUCKET: JSON.stringify(process.env.S3_BUCKET),
},
},
}
Loading

0 comments on commit 35092a5

Please sign in to comment.