Compare commits

...

5 commits
v0.4.2 ... main

Author SHA1 Message Date
c1b24a1d5f feat: descriptive props on the test page 2025-03-05 22:40:18 +01:00
6494a3bbed chore: update peer dep 2025-03-05 22:38:24 +01:00
08bcc85c93 chore: update repo info 2025-02-09 15:01:16 +01:00
62862b560f chore: add auto mirror to github build script 2025-02-09 14:59:12 +01:00
4c4730e812 0.4.3 2024-11-23 12:25:34 +01:00
5 changed files with 854 additions and 883 deletions

11
.build.yml Normal file
View file

@ -0,0 +1,11 @@
image: alpine/edge
secrets:
- bbfcb6dc-7c4a-42ee-a11a-022f0339a133
environment:
REPO: astro-resume
GH_USER: ayoayco
tasks:
- push-mirror: |
cd ~/"${REPO}"
git config --global credential.helper store
git push --mirror "https://github.com/${GH_USER}/${REPO}"

View file

@ -1,4 +1,5 @@
> **>>> TL;DR:** This facilitates the *creation* and *usage* of global, immutable data for [Astro](https://astro.build) apps > [!NOTE]
> This project moved to [SourceHut](https://git.sr.ht/~ayoayco/astro-resume).
# Astro Resume # Astro Resume
@ -204,4 +205,3 @@ See the [TODO tracker](https://todo.sr.ht/~ayoayco/astro-resume) for planned wor
## Reporting Issues ## Reporting Issues
To report issues or request features, send a plain text email to [~ayoayco/astro-resume@todo.sr.ht](mailto:~ayoayco/astro-resume@todo.sr.ht) or file a ticket via [SourceHut](https://todo.sr.ht/~ayoayco/astro-resume) To report issues or request features, send a plain text email to [~ayoayco/astro-resume@todo.sr.ht](mailto:~ayoayco/astro-resume@todo.sr.ht) or file a ticket via [SourceHut](https://todo.sr.ht/~ayoayco/astro-resume)

View file

@ -1,13 +1,13 @@
{ {
"name": "@ayco/astro-resume", "name": "@ayco/astro-resume",
"author": "Ayo Ayco", "author": "Ayo Ayco",
"homepage": "https://github.com/ayoayco/astro-resume", "homepage": "https://ayco.io/sh/astro-resume",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/ayoayco/astro-resume" "url": "https://git.sr.ht/~ayoayco/astro-resume"
}, },
"type": "module", "type": "module",
"version": "0.4.2", "version": "0.4.3",
"keywords": [ "keywords": [
"astro-component", "astro-component",
"css", "css",
@ -35,6 +35,6 @@
"devalue": "^5.1.1" "devalue": "^5.1.1"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "^4.12.2" "astro": "^5"
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -2,43 +2,43 @@
import Serialize from "../Serialize.astro"; import Serialize from "../Serialize.astro";
import { stringify } from "devalue"; import { stringify } from "devalue";
const data = { const data = {
name: 'John Doe', nameStr: "John Doe",
isOkay: true, isOkayBool: true,
mood: null, moodNull: null,
now: new Date(), nowDate: new Date(),
age: BigInt('3218378192378') ageBigInt: BigInt("3218378192378"),
} };
export type Data = typeof data; export type Data = typeof data;
--- ---
<div id="render-here"></div> <div id="render-here"></div>
<Serialize data={data} id="my-data" use={stringify}/> <Serialize data={data} id="my-data" use={stringify} />
<script> <script>
import { deserialize } from '../deserialize'; import { deserialize } from "../deserialize";
import { parse } from 'devalue'; import { parse } from "devalue";
import type { Data } from './index.astro'; import type { Data } from "./index.astro";
const data = deserialize<Data>('my-data', parse); const data = deserialize<Data>("my-data", parse);
console.log(data); console.log(data);
Object.keys(data).forEach(key => console.log(key, data[key], typeof data[key]))
// render table to render-here
const table = document.createElement('table');
const tbody = document.createElement('tbody');
table.appendChild(tbody);
Object.keys(data).forEach(key => {
const tr = document.createElement('tr');
const tdKey = document.createElement('td');
const tdValue = document.createElement('td');
tdKey.textContent = key;
tdValue.textContent = data[key];
tr.appendChild(tdKey);
tr.appendChild(tdValue);
tbody.appendChild(tr);
});
document.getElementById('render-here').appendChild(table);
Object.keys(data).forEach((key) =>
console.log(key, data[key], typeof data[key])
);
// render table to render-here
const table = document.createElement("table");
const tbody = document.createElement("tbody");
table.appendChild(tbody);
Object.keys(data).forEach((key) => {
const tr = document.createElement("tr");
const tdKey = document.createElement("td");
const tdValue = document.createElement("td");
tdKey.textContent = key;
tdValue.textContent = data[key];
tr.appendChild(tdKey);
tr.appendChild(tdValue);
tbody.appendChild(tr);
});
document.getElementById("render-here").appendChild(table);
</script> </script>