@studiocms/cfetch 0.0.1 → 0.1.1

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.
package/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # `@studiocms/cfetch`
2
2
 
3
+ ![Readme's Banner](https://github.com/withstudiocms/cfetch/blob/main/assets/cfetch-banner.png)
4
+
5
+ [![NPM Version](https://img.shields.io/npm/v/@studiocms/cfetch?logo=npm)](https://npm.im/@studiocms/cfetch)
6
+ [![Formatted with Biome](https://img.shields.io/badge/Formatted_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev/)
7
+ [![Built with Astro](https://astro.badg.es/v2/built-with-astro/tiny.svg)](https://astro.build)
8
+
3
9
  This is an [Astro integration](https://docs.astro.build/en/guides/integrations-guide/) that provides a cacheable fetch function for Astro SSR
4
10
 
5
11
  ## Usage
@@ -58,7 +64,7 @@ You can import the cachedFetch function anywhere you would use a normal `fetch`
58
64
 
59
65
  ```astro
60
66
  ---
61
- import { cFetch } from 'cached:fetch';
67
+ import { cFetch } from 'c:fetch';
62
68
 
63
69
  const response = await cFetch(
64
70
  'https://example.com', // string | URL | Request
@@ -74,7 +80,7 @@ If you are also wanting the other available metadata (such as `lastChecked` valu
74
80
 
75
81
  ```astro
76
82
  ---
77
- import { cFetch } from 'cached:fetch';
83
+ import { cFetch } from 'c:fetch';
78
84
 
79
85
  const { lastCheck, data: response } = await cFetch(
80
86
  'https://example.com', // string | URL | Request
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { addVirtualImports, createResolver } from "./utils/integration.js";
2
1
  import { defaultConfig } from "./consts.js";
2
+ import { addVirtualImports, createResolver } from "./utils/integration.js";
3
3
  function astroCache(opts) {
4
4
  const name = "@studiocms/cfetch";
5
5
  const { resolve } = createResolver(import.meta.url);
package/dist/wrappers.js CHANGED
@@ -1,5 +1,5 @@
1
- import isOlderThan from "./utils/isOlderThan.js";
2
1
  import { defaultConfig as _config } from "./consts.js";
2
+ import isOlderThan from "./utils/isOlderThan.js";
3
3
  const defaultConfig = await import("virtual:cfetch/config").then((mod) => {
4
4
  return mod.default;
5
5
  }).catch(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiocms/cfetch",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "Astro integration that allows you to have a cached fetch function in your Astro SSR project.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://studiocms.dev",