Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to yarn 4 #68

Merged
merged 7 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2

updates:
- package-ecosystem: github-actions
directory: /
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/build-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,24 @@ jobs:
uses: actions/[email protected]
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: 🏗 Setup nodejs corepack
run: corepack enable

- name: 🏗 Get yarn config
id: yarn_config
run: echo "cache_folder=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/[email protected]
# id: yarn_cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn_config.outputs.cache_folder }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: 🏗 Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: 🚀 Build Typescript
run: yarn build
Expand Down
23 changes: 18 additions & 5 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:

jobs:
publish-npm:
if: github.repository_owner == 'AliMD'
if: github.repository_owner == 'Alwatr'

name: Publish NPM
runs-on: ubuntu-latest
Expand All @@ -29,12 +29,25 @@ jobs:
- name: 🏗 Setup nodejs
uses: actions/[email protected]
with:
node-version: ${{env.NODE_VERSION}}
registry-url: https://registry.npmjs.org/
cache: yarn
node-version: ${{ env.NODE_VERSION }}

- name: 🏗 Setup nodejs corepack
run: corepack enable

- name: 🏗 Get yarn config
id: yarn_config
run: echo "cache_folder=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/[email protected]
# id: yarn_cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn_config.outputs.cache_folder }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: 🏗 Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: 🏗 Build Typescript
run: yarn build
Expand Down
19 changes: 12 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ Desktop.ini
# Logs
*.log*

# package managers
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
#!.yarn/cache
.pnp.*
node_modules
package-lock.json

# Build
dist
build
Expand All @@ -23,15 +35,8 @@ build
!*.config.js
!**/res/*.js

# Dependencies
node_modules
package-lock.json

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodeLinker: node-modules
enableTelemetry: false
13 changes: 12 additions & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,16 @@
"main": "index.js",
"author": "S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com)",
"type": "module",
"private": "true"
"private": true,
"dependencies": {
"@alwatr/fsm": "workspace:^",
"@alwatr/logger": "^2.1.3",
"@alwatr/server-context": "workspace:^",
"@alwatr/signal": "workspace:^",
"@alwatr/type": "^1.1.5",
"@alwatr/util": "^1.2.10"
},
"devDependencies": {
"@types/node": "^20.9.0"
}
}
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "alwatr-signal",
"description": "Elegant powerful event system for handle global signals and states base on observable design pattern, written in tiny TypeScript module.",
"repository": "https://github.com/AliMD/alwatr-signal",
"repository": "https://github.com/Alwatr/signal",
"author": "S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com)",
"license": "MIT",
"type": "module",
Expand All @@ -14,29 +14,29 @@
"demo"
],
"scripts": {
"l": "yarn lint",
"b": "yarn build",
"l": "yarn run lint",
"b": "yarn run build",
"br": "run-s build build:r",
"c": "yarn clean",
"c": "yarn run clean",
"cb": "run-s clean build",
"s": "run-s build serve",
"w": "yarn watch",
"f": "yarn format",
"fl": "yarn format:eslint",
"fp": "yarn format:prettier",
"w": "yarn run watch",
"f": "yarn run format",
"fl": "yarn run format:eslint",
"fp": "yarn run format:prettier",
"rl": "run-s pull clean build release",
"lint": "run-s lint:*",
"lint": "run-s 'lint:*'",
"lint:ts": "eslint . --config .eslintrc.json --ext .ts",
"build": "run-s build:ts build:r",
"build:ts": "tsc --build",
"build:r": "lerna run build",
"format": "run-s format:prettier format:eslint",
"format:eslint": "yarn lint:ts --fix",
"format:eslint": "yarn run lint:ts --fix",
"format:prettier": "prettier . --ignore-path .gitignore --write",
"clean": "git clean -d -x -f --exclude=node_modules --exclude=*.env --exclude=_data",
"clean": "git clean -d -x -f --exclude=node_modules --exclude='*.env' --exclude=_data --exclude='.pnp*' --exclude=.yarn",
"serve": "wds",
"watch": "run-p watch:* serve",
"watch:ts": "yarn build:ts --watch --preserveWatchOutput",
"watch": "run-p 'watch:*' serve",
"watch:ts": "yarn run build:ts --watch --preserveWatchOutput",
"pull": "git pull",
"release": "lerna version",
"publish": "lerna publish from-package"
Expand All @@ -50,15 +50,16 @@
"@lerna-lite/run": "^2.6.0",
"@lerna-lite/version": "^2.5.1",
"@types/node": "^20.9.0",
"@web/dev-server": "^0.4.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@web/dev-server": "^0.4.0",
"eslint": "^8.53.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"tslib": "^2.6.2",
"typescript": "^5.2.2"
}
},
"packageManager": "[email protected]"
}
15 changes: 9 additions & 6 deletions packages/fsm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@
},
"repository": {
"type": "git",
"url": "https://github.com/AliMD/alwatr-signal",
"url": "https://github.com/Alwatr/signal",
"directory": "packages/fsm"
},
"homepage": "https://github.com/AliMD/alwatr-signal/tree/next/packages/fsm#readme",
"homepage": "https://github.com/Alwatr/signal/tree/next/packages/fsm#readme",
"bugs": {
"url": "https://github.com/AliMD/alwatr-signal/issues"
"url": "https://github.com/Alwatr/signal/issues"
},
"dependencies": {
"@alwatr/logger": "^2.1.2",
"@alwatr/signal": "^2.0.2",
"@alwatr/type": "^1.1.4",
"@alwatr/logger": "^2.1.3",
"@alwatr/signal": "workspace:^",
"@alwatr/type": "^1.1.5",
"tslib": "^2.6.2"
},
"devDependencies": {
"@types/node": "^20.9.0"
}
}
21 changes: 12 additions & 9 deletions packages/server-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@
},
"repository": {
"type": "git",
"url": "https://github.com/AliMD/alwatr-signal",
"url": "https://github.com/Alwatr/signal",
"directory": "packages/server-context"
},
"homepage": "https://github.com/AliMD/alwatr-signal/tree/next/packages/server-context#readme",
"homepage": "https://github.com/Alwatr/signal/tree/next/packages/server-context#readme",
"bugs": {
"url": "https://github.com/AliMD/alwatr-signal/issues"
"url": "https://github.com/Alwatr/signal/issues"
},
"dependencies": {
"@alwatr/fetch": "^2.0.7",
"@alwatr/fsm": "^2.0.2",
"@alwatr/logger": "^2.1.2",
"@alwatr/signal": "^2.0.2",
"@alwatr/type": "^1.1.4",
"@alwatr/util": "^1.2.9",
"@alwatr/fetch": "^2.0.8",
"@alwatr/fsm": "workspace:^",
"@alwatr/logger": "^2.1.3",
"@alwatr/signal": "workspace:^",
"@alwatr/type": "^1.1.5",
"@alwatr/util": "^1.2.10",
"tslib": "^2.6.2"
},
"devDependencies": {
"@types/node": "^20.9.0"
}
}
15 changes: 9 additions & 6 deletions packages/signal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@
},
"repository": {
"type": "git",
"url": "https://github.com/AliMD/alwatr-signal",
"url": "https://github.com/Alwatr/signal",
"directory": "packages/signal"
},
"homepage": "https://github.com/AliMD/alwatr-signal/tree/next/packages/signal#readme",
"homepage": "https://github.com/Alwatr/signal/tree/next/packages/signal#readme",
"bugs": {
"url": "https://github.com/AliMD/alwatr-signal/issues"
"url": "https://github.com/Alwatr/signal/issues"
},
"dependencies": {
"@alwatr/logger": "^2.1.2",
"@alwatr/type": "^1.1.4",
"@alwatr/util": "^1.2.9",
"@alwatr/logger": "^2.1.3",
"@alwatr/type": "^1.1.5",
"@alwatr/util": "^1.2.10",
"tslib": "^2.6.2"
},
"devDependencies": {
"@types/node": "^20.9.0"
}
}
Loading