Skip to content

Commit

Permalink
fix: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Jun 17, 2024
2 parents e7dc174 + 6f288c3 commit 461a648
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 126 deletions.
8 changes: 0 additions & 8 deletions .changeset/short-steaks-bow.md

This file was deleted.

90 changes: 45 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@10up/headless_framework",
"name": "@10up/headstartwp",
"version": "1.0.0",
"description": "Monorepo for headless framework",
"homepage": "https://github.com/10up/headstartwp#readme",
Expand All @@ -14,16 +14,14 @@
"scripts": {
"build": "turbo run build",
"build:packages": "turbo run build --filter=./packages/*",
"build:wpnextjs": "npm run build:packages && turbo run build --filter=./projects/wp-nextjs",
"test": "npm run build:packages && turbo run test",
"build:wpnextjs": "turbo run build --filter=./projects/wp-nextjs",
"test": "turbo run test",
"test:watch": "turbo run test:watch",
"lint": "turbo run lint",
"wp-env": "npm run wp-env:start -w=wp/headless-wp",
"nextjs:dev": "turbo run dev --parallel --filter=!./projects/wp-multisite-nextjs --filter=!./projects/wp-multisite-i18n-nextjs",
"nextjs:dev-app": "turbo run dev --parallel --filter=!./projects/wp-multisite-nextjs --filter=!./projects/wp-multisite-i18n-nextjs --filter=!./projects/wp-nextjs",
"nextjs:dev-multisite": "turbo run dev --parallel --filter=!./projects/wp-nextjs",
"dev": "npm run build:packages && npm run wp-env && npm run nextjs:dev",
"dev:app": "npm run build:packages && npm run wp-env && npm run nextjs:dev-app",
"dev:multisite": "npm run build:packages && npm run wp-env && npm run nextjs:dev-multisite",
"dev": "turbo run dev --parallel --filter=!./projects/wp-multisite-nextjs --filter=!./projects/wp-multisite-i18n-nextjs",
"dev:app": "turbo run dev --parallel --filter=!./projects/wp-multisite-nextjs --filter=!./projects/wp-multisite-i18n-nextjs --filter=!./projects/wp-nextjs",
"dev:multisite": "turbo run dev --parallel --filter=!./projects/wp-nextjs",
"prepare": "husky install",
"typedoc": "typedoc",
"typedoc:watch": "typedoc --watch",
Expand All @@ -50,8 +48,8 @@
"jest": "^29.0.3",
"jest-environment-jsdom": "^29.0.3",
"lint-staged": "^11.1.2",
"turbo": "^1.9.3",
"prettier": "3.2.5"
"prettier": "3.2.5",
"turbo": "^2.0.3"
},
"nextBundleAnalysis": {
"buildOutputDirectory": "./projects/wp-nextjs/.next",
Expand All @@ -65,11 +63,12 @@
"npm": ">=9.0.0"
},
"optionalDependencies": {
"turbo-darwin-64": "^1.9.3",
"turbo-darwin-arm64": "^1.9.3",
"turbo-linux-64": "^1.9.3",
"turbo-linux-arm64": "^1.9.3",
"turbo-windows-64": "^1.9.3",
"turbo-windows-arm64": "^1.9.3"
}
"turbo-darwin-64": "^2.0.3",
"turbo-darwin-arm64": "^2.0.3",
"turbo-linux-64": "^2.0.3",
"turbo-linux-arm64": "^2.0.3",
"turbo-windows-64": "^2.0.3",
"turbo-windows-arm64": "^2.0.3"
},
"packageManager": "[email protected]"
}
8 changes: 8 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @headstartwp/core

## 1.4.4

### Patch Changes

- f6e005c: Fix: Improve types for better page props type inference.

It also updates types for data fetching hooks to better reflect the fact that `data` is treated as though it is always there and if users do not check for `loading` or `error` by themselves and there's no preloaded data, a runtime fatal error will be issued instead.

## 1.4.3

### Patch Changes
Expand Down
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@headstartwp/core",
"version": "1.4.3",
"version": "1.4.4",
"description": "`@headstartwp/core` is the core package that houses framework-agnostic components and utilities for building headless sites with WordPress.",
"homepage": "https://github.com/10up/headstartwp/blob/develop/packages/core/README.md",
"license": "MIT",
Expand Down Expand Up @@ -57,6 +57,7 @@
"watch:ts:cjs": "npm run ts:cjs -- --watch",
"watch:ts": "npm run ts -- --watch",
"test": "jest",
"test:watch": "jest --watch",
"lint": "eslint src/"
},
"devDependencies": {
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/data/api/fetch-utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { LOGTYPE, addQueryArgs, getHeadlessConfig, log } from '../../utils';

export const getAuthHeader = () => {
return null;
};

/**
* Fetch Wrapper to handle POST requests
*
Expand Down Expand Up @@ -78,3 +74,5 @@ export const apiGet = async (

return { headers: receivedHeaders, json };
};

export const fetchStrategy = async () => {};
18 changes: 18 additions & 0 deletions packages/core/src/react/components/__tests__/BlocksRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,22 @@ describe('BlocksRenderer', () => {
</div>
`);
});

it('works correctly with chinese content', () => {
const StrongToDiv = ({ domNode, children }: BlockProps) => {
const className =
domNode instanceof Element ? domNode?.attribs.class || undefined : undefined;
return <div className={className}>{children}</div>;
};

const { container } = render(
<BlocksRenderer
html={`<h3 class="wp-block-heading" data-wp-block='{"level":3,"hash":"9fb25fc5-7456-4704-bffe-aa438487253b"}' data-wp-block-name="core/heading"><strong>&aelig;&acute;&raquo;&aring;&#139;&#149;&aelig;&#156;&#159;&eacute;&#150;&#147;</strong></h3>`}
>
<StrongToDiv tagName="strong" classList={['my-class']} />
</BlocksRenderer>,
);

expect(container).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`BlocksRenderer works correctly with chinese content 1`] = `
<div>
<h3
class="wp-block-heading"
data-wp-block="{"level":3,"hash":"9fb25fc5-7456-4704-bffe-aa438487253b"}"
data-wp-block-name="core/heading"
>
<strong>
活動期間
</strong>
</h3>
</div>
`;
7 changes: 0 additions & 7 deletions packages/core/tsconfig.ref.json

This file was deleted.

3 changes: 2 additions & 1 deletion packages/next-redis-cache-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"dev": "npm run watch:ts",
"watch:ts": "npm run ts -- --watch",
"lint": "eslint src",
"test": "jest"
"test": "jest",
"test:watch": "jest --watch"
},
"dependencies": {
"ioredis": "^5.3.1"
Expand Down
11 changes: 11 additions & 0 deletions packages/next/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @headstartwp/next

## 1.4.3

### Patch Changes

- f6e005c: Fix: Improve types for better page props type inference.

It also updates types for data fetching hooks to better reflect the fact that `data` is treated as though it is always there and if users do not check for `loading` or `error` by themselves and there's no preloaded data, a runtime fatal error will be issued instead.

- Updated dependencies [f6e005c]
- @headstartwp/core@1.4.4

## 1.4.2

### Patch Changes
Expand Down
Loading

0 comments on commit 461a648

Please sign in to comment.