Skip to content

Commit

Permalink
Convert it into an add-on.
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Feb 15, 2025
1 parent ecaad28 commit 0212cca
Show file tree
Hide file tree
Showing 21 changed files with 82 additions and 32 deletions.
5 changes: 5 additions & 0 deletions packages/contents/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['../../.eslintrc.cjs', '../eslintconfig/addons.js'],
ignorePatterns: ['vitest.config.ts'],
};
9 changes: 0 additions & 9 deletions packages/contents/.parcelrc

This file was deleted.

3 changes: 2 additions & 1 deletion packages/contents/.release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
},
"hooks": {
"after:bump": [
"pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version}",
"pipx run towncrier build --draft --yes --version ${version} > .changelog.draft",
"pipx run towncrier build --yes --version ${version}",
"pnpm build"
],
"after:release": "rm .changelog.draft"
Expand Down
5 changes: 5 additions & 0 deletions packages/contents/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# `@plone/contents`

This package contains the folder Contents view for Plone.

> [!WARNING]
> This package or app is experimental.
> The community offers no support whatsoever for it.
> Breaking changes may occur without notice.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ComponentProps, useRef, useState } from 'react';
import React, { type ComponentProps, useRef, useState } from 'react';
import { useDateFormatter } from 'react-aria';
import { Brain } from '../../../types/src';
import type { Brain } from '../../types';
import { Button, Link, MoreoptionsIcon } from '@plone/components';
import { ItemActionsPopover } from './ItemActionsPopover';
import { useContentsContext } from '../providers/contents';
Expand Down
8 changes: 8 additions & 0 deletions packages/contents/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { ConfigType } from '@plone/registry';

export default function install(config: ConfigType) {
return config;
}

export { ContentsTable } from './components/ContentsTable';
export * from './providers/contents';
16 changes: 8 additions & 8 deletions packages/contents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,18 @@
"publishConfig": {
"access": "public"
},
"source": "./src/index.ts",
"main": "./src/index.ts",
"main": "index.ts",
"scripts": {
"watch": "parcel watch",
"build": "parcel build",
"build:force": "parcel build --no-cache",
"test": "vitest",
"check-ts": "tsc --project tsconfig.json",
"dry-release": "release-it --dry-run",
"release": "release-it",
"release-major-alpha": "release-it major --preRelease=alpha",
"release-alpha": "release-it --preRelease=alpha"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"peerDependenciesMeta": {
"react-dom": {
Expand All @@ -55,14 +52,17 @@
"@plone/providers": "workspace:*",
"@plone/registry": "workspace:*",
"@tanstack/react-query": "^5.59.0",
"react-aria": "^3.33.0",
"react-aria": "^3.37.0",
"react-aria-components": "^1.6.0",
"usehooks-ts": "^3.1.0"
},
"devDependencies": {
"@plone/types": "workspace:*",
"@testing-library/jest-dom": "6.4.2",
"@types/jest-axe": "^3.5.7",
"@types/react": "^18",
"@types/react-dom": "^18",
"jest-axe": "^8.0.0",
"release-it": "17.1.1",
"tsconfig": "workspace:*",
"typescript": "5.2.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {
createContext,
PropsWithChildren,
type PropsWithChildren,
useContext,
useMemo,
} from 'react';
Expand Down
3 changes: 3 additions & 0 deletions packages/contents/setupTesting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '@testing-library/jest-dom';
import { toHaveNoViolations } from 'jest-axe';
expect.extend(toHaveNoViolations);
2 changes: 0 additions & 2 deletions packages/contents/src/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/contents/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "tsconfig/react-library.json",
"include": ["src", "src/**/*.js"],
"include": ["src", "src/**/*.js", "index.ts", "types.d.ts"],
"exclude": [
"node_modules",
"build",
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/contents/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'vitest/config';

// https://vitejs.dev/config/
export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
setupFiles: './setupTesting.ts',
// you might want to disable it, if you don't have tests that rely on CSS
// since parsing CSS is slow
css: true,
exclude: ['**/node_modules/**', '**/lib/**'],
},
});
41 changes: 33 additions & 8 deletions pnpm-lock.yaml

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

0 comments on commit 0212cca

Please sign in to comment.