@servicetitan/anvil2-ext-common 0.0.0-rc-1.49.0-20251112153304 → 0.0.0-rc-1.49.0-20251114220804

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,11 +1,25 @@
1
1
  # @servicetitan/anvil2-ext-common
2
2
 
3
- ## 0.0.0-rc-1.49.0-20251112153304
3
+ ## 0.0.0-rc-1.49.0-20251114220804
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [[`b92e48b`](https://github.com/servicetitan/hammer/commit/b92e48bd0b2720a49fb8fb0078477effafde20c1), [`b92e48b`](https://github.com/servicetitan/hammer/commit/b92e48bd0b2720a49fb8fb0078477effafde20c1), [`b92e48b`](https://github.com/servicetitan/hammer/commit/b92e48bd0b2720a49fb8fb0078477effafde20c1), [`eec7556`](https://github.com/servicetitan/hammer/commit/eec75569f008fa2df8166b8efd5c5975741ad386), [`b92e48b`](https://github.com/servicetitan/hammer/commit/b92e48bd0b2720a49fb8fb0078477effafde20c1)]:
8
- - @servicetitan/anvil2@0.0.0-rc-1.49.0-20251112153304
7
+ - Updated dependencies [[`f76f28c`](https://github.com/servicetitan/hammer/commit/f76f28cfbb4a6fde0a4de1854181deae72a5cd26), [`f463031`](https://github.com/servicetitan/hammer/commit/f463031c7f023153157cc49b57534035e0745b71), [`b92e48b`](https://github.com/servicetitan/hammer/commit/b92e48bd0b2720a49fb8fb0078477effafde20c1), [`9fee6b2`](https://github.com/servicetitan/hammer/commit/9fee6b2155d80d8e5d1a4175e0da51160b8ae681), [`9fee6b2`](https://github.com/servicetitan/hammer/commit/9fee6b2155d80d8e5d1a4175e0da51160b8ae681), [`b92e48b`](https://github.com/servicetitan/hammer/commit/b92e48bd0b2720a49fb8fb0078477effafde20c1), [`b92e48b`](https://github.com/servicetitan/hammer/commit/b92e48bd0b2720a49fb8fb0078477effafde20c1), [`138b5d2`](https://github.com/servicetitan/hammer/commit/138b5d2c868da26258622fbcd829a7a2923b32ab), [`b92e48b`](https://github.com/servicetitan/hammer/commit/b92e48bd0b2720a49fb8fb0078477effafde20c1)]:
8
+ - @servicetitan/anvil2@0.0.0-rc-1.49.0-20251114220804
9
+
10
+ ## 0.1.7
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`834507e`](https://github.com/servicetitan/hammer/commit/834507e1ae1b11d46db95131849258f583a59eea), [`7889423`](https://github.com/servicetitan/hammer/commit/788942353ece5412f6c4c7382907489d9861d068), [`7889423`](https://github.com/servicetitan/hammer/commit/788942353ece5412f6c4c7382907489d9861d068), [`ef457b3`](https://github.com/servicetitan/hammer/commit/ef457b36b15049080c4b7a86024a1a955c10fc0f), [`a46d097`](https://github.com/servicetitan/hammer/commit/a46d097bd7b8153aed09bdfd717029e231d4ac0b), [`4a70c88`](https://github.com/servicetitan/hammer/commit/4a70c88392905b3c3de55715eb8d0af05f2f3eef)]:
15
+ - @servicetitan/anvil2@1.48.0
16
+
17
+ ## 0.1.6
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [[`eec7556`](https://github.com/servicetitan/hammer/commit/eec75569f008fa2df8166b8efd5c5975741ad386)]:
22
+ - @servicetitan/anvil2@1.47.1
9
23
 
10
24
  ## 0.1.5
11
25
 
package/README.md CHANGED
@@ -0,0 +1,159 @@
1
+ <h1 align="center">
2
+ Anvil2 Extended Common
3
+ </h1>
4
+
5
+ The Anvil2 Extended Common library is an open contribution area for components, hooks, and other code that extends Anvil2. This is maintained by the larger ServiceTitan engineering organization with support from the Design System team.
6
+
7
+ # Getting Started
8
+
9
+ ## Installation
10
+
11
+ We recommend installing the Common package by running the following `npm` command (or the equivalent `yarn`/`pnpm` command) in your project folder:
12
+
13
+ ```
14
+ npm install @servicetitan/anvil2-ext-common
15
+ ```
16
+
17
+ > [!NOTE]
18
+ > This package requires `@servicetitan/anvil2` as a `peerDependency`, so make sure that is installed as well, and meets the version requirement in this package's `package.json`.
19
+
20
+ ## Usage
21
+
22
+ Components and hooks can be imported as named exports from the package root:
23
+
24
+ ```tsx
25
+ import { useConfirmDialog } from "@servicetitan/anvil2-ext-common";
26
+ ```
27
+
28
+ <br />
29
+
30
+ # Contribution Guide
31
+
32
+ This extended common library is meant to be a place for contributions that extend the Anvil2 library, but that don't necessarily make sense to live inside of Anvil2. Do you have a wrapper to connect a component to MobX or formstate or to a specific backend API? Do you have a shorthand to reduce the boilerplate for one of your common use cases? This is the place for those kinds of contributions!
33
+
34
+ This library can also be used as a place to test new ideas and features that are proposed to be added to Anvil2 in the future, but that need more validation or testing. Code in the common library is not required to be 100% stable to allow for these kind of experimental contributions and to serve as a more open area for testing ideas.
35
+
36
+ The Design System team intends to give guidance and help with maintaining contributions here, but contributions to this package aren't intended to meet the same standards as Anvil2 code.
37
+
38
+ ## Prerequisites
39
+
40
+ This monorepo requires Node >= 20 and [pnpm](https://pnpm.io/) >= 9.
41
+ <br />
42
+ To install `pnpm`, please follow the installation instructions at: https://pnpm.io/installation
43
+
44
+ ## Setting up your local repo
45
+
46
+ Install the dependencies from the top-level project root directory:
47
+
48
+ ```shell
49
+ pnpm install
50
+ ```
51
+
52
+ To make sure everything is installed and working properly, we recommend running a build. This command will also build Anvil2 and its dependencies, so it might take a few minutes:
53
+
54
+ ```shell
55
+ pnpm build:common
56
+ ```
57
+
58
+ ## Development
59
+
60
+ To run our Storybook, you can use the following script from the root of the repo:
61
+
62
+ ```shell
63
+ pnpm storybook:common
64
+ ```
65
+
66
+ Our `ext-common` Storybook will be hosted at http://localhost:8008/.
67
+
68
+ > [!NOTE]
69
+ > For more information about using Storybook, see [their docs](https://storybook.js.org/docs).
70
+
71
+ ## Adding a new component or hook
72
+
73
+ ### Directory structure
74
+
75
+ ```
76
+ - src
77
+ - components
78
+ - MyNewComponent
79
+ - internal
80
+ - SomeInternalCode.ts
81
+ - MyNewComponent.tsx
82
+ - MyNewComponent.stories.tsx
83
+ - MyNewComponent.test.tsx
84
+ - index.ts
85
+ index.ts
86
+ ```
87
+
88
+ To add a new component, you would start by added a new folder in the `src/components` directory for your component. Inside that folder, in addition to the files for your component, you'll want to add an `index.ts` file where you export everything you want to be publicly accessible (component, proptypes, context, etc). Code that is not intended to be public can be organized into an `internal` subdirectory.
89
+
90
+ Then in the `src/components/index.ts` file, you'll want to add the export for your new component to make sure it gets exported along with all the other components.
91
+
92
+ ```tsx
93
+ export * from "./SomeExistingComponent";
94
+ export * from "./MyNewComponent";
95
+ ```
96
+
97
+ To add new stories to the existing Storybook, you'll need to add a file that ends in `*.stories.tsx` or `*.mdx`.
98
+
99
+ To add new unit tests to the existing Vitest run, you'll need to add a file that ends in `*.test.tsx` or `test.ts`.
100
+
101
+ ### Adding a new top-level folder in `src`
102
+
103
+ To add a new top-level folder in the `src` directory works very similarly, just another level higher. You would create a new folder under `src`:
104
+
105
+ ```
106
+ - src
107
+ - components
108
+ - hooks
109
+ - mynewcategory
110
+ index.ts
111
+ ```
112
+
113
+ ...and then add your new folder's exports to the `src/index.ts` file:
114
+
115
+ ```tsx
116
+ export * from "./components";
117
+ export * from "./hooks";
118
+ export * from "./mynewcategory";
119
+ ```
120
+
121
+ ## Making a pull request
122
+
123
+ ### Changesets
124
+
125
+ We use [Changesets](https://github.com/changesets/changesets/blob/main/README.md) to create release notes and manage our release versioning.
126
+
127
+ When you are ready to create a PR to release a change to this package, run:
128
+
129
+ ```shell
130
+ pnpm changeset
131
+ ```
132
+
133
+ Follow the steps and use appropriate semantic version for your change.
134
+
135
+ #### Changeset message format
136
+
137
+ Please format your changelog with name of the relevant components, hooks, or other code in brackets at the start of the changelog, such as:
138
+
139
+ ```md
140
+ ---
141
+ "@servicetitan/anvil2": patch
142
+ ---
143
+
144
+ [TextField] Update padding for `TextField` `prefix` and `suffix`
145
+ ```
146
+
147
+ For more details, see our [internal docs on changeset formatting](https://servicetitan.atlassian.net/wiki/spaces/ADS/pages/3426746698/Changesets+Format).
148
+
149
+ ## Other useful scripts
150
+
151
+ From the root of the monorepo, you can run the following to run scripts specifically for the common library:
152
+
153
+ ```
154
+ pnpm build:common
155
+ pnpm lint:common # run ESLint
156
+ pnpm test:common # run Vitest
157
+ pnpm clean # clear build outputs
158
+ pnpm nuke # clear build outputs and node_modules
159
+ ```
@@ -0,0 +1,6 @@
1
+ export * from './components/ExampleComponent/index'
2
+ export {}
3
+ import _default from './components/ExampleComponent/index'
4
+ export default _default
5
+ export * from './components/ExampleComponent/index'
6
+ export {}
@@ -0,0 +1,4 @@
1
+ const ExampleComponent = {};
2
+
3
+ export { ExampleComponent, ExampleComponent as default };
4
+ //# sourceMappingURL=ExampleComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleComponent.js","sources":["../src/components/ExampleComponent/ExampleComponent.tsx"],"sourcesContent":["export const ExampleComponent = {};\n"],"names":[],"mappings":"AAAO,MAAM,mBAAmB;;;;"}
@@ -0,0 +1,6 @@
1
+ export * from './providers/ExampleProvider/index'
2
+ export {}
3
+ import _default from './providers/ExampleProvider/index'
4
+ export default _default
5
+ export * from './providers/ExampleProvider/index'
6
+ export {}
@@ -0,0 +1,4 @@
1
+ const ExampleProvider = {};
2
+
3
+ export { ExampleProvider, ExampleProvider as default };
4
+ //# sourceMappingURL=ExampleProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleProvider.js","sources":["../src/providers/ExampleProvider/ExampleProvider.tsx"],"sourcesContent":["export const ExampleProvider = {};\n"],"names":[],"mappings":"AAAO,MAAM,kBAAkB;;;;"}
@@ -0,0 +1 @@
1
+ export declare const ExampleComponent: {};
@@ -0,0 +1,2 @@
1
+ export * from './ExampleComponent';
2
+ export { ExampleComponent as default } from './ExampleComponent';
@@ -0,0 +1 @@
1
+ export * from './ExampleComponent';
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
+ export * from './components';
1
2
  export * from './hooks';
3
+ export * from './providers';
2
4
  export * from './types';
package/dist/index.js CHANGED
@@ -1,2 +1,4 @@
1
+ export { default as ExampleComponent } from './ExampleComponent.js';
1
2
  export { u as useConfirmDialog } from './useConfirmDialog-DaQ5Golt.js';
3
+ export { default as ExampleProvider } from './ExampleProvider.js';
2
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export declare const ExampleProvider: {};
@@ -0,0 +1,2 @@
1
+ export * from './ExampleProvider';
2
+ export { ExampleProvider as default } from './ExampleProvider';
@@ -0,0 +1 @@
1
+ export * from './ExampleProvider';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/anvil2-ext-common",
3
- "version": "0.0.0-rc-1.49.0-20251112153304",
3
+ "version": "0.0.0-rc-1.49.0-20251114220804",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "tabbable": "^6.2.0",
29
29
  "tinycolor2": "^1.6.0",
30
30
  "uuid": "^10.0.0",
31
- "@servicetitan/anvil2": "0.0.0-rc-1.49.0-20251112153304"
31
+ "@servicetitan/anvil2": "0.0.0-rc-1.49.0-20251114220804"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@types/react": "^18",