test-ra-lib v0.0.1
New project
- Init yarn workspace
Create package.json:
{ "private": true, "workspaces": [ "packages/*" ] }
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
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 foldercd 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"
,
4 years ago