Skip to content

Commit

Permalink
Migrate to pnpm workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
G4brym committed Mar 9, 2024
1 parent 3654759 commit d0b8813
Show file tree
Hide file tree
Showing 278 changed files with 6,266 additions and 48,565 deletions.
27 changes: 5 additions & 22 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
max_line_length = 120
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_style = tab
indent_size = 4

[*.py]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
insert_final_newline = true

[Makefile]
indent_style = tab
indent_size = 4

[*.sln]
indent_style = tab

[*.{md,mdx}]
trim_trailing_whitespace = false
[*.yml]
indent_style = space
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
23 changes: 23 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"typescript",
"prettier"
],
"ignorePatterns": ["**/test/*.js","**/test/*.ts","**/test/**/*.js","**/test/**/*.ts", "packages/worker-constellation-entry/src/ai/tasks/data/validators.js"],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unused-vars": "warn"
}
}
14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ jobs:
- name: Set RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Apply new version
run: node worker/config/preparePublish.js
- name: Install worker modules
run: cd worker && npm install
- name: Build worker
run: cd worker && npm run build
run: node packages/worker/config/preparePublish.js
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Build everything
run: pnpm build
- name: Publish to npm
run: cd worker && npm publish --access public
run: pnpm publish-npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
12 changes: 7 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ jobs:
- name: Set RELEASE_VERSION
run: echo "RELEASE_VERSION=0.0.1" >> $GITHUB_ENV
- name: Apply new version
run: node worker/config/preparePublish.js
- name: Build dashboard
run: make build-dashboard
- name: Build worker
run: make build-worker
run: node packages/worker/config/preparePublish.js
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Build everything
run: pnpm build
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ pnpm-debug.log*
# local tests
my-r2-explorer

worker/bin
worker/README.md
worker/LICENSE
packages/worker/bin
packages/worker/README.md
packages/worker/LICENSE

worker/dev/.wrangler
packages/worker/dev/.wrangler

packages/github-action/wrangler.toml
packages/github-action/src
Expand Down
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/commit-msg

This file was deleted.

8 changes: 0 additions & 8 deletions .husky/common.sh

This file was deleted.

8 changes: 3 additions & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

#npm run prettify
#npm run test
npm run lint
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git-checks=false
shamefully-hoist=true
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ npm publish --access public
```bash
cd worker
export RELEASE_VERSION=v1.0.0
node config/preparePublish.js
node packages/config/preparePublish.js
npm run build
npm publish --access public
```
Expand All @@ -53,7 +53,7 @@ convert logo.png -resize '152x152' -background white apple-touch-icon-152x152.pn
convert logo.png -resize '16x16' favicon-16x16.png
convert logo.png -resize '32x32' favicon-32x32.png
convert logo.png -resize '144x144' msapplication-icon-144x144.png
convert logo.png -resize '150x150' -background transparent -compose Copy -gravity center -extent 270x270 mstile-150x150.png
convert logo.png -resize '150x150' -background transparent -compose Copy -gravity center -extent 270x270 mstile-150x150.png
convert logo.png -resize '512x512' safari-pinned-tab.svg


Expand Down
18 changes: 0 additions & 18 deletions Makefile

This file was deleted.

26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "r2-explorer-root",
"version": "0.0.0",
"private": true,
"scripts": {
"prepare": "husky install",
"lint": "(eslint . || (eslint . --fix; exit 1)) && (prettier --check '*.{json,js}' 'packages/*/src/**/*.{js,ts}' || (prettier -w '*.{json,js}' 'packages/*/src/**/*.{js,ts}'; exit 1))",
"build-create": "pnpm run --filter create-r2-explorer build",
"build-dashboard": "pnpm run --filter r2-explorer-dashboard build",
"build-worker": "pnpm run --filter worker build",
"build": "pnpm build-create && pnpm build-dashboard && pnpm build worker",
"deploy-dashboard": "pnpm run --filter r2-explorer-dashboard deploy",
"deploy-dashboard-dev": "pnpm run --filter r2-explorer-dashboard deploy-dev",
"deploy-dev-worker": "pnpm run --filter r2-explorer-dev-worker deploy",
"publish-npm": "pnpm run --filter worker publish"
},
"devDependencies": {
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-typescript": "^3.0.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"prettier": "^3.2.5",
"typescript": "^4.7.4"
}
}
Loading

0 comments on commit d0b8813

Please sign in to comment.