Skip to content

Commit

Permalink
feat: reorganize repo
Browse files Browse the repository at this point in the history
  • Loading branch information
megheaiulian committed May 18, 2022
1 parent 39783c0 commit afb9d52
Show file tree
Hide file tree
Showing 20 changed files with 6,085 additions and 8,860 deletions.
34 changes: 0 additions & 34 deletions .storybook/preview.js

This file was deleted.

14,826 changes: 6,037 additions & 8,789 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@
},
"license": "Apache-2.0",
"author": "Neovici Development <dev@neovici.se>",
"main": "cosmoz-tabs.js",
"main": "src/index.js",
"directories": {
"test": "test"
},
"files": [
"cosmoz-*.js",
"lib/**/*.js"
"src/**/*.js"
],
"scripts": {
"lint": "eslint --cache --ext .js .",
"lint-tsc": "tsc",
"start": "npm run storybook",
"start": "wds",
"test": "wtr --coverage",
"test:watch": "wtr --watch",
"storybook": "start-storybook --node-resolve --watch --open",
"storybook:build": "build-storybook",
"storybook:deploy": "storybook-to-ghpages",
"prepare": "husky install"
Expand Down Expand Up @@ -63,19 +61,19 @@
"lit-html": "^1.4.0"
},
"devDependencies": {
"@commitlint/cli": "^16.0.0",
"@commitlint/config-conventional": "^16.0.0",
"@commitlint/cli": "^17.0.0",
"@commitlint/config-conventional": "^17.0.0",
"@neovici/cfg": "^1.11.0",
"@open-wc/demoing-storybook": "^2.4.0",
"@open-wc/testing": "^2.5.0",
"@polymer/iron-list": "^3.1.0",
"@semantic-release/changelog": "^6.0.0",
"@semantic-release/git": "^10.0.0",
"@storybook/storybook-deployer": "^2.8.0",
"@web/dev-server-storybook": "^0.5.0",
"@web/test-runner": "^0.13.18",
"husky": "^7.0.0",
"husky": "^8.0.0",
"semantic-release": "^19.0.0",
"sinon": "^13.0.0",
"sinon": "^14.0.0",
"typescript": "^4.4.0"
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion cosmoz-tab.js → src/cosmoz-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
html,
component
} from 'haunted';
import { useTab } from './lib/use-tab';
import { useTab } from './use-tab';

/**
Expand Down
4 changes: 2 additions & 2 deletions cosmoz-tabs.js → src/cosmoz-tabs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @license Copyright (C) 2015 Neovici AB - Apache 2 License
import { html, component } from 'haunted';
import { useTabs } from './lib/use-tabs';
import { style, renderTab } from './lib/render';
import { useTabs } from './use-tabs';
import { style, renderTab } from './render';
import './cosmoz-tab.js';
import '@polymer/iron-icon';
import '@polymer/iron-icons';
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './cosmoz-tabs';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion stories/cosmoz-tab-card.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { html } from 'haunted';

import '../cosmoz-tabs';
import '../src/cosmoz-tabs';

export default {
title: 'Card',
Expand Down
2 changes: 1 addition & 1 deletion stories/cosmoz-tab.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { html } from 'haunted';

import '../cosmoz-tabs';
import '../src/cosmoz-tabs';

export default {
title: 'Tab',
Expand Down
2 changes: 1 addition & 1 deletion stories/cosmoz-tabs.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { html } from 'haunted';
import { until } from 'lit-html/directives/until.js';

import '../cosmoz-tabs';
import '../src/cosmoz-tabs';
import '@polymer/iron-list';

export default {
Expand Down
2 changes: 1 addition & 1 deletion test/cosmoz-tabs-basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
} from '@open-wc/testing';
import { spy } from 'sinon';

import '../cosmoz-tabs.js';
import '../src/cosmoz-tabs.js';

suite('cosmoz-tabs', () => {
let tabs;
Expand Down
2 changes: 1 addition & 1 deletion test/cosmoz-tabs-events.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
spy
} from 'sinon';

import '../cosmoz-tabs.js';
import '../src/cosmoz-tabs.js';

suite('cosmoz-tabs', () => {
let tabs;
Expand Down
2 changes: 1 addition & 1 deletion test/cosmoz-tabs-hash.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
assert, html, fixture, nextFrame
} from '@open-wc/testing';

import '../cosmoz-tabs.js';
import '../src/cosmoz-tabs.js';

teardown(() => {
window.location.hash = '';
Expand Down
2 changes: 1 addition & 1 deletion test/cosmoz-tabs-sizing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
assert, html, fixture, nextFrame
} from '@open-wc/testing';
import '@polymer/iron-list';
import '../cosmoz-tabs.js';
import '../src/cosmoz-tabs.js';

suite('cosmoz-tabs sizing', () => {
test('sizes non explicitly sized tabs and list without flex renders max items', async () => {
Expand Down
40 changes: 23 additions & 17 deletions test/cosmoz-tabs-slot.test.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
import {
assert, html, fixture, nextFrame
} from '@open-wc/testing';

import '../cosmoz-tabs.js';
import { assert, html, fixture, nextFrame } from '@open-wc/testing';
import { component } from 'haunted';

import '../src/cosmoz-tabs.js';

suiteSetup(() => {
if (customElements.get('slot-test')) {
return;
}
customElements.define('slot-test', component(() => html`
<cosmoz-tabs>
<cosmoz-tab name="tab0" heading="Tab0">1</cosmoz-tab>
<slot></slot>
</cosmoz-tabs>
`));
customElements.define(
'slot-test',
component(
() => html`
<cosmoz-tabs>
<cosmoz-tab name="tab0" heading="Tab0">1</cosmoz-tab>
<slot></slot>
</cosmoz-tabs>
`
)
);
});

suite('cosmoz-tabs slot', () => {
test('collects cosmoz-tabs from slot', async () => {
const el = await fixture(html`
<slot-test>
<cosmoz-tab name="tab1">2</cosmoz-tab>
<span name="notatab2">3</span>
</slot-test>
`),
<slot-test>
<cosmoz-tab name="tab1">2</cosmoz-tab>
<span name="notatab2">3</span>
</slot-test>
`),
tabs = el.shadowRoot.querySelector('cosmoz-tabs');
await nextFrame();
await nextFrame();
tabs.selected = 'tab1';
await nextFrame();
assert.equal(el.querySelector('cosmoz-tab').getAttribute('is-selected'), '');
assert.equal(
el.querySelector('cosmoz-tab').getAttribute('is-selected'),
''
);
});
});
6 changes: 6 additions & 0 deletions web-dev-server.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { storybookPlugin } from '@web/dev-server-storybook';

export default {
plugins: [storybookPlugin({ type: 'web-components' })],
nodeResolve: true
};

0 comments on commit afb9d52

Please sign in to comment.