0.0.1 • Published 4 years ago

test-ra-lib v0.0.1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
4 years ago

New project

  1. Init yarn workspace Create package.json: { "private": true, "workspaces": [ "packages/*" ] }
  2. To add ra-lib and other projects as git submodules, run next command in workspace root folder: git submodule add [path-to-folder] [git-link] Example: git submodule add git@gitlab.com:king-david/libraries/ra-lib.git packages/ra-lib

  3. Install packages for all projects: yarn install

Existed project

-git submodule update --init - This will update the submodules, and if they're not initiated yet, will initiate them. -yarn install will install packages for all projects

  • E.g, how to run project: a) yarn workspace [project_name] start (see project name in package.json) b) go to project folder cd packages/[project_folder] and use project scripts, e.g. yarn start

Using

Use next command for every project that uses ra-lib: yarn install ra-lib@1.0.0 (1.0.0 ra-lib version from package.json )

Using ra-lib components: import { DatePickerInput } from 'ra-lib/components'

Use folders in a root to import: ra-lib/components, ra-lib/providers and other.

Additional

How to remove submodule correctly

  • Remove the submodule entry from .git/config git submodule deinit -f path/to/submodule

  • Remove the submodule directory from the superproject's .git/modules directory rm -rf .git/modules/path/to/submodule

  • Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule git rm -f path/to/submodule

How to use local package

Package.json -> main: 'build/index.js'. So to use local ts files semove 'build' folder, and root 'index.ts' will be used.

How to fix
  • definition for rule '@typescript-eslint/interface-name-prefix' was not found @typescript-eslint/interface-name-prefix

Downgrade this dependencies to: "@typescript-eslint/eslint-plugin": "^2.19.0", "@typescript-eslint/parser": "^2.19.0",