Skip to content

Commit

Permalink
Use caido-dev tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
Corb3nik committed Jan 5, 2025
1 parent eb0cccf commit a1f522b
Show file tree
Hide file tree
Showing 12 changed files with 1,344 additions and 361 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ jobs:

- name: Check version
id: meta
working-directory: dist
run: |
VERSION=$(jq -r .version manifest.json)
VERSION=$(unzip -p plugin_package.zip manifest.json | jq -r .version)
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Setup Node.js
Expand Down
78 changes: 78 additions & 0 deletions caido.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import { defineConfig } from '@caido-community/dev';
import vue from '@vitejs/plugin-vue';
import tailwindcss from "tailwindcss";
// @ts-expect-error no declared types at this time
import tailwindPrimeui from "tailwindcss-primeui";
import tailwindCaido from "@caido/tailwindcss";
import prefixwrap from "postcss-prefixwrap";
import path from "path";

export default defineConfig({
id: "authmatrix",
name: "AuthMatrix",
description: "Grid-based authorization testing across multiple users and roles.",
version: "0.4.0",
author: {
name: "Caido Labs Inc.",
email: "[email protected]",
url: "https://caido.io",
},
plugins: [
{
kind: "backend",
id: "backend",
root: "packages/backend",
},
{
kind: 'frontend',
id: "frontend",
root: 'packages/frontend',
backend: {
id: "backend",
},
vite: {
plugins: [vue()],
build: {
rollupOptions: {
external: ['@caido/frontend-sdk']
}
},
resolve: {
alias: [
{
find: "@",
replacement: path.resolve(__dirname, "packages/frontend/src"),
},
],
},
css: {
postcss: {
plugins: [
prefixwrap("#plugin--authmatrix"),
tailwindcss({
corePlugins: {
preflight: false,
},
content: [
'./packages/frontend/src/**/*.{vue,ts}',
'./node_modules/@caido/primevue/dist/primevue.mjs'
],
// Check the [data-mode="dark"] attribute on the <html> element to determine the mode
// This attribute is set in the Caido core application
darkMode: ["selector", '[data-mode="dark"]'],
plugins: [

// This plugin injects the necessary Tailwind classes for PrimeVue components
tailwindPrimeui,

// This plugin injects the necessary Tailwind classes for the Caido theme
tailwindCaido,
],
})
]
}
}
}
}
]
});
30 changes: 0 additions & 30 deletions manifest.json

This file was deleted.

11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@
"type": "module",
"scripts": {
"typecheck": "pnpm -r typecheck",
"build": "node scripts/clean.js && pnpm -r build && node scripts/pack.js",
"build": "caido-dev build",
"watch": "caido-dev watch",
"lint": "biome check --write ./packages/*/src"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@caido-community/dev": "0.0.4",
"@caido/plugin-manifest": "0.1.3",
"@caido/tailwindcss": "0.0.1",
"@vitejs/plugin-vue": "5.2.1",
"jszip": "3.10.1",
"postcss-prefixwrap": "1.51.0",
"tailwindcss": "3.4.13",
"tailwindcss-primeui": "0.3.4",
"typescript": "5.5.4",
"vite": "5.2.7"
"vite": "6.0.7"
}
}
3 changes: 1 addition & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"type": "module",
"types": "src/index.ts",
"scripts": {
"typecheck": "tsc --noEmit",
"build": "vite build"
"typecheck": "tsc --noEmit"
},
"dependencies": {
"shared": "workspace:*"
Expand Down
21 changes: 0 additions & 21 deletions packages/backend/vite.config.ts

This file was deleted.

8 changes: 1 addition & 7 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"license": "CC0-1.0",
"type": "module",
"scripts": {
"typecheck": "vue-tsc --noEmit",
"build": "vite build"
"typecheck": "vue-tsc --noEmit"
},
"dependencies": {
"@caido/primevue": "0.1.1",
Expand All @@ -21,13 +20,8 @@
},
"devDependencies": {
"@caido/sdk-backend": "0.43.1",
"@caido/tailwindcss": "0.0.1",
"@codemirror/view": "6.28.1",
"@vitejs/plugin-vue": "5.1.2",
"backend": "workspace:*",
"postcss-prefixwrap": "1.51.0",
"tailwindcss": "3.4.13",
"tailwindcss-primeui": "0.3.4",
"vue-tsc": "2.0.29"
}
}
9 changes: 0 additions & 9 deletions packages/frontend/postcss.config.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/frontend/src/plugins/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const SDKPlugin: Plugin = (app, sdk: CaidoSDK) => {
app.provide(KEY, sdk);
};


export const useSDK = () => {
return inject(KEY) as CaidoSDK;
};
19 changes: 0 additions & 19 deletions packages/frontend/tailwind.config.ts

This file was deleted.

33 changes: 0 additions & 33 deletions packages/frontend/vite.config.ts

This file was deleted.

Loading

0 comments on commit a1f522b

Please sign in to comment.