Skip to content

Commit a9cbcea

Browse files
committed
init
0 parents  commit a9cbcea

File tree

85 files changed

+29969
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+29969
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
insert_final_newline = false
15+
trim_trailing_whitespace = false

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
www/
2+
3+
*~
4+
*.sw[mnpcod]
5+
*.log
6+
*.lock
7+
*.tmp
8+
*.tmp.*
9+
log.txt
10+
*.sublime-project
11+
*.sublime-workspace
12+
13+
.stencil/
14+
.idea/
15+
.vscode/
16+
.sass-cache/
17+
.versions/
18+
node_modules/
19+
$RECYCLE.BIN/
20+
21+
.DS_Store
22+
Thumbs.db
23+
UserInterfaceState.xcuserstate
24+
.env
25+
jest-test-results.json

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
.stencil/
3+
.github/
4+
www/
5+
.editorconfig
6+
.gitignore

.storybook/addons.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import '@storybook/addon-actions/register';
2+
import "@storybook/addon-jest/register";
3+
import '@storybook/addon-notes/register';
4+
import '@storybook/addon-viewport/register';

.storybook/config.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { configure, addDecorator, addParameters } from '@storybook/html';
2+
import { create } from '@storybook/theming'
3+
import { withTests } from "@storybook/addon-jest";
4+
import results from "../jest-test-results.json";
5+
6+
const theme = create({
7+
base: 'light',
8+
9+
/*
10+
colorPrimary: 'hotpink',
11+
colorSecondary: 'deepskyblue',
12+
// UI
13+
appBg: 'white',
14+
appContentBg: 'white',
15+
appBorderColor: 'grey',
16+
appBorderRadius: 4,
17+
18+
// Typography
19+
fontBase: '"Open Sans", sans-serif',
20+
fontCode: 'monospace',
21+
22+
// Text colors
23+
textColor: 'black',
24+
textInverseColor: 'rgba(255,255,255,0.9)',
25+
26+
// Toolbar default and active colors
27+
barTextColor: 'silver',
28+
barSelectedColor: 'black',
29+
barBg: 'white',
30+
31+
// Form colors
32+
inputBg: 'white',
33+
inputBorder: 'silver',
34+
inputTextColor: 'black',
35+
inputBorderRadius: 4,
36+
*/
37+
brandTitle: 'Purple Web Components',
38+
//brandUrl: 'https://example.com',
39+
//brandImage: 'https://www.purple-technology.com/2072473f6e8356bd743b97387b175fc28c03139e/images/icons/logo-menu2x.png',
40+
})
41+
42+
addParameters({
43+
options: {
44+
theme
45+
}
46+
})
47+
48+
addDecorator(
49+
withTests({
50+
results,
51+
filesExt: ".spec.ts"
52+
})
53+
);
54+
55+
const req = require.context("../src", true, /\.stories\.js$/);
56+
function loadStories() {
57+
req.keys().forEach(filename => req(filename));
58+
}
59+
configure(loadStories, module);

.storybook/preview-head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- <script src="./build/enjin.js"></script> -->

.storybook/webpack.config.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
const CopyPlugin = require("copy-webpack-plugin");
4+
const WriteFilePlugin = require("write-file-webpack-plugin");
5+
6+
module.exports = async ({ config }) => {
7+
config.entry.push(path.join(__dirname, "../dist/purple-web-components.js"));
8+
fs.readdirSync(
9+
path.join(__dirname, "../dist/collection/components")
10+
).map(function(file) {
11+
jsFilePath = path.join(
12+
__dirname,
13+
`../dist/collection/components/${file}/${file}.js`
14+
);
15+
try {
16+
if (fs.existsSync(jsFilePath)) {
17+
config.entry.push(jsFilePath);
18+
}
19+
} catch (err) {
20+
console.error(err);
21+
}
22+
23+
cssFilePath = path.join(
24+
__dirname,
25+
`../dist/collection/components/${file}/${file}.css`
26+
);
27+
try {
28+
if (fs.existsSync(cssFilePath)) {
29+
config.entry.push(cssFilePath);
30+
}
31+
} catch (err) {
32+
console.error(err);
33+
}
34+
});
35+
36+
config.plugins.push(
37+
new CopyPlugin([
38+
{
39+
from: "**/*",
40+
to: "./",
41+
context: "dist"
42+
}
43+
])
44+
);
45+
46+
config.plugins.push(new WriteFilePlugin());
47+
48+
return config;
49+
};

0 commit comments

Comments
 (0)