Skip to content

Commit

Permalink
Removes the deprecation warning for import.meta.globEager (#32)
Browse files Browse the repository at this point in the history
* updating the demo to astro@0.25

* removing deprecated `assert` from import.meta.glob call

* why did github-bot remove the keywords in 73e4b9b?

* chore: adding changeset

* realized this wouldn't be compatible with older versions of Astro, making this a minor release
  • Loading branch information
Tony Sullivan committed Apr 5, 2022
1 parent 73e4b9b commit 4cfc1ba
Show file tree
Hide file tree
Showing 6 changed files with 1,268 additions and 98 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-swans-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro-icon": minor
---

Removes the deprecation warning for assert in import.meta.globEager
14 changes: 3 additions & 11 deletions demo/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
// Full Astro Configuration API Documentation:
// https://docs.astro.build/reference/configuration-reference

// @type-check enabled!
// VSCode and other TypeScript-enabled text editors will provide auto-completion,
// helpful tooltips, and warnings if your exported object is invalid.
// You can disable this by removing "@ts-check" and `@type` comments below.
import { defineConfig } from 'astro/config';

// @ts-check
export default /** @type {import('astro').AstroUserConfig} */ ({
// Comment out "renderers: []" to enable Astro's default component support.
renderers: [],
});
// https://astro.build/config
export default defineConfig({});
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "astro preview"
},
"devDependencies": {
"astro": "^0.23.0-next.4",
"astro": "^0.25.4",
"astro-icon": "0.6.1"
},
"dependencies": {
Expand Down
6 changes: 1 addition & 5 deletions packages/core/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,7 @@ ${contents}`
filepath = `/src/icons/${name}.svg`;

try {
const files = import.meta.globEager(`/src/icons/**/*.svg`, {
assert: {
type: "raw",
},
});
const files = import.meta.globEager(`/src/icons/**/*.svg`, { as: "raw" });

if (!(filepath in files)) {
throw new Error(`Could not find the file "${filepath}"`);
Expand Down
8 changes: 6 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
},
"keywords": [
"astro",
"astro-component",
"image",
"images",
"icon",
"svg",
"svgo"
"icons",
"iconify",
"optimization"
],
"repository": {
"type": "git",
Expand Down
Loading

1 comment on commit 4cfc1ba

@vercel
Copy link

@vercel vercel bot commented on 4cfc1ba Apr 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

api-astroicon – ./packages/service

api-astroicon-git-main-nmoo.vercel.app
api.astroicon.dev
api-astroicon-nmoo.vercel.app

Please sign in to comment.