cmu-web-kilt 0.8.25__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ node_modules/
2
+ *.gem
3
+ # The Rails gem's build: copies of the kit's files (rake assets) and its output
4
+ packages/rails/Gemfile.lock
5
+ packages/rails/pkg/
6
+ packages/rails/css/
7
+ packages/rails/js/
8
+ packages/rails/LICENSE
9
+ packages/rails/VERSION
10
+ # The Python package's build: copies of the kit's files (hatch_build.py)
11
+ packages/python/LICENSE
12
+ packages/python/src/cmu_web_kilt/package.json
13
+ packages/python/src/cmu_web_kilt/static/
14
+ packages/python/dist/
15
+ __pycache__/
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Carnegie Mellon University
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,73 @@
1
+ Metadata-Version: 2.5
2
+ Name: cmu-web-kilt
3
+ Version: 0.8.25
4
+ Summary: The Carnegie Mellon Web Kilt's browser files and integrity hashes, for Python and Django apps
5
+ Project-URL: Homepage, https://webkilt.andrew.cmu.edu/
6
+ Project-URL: Source, https://github.com/cmu-web/cmu-web-kilt
7
+ Project-URL: Issues, https://github.com/cmu-web/cmu-web-kilt/issues
8
+ Author: CMU Web
9
+ License-Expression: BSD-3-Clause
10
+ License-File: LICENSE
11
+ Classifier: Framework :: Django
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Internet :: WWW/HTTP
14
+ Classifier: Typing :: Typed
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+
18
+ # Carnegie Mellon Web Kilt for Python
19
+
20
+ The [Carnegie Mellon Web Kilt](https://webkilt.andrew.cmu.edu/) extends
21
+ Carnegie Mellon University's web template with page and app components.
22
+ This package carries one kit release: its stylesheets and script, and their
23
+ integrity hashes. Its version is the kit's version, so Dependabot or
24
+ Renovate can propose each release.
25
+
26
+ ```console
27
+ pip install cmu-web-kilt
28
+ ```
29
+
30
+ ## Serve the Files From Django
31
+
32
+ Add the package to `INSTALLED_APPS`, and `collectstatic` picks up its
33
+ files:
34
+
35
+ ```python
36
+ INSTALLED_APPS = [
37
+ # ...
38
+ "cmu_web_kilt",
39
+ ]
40
+ ```
41
+
42
+ ```html
43
+ {% load static %}
44
+ <link href="{% static 'cmu-web-kilt/css/cmu-cms.css' %}" rel="stylesheet" />
45
+ <link href="{% static 'cmu-web-kilt/css/cmu-app.css' %}" rel="stylesheet" />
46
+ <script src="{% static 'cmu-web-kilt/js/cmu-app.js' %}"></script>
47
+ ```
48
+
49
+ Outside Django, `cmu_web_kilt.STATIC_DIR` is the folder that holds `css/`
50
+ and `js/`.
51
+
52
+ ## Link the Files on jsDelivr
53
+
54
+ `cdn_url` gives a file's address on jsDelivr for this release, and
55
+ `INTEGRITY` its hash, so the browser refuses a changed file:
56
+
57
+ ```python
58
+ import cmu_web_kilt
59
+
60
+ for file in ("css/cmu-cms.css", "css/cmu-app.css"):
61
+ print(
62
+ f'<link href="{cmu_web_kilt.cdn_url(file)}" '
63
+ f'integrity="{cmu_web_kilt.INTEGRITY[file]}" crossorigin="anonymous" rel="stylesheet">'
64
+ )
65
+ ```
66
+
67
+ `cmu_web_kilt.VERSION` is the release, such as for a page's footer or a
68
+ cache key.
69
+
70
+ ## License
71
+
72
+ BSD 3-Clause. CMU's names, marks and artwork retain their own usage
73
+ requirements and are not covered by that license.
@@ -0,0 +1,56 @@
1
+ # Carnegie Mellon Web Kilt for Python
2
+
3
+ The [Carnegie Mellon Web Kilt](https://webkilt.andrew.cmu.edu/) extends
4
+ Carnegie Mellon University's web template with page and app components.
5
+ This package carries one kit release: its stylesheets and script, and their
6
+ integrity hashes. Its version is the kit's version, so Dependabot or
7
+ Renovate can propose each release.
8
+
9
+ ```console
10
+ pip install cmu-web-kilt
11
+ ```
12
+
13
+ ## Serve the Files From Django
14
+
15
+ Add the package to `INSTALLED_APPS`, and `collectstatic` picks up its
16
+ files:
17
+
18
+ ```python
19
+ INSTALLED_APPS = [
20
+ # ...
21
+ "cmu_web_kilt",
22
+ ]
23
+ ```
24
+
25
+ ```html
26
+ {% load static %}
27
+ <link href="{% static 'cmu-web-kilt/css/cmu-cms.css' %}" rel="stylesheet" />
28
+ <link href="{% static 'cmu-web-kilt/css/cmu-app.css' %}" rel="stylesheet" />
29
+ <script src="{% static 'cmu-web-kilt/js/cmu-app.js' %}"></script>
30
+ ```
31
+
32
+ Outside Django, `cmu_web_kilt.STATIC_DIR` is the folder that holds `css/`
33
+ and `js/`.
34
+
35
+ ## Link the Files on jsDelivr
36
+
37
+ `cdn_url` gives a file's address on jsDelivr for this release, and
38
+ `INTEGRITY` its hash, so the browser refuses a changed file:
39
+
40
+ ```python
41
+ import cmu_web_kilt
42
+
43
+ for file in ("css/cmu-cms.css", "css/cmu-app.css"):
44
+ print(
45
+ f'<link href="{cmu_web_kilt.cdn_url(file)}" '
46
+ f'integrity="{cmu_web_kilt.INTEGRITY[file]}" crossorigin="anonymous" rel="stylesheet">'
47
+ )
48
+ ```
49
+
50
+ `cmu_web_kilt.VERSION` is the release, such as for a page's footer or a
51
+ cache key.
52
+
53
+ ## License
54
+
55
+ BSD 3-Clause. CMU's names, marks and artwork retain their own usage
56
+ requirements and are not covered by that license.
@@ -0,0 +1,29 @@
1
+ """Copies the kit's browser files, manifest and license into the package and
2
+ takes the package's version from the kit's package.json.
3
+
4
+ In a checkout, the kit is the repository root, two folders up. An sdist
5
+ already carries the copies, so it builds without the repository."""
6
+
7
+ import json
8
+ import shutil
9
+ from pathlib import Path
10
+
11
+ from hatchling.metadata.plugin.interface import MetadataHookInterface
12
+
13
+ FILES = ["css/cmu-cms.css", "css/cmu-app.css", "js/cmu-app.js"]
14
+
15
+
16
+ class KitHook(MetadataHookInterface):
17
+ def update(self, metadata: dict) -> None:
18
+ here = Path(self.root)
19
+ package = here / "src" / "cmu_web_kilt"
20
+ kit = here.parent.parent
21
+ manifest = kit / "package.json"
22
+ if manifest.is_file() and json.loads(manifest.read_text("utf-8")).get("name") == "@cmu-web/kilt":
23
+ for file in FILES:
24
+ target = package / "static" / "cmu-web-kilt" / file
25
+ target.parent.mkdir(parents=True, exist_ok=True)
26
+ shutil.copyfile(kit / file, target)
27
+ shutil.copyfile(manifest, package / "package.json")
28
+ shutil.copyfile(kit / "LICENSE", here / "LICENSE")
29
+ metadata["version"] = json.loads((package / "package.json").read_text("utf-8"))["version"]
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "cmu-web-kilt"
7
+ # The kit's version, from package.json (hatch_build.py)
8
+ dynamic = ["version"]
9
+ description = "The Carnegie Mellon Web Kilt's browser files and integrity hashes, for Python and Django apps"
10
+ readme = "README.md"
11
+ license = "BSD-3-Clause"
12
+ license-files = ["LICENSE"]
13
+ requires-python = ">=3.10"
14
+ authors = [{ name = "CMU Web" }]
15
+ classifiers = [
16
+ "Framework :: Django",
17
+ "Programming Language :: Python :: 3",
18
+ "Topic :: Internet :: WWW/HTTP",
19
+ "Typing :: Typed",
20
+ ]
21
+
22
+ [project.urls]
23
+ Homepage = "https://webkilt.andrew.cmu.edu/"
24
+ Source = "https://github.com/cmu-web/cmu-web-kilt"
25
+ Issues = "https://github.com/cmu-web/cmu-web-kilt/issues"
26
+
27
+ [tool.hatch.metadata.hooks.custom]
28
+
29
+ # The kit's files are copied in by hatch_build.py and ignored by git, so
30
+ # they're named here to be packaged anyway
31
+ [tool.hatch.build]
32
+ artifacts = ["src/cmu_web_kilt/static/", "src/cmu_web_kilt/package.json", "LICENSE"]
33
+
34
+ [tool.hatch.build.targets.wheel]
35
+ packages = ["src/cmu_web_kilt"]
36
+
37
+ [tool.hatch.build.targets.sdist]
38
+ include = ["src/", "tests/", "hatch_build.py", "README.md", "LICENSE"]
@@ -0,0 +1,33 @@
1
+ """The Carnegie Mellon Web Kilt's browser files and integrity hashes.
2
+
3
+ As a Django app (add "cmu_web_kilt" to INSTALLED_APPS), its files are at
4
+ {% static "cmu-web-kilt/css/cmu-cms.css" %} and so on.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import json
10
+ from pathlib import Path
11
+
12
+ __all__ = ["INTEGRITY", "STATIC_DIR", "VERSION", "cdn_url"]
13
+
14
+ _HERE = Path(__file__).resolve().parent
15
+ _MANIFEST = json.loads((_HERE / "package.json").read_text("utf-8"))
16
+
17
+ #: The kit's release, which is also this package's version
18
+ VERSION: str = _MANIFEST["version"]
19
+
20
+ #: Each file's subresource integrity hash, by path ("css/cmu-cms.css"), for
21
+ #: the release's copy on jsDelivr
22
+ INTEGRITY: dict[str, str] = dict(_MANIFEST["integrity"])
23
+
24
+ #: The folder that holds the release's css/ and js/
25
+ STATIC_DIR: Path = _HERE / "static" / "cmu-web-kilt"
26
+
27
+
28
+ def cdn_url(file: str) -> str:
29
+ """The jsDelivr address of one of the release's files, such as
30
+ "css/cmu-cms.css". Link it with INTEGRITY[file] as its integrity."""
31
+ if file not in INTEGRITY:
32
+ raise ValueError(f"{file!r} isn't one of the kit's files: {', '.join(INTEGRITY)}")
33
+ return f"https://cdn.jsdelivr.net/gh/cmu-web/cmu-web-kilt@{VERSION}/{file}"
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@cmu-web/kilt",
3
+ "version": "0.8.25",
4
+ "description": "Components for pages on Carnegie Mellon's web template: CMS sites and web apps.",
5
+ "license": "BSD-3-Clause",
6
+ "homepage": "https://webkilt.andrew.cmu.edu/",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/cmu-web/cmu-web-kilt.git"
10
+ },
11
+ "bugs": "https://github.com/cmu-web/cmu-web-kilt/issues",
12
+ "files": [
13
+ "bin",
14
+ "css",
15
+ "js"
16
+ ],
17
+ "bin": {
18
+ "cmu-web-kilt-links": "bin/cmu-web-kilt-links.mjs"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public",
22
+ "provenance": true
23
+ },
24
+ "scripts": {
25
+ "check": "npm run lint && npm run format:check && npm run check:versions && npm run check:components && npm run check:gallery && npm run check:template && npm run check:opengraph && npm run check:data && npm run test:preview && npm run test:initials && npm run test:links",
26
+ "check:template": "node tools/check-template.mjs",
27
+ "check:versions": "node tools/versions.mjs",
28
+ "check:components": "node tools/components.mjs --check",
29
+ "check:gallery": "node tools/gallery.mjs --check",
30
+ "check:opengraph": "node tools/opengraph.mjs --check",
31
+ "check:data": "node tools/data.mjs --check",
32
+ "lint": "eslint . --max-warnings 0",
33
+ "lint:fix": "npm run lint -- --fix",
34
+ "format": "prettier --write .",
35
+ "format:check": "prettier --check .",
36
+ "components": "node tools/components.mjs",
37
+ "data": "node tools/data.mjs",
38
+ "docs": "node tools/serve.mjs",
39
+ "gallery": "node tools/gallery.mjs",
40
+ "opengraph": "node tools/opengraph.mjs",
41
+ "preview": "node tools/preview.mjs",
42
+ "release": "node tools/versions.mjs",
43
+ "test:browser": "node --test tools/turbo.browser.test.mjs",
44
+ "test:initials": "node --test tools/initials.test.mjs",
45
+ "test:preview": "node --test tools/preview.test.mjs",
46
+ "test:links": "node --test tools/links.test.mjs"
47
+ },
48
+ "devDependencies": {
49
+ "@eslint/js": "^10.0.1",
50
+ "@j178/prek": "^0.5.11",
51
+ "eslint": "^10.15.0",
52
+ "globals": "^17.14.0",
53
+ "playwright": "1.65.1",
54
+ "prettier": "^3.10.1"
55
+ },
56
+ "integrity": {
57
+ "css/cmu-cms.css": "sha384-zOTLMByHk6q956nLCf4pDG1cOUPqc7KBFVsp+Pc21Dmv/7LTb/U9TPHOMwrwoI2b",
58
+ "css/cmu-app.css": "sha384-dnXGzcz4qDkJAdXoxpQ3JIcsQALV7a49EhCv7LUGtFR5Ss4jbecJHQn9RlYdJjj5",
59
+ "js/cmu-app.js": "sha384-sXajIZAZhy1vudkOQPsUNdClpCRearnIVZN8gkIpT03A2dzoQ5vi4EMZCstd/te/"
60
+ }
61
+ }
File without changes