Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Tooling and scripts for oscd #25

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions dist/oscd/package.json

This file was deleted.

1 change: 0 additions & 1 deletion lib/core/.tsbuildinfo

This file was deleted.

2 changes: 0 additions & 2 deletions lib/core/dist/index.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions lib/core/dist/index.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/core/dist/index.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions lib/core/dist/oscd-component.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions lib/core/dist/oscd-component.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/core/dist/oscd-component.js.map

This file was deleted.

1 change: 0 additions & 1 deletion lib/core/dist/oscd-component.styles.d.ts

This file was deleted.

17 changes: 0 additions & 17 deletions lib/core/dist/oscd-component.styles.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/core/dist/oscd-component.styles.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion tools/oscd/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"rules": {}
},
{
"files": ["./package.json", "./executors.json"],
"files": ["./package.json", "./executors.json", "./generators.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/nx-plugin-checks": "error"
Expand Down
5 changes: 5 additions & 0 deletions tools/oscd/generators.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"factory": "./src/generators/component/generator",
"schema": "./src/generators/component/schema.json",
"description": "oscd-component generator"
},
"status": {
"factory": "./src/generators/status/generator",
"schema": "./src/generators/status/schema.json",
"description": "Oscd Component Status setter"
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion tools/oscd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
"version": "0.0.1",
"type": "commonjs",
"executors": "./executors.json",
"generators": "./generators.json"
"generators": "./generators.json",
"dependencies": {
"@nx/devkit": "16.6.0"
},
"devDependencies": {
"mem": "^9.0.2"
}
}
17 changes: 2 additions & 15 deletions tools/oscd/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,10 @@
"oscd/**/*.ts",
"oscd/package.json",
"tools/oscd/executors.json",
"tools/oscd/package.json"
"tools/oscd/package.json",
"tools/oscd/generators.json"
]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "oscd/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"tags": []
Expand Down
29 changes: 0 additions & 29 deletions tools/oscd/src/generators/component/files/.editorconfig

This file was deleted.

16 changes: 0 additions & 16 deletions tools/oscd/src/generators/component/files/.eslintrc

This file was deleted.

16 changes: 3 additions & 13 deletions tools/oscd/src/generators/component/files/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@
## npm
/node_modules/
/npm-debug.log

## failed screenshots
/screenshots/*/failed/
.tsbuildinfo

## testing
/coverage/

## local debug
/.npmrc

## temp folders
/.tmp/
## docs
/doc/

# build
/_site/
/dist/
/out-tsc/

storybook-static
custom-elements.json
17 changes: 3 additions & 14 deletions tools/oscd/src/generators/component/files/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,11 @@
## npm
/node_modules/
/npm-debug.log

## failed screenshots
/screenshots/*/failed/
.tsbuildinfo

## testing
/coverage/

## local debug
/.npmrc

## temp folders
/.tmp/

# build
/_site/
/out-tsc/
## docs
/doc/

storybook-static
custom-elements.json
20 changes: 15 additions & 5 deletions tools/oscd/src/generators/component/files/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@ import type { StorybookConfig } from '@storybook/web-components-vite';

const config: StorybookConfig = {
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)', '../stories/**/*.mdx'],
addons: ['@storybook/addon-essentials'],
addons: [
'@storybook/addon-docs',
'@storybook/addon-controls',
'@storybook/addon-actions',
'@storybook/addon-a11y',
'@storybook/addon-links',
{
name: '@storybook/adddon-essentials',
options: {
background: false,
},
},
'@etchteam/storybook-addon-status/register',
'storybook-addon-root-attribute/register',
],
framework: {
name: '@storybook/web-components-vite',
options: {
Expand All @@ -14,7 +28,3 @@ const config: StorybookConfig = {
};

export default config;

// To customize your Vite configuration you can use the viteFinal field.
// Check https://storybook.js.org/docs/react/builders/vite#configuration
// and https://nx.dev/packages/storybook/documents/custom-builder-configs
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />

<style>
.story-wrapper {
background: #FFFFFF;
padding: 32px;
}

:root[dark] .story-wrapper {
background: #242424;
}
</style>
38 changes: 38 additions & 0 deletions tools/oscd/src/generators/component/files/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { html } from 'lit';
import { withRootAttribute } from 'storybook-addon-root-attribute';

import '../../../themes/prebuilt/oscd.css';

export const decorators = [
withRootAttribute,
(story) => html`<div class="story-wrapper">${story()}</div>`,
];

export const parameters = {
statuses: {
released: {
background: '#0000ff',
color: '#ffffff',
description: 'This component is stable and released',
},
beta: {
background: '#FF0000',
color: '#FFFFFF',
description: 'This component is still in beta',
},
},
rootAttribute: {
defaultState: {
name: 'Light',
value: null,
},
attribute: 'dark',
tooltip: true,
states: [
{
name: 'Dark',
value: 'dark',
},
],
},
};

This file was deleted.

2 changes: 1 addition & 1 deletion tools/oscd/src/generators/component/files/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Changelog
# Changelog
4 changes: 4 additions & 0 deletions tools/oscd/src/generators/component/files/EXAMPLE.md.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```html
<<%= selector %>>
</<%= selector %>>
```
File renamed without changes.
Loading