mirror of
https://github.com/morten-olsen/bob.git
synced 2026-02-08 01:46:29 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
732e47ceed | ||
|
|
b722d385f7 | ||
|
|
6f485f90e4 | ||
|
|
b01ce539b7 | ||
|
|
69a6b23455 |
35
.github/workflows/release-package.yml
vendored
35
.github/workflows/release-package.yml
vendored
@@ -33,9 +33,9 @@ jobs:
|
|||||||
- run: |
|
- run: |
|
||||||
pnpm install
|
pnpm install
|
||||||
pnpm run build
|
pnpm run build
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
env:
|
env:
|
||||||
ASSET_URL: https://mortenolsen.pro/bob
|
ASSET_URL: https://mortenolsen.pro/bob
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: lib
|
name: lib
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
@@ -44,6 +44,10 @@ jobs:
|
|||||||
packages/*/package.json
|
packages/*/package.json
|
||||||
package.json
|
package.json
|
||||||
README.md
|
README.md
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v2
|
||||||
|
with:
|
||||||
|
path: './packages/playground/dist'
|
||||||
update-release-draft:
|
update-release-draft:
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
needs: build
|
needs: build
|
||||||
@@ -64,21 +68,18 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build, update-release-draft]
|
needs: [build, update-release-draft]
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Setup Pages
|
||||||
with:
|
uses: actions/configure-pages@v3
|
||||||
fetch-depth: 0
|
- name: Deploy to GitHub Pages
|
||||||
- uses: actions/download-artifact@v3
|
id: deployment
|
||||||
with:
|
uses: actions/deploy-pages@v2
|
||||||
name: lib
|
|
||||||
path: ./
|
|
||||||
- name: Deploy 🚀
|
|
||||||
uses: JamesIves/github-pages-deploy-action@4.0.0
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
branch: gh-pages
|
|
||||||
folder: packages/playground/dist
|
|
||||||
release-npm:
|
release-npm:
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -105,7 +106,7 @@ jobs:
|
|||||||
pnpm install
|
pnpm install
|
||||||
git config user.name "Github Actions Bot"
|
git config user.name "Github Actions Bot"
|
||||||
git config user.email "<>"
|
git config user.email "<>"
|
||||||
pnpm version $(git describe --tag --abbrev=0)
|
pnpm ts-node -T scripts/set-version.ts $(git describe --tag --abbrev=0)
|
||||||
pnpm publish -r
|
pnpm publish -r --publish-branch main --access public --no-git-checks
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -1,10 +1,16 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@pnpm/find-workspace-packages": "^6.0.9",
|
||||||
|
"@pnpm/logger": "^5.0.0",
|
||||||
"@react-native-community/eslint-config": "^3.2.0",
|
"@react-native-community/eslint-config": "^3.2.0",
|
||||||
"eslint": "^8.33.0",
|
"eslint": "^8.33.0",
|
||||||
"prettier": "^2.8.3",
|
"prettier": "^2.8.3",
|
||||||
|
"ts-node": "^10.9.1",
|
||||||
"turbo": "^1.9.9"
|
"turbo": "^1.9.9"
|
||||||
},
|
},
|
||||||
|
"workspaces": [
|
||||||
|
"packages/*"
|
||||||
|
],
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "turbo build",
|
"build": "turbo build",
|
||||||
@@ -14,5 +20,8 @@
|
|||||||
"test": "turbo test"
|
"test": "turbo test"
|
||||||
},
|
},
|
||||||
"version": "0.1.8",
|
"version": "0.1.8",
|
||||||
"name": "@bob-the-algorithm/repo"
|
"name": "@bob-the-algorithm/repo",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^20.5.9"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,10 @@
|
|||||||
],
|
],
|
||||||
"private": false,
|
"private": false,
|
||||||
"main": "./dist/cjs/index.js",
|
"main": "./dist/cjs/index.js",
|
||||||
"name": "bob-the-algorithm",
|
"name": "@bob-the-algorithm/core",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc --build configs/tsconfig.libs.json"
|
"build": "tsc --build configs/tsconfig.libs.json"
|
||||||
},
|
},
|
||||||
"types": "./dist/cjs/types/index.d.ts"
|
"types": "./dist/cjs/types/index.d.ts",
|
||||||
|
"version": "0.1.8"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@bob-the-algorithm/config",
|
"name": "@bob-the-algorithm/config",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "0.0.1"
|
"version": "0.1.8"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@bob-the-algorithm/playground",
|
"name": "@bob-the-algorithm/playground",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.1.8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bob-the-algorithm": "workspace:^",
|
"@bob-the-algorithm/core": "workspace:^",
|
||||||
"date-fns": "^2.30.0",
|
"date-fns": "^2.30.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0"
|
"react-dom": "^18.2.0"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { calulation, plugins } from 'bob-the-algorithm';
|
import { calulation, plugins } from '@bob-the-algorithm/core';
|
||||||
import { createWorker } from '../../features/runner/worker';
|
import { createWorker } from '../../features/runner/worker';
|
||||||
import { convertResult } from '../../utils/graph';
|
import { convertResult } from '../../utils/graph';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { GraphNode } from 'bob-the-algorithm';
|
import { GraphNode } from '@bob-the-algorithm/core';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { ConvertedResult } from '../../utils/graph';
|
import { ConvertedResult } from '../../utils/graph';
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { CalulationResult } from 'bob-the-algorithm';
|
import { CalulationResult } from '@bob-the-algorithm/core';
|
||||||
|
|
||||||
function msToHMS(ms: number) {
|
function msToHMS(ms: number) {
|
||||||
// 1- Convert to seconds:
|
// 1- Convert to seconds:
|
||||||
|
|||||||
1052
pnpm-lock.yaml
generated
1052
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
26
scripts/set-version.ts
Normal file
26
scripts/set-version.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { findWorkspacePackages } from '@pnpm/find-workspace-packages';
|
||||||
|
import { writeFile } from 'fs/promises';
|
||||||
|
import { join } from 'path';
|
||||||
|
|
||||||
|
const version = process.argv[2];
|
||||||
|
if (!version) {
|
||||||
|
throw new Error('Version is required');
|
||||||
|
}
|
||||||
|
|
||||||
|
const run = async () => {
|
||||||
|
const packages = await findWorkspacePackages(process.cwd());
|
||||||
|
|
||||||
|
for (const { manifest, dir } of packages) {
|
||||||
|
console.log(dir, version);
|
||||||
|
manifest.version = version;
|
||||||
|
await writeFile(
|
||||||
|
join(dir, 'package.json'),
|
||||||
|
JSON.stringify(manifest, null, 2),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
run().catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user