@procore/directory-add-company
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

directory-add-company

New add company flow allowing users to add a connected company to their directory by searching PCN.

Installation

yarn add @procore/directory-add-company

Development

Adding Dependencies

This package uses yarn workspaces to manage dependencies. To add a dependency, run the following command in the root directory of this package:

yarn workspace @procore/directory-add-company add <npm-package-name>

Yarn Workspaces Docs

Local Development using Storybook

This package uses storybook to develop and test components. To run storybook, run the following command in the root directory of this package:

yarn storybook

Storybook Docs

Local Development inside the Directory Hydra Client

By linking the directory hydra client to the directory add company package, you can import the package in the directory hydra client as you would any other package.

Install yalc https://www.npmjs.com/package/yalc If you already have yalc installed you can skip this step.

yarn global add yalc

In this directory directory-js-monorepo/packages/directory-add-company, run

yarn publish:locally

This will publish the package to your local yalc store.

In the Directory hydra client root folder, run

yalc add @procore/directory-add-company

This will link the package to the directory hydra client.

You can then import the package in the directory hydra client as you would any other package.

import { AddCompanyButton } from '@procore/directory-add-company';

After making changes to the directory add company package, run yarn publish:locally in this directory and restart your server in the directory hydra client to see the changes.

Publishing to NPM and updating the package in the Directory Hydra Client

To publish a release with changes:

  1. Create new new branch (e.g., git checkout -b chore/release).
  2. Create a changeset by running yarn changeset in the root folder of this monorepo and follow the prompts. This will create a file in the .changeset folder.
  3. Run yarn changeset version to create a release containing all changes. This command will update the version(s) of any packages that have changed, as well as update any relevant CHANGELOG.md files.
  4. Commit the changes (e.g., git commit -m "chore: release").
  5. Create a pull request. git push -u origin <BRANCH_NAME>, and then create pull request in the web UI.
  6. Once the pull request is merged to main the updated packages will be published to npm once the CI pipeline is completed.

Updating the package in the Directory Hydra Client

Once the PR containing the changeset is merged, you can update the package in the directory hydra client by running the following command in the directory hydra client root folder:

yarn add @procore/directory-add-company

You can then test the changes in the directory hydra client by running yarn start in the directory hydra client root folder.

If everything looks good, you can commit the changes to the directory hydra client and create a PR. If CI passes you can then create a tugboat instance from your branch to QA the changes.

Running E2E Tests Locally

This package uses Cypress to run E2E tests. To run the E2E tests, run the following command in the root directory of this package:

yarn cypress:local

Cypress Docs

Trouble Shooting

  • If you receive an error stating no declaration file was found after linking the package, run yarn build in the directory-add-company package and restart your server.

Publishing Storybook by Chromatic

The Chromatic snapshot testing (Regression Testing) is turned off by default as we can publish stories to Chromatic without running these tests.

Note: DO NOT turn on regression testing without acquiring leadership sign off for funding as this will accrue cost

References: Chromatic Docs

How to publish stories from local machine In order to publish stories to Chromatic:
// .env
CHROMATIC_PROJECT_TOKEN=your-token-here
  • Run chromatic script:
yarn chromatic
How to publish stories with CI tools
  • Please copy the Chromatic project from Chromatic token to CI Environment value.

  • Add new job to your process. Circle CI example:

    workflows:
      ...
      jobs:
        - storybook_chromatic_deployment:
        requires:
            - setup
    
    jobs:
        storybook_chromatic_deployment:
        steps:
        - run:
            name: Deploy To Chromatic
            command: yarn chromatic:ci
    
  • Optionally(Recommended) if you like to speed up the build with Chromatic you can use the already built stories so we can depend the Chromatic build on the generated build from Storybook build. Steps are as following:

    1. Add --storybook-build-dir ./storybook-static flag to the chromatic script.(Already added)

    2. Add --webpack-stats-json flag to storybook:build.(Already added)

    3. Add the steps to build stories before building Chromatic.

              ```
              workflows:
                  - storybook_chromatic_deployment
                    requires:
                      - build_storybook
              ```
      
      </details>
       <details>
      
      How to see published storybook: Please visit: https://www.chromatic.com/docs/setup#view-published-storybook

Readme

Keywords

none

Package Sidebar

Install

npm i @procore/directory-add-company

Weekly Downloads

83

Version

1.0.2

License

SEE LICENSE IN LICENSE

Unpacked Size

514 kB

Total Files

156

Last publish

Collaborators

  • yzhou2024
  • alyelashram_procore
  • melch-procore
  • peterknif
  • moaz-ashraf
  • attachi
  • a.elbadawei
  • hyogman
  • dmitri_wm
  • stephanie.brereton
  • procore-oss-user
  • stevenkang3
  • max.helmetag
  • codyrobertsprocore
  • miguel.garcia-procore
  • magdyyx
  • atoaima
  • mustafa-abdelrahman
  • elewando-procore
  • ahmed.ghorab
  • lnspatz914
  • richard.bunn
  • omar.wagdy
  • mona.khairbek
  • mbartlett413
  • cody_schindler_procore
  • yoasyo25
  • ritchlee
  • andersontr15
  • steven.hinkle
  • jamie-dugan-procore
  • hgouhierprocore
  • denzylbalram
  • sarah.freitas
  • alan.bresani
  • amyprocore
  • yoyis3000
  • elijah.procore
  • mike-arndt-procore
  • jnhoang1
  • pam-whisenhunt
  • shradha.khard
  • david-christensen-procore
  • javio-procore
  • chance.eakin.procore
  • gideon-procore
  • ihor.diachenko_procore
  • justinmwatts
  • tedyang
  • jyang-procore
  • pwhisenhunt-procore
  • fairchild
  • rodayna.ehab
  • neil1023
  • scottstern
  • brian.smith1
  • g2mitchell
  • dlameter-procore
  • kylepietz
  • abhijit-procore
  • lhuang325
  • jake-pitkin
  • erikthoreson
  • simona.iancu
  • decha-sanson
  • aberkowitz
  • asamay
  • mustafa-u-abdelrahman
  • rajatmenhdiratta
  • jacksonleach-procore
  • pmfrawley
  • phunguyen-pcor
  • tatsiana.clifton
  • deiab
  • srichaitanya.peddinti
  • kenny.foisy
  • matheusprocore
  • jgreene_procore
  • hectorthiele
  • etokarev
  • daniel.ferreira-contractor
  • dmccraw-procore
  • cyrille.bai
  • greg.sparks
  • fabiomelo513
  • phil.custer
  • bbreyel921
  • amir-iskander
  • neil.mckeeman
  • nickprocore
  • lzhou888
  • davidshure
  • stevenliprocore
  • ramysaid2
  • refaiepcn
  • jgentes
  • faraz.hanif
  • mostafaeltazy
  • agamaleldin
  • andrew.isaac
  • saranahal2
  • rodrigo.dejuana
  • kellen.stewart
  • bill-wagner
  • ezrasimeloff
  • jeffgiaquinto
  • gturkadze
  • sean.spearman.procore
  • kylemartinez-procore
  • roobo-romeski
  • andres-mendez-procore
  • gaurav.sharma.procore
  • tracy.otto
  • sarah.heredia
  • victorbendeck-pc
  • cbathgate
  • davidkangpro
  • kyle.liu
  • amin.jaipuri
  • grafffffff
  • mishaelowoyemi
  • evan.cerwonka.procore
  • ilya.dryha-contractor
  • varomir
  • yogevfine1
  • timofeee
  • matt.harris0223
  • winson.chu
  • andersonbispoprocore
  • scorgiat-procore
  • ladavarga
  • procore_halzy
  • enyaga
  • willpankonien
  • sateesh-kadiyala-procore
  • chris.berber
  • txin1
  • epalinprocore
  • mehrdad-panahandeh
  • tyler.wasden.procore
  • jeremy.lund
  • dineshkumar.jayak
  • ryanfuentesprocore
  • stajics
  • brocktillotsonprocore
  • kyle.williams
  • dtorres-procore
  • noor.ali
  • ari-procore
  • alanprocore
  • jl4ever
  • james.lawson
  • ajaykumar-procore
  • dennis.heckman
  • tara.chambers
  • lalovar-procore
  • james.cleary
  • chadryder
  • devin.cunningham.procore
  • abhijit.patwardhan
  • lydiahara
  • sherylnapigkit
  • changprocore
  • apcarroll_procore
  • andy.mayer
  • bob.laskowski
  • vinaya-procore
  • kahliholmes
  • andrew.wheeler
  • leandro-proc
  • yadhu.prakash
  • jason-kaye
  • jesse.olsen
  • patrick.lardin
  • brad.urani
  • allenanle.procore
  • brookyboy009
  • uddhavjoglekar
  • dancingshell
  • rysmithprocore
  • robbiegprocore
  • jadamsss
  • jeremy.bouzigard
  • timdoherty
  • b.bookout
  • jalyng
  • htael
  • dev-account-admin
  • sseanwang
  • bhargavrnd
  • farismmk
  • dannyporrello
  • danny.ou
  • messanjah
  • eyvettesou
  • jgee67
  • cagmz
  • mariah_delaney
  • lukenispel
  • kimhin267
  • juliana.hernandez
  • judy-lu-pc
  • procore-it-support
  • andrewburke-pc
  • jkleintech
  • rachel.arkebauer
  • procore-npm-bot
  • james.dabbs-procore
  • laurenbrandsteinprocore
  • scottbieser-procore
  • zach.mckenzie.procore
  • shayonj_procore
  • heplayskeys
  • mike.south
  • thomasoboyle
  • dischorde
  • derek-carter-procore
  • dlgasser
  • cfprocore
  • evan.waits
  • jeremy-marcus
  • jmejia-fsl
  • ersgonzalo
  • stephan-procore
  • aleclarsenprocore
  • yihai.zweifel
  • jay-rajan
  • jacky-lei
  • peter.jin