From 9f43db2a02f3e5facdda80eac14ab64ba51a714f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 28 Sep 2024 01:35:28 +0000 Subject: [PATCH] [ci] release --- .changeset/dull-mayflies-flash.md | 5 -- .changeset/giant-months-search.md | 5 -- .changeset/wild-dancers-juggle.md | 5 -- examples/sitemap-ext/src/auth.ts | 24 +++---- packages/aik-mod/CHANGELOG.md | 6 ++ packages/aik-mod/package.json | 2 +- packages/aik-route-config/CHANGELOG.md | 7 ++ packages/aik-route-config/package.json | 2 +- packages/astro-tests/CHANGELOG.md | 8 +++ packages/astro-tests/package.json | 2 +- packages/astro-tests/src/astroFixture.ts | 6 +- packages/content-utils/CHANGELOG.md | 8 +++ packages/content-utils/package.json | 2 +- packages/cut-short/CHANGELOG.md | 12 ++++ packages/cut-short/README.md | 6 +- packages/cut-short/package.json | 2 +- packages/cut-short/src/index.ts | 74 ++++++++++---------- packages/cut-short/src/internal/debug.ts | 6 +- packages/cut-short/src/runtime/middleware.ts | 18 ++--- packages/cut-short/tests/basic.test.ts | 18 ++--- packages/inline-mod/CHANGELOG.md | 7 ++ packages/inline-mod/package.json | 2 +- packages/modular-station/CHANGELOG.md | 7 ++ packages/modular-station/package.json | 2 +- packages/request-nanostores/CHANGELOG.md | 8 +++ packages/request-nanostores/package.json | 2 +- packages/request-state/CHANGELOG.md | 7 ++ packages/request-state/package.json | 2 +- packages/runtime-logger/CHANGELOG.md | 8 +++ packages/runtime-logger/package.json | 2 +- packages/sitemap-ext/CHANGELOG.md | 6 ++ packages/sitemap-ext/package.json | 2 +- packages/star-warp/CHANGELOG.md | 7 ++ packages/star-warp/package.json | 2 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 2 +- 36 files changed, 186 insertions(+), 104 deletions(-) delete mode 100644 .changeset/dull-mayflies-flash.md delete mode 100644 .changeset/giant-months-search.md delete mode 100644 .changeset/wild-dancers-juggle.md create mode 100644 packages/cut-short/CHANGELOG.md diff --git a/.changeset/dull-mayflies-flash.md b/.changeset/dull-mayflies-flash.md deleted file mode 100644 index 7366167d..00000000 --- a/.changeset/dull-mayflies-flash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@inox-tools/astro-tests': patch ---- - -Export `TestApp` type diff --git a/.changeset/giant-months-search.md b/.changeset/giant-months-search.md deleted file mode 100644 index 9cd3d656..00000000 --- a/.changeset/giant-months-search.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@inox-tools/cut-short': minor ---- - -Implement cut-short integration diff --git a/.changeset/wild-dancers-juggle.md b/.changeset/wild-dancers-juggle.md deleted file mode 100644 index 48d435f7..00000000 --- a/.changeset/wild-dancers-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@inox-tools/utils': patch ---- - -Add `MaybePromise`, `MaybeFactory` and `MaybeThunk` utility types. diff --git a/examples/sitemap-ext/src/auth.ts b/examples/sitemap-ext/src/auth.ts index a62f34fc..fd5d6306 100644 --- a/examples/sitemap-ext/src/auth.ts +++ b/examples/sitemap-ext/src/auth.ts @@ -2,21 +2,21 @@ import type { AstroGlobal } from 'astro'; import { endRequest } from '@it-astro:cut-short'; export function getUser(Astro: AstroGlobal): { id: string; permissions: string[] } { - const cookie = Astro.cookies.get('username'); - if (cookie === undefined) { - endRequest(Astro.redirect('/signin')); - } + const cookie = Astro.cookies.get('username'); + if (cookie === undefined) { + endRequest(Astro.redirect('/signin')); + } - return { - id: cookie.value, - permissions: [], - }; + return { + id: cookie.value, + permissions: [], + }; } export function validateUserPermisssion(Astro: AstroGlobal, permission: string): void { - const user = getUser(Astro); + const user = getUser(Astro); - if (!user.permissions.includes(permission)) { - endRequest(Astro.redirect('/404')); - } + if (!user.permissions.includes(permission)) { + endRequest(Astro.redirect('/404')); + } } diff --git a/packages/aik-mod/CHANGELOG.md b/packages/aik-mod/CHANGELOG.md index 806c1082..986b078f 100644 --- a/packages/aik-mod/CHANGELOG.md +++ b/packages/aik-mod/CHANGELOG.md @@ -1,5 +1,11 @@ # @inox-tools/aik-mod +## 0.8.3 + +### Patch Changes + +- @inox-tools/inline-mod@1.5.1 + ## 0.8.2 ### Patch Changes diff --git a/packages/aik-mod/package.json b/packages/aik-mod/package.json index cbe121fe..ea22da21 100644 --- a/packages/aik-mod/package.json +++ b/packages/aik-mod/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/aik-mod", - "version": "0.8.2", + "version": "0.8.3", "description": "AIK Plugin for inline modules", "keywords": [ "aik", diff --git a/packages/aik-route-config/CHANGELOG.md b/packages/aik-route-config/CHANGELOG.md index 808282da..99a825fa 100644 --- a/packages/aik-route-config/CHANGELOG.md +++ b/packages/aik-route-config/CHANGELOG.md @@ -1,5 +1,12 @@ # @inox-tools/aik-route-config +## 0.7.3 + +### Patch Changes + +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 + ## 0.7.2 ### Patch Changes diff --git a/packages/aik-route-config/package.json b/packages/aik-route-config/package.json index 3385db62..a8d39823 100644 --- a/packages/aik-route-config/package.json +++ b/packages/aik-route-config/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/aik-route-config", - "version": "0.7.2", + "version": "0.7.3", "description": "", "keywords": [ "aik", diff --git a/packages/astro-tests/CHANGELOG.md b/packages/astro-tests/CHANGELOG.md index 51e66128..bab85d90 100644 --- a/packages/astro-tests/CHANGELOG.md +++ b/packages/astro-tests/CHANGELOG.md @@ -1,5 +1,13 @@ # @inox-tools/astro-tests +## 0.1.2 + +### Patch Changes + +- b53264e: Export `TestApp` type +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 + ## 0.1.1 ### Patch Changes diff --git a/packages/astro-tests/package.json b/packages/astro-tests/package.json index c898d9cb..8337f263 100644 --- a/packages/astro-tests/package.json +++ b/packages/astro-tests/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/astro-tests", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "author": "Luiz Ferraz ", "type": "module", diff --git a/packages/astro-tests/src/astroFixture.ts b/packages/astro-tests/src/astroFixture.ts index 00a4f62d..4f05b2d4 100644 --- a/packages/astro-tests/src/astroFixture.ts +++ b/packages/astro-tests/src/astroFixture.ts @@ -224,9 +224,9 @@ export async function loadFixture(inlineConfig: InlineConfig): Promise const onNextChange = () => devServer ? new Promise((resolve) => - // TODO: Implement filter to only resolve on changes to a given file. - devServer.watcher.once('change', () => resolve()) - ) + // TODO: Implement filter to only resolve on changes to a given file. + devServer.watcher.once('change', () => resolve()) + ) : Promise.reject(new Error('No dev server running')); // Also do it on process exit, just in case. diff --git a/packages/content-utils/CHANGELOG.md b/packages/content-utils/CHANGELOG.md index 7445758a..ce522cf9 100644 --- a/packages/content-utils/CHANGELOG.md +++ b/packages/content-utils/CHANGELOG.md @@ -1,5 +1,13 @@ # @inox-tools/content-utils +## 0.7.1 + +### Patch Changes + +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 + - @inox-tools/modular-station@0.3.1 + ## 0.7.0 ### Minor Changes diff --git a/packages/content-utils/package.json b/packages/content-utils/package.json index e69fa1fa..72cfc733 100644 --- a/packages/content-utils/package.json +++ b/packages/content-utils/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/content-utils", - "version": "0.7.0", + "version": "0.7.1", "description": "Utilities to work with content collections on an Astro project from an integration or library.", "keywords": [ "lifecycle", diff --git a/packages/cut-short/CHANGELOG.md b/packages/cut-short/CHANGELOG.md new file mode 100644 index 00000000..c93457b4 --- /dev/null +++ b/packages/cut-short/CHANGELOG.md @@ -0,0 +1,12 @@ +# @inox-tools/cut-short + +## 0.1.0 + +### Minor Changes + +- b53264e: Implement cut-short integration + +### Patch Changes + +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 diff --git a/packages/cut-short/README.md b/packages/cut-short/README.md index 293ebc00..dbb3303d 100644 --- a/packages/cut-short/README.md +++ b/packages/cut-short/README.md @@ -16,10 +16,10 @@ Add the integration to your `astro.config.mjs`: ```js // astro.config.mjs -import { defineConfig } from 'astro' +import { defineConfig } from 'astro'; import cutShort from '@inox-tools/cut-short'; export default defineConfig({ - integrations: [cutShort({})] -}) + integrations: [cutShort({})], +}); ``` diff --git a/packages/cut-short/package.json b/packages/cut-short/package.json index ab7adfed..204194be 100644 --- a/packages/cut-short/package.json +++ b/packages/cut-short/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/cut-short", - "version": "0.0.0", + "version": "0.1.0", "description": "Immediately halt request processing and return custom responses effortlessly.", "keywords": [ "astro-integration", diff --git a/packages/cut-short/src/index.ts b/packages/cut-short/src/index.ts index 7d7c6ded..cf468a80 100644 --- a/packages/cut-short/src/index.ts +++ b/packages/cut-short/src/index.ts @@ -3,43 +3,43 @@ import { z } from 'astro/zod'; import { debug } from './internal/debug.js'; export default defineIntegration({ - name: '@inox-tools/cut-short', - optionsSchema: z.never().optional(), - setup() { - const { resolve } = createResolver(import.meta.url); + name: '@inox-tools/cut-short', + optionsSchema: z.never().optional(), + setup() { + const { resolve } = createResolver(import.meta.url); - return { - hooks: { - 'astro:config:setup': (params) => { - params.addMiddleware({ - entrypoint: resolve('./runtime/middleware.js'), - order: 'post', - }); + return { + hooks: { + 'astro:config:setup': (params) => { + params.addMiddleware({ + entrypoint: resolve('./runtime/middleware.js'), + order: 'post', + }); - addVitePlugin(params, { - warnDuplicated: true, - plugin: { - name: '@inox-tools/cut-short', - enforce: 'pre', - resolveId(source) { - if (source === '@it-astro:cut-short') { - return resolve('./runtime/entrypoint.js'); - } - }, - }, - }); - }, - 'astro:config:done': (params) => { - // Check if the version of Astro being used has the `injectTypes` utility. - if (typeof params.injectTypes === 'function') { - debug('Injecting types in .astro structure'); - params.injectTypes({ - filename: 'types.d.ts', - content: "import '@inox-tools/cut-short';", - }); - } - }, - }, - }; - }, + addVitePlugin(params, { + warnDuplicated: true, + plugin: { + name: '@inox-tools/cut-short', + enforce: 'pre', + resolveId(source) { + if (source === '@it-astro:cut-short') { + return resolve('./runtime/entrypoint.js'); + } + }, + }, + }); + }, + 'astro:config:done': (params) => { + // Check if the version of Astro being used has the `injectTypes` utility. + if (typeof params.injectTypes === 'function') { + debug('Injecting types in .astro structure'); + params.injectTypes({ + filename: 'types.d.ts', + content: "import '@inox-tools/cut-short';", + }); + } + }, + }, + }; + }, }); diff --git a/packages/cut-short/src/internal/debug.ts b/packages/cut-short/src/internal/debug.ts index 408f385a..505209c0 100644 --- a/packages/cut-short/src/internal/debug.ts +++ b/packages/cut-short/src/internal/debug.ts @@ -1,7 +1,7 @@ import debugC from 'debug'; -export const debug = debugC('inox-tools:cut-short') +export const debug = debugC('inox-tools:cut-short'); export const getDebug = (segment?: string) => { - return segment ? debug.extend(segment) : debug; -} + return segment ? debug.extend(segment) : debug; +}; diff --git a/packages/cut-short/src/runtime/middleware.ts b/packages/cut-short/src/runtime/middleware.ts index cdd36523..1fb820cb 100644 --- a/packages/cut-short/src/runtime/middleware.ts +++ b/packages/cut-short/src/runtime/middleware.ts @@ -3,14 +3,14 @@ import { debug } from '../internal/debug.js'; import { CarrierError } from '../internal/carrier.js'; export const onRequest: MiddlewareHandler = async (_, next) => { - try { - return await next(); - } catch (err: unknown) { - if (err instanceof CarrierError) { - debug('Returning response from CarrierError'); - return err.getResponse(); - } + try { + return await next(); + } catch (err: unknown) { + if (err instanceof CarrierError) { + debug('Returning response from CarrierError'); + return err.getResponse(); + } - throw err; - } + throw err; + } }; diff --git a/packages/cut-short/tests/basic.test.ts b/packages/cut-short/tests/basic.test.ts index b9e99112..80360aab 100644 --- a/packages/cut-short/tests/basic.test.ts +++ b/packages/cut-short/tests/basic.test.ts @@ -3,23 +3,23 @@ import testAdapter from '@inox-tools/astro-tests/testAdapter'; import { beforeAll, expect, test } from 'vitest'; const fixture = await loadFixture({ - root: './fixture/basic', - output: 'server', - adapter: testAdapter(), + root: './fixture/basic', + output: 'server', + adapter: testAdapter(), }); let app: TestApp; beforeAll(async () => { - await fixture.build({}); - app = await fixture.loadTestAdapterApp(); + await fixture.build({}); + app = await fixture.loadTestAdapterApp(); }); test('ending request on page frontmatter', async () => { - const res = await app.render(new Request('https://example.com/')); + const res = await app.render(new Request('https://example.com/')); - expect(res.headers.get('Content-Type')).toEqual('application/json'); + expect(res.headers.get('Content-Type')).toEqual('application/json'); - const content = await res.json(); - expect(content).toEqual({ cutShort: true }); + const content = await res.json(); + expect(content).toEqual({ cutShort: true }); }); diff --git a/packages/inline-mod/CHANGELOG.md b/packages/inline-mod/CHANGELOG.md index 2665ecc4..022c6fe0 100644 --- a/packages/inline-mod/CHANGELOG.md +++ b/packages/inline-mod/CHANGELOG.md @@ -1,5 +1,12 @@ # @inox-tools/inline-mod +## 1.5.1 + +### Patch Changes + +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 + ## 1.5.0 ### Minor Changes diff --git a/packages/inline-mod/package.json b/packages/inline-mod/package.json index 8d997e52..53379811 100644 --- a/packages/inline-mod/package.json +++ b/packages/inline-mod/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/inline-mod", - "version": "1.5.0", + "version": "1.5.1", "description": "Define a virtual module inline with any reference to buildtime values", "keywords": [ "vite-plugin" diff --git a/packages/modular-station/CHANGELOG.md b/packages/modular-station/CHANGELOG.md index 24b46742..26540340 100644 --- a/packages/modular-station/CHANGELOG.md +++ b/packages/modular-station/CHANGELOG.md @@ -1,5 +1,12 @@ # @inox-tools/modular-station +## 0.3.1 + +### Patch Changes + +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 + ## 0.3.0 ### Minor Changes diff --git a/packages/modular-station/package.json b/packages/modular-station/package.json index cd00bf9e..e0742a9a 100644 --- a/packages/modular-station/package.json +++ b/packages/modular-station/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/modular-station", - "version": "0.3.0", + "version": "0.3.1", "description": "Simplifying Astro integrations with a flexible docking system.", "keywords": [ "astro-integration", diff --git a/packages/request-nanostores/CHANGELOG.md b/packages/request-nanostores/CHANGELOG.md index 08ef97a7..607b9fa0 100644 --- a/packages/request-nanostores/CHANGELOG.md +++ b/packages/request-nanostores/CHANGELOG.md @@ -1,5 +1,13 @@ # @inox-tools/request-nanostores +## 0.1.2 + +### Patch Changes + +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 + - @inox-tools/request-state@0.1.2 + ## 0.1.1 ### Patch Changes diff --git a/packages/request-nanostores/package.json b/packages/request-nanostores/package.json index 1dc05e87..783e8e6f 100644 --- a/packages/request-nanostores/package.json +++ b/packages/request-nanostores/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/request-nanostores", - "version": "0.1.1", + "version": "0.1.2", "description": "Make your Nanostores concurrent safe and shared from server to client", "keywords": [ "astro-integration", diff --git a/packages/request-state/CHANGELOG.md b/packages/request-state/CHANGELOG.md index bacf088f..fbbab82a 100644 --- a/packages/request-state/CHANGELOG.md +++ b/packages/request-state/CHANGELOG.md @@ -1,5 +1,12 @@ # @inox-tools/request-state +## 0.1.2 + +### Patch Changes + +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 + ## 0.1.1 ### Patch Changes diff --git a/packages/request-state/package.json b/packages/request-state/package.json index 8fc90713..be08d41a 100644 --- a/packages/request-state/package.json +++ b/packages/request-state/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/request-state", - "version": "0.1.1", + "version": "0.1.2", "description": "Shared request state between server and client", "keywords": [ "astro-integration", diff --git a/packages/runtime-logger/CHANGELOG.md b/packages/runtime-logger/CHANGELOG.md index d834f95d..faa162af 100644 --- a/packages/runtime-logger/CHANGELOG.md +++ b/packages/runtime-logger/CHANGELOG.md @@ -1,5 +1,13 @@ # @inox-tools/runtime-logger +## 0.3.2 + +### Patch Changes + +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 + - @inox-tools/modular-station@0.3.1 + ## 0.3.1 ### Patch Changes diff --git a/packages/runtime-logger/package.json b/packages/runtime-logger/package.json index 688a5702..5b99cffd 100644 --- a/packages/runtime-logger/package.json +++ b/packages/runtime-logger/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/runtime-logger", - "version": "0.3.1", + "version": "0.3.2", "description": "Expose Astro Integration Logger at runtime for consistent output", "keywords": [ "astro-integration", diff --git a/packages/sitemap-ext/CHANGELOG.md b/packages/sitemap-ext/CHANGELOG.md index a28aaa6f..12c022ff 100644 --- a/packages/sitemap-ext/CHANGELOG.md +++ b/packages/sitemap-ext/CHANGELOG.md @@ -1,5 +1,11 @@ # @inox-tools/sitemap-ext +## 0.3.4 + +### Patch Changes + +- @inox-tools/aik-route-config@0.7.3 + ## 0.3.3 ### Patch Changes diff --git a/packages/sitemap-ext/package.json b/packages/sitemap-ext/package.json index 1b0f971d..59dafd89 100644 --- a/packages/sitemap-ext/package.json +++ b/packages/sitemap-ext/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/sitemap-ext", - "version": "0.3.3", + "version": "0.3.4", "description": "Higher level extension over Astro's official sitemap integration", "keywords": [ "sitemap", diff --git a/packages/star-warp/CHANGELOG.md b/packages/star-warp/CHANGELOG.md index 0187267b..ccfc267e 100644 --- a/packages/star-warp/CHANGELOG.md +++ b/packages/star-warp/CHANGELOG.md @@ -1,5 +1,12 @@ # @inox-tools/star-warp +## 0.1.2 + +### Patch Changes + +- Updated dependencies [b53264e] + - @inox-tools/utils@0.1.4 + ## 0.1.1 ### Patch Changes diff --git a/packages/star-warp/package.json b/packages/star-warp/package.json index 3b2d492c..f9d9f233 100644 --- a/packages/star-warp/package.json +++ b/packages/star-warp/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/star-warp", - "version": "0.1.1", + "version": "0.1.2", "description": "Warp-drive search for Astro sites using Pagefind", "keywords": [ "astro-integration", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 2b968ad9..606748a0 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,11 @@ # @inox-tools/utils +## 0.1.4 + +### Patch Changes + +- b53264e: Add `MaybePromise`, `MaybeFactory` and `MaybeThunk` utility types. + ## 0.1.3 ### Patch Changes diff --git a/packages/utils/package.json b/packages/utils/package.json index e86daa1f..041f5cb1 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/utils", - "version": "0.1.3", + "version": "0.1.4", "description": "A collection of utilities used throughout Inox Tools", "keywords": [ "utilities"