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

[project] update dependencies to allow proper build #219

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.0
20.12.2
10 changes: 5 additions & 5 deletions aform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"exports": {
".": {
"import": {
"types": "./dist/aform/src/index.d.ts",
"types": "./dist/src/index.d.ts",
"default": "./dist/aform.js"
},
"require": "./dist/aform.umd.cjs"
},
"./styles": "./dist/assets/index.css"
},
"typings": "./dist/aform/src/index.d.ts",
"typings": "./dist/src/index.d.ts",
"files": [
"dist/*",
"src/*"
Expand All @@ -48,8 +48,8 @@
"vue": "^3.5.11"
},
"devDependencies": {
"@microsoft/api-documenter": "^7.25.3",
"@rushstack/heft": "^0.67.2",
"@microsoft/api-documenter": "^7.26.2",
"@rushstack/heft": "^0.68.6",
"@stonecrop/atable": "workspace:*",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
Expand All @@ -63,7 +63,7 @@
"eslint": "^8.40.0",
"jsdom": "^25.0.0",
"stonecrop-rig": "workspace:*",
"typescript": "^5.5.2",
"typescript": "^5.6.3",
"vite-plugin-lib-inject-css": "^2.1.1",
"vite": "^5.4.5",
"vitest": "^2.1.1",
Expand Down
28 changes: 14 additions & 14 deletions aform/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { App } from 'vue'

import ACheckbox from '@/components/form/ACheckbox.vue'
import AComboBox from '@/components/form/AComboBox.vue'
import ADate from '@/components/form/ADate.vue'
import ADropdown from '@/components/form/ADropdown.vue'
import ADatePicker from '@/components/form/ADatePicker.vue'
import AFieldset from '@/components/form/AFieldset.vue'
import AFileAttach from '@/components/form/AFileAttach.vue'
import AForm from '@/components/AForm.vue'
import ANumericInput from '@/components/form/ANumericInput.vue'
import ATextInput from '@/components/form/ATextInput.vue'
import Login from '@/components/utilities/Login.vue'
export type { BasicSchema, FormSchema, TableSchema, FieldsetSchema, SchemaTypes } from '@/types'
// import { ACurrency } from '@/components/form/ACurrency.vue'
// import { AQuantity } from '@/components/form/AQuantity.vue'
import ACheckbox from './components/form/ACheckbox.vue'
import AComboBox from './components/form/AComboBox.vue'
import ADate from './components/form/ADate.vue'
import ADropdown from './components/form/ADropdown.vue'
import ADatePicker from './components/form/ADatePicker.vue'
import AFieldset from './components/form/AFieldset.vue'
import AFileAttach from './components/form/AFileAttach.vue'
import AForm from './components/AForm.vue'
import ANumericInput from './components/form/ANumericInput.vue'
import ATextInput from './components/form/ATextInput.vue'
import Login from './components/utilities/Login.vue'
export type { BasicSchema, FormSchema, TableSchema, FieldsetSchema, SchemaTypes } from './types'
// import { ACurrency } from './components/form/ACurrency.vue'
// import { AQuantity } from './components/form/AQuantity.vue'

/**
* Install all AForm components
Expand Down
32 changes: 28 additions & 4 deletions aform/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import ATable from '@stonecrop/atable'
import type { TableColumn, TableConfig, TableRow } from '@stonecrop/atable'

/**
* Defined props for AForm components
* @public
*/
export type ComponentProps = {
label?: string
mask?: string
Expand All @@ -9,12 +13,20 @@ export type ComponentProps = {
validation?: Record<string, any>
}

/**
* Base schemda for AForm components
* @beta
*/
export type BasicSchema = {
component: string
fieldname: string
value: any
}

/**
* Form schema
* @beta
*/
export type FormSchema = BasicSchema & {
align: string
edit: boolean
Expand All @@ -25,16 +37,28 @@ export type FormSchema = BasicSchema & {
mask?: string
}

/**
* Table schema
* @beta
*/
export type TableSchema = BasicSchema & {
columns: ATable.TableColumn[]
config: ATable.TableConfig
rows: ATable.TableRow[]
columns: TableColumn[]
config: TableConfig
rows: TableRow[]
}

/**
* Fieldset schema
* @beta
*/
export type FieldsetSchema = BasicSchema & {
label: string
schema: (FormSchema | TableSchema)[]
collapsible?: boolean
}

/**
* Superset of schema types
* @public
*/
export type SchemaTypes = FormSchema | TableSchema | FieldsetSchema
2 changes: 1 addition & 1 deletion aform/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"types/*": ["./src/types/*"]
}
},
"include": ["src/**/*", "src/**/*.ts", "src/**/*.vue", "tests/**/*.spec.ts", "tests/**/*.ts", "tests/**/*.vue"]
"include": ["src/**/*.ts", "src/**/*.vue", "tests/**/*.spec.ts", "tests/**/*.ts", "tests/**/*.vue"]
}
10 changes: 5 additions & 5 deletions atable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"exports": {
".": {
"import": {
"types": "./dist/atable/src/index.d.ts",
"types": "./dist/src/index.d.ts",
"default": "./dist/atable.js"
},
"require": "./dist/atable.umd.cjs"
},
"./styles": "./dist/assets/index.css"
},
"typings": "./dist/atable/src/index.d.ts",
"typings": "./dist/src/index.d.ts",
"files": [
"dist/*",
"src/*"
Expand Down Expand Up @@ -53,8 +53,8 @@
"vue": "^3.5.11"
},
"devDependencies": {
"@microsoft/api-documenter": "^7.25.3",
"@rushstack/heft": "^0.67.2",
"@microsoft/api-documenter": "^7.26.2",
"@rushstack/heft": "^0.68.6",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"@vitejs/plugin-vue": "^5.1.3",
Expand All @@ -67,7 +67,7 @@
"eslint": "^8.40.0",
"jsdom": "^25.0.0",
"stonecrop-rig": "workspace:*",
"typescript": "^5.5.2",
"typescript": "^5.6.3",
"vite-plugin-lib-inject-css": "^2.1.1",
"vite": "^5.4.5",
"vitest": "^2.1.1",
Expand Down
20 changes: 8 additions & 12 deletions atable/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import { createPinia } from 'pinia'
import { App } from 'vue'

import ACell from '@/components/ACell.vue'
import AExpansionRow from '@/components/AExpansionRow.vue'
import ARow from '@/components/ARow.vue'
import ATable from '@/components/ATable.vue'
import ATableHeader from '@/components/ATableHeader.vue'
import ATableModal from '@/components/ATableModal.vue'
export { createTableStore } from '@/stores/table'
export type { CellContext, TableColumn, TableConfig, TableDisplay, TableRow, TableModal } from '@/types'
import ACell from './components/ACell.vue'
import AExpansionRow from './components/AExpansionRow.vue'
import ARow from './components/ARow.vue'
import ATable from './components/ATable.vue'
import ATableHeader from './components/ATableHeader.vue'
import ATableModal from './components/ATableModal.vue'
export { createTableStore } from './stores/table'
export type { CellContext, TableColumn, TableConfig, TableDisplay, TableRow, TableModal } from './types'

/**
* Install all ATable components
* @param app - Vue app instance
* @public
*/
function install(app: App /* options */) {
const pinia = createPinia()
app.use(pinia)

app.component('ACell', ACell)
app.component('AExpansionRow', AExpansionRow)
app.component('ARow', ARow)
Expand Down
6 changes: 6 additions & 0 deletions atable/src/stores/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { type CSSProperties, computed, ref } from 'vue'

import type { CellContext, TableColumn, TableConfig, TableDisplay, TableModal, TableRow } from '@/types'

/**
* Create a table store
* @param initData - Initial data for the table store
* @returns table store instance
* @public
*/
export const createTableStore = (initData: {
columns: TableColumn[]
rows: TableRow[]
Expand Down
24 changes: 24 additions & 0 deletions atable/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* Table column definition.
* @public
*/
export type TableColumn = {
name: string

Expand All @@ -17,12 +21,20 @@ export type TableColumn = {
mask?: (value: any) => any
}

/**
* Table cell context definition.
* @public
*/
export type CellContext = {
row: TableRow
column: TableColumn
table: { [key: string]: any }
}

/**
* Table configuration definition.
* @public
*/
export type TableConfig = {
/**
* The type of view to display the table in. Possible values:
Expand All @@ -35,6 +47,10 @@ export type TableConfig = {
fullWidth?: boolean
}

/**
* Table display definition.
* @public
*/
export type TableDisplay = {
childrenOpen?: boolean
expanded?: boolean
Expand All @@ -46,12 +62,20 @@ export type TableDisplay = {
rowModified?: boolean
}

/**
* Table row definition.
* @public
*/
export type TableRow = {
[key: string]: any
indent?: number
parent?: number
}

/**
* Table modal definition.
* @public
*/
export type TableModal = {
colIndex?: number
event?: string
Expand Down
2 changes: 1 addition & 1 deletion atable/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"types/*": ["./src/types/*"]
}
},
"include": ["src/**/*", "src/**/*.ts", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.vue"]
"include": ["src/**/*.ts", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.vue"]
}
3 changes: 2 additions & 1 deletion atable/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ export default defineConfig({
name: '@stonecrop/atable',
},
rollupOptions: {
external: ['vue'],
external: ['vue', 'pinia'],
output: {
chunkFileNames: 'chunks/[name].[hash].js',
assetFileNames: 'assets/[name].[ext]',
globals: {
vue: 'Vue',
pinia: 'pinia',
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions beam/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"vue": "^3.5.11"
},
"devDependencies": {
"@microsoft/api-documenter": "^7.25.3",
"@rushstack/heft": "^0.67.2",
"@microsoft/api-documenter": "^7.26.2",
"@rushstack/heft": "^0.68.6",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"@vitejs/plugin-vue": "^5.1.3",
Expand All @@ -60,7 +60,7 @@
"eslint-plugin-vue": "^9.11.1",
"sass": "^1.75.0",
"stonecrop-rig": "workspace:*",
"typescript": "^5.5.2",
"typescript": "^5.6.3",
"vite-plugin-lib-inject-css": "^2.1.1",
"vite": "^5.4.5",
"vitest": "^2.1.1",
Expand Down
12 changes: 8 additions & 4 deletions beam/src/composables/mqtt.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import mqtt, { type MqttClient, type IClientOptions } from 'mqtt'
import mqtt, { type MqttClient } from 'mqtt'
import { onMounted, onUnmounted, ref } from 'vue'

interface IMqttStream extends IClientOptions {
topics?: string[]
}
import { IMqttStream } from '@/types'

/**
* Use MQTT stream
* @param options - MQTT stream options
* @returns MQTT stream messages
* @beta
*/
export const useMqttStream = (options?: IMqttStream) => {
const client = ref<MqttClient>(null)
const messages = ref<Record<string, string[]>>({})
Expand Down
2 changes: 1 addition & 1 deletion beam/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ScanInput from '@/components/ScanInput.vue'
import SplitColumn from '@/components/SplitColumn.vue'
import ToggleArrow from '@/components/ToggleArrow.vue'
import { useMqttStream } from '@/composables/mqtt'
export type { ListViewItem } from '@/types'
export type { IMqttStream, ListViewItem } from '@/types'
import 'themes/beam.css'

/**
Expand Down
13 changes: 13 additions & 0 deletions beam/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import type { IClientOptions } from 'mqtt'

/**
* @beta
*/
export type ListViewItem = {
description: string
label: string
Expand All @@ -14,3 +19,11 @@ export type ListViewItem = {
linkComponent?: string
route?: string
}

/**
* MQTT stream options
* @public
*/
export interface IMqttStream extends IClientOptions {
topics?: string[]
}
2 changes: 1 addition & 1 deletion beam/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"@/*": ["./src/*"]
}
},
"include": ["src/**/*", "src/**/*.ts", "src/**/*.vue", "tests/**/*.spec.ts", "tests/**/*.ts", "tests/**/*.vue"]
"include": ["src/**/*.ts", "src/**/*.vue", "tests/**/*.spec.ts", "tests/**/*.ts", "tests/**/*.vue"]
}
Loading
Loading