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

docs: generate api files from typedoc #1192

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions .github/workflows/ci-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ jobs:
publish_dir: ./storybook-static
destination_dir: ./storybook-${{ steps.branch-name.outputs.current_branch }}
- name: build docs website
working-directory: ./docs/
working-directory: ./website/
run: yarn install --frozen-lockfile && yarn build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
destination_dir: ./docs
publish_dir: ./website/build
destination_dir: ./website

check_if_version_upgraded:
name: Check if version upgrade
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/node_modules/
/.eslintrc.js
/docs/
/website/
/lib/
/storybook-static/
/test-results/
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<img align="right" src="docs/img/lunatic-logo.png" alt="Lunatic logo"/>
<p align="center">
<img alt="Lunatic" src="public/images/lunatic-logo.png" style="max-width: 100%;">
</p>

# Lunatic
Lunatic is a front-end library in the form of a React hook and component libraries for generating a questionnaire from the [Lunatic-Model](https://github.com/InseeFr/Lunatic-Model) data format.

[![Lunatic CI](https://github.com/InseeFr/Lunatic/actions/workflows/ci-main.yaml/badge.svg)](https://github.com/InseeFr/Lunatic/actions/workflows/ci-main.yaml)
[![npm version](https://badge.fury.io/js/%40inseefr%2Flunatic.svg)](https://badge.fury.io/js/%40inseefr%2Flunatic)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=InseeFr_Lunatic&metric=coverage)](https://sonarcloud.io/dashboard?id=InseeFr_Lunatic)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=InseeFr_Lunatic&metric=alert_status)](https://sonarcloud.io/dashboard?id=InseeFr_Lunatic)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=InseeFr_Lunatic&metric=coverage)](https://sonarcloud.io/dashboard?id=InseeFr_Lunatic)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Lunatic is a front-end library in the form of a React hook and component libraries for generating a questionnaire from the [Lunatic-Model](https://github.com/InseeFr/Lunatic-Model) data format.
---

- [Storybook 3.0](https://inseefr.github.io/Lunatic/storybook-3.0), branch `3.0`
- [Storybook 2.7](https://inseefr.github.io/Lunatic/storybook-2.7), branch `2.7`
Expand Down
137 changes: 0 additions & 137 deletions docs/docusaurus.config.ts

This file was deleted.

106 changes: 0 additions & 106 deletions docs/sidebars.ts

This file was deleted.

9 changes: 0 additions & 9 deletions docs/src/css/custom.css

This file was deleted.

2 changes: 1 addition & 1 deletion lunatic-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://insee.fr/lunatic/survey.schema.json",
"title": "Lunatic Source",
"description": "A lunatic survey unit",
"description": "Representation of a Lunatic survey unit in the Lunatic Model.",
"type": "object",
"properties": {
"label": {
Expand Down
Binary file added public/images/lunatic-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"packageRules": [
{
"description": "Documentation website dependencies",
"matchPaths": ["docs/**"],
"matchPaths": ["website/**"],
"matchDepTypes": ["dependencies", "devDependencies"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "docs website dependencies",
Expand Down
18 changes: 10 additions & 8 deletions src/components/LunaticComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ import {
import type { LunaticComponentProps } from './type';

type Props<V = unknown> = {
// List of components to display (coming from getComponents)
/** List of components to display (coming from getComponents). */
components: LunaticComponentProps[];
// Should we memoized children
/** Should we memoized children. */
memo?: boolean;
// Key that trigger autofocus when it changes (pageTag)
/** Key that trigger autofocus when it changes (pageTag). */
autoFocusKey?: string;
// Returns the list of extra props to add to components
/** Returns the list of extra props to add to components. */
componentProps?: (component: LunaticComponentProps) => V;
// Forbidden components
/** Forbidden components. */
blocklist?: string[];
// Add additional wrapper around each component
/** Add additional wrapper around each component. */
wrapper?: (
props: PropsWithChildren<LunaticComponentProps & V & { index: number }>
) => ReactNode;
// Customized deep components
/** Customized deep components. */
slots?: Partial<LunaticSlotComponents>;
};

Expand All @@ -45,7 +45,9 @@ const LunaticComponentWrapper = slottableComponent(
);

/**
* Entry point for orchestrators, this component display the list of fields
* Entry point for orchestrators, this component display the list of fields.
*
* Components offered by Lunatic can be seen at {@link https://github.com/InseeFr/Lunatic/tree/3.0/src/components}
*/
export function LunaticComponents<V = unknown>({
components,
Expand Down
6 changes: 3 additions & 3 deletions src/components/shared/HOC/slottableComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import type { MarkdownLink } from '../MDLabel/MarkdownLink';
import type { Accordion } from '../../Accordion/Accordion';

/**
* Contains the type of every customizable component
* Contain the type of every customizable components.
*/
export type LunaticSlotComponents = {
// Components
Expand Down Expand Up @@ -130,9 +130,9 @@ export const SlotsProvider = ({
};

/**
* Create a replaceable version of a component
* Create a replaceable version of a component.
*
* The component can be replaced using the "slots" props on <LunaticComponents>
* The component can be replaced through the `slots` props on `LunaticComponents`.
*/
export function slottableComponent<T>(
name: keyof LunaticSlotComponents,
Expand Down
Loading
Loading