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

Update from Lit monorepo (manually) #23

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7357f59
[lit-next] Add tsconfig for dowleveling polyfill-support to ES5 (#1579)
kevinpschaaf Feb 5, 2021
6b7472a
[lit-next] Prepare next pre-releases
justinfagnani Feb 11, 2021
8934599
[lit-starter-*] Fix tests on macOS 11.2
justinfagnani Feb 12, 2021
f5ce5b5
New copyright headers (#1630)
aomarks Feb 26, 2021
882ce5f
Update package-locks to v2
justinfagnani Mar 24, 2021
3a903b2
[localize] Replace msgdesc comment with desc option (#1702)
aomarks Mar 31, 2021
21c8db4
[labs] Add @lit-labs/ssr-client and move renderLight (#1689)
kevinpschaaf Mar 31, 2021
6158391
Prepare releases (#1709)
justinfagnani Mar 31, 2021
5ee50e2
[all] Release rc 1 (#1773)
rictic Apr 21, 2021
8147bf1
Update starter kit versions (#1785)
rictic Apr 21, 2021
3f86bac
[all] Remove Polymer references and update links (#1795)
abdonrd Apr 22, 2021
d00d59e
Release all packages with changes (#1860)
justinfagnani May 7, 2021
f5b6fff
Upgrade dependencies. Separate `upgrade` and `nuke`. (#1892)
kevinpschaaf May 12, 2021
bee9669
[all] Update Prettier to v2.3.0 (#1903)
abdonrd May 25, 2021
6e00285
[localize] SSR localization (#1836)
aomarks Jul 13, 2021
b645f89
Replace local type declarations for polyfill APIs with those imported…
bicknellr Aug 6, 2021
c215138
Enable noImplicitOverride in our tsconfigs, requiring us to add the `…
rictic Aug 26, 2021
bb6eb3e
[all] Upgrade all package locks, includes TypeScript 4.4.2 (#2113)
aomarks Aug 31, 2021
3ed0012
[all] Take (almost) all major upgrades to dependencies (#2115)
aomarks Aug 31, 2021
2487241
Remove subpath folder mapping from packages' `exports` field. (#2103)
bicknellr Sep 1, 2021
c458144
[starter-kits] Update starter kits to use open-wc CEM analyzer (#2117)
kevinpschaaf Sep 1, 2021
450a96c
Bump package locks (#2131)
aomarks Sep 2, 2021
3ebb4c3
[all] Prepare Lit 2.0 GA release (#2170)
kevinpschaaf Sep 21, 2021
f301ef4
[starter-kits] Fix starter kits so `npm run serve` isn't `npm run doc…
AndrewJakubowicz Nov 13, 2021
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
Prev Previous commit
Next Next commit
[starter-kits] Update starter kits to use open-wc CEM analyzer (#2117)
* Update from WCA to CEM generator

* Remove generated custom-elements.json manifest from git

* Fix formatting

* Add changeset

* Fix TS return type in docs generator

* Update package-lock for starter kits

* Update package-lock
  • Loading branch information
kevinpschaaf authored Sep 1, 2021
commit c458144e9f2368fec379672e95b2ca8eb5357de2
70 changes: 0 additions & 70 deletions custom-elements.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs-src/_includes/footer.11ty.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = function (data) {
<footer>
<p>
Made with
<a href="https://github.com/PolymerLabs/lit-starter-js">lit-starter-js</a>
<a href="https://github.com/lit/lit-element-starter-js">lit-starter-js</a>
</p>
</footer>`;
};
96 changes: 69 additions & 27 deletions docs-src/api.11ty.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,67 @@ module.exports = class Docs {
}

render(data) {
const customElements = data.api['11tydata'].customElements;
const tags = customElements.tags;
const manifest = data.api['11tydata'].customElements;
const elements = manifest.modules.reduce(
(els, module) =>
els.concat(
module.declarations?.filter((dec) => dec.customElement) ?? []
),
[]
);
return `
<h1>API</h1>
${tags
${elements
.map(
(tag) => `
<h2>&lt;${tag.name}></h2>
(element) => `
<h2>&lt;${element.tagName}></h2>
<div>
${tag.description}
${element.description}
</div>
${renderTable(
'Attributes',
['name', 'description', 'type', 'default'],
tag.attributes
['name', 'description', 'type.text', 'default'],
element.attributes
)}
${renderTable(
'Properties',
['name', 'attribute', 'description', 'type', 'default'],
tag.properties
['name', 'attribute', 'description', 'type.text', 'default'],
element.members.filter((m) => m.kind === 'field')
)}
${renderTable(
'Methods',
['name', 'parameters', 'description', 'return.type.text'],
element.members
.filter(
(m) =>
m.kind === 'method' &&
m.privacy !== 'private' &&
m.name[0] !== '_'
)
.map((m) => ({
...m,
parameters: renderTable(
'',
['name', 'description', 'type.text'],
m.parameters
),
}))
)}
${renderTable('Events', ['name', 'description'], element.events)}
${renderTable(
'Slots',
[['name', '(default)'], 'description'],
element.slots
)}
${
/*
* Methods are not output by web-component-analyzer yet (a bug), so
* this is a placeholder so that at least _something_ will be output
* when that is fixed, and element maintainers will hopefully have a
* signal to update this file to add the neccessary columns.
*/
renderTable('Methods', ['name', 'description'], tag.methods)
}
${renderTable('Events', ['name', 'description'], tag.events)}
${renderTable('Slots', ['name', 'description'], tag.slots)}
${renderTable(
'CSS Shadow Parts',
['name', 'description'],
tag.cssParts
element.cssParts
)}
${renderTable(
'CSS Custom Properties',
['name', 'description'],
tag.cssProperties
element.cssProperties
)}
`
)
Expand All @@ -60,25 +80,47 @@ module.exports = class Docs {
}
};

/**
* Reads a (possibly deep) path off of an object.
*/
const get = (obj, path) => {
let fallback = '';
if (Array.isArray(path)) {
[path, fallback] = path;
}
const parts = path.split('.');
while (obj && parts.length) {
obj = obj[parts.shift()];
}
return obj == null || obj === '' ? fallback : obj;
};

/**
* Renders a table of data, plucking the given properties from each item in
* `data`.
*/
const renderTable = (name, properties, data) => {
if (data === undefined) {
if (data === undefined || data.length === 0) {
return '';
}
return `
<h3>${name}</h3>
${name ? `<h3>${name}</h3>` : ''}
<table>
<tr>
${properties.map((p) => `<th>${capitalize(p)}</th>`).join('')}
${properties
.map(
(p) =>
`<th>${capitalize(
(Array.isArray(p) ? p[0] : p).split('.')[0]
)}</th>`
)
.join('')}
</tr>
${data
.map(
(i) => `
<tr>
${properties.map((p) => `<td>${i[p]}</td>`).join('')}
${properties.map((p) => `<td>${get(i, p)}</td>`).join('')}
</tr>
`
)
Expand Down
1 change: 1 addition & 0 deletions docs-src/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,5 @@ td, th {
border: solid 1px #aaa;
padding: 4px;
text-align: left;
vertical-align: top;
}
58 changes: 34 additions & 24 deletions docs/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ <h3>Attributes</h3>
</tr>

<tr>
<td>name</td><td>The name to say "Hello" to.</td><td>string</td><td>"World"</td>
<td>name</td><td>The name to say "Hello" to.</td><td>string</td><td></td>
</tr>

<tr>
<td>count</td><td>The number of times the button has been clicked.</td><td>number</td><td>0</td>
<td>count</td><td>The number of times the button has been clicked.</td><td>number</td><td></td>
</tr>

</table>
Expand All @@ -60,43 +60,53 @@ <h3>Properties</h3>
</tr>

<tr>
<td>name</td><td>name</td><td>The name to say "Hello" to.</td><td>string</td><td>"World"</td>
<td>name</td><td>name</td><td>The name to say "Hello" to.</td><td>string</td><td>'World'</td>
</tr>

<tr>
<td>count</td><td>count</td><td>The number of times the button has been clicked.</td><td>number</td><td>0</td>
</tr>

</table>


<h3>Methods</h3>
<table>
<tr>
<th>Name</th><th>Parameters</th><th>Description</th><th>Return</th>
</tr>

<tr>
<td>renderRoot</td><td>undefined</td><td>Node or ShadowRoot into which element DOM should be rendered. Defaults
to an open shadowRoot.</td><td>HTMLElement | ShadowRoot</td><td>undefined</td>
</tr>
<td>sayHello</td><td>

<table>
<tr>
<th>Name</th><th>Description</th><th>Type</th>
</tr>

<tr>
<td>isUpdatePending</td><td>undefined</td><td>undefined</td><td>boolean</td><td>undefined</td>
<td>name</td><td>The name to say "Hello" to</td><td>string</td>
</tr>

<tr>
<td>hasUpdated</td><td>undefined</td><td>undefined</td><td>boolean</td><td>undefined</td>
</table>
</td><td>Formats a greeting</td><td>string</td>
</tr>

</table>


<h3>Events</h3>
<table>
<tr>
<th>Name</th><th>Description</th>
</tr>

<tr>
<td>updateComplete</td><td>undefined</td><td>Returns a Promise that resolves when the element has completed updating.
The Promise value is a boolean that is `true` if the element completed the
update without triggering another update. The Promise result is `false` if
a property was set inside `updated()`. If the Promise is rejected, an
exception was thrown during the update.

To await additional asynchronous work, override the `getUpdateComplete`
method. For example, it is sometimes useful to await a rendered element
before fulfilling this Promise. To do this, first await
`super.getUpdateComplete()`, then any subsequent state.</td><td>Promise<boolean></td><td>undefined</td>
<td>count-changed</td><td>Indicates when the count changes</td>
</tr>

</table>





<h3>Slots</h3>
<table>
Expand All @@ -105,7 +115,7 @@ <h3>Slots</h3>
</tr>

<tr>
<td></td><td>This element has a slot</td>
<td>(default)</td><td>This element has a slot</td>
</tr>

</table>
Expand All @@ -132,7 +142,7 @@ <h3>CSS Shadow Parts</h3>
<footer>
<p>
Made with
<a href="https://github.com/PolymerLabs/lit-starter-js">lit-starter-js</a>
<a href="https://github.com/lit/lit-element-starter-js">lit-starter-js</a>
</p>
</footer>
</body>
Expand Down
1 change: 1 addition & 0 deletions docs/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,5 @@ td, th {
border: solid 1px #aaa;
padding: 4px;
text-align: left;
vertical-align: top;
}
2 changes: 1 addition & 1 deletion docs/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h3>HTML</h3>
<footer>
<p>
Made with
<a href="https://github.com/PolymerLabs/lit-starter-js">lit-starter-js</a>
<a href="https://github.com/lit/lit-element-starter-js">lit-starter-js</a>
</p>
</footer>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/name-property/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h3>HTML</h3>
<footer>
<p>
Made with
<a href="https://github.com/PolymerLabs/lit-starter-js">lit-starter-js</a>
<a href="https://github.com/lit/lit-element-starter-js">lit-starter-js</a>
</p>
</footer>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h2>This is a &lt;my-element&gt;</h2>
<footer>
<p>
Made with
<a href="https://github.com/PolymerLabs/lit-starter-js">lit-starter-js</a>
<a href="https://github.com/lit/lit-element-starter-js">lit-starter-js</a>
</p>
</footer>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/install/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h3>JavaScript</h3>
<footer>
<p>
Made with
<a href="https://github.com/PolymerLabs/lit-starter-js">lit-starter-js</a>
<a href="https://github.com/lit/lit-element-starter-js">lit-starter-js</a>
</p>
</footer>
</body>
Expand Down
Loading