From 13e7f0d8709beaabde0f5669b52630f94ff0d505 Mon Sep 17 00:00:00 2001
From: Ivan Porto Wigner <47715589+iivvaannxx@users.noreply.github.com>
Date: Wed, 13 Mar 2024 15:54:10 +0000
Subject: [PATCH 1/9] chore: removed package-lock.json
---
package-lock.json | 30 ------------------------------
1 file changed, 30 deletions(-)
delete mode 100644 package-lock.json
diff --git a/package-lock.json b/package-lock.json
deleted file mode 100644
index 3f67905a..00000000
--- a/package-lock.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "astro-qwik",
- "version": "0.0.1",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "": {
- "name": "astro-qwik",
- "version": "0.0.1",
- "devDependencies": {
- "@types/node": "^20.8.9"
- }
- },
- "node_modules/@types/node": {
- "version": "20.8.9",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.9.tgz",
- "integrity": "sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg==",
- "dev": true,
- "dependencies": {
- "undici-types": "~5.26.4"
- }
- },
- "node_modules/undici-types": {
- "version": "5.26.5",
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
- "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
- "dev": true
- }
- }
-}
From 9fe76e60f0046299d97a122602349017a38c6200 Mon Sep 17 00:00:00 2001
From: Ivan Porto Wigner <47715589+iivvaannxx@users.noreply.github.com>
Date: Wed, 13 Mar 2024 15:56:18 +0000
Subject: [PATCH 2/9] docs: update contributing.md to clarify pnpm usage
---
contributing.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/contributing.md b/contributing.md
index 5a0a02a8..42d98f52 100644
--- a/contributing.md
+++ b/contributing.md
@@ -12,7 +12,9 @@ You can quickly get up and running with the playground by doing the following:
2. Once the dependencies are installed, you can build by running `pnpm build` in `apps/astro-demo`
-That's it!
+That's it!
+
+Note that we only use pnpm. Please don't make any PR's that introduce lock files of other package managers.
**dev:**
From 93b1ff322f51ab18a1afb6afb8d29505ac4fb4ee Mon Sep 17 00:00:00 2001
From: Ivan Porto Wigner <47715589+iivvaannxx@users.noreply.github.com>
Date: Wed, 13 Mar 2024 17:00:07 +0000
Subject: [PATCH 3/9] chore: added biome for linting and formatting.
---
.vscode/extensions.json | 3 ++
.vscode/settings.json | 15 +++++++
biome.json | 94 ++++++++++++++++++++++++++++++++++++++++
package.json | 11 +++--
pnpm-lock.yaml | 95 +++++++++++++++++++++++++++++++++++++++++
5 files changed, 215 insertions(+), 3 deletions(-)
create mode 100644 .vscode/extensions.json
create mode 100644 .vscode/settings.json
create mode 100644 biome.json
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 00000000..f95e7286
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,3 @@
+{
+ "recommendations": ["biomejs.biome", "usernamehw.errorlens", "astro-build.astro-vscode"]
+}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..e96649b7
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,15 @@
+{
+ "[javascript][typescript][json][jsonc][javascriptreact][typescriptreact]": {
+ "editor.defaultFormatter": "biomejs.biome"
+ },
+
+ "editor.formatOnSave": true,
+ "editor.codeActionsOnSave": {
+ "quickfix.biome": "explicit",
+ "source.organizeImports.biome": "always"
+ },
+
+ // Prevent conflicts between tools.
+ "eslint.enable": false,
+ "prettier.enable": false
+}
diff --git a/biome.json b/biome.json
new file mode 100644
index 00000000..9b8bf438
--- /dev/null
+++ b/biome.json
@@ -0,0 +1,94 @@
+{
+ "$schema": "https://biomejs.dev/schemas/1.6.1/schema.json",
+ "files": {
+ "ignore": [".git", "build", "dist", "node_modules"]
+ },
+
+ "formatter": {
+ "enabled": true,
+ "formatWithErrors": false,
+ "indentStyle": "space",
+ "lineEnding": "lf",
+ "lineWidth": 90
+ },
+
+ "javascript": {
+ "formatter": {
+ "arrowParentheses": "always",
+ "bracketSameLine": false,
+ "bracketSpacing": true,
+ "enabled": true,
+ "jsxQuoteStyle": "double",
+ "quoteProperties": "preserve",
+ "quoteStyle": "double",
+ "semicolons": "always",
+ "trailingComma": "none"
+ }
+ },
+
+ "json": {
+ "formatter": {
+ "enabled": true
+ }
+ },
+
+ "linter": {
+ "enabled": true,
+ "rules": {
+ "a11y": {
+ "recommended": true
+ },
+ "complexity": {
+ "recommended": true,
+ "useSimplifiedLogicExpression": "warn"
+ },
+ "correctness": {
+ "noUndeclaredVariables": "error",
+ "recommended": true
+ },
+ "performance": {
+ "recommended": true
+ },
+ "recommended": true,
+ "style": {
+ "recommended": true,
+ "useBlockStatements": "error",
+ "useCollapsedElseIf": "warn",
+ "useNamingConvention": {
+ "level": "error",
+ "options": {
+ "strictCase": false
+ }
+ },
+ "useShorthandArrayType": "error",
+ "useShorthandAssign": "error",
+ "useSingleCaseStatement": "error"
+ },
+ "suspicious": {
+ "noApproximativeNumericConstant": "error",
+ "noMisrefactoredShorthandAssign": "warn",
+ "recommended": true
+ }
+ }
+ },
+
+ "organizeImports": {
+ "enabled": true
+ },
+
+ "overrides": [
+ {
+ "include": [".vscode/**"],
+ "json": {
+ "parser": {
+ "allowComments": true
+ }
+ }
+ }
+ ],
+
+ "vcs": {
+ "clientKind": "git",
+ "enabled": true
+ }
+}
diff --git a/package.json b/package.json
index 7412132a..f0dbb949 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,13 @@
{
"name": "qwikdev-astro",
"version": "0.0.0",
- "scripts": {},
- "dependencies": {
- "@changesets/cli": "^2.27.1"
+ "scripts": {
+ "check": "biome check --no-errors-on-unmatched --files-ignore-unknown=true .",
+ "format": "biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true ."
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "@changesets/cli": "^2.27.1",
+ "@biomejs/biome": "1.6.1"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index fd88a67f..17d6b0ab 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -11,6 +11,10 @@ importers:
'@changesets/cli':
specifier: ^2.27.1
version: 2.27.1
+ devDependencies:
+ '@biomejs/biome':
+ specifier: 1.6.1
+ version: 1.6.1
apps/astro-demo:
dependencies:
@@ -430,6 +434,94 @@ packages:
'@babel/helper-validator-identifier': 7.22.20
to-fast-properties: 2.0.0
+ /@biomejs/biome@1.6.1:
+ resolution: {integrity: sha512-SILQvA2S0XeaOuu1bivv6fQmMo7zMfr2xqDEN+Sz78pGbAKZnGmg0emsXjQWoBY/RVm9kPCgX+aGEpZZTYaM7w==}
+ engines: {node: '>=14.*'}
+ hasBin: true
+ requiresBuild: true
+ optionalDependencies:
+ '@biomejs/cli-darwin-arm64': 1.6.1
+ '@biomejs/cli-darwin-x64': 1.6.1
+ '@biomejs/cli-linux-arm64': 1.6.1
+ '@biomejs/cli-linux-arm64-musl': 1.6.1
+ '@biomejs/cli-linux-x64': 1.6.1
+ '@biomejs/cli-linux-x64-musl': 1.6.1
+ '@biomejs/cli-win32-arm64': 1.6.1
+ '@biomejs/cli-win32-x64': 1.6.1
+ dev: true
+
+ /@biomejs/cli-darwin-arm64@1.6.1:
+ resolution: {integrity: sha512-KlvY00iB9T/vFi4m/GXxEyYkYnYy6aw06uapzUIIdiMMj7I/pmZu7CsZlzWdekVD0j+SsQbxdZMsb0wPhnRSsg==}
+ engines: {node: '>=14.*'}
+ cpu: [arm64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/cli-darwin-x64@1.6.1:
+ resolution: {integrity: sha512-jP4E8TXaQX5e3nvRJSzB+qicZrdIDCrjR0sSb1DaDTx4JPZH5WXq/BlTqAyWi3IijM+IYMjWqAAK4kOHsSCzxw==}
+ engines: {node: '>=14.*'}
+ cpu: [x64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/cli-linux-arm64-musl@1.6.1:
+ resolution: {integrity: sha512-YdkDgFecdHJg7PJxAMaZIixVWGB6St4yH08BHagO0fEhNNiY8cAKEVo2mcXlsnEiTMpeSEAY9VxLUrVT3IVxpw==}
+ engines: {node: '>=14.*'}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/cli-linux-arm64@1.6.1:
+ resolution: {integrity: sha512-nxD1UyX3bWSl/RSKlib/JsOmt+652/9yieogdSC/UTLgVCZYOF7u8L/LK7kAa0Y4nA8zSPavAQTgko7mHC2ObA==}
+ engines: {node: '>=14.*'}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/cli-linux-x64-musl@1.6.1:
+ resolution: {integrity: sha512-aSISIDmxq04NNy7tm4x9rBk2vH0ub2VDIE4outEmdC2LBtEJoINiphlZagx/FvjbsqUfygent9QUSn0oREnAXg==}
+ engines: {node: '>=14.*'}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/cli-linux-x64@1.6.1:
+ resolution: {integrity: sha512-BYAzenlMF3QdngjNFw9QVBXKGNzeecqwF3pwDgUGEvU7OJpn1/lyVkJVxYPtVGRNdjQ9e6l/s8NjKuBpW/ZR4Q==}
+ engines: {node: '>=14.*'}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/cli-win32-arm64@1.6.1:
+ resolution: {integrity: sha512-/eCHQKZ1kEawUpkSuXq4urtxMsD1P1678OPG3zNKt3ru16AqqspLdO3jzBe3k74xCPYnQ36e9Yqc97Mo0qgPtg==}
+ engines: {node: '>=14.*'}
+ cpu: [arm64]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@biomejs/cli-win32-x64@1.6.1:
+ resolution: {integrity: sha512-5TUZbzBwnDLFxLVGEPsorNi6eC2Gt+z4Oei9Qvq0M/4c4/mjZ96ABgwao/tMxf4ZBr/qyy2YdvF+gX9Rc+xC0A==}
+ engines: {node: '>=14.*'}
+ cpu: [x64]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
+
/@builder.io/qwik@1.5.1(@types/node@20.10.0)(undici@5.28.0):
resolution: {integrity: sha512-xjGVH6xx/ADN+ACSfvoZQWIlN6B4bTcL1gpoijVKyx/Wed7U7QPgVq2VIJ92Vhr6Y+uKiUaoNlsuY5s4PhVQkQ==}
engines: {node: '>=16.8.0 <18.0.0 || >=18.11'}
@@ -3990,6 +4082,7 @@ packages:
/safe-buffer@5.2.1:
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
+ requiresBuild: true
/safe-regex-test@1.0.3:
resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==}
@@ -4312,6 +4405,7 @@ packages:
/string_decoder@1.3.0:
resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
+ requiresBuild: true
dependencies:
safe-buffer: 5.2.1
@@ -4710,6 +4804,7 @@ packages:
/util-deprecate@1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
+ requiresBuild: true
/validate-npm-package-license@3.0.4:
resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}
From 7fb0a1b075fda28b13c383bde18be1d9d090f6d4 Mon Sep 17 00:00:00 2001
From: Ivan Porto Wigner <47715589+iivvaannxx@users.noreply.github.com>
Date: Wed, 13 Mar 2024 17:01:03 +0000
Subject: [PATCH 4/9] chore: removed astro extension recommendation
---
.vscode/extensions.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index f95e7286..60793a3a 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,3 +1,3 @@
{
- "recommendations": ["biomejs.biome", "usernamehw.errorlens", "astro-build.astro-vscode"]
-}
\ No newline at end of file
+ "recommendations": ["biomejs.biome", "usernamehw.errorlens"]
+}
From c47446c863b782fe6f3857dc3b46d8395383d6c1 Mon Sep 17 00:00:00 2001
From: Ivan Porto Wigner <47715589+iivvaannxx@users.noreply.github.com>
Date: Wed, 13 Mar 2024 17:35:24 +0000
Subject: [PATCH 5/9] fix: some linter errors. mid process.
---
apps/astro-demo/astro.config.mjs | 9 ++-
.../src/components/qwik/counter.tsx | 4 +-
.../astro-demo/src/components/qwik/say-hi.tsx | 1 +
.../src/components/react/react-counter.tsx | 6 +-
libs/qwikdev-astro/env.d.ts | 2 +-
libs/qwikdev-astro/package.json | 7 +--
libs/qwikdev-astro/server.ts | 62 +++++++++----------
.../fs-move.d.ts | 9 ++-
libs/qwikdev-astro/src/index.ts | 10 +--
9 files changed, 54 insertions(+), 56 deletions(-)
rename libs/qwikdev-astro/src/{cutom_types => custom_types}/fs-move.d.ts (76%)
diff --git a/apps/astro-demo/astro.config.mjs b/apps/astro-demo/astro.config.mjs
index 49c2688d..429ecd01 100644
--- a/apps/astro-demo/astro.config.mjs
+++ b/apps/astro-demo/astro.config.mjs
@@ -1,4 +1,5 @@
import { defineConfig } from "astro/config";
+
import qwik from "@qwikdev/astro";
import node from "@astrojs/node";
import react from "@astrojs/react";
@@ -7,10 +8,8 @@ import react from "@astrojs/react";
export default defineConfig({
output: "server",
adapter: node({
- mode: "standalone",
+ mode: "standalone"
}),
- integrations: [
- qwik({ include: "**/qwik/*" }),
- react({ include: "**/react/*" }),
- ],
+
+ integrations: [qwik({ include: "**/qwik/*" }), react({ include: "**/react/*" })]
});
diff --git a/apps/astro-demo/src/components/qwik/counter.tsx b/apps/astro-demo/src/components/qwik/counter.tsx
index 803d90f2..329dd69b 100644
--- a/apps/astro-demo/src/components/qwik/counter.tsx
+++ b/apps/astro-demo/src/components/qwik/counter.tsx
@@ -5,7 +5,9 @@ export const Counter = component$<{ initial: number }>((props) => {
return (
<>
-
+
>
);
});
diff --git a/apps/astro-demo/src/components/qwik/say-hi.tsx b/apps/astro-demo/src/components/qwik/say-hi.tsx
index 41a8cffc..951bbd9d 100644
--- a/apps/astro-demo/src/components/qwik/say-hi.tsx
+++ b/apps/astro-demo/src/components/qwik/say-hi.tsx
@@ -3,6 +3,7 @@ import { component$, sync$ } from "@builder.io/qwik";
export const SayHi = component$(() => {
return (