Update meson (#647)
* Update meson * update * Use build_always_stale instead of manually defining files to track. * Clean up tsconfig
This commit is contained in:
1
env.d.ts
vendored
1
env.d.ts
vendored
@@ -1,4 +1,5 @@
|
||||
declare const SRC: string;
|
||||
declare const DATADIR: string;
|
||||
|
||||
declare module 'inline:*' {
|
||||
const content: string;
|
||||
|
||||
50
meson.build
50
meson.build
@@ -1,57 +1,37 @@
|
||||
project('hyprpanel')
|
||||
project(
|
||||
'hyprpanel',
|
||||
default_options: [
|
||||
'prefix=/usr',
|
||||
],
|
||||
)
|
||||
|
||||
bindir = get_option('prefix') / get_option('bindir')
|
||||
datadir = get_option('prefix') / get_option('datadir') / 'hyprpanel'
|
||||
prefix = get_option('prefix')
|
||||
bindir = prefix / get_option('bindir')
|
||||
datadir = prefix / get_option('datadir') / meson.project_name()
|
||||
|
||||
ags = find_program('ags', required: true)
|
||||
find_program('gjs', required: true)
|
||||
|
||||
src_file_list_process = run_command(
|
||||
'find',
|
||||
'src',
|
||||
'-type', 'f',
|
||||
'(',
|
||||
'-name', '*.ts',
|
||||
'-o',
|
||||
'-name', '*.tsx',
|
||||
'-o',
|
||||
'-name', '*.scss',
|
||||
')',
|
||||
)
|
||||
|
||||
if src_file_list_process.returncode() != 0
|
||||
error('Failed to find source files.')
|
||||
endif
|
||||
|
||||
src_file_list = src_file_list_process.stdout().split('\n')
|
||||
|
||||
all_sources = []
|
||||
|
||||
foreach file : src_file_list
|
||||
file_stripped = file.strip()
|
||||
if file_stripped != ''
|
||||
all_sources += meson.project_source_root() / file_stripped
|
||||
endif
|
||||
endforeach
|
||||
|
||||
custom_target(
|
||||
'hyprpanel_bundle',
|
||||
input: all_sources,
|
||||
input: files('app.ts'),
|
||||
command: [
|
||||
ags,
|
||||
'bundle',
|
||||
'--define', 'DATADIR="' + datadir + '"',
|
||||
'--root', meson.project_source_root(),
|
||||
meson.project_source_root() / 'app.ts',
|
||||
'@OUTPUT@',
|
||||
'--src', meson.project_source_root(),
|
||||
],
|
||||
output: 'hyprpanel.js',
|
||||
output: meson.project_name() + '.js',
|
||||
install: true,
|
||||
install_dir: datadir,
|
||||
build_always_stale: true,
|
||||
)
|
||||
|
||||
configure_file(
|
||||
input: 'scripts/hyprpanel_launcher.sh.in',
|
||||
output: 'hyprpanel',
|
||||
output: meson.project_name(),
|
||||
configuration: {'DATADIR': datadir},
|
||||
install: true,
|
||||
install_dir: bindir,
|
||||
|
||||
10
package-lock.json
generated
10
package-lock.json
generated
@@ -8,6 +8,9 @@
|
||||
"name": "hyprpanel",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"astal": "/usr/share/astal/gjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.5.4",
|
||||
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
||||
@@ -21,6 +24,9 @@
|
||||
"typescript": "^5.6.2"
|
||||
}
|
||||
},
|
||||
"../../../../usr/share/astal/gjs": {
|
||||
"license": "LGPL-2.1"
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
|
||||
@@ -593,6 +599,10 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/astal": {
|
||||
"resolved": "../../../../usr/share/astal/gjs",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/available-typed-arrays": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
"name": "hyprpanel",
|
||||
"version": "1.0.0",
|
||||
"description": "A customizable panel built for Hyprland.",
|
||||
"main": "config.js",
|
||||
"directories": {
|
||||
"lib": "lib"
|
||||
},
|
||||
"main": "app.ts",
|
||||
"scripts": {
|
||||
"lint": "eslint --config .eslintrc.js .",
|
||||
"lint:fix": "eslint --config .eslintrc.js . --fix",
|
||||
@@ -14,6 +11,9 @@
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"astal": "/usr/share/astal/gjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.5.4",
|
||||
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
export HYPRPANEL_DATADIR="@DATADIR@"
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
exec gjs -m "@DATADIR@/hyprpanel.js"
|
||||
else
|
||||
|
||||
@@ -28,11 +28,13 @@ export function ensureFile(path: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
const dataDir = typeof DATADIR !== 'undefined' ? DATADIR : SRC;
|
||||
|
||||
Object.assign(globalThis, {
|
||||
CONFIG: `${GLib.get_user_config_dir()}/hyprpanel/config.json`,
|
||||
TMP: `${GLib.get_tmp_dir()}/hyprpanel`,
|
||||
USER: GLib.get_user_name(),
|
||||
SRC_DIR: GLib.getenv('HYPRPANEL_DATADIR') ?? SRC,
|
||||
SRC_DIR: dataDir,
|
||||
});
|
||||
|
||||
ensureDirectory(TMP);
|
||||
|
||||
@@ -19,11 +19,6 @@
|
||||
"types": [],
|
||||
"experimentalDecorators": true,
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "/usr/share/astal/gjs/gtk3",
|
||||
"paths": {
|
||||
"astal": ["/usr/share/astal/gjs"],
|
||||
"astal/*": ["/usr/share/astal/gjs/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["astal/gtk3/jsx-runtime.ts"]
|
||||
"jsxImportSource": "astal/gtk3"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user