diff --git a/packages/domain-expansion/.changeset/README.md b/packages/domain-expansion/.changeset/README.md
deleted file mode 100644
index e5b6d8d..0000000
--- a/packages/domain-expansion/.changeset/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Changesets
-
-Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
-with multi-package repos, or single-package repos to help you version and publish your code. You can
-find the full documentation for it [in our repository](https://github.com/changesets/changesets)
-
-We have a quick list of common questions to get you started engaging with this project in
-[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
diff --git a/packages/domain-expansion/.changeset/config.json b/packages/domain-expansion/.changeset/config.json
deleted file mode 100644
index 2da19d4..0000000
--- a/packages/domain-expansion/.changeset/config.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
- "changelog": "@changesets/cli/changelog",
- "commit": false,
- "fixed": [],
- "linked": [],
- "access": "public",
- "baseBranch": "main",
- "updateInternalDependencies": "patch",
- "ignore": [
- "@domain-expansion-test/*",
- "docs"
- ]
-}
diff --git a/packages/domain-expansion/.github/renovate.json b/packages/domain-expansion/.github/renovate.json
deleted file mode 100644
index 6cc37d1..0000000
--- a/packages/domain-expansion/.github/renovate.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
- "extends": ["config:recommended"],
- "dependencyDashboard": true,
- "lockFileMaintenance": {
- "enabled": true
- },
- "postUpdateOptions": ["pnpmDedupe"],
- "packageRules": [
- {
- "groupName": "all dependencies",
- "groupSlug": "all",
- "matchPackagePatterns": ["*"],
- "schedule": ["before 4am on Monday"],
- "rangeStrategy": "bump"
- }
- ],
- "ignoreDeps": ["node"]
-}
diff --git a/packages/domain-expansion/.github/workflows/changesets.yml b/packages/domain-expansion/.github/workflows/changesets.yml
deleted file mode 100644
index dbde33a..0000000
--- a/packages/domain-expansion/.github/workflows/changesets.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-name: Surface PR Changesets
-
-on: pull_request
-
-permissions:
- pull-requests: write
- checks: write
- statuses: write
-
-jobs:
- check:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- - name: Get changed files in the .changeset folder
- id: changed-files
- uses: tj-actions/changed-files@v35
- with:
- files: |
- .changeset/**/*.md
-
- - name: Check if any changesets contain minor or major changes
- id: check
- run: |
- echo "Checking for changesets marked as minor or major"
- echo "found=false" >> $GITHUB_OUTPUT
-
- regex="[\"']astro[\"']: (minor|major)"
- for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
- if [[ $(cat $file) =~ $regex ]]; then
- version="${BASH_REMATCH[1]}"
- echo "version=$version" >> $GITHUB_OUTPUT
- echo "found=true" >> $GITHUB_OUTPUT
- echo "$file has a $version release tag"
- fi
- done
-
- - name: Add label
- uses: actions/github-script@v6
- if: steps.check.outputs.found == 'true'
- env:
- issue_number: ${{ github.event.number }}
- with:
- script: |
- github.rest.issues.addLabels({
- issue_number: process.env.issue_number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- labels: ['semver: ${{ steps.check.outputs.version }}']
- });
diff --git a/packages/domain-expansion/.github/workflows/ci.yml b/packages/domain-expansion/.github/workflows/ci.yml
deleted file mode 100644
index ab92a6c..0000000
--- a/packages/domain-expansion/.github/workflows/ci.yml
+++ /dev/null
@@ -1,147 +0,0 @@
-name: CI
-
-on:
- workflow_dispatch:
- push:
- branches:
- - main
- merge_group:
- pull_request:
- paths-ignore:
- - "**/*.md"
- - ".github/ISSUE_TEMPLATE/**"
-
-# Automatically cancel older in-progress jobs on the same branch
-concurrency:
- group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
- cancel-in-progress: true
-
-defaults:
- run:
- shell: bash
-
-env:
- FORCE_COLOR: true
- ASTRO_TELEMETRY_DISABLED: true
- # 7 GiB by default on GitHub, setting to 6 GiB
- # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
- NODE_OPTIONS: --max-old-space-size=6144
-
-jobs:
- # Build primes out Turbo build cache and pnpm cache
- build:
- name: "Build - Node ${{ matrix.NODE_VERSION }}"
- runs-on: ubuntu-latest
- timeout-minutes: 3
- strategy:
- matrix:
- NODE_VERSION: [20, 22]
- fail-fast: false
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v2
-
- - name: Setup node@${{ matrix.NODE_VERSION }}
- uses: actions/setup-node@main
- with:
- node-version: ${{ matrix.NODE_VERSION }}
- cache: "pnpm"
-
- - name: Install dependencies
- run: pnpm install
-
- - name: Build Packages
- run: pnpm run package:build
-
- lint:
- name: Lint
- runs-on: ubuntu-latest
- timeout-minutes: 5
- needs: build
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v2
-
- - name: Setup Node
- uses: actions/setup-node@v4
- with:
- node-version: 22
- cache: "pnpm"
-
- - name: Install dependencies
- run: pnpm install
-
- - name: Format Check
- run: pnpm run lint
-
- test:
- name: "Test: Node ${{ matrix.NODE_VERSION }}"
- runs-on: ubuntu-latest
- timeout-minutes: 10
- needs: build
- strategy:
- matrix:
- NODE_VERSION: [20, 22]
- fail-fast: false
- env:
- NODE_VERSION: ${{ matrix.NODE_VERSION }}
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Cache turbo build setup
- uses: actions/cache@v4
- with:
- path: .turbo
- key: ${{ runner.os }}-${{ matrix.NODE_VERSION }}-turbo-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-${{ matrix.NODE_VERSION }}-turbo-
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v2
-
- - name: Setup node@${{ matrix.NODE_VERSION }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.NODE_VERSION }}
- cache: "pnpm"
-
- - name: Install dependencies
- run: pnpm install
-
- - name: Build Packages
- run: pnpm run package:build
-
- - name: Test
- run: pnpm test
- working-directory: package
-
- duplicated-packages:
- name: Check for duplicated dependencies
- runs-on: ubuntu-latest
- env:
- NODE_VERSION: 22
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v2
-
- - name: Setup node@${{ matrix.NODE_VERSION }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.NODE_VERSION }}
- cache: "pnpm"
-
- - name: Install dependencies
- run: pnpm install
-
- - name: Check duplicated dependencies
- run: pnpm dedupe --prefer-offline --check
diff --git a/packages/domain-expansion/.github/workflows/preview-mode.yml b/packages/domain-expansion/.github/workflows/preview-mode.yml
deleted file mode 100644
index 5d9b742..0000000
--- a/packages/domain-expansion/.github/workflows/preview-mode.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-name: Preview mode
-
-on:
- pull_request:
- types:
- - synchronize
- - opened
- - reopened
-
-env:
- FORCE_COLOR: true
-
-jobs:
- no-preview:
- name: Block Preview mode
- runs-on: ubuntu-latest
- permissions:
- contents: read
- id-token: write
- issues: write
- pull-requests: write
- steps:
- - uses: actions/checkout@v4
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v2
-
- - name: Setup Node
- uses: actions/setup-node@v4
- with:
- node-version: 22
- cache: "pnpm"
-
- - name: Install dependencies
- run: pnpm install
-
- - name: Check for preview mode
- # Fails if in preview mode
- run: pnpm changeset pre enter foo
-
- - name: Remove Preview Label
- uses: actions-ecosystem/action-remove-labels@v1
- with:
- labels: preview
-
- - name: Add Label
- if: ${{ failure() }}
- uses: actions-ecosystem/action-add-labels@v1
- with:
- labels: preview
diff --git a/packages/domain-expansion/.github/workflows/release.yml b/packages/domain-expansion/.github/workflows/release.yml
deleted file mode 100644
index fcbc9bf..0000000
--- a/packages/domain-expansion/.github/workflows/release.yml
+++ /dev/null
@@ -1,68 +0,0 @@
-name: Release
-
-on:
- push:
- branches:
- - main
- pull_request:
- types:
- - opened
- - reopened
- - synchronize
- - labeled
-
-defaults:
- run:
- shell: bash
-
-env:
- FORCE_COLOR: true
-
-jobs:
- changelog:
- name: Changelog PR or Release
- runs-on: ubuntu-latest
- if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'preview') }}
- permissions:
- contents: write
- id-token: write
- steps:
- - uses: actions/checkout@v4
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v2
-
- - name: Setup Node
- uses: actions/setup-node@v4
- with:
- node-version: 22
- cache: "pnpm"
- registry-url: 'https://registry.npmjs.org'
-
- - name: Install dependencies
- run: pnpm install
-
- - name: Build Packages
- run: pnpm run package:build
-
- - name: Publish preview
- if: ${{ contains(github.event.pull_request.labels.*.name, 'preview') }}
- run: pnpm exec changeset publish
- env:
- # Use Node auth from above
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
-
- - name: Create Release Pull Request or Publish
- id: changesets
- if: ${{ github.event_name == 'push' }}
- uses: changesets/action@v1
- with:
- # Note: pnpm install after versioning is necessary to refresh lockfile
- version: pnpm run version
- publish: pnpm exec changeset publish
- commit: '[ci] release'
- title: '[ci] release'
- env:
- GITHUB_TOKEN: ${{ secrets.COMMIT_TOKEN }}
- # Needs access to publish to npm
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/packages/domain-expansion/.github/workflows/todo-tracking.yml b/packages/domain-expansion/.github/workflows/todo-tracking.yml
deleted file mode 100644
index 5feb5fe..0000000
--- a/packages/domain-expansion/.github/workflows/todo-tracking.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: TODO Tracking
-
-on:
- push:
- # branches: [main]
-
-permissions:
- issues: read
- repository-projects: read
- contents: read
-
-jobs:
- track-todos:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Run tdg-github-action
- uses: ribtoks/tdg-github-action@master
- with:
- TOKEN: ${{ secrets.GITHUB_TOKEN }}
- REPO: ${{ github.repository }}
- SHA: ${{ github.sha }}
- REF: ${{ github.ref }}
- DRY_RUN: false
- COMMENT_ON_ISSUES: true
diff --git a/packages/domain-expansion/.husky/pre-commit b/packages/domain-expansion/.husky/pre-commit
deleted file mode 100644
index 9c1cf54..0000000
--- a/packages/domain-expansion/.husky/pre-commit
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-node_modules/.bin/lint-staged
diff --git a/packages/domain-expansion/.vscode/settings.json b/packages/domain-expansion/.vscode/settings.json
deleted file mode 100644
index a91ae0b..0000000
--- a/packages/domain-expansion/.vscode/settings.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "editor.defaultFormatter": "prettier",
- "editor.gotoLocation.multipleDefinitions": "goto"
-}
diff --git a/packages/domain-expansion/package-lock.json b/packages/domain-expansion/package-lock.json
index 1ec9436..ba9d679 100644
--- a/packages/domain-expansion/package-lock.json
+++ b/packages/domain-expansion/package-lock.json
@@ -343,6 +343,13 @@
"fs-extra": "^8.1.0"
}
},
+ "node_modules/@manypkg/find-root/node_modules/@types/node": {
+ "version": "12.20.55",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
+ "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@manypkg/find-root/node_modules/fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
@@ -434,11 +441,16 @@
}
},
"node_modules/@types/node": {
- "version": "12.20.55",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
- "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
+ "version": "24.3.3",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.3.tgz",
+ "integrity": "sha512-GKBNHjoNw3Kra1Qg5UXttsY5kiWMEfoHq2TmXb+b1rcm6N7B3wTrFYIf/oSZ1xNQ+hVVijgLkiDZh7jRRsh+Gw==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "undici-types": "~7.10.0"
+ }
},
"node_modules/ansi-colors": {
"version": "4.1.3",
@@ -1920,6 +1932,15 @@
"node": ">=8.0"
}
},
+ "node_modules/undici-types": {
+ "version": "7.10.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz",
+ "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "peer": true
+ },
"node_modules/universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
diff --git a/packages/imagetools/plugin/hooks/load.js b/packages/imagetools/plugin/hooks/load.js
index f09d5b7..f5430ce 100644
--- a/packages/imagetools/plugin/hooks/load.js
+++ b/packages/imagetools/plugin/hooks/load.js
@@ -20,26 +20,18 @@ export default async function load(id) {
const { search, searchParams } = fileURL;
- id = id.replace(search, "");
-
+ id = id.replace(search, "");
const ext = path.extname(id).slice(1);
-
if (!supportedImageTypes.includes(ext)) return null;
- debugger
-
const { default: astroViteConfigs } = await import(
// @ts-ignore
"../../astroViteConfigs.js"
);
-
const { environment, projectBase, assetFileNames } = astroViteConfigs;
-
const src = await getSrcPath(id);
-
const rootRelativePosixSrc = path.posix.normalize(
path.relative("", src).split(path.sep).join(path.posix.sep)
);
-
const getHash = (width) =>
objectHash(
{ width, options, rootRelativePosixSrc },
diff --git a/packages/imagetools_3/api/utils/getImage.js b/packages/imagetools_3/api/utils/getImage.js
index c857a87..c3f8aef 100644
--- a/packages/imagetools_3/api/utils/getImage.js
+++ b/packages/imagetools_3/api/utils/getImage.js
@@ -50,7 +50,7 @@ export default async function ({
imageWidth,
imageHeight,
imageFormat
- } = await getProcessedImage(src, transformConfigs, { skipCache: true });
+ } = await getProcessedImage(src, transformConfigs, { skipCache: false });
src = path;
@@ -114,9 +114,7 @@ export default async function ({
return returnObject;
} catch (error) {
- console.error(`Error processing images:: ${src}`, error, error.stack);
- debugger
-
+ console.error(`Error processing images:: ${src}`, error, error.stack);
throw error;
}
}
diff --git a/packages/imagetools_3/api/utils/getProcessedImage.js b/packages/imagetools_3/api/utils/getProcessedImage.js
index 08a86b3..7523507 100644
--- a/packages/imagetools_3/api/utils/getProcessedImage.js
+++ b/packages/imagetools_3/api/utils/getProcessedImage.js
@@ -55,12 +55,18 @@ export default async function getProcessedImage(
let path = src.replace(/\\/g, `/`);
+ // @todo : remove this
let imagePath = isRemote ? join(cwd, path) : await getSrcPath(src);
-
+ if(!existsSync(imagePath)) {
+ console.log("getProcessedImage::imagePath does not exist", imagePath);
+ return {
+ path,
+ base,
+ rest,
+ };
+ }
const imageBuffer = await fs.readFile(imagePath);
-
- const { image, imageWidth, imageHeight, imageFormat } =
- await getImageDetails(imageBuffer, width, height, aspect, skipCache);
+ const { image, imageWidth, imageHeight, imageFormat } = await getImageDetails(imageBuffer, width, height, aspect);
return {
path,
diff --git a/packages/imagetools_3/api/utils/getSrcset.js b/packages/imagetools_3/api/utils/getSrcset.js
index 75f411d..a9337ed 100644
--- a/packages/imagetools_3/api/utils/getSrcset.js
+++ b/packages/imagetools_3/api/utils/getSrcset.js
@@ -27,9 +27,9 @@ export default async function getSrcset(
: "";
const [cleanSrc] = src.split("?");
-
const id = `${cleanSrc}?${params.slice(1)}`;
- const fullPath = await getSrcPath(cleanSrc);
+ // @todo : remove this
+ const fullPath = await getSrcPath(id);
const { default: load } = await import("../../plugin/hooks/load.js");
// @ts-ignore
let srcset = null
diff --git a/packages/imagetools_3/astroViteConfigs.js b/packages/imagetools_3/astroViteConfigs.js
index af59ac4..8b2d327 100644
--- a/packages/imagetools_3/astroViteConfigs.js
+++ b/packages/imagetools_3/astroViteConfigs.js
@@ -1,12 +1,12 @@
export default {
- "environment": "build",
+ "environment": "dev",
"isSsrBuild": false,
"projectBase": "",
- "publicDir": "C:\\Users\\zx\\Desktop\\polymech\\site-min\\public\\",
- "rootDir": "C:\\Users\\zx\\Desktop\\polymech\\site-min\\",
- "mode": "production",
- "outDir": "C:\\Users\\zx\\Desktop\\polymech\\site-min\\dist\\",
- "assetsDir": "_astro",
+ "publicDir": "C:\\Users\\zx\\Desktop\\polymech\\site2\\public\\",
+ "rootDir": "C:\\Users\\zx\\Desktop\\polymech\\site2\\",
+ "mode": "dev",
+ "outDir": "dist",
+ "assetsDir": "/_astro",
"sourcemap": false,
"assetFileNames": "/_astro/[name]@[width].[hash][extname]"
}
\ No newline at end of file
diff --git a/packages/imagetools_3/components/Img.astro b/packages/imagetools_3/components/Img.astro
index 36c03ab..53cc055 100644
--- a/packages/imagetools_3/components/Img.astro
+++ b/packages/imagetools_3/components/Img.astro
@@ -2,9 +2,18 @@
import renderImg from "../api/renderImg.js";
import type { ImgConfigOptions } from "../types.d";
-declare interface Props extends ImgConfigOptions {}
+declare interface Props extends ImgConfigOptions {
+ s?: string;
+}
-const { link, style, img } = await renderImg(Astro.props as Props);
+const { s, ...rest } = Astro.props as Props;
+
+if (s) {
+ const separator = rest.src.includes("?") ? "&" : "?";
+ rest.src = `${rest.src}${separator}s=${s}`;
+}
+
+const { link, style, img } = await renderImg(rest);
---