Skip to content

Commit

Permalink
refactor: plugin file org (#942)
Browse files Browse the repository at this point in the history
* refactor: official file organization

* fix: reset query error in plugin

* fix: next types

* fix: restore plugin position

* fix: plugin header flash
  • Loading branch information
boris-w authored Sep 26, 2024
1 parent 8bda47a commit c1a10ff
Show file tree
Hide file tree
Showing 83 changed files with 451 additions and 365 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export const PluginHeader = (props: {
/>
</div>
<div
className={cn('w-0 flex gap-1 group-hover:w-auto', {
'w-auto px-2': menuOpen,
className={cn('hidden gap-1 group-hover:flex', {
flex: menuOpen,
})}
>
<Button
Expand Down
2 changes: 1 addition & 1 deletion dockers/teable/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ COPY --from=post-builder --chown=nodejs:nodejs /app/packages ./packages
COPY --from=post-builder --chown=nodejs:nodejs /app/node_modules ./node_modules
COPY --from=post-builder --chown=nodejs:nodejs /app/package.json ./package.json

COPY --from=post-builder --chown=nodejs:nodejs /app/plugins/chart/.next/standalone/plugins ./plugins
COPY --from=post-builder --chown=nodejs:nodejs /app/plugins/.next/standalone/plugins ./plugins
COPY --from=post-builder --chown=nodejs:nodejs /app/apps/nestjs-backend/static ./static

COPY --chown=nodejs:nodejs scripts/start.sh ./scripts/start.sh
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"workspaces": [
"apps/*",
"packages/*",
"plugins/*",
"plugins",
"!apps/electron"
],
"scripts": {
Expand Down Expand Up @@ -52,7 +52,7 @@
"publish:next:minor": "node ./scripts/publish.mjs minor next",
"publish:next:major": "node ./scripts/publish.mjs major next",
"prepare": "run-s install:husky",
"run:plugin": "pnpm -F '@teable/plugin-chart' dev"
"run:plugin": "pnpm -F '@teable/plugin' dev"
},
"dependencies": {
"cross-env": "7.0.3"
Expand Down
3 changes: 3 additions & 0 deletions plugins/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PORT=3002
PLUGIN_CHART_SECRET=defaultSecretKey
PLUGIN_TEABLE_BACKEND_BASE_URL=http://127.0.0.1:3000/api
File renamed without changes.
1 change: 0 additions & 1 deletion plugins/chart/.gitignore → plugins/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ yarn-error.log*

# typescript
*.tsbuildinfo
next-env.d.ts
File renamed without changes.
3 changes: 0 additions & 3 deletions plugins/chart/.env

This file was deleted.

166 changes: 0 additions & 166 deletions plugins/chart/src/app/api/backend.ts

This file was deleted.

94 changes: 0 additions & 94 deletions plugins/chart/src/app/api/plugin/getToken/uilts.ts

This file was deleted.

27 changes: 0 additions & 27 deletions plugins/chart/src/app/page.tsx

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion plugins/chart/next.config.mjs → plugins/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createSecureHeaders } from 'next-secure-headers';

const isProd = process.env.NODE_ENV === 'production';
const basePath = '/plugin/chart';
const basePath = '/plugin';

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down
2 changes: 1 addition & 1 deletion plugins/chart/package.json → plugins/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@teable/plugin-chart",
"name": "@teable/plugin",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs');
const path = require('path');

// Path to the server.js file
const serverJsPath = path.join(process.cwd(), '.next/standalone/plugins/chart/server.js');
const serverJsPath = path.join(process.cwd(), '.next/standalone/plugins/server.js');

// Read the file content
let serverJs = fs.readFileSync(serverJsPath, 'utf8');
Expand All @@ -19,7 +19,7 @@ fs.writeFileSync(serverJsPath, serverJs, 'utf8');
// Move the static directory
// Path for moving the static directory
const staticSrc = path.join(process.cwd(), '.next/static');
const staticDest = path.join(process.cwd(), '.next/standalone/plugins/chart/.next/static');
const staticDest = path.join(process.cwd(), '.next/standalone/plugins/.next/static');

try {
// Check if the source directory exists
Expand Down
Loading

0 comments on commit c1a10ff

Please sign in to comment.