1.8 KiB
To build the project(s)
To build Observable Store:
npm run build or npm run build:w
To build Observable Store extensions cd into the folder and run:
npm run build or npm run build:w
To publish to npm
- Update the version in
package.json. - Run
npm run buildto create the dist folder (ensure tsconfig.json is set to copy the build there) - Run
npm publish --access publicand enter the 2FA code for npm in 1Password
To run the Observable Store npm module locally without publishing to npm
- Run
npm linkat the root of theobservable-storeproject - Go into the target sample project and run
npm link @codewithdan/observable-store
When done you can unlink by running npm unlink @codewithdan/observable-store in the target sample project
Access Angular Zone Outside of Angular
https://stackoverflow.com/questions/47619350/access-angular-ngzone-instance-from-window-object https://medium.com/nextfaze/devmod-probing-your-angular-application-for-fun-and-debugging-d7e07c688247
Window object will have ng and getAllAngularRootElements:
ng.probe(getAllAngularRootElements()[0]).injector.get(ng.coreTokens.NgZone)
To run samples with local Observable Store Code for testing (old)
-
Run
npm installat root of the project -
Remove
@codewithdan/observable-storefrompackage.jsonfile for sample. -
Change the import in the service(s) from:
import { ObservableStore } from '@codewithdan/observable-store';To:
import { ObservableStore } from '../../../../../src/observable-store'; -
Delete
node_modulesand runnpm installagain for the sample project. -
Run
ng server -o
Copy README.md from root into modules/observable-store folder
npm run build now automatically copies the file into the folder for deployment. Any updates should be made to the root README.md.