From 2df012d4eeb987149b162b153aab99a8077807e6 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 1 Jan 2024 17:27:32 -0500 Subject: [PATCH 1/7] chore: package.json --- packages/stream/package.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/stream/package.json diff --git a/packages/stream/package.json b/packages/stream/package.json new file mode 100644 index 0000000..c61dd27 --- /dev/null +++ b/packages/stream/package.json @@ -0,0 +1,25 @@ +{ + "name": "simple-stack-stream", + "version": "0.0.1", + "description": "Suspend your Astro components with fallback content.", + "type": "module", + "scripts": { + "build": "tsc", + "dev": "tsc --watch" + }, + "keywords": ["withastro", "astro-integration"], + "repository": { + "type": "git", + "url": "https://github.com/bholmesdev/simple-stack.git", + "directory": "packages/form" + }, + "devDependencies": { + "typescript": "^5.3.3", + "astro": "^4.0.7" + }, + "peerDependencies": { + "astro": "^3.6.0 || ^4.0.0" + }, + "author": "bholmesdev", + "license": "MIT" +} From f443725fd6c5a66421f151a67ff89b72f2e5e71a Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 1 Jan 2024 17:28:06 -0500 Subject: [PATCH 2/7] refactor: examples/form -> examples/playground --- examples/{form => playground}/.gitignore | 0 examples/{form => playground}/.vscode/extensions.json | 0 examples/{form => playground}/.vscode/launch.json | 0 examples/{form => playground}/README.md | 0 examples/{form => playground}/astro.config.mjs | 0 examples/{form => playground}/package.json | 0 examples/{form => playground}/public/favicon.svg | 0 examples/{form => playground}/src/components/Sanitize.tsx | 0 examples/{form => playground}/src/components/preact/Form.tsx | 0 examples/{form => playground}/src/components/preact/Signup.tsx | 0 examples/{form => playground}/src/components/react/Form.tsx | 0 examples/{form => playground}/src/components/react/Signup.tsx | 0 examples/{form => playground}/src/env.d.ts | 0 examples/{form => playground}/src/pages/array.astro | 0 examples/{form => playground}/src/pages/index.astro | 0 examples/{form => playground}/tailwind.config.mjs | 0 examples/{form => playground}/tsconfig.json | 0 17 files changed, 0 insertions(+), 0 deletions(-) rename examples/{form => playground}/.gitignore (100%) rename examples/{form => playground}/.vscode/extensions.json (100%) rename examples/{form => playground}/.vscode/launch.json (100%) rename examples/{form => playground}/README.md (100%) rename examples/{form => playground}/astro.config.mjs (100%) rename examples/{form => playground}/package.json (100%) rename examples/{form => playground}/public/favicon.svg (100%) rename examples/{form => playground}/src/components/Sanitize.tsx (100%) rename examples/{form => playground}/src/components/preact/Form.tsx (100%) rename examples/{form => playground}/src/components/preact/Signup.tsx (100%) rename examples/{form => playground}/src/components/react/Form.tsx (100%) rename examples/{form => playground}/src/components/react/Signup.tsx (100%) rename examples/{form => playground}/src/env.d.ts (100%) rename examples/{form => playground}/src/pages/array.astro (100%) rename examples/{form => playground}/src/pages/index.astro (100%) rename examples/{form => playground}/tailwind.config.mjs (100%) rename examples/{form => playground}/tsconfig.json (100%) diff --git a/examples/form/.gitignore b/examples/playground/.gitignore similarity index 100% rename from examples/form/.gitignore rename to examples/playground/.gitignore diff --git a/examples/form/.vscode/extensions.json b/examples/playground/.vscode/extensions.json similarity index 100% rename from examples/form/.vscode/extensions.json rename to examples/playground/.vscode/extensions.json diff --git a/examples/form/.vscode/launch.json b/examples/playground/.vscode/launch.json similarity index 100% rename from examples/form/.vscode/launch.json rename to examples/playground/.vscode/launch.json diff --git a/examples/form/README.md b/examples/playground/README.md similarity index 100% rename from examples/form/README.md rename to examples/playground/README.md diff --git a/examples/form/astro.config.mjs b/examples/playground/astro.config.mjs similarity index 100% rename from examples/form/astro.config.mjs rename to examples/playground/astro.config.mjs diff --git a/examples/form/package.json b/examples/playground/package.json similarity index 100% rename from examples/form/package.json rename to examples/playground/package.json diff --git a/examples/form/public/favicon.svg b/examples/playground/public/favicon.svg similarity index 100% rename from examples/form/public/favicon.svg rename to examples/playground/public/favicon.svg diff --git a/examples/form/src/components/Sanitize.tsx b/examples/playground/src/components/Sanitize.tsx similarity index 100% rename from examples/form/src/components/Sanitize.tsx rename to examples/playground/src/components/Sanitize.tsx diff --git a/examples/form/src/components/preact/Form.tsx b/examples/playground/src/components/preact/Form.tsx similarity index 100% rename from examples/form/src/components/preact/Form.tsx rename to examples/playground/src/components/preact/Form.tsx diff --git a/examples/form/src/components/preact/Signup.tsx b/examples/playground/src/components/preact/Signup.tsx similarity index 100% rename from examples/form/src/components/preact/Signup.tsx rename to examples/playground/src/components/preact/Signup.tsx diff --git a/examples/form/src/components/react/Form.tsx b/examples/playground/src/components/react/Form.tsx similarity index 100% rename from examples/form/src/components/react/Form.tsx rename to examples/playground/src/components/react/Form.tsx diff --git a/examples/form/src/components/react/Signup.tsx b/examples/playground/src/components/react/Signup.tsx similarity index 100% rename from examples/form/src/components/react/Signup.tsx rename to examples/playground/src/components/react/Signup.tsx diff --git a/examples/form/src/env.d.ts b/examples/playground/src/env.d.ts similarity index 100% rename from examples/form/src/env.d.ts rename to examples/playground/src/env.d.ts diff --git a/examples/form/src/pages/array.astro b/examples/playground/src/pages/array.astro similarity index 100% rename from examples/form/src/pages/array.astro rename to examples/playground/src/pages/array.astro diff --git a/examples/form/src/pages/index.astro b/examples/playground/src/pages/index.astro similarity index 100% rename from examples/form/src/pages/index.astro rename to examples/playground/src/pages/index.astro diff --git a/examples/form/tailwind.config.mjs b/examples/playground/tailwind.config.mjs similarity index 100% rename from examples/form/tailwind.config.mjs rename to examples/playground/tailwind.config.mjs diff --git a/examples/form/tsconfig.json b/examples/playground/tsconfig.json similarity index 100% rename from examples/form/tsconfig.json rename to examples/playground/tsconfig.json From 2cc3d529b8a838873898684819de14b772faa227 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 1 Jan 2024 17:29:20 -0500 Subject: [PATCH 3/7] chore: update READMEs and pkgs --- examples/playground/package.json | 2 +- packages/form/README.md | 6 +- pnpm-lock.yaml | 418 +++---------------------------- 3 files changed, 42 insertions(+), 384 deletions(-) diff --git a/examples/playground/package.json b/examples/playground/package.json index 6eb5855..cda41d7 100644 --- a/examples/playground/package.json +++ b/examples/playground/package.json @@ -1,5 +1,5 @@ { - "name": "@examples/form", + "name": "@examples/playground", "type": "module", "version": "0.0.0", "private": true, diff --git a/packages/form/README.md b/packages/form/README.md index 439a5ea..77c83bd 100644 --- a/packages/form/README.md +++ b/packages/form/README.md @@ -244,8 +244,8 @@ We expose internal functions to manage your form state and handle both synchrono An demo can be found in our repository `examples`: -- [StackBlitz playground](https://stackblitz.com/github/bholmesdev/simple-stack/tree/main/examples/form) -- [GitHub](https://github.com/bholmesdev/simple-stack/tree/main/examples/form) +- [StackBlitz playground](https://stackblitz.com/github/bholmesdev/simple-stack/tree/main/examples/playground) +- [GitHub](https://github.com/bholmesdev/simple-stack/tree/main/examples/playground) ## Sanitizing User Input @@ -272,4 +272,4 @@ const signupForm = createForm({ ### Examples -You can find a sanitization implementation example on our [`examples`](https://github.com/bholmesdev/simple-stack/tree/main/examples/form/src/components/Sanitize.tsx) +You can find a sanitization implementation example on our [`examples`](https://github.com/bholmesdev/simple-stack/tree/main/examples/playground/src/components/Sanitize.tsx) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c99c4f8..e840530 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,7 +21,7 @@ importers: specifier: ^1.11.2 version: 1.11.2 - examples/form: + examples/playground: dependencies: '@astrojs/node': specifier: ^7.0.0 @@ -43,7 +43,7 @@ importers: version: 18.2.17 astro: specifier: ^4.0.7 - version: 4.0.7 + version: 4.0.7(@types/node@20.10.4)(typescript@5.3.3) open-props: specifier: ^1.6.13 version: 1.6.16 @@ -135,6 +135,15 @@ importers: specifier: ^4.5.0 version: 4.5.1 + packages/stream: + devDependencies: + astro: + specifier: ^4.0.7 + version: 4.0.7(@types/node@20.10.4)(typescript@5.3.3) + typescript: + specifier: ^5.3.3 + version: 5.3.3 + packages: /@alloc/quick-lru@5.2.0: @@ -180,7 +189,7 @@ packages: peerDependencies: astro: ^4.0.0-beta.0 dependencies: - astro: 4.0.7 + astro: 4.0.7(@types/node@20.10.4)(typescript@5.3.3) send: 0.18.0 server-destroy: 1.0.1 transitivePeerDependencies: @@ -238,7 +247,7 @@ packages: astro: ^3.0.0 || ^4.0.0 tailwindcss: ^3.0.24 dependencies: - astro: 4.0.7 + astro: 4.0.7(@types/node@20.10.4)(typescript@5.3.3) autoprefixer: 10.4.16(postcss@8.4.32) postcss: 8.4.32 postcss-load-config: 4.0.2(postcss@8.4.32) @@ -261,13 +270,6 @@ packages: transitivePeerDependencies: - supports-color - /@babel/code-frame@7.23.4: - resolution: {integrity: sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/highlight': 7.23.4 - chalk: 2.4.2 - /@babel/code-frame@7.23.5: resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} @@ -275,61 +277,10 @@ packages: '@babel/highlight': 7.23.4 chalk: 2.4.2 - /@babel/compat-data@7.23.3: - resolution: {integrity: sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ==} - engines: {node: '>=6.9.0'} - dev: false - /@babel/compat-data@7.23.5: resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} engines: {node: '>=6.9.0'} - /@babel/core@7.23.3: - resolution: {integrity: sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew==} - engines: {node: '>=6.9.0'} - dependencies: - '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.23.4 - '@babel/generator': 7.23.4 - '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.3) - '@babel/helpers': 7.23.4 - '@babel/parser': 7.23.4 - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.4 - '@babel/types': 7.23.4 - convert-source-map: 2.0.0 - debug: 4.3.4 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/core@7.23.5: - resolution: {integrity: sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==} - engines: {node: '>=6.9.0'} - dependencies: - '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.5 - '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) - '@babel/helpers': 7.23.5 - '@babel/parser': 7.23.5 - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.5 - '@babel/types': 7.23.5 - convert-source-map: 2.0.0 - debug: 4.3.4 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - dev: false - /@babel/core@7.23.6: resolution: {integrity: sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==} engines: {node: '>=6.9.0'} @@ -352,26 +303,6 @@ packages: transitivePeerDependencies: - supports-color - /@babel/generator@7.23.4: - resolution: {integrity: sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.4 - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 - jsesc: 2.5.2 - dev: false - - /@babel/generator@7.23.5: - resolution: {integrity: sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.5 - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 - jsesc: 2.5.2 - dev: false - /@babel/generator@7.23.6: resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==} engines: {node: '>=6.9.0'} @@ -385,18 +316,7 @@ packages: resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.4 - - /@babel/helper-compilation-targets@7.22.15: - resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/compat-data': 7.23.3 - '@babel/helper-validator-option': 7.22.15 - browserslist: 4.22.1 - lru-cache: 5.1.1 - semver: 6.3.1 - dev: false + '@babel/types': 7.23.6 /@babel/helper-compilation-targets@7.23.6: resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==} @@ -417,47 +337,19 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.15 - '@babel/types': 7.23.4 + '@babel/types': 7.23.6 /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.4 + '@babel/types': 7.23.6 /@babel/helper-module-imports@7.22.15: resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.4 - - /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.3): - resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.23.3 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.22.15 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 - dev: false - - /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.5): - resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.23.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.22.15 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 - dev: false + '@babel/types': 7.23.6 /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.6): resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} @@ -480,13 +372,13 @@ packages: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.4 + '@babel/types': 7.23.6 /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.4 + '@babel/types': 7.23.6 /@babel/helper-string-parser@7.23.4: resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} @@ -496,37 +388,10 @@ packages: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} - /@babel/helper-validator-option@7.22.15: - resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} - engines: {node: '>=6.9.0'} - dev: false - /@babel/helper-validator-option@7.23.5: resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} engines: {node: '>=6.9.0'} - /@babel/helpers@7.23.4: - resolution: {integrity: sha512-HfcMizYz10cr3h29VqyfGL6ZWIjTwWfvYBMsBVGwpcbhNGe3wQ1ZXZRPzZoAHhd9OqHadHqjQ89iVKINXnbzuw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.4 - '@babel/types': 7.23.4 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/helpers@7.23.5: - resolution: {integrity: sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.5 - '@babel/types': 7.23.5 - transitivePeerDependencies: - - supports-color - dev: false - /@babel/helpers@7.23.6: resolution: {integrity: sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA==} engines: {node: '>=6.9.0'} @@ -545,21 +410,6 @@ packages: chalk: 2.4.2 js-tokens: 4.0.0 - /@babel/parser@7.23.4: - resolution: {integrity: sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.23.4 - - /@babel/parser@7.23.5: - resolution: {integrity: sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.23.5 - dev: false - /@babel/parser@7.23.6: resolution: {integrity: sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==} engines: {node: '>=6.0.0'} @@ -567,16 +417,6 @@ packages: dependencies: '@babel/types': 7.23.6 - /@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.23.3): - resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.3 - '@babel/helper-plugin-utils': 7.22.5 - dev: false - /@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.23.6): resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} engines: {node: '>=6.9.0'} @@ -596,38 +436,24 @@ packages: '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.23.6) dev: false - /@babel/plugin-transform-react-jsx-self@7.23.3(@babel/core@7.23.5): + /@babel/plugin-transform-react-jsx-self@7.23.3(@babel/core@7.23.6): resolution: {integrity: sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.5 + '@babel/core': 7.23.6 '@babel/helper-plugin-utils': 7.22.5 dev: false - /@babel/plugin-transform-react-jsx-source@7.23.3(@babel/core@7.23.5): + /@babel/plugin-transform-react-jsx-source@7.23.3(@babel/core@7.23.6): resolution: {integrity: sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.5 - '@babel/helper-plugin-utils': 7.22.5 - dev: false - - /@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.23.3): - resolution: {integrity: sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.3 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-module-imports': 7.22.15 + '@babel/core': 7.23.6 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.3) - '@babel/types': 7.23.6 dev: false /@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.23.6): @@ -653,46 +479,10 @@ packages: /@babel/template@7.22.15: resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.23.4 - '@babel/parser': 7.23.4 - '@babel/types': 7.23.4 - - /@babel/traverse@7.23.4: - resolution: {integrity: sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.23.4 - '@babel/generator': 7.23.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.23.4 - '@babel/types': 7.23.4 - debug: 4.3.4 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/traverse@7.23.5: - resolution: {integrity: sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==} - engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.23.5 - '@babel/types': 7.23.5 - debug: 4.3.4 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - dev: false + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 /@babel/traverse@7.23.6: resolution: {integrity: sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==} @@ -711,23 +501,6 @@ packages: transitivePeerDependencies: - supports-color - /@babel/types@7.23.4: - resolution: {integrity: sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.23.4 - '@babel/helper-validator-identifier': 7.22.20 - to-fast-properties: 2.0.0 - - /@babel/types@7.23.5: - resolution: {integrity: sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.23.4 - '@babel/helper-validator-identifier': 7.22.20 - to-fast-properties: 2.0.0 - dev: false - /@babel/types@7.23.6: resolution: {integrity: sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==} engines: {node: '>=6.9.0'} @@ -1607,8 +1380,8 @@ packages: /@types/babel__core@7.20.5: resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} dependencies: - '@babel/parser': 7.23.4 - '@babel/types': 7.23.4 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 '@types/babel__generator': 7.6.7 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.4 @@ -1616,18 +1389,18 @@ packages: /@types/babel__generator@7.6.7: resolution: {integrity: sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ==} dependencies: - '@babel/types': 7.23.4 + '@babel/types': 7.23.6 /@types/babel__template@7.4.4: resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} dependencies: - '@babel/parser': 7.23.4 - '@babel/types': 7.23.4 + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 /@types/babel__traverse@7.20.4: resolution: {integrity: sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==} dependencies: - '@babel/types': 7.23.4 + '@babel/types': 7.23.6 /@types/debug@4.1.12: resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} @@ -1729,9 +1502,9 @@ packages: peerDependencies: vite: ^4.2.0 || ^5.0.0 dependencies: - '@babel/core': 7.23.5 - '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.23.5) - '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.5) + '@babel/core': 7.23.6 + '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.23.6) + '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.6) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 vite: 4.5.1 @@ -1845,86 +1618,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /astro@4.0.7: - resolution: {integrity: sha512-K+Ms2AAQvi6yERPuglcI69tnHyTT44JCjzqprSjw3uOwFX7N9obpLgbhmLMH1fPFTgzt3ZD7APjmtDPN51makw==} - engines: {node: '>=18.14.1', npm: '>=6.14.0'} - hasBin: true - dependencies: - '@astrojs/compiler': 2.3.4 - '@astrojs/internal-helpers': 0.2.1 - '@astrojs/markdown-remark': 4.0.1 - '@astrojs/telemetry': 3.0.4 - '@babel/core': 7.23.3 - '@babel/generator': 7.23.4 - '@babel/parser': 7.23.4 - '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.23.3) - '@babel/traverse': 7.23.4 - '@babel/types': 7.23.4 - '@types/babel__core': 7.20.5 - acorn: 8.11.2 - boxen: 7.1.1 - chokidar: 3.5.3 - ci-info: 4.0.0 - clsx: 2.0.0 - common-ancestor-path: 1.0.1 - cookie: 0.6.0 - debug: 4.3.4 - deterministic-object-hash: 2.0.2 - devalue: 4.3.2 - diff: 5.1.0 - dlv: 1.1.3 - dset: 3.1.3 - es-module-lexer: 1.4.1 - esbuild: 0.19.7 - estree-walker: 3.0.3 - execa: 8.0.1 - fast-glob: 3.3.2 - flattie: 1.1.0 - github-slugger: 2.0.0 - gray-matter: 4.0.3 - html-escaper: 3.0.3 - http-cache-semantics: 4.1.1 - js-yaml: 4.1.0 - kleur: 4.1.5 - magic-string: 0.30.5 - mdast-util-to-hast: 13.0.2 - mime: 3.0.0 - ora: 7.0.1 - p-limit: 5.0.0 - p-queue: 8.0.1 - path-to-regexp: 6.2.1 - preferred-pm: 3.1.2 - probe-image-size: 7.2.3 - prompts: 2.4.2 - rehype: 13.0.1 - resolve: 1.22.8 - semver: 7.5.4 - server-destroy: 1.0.1 - shikiji: 0.6.13 - string-width: 7.0.0 - strip-ansi: 7.1.0 - tsconfck: 3.0.0(typescript@5.3.3) - unist-util-visit: 5.0.0 - vfile: 6.0.1 - vite: 5.0.10(@types/node@20.10.4) - vitefu: 0.2.5(vite@5.0.10) - which-pm: 2.1.1 - yargs-parser: 21.1.1 - zod: 3.22.4 - optionalDependencies: - sharp: 0.32.6 - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - - typescript - dev: false - /astro@4.0.7(@types/node@20.10.4)(typescript@5.3.3): resolution: {integrity: sha512-K+Ms2AAQvi6yERPuglcI69tnHyTT44JCjzqprSjw3uOwFX7N9obpLgbhmLMH1fPFTgzt3ZD7APjmtDPN51makw==} engines: {node: '>=18.14.1', npm: '>=6.14.0'} @@ -2003,7 +1696,6 @@ packages: - supports-color - terser - typescript - dev: true /autoprefixer@10.4.16(postcss@8.4.32): resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==} @@ -2012,8 +1704,8 @@ packages: peerDependencies: postcss: ^8.1.0 dependencies: - browserslist: 4.22.1 - caniuse-lite: 1.0.30001564 + browserslist: 4.22.2 + caniuse-lite: 1.0.30001570 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -2111,17 +1803,6 @@ packages: wcwidth: 1.0.1 dev: true - /browserslist@4.22.1: - resolution: {integrity: sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - dependencies: - caniuse-lite: 1.0.30001564 - electron-to-chromium: 1.4.593 - node-releases: 2.0.13 - update-browserslist-db: 1.0.13(browserslist@4.22.1) - dev: false - /browserslist@4.22.2: resolution: {integrity: sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -2177,10 +1858,6 @@ packages: resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} engines: {node: '>=14.16'} - /caniuse-lite@1.0.30001564: - resolution: {integrity: sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg==} - dev: false - /caniuse-lite@1.0.30001570: resolution: {integrity: sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==} @@ -2335,7 +2012,7 @@ packages: resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} /concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} dev: false /convert-source-map@2.0.0: @@ -2581,11 +2258,7 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} /ee-first@1.1.1: - resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - dev: false - - /electron-to-chromium@1.4.593: - resolution: {integrity: sha512-c7+Hhj87zWmdpmjDONbvNKNo24tvmD4mjal1+qqTYTrlF0/sNpAcDlU0Ki84ftA/5yj3BF2QhSGEC0Rky6larg==} + resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} dev: false /electron-to-chromium@1.4.615: @@ -4173,10 +3846,6 @@ packages: whatwg-url: 5.0.0 dev: true - /node-releases@2.0.13: - resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} - dev: false - /node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} @@ -5691,17 +5360,6 @@ packages: engines: {node: '>= 10.0.0'} dev: false - /update-browserslist-db@1.0.13(browserslist@4.22.1): - resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - dependencies: - browserslist: 4.22.1 - escalade: 3.1.1 - picocolors: 1.0.0 - dev: false - /update-browserslist-db@1.0.13(browserslist@4.22.2): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true From 25530cfe5d51490ade50d1aa7db6c9922e6bbd8d Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 1 Jan 2024 18:51:55 -0500 Subject: [PATCH 4/7] feat: simple-stack-stream MVP --- examples/playground/astro.config.mjs | 2 ++ examples/playground/package.json | 1 + examples/playground/src/components/Wait.astro | 14 ++++++++ examples/playground/src/pages/stream.astro | 35 +++++++++++++++++++ .../stream/components/ResolveSuspended.astro | 26 ++++++++++++++ packages/stream/components/Suspense.astro | 16 +++++++++ packages/stream/components/env.d.ts | 1 + packages/stream/components/index.ts | 2 ++ packages/stream/components/tsconfig.json | 3 ++ packages/stream/components/types.ts | 7 ++++ packages/stream/package.json | 14 ++++++-- packages/stream/src/index.ts | 15 ++++++++ packages/stream/src/middleware.ts | 11 ++++++ packages/stream/tsconfig.json | 8 +++++ pnpm-lock.yaml | 7 ++++ 15 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 examples/playground/src/components/Wait.astro create mode 100644 examples/playground/src/pages/stream.astro create mode 100644 packages/stream/components/ResolveSuspended.astro create mode 100644 packages/stream/components/Suspense.astro create mode 100644 packages/stream/components/env.d.ts create mode 100644 packages/stream/components/index.ts create mode 100644 packages/stream/components/tsconfig.json create mode 100644 packages/stream/components/types.ts create mode 100644 packages/stream/src/index.ts create mode 100644 packages/stream/src/middleware.ts create mode 100644 packages/stream/tsconfig.json diff --git a/examples/playground/astro.config.mjs b/examples/playground/astro.config.mjs index 236bb91..277ed15 100644 --- a/examples/playground/astro.config.mjs +++ b/examples/playground/astro.config.mjs @@ -1,5 +1,6 @@ import { defineConfig } from "astro/config"; import simpleStackForm from "simple-stack-form"; +import simpleStackStream from "simple-stack-stream"; import react from "@astrojs/react"; import node from "@astrojs/node"; import preact from "@astrojs/preact"; @@ -10,6 +11,7 @@ export default defineConfig({ output: "server", integrations: [ simpleStackForm(), + simpleStackStream(), react({ include: ["**/react/*"] }), preact({ include: ["**/preact/*"] }), tailwind(), diff --git a/examples/playground/package.json b/examples/playground/package.json index cda41d7..a7bccb2 100644 --- a/examples/playground/package.json +++ b/examples/playground/package.json @@ -24,6 +24,7 @@ "react-dom": "^18.0.0", "sanitize-html": "^2.11.0", "simple-stack-form": "^0.1.0", + "simple-stack-stream": "^0.0.1", "tailwindcss": "^3.0.24", "zod": "^3.22.4" }, diff --git a/examples/playground/src/components/Wait.astro b/examples/playground/src/components/Wait.astro new file mode 100644 index 0000000..33c1c49 --- /dev/null +++ b/examples/playground/src/components/Wait.astro @@ -0,0 +1,14 @@ +--- +type Props = { + ms: number, + class?: string, +} + +const {ms, class: cls} = Astro.props; + +await new Promise(resolve => setTimeout(resolve, ms)); +--- +
+ +

Loaded in {ms}ms

+
\ No newline at end of file diff --git a/examples/playground/src/pages/stream.astro b/examples/playground/src/pages/stream.astro new file mode 100644 index 0000000..3159283 --- /dev/null +++ b/examples/playground/src/pages/stream.astro @@ -0,0 +1,35 @@ +--- +import Wait from "../components/Wait.astro"; +import { Suspense, ResolveSuspended } from 'simple-stack-stream/components' +--- + + + + + + + Suspense + + +

Out of order streaming

+ + + +

Content

+
+

Loading...

+
+ + + +
+

Follow us

+

Join the newsletter

+
+
+ + + + + \ No newline at end of file diff --git a/packages/stream/components/ResolveSuspended.astro b/packages/stream/components/ResolveSuspended.astro new file mode 100644 index 0000000..8f2d5f1 --- /dev/null +++ b/packages/stream/components/ResolveSuspended.astro @@ -0,0 +1,26 @@ +--- +import type { LocalsWithStreamInternals } from "./types"; + +const { stream } = Astro.locals as LocalsWithStreamInternals; + +const entries = [...stream._internal.components.entries()]; + +const resolvedEntries = await Promise.all( + entries.map( + async ([id, slotPromise]) => [id, await slotPromise], + ) +); +--- + +{ + resolvedEntries.map( ([id, html]) => ( + <> +