Skip to content

Commit

Permalink
chore(structure): add component folders (#31)
Browse files Browse the repository at this point in the history
* chore(components): add components within packages for subcomponents

* chore(storybook): reorganize subcomponents under package

* chore(build): edit glob for css gulp job

* chore(lock): update lock file
  • Loading branch information
annawen1 authored Nov 16, 2023
1 parent c099772 commit 82462c5
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import sass from 'sass';

const config = {
stories: [
'../packages/**/src/__stories__/*.mdx',
'../packages/**/__stories__/*.mdx',
'../packages/**/__stories__/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/build/modules/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const promisifyStream = promisify(asyncDone);
*/
const buildModulesCSS = ({ banner }) =>
gulp
.src([`packages/*/src/*.scss`])
.src([`packages/**/src/*.scss`])
.pipe(
sass({
includePaths: ['node_modules', '../../node_modules'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
* LICENSE file in the root directory of this source tree.
*/

import '../test-input.ts';
import '../components/test-input/test-input';
import { html } from 'lit';

// More on how to set up stories at: https://storybook.js.org/docs/web-components/writing-stories/introduction
export default {
title: 'Components/Test input',
title: 'Components/Chat/Test input',
tags: ['autodocs'],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@open-wc/testing';
import { stub } from 'sinon';
import '@carbon-labs/ai-test-input/es/test-input.js';
import C4AITestInput from '../test-input.js';
import C4AITestInput from '../components/test-input/test-input.js';

describe('c4ai-test-input', function () {
it('should render with minimum attributes', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { LitElement } from 'lit';
import { property } from 'lit/decorators.js';
import { SearchTypeaheadAPI } from '../services/SearchTypeahead/index.js';
import { SearchTypeaheadAPI } from '../../../services/SearchTypeahead/index.js';

/**
* Input component using search typeahead api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
*/

import { customElement } from 'lit/decorators.js';
// need to set up package to import global files like the one below. Hardcoding the prefixes
// for now
// need to set up package to import global files like the one below. Hardcoding
// the `c4ai` prefixes for now

// import settings from '../../globals/settings.js';
import testInput from './src/test-input.js';
import { testInputTemplate } from './src/test-input.template.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/test-input/index.ts → packages/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* LICENSE file in the root directory of this source tree.
*/

import './test-input.js';
import './components/test-input/test-input.js';
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@carbon-labs/ai-test-input",
"name": "@carbon-labs/ai-chat",
"version": "0.0.1",
"publishConfig": {
"access": "public"
},
"description": "Carbon for AI - test-input component",
"description": "Carbon for AI - chat component",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/carbon-design-system/carbon-for-ai",
"directory": "packages/test-input"
"directory": "packages/chat"
},
"main": "./src/index.js",
"module": "./src/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
* LICENSE file in the root directory of this source tree.
*/

import '../extended-button.ts';
import '../components/extended-button/extended-button';
import { html } from 'lit';
import ArrowRight16 from '@carbon/web-components/es/icons/arrow--right/16';

/**
* More on how to set up stories at: https://storybook.js.org/docs/web-components/writing-stories/introduction
*/
export default {
title: 'Components/Extended button',
title: 'Components/Extended button/Extended button',
tags: ['autodocs'],
};

Expand Down
2 changes: 1 addition & 1 deletion packages/extended-button/__tests__/extended-button.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { html, fixture, expect } from '@open-wc/testing';
import '@carbon-labs/ai-extended-button/es/extended-button.js';
import C4AIExtendedButton from '../src/extended-button.template.js';
import C4AIExtendedButton from '../components/extended-button/src/extended-button.template.js';

describe('c4ai-extended-button', function () {
it('should render with cds-button minimum attributes', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
*/

import { customElement } from 'lit/decorators.js';
// need to set up package to import global files like the one below. Hardcoding the prefixes
// for now
// need to set up package to import global files like the one below. Hardcoding
//the `c4ai`prefixes for now

// import settings from '../../globals/settings.js';
import extendedButton from './src/extended-button.template.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

$css--plex: true !default;

@use '../../../globals/scss/vars' as *;
@use '../../../../../globals/scss/vars' as *;
@use '@carbon/styles/scss/themes' as *;
@use '@carbon/web-components/scss/components/button/button';

Expand Down
2 changes: 1 addition & 1 deletion packages/extended-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* LICENSE file in the root directory of this source tree.
*/

import './extended-button.js';
import './components/extended-button/extended-button.js';
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions tools/rollup-plugin-scss-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

import path from 'path';
import replace from 'replace-in-file';
import { promisify } from 'util';
import * as sass from 'sass';
import { createFilter } from '@rollup/pluginutils';

/**
Expand Down

0 comments on commit 82462c5

Please sign in to comment.