-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
344 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# kaiware-lib | ||
|
||
![build](https://github.com/nothingspecialdev/kaiware-lib/actions/workflows/build.yml/badge.svg) | ||
![build](https://github.com/nothingspecialdev/kaiware-lib/actions/workflows/build.yml/badge.svg) | ||
![NPM Version](https://img.shields.io/npm/v/%40nothing-special%2Fkaiware-lib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,61 @@ | ||
import alias from '@rollup/plugin-alias'; | ||
import babel from '@rollup/plugin-babel'; | ||
import nodeResolve from '@rollup/plugin-node-resolve'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import path from 'node:path'; | ||
|
||
/** @type {import('rollup').RollupOptions[]} */ | ||
export default [ | ||
{ | ||
input: [ | ||
'src/index.ts', | ||
'src/enums/index.ts', | ||
'src/lib/index.ts', | ||
'src/types/index.ts', | ||
'src/utils/index.ts' | ||
], | ||
output: { | ||
dir: 'build/esm', | ||
/** @type {import('rollup').RollupOptions} */ | ||
export default { | ||
input: [ | ||
'src/index.ts', | ||
'src/enums/index.ts', | ||
'src/lib/index.ts', | ||
'src/types/index.ts', | ||
'src/utils/index.ts' | ||
], | ||
output: [ | ||
{ | ||
dir: 'build', | ||
format: 'esm', | ||
preserveModules: true, | ||
exports: 'named' | ||
exports: 'named', | ||
entryFileNames: '[name].mjs' | ||
}, | ||
preserveEntrySignatures: 'strict', | ||
plugins: [ | ||
typescript({ | ||
outDir: 'build/esm/src' | ||
}), | ||
alias({ | ||
customResolver: nodeResolve({ extensions: ['.ts', '.js', '.d.ts'] }), | ||
entries: [{ find: 'src', replacement: path.resolve(__dirname, 'build/esm/src') }] | ||
}), | ||
babel({ | ||
extensions: ['.js', '.ts', '.mjs', '.cjs', '.html'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/@babel/**'], | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { firefox: '48' }, | ||
exclude: ['@babel/plugin-transform-regenerator'] | ||
} | ||
] | ||
], | ||
plugins: [ | ||
'@babel/plugin-syntax-dynamic-import', | ||
[ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
useESModules: true, | ||
regenerator: false | ||
} | ||
] | ||
] | ||
}), | ||
nodeResolve() | ||
] | ||
}, | ||
{ | ||
input: [ | ||
'src/index.ts', | ||
'src/enums/index.ts', | ||
'src/lib/index.ts', | ||
'src/types/index.ts', | ||
'src/utils/index.ts' | ||
], | ||
output: { | ||
dir: 'build/cjs', | ||
{ | ||
dir: 'build', | ||
format: 'cjs', | ||
preserveModules: true, | ||
exports: 'named' | ||
}, | ||
preserveEntrySignatures: 'strict', | ||
plugins: [ | ||
alias({ | ||
entries: [{ find: '$', replacement: path.resolve(__dirname, 'src') }] | ||
}), | ||
typescript({ | ||
outDir: 'build/cjs/src' | ||
}), | ||
babel({ | ||
extensions: ['.js', '.ts', '.mjs', '.cjs', '.html'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/@babel/**'], | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { firefox: '48' }, | ||
exclude: ['@babel/plugin-transform-regenerator'] | ||
} | ||
] | ||
], | ||
plugins: [ | ||
'@babel/plugin-syntax-dynamic-import', | ||
[ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
useESModules: true, | ||
regenerator: false | ||
} | ||
] | ||
exports: 'named', | ||
entryFileNames: '[name].cjs' | ||
} | ||
], | ||
preserveEntrySignatures: 'strict', | ||
plugins: [ | ||
nodeResolve({}), | ||
typescript({ | ||
outDir: 'build/src' | ||
}), | ||
babel({ | ||
extensions: ['.js', '.ts', '.mjs', '.cjs', '.html'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/@babel/**'], | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { firefox: '48' }, | ||
exclude: ['@babel/plugin-transform-regenerator'] | ||
} | ||
] | ||
], | ||
plugins: [ | ||
'@babel/plugin-syntax-dynamic-import', | ||
[ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
useESModules: true, | ||
regenerator: false | ||
} | ||
] | ||
}), | ||
nodeResolve() | ||
] | ||
} | ||
]; | ||
] | ||
}) | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
export enum MessageType { | ||
RefreshElements = 'refresh-elements', | ||
RefreshDeviceInfo = 'refresh-device-info', | ||
RefreshStorage = 'refresh-storage', | ||
GetDeviceInfo = 'get-device-info', | ||
GetDeviceInfoRes = 'get-device-info-res', | ||
|
||
GetElements = 'get-elements', | ||
GetElementsRes = 'get-elements-res', | ||
|
||
GetElementStyles = 'get-element-styles', | ||
GetElementStylesRes = 'get-element-styles-res', | ||
SetElementStyles = 'set-element-styles', | ||
SetElementStylesRes = 'set-element-styles-res', | ||
|
||
GetElementData = 'get-element-data', | ||
GetElementDataRes = 'get-element-data-res', | ||
SetElementData = 'set-element-data', | ||
SetElementDataRes = 'set-element-data-res', | ||
|
||
GetStorage = 'get-storage', | ||
GetStorageRes = 'get-storage-res', | ||
SetStorage = 'set-storage', | ||
SetStorageRes = 'set-storage-res', | ||
|
||
// Misc | ||
|
||
DeviceInfoUpdate = 'device-info-update', | ||
NewLog = 'new-log', | ||
ClearLogs = 'clear-logs', | ||
ElementsUpdate = 'elements-update', | ||
StorageUpdate = 'storage-update', | ||
|
||
Error = 'error' | ||
} |
Oops, something went wrong.