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

fix: remove createRequire for package json #978

Merged
merged 8 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: utf8 encoding
tylersayshi authored Oct 20, 2024
commit aa282fe89f3c7f364dd047b9873d8e2c9585654a
4 changes: 3 additions & 1 deletion packages/create-waku/src/index.ts
Original file line number Diff line number Diff line change
@@ -161,7 +161,9 @@ Options:
}

async function notifyUpdate() {
const packageJson = JSON.parse(readFileSync('../package.json'));
const packageJson = JSON.parse(readFileSync('../package.json', {
encoding: 'utf8',
}));
const result = await checkForUpdate(packageJson).catch(() => {});
if (result?.latest) {
console.log(`A new version of 'create-waku' is available!`);

Unchanged files with check annotations Beta

await page.getByTestId('increment').click();
await page.getByTestId('increment').click();
await page.getByTestId('increment').click();
await expect(page.getByTestId('count')).toHaveText('3');

Check failure on line 58 in e2e/ssr-basic.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (4/4)

[webkit] › ssr-basic.spec.ts:51:5 › ssr-basic: dev › increase counter

1) [webkit] › ssr-basic.spec.ts:51:5 › ssr-basic: dev › increase counter ───────────────────────── Error: Timed out 10000ms waiting for expect(locator).toHaveText(expected) Locator: getByTestId('count') Expected string: "3" Received string: "2" Call log: - expect.toHaveText with timeout 10000ms - waiting for getByTestId('count') - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" - locator resolved to <p data-testid="count">2</p> - unexpected value "2" 56 | await page.getByTestId('increment').click(); 57 | await page.getByTestId('increment').click(); > 58 | await expect(page.getByTestId('count')).toHaveText('3'); | ^ 59 | }); 60 | 61 | test('vercel ai', async ({ page }) => { at /home/runner/work/waku/waku/e2e/ssr-basic.spec.ts:58:47
});
test('vercel ai', async ({ page }) => {
await expect(aiLocator.getByTestId('ai-state-user')).toHaveText('guest');
await expect(aiLocator.getByTestId('ui-state-count')).toHaveText('0');
await aiLocator.getByTestId('action-foo').click();
await expect(aiLocator.getByTestId('ai-state-user')).toHaveText('admin');

Check failure on line 70 in e2e/ssr-basic.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (1/4)

[chromium] › ssr-basic.spec.ts:61:5 › ssr-basic: dev › vercel ai

1) [chromium] › ssr-basic.spec.ts:61:5 › ssr-basic: dev › vercel ai ────────────────────────────── Error: Timed out 10000ms waiting for expect(locator).toHaveText(expected) Locator: getByTestId('vercel-ai').getByTestId('ai-state-user') Expected string: "admin" Received string: "guest" Call log: - expect.toHaveText with timeout 10000ms - waiting for getByTestId('vercel-ai').getByTestId('ai-state-user') - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" - locator resolved to <span data-testid="ai-state-user">guest</span> - unexpected value "guest" 68 | await expect(aiLocator.getByTestId('ui-state-count')).toHaveText('0'); 69 | await aiLocator.getByTestId('action-foo').click(); > 70 | await expect(aiLocator.getByTestId('ai-state-user')).toHaveText('admin'); | ^ 71 | await expect(aiLocator.getByTestId('ui-state-count')).toHaveText('1'); 72 | await aiLocator.getByTestId('action-foo').click(); 73 | await expect(aiLocator.getByTestId('ui-state-count')).toHaveText('2'); at /home/runner/work/waku/waku/e2e/ssr-basic.spec.ts:70:60
await expect(aiLocator.getByTestId('ui-state-count')).toHaveText('1');
await aiLocator.getByTestId('action-foo').click();
await expect(aiLocator.getByTestId('ui-state-count')).toHaveText('2');
import { exec, spawn } from 'node:child_process';

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///Users/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///Users/runner/work/waku/waku/e2e/.cache/0c527db6-9be5-4ac5-b375-06f5d1309141/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///Users/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///Users/runner/work/waku/waku/e2e/.cache/6b96328f-c04c-4896-9e33-3aaa358c8331/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///Users/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on macos-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///Users/runner/work/waku/waku/e2e/.cache/f5dd8777-18b5-4e62-8c56-fdad64780a2b/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///home/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///home/runner/work/waku/waku/e2e/.cache/737ba8f6-384f-463d-be9a-7b2629ad111b/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///home/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///home/runner/work/waku/waku/e2e/.cache/36e3bea2-ff7d-4ce3-81a7-0a8d9a23c253/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.readFileUtf8 (node:internal/fs/sync:25:18) at readFileSync (node:fs:441:19) at Fx (file:///home/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.readFileUtf8 (node:internal/fs/sync:25:18) at readFileSync (node:fs:441:19) at Fx (file:///home/runner/work/waku/waku/e2e/.cache/b5161c6f-a5fb-44de-b966-807382500f13/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.readFileUtf8 (node:internal/fs/sync:25:18) at readFileSync (node:fs:441:19) at Fx (file:///home/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.readFileUtf8 (node:internal/fs/sync:25:18) at readFileSync (node:fs:441:19) at Fx (file:///home/runner/work/waku/waku/e2e/.cache/aa13dcba-5717-48c3-aa0e-acd6d5fe8250/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.openSync (node:fs:603:3) at readFileSync (node:fs:471:35) at Fx (file:///home/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, syscall: 'open', code: 'ENOENT', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.openSync (node:fs:603:3) at readFileSync (node:fs:471:35) at Fx (file:///home/runner/work/waku/waku/e2e/.cache/1f83f228-cbb2-4985-83c8-214c883cb6e6/create-waku/dist/index.js:119:41) { errno: -2, syscall: 'open', code: 'ENOENT', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.openSync (node:fs:603:3) at readFileSync (node:fs:471:35) at Fx (file:///home/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, syscall: 'open', code: 'ENOENT', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.openSync (node:fs:603:3) at readFileSync (node:fs:471:35) at Fx (file:///home/runner/work/waku/waku/e2e/.cache/42dbf3d4-4827-4f4a-a8d7-2d037599d3f0/create-waku/dist/index.js:119:41) { errno: -2, syscall: 'open', code: 'ENOENT', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///home/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at readFileSync (node:fs:441:20) at Fx (file:///home/runner/work/waku/waku/e2e/.cache/34ece229-a19b-40b5-b074-51f7ad6a9ce9/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.readFileUtf8 (node:internal/fs/sync:25:18) at readFileSync (node:fs:441:19) at Fx (file:///home/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.readFileUtf8 (node:internal/fs/sync:25:18) at readFileSync (node:fs:441:19) at Fx (file:///home/runner/work/waku/waku/e2e/.cache/f9a9fffe-10b5-40f6-8a8d-e971fd4e54b3/create-waku/dist/index.js:119:41) { errno: -2, code: 'ENOENT', syscall: 'open', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.openSync (node:fs:603:3) at readFileSync (node:fs:471:35) at Fx (file:///home/runner/work/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -2, syscall: 'open', code: 'ENOENT', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 18.17.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open '../package.json' at Object.openSync (node:fs:603:3) at readFileSync (node:fs:471:35) at Fx (file:///home/runner/work/waku/waku/e2e/.cache/2b9c4273-1551-49bc-97d0-2a70d772132c/create-waku/dist/index.js:119:41) { errno: -2, syscall: 'open', code: 'ENOENT', path: '../package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open 'D:\a\waku\waku\e2e\.cache\package.json' at readFileSync (node:fs:441:20) at Fx (file:///D:/a/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'D:\\a\\waku\\waku\\e2e\\.cache\\package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (2/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open 'D:\a\waku\waku\e2e\.cache\package.json' at readFileSync (node:fs:441:20) at Fx (file:///D:/a/waku/waku/e2e/.cache/fdcaae50-7dc9-4238-b3a1-ba0a416f8ab0/create-waku/dist/index.js:119:41) { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'D:\\a\\waku\\waku\\e2e\\.cache\\package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open 'D:\a\waku\waku\e2e\.cache\package.json' at readFileSync (node:fs:441:20) at Fx (file:///D:/a/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'D:\\a\\waku\\waku\\e2e\\.cache\\package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (1/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open 'D:\a\waku\waku\e2e\.cache\package.json' at readFileSync (node:fs:441:20) at Fx (file:///D:/a/waku/waku/e2e/.cache/e15ac8a7-29a5-41a8-ae9e-9082f630cd12/create-waku/dist/index.js:119:41) { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'D:\\a\\waku\\waku\\e2e\\.cache\\package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open 'D:\a\waku\waku\e2e\.cache\package.json' at readFileSync (node:fs:441:20) at Fx (file:///D:/a/waku/waku/packages/create-waku/dist/index.js:119:41) { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'D:\\a\\waku\\waku\\e2e\\.cache\\package.json' }

Check failure on line 1 in e2e/create-waku.spec.ts

GitHub Actions / E2E on windows-latest (Node 22.7.0) - (3/4)

Child Process Error

stderr: Error: ENOENT: no such file or directory, open 'D:\a\waku\waku\e2e\.cache\package.json' at readFileSync (node:fs:441:20) at Fx (file:///D:/a/waku/waku/e2e/.cache/4702801e-3c59-4801-bd13-63ce0c27baa8/create-waku/dist/index.js:119:41) { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'D:\\a\\waku\\waku\\e2e\\.cache\\package.json' }
import { fileURLToPath } from 'node:url';
import crypto from 'node:crypto';
import { mkdir, readdir, cp, readFile, writeFile } from 'node:fs/promises';
});
const page = await context.newPage();
await page.goto(`http://localhost:${port}/`);
await expect(page.getByTestId('value')).toHaveText('provider value');

Check failure on line 65 in e2e/ssr-context-provider.spec.ts

GitHub Actions / E2E on ubuntu-latest (Node 20.8.0) - (2/4)

[chromium] › ssr-context-provider.spec.ts:59:5 › ssr-context-provider: dev › no js environment

1) [chromium] › ssr-context-provider.spec.ts:59:5 › ssr-context-provider: dev › no js environment Error: Timed out 10000ms waiting for expect(locator).toHaveText(expected) Locator: getByTestId('value') Expected string: "provider value" Received string: "original" Call log: - expect.toHaveText with timeout 10000ms - waiting for getByTestId('value') - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" - locator resolved to <div data-testid="value">original</div> - unexpected value "original" 63 | const page = await context.newPage(); 64 | await page.goto(`http://localhost:${port}/`); > 65 | await expect(page.getByTestId('value')).toHaveText('provider value'); | ^ 66 | await page.close(); 67 | await context.close(); 68 | }); at /home/runner/work/waku/waku/e2e/ssr-context-provider.spec.ts:65:47
await page.close();
await context.close();
});