Skip to content

Commit dac929b

Browse files
author
R. S. Doiel
committed
re-organized code layout, integrate Deno to bundle modules, update build options and docs
1 parent 9729d57 commit dac929b

File tree

73 files changed

+3812
-506
lines changed

Some content is hidden

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

73 files changed

+3812
-506
lines changed

CITATION.cff

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cff-version: 1.2.0
33
message: "If you use this software, please cite it as below."
44
type: software
55
title: CL-web-components
6-
abstract: "CL-web-components provides a collection of Web Components used by Caltech Library in various web sites and projects.
6+
abstract: "CL-web-components provides a collection of Web Components used by Caltech Library across sites and projects.
77
88
The following are the components currently provided.
99
@@ -24,6 +24,10 @@ authors:
2424
given-names: R. S.
2525
orcid: https://orcid.org/0000-0003-0900-6903
2626
27+
- family-names: Smith
28+
given-names: Twila
29+
orcid: https://orcid.org/0009-0003-7975-1922
30+
2731

2832
contacts:
2933
- family-names: Doiel
@@ -32,8 +36,8 @@ contacts:
3236
3337

3438
repository-code: "https://github.com/caltechlibrary/CL-web-components"
35-
version: 0.0.11
36-
date-released: 2025-07-07
39+
version: 0.0.12
40+
date-released: 2025-07-17
3741

3842
license-url: "https://caltechlibrary.github.io/CL-web-components/LICENSE"
3943
keywords:

DEVELOPERS.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@
2020
<section>
2121
<h1 id="developer-notes">Developer Notes</h1>
2222
<p>This is a new endeavor for Caltech Library. Our practices are
23-
evolving as we develop this project and we periodically make course
24-
corrections. In I hope to highlight approaches or technique that proved
25-
useful.</p>
23+
evolving as we develop this project. You should expected periodically
24+
make course corrections. The following documentation will highlight our
25+
approaches and techniques to solving the challenges of developing a web
26+
component library for libraries, archives and museums.</p>
27+
<p>See the <a href="user_manual.html">user manual</a> for developer
28+
documentation.</p>
2629
</section>
2730
</body>
2831
</html>

DEVELOPERS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Developer Notes
33

4-
This is a new endeavor for Caltech Library. Our practices are evolving as we develop this project. You should expected periodically make course corrections. The following documentation will highlight our approaches and techiniquess to solving the challenges of developing a web component library for libraries, archives and museums.
4+
This is a new endeavor for Caltech Library. Our practices are evolving as we develop this project. You should expected periodically make course corrections. The following documentation will highlight our approaches and techniques to solving the challenges of developing a web component library for libraries, archives and museums.
5+
6+
See the [user manual](user_manual.md) for developer documentation.
57

6-
- [Web Component Naming](web_component_naming.md)
7-
- [Integrating CSS in Web Compnoents](integrating_css_in_web_components.md)

INSTALL.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h1 id="cl-web-components">CL-web-components</h1>
3636
number in the filename. The combined bundle includes the version,
3737
releaseDate, releaseHash and licenseText in the bundle.</p>
3838
<p>Here’s an example of getting the v0.0.11
39-
<code>cl-web-compponents.js</code> combined bundled from the release on
39+
<code>cl-web-components.js</code> combined bundled from the release on
4040
macOS or Linux.</p>
4141
<pre><code>curl -L -O https://github.com/caltechlibrary/CL-web-components/releases/download/v0.0.10/cl-web-components-0.0.11.zip
4242
unzip cl-web-components-0.0.11.zip cl-web-components.js</code></pre>

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It recommended that you download the Zip file containing the individual componen
77

88
The zip files are provided for each release. They include the release number in the filename. The combined bundle includes the version, releaseDate, releaseHash and licenseText in the bundle.
99

10-
Here's an example of getting the v0.0.11 `cl-web-compponents.js` combined bundled from the release on macOS or Linux.
10+
Here's an example of getting the v0.0.11 `cl-web-components.js` combined bundled from the release on macOS or Linux.
1111

1212
~~~
1313
curl -L -O https://github.com/caltechlibrary/CL-web-components/releases/download/v0.0.10/cl-web-components-0.0.11.zip

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ ifeq ($(OS), Windows)
3535
EXT = .exe
3636
endif
3737

38-
build: $(PROGRAMS) CITATION.cff README.md about.md version.js
38+
build: CITATION.cff README.md about.md version.js
39+
deno task build
3940

4041
hash: .FORCE
4142
git log --pretty=format:'%h' -n 1
@@ -66,19 +67,17 @@ refresh:
6667
git fetch origin
6768
git pull origin $(BRANCH)
6869

69-
publish: build website .FORCE
70+
publish: website .FORCE
7071
./publish.bash
7172

7273
clean:
7374
-rm *.bak >/dev/null
7475
@if [ -d dist ]; then rm -fR dist; fi
7576
@if [ -d testout ]; then rm -fR testout; fi
7677

77-
dist: .FORCE
78-
@mkdir -p dist
78+
dist: build .FORCE
7979
@rm -fR dist/* >/dev/null
80-
deno bundle --platform=browser --outdir=dist $(WEB_COMPONENTS)
81-
deno bundle --platform=browser --output=dist/cl-web-components.js mod.js
80+
deno task release
8281
cp INSTALL.md dist/
8382
cp LICENSE dist/
8483
cp about.md dist/

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22

3-
# CL-web-components 0.0.11
3+
# CL-web-components
44

5-
CL-web-components provides a collection of Web Components used by Caltech Library in various web sites and projects.
5+
CL-web-components provides a collection of Web Components used by Caltech Library across sites and projects.
66

77
The following are the components currently provided.
88

99

1010
`ul-a-to-z`
11-
: This component takes an innerHTML containing a UL list. The UL list is then turned into an A to Z navigatable UL List. If JavaScript is unavailable then the innerHTML UL remains as a fallback.
11+
: This component takes an innerHTML containing a UL list. The UL list is then turned into an A to Z navigable UL List. If JavaScript is unavailable then the innerHTML UL remains as a fallback.
1212

1313
`textarea-csv`
1414
: This is a textarea like component who's innerHTML content is CSV data. The component will display this as an editable table.
@@ -21,31 +21,42 @@ The following are the components currently provided.
2121

2222
## Release Notes
2323

24-
- version: 0.0.11
24+
- version: 0.0.12
2525
- status: wip
26-
- released: 2025-07-07
26+
- released: 2025-07-17
2727

28-
Renamed components to use a prefix of the standard element name they are extending.
28+
This release includes a re-organization of the project source code. Editable code is now maintained in &#x60;src/&#x60;. The bundled versions
29+
are retained in the root of the repository. Distribution versions are generating in the &#x60;dist/&#x60; directory.
30+
31+
Deno 2.4.1 or better is now a requirement to build the bundled versions.
32+
33+
Additional documentation has been updated and improved in preparation for eventual integration into the Caltech Library design system.
34+
The web component, &#x60;textarea-csv&#x60; now uses the &#x60;jsr:@std/csv&#x60; library which provides robust CSV support.
2935

3036

3137
### Authors
3238

3339
- Doiel, R. S.
40+
- Smith, Twila
3441

3542

3643

3744
### Maintainers
3845

3946
- Doiel, R. S.
4047

48+
## Software Requirements
4149

42-
## Software Suggestions
50+
- Deno &gt;&#x3D; 2.4.1 (for bundling dependencies)
4351

44-
- Deno &gt;&#x3D; 2.4
45-
- CMTools &gt;&#x3D; 0.0.33
52+
### Software Suggestions
53+
54+
- CMTools &gt;&#x3D; 0.0.35
4655
- Pandoc &gt;&#x3D; 3.1
4756

48-
**Uses: HTML5-compatible web browser**
57+
#### Runtime platform
58+
59+
HTML5-compatible web browser**
4960

5061
## Related resources
5162

about.html

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,32 @@
1919
</nav>
2020
<section>
2121
<h1 id="about-this-software">About this software</h1>
22-
<h2 id="cl-web-components-0.0.11">CL-web-components 0.0.11</h2>
23-
<p>Renamed components to use a prefix of the standard element name they
24-
are extending.</p>
22+
<h2 id="cl-web-components-0.0.12">CL-web-components 0.0.12</h2>
23+
<p>This release includes a re-organization of the project source code.
24+
Editable code is now maintained in `src/`. The bundled versions are
25+
retained in the root of the repository. Distribution versions are
26+
generating in the `dist/` directory.</p>
27+
<p>Deno 2.4.1 or better is now a requirement to build the bundled
28+
versions.</p>
29+
<p>Additional documentation has been updated and improved in preparation
30+
for eventual integration into the Caltech Library design system. The web
31+
component, `textarea-csv` now uses the `jsr:<span class="citation"
32+
data-cites="std/csv">@std/csv</span>` library which provides robusts CSV
33+
support.</p>
2534
<h3 id="authors">Authors</h3>
2635
<ul>
2736
<li>R. S. Doiel, <a href="https://orcid.org/0000-0003-0900-6903"
2837
class="uri">https://orcid.org/0000-0003-0900-6903</a></li>
38+
<li>Twila Smith, <a href="https://orcid.org/0009-0003-7975-1922"
39+
class="uri">https://orcid.org/0009-0003-7975-1922</a></li>
2940
</ul>
3041
<h3 id="maintainers">Maintainers</h3>
3142
<ul>
3243
<li>R. S. Doiel, <a href="https://orcid.org/0000-0003-0900-6903"
3344
class="uri">https://orcid.org/0000-0003-0900-6903</a></li>
3445
</ul>
3546
<p>CL-web-components provides a collection of Web Components used by
36-
Caltech Library in various web sites and projects.</p>
47+
Caltech Library across sites and projects.</p>
3748
<p>The following are the components currently provided.</p>
3849
<dl>
3950
<dt>`ul-a-to-z`</dt>
@@ -76,10 +87,13 @@ <h3 id="programming-languages">Programming languages</h3>
7687
<li>HTML</li>
7788
<li>CSS</li>
7889
</ul>
90+
<h3 id="software-requirements">Software Requirements</h3>
91+
<ul>
92+
<li>Deno &gt;= 2.4.1 (for bundling dependencies)</li>
93+
</ul>
7994
<h3 id="software-suggestions">Software Suggestions</h3>
8095
<ul>
81-
<li>Deno &gt;= 2.4</li>
82-
<li>CMTools &gt;= 0.0.33</li>
96+
<li>CMTools &gt;= 0.0.35</li>
8397
<li>Pandoc &gt;= 3.1</li>
8498
</ul>
8599
</section>

about.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: CL-web-components
3-
abstract: "CL-web-components provides a collection of Web Components used by Caltech Library in various web sites and projects.
3+
abstract: "CL-web-components provides a collection of Web Components used by Caltech Library across sites and projects.
44
55
The following are the components currently provided.
66
@@ -20,6 +20,9 @@ authors:
2020
- family_name: Doiel
2121
given_name: R. S.
2222
id: https://orcid.org/0000-0003-0900-6903
23+
- family_name: Smith
24+
given_name: Twila
25+
id: https://orcid.org/0009-0003-7975-1922
2326

2427

2528
maintainer:
@@ -28,7 +31,7 @@ maintainer:
2831
id: https://orcid.org/0000-0003-0900-6903
2932

3033
repository_code: https://github.com/caltechlibrary/CL-web-components
31-
version: 0.0.11
34+
version: 0.0.12
3235
license_url: https://caltechlibrary.github.io/CL-web-components/LICENSE
3336

3437
programming_language:
@@ -43,19 +46,26 @@ keywords:
4346
- ES6
4447
- Web Components
4548

46-
date_released: 2025-07-07
49+
date_released: 2025-07-17
4750
---
4851

4952
About this software
5053
===================
5154

52-
## CL-web-components 0.0.11
55+
## CL-web-components 0.0.12
5356

54-
Renamed components to use a prefix of the standard element name they are extending.
57+
This release includes a re-organization of the project source code. Editable code is now maintained in &#x60;src/&#x60;. The bundled versions
58+
are retained in the root of the repository. Distribution versions are generating in the &#x60;dist/&#x60; directory.
59+
60+
Deno 2.4.1 or better is now a requirement to build the bundled versions.
61+
62+
Additional documentation has been updated and improved in preparation for eventual integration into the Caltech Library design system.
63+
The web component, &#x60;textarea-csv&#x60; now uses the &#x60;jsr:@std/csv&#x60; library which provides robusts CSV support.
5564

5665
### Authors
5766

5867
- R. S. Doiel, <https://orcid.org/0000-0003-0900-6903>
68+
- Twila Smith, <https://orcid.org/0009-0003-7975-1922>
5969

6070

6171

@@ -65,7 +75,7 @@ Renamed components to use a prefix of the standard element name they are extendi
6575
- R. S. Doiel, <https://orcid.org/0000-0003-0900-6903>
6676

6777

68-
CL-web-components provides a collection of Web Components used by Caltech Library in various web sites and projects.
78+
CL-web-components provides a collection of Web Components used by Caltech Library across sites and projects.
6979

7080
The following are the components currently provided.
7181

@@ -95,12 +105,14 @@ The following are the components currently provided.
95105

96106

97107

108+
### Software Requirements
109+
110+
- Deno &gt;&#x3D; 2.4.1 (for bundling dependencies)
98111

99112

100113
### Software Suggestions
101114

102-
- Deno &gt;&#x3D; 2.4
103-
- CMTools &gt;&#x3D; 0.0.33
115+
- CMTools &gt;&#x3D; 0.0.35
104116
- Pandoc &gt;&#x3D; 3.1
105117

106118

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<head>
4+
<title>CL-web-components</title>
5+
<link rel="stylesheet" href="/css/site.css">
6+
</head>
7+
<body>
8+
<nav>
9+
<ul>
10+
<li><a href="/">Home</a></li>
11+
<li><a href="index.html">README</a></li>
12+
<li><a href="LICENSE">LICENSE</a></li>
13+
<li><a href="user_manual.html">User Manual</a></li>
14+
<li><a href="INSTALL.html">INSTALL</a></li>
15+
<li><a href="about.html">About</a></li>
16+
<li><a href="search.html">Search</a></li>
17+
<li><a href="https://github.com/caltechlibrary/CL-web-components">GitHub</a></li>
18+
</ul>
19+
</nav>
20+
<section>
21+
<h1 id="building-web-components-with-deno">Building Web Components with
22+
Deno</h1>
23+
<p>Web components run in the browser as JavaScript. Generally speaking
24+
their built as independent modules. There is a growing library of
25+
standard modules at <a href="https://jsr.io"
26+
class="uri">https://jsr.io</a>. The standard modules work in Deno as
27+
well as the browser. This includes useful libraries like
28+
<code>@std/csv</code>, <code>@std/path</code> and
29+
<code>@std/yaml</code>. The referencing an import of these by full URLs
30+
is not ideal. It makes much more sense to take advantage Deno which
31+
provides additional functionality like check, lint, fmt and bundle. The
32+
last item is important for web components. With bundle we can generate a
33+
a web component including it’s dependent modules. This gives us much
34+
more reliability in deployments and flexibility of moving code between
35+
browser and server.</p>
36+
<h2 id="un-bundled-sources">Un-bundled sources</h2>
37+
<p>If you are working on a web component the un-bundled source should be
38+
placed in the <code>src/</code> directory. This allows you to include
39+
remote and local modules easily. The build process maintains the
40+
<code>version.js</code> module which includes the versioning of this
41+
repository as well as license text.</p>
42+
<p>Current the following component(s) <strong>require</strong> bundling
43+
due to external dependencies.</p>
44+
<ul>
45+
<li><a href="src/textarea-csv.js">src/textarea-csv.js</a>, uses
46+
<code>@std/csv</code></li>
47+
</ul>
48+
<p>You can build local bundles and test versions using the following
49+
Deno task command.</p>
50+
<pre class="shell"><code>deno task build</code></pre>
51+
<h2 id="building-cl-web-components">Building CL-web-components</h2>
52+
<p>The process to build a release is a little more complex than is
53+
convenient for a Deno task. If your are on macOS or Linux you can use
54+
GNU Make to run the Makefile.</p>
55+
<pre class="shell"><code>make build
56+
make website
57+
web release</code></pre>
58+
<p>On Windows you can use the related PowerShell scripts that replace
59+
make. Example,</p>
60+
<pre class="pwsh"><code>make.ps1 build
61+
make.ps1 website
62+
make.ps1 release</code></pre>
63+
<p>The “release” option makes the zip files needed for a GitHub release.
64+
If you are on macOS or Linux you can run the <code>./replace.bash</code>
65+
script to perform those chores if you have <code>gh</code>
66+
installed.</p>
67+
<p>NOTE: The bundled JavaScript files are in the root directory. The
68+
source are in the <code>src</code> directory. If you need to fix
69+
something, add something, etc. It should go in the <code>src/</code>
70+
directory. You may need to either add or edit the tasks in
71+
<code>deno.json</code>, <code>Makefile</code> or
72+
<code>make.ps1</code>.</p>
73+
</section>
74+
</body>
75+
</html>

0 commit comments

Comments
 (0)