Skip to content

Commit e4c569e

Browse files
committed
chore: pair programming with nolan
1 parent 620183a commit e4c569e

File tree

14 files changed

+9771
-0
lines changed

14 files changed

+9771
-0
lines changed

libraries/lwc/.babelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"plugins": [
3+
[
4+
"@babel/plugin-transform-runtime",
5+
{
6+
"useESModules": true
7+
}
8+
]
9+
]
10+
}

libraries/lwc/karma.conf.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/**
2+
* @license
3+
* Copyright 2017 Google Inc. All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
var webpack = require('webpack');
19+
var path = require('path');
20+
var LwcWebpackPlugin = require('lwc-webpack-plugin');
21+
22+
module.exports = function(config) {
23+
config.set({
24+
plugins: [
25+
'karma-chrome-launcher',
26+
'karma-firefox-launcher',
27+
require(path.resolve(__dirname, '../__shared__/karma-plugins/karma-mocha')),
28+
'karma-sourcemap-loader',
29+
'karma-webpack',
30+
require(path.resolve(__dirname, '../__shared__/karma-plugins/karma-custom-html-reporter')),
31+
require(path.resolve(__dirname, '../__shared__/karma-plugins/karma-custom-json-reporter'))
32+
],
33+
browsers: ['ChromeHeadless', 'FirefoxHeadless'], // run in Chrome and Firefox
34+
customLaunchers: {
35+
FirefoxHeadless: {
36+
base: 'Firefox',
37+
flags: [ '-headless' ],
38+
displayName: 'FirefoxHeadless'
39+
},
40+
},
41+
singleRun: true, // set this to false to leave the browser open
42+
frameworks: ['mocha'], // use the mocha test framework
43+
files: [
44+
'tests.webpack.js' // just load this file
45+
],
46+
preprocessors: {
47+
'tests.webpack.js': ['webpack', 'sourcemap'] // preprocess with webpack and our sourcemap loader
48+
},
49+
reporters: ['dots', 'custom-html', 'custom-json'], // report results in these formats
50+
htmlReporter: {
51+
outputFile: path.resolve(__dirname, './results/results.html'),
52+
pageTitle: 'LWC + Custom Elements',
53+
groupSuites: true,
54+
useCompactStyle: true
55+
},
56+
jsonResultReporter: {
57+
outputFile: path.resolve(__dirname, './results/results.json')
58+
},
59+
webpack: { // kind of a copy of your webpack config
60+
mode: 'development',
61+
// devtool: 'inline-source-map', // just do inline source maps instead of the default
62+
resolve: {
63+
modules: [
64+
path.resolve(__dirname, '../__shared__/webcomponents/src'),
65+
path.resolve(__dirname, './node_modules')
66+
]
67+
},
68+
plugins: [
69+
new LwcWebpackPlugin({
70+
modules: [
71+
{ dir: "src/modules" }
72+
]
73+
})
74+
],
75+
module: {
76+
rules: [
77+
{
78+
test: /\.js$/,
79+
exclude: /node_modules/,
80+
use: {
81+
loader: 'babel-loader'
82+
}
83+
}
84+
]
85+
}
86+
},
87+
webpackServer: {
88+
// noInfo: true // please don't spam the console when running in karma!
89+
}
90+
});
91+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"success": 30,
3+
"failed": 0,
4+
"skipped": 0,
5+
"error": false,
6+
"disconnected": false,
7+
"exitCode": 0,
8+
"score": 100,
9+
"basicSupport": {
10+
"total": 16,
11+
"failed": 0,
12+
"passed": 16
13+
},
14+
"advancedSupport": {
15+
"total": 14,
16+
"failed": 0,
17+
"passed": 14
18+
}
19+
}

libraries/lwc/meta/issues.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

libraries/lwc/meta/summary.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<h4 id="vue-handling-data">Handling data</h4>
2+
3+
By default, Vue passes all data to Custom Elements as attributes. However, Vue
4+
also provides syntax to instruct its bindings to use properties instead. To bind
5+
to a Custom Element property use <code>:foo.prop="bar"</code>.
6+
7+
<h4 id="vue-handling-events">Handling events</h4>
8+
9+
Vue can listen to native DOM events dispatched from Custom Elements. Its
10+
declarative event bindings only support lowercase and kebab case events. To
11+
listen for any events named with capital letters you must write imperative code.

0 commit comments

Comments
 (0)