Skip to content

Commit bdc57b8

Browse files
linting
1 parent 51fc910 commit bdc57b8

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

knip.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const config: KnipConfig = {
3939

4040
// React on Rails core package workspace
4141
'packages/react-on-rails': {
42-
entry: ['src/ReactOnRails.node.ts!'],
42+
entry: ['src/ReactOnRails.full.ts!', 'src/ReactOnRails.client.ts!'],
4343
project: ['src/**/*.[jt]s{x,}!', 'tests/**/*.[jt]s{x,}', '!lib/**'],
4444
ignore: [
4545
// Jest setup and test utilities - not detected by Jest plugin in workspace setup

packages/react-on-rails-pro/src/ComponentRegistry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const componentRegistry = new CallbackRegistry<RegisteredComponent>('component')
2020

2121
/**
2222
* @param components { component1: component1, component2: component2, etc. }
23+
* @public
2324
*/
2425
export function register(components: Record<string, ReactComponentOrRenderFunction>): void {
2526
Object.keys(components).forEach((name) => {
@@ -57,6 +58,7 @@ export const getOrWaitForComponent = (name: string): Promise<RegisteredComponent
5758
* Get a Map containing all registered components. Useful for debugging.
5859
* @returns Map where key is the component name and values are the
5960
* { name, component, renderFunction, isRenderer}
61+
* @public
6062
*/
6163
export const components = (): Map<string, RegisteredComponent> => componentRegistry.getAll();
6264

packages/react-on-rails-pro/src/StoreRegistry.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const hydratedStoreRegistry = new CallbackRegistry<Store>('hydrated store');
2121
/**
2222
* Register a store generator, a function that takes props and returns a store.
2323
* @param storeGenerators { name1: storeGenerator1, name2: storeGenerator2 }
24+
* @public
2425
*/
2526
export function register(storeGenerators: Record<string, StoreGenerator>): void {
2627
Object.keys(storeGenerators).forEach((name) => {
@@ -46,6 +47,7 @@ export function register(storeGenerators: Record<string, StoreGenerator>): void
4647
* @param throwIfMissing Defaults to true. Set to false to have this call return undefined if
4748
* there is no store with the given name.
4849
* @returns Redux Store, possibly hydrated
50+
* @public
4951
*/
5052
export function getStore(name: string, throwIfMissing = true): Store | undefined {
5153
try {
@@ -71,6 +73,7 @@ This can happen if you are server rendering and either:
7173
* Internally used function to get the store creator that was passed to `register`.
7274
* @param name
7375
* @returns storeCreator with given name
76+
* @public
7477
*/
7578
export const getStoreGenerator = (name: string): StoreGenerator => storeGeneratorRegistry.get(name);
7679

@@ -85,6 +88,7 @@ export function setStore(name: string, store: Store): void {
8588

8689
/**
8790
* Internally used function to completely clear hydratedStores Map.
91+
* @public
8892
*/
8993
export function clearHydratedStores(): void {
9094
hydratedStoreRegistry.clear();
@@ -93,12 +97,14 @@ export function clearHydratedStores(): void {
9397
/**
9498
* Get a Map containing all registered store generators. Useful for debugging.
9599
* @returns Map where key is the component name and values are the store generators.
100+
* @public
96101
*/
97102
export const storeGenerators = (): Map<string, StoreGenerator> => storeGeneratorRegistry.getAll();
98103

99104
/**
100105
* Get a Map containing all hydrated stores. Useful for debugging.
101106
* @returns Map where key is the component name and values are the hydrated stores.
107+
* @public
102108
*/
103109
export const stores = (): Map<string, Store> => hydratedStoreRegistry.getAll();
104110

packages/react-on-rails-pro/src/createReactOnRailsPro.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,15 @@ export default function createReactOnRailsPro(
144144
const reactOnRailsPro = baseObject as unknown as ReactOnRailsInternal;
145145

146146
if (reactOnRailsPro.streamServerRenderedReactComponent) {
147-
// eslint-disable-next-line @typescript-eslint/unbound-method
148-
reactOnRailsProSpecificFunctions.streamServerRenderedReactComponent = reactOnRailsPro.streamServerRenderedReactComponent;
147+
reactOnRailsProSpecificFunctions.streamServerRenderedReactComponent =
148+
// eslint-disable-next-line @typescript-eslint/unbound-method
149+
reactOnRailsPro.streamServerRenderedReactComponent;
149150
}
150151

151152
if (reactOnRailsPro.serverRenderRSCReactComponent) {
152-
// eslint-disable-next-line @typescript-eslint/unbound-method
153-
reactOnRailsProSpecificFunctions.serverRenderRSCReactComponent = reactOnRailsPro.serverRenderRSCReactComponent;
153+
reactOnRailsProSpecificFunctions.serverRenderRSCReactComponent =
154+
// eslint-disable-next-line @typescript-eslint/unbound-method
155+
reactOnRailsPro.serverRenderRSCReactComponent;
154156
}
155157

156158
// Assign Pro-specific functions to the ReactOnRailsPro object using Object.assign

packages/react-on-rails/src/ClientRenderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ You should return a React.Component always for the client side entry point.`);
116116
/**
117117
* Render a single component by its DOM ID.
118118
* This is the main entry point for rendering individual components.
119+
* @public
119120
*/
120121
export function renderComponent(domId: string): void {
121122
const railsContext = getRailsContext();

packages/react-on-rails/src/ReactOnRails.node.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/react-on-rails/src/base/full.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type ReactOnRailsFullSpecificFunctions = Pick<
2424
/**
2525
* Full object type that includes all base methods plus real SSR implementations.
2626
* Derived from ReactOnRailsInternal by picking base methods and SSR methods.
27+
* @public
2728
*/
2829
export type BaseFullObjectType = Pick<
2930
ReactOnRailsInternal,

0 commit comments

Comments
 (0)