Skip to content

Commit

Permalink
👋 goodbye yarn, forever. yarnpkg/berry#3169
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Dec 17, 2024
1 parent a4d7502 commit 3480d95
Show file tree
Hide file tree
Showing 131 changed files with 20,516 additions and 30,846 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'yarn'
cache: 'pnpm'

- name: Setup Yarn
uses: threeal/[email protected]
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Run alpha deploy
run: yarn workspaces foreach -ptR --from @nostrwatch/gui run build
# run: ./scripts/deploy/gui.sh
run: |
# pnpm --filter @nostrwatch/gui... --workspace-concurrency=4 --parallel run build
pnpm --filter @nostrwatch/gui... --parallel run build
- name: Get package version
id: get_version
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ jobs:
node-version: ${{ matrix.nodeVersion }}

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm run install --frozen-lockfile

- name: Bootstrap Packages
run: yarn workspaces run bootstrap
run: pnpm -r run bootstrap
if: github.workspace == 'true'

- name: Find Package
Expand All @@ -91,13 +91,13 @@ jobs:
id: install_package
run: |
cd "${{ steps.find_package.outputs.the_path }}"
yarn install
pnpm i
- name: Build Typescript
if: matrix.typescript == 'true'
run: |
cd "${{ steps.find_package.outputs.the_path }}"
yarn build
pnpm run build
- name: Publish Package
id: publish
Expand Down
Binary file removed .yarn/install-state.gz
Binary file not shown.
934 changes: 0 additions & 934 deletions .yarn/releases/yarn-4.5.3.cjs

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion apps/gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"dev": "vite dev",
"build": "vite build -c vite.production.js",
"preview": "yarn serve dist",
"preview": "pnpm run serve dist",
"package": "svelte-kit sync && svelte-package && publint",
"release": "changeset publish",
"prepublishOnly": "npm run package",
Expand Down
70 changes: 48 additions & 22 deletions apps/gui/src/lib/components/blocks/table/DataTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
import TableOptions from './TableOptions.svelte';
import * as Popover from "$lib/components/ui/popover";
import * as Tabs from "$lib/components/ui/tabs";
import Button from '../../ui/button/button.svelte';
export let tableKey: string;
export let data: any;
export let config: Writable<any>;
export let enableFilters: boolean = true;
export let actionsComponent;
let sidebarPaneApi: Resizable.PaneApi | null = null;
export let sidebarPaneApi: Resizable.PaneApi | null = null;
const sidebarCollapsed = writable(StateManager.get('sidebarCollapsed') ?? false);
type DataTableConfig = {
columnsDisable: string[]
Expand Down Expand Up @@ -200,6 +202,18 @@
filters.set({});
}
$: isCollapsed = $sidebarCollapsed;
$: activeFilters = Object.keys($filters).length;
const toggleSidebarPane = () => {
if(isCollapsed) {
sidebarPaneApi.expand()
}
else {
sidebarPaneApi.collapse()
}
sidebarCollapsed.set(!$sidebarCollapsed)
}
</script>

Expand Down Expand Up @@ -320,24 +334,44 @@
<Resizable.Pane
class="min-h-[100%]"
defaultSize={25}
collapsedSize={10}
collapsedSize={5}
collapsible={true}
onExpand={()=>{}}
onCollapse={()=>{}}
onResize={()=>{}}
bind:api={sidebarPaneApi}
bind:pane={sidebarPaneApi}
> <!----->
{#if tableInstance !== null && enableFilters}
<Filters
{tableData}
{keysEnable}
{filters}
{filtersInclude}
{humanReadableNames}
{filterFormatters}
{maxBadgeLength}
{config}
/>

{#if sidebarPaneApi}
<Button class="rounded-l-none display-inline bg-white/5 text-white/80 hover:bg-white/15 text-white/90" on:click={toggleSidebarPane()}>
{#if isCollapsed}
â­…
{:else}
â­†
{/if}
</Button>

{/if}

{#if isCollapsed}
{#if activeFilters > 0}
<Badge class="clear-left py-2 inline-block text-white/80 rounded-full" variant="destructive">
{activeFilters}
</Badge>
{/if}
{:else}
{#if tableInstance !== null && enableFilters}
<Filters
{tableData}
{keysEnable}
{filters}
{filtersInclude}
{humanReadableNames}
{filterFormatters}
{maxBadgeLength}
{config}
/>
{/if}
{/if}

</Resizable.Pane>
Expand All @@ -348,14 +382,6 @@


<style lang="postcss" global>
.active-filters {
margin-bottom: 1rem;
}
.active-filters-list {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.active-filter {
background-color: #e0e0e0;
padding: 0.5rem;
Expand Down
1 change: 0 additions & 1 deletion apps/trawler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"main": "src/index.js",
"type": "module",
"engines": {
"yarn": ">=1.16.0",
"node": ">=16.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion demos/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sandbox",
"type": "module",
"packageManager": "[email protected].0",
"packageManager": "[email protected].0",
"dependencies": {
"@nostrwatch/nocap": "workspace:^",
"@nostrwatch/nocap-every-adapter-default": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion internal/announce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "tsc",
"test": "vitest",
"test-ui": "vitest --ui",
"prepare": "yarn build"
"prepare": "pnpm run build"
},
"author": "",
"license": "ISC",
Expand Down
5 changes: 4 additions & 1 deletion internal/controlflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "dist/server/index.d.ts",
"scripts": {
"clean": "rimraf dist",
"build": "yarn clean && yarn build:server",
"build": "pnpm run clean && pnpm run build:server",
"build:server": "webpack --config webpack.server.config.cjs",
"dev:server": "webpack --config webpack.server.config.cjs --watch",
"start": "node dist/index.js",
Expand All @@ -17,6 +17,9 @@
"type": "module",
"license": "MIT",
"dependencies": {
"@nostrwatch/logger": "workspace:*",
"@nostrwatch/nwcache": "workspace:*",
"@nostrwatch/utils": "workspace:*",
"bullmq": "^5.4.2",
"dotenv": "16.3.1",
"node-schedule": "2.1.1"
Expand Down
6 changes: 2 additions & 4 deletions internal/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
},
"scripts": {
"clean": "rimraf dist",
"build": "yarn clean && rollup -c && yarn build:types",
"build": "pnpm run clean && rollup -c && pnpm run build:types",
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
"dev": "rollup -c --watch",
"dev:server": "yarn dev",
"dev:web": "yarn dev",
"test": "vitest",
"lint": "eslint . --ext .ts",
"prepare": "yarn clean && yarn build"
"prepare": "pnpm run clean && pnpm run build"
},
"keywords": [
"logger",
Expand Down
2 changes: 1 addition & 1 deletion internal/publisher/adapters/NostrTools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "vitest",
"lint": "eslint . --ext .ts",
"clean": "rimraf dist",
"prepare": "yarn clean && yarn build"
"prepare": "pnpm run clean && pnpm run build"
},
"keywords": [
"nostr",
Expand Down
15 changes: 7 additions & 8 deletions internal/publisher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
}
},
"scripts": {
"build": "yarn clean && yarn transpile && rollup -c && yarn transpile:alias",
"build:all": "yarn build && yarn build:adapters",
"build:server": "yarn clean && yarn transpile:server && rollup -c && yarn transpile:alias",
"build": "pnpm run clean && pnpm run transpile && rollup -c && pnpm run transpile:alias",
"build:all": "pnpm run build && pnpm run build:adapters",
"build:server": "pnpm run clean && pnpm run transpile:server && rollup -c && pnpm run transpile:alias",
"clean": "rimraf dist",
"transpile": "yarn transpile:server && yarn transpile:web",
"transpile": "pnpm run transpile:server && pnpm run transpile:web",
"transpile:web": "tsc -p tsconfig.web.json",
"transpile:server": "tsc -p tsconfig.server.json",
"transpile:alias": "yarn transpile:server:alias",
"transpile:server:alias": "yarn tsc-alias -p tsconfig.server.json",
"transpile:alias": "pnpm run transpile:server:alias",
"transpile:server:alias": "tsc-alias -p tsconfig.server.json",
"build:adapters": "./scripts/build-adapters.sh",
"prepare": "yarn clean && yarn build",
"prepare": "pnpm run clean && pnpm run build",
"lint": "eslint . --ext .ts",
"test": "vitest",
"test-ui": "vitest --ui --testTimeout=15000"
Expand Down Expand Up @@ -68,7 +68,6 @@
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.36.0",
"ts-loader": "^9.0.0",
"tsc": "^2.0.4",
"tsc-alias": "^1.8.10",
"tslib": "^2.7.0",
"typescript": "^5.6.2",
Expand Down
9 changes: 5 additions & 4 deletions internal/seed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
"browser": "dist/web/index.js",
"types": "dist/server/index.d.ts",
"scripts": {
"build": "yarn clean && yarn build:server",
"build": "pnpm run clean && pnpm run build:server",
"build:server": "webpack --config webpack.server.config.cjs",
"dev:server": "webpack --config webpack.server.config.cjs --watch",
"test": "vitest",
"lint": "eslint . --ext .ts",
"clean": "rimraf dist",
"prepare": "yarn clean && yarn build"
"prepare": "pnpm run clean && pnpm run build"
},
"dependencies": {
"@nostr-fetch/adapter-nostr-tools": "^0.15.1",
"@nostrwatch/logger": "*",
"@nostrwatch/utils": "*",
"@nostrwatch/logger": "workspace:*",
"@nostrwatch/utils": "workspace:*",
"@nostrwatch/nwcache": "workspace:*",
"cross-fetch": "^3.1.5",
"js-yaml": "^4.1.0",
"nostr-fetch": "^0.15.1",
Expand Down
13 changes: 0 additions & 13 deletions internal/seed/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import {
relaysFromCache,
relaysOnlineFromApi,
} from '../src/index';
import Logger from '@nostrwatch/logger';

vi.mock('@nostrwatch/logger', () => ({
default: class {
warn = vi.fn();
err = vi.fn();
debug = vi.fn();
},
}));

vi.mock('@nostrwatch/utils', () => ({
extractConfig: vi.fn(),
Expand All @@ -32,10 +23,6 @@ describe('bootstrap', () => {
const mockExtractConfig = require('@nostrwatch/utils').extractConfig;
mockExtractConfig.mockResolvedValue({});
const result = await bootstrap('caller');
const mockLogger = Logger as unknown as { prototype: any };
expect(mockLogger.prototype.warn).toHaveBeenCalledWith(
'Skipping seed because there is no seed config'
);
expect(result).toEqual([[], {}]);
});

Expand Down
2 changes: 1 addition & 1 deletion internal/seed/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"outDir": "./dist/server",
"strict": true,
"esModuleInterop": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"isolatedModules": true, // Important to ensure individual modules are handled correctly
"skipLibCheck": true
Expand Down
8 changes: 4 additions & 4 deletions internal/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
},
"scripts": {
"clean": "rimraf dist",
"build": "yarn clean && rollup -c && yarn build:types",
"build": "pnpm run clean && rollup -c && pnpm run build:types",
"build:types": "tsc -p tsconfig.web.json --emitDeclarationOnly",
"dev": "rollup -c --watch",
"dev:server": "yarn dev",
"dev:web": "yarn dev",
"dev:server": "pnpm run dev",
"dev:web": "pnpm run dev",
"test": "vitest",
"lint": "eslint . --ext .ts",
"prepare": "yarn clean && yarn build"
"prepare": "pnpm run clean && pnpm run build"
},
"dependencies": {
"dotenv": "16.3.1",
Expand Down
18 changes: 12 additions & 6 deletions libraries/auditor/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,26 @@ const serverConfig = {

async function build() {
try {
const browserContext = await esbuild.context(browserConfig);
const serverContext = await esbuild.context(serverConfig);

if (isWatchMode) {
// Create persistent build contexts
const browserContext = await esbuild.context(browserConfig);
const serverContext = await esbuild.context(serverConfig);

await Promise.all([
browserContext.watch(),
serverContext.watch()
]);

//console.log("Watching for changes in src...");
console.log("Watching for changes in src...");
watchSrcDirectory();
} else {
await Promise.all([browserContext.rebuild(), serverContext.rebuild()]);
//console.log("Build complete for both web and server targets.");
// Single-run builds using esbuild.build()
await Promise.all([
esbuild.build(browserConfig),
esbuild.build(serverConfig)
]);

console.log("Build complete for both web and server targets.");
await dereferenceSchemas();
}
} catch (error) {
Expand Down
Loading

0 comments on commit 3480d95

Please sign in to comment.