ni / nimble

The NI Nimble Design System
https://nimble.ni.dev
MIT License
30 stars 8 forks source link

Organize repo to consistently have an import per component #172

Open rajsite opened 2 years ago

rajsite commented 2 years ago

Currently nimble-components and nimble-angular organize each component into a separate directory with separate import strategies.

Edit August 2023:

The current recommendation would be as follows (these are not coupled, we could do the smaller nimble-components work first):

Known issues this change will resolve:

jattasNI commented 2 years ago

As part of closing this issue we should include CONTRIBUTING docs that explain whatever layout philosophy we land on.

rajsite commented 2 years ago

Related tasks for repo layout:

rajsite commented 2 years ago

As part of this work we should control our exports. This helps two issues, one is the Angular warning about deep entry points:

 - Generating browser application bundles (phase: setup)...Warning: Entry point '@ni/nimble-angular' contains deep imports into 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/button/types', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/button', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/checkbox', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/drawer/types', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/drawer', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/listbox-option', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/menu', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/menu-item', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/number-field', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/select', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/tab', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/tab-panel', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/tabs', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/tabs-toolbar', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/text-field/types', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/text-field', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/theme-provider/types', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/theme-provider', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/tree-item', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/tree-view/types', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/tree-view', 'C:/dev/github/nimble/node_modules/@ni/nimble-components/dist/esm/testing/async-helpers'. This is probably not a problem, but may cause the compilation of entry points to be out of order.

The other is we can prevent implementation details from being exposed externally, like stuff in src/patterns styles.

rajsite commented 2 years ago

As part of adding secondary entrypoints to the nimble-angular library we should export the ButtonAppearance from each component. See https://github.com/ni/nimble/pull/344/files#r803863208

rajsite commented 2 years ago

Some initial research:

rajsite commented 1 year ago

As part of this work we should control our exports. This helps two issues, one is the Angular warning about deep entry points:

The other is we can prevent implementation details from being exposed externally, like stuff in src/patterns styles.

In addition, we should evaluate our exported .d.ts files to make sure internal libraries are not exposed and move @types to devDependencies where possible. See https://github.com/ni/nimble/pull/831/files#r1029565900

rajsite commented 1 year ago

Related issue suggesting we should use package exports as described above. That is technically independent of re-organizing the repo so not closing as a duplicate. It's essentially a subtask of this issue https://github.com/ni/nimble/issues/694

rajsite commented 1 year ago

As part of a repo re-org we should move the design-tokens to a top-level export so applications that only need the tokens can adopt them independently of the theme-provider or of importing elements. Example the microstrategy theme customization and the nimble landing page which just need the tokens and no components.

rajsite commented 1 year ago

As part of adding secondary entrypoints to nimble-angular we should expose testing entrypoints as we have done in nimble-components.

jattasNI commented 5 months ago

I created an AzDO tech debt feature to help us prioritize this large body of work against other non-tech debt work. Feature 2677713: [Tech Debt] Nimble entry point refactor

jattasNI commented 4 months ago

Next step is to create an HLD that describes the overall plan. It should cover the issues raised in the comments and description above.