Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publish #664

Merged
merged 16 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/nestjs-backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teable/backend",
"version": "1.0.0",
"version": "1.1.3-beta.0",
"license": "AGPL-3.0",
"private": true,
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teable/app",
"version": "1.0.0",
"version": "1.1.3-beta.0",
"license": "AGPL-3.0",
"private": true,
"main": "main/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ISelectFieldOptions } from '@teable/core';
import { Colors, ColorUtils, CellValueType, FieldType } from '@teable/core';
import { useBase, useFields, useTable, useView } from '@teable/sdk/hooks';
import { useBase, useDriver, useFields, useTable, useView } from '@teable/sdk/hooks';
import { knex } from 'knex';
import { useEffect, useMemo, useState } from 'react';

interface IData {
Expand All @@ -14,6 +15,7 @@ export function useChartData() {
const table = useTable();
const view = useView();
const base = useBase();
const driver = useDriver();
const [data, setData] = useState<{ list: IData[]; title: string }>({ title: '', list: [] });
const groupingField = useMemo(
() => fields.find((field) => field.type === FieldType.SingleSelect),
Expand All @@ -34,8 +36,7 @@ export function useChartData() {
return;
}

const nativeSql = base
.knex(table.dbTableName)
const nativeSql = knex({ client: driver })(table.dbTableName)
.select(`${groupingField.dbFieldName} as name`)
.sum(`${numberField.dbFieldName} as total`)
.groupBy(groupingField.dbFieldName)
Expand All @@ -57,6 +58,6 @@ export function useChartData() {
})),
});
});
}, [base, fields, groupingField, numberField, table, view]);
}, [base, driver, fields, groupingField, numberField, table, view]);
return data;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CellValueType, FieldType } from '@teable/core';
import { useBase, useFields, useTable, useViewId } from '@teable/sdk/hooks';
import { useBase, useDriver, useFields, useTable, useViewId } from '@teable/sdk/hooks';
import { knex } from 'knex';
import { useEffect, useMemo, useState } from 'react';

interface IData {
Expand All @@ -12,6 +13,7 @@ export function useLineChartData() {
const base = useBase();
const table = useTable();
const viewId = useViewId();
const driver = useDriver();
const [data, setData] = useState<{ list: IData[]; title: string }>({ title: '', list: [] });
const selectField = useMemo(
() => fields.find((field) => field.type === FieldType.SingleSelect),
Expand All @@ -34,8 +36,7 @@ export function useLineChartData() {

const nameColumn = selectField.dbFieldName;
const numberColumn = numberField.dbFieldName;
const nativeSql = base
.knex(table.dbTableName)
const nativeSql = knex({ client: driver })(table.dbTableName)
.select(nameColumn)
.min(numberColumn + ' as total')
.avg(numberColumn + ' as average')
Expand All @@ -53,6 +54,6 @@ export function useLineChartData() {
})),
});
});
}, [fields, selectField, numberField, table, viewId, base]);
}, [fields, selectField, numberField, table, viewId, base, driver]);
return data;
}
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@teable/teable",
"version": "1.1.3-beta.0",
"license": "AGPL-3.0",
"private": true,
"homepage": "https://github.com/teableio/teable",
Expand Down Expand Up @@ -42,6 +43,12 @@
"install:playwright": "playwright install",
"install:husky": "node .husky/install.mjs",
"nuke:node_modules": "pnpm -r exec -- rm -fr node_modules",
"publish:beta:patch": "node ./scripts/publish.mjs prepatch beta",
"publish:beta:minor": "node ./scripts/publish.mjs preminor beta",
"publish:beta:major": "node ./scripts/publish.mjs premajor beta",
"publish:next:patch": "node ./scripts/publish.mjs patch next",
"publish:next:minor": "node ./scripts/publish.mjs minor next",
"publish:next:major": "node ./scripts/publish.mjs major next",
"prepare": "run-s install:husky"
},
"dependencies": {
Expand Down
46 changes: 0 additions & 46 deletions packages/common-i18n/README.md

This file was deleted.

16 changes: 6 additions & 10 deletions packages/common-i18n/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "@teable/common-i18n",
"version": "1.0.0",
"version": "1.1.3-beta.0",
"license": "AGPL-3.0",
"homepage": "https://github.com/teableio/teable",
"private": false,
"publishConfig": {
"access": "public"
},
Expand All @@ -22,15 +23,10 @@
"src"
],
"exports": {
"./locales/*.json": {
"require": "./src/locales/*.json",
"import": "./src/locales/*.json"
},
"./src/locales/en/sdk.json": {
"require": "./src/locales/en/sdk.json",
"import": "./src/locales/en/sdk.json"
},
"./package.json": "./package.json"
"./src/locales/*": {
"require": "./src/locales/*",
"import": "./src/locales/*"
}
},
"scripts": {
"clean": "rimraf ./dist ./coverage ./tsconfig.tsbuildinfo",
Expand Down
40 changes: 0 additions & 40 deletions packages/core/README.md

This file was deleted.

6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teable/core",
"version": "1.0.0",
"version": "1.1.3-beta.0",
"license": "AGPL-3.0",
"homepage": "https://github.com/teableio/teable",
"publishConfig": {
Expand All @@ -23,9 +23,9 @@
"dist"
],
"scripts": {
"build": "tsc",
"build": "tsc --project ./tsconfig.build.json",
"dev": "tsc --watch",
"clean": "rimraf ./dist ./coverage ./tsconfig.tsbuildinfo ./.eslintcache",
"clean": "rimraf ./dist ./coverage ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo ./.eslintcache",
"lint": "eslint . --ext .ts,.js,.mjs,.cjs,.mts,.cts --cache --cache-location ../../.cache/eslint/core.eslintcache",
"antlr4ts": "antlr4ts -visitor -no-listener src/formula/parser/*.g4",
"antlr4ts-tql": "antlr4ts -visitor -no-listener src/query/parser/*.g4",
Expand Down
10 changes: 1 addition & 9 deletions packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.json",
"compilerOptions": {
"baseUrl": "./src",
"target": "ESNext",
"module": "ESNext",
"declarationDir": "./dist",
"incremental": true,
"tsBuildInfoFile": "./tsconfig.build.tsbuildinfo" // for tsup rollup dts tsBuildInfoFile is required when using incremental
},
"exclude": ["dist", "**/__tests__/*", "*.spec.ts"]
"exclude": ["dist", "**/__tests__/*", "**/*spec.ts"]
}
3 changes: 2 additions & 1 deletion packages/db-main-prisma/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "@teable/db-main-prisma",
"version": "1.0.0",
"version": "1.1.3-beta.0",
"license": "AGPL-3.0",
"homepage": "https://github.com/teableio/teable",
"private": true,
"publishConfig": {
"access": "public"
},
Expand Down
Loading