diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b934bd8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22.x] + + steps: + - uses: actions/checkout@v6 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Lint + run: pnpm lint + + - name: Build + run: pnpm build + + - name: Type check + run: pnpm type-check + + - name: Test + run: pnpm test + diff --git a/package.json b/package.json index 7816170..f7cd483 100644 --- a/package.json +++ b/package.json @@ -17,19 +17,16 @@ "prepare": "husky", "lint-staged": "biome check --write --no-errors-on-unmatched" }, - "keywords": [ - "chrome-extension", - "auth", - "headers", - "sdk-kit", - "developer-tools" - ], + "keywords": ["chrome-extension", "auth", "headers", "sdk-kit", "developer-tools"], "author": "ProsDevLab", "license": "MIT", "packageManager": "pnpm@10.14.0", + "engines": { + "node": ">=22" + }, "dependencies": { "@hookform/resolvers": "^5.2.2", - "@lytics/sdk-kit": "link:../sdk-kit/packages/core", + "@lytics/sdk-kit": "^0.1.1", "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-label": "^2.1.8", "@radix-ui/react-slot": "^1.2.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9cbd49b..f1596c4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^5.2.2 version: 5.2.2(react-hook-form@7.69.0(react@19.2.3)) '@lytics/sdk-kit': - specifier: link:../sdk-kit/packages/core - version: link:../sdk-kit/packages/core + specifier: ^0.1.1 + version: 0.1.1(typescript@5.9.3) '@radix-ui/react-dialog': specifier: ^1.1.15 version: 1.1.15(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) @@ -657,6 +657,14 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@lytics/sdk-kit@0.1.1': + resolution: {integrity: sha512-IDNeiQpuTwAeCh7H8WjxApos6RN7GSe1cW9ncBs+yg9Ja9Ekcxo6xC1U5O0uR4uxrkm84TMwN8HiP8Q74xi/CA==} + peerDependencies: + typescript: '>=5.0.0' + peerDependenciesMeta: + typescript: + optional: true + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -3119,6 +3127,10 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 + '@lytics/sdk-kit@0.1.1(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 diff --git a/scripts/generate-icons.cjs b/scripts/generate-icons.cjs deleted file mode 100644 index 5d50086..0000000 --- a/scripts/generate-icons.cjs +++ /dev/null @@ -1,65 +0,0 @@ -const fs = require('node:fs'); -const path = require('node:path'); -const zlib = require('node:zlib'); - -// Simple PNG generator -const sizes = [16, 48, 128]; -const iconsDir = path.join(__dirname, '../src/icons'); - -// Create a simple colored square PNG manually -function createSimplePNG(size, color = [59, 130, 246]) { - const width = size; - const height = size; - - // PNG signature - const signature = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]); - - // IHDR chunk - const ihdr = Buffer.alloc(25); - ihdr.writeUInt32BE(13, 0); // Length - ihdr.write('IHDR', 4); - ihdr.writeUInt32BE(width, 8); - ihdr.writeUInt32BE(height, 12); - ihdr.writeUInt8(8, 16); // Bit depth - ihdr.writeUInt8(2, 17); // Color type (RGB) - ihdr.writeUInt8(0, 18); // Compression - ihdr.writeUInt8(0, 19); // Filter - ihdr.writeUInt8(0, 20); // Interlace - - const crc = zlib.crc32(ihdr.slice(4, 21)); - ihdr.writeUInt32BE(crc, 21); - - // IDAT chunk - solid blue color - const pixelData = Buffer.alloc(height * (1 + width * 3)); - for (let y = 0; y < height; y++) { - pixelData[y * (1 + width * 3)] = 0; // Filter type - for (let x = 0; x < width; x++) { - const offset = y * (1 + width * 3) + 1 + x * 3; - pixelData[offset] = color[0]; // R - pixelData[offset + 1] = color[1]; // G - pixelData[offset + 2] = color[2]; // B - } - } - - const compressed = zlib.deflateSync(pixelData); - const idat = Buffer.alloc(12 + compressed.length); - idat.writeUInt32BE(compressed.length, 0); - idat.write('IDAT', 4); - compressed.copy(idat, 8); - const idatCrc = zlib.crc32(idat.slice(4, 8 + compressed.length)); - idat.writeUInt32BE(idatCrc, 8 + compressed.length); - - // IEND chunk - const iend = Buffer.from([0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130]); - - return Buffer.concat([signature, ihdr, idat, iend]); -} - -// Generate icons -sizes.forEach((size) => { - const png = createSimplePNG(size); - fs.writeFileSync(path.join(iconsDir, `icon-${size}.png`), png); - console.log(`✓ Created icon-${size}.png`); -}); - -console.log('\n✓ Icons generated successfully!'); diff --git a/scripts/generate-icons.js b/scripts/generate-icons.js deleted file mode 100644 index eb3cc0b..0000000 --- a/scripts/generate-icons.js +++ /dev/null @@ -1,65 +0,0 @@ -const fs = require('node:fs'); -const path = require('node:path'); -const zlib = require('node:zlib'); - -// Simple PNG generator -const sizes = [16, 48, 128]; -const iconsDir = path.join(__dirname, '../src/icons'); - -// Create a simple colored square PNG manually -function createSimplePNG(size, color = [59, 130, 246]) { - const width = size; - const height = size; - - // PNG signature - const signature = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]); - - // IHDR chunk - const ihdr = Buffer.alloc(25); - ihdr.writeUInt32BE(13, 0); // Length - ihdr.write('IHDR', 4); - ihdr.writeUInt32BE(width, 8); - ihdr.writeUInt32BE(height, 12); - ihdr.writeUInt8(8, 16); // Bit depth - ihdr.writeUInt8(2, 17); // Color type (RGB) - ihdr.writeUInt8(0, 18); // Compression - ihdr.writeUInt8(0, 19); // Filter - ihdr.writeUInt8(0, 20); // Interlace - - const crc = zlib.crc32(ihdr.slice(4, 21)); - ihdr.writeUInt32BE(crc, 21); - - // IDAT chunk - solid blue color - const pixelData = Buffer.alloc(height * (1 + width * 3)); - for (let y = 0; y < height; y++) { - pixelData[y * (1 + width * 3)] = 0; // Filter type - for (let x = 0; x < width; x++) { - const offset = y * (1 + width * 3) + 1 + x * 3; - pixelData[offset] = color[0]; // R - pixelData[offset + 1] = color[1]; // G - pixelData[offset + 2] = color[2]; // B - } - } - - const compressed = zlib.deflateSync(pixelData); - const idat = Buffer.alloc(12 + compressed.length); - idat.writeUInt32BE(compressed.length, 0); - idat.write('IDAT', 4); - compressed.copy(idat, 8); - const idatCrc = zlib.crc32(idat.subarray(4, 8 + compressed.length)); - idat.writeUInt32BE(idatCrc, 8 + compressed.length); - - // IEND chunk - const iend = Buffer.from([0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130]); - - return Buffer.concat([signature, ihdr, idat, iend]); -} - -// Generate icons -for (const size of sizes) { - const png = createSimplePNG(size); - fs.writeFileSync(path.join(iconsDir, `icon-${size}.png`), png); - console.log(`✓ Created icon-${size}.png`); -} - -console.log('\n✓ Icons generated successfully!'); diff --git a/scripts/generate-icons.mjs b/scripts/generate-icons.mjs deleted file mode 100644 index bfd6a7f..0000000 --- a/scripts/generate-icons.mjs +++ /dev/null @@ -1,24 +0,0 @@ -import { dirname, join } from 'node:path'; -import { fileURLToPath } from 'node:url'; -import sharp from 'sharp'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); - -const iconsDir = join(__dirname, '../src/icons'); -const mainIconPath = join(iconsDir, 'icon-main.png'); - -const sizes = [16, 48, 128]; - -async function generateIcons() { - for (const size of sizes) { - await sharp(mainIconPath) - .resize(size, size) - .png() - .toFile(join(iconsDir, `icon-${size}.png`)); - console.log(`✓ Created icon-${size}.png`); - } - console.log('\n✓ Icons generated successfully!'); -} - -generateIcons().catch(console.error);