From fec58246b70034e2d720fb8c9d2f91147456ea11 Mon Sep 17 00:00:00 2001 From: Offirmo Date: Mon, 13 May 2024 20:53:59 +1000 Subject: [PATCH] +++ --- .../css--foundation/package.json | 5 ++- .../css--foundation/public/index.css | 1 + .../css--foundation/src/~~gen/bundle.mjs | 43 +++++++++++++++++++ .../lists/senior-dev/tech-bites--gamedev.md | 1 + .../lists/senior-dev/tech-bites--system.md | 5 +-- stack--2022/package.json | 1 + stack--2022/yarn.lock | 2 +- 7 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 stack--2022/3-advanced--browser/css--foundation/public/index.css create mode 100644 stack--2022/3-advanced--browser/css--foundation/src/~~gen/bundle.mjs diff --git a/stack--2022/3-advanced--browser/css--foundation/package.json b/stack--2022/3-advanced--browser/css--foundation/package.json index bf3a1b3a..b696c49c 100644 --- a/stack--2022/3-advanced--browser/css--foundation/package.json +++ b/stack--2022/3-advanced--browser/css--foundation/package.json @@ -18,13 +18,16 @@ "_start:parcel:storypad": "parcel serve doc/storypad/index.html --port 8080 --lazy --no-autoinstall", "_start:parcel:demo": "parcel serve --log-level verbose 'doc/demo/*.html' --port 3020 --no-autoinstall", - "dev": "npm-run-all clean--cache --parallel _start:parcel:storypad" + "dev": "npm-run-all clean--cache --parallel _start:parcel:storypad", + + "build": "node ./src/~~gen/bundle.mjs" }, "devDependencies": { "@offirmo-private/monorepo-scripts": "*", "@offirmo-private/storypad": "*", "@offirmo-private/toolbox--parcel": "*", + "lightningcss": "^1", "npm-run-all": "^4" } } diff --git a/stack--2022/3-advanced--browser/css--foundation/public/index.css b/stack--2022/3-advanced--browser/css--foundation/public/index.css new file mode 100644 index 00000000..b0d9fe8b --- /dev/null +++ b/stack--2022/3-advanced--browser/css--foundation/public/index.css @@ -0,0 +1 @@ +@layer offirmo--foundation{:root{--o⋄color⁚fg--link--default:#00f;--o⋄color⁚fg--link--visited--default:#531a89;--o⋄color⁚fg--activity-outline--default:#4d91fe;--o⋄color⁚fg--accent--default:#07f;--o⋄font-family--system--sans:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Avenir Next",Avenir,"Segoe UI","Helvetica Neue",Helvetica,Cantarell,Ubuntu,Roboto,Noto,Arial,sans-serif;--o⋄font-family--system--mono:ui-monospace,Menlo,Consolas,Monaco,"Liberation Mono","Lucida Console",monospace,monospace;--o⋄font-family--system--serif:"Iowan Old Style","Apple Garamond",Baskerville,"Times New Roman","Droid Serif",Times,"Source Serif Pro",serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}a{color:var(--o⋄color⁚fg--link);touch-action:manipulation;&:visited{color:var(--o⋄color⁚fg--link--visited)}&:hover,&:active{color:var(--o⋄color⁚fg--activity-outline)}}blockquote>p:first-of-type:before{content:open-quote}blockquote>p:last-of-type:after{content:close-quote}blockquote>p{display:inline-block}body{max-width:var(--o⋄content-recommended-width);margin:0 max(1ch,(100vw - var(--o⋄content-recommended-width))/2);padding:0}figure{text-align:center;& img{margin:auto}}hr{border:none;border-top:var(--o⋄border--thickness)solid;background-color:var(--o⋄color⁚fg--ancillary);width:100%}iframe{border:0}img{image-orientation:from-image;object-fit:cover;background-color:var(--o⋄color⁚bg--highlight--1);image-rendering:-webkit-optimize-contrast;max-width:100%}nav{&:is(ol,ul){flex-direction:row;gap:2em;padding-inline-start:0;list-style-type:none;display:flex}}p{text-wrap:pretty}strong{color:var(--o⋄color⁚fg--strong);font-family:var(--o⋄font-family--important)}svg|a{color:var(--o⋄color⁚fg--link);touch-action:manipulation;&:visited{color:var(--o⋄color⁚fg--link--visited)}&:hover,&:active{color:var(--o⋄color⁚fg--activity-outline)}&:link,&:visited{cursor:pointer}&,& text{fill:var(--o⋄color⁚fg--link);text-decoration:underline}&:hover,&:active{outline:dotted var(--o⋄border--thickness)var(--o⋄color⁚fg--activity-outline)}}textarea{form-sizing:normal}details{border:dashed var(--o⋄border--thickness);padding-inline-start:1.4rem}details summary{cursor:pointer;margin-inline-start:-1rem}details summary>*{display:inline}details[open]{border-color:var(--o⋄color⁚fg--main)}:is(h1,h2,h3,h4,h5,h6){color:var(--o⋄color⁚fg--strong);font-family:var(--o⋄font-family--important);text-wrap:balance;margin-block:.5em}[id]:is(h1,h2,h3,h4,h5,h6){scroll-margin-top:2ex}:root{accent-color:var(--o⋄color⁚fg--accent)}ul,ol{padding-inline-start:1.5em}code,kbd,pre,samp{font-family:var(--o⋄font-family--code);background:var(--o⋄color⁚bg--code);border-radius:.2em;padding-inline:.5ch;font-size:.9em}img,video{max-width:100%;display:block}table{table-layout:fixed;border-collapse:collapse}td{font-variant-numeric:tabular-nums}tbody tr:nth-child(odd){background-color:var(--o⋄color⁚bg--highlight--1)}thead{position:sticky;top:0}:root{scrollbar-color:var(--o⋄color⁚bg--highlight--1)var(--o⋄color⁚bg--main);scrollbar-width:thin}*,:before,:after{scrollbar-color:inherit;scrollbar-width:inherit}::-webkit-scrollbar{xxwidth:.5rem}::-webkit-scrollbar-thumb{background-color:var(--o⋄color⁚bg--highlight--2)}:root{box-sizing:border-box}*,:before,:after{box-sizing:inherit}.box-sizing-reset{box-sizing:initial}:root{color:var(--o⋄color⁚fg--main);background-color:var(--o⋄color⁚bg--main);scroll-behavior:smooth}*{touch-action:manipulation}:root{--o⋄header__scale-ratio:2;font-size:100%}:is(h1,h2,h3,h4){font-size:calc(1rem*(1 + ((var(--o⋄header__scale-ratio) - 1)*var(--o⋄header__scale-ratio__modifier))))}h1{--o⋄header__scale-ratio__modifier:calc(3/3)}h2{--o⋄header__scale-ratio__modifier:calc(2/3)}h3{--o⋄header__scale-ratio__modifier:calc(1/3)}h4{--o⋄header__scale-ratio__modifier:calc(0/3)}small{font-size:.8rem}:root{font-family:var(--o⋄font-family--fast_and_good_enough);text-rendering:geometricprecision;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-variant-numeric:slashed-zero;line-height:1.5}.offirmo--layer--debug{color:#00f}}@layer offirmo--foundation.offirmo--foundation{:root{--o⋄color⁚fg--main:#000;--o⋄color⁚bg--main:#fff;--o⋄color⁚fg--strong:var(--o⋄color⁚fg--main);--o⋄color⁚fg--accent:var(--o⋄color⁚fg--accent--default);--o⋄color⁚fg--link:var(--o⋄color⁚fg--link--default);--o⋄color⁚fg--link--visited:var(--o⋄color⁚fg--link--visited--default);--o⋄color⁚fg--activity-outline:var(--o⋄color⁚fg--activity-outline--default);--o⋄color⁚bg--code:#ededed;--o⋄color⁚bg--highlight--1:#0000001a;--o⋄color⁚bg--highlight--2:#0000004d;--o⋄font-family--fast_and_good_enough:var(--o⋄font-family--system--sans);--o⋄font-family--main:var(--o⋄font-family--fast_and_good_enough);--o⋄font-family--important:var(--o⋄font-family--main);--o⋄font-family--code:var(--o⋄font-family--system--mono);--o⋄border--thickness:.07rem;--o⋄content-recommended-width:60ch}} \ No newline at end of file diff --git a/stack--2022/3-advanced--browser/css--foundation/src/~~gen/bundle.mjs b/stack--2022/3-advanced--browser/css--foundation/src/~~gen/bundle.mjs new file mode 100644 index 00000000..0690e69b --- /dev/null +++ b/stack--2022/3-advanced--browser/css--foundation/src/~~gen/bundle.mjs @@ -0,0 +1,43 @@ +/* https://lightningcss.dev/bundling.html + */ + +import { fileURLToPath } from 'node:url' +import path from 'node:path' + +import { bundleAsync } from 'lightningcss' +import * as fs from '@offirmo/cli-toolbox/fs/extra' + + +///////////////////////////////////////////////// +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const filenameⵧinput = path.join(__dirname, '../index.css') +const filenameⵧoutput = path.join(__dirname, '../../public/index.css') + +///////////////////////////////////////////////// + +console.log('BUNDLING') +console.log({filenameⵧinput, filenameⵧoutput}) + +let { code, map } = await bundleAsync({ + filename: filenameⵧinput, + minify: true, + //errorRecovery: true, + // todo targets: browserslistToTargets(browserslist('>= 0.25%')) + resolver: { + read(filePath) { + //console.log(`Reading "${filePath}"`) + if (filePath.endsWith(`npm:@offirmo-private/css--reset`)) + return '' + + return fs.readFileSync(filePath, 'utf8'); + }, + resolve(specifier, from) { + //console.log(`Resolving`, {specifier, from}) + return path.resolve(path.dirname(from), specifier); + } + } +}); + +//console.log({ code, map }) + +await fs.outputFile(filenameⵧoutput, code) diff --git a/stack--2022/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--gamedev.md b/stack--2022/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--gamedev.md index b387ee7f..ed4db7b5 100644 --- a/stack--2022/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--gamedev.md +++ b/stack--2022/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--gamedev.md @@ -106,6 +106,7 @@ overworld https://en.wikipedia.org/wiki/Overworld pacifist run party permadeath +permanently missable content procedural generation progression system progression system -- power creep (to avoid) diff --git a/stack--2022/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--system.md b/stack--2022/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--system.md index fb6c250d..b4b5c622 100644 --- a/stack--2022/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--system.md +++ b/stack--2022/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--system.md @@ -140,9 +140,8 @@ headless = Front-end presentation is completely decoupled from back-end logic/CM hypermedia incident management = prepare, detect, triage, mitigate, resolve, learn, remediate https://sre.google/resources/practices-and-processes/incident-management-guide/ infrastructure as code (IaC) https://bluelight.co/blog/best-infrastructure-as-code-tools -ingress egress ingress/egress = “the act of entering”, “the right of entering”, or “the means of entering” -Integrity +integrity interview -- manage time: reqts + estimation - 5 min, HLD - 20 min, deep dive - 15 min, roundup - 5 min interview -- popular problems = designing a URL shortening service, Pastebin, Instagram, Dropbox, Facebook Messenger, Twitter, YouTube/Netflix, Typeahead Suggestion, API Rate Limiter, Twitter Search... interview -- popular problems = Google products: Google Search, YouTube, Google Photo Sharing and Storage, Google Docs, Google Drive... @@ -199,7 +198,7 @@ network model -- TCP/IP -- 3 = internet (IP) network model -- TCP/IP -- 4 = link (MAC) network model -- TCP/IP -- 4 = physical network model -- TCP/IP https://www.geeksforgeeks.org/tcp-ip-model/ -nicro-frontend https://micro-frontends.org/ https://the-tractor.store/ +micro-frontend https://micro-frontends.org/ https://the-tractor.store/ non-abstract large system design (NALSD) = iterative process for designing, assessing, and evaluating distributed systems non-abstract large systems design (NALSD) https://sre.google/workbook/non-abstract-design/ numbers everyone should know https://static.googleusercontent.com/media/sre.google/en//static/pdf/rule-of-thumb-latency-numbers-letter.pdf diff --git a/stack--2022/package.json b/stack--2022/package.json index 66fff9bb..0e98cbc5 100644 --- a/stack--2022/package.json +++ b/stack--2022/package.json @@ -124,6 +124,7 @@ "icepick": "^2", "indent-string": "^5", "jsondiffpatch": "^0.6", + "lightningcss": "^1", "load-json-file": "^7", "lodash": "^4", "lodash-es": "^4", diff --git a/stack--2022/yarn.lock b/stack--2022/yarn.lock index a254bad0..eca2f4ed 100644 --- a/stack--2022/yarn.lock +++ b/stack--2022/yarn.lock @@ -3666,7 +3666,7 @@ lightningcss-win32-x64-msvc@1.24.1: resolved "https://packages.atlassian.com/api/npm/npm-remote/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.24.1.tgz#bd6b562d902e0f92904ac3754c722d9e63e00480" integrity sha512-joEupPjYJ7PjZtDsS5lzALtlAudAbgIBMGJPNeFe5HfdmJXFd13ECmEM+5rXNxYVMRHua2w8132R6ab5Z6K9Ow== -lightningcss@^1.22.1: +lightningcss@^1, lightningcss@^1.22.1: version "1.24.1" resolved "https://packages.atlassian.com/api/npm/npm-remote/lightningcss/-/lightningcss-1.24.1.tgz#8b86a5ee6e6ae9e035ff92892bd047b8d687581e" integrity sha512-kUpHOLiH5GB0ERSv4pxqlL0RYKnOXtgGtVe7shDGfhS0AZ4D1ouKFYAcLcZhql8aMspDNzaUCumGHZ78tb2fTg==