Skip to content

sderickson/react-treema

Repository files navigation

React Treema

Cloned from https://github.com/KaiHotz/react-rollup-boilerplate

TODO

View Component

Drawing from https://www.learnjsonschema.com/ And http://codecombat.github.io/treema/demo.html

Done

  • Basic types
  • View toggle
  • Walk
  • Keyboard nav
  • open/close
  • Styling
  • Storybook docs
  • General schema validation (ajv, tv4)
  • oneOf/allOf/anyOf (working schemas)
  • Additional schemas ($ref)
  • items, properties, patternProperties, additionalProperties, additionalItems
  • Description prop
  • Default data
  • Required data
  • Editing
    • Make default story work, able to set data
    • Make arrays and objects able to add children
    • Make able to delete properties and children
  • Callbacks
  • Custom treema nodes
  • Extras (2d point, etc)
  • Preventing adding items, props where no more can be added
  • Test data prop changing
  • Hidden format
  • Object and array displays
  • Feature Parity for AI Scenario
    • Edit working schemas
      • Show errors by working schema
      • Retain initial working schema settings
      • advanced combineSchemas
        • combine properties
        • combine required
      • Deleting prompt quiz content breaks treema
    • Migrate to json pointer utils
    • Support for enum
    • Show root elem
    • Ace Editor integration
    • Full custom type definition interface
      • Write documentation on making them
      • Export all tools necessary
      • Finalize names
      • Add schema prop to definition
    • export utility functions
  • Mouse click to edit
  • Copy/Paste
  • Filter
  • undo/redo
  • Shift/Meta click
  • readOnly, skipValidation

In Progress

TODO

  • export getters/setters
  • Put more documentation in storybook mdx
  • A11y
    • Add roles, test with screen reader
    • Form mode
    • Update tests to use role
  • CSS
    • "Border" error look when error is for collection
    • Audit existing CSS, remove floats and unnecessary rules
    • Responsive
  • search (that one jquery ui thing)
  • drag and drop (that other jquery ui thing), noSortable
  • comprehensive input attribute support
  • Shore up coverage
  • README
  • Github pages
  • Publish

Developing

To start the developing run :

yarn start

This will build Treema and run Storybook. To open Storybook manually open your Browser and navigate to http://localhost:6060.

Testing

Testing is done with Jest and @testing-library/react

yarn test

or (for getting coverage)

yarn test:coverage

or (for automatic running)

yarn test:watch

Note that Storybook is also set up to run the interactive tests. Unit tests are not run in Storybook.

Linting

Linting is set up through ESLint and configured with eslint-config-react-app and eslint-config-prettier.

yarn lint

or (if automatic fixing is possible)

yarn lint:fix

Publishing your library to NPM

TODO

To release to NPM, make sure you have an active account at NPM, your .npmrc file is correctly setup and the repository url in package.json file is set to your repository url, then:

yarn release

Storybook

For custom layouts, styling and more information about Storybook, please refer to Storybook documentation.

Deploy Storybook to GitHub Pages

TODO

Make sure the repository url in package.json file is set to your repository url, then:

yarn deploy

Scripts

  • yarn start : Only serves Storybook.
  • yarn build : Builds your library (build can be found in dist folder).
  • yarn storybook:build : Builds the static Storybook in case you want to deploy it.
  • yarn test : Runs the tests.
  • yarn test:watch : Runs the tests with a watcher.
  • yarn test:coverage: Runs the test and shows the coverage.
  • yarn lint : Runs the linter, Typescript typecheck and stylelint.
  • yarn lint:fix : Runs the linter, Typescript typecheck and stylelint and fixes automatic fixable issues.
  • yarn eslint: Runs only the JavaScript linter.
  • yarn eslint:fix: Runs only the JavaScript linter and fixes automatic fixable issues.
  • yarn stylelint: Runs only the style linter.
  • yarn stylelint:fix: Runs only the style linter and fixes automatic fixable issues.
  • yarn check-types: Runs typescript type checker.
  • yarn release : Publishes your Library on NPM or your private Registry (depending on your config in your .npmrc file).
  • yarn deploy: Deploys the Styleguide to GitHub Pages.

Resources

Bundler

Code Formatter

Storybook

Testing

Linting

Compiler

About

React component for editing JSON data which has a schema

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published