This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate from webpack to rollup
- Loading branch information
Showing
21 changed files
with
623 additions
and
2,931 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
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 |
---|---|---|
|
@@ -8,13 +8,13 @@ | |
"clean": "yarn run clean:ts && yarn run build:types", | ||
"build:types": "yarn run clean:types && ts-for-gir generate", | ||
"clean:types": "rm -rf ./@types", | ||
"build:ts": "yarn run clean:ts && webpack", | ||
"build:ts": "yarn run clean:ts && rollup -c", | ||
"clean:ts": "rm -rf ./dist", | ||
"build:extension": "yarn run build:schema", | ||
"build:schema": "yarn run clean:schema && glib-compile-schemas ./resources/schemas --targetdir=./dist/schemas/", | ||
"clean:schema": "rm -rf ./dist/schemas/*.compiled", | ||
"build:package": "rm -rf './dist/[email protected]' && cd ./dist && zip -qr '[email protected]' .", | ||
"watch": "yarn run build && yarn run webpack --watch", | ||
"watch": "yarn run build && yarn run rollup -c --watch", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"lint": "eslint --ext .ts src/" | ||
}, | ||
|
@@ -30,28 +30,25 @@ | |
} | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^9.1.1", | ||
"@commitlint/config-conventional": "^9.1.1", | ||
"@commitlint/cli": "^9.1.2", | ||
"@commitlint/config-conventional": "^9.1.2", | ||
"@rollup/plugin-commonjs": "^15.0.0", | ||
"@rollup/plugin-node-resolve": "^9.0.0", | ||
"@rollup/plugin-typescript": "^5.0.2", | ||
"@types/events": "^3.0.0", | ||
"@typescript-eslint/eslint-plugin": "^3.9.0", | ||
"@typescript-eslint/parser": "^3.9.0", | ||
"copy-webpack-plugin": "^6.0.3", | ||
"css-loader": "^4.2.1", | ||
"eslint": "^7.6.0", | ||
"@typescript-eslint/eslint-plugin": "^3.9.1", | ||
"@typescript-eslint/parser": "^3.9.1", | ||
"eslint": "^7.7.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"file-loader": "^6.0.0", | ||
"husky": "^4.2.5", | ||
"mini-css-extract-plugin": "^0.10.0", | ||
"node-sass": "^4.14.1", | ||
"prettier": "^2.0.5", | ||
"sass-loader": "^9.0.3", | ||
"style-loader": "^1.2.1", | ||
"rollup": "^2.26.4", | ||
"rollup-plugin-copy": "^3.3.0", | ||
"rollup-plugin-scss": "^2.6.0", | ||
"ts-for-gir": "https://github.com/oae/ts-for-gjs", | ||
"ts-loader": "^8.0.2", | ||
"typescript": "^3.9.7", | ||
"webpack": "^4.44.1", | ||
"webpack-cli": "^3.3.12" | ||
"typescript": "^4.0.2" | ||
}, | ||
"dependencies": { | ||
"events": "^3.2.0", | ||
|
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import typescript from '@rollup/plugin-typescript'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import scss from 'rollup-plugin-scss'; | ||
import copy from 'rollup-plugin-copy'; | ||
|
||
const buildPath = 'dist'; | ||
|
||
const globals = { | ||
'@imports/Gio-2.0': 'imports.gi.Gio', | ||
'@imports/Gdk-3.0': 'imports.gi.Gdk', | ||
'@imports/Gtk-3.0': 'imports.gi.Gtk', | ||
'@imports/GdkPixbuf-2.0': 'imports.gi.GdkPixbuf', | ||
'@imports/GLib-2.0': 'imports.gi.GLib', | ||
'@imports/St-1.0': 'imports.gi.St', | ||
'@imports/Shell-0.1': 'imports.gi.Shell', | ||
'@imports/Meta-6': 'imports.gi.Meta', | ||
'@imports/Wnck-3.0': 'imports.gi.Wnck', | ||
'@imports/Clutter-6': 'imports.gi.Clutter', | ||
'@imports/Soup-2.4': 'imports.gi.Soup', | ||
}; | ||
|
||
const external = Object.keys(globals); | ||
|
||
const banner = [ | ||
].join('\n'); | ||
|
||
const prefsFooter = [ | ||
'var init = prefs.init;', | ||
'var buildPrefsWidget = prefs.buildPrefsWidget;', | ||
].join('\n') | ||
|
||
export default [ | ||
{ | ||
input: 'src/extension.ts', | ||
output: { | ||
file: `${buildPath}/extension.js`, | ||
format: 'iife', | ||
name: 'init', | ||
banner, | ||
exports: 'default', | ||
globals, | ||
}, | ||
external, | ||
plugins: [ | ||
commonjs(), | ||
nodeResolve({ | ||
preferBuiltins: false, | ||
}), | ||
typescript({ | ||
tsconfig: './tsconfig.json', | ||
}), | ||
scss({ | ||
output: `${buildPath}/stylesheet.css`, | ||
failOnError: true, | ||
watch: 'src/styles', | ||
}), | ||
copy({ | ||
targets: [ | ||
{ src: './resources/icons', dest: `${buildPath}` }, | ||
{ src: './resources/metadata.json', dest: `${buildPath}` }, | ||
{ src: './resources/schemas', dest: `${buildPath}` }, | ||
], | ||
}), | ||
], | ||
}, | ||
{ | ||
input: 'src/prefs/prefs.ts', | ||
output: { | ||
file: `${buildPath}/prefs.js`, | ||
format: 'iife', | ||
exports: 'default', | ||
name: 'prefs', | ||
banner, | ||
footer: prefsFooter, | ||
globals, | ||
}, | ||
external, | ||
plugins: [ | ||
commonjs(), | ||
nodeResolve({ | ||
preferBuiltins: false, | ||
}), | ||
typescript({ | ||
tsconfig: './tsconfig.json', | ||
}), | ||
copy({ | ||
targets: [{ src: './resources/ui', dest: `${buildPath}` }], | ||
}), | ||
], | ||
}, | ||
]; |
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { SyncData } from '@esync/data'; | ||
|
||
export enum ApiOperationStatus { | ||
SUCCESS, | ||
FAIL, | ||
} | ||
|
||
export enum ApiEvent { | ||
UPLOAD = 'UPLOAD', | ||
UPLOAD_FINISHED = 'UPLOAD_FINISHED', | ||
DOWNLOAD = 'DOWNLOAD', | ||
DOWNLOAD_FINISHED = 'DOWNLOAD_FINISHED', | ||
} | ||
|
||
export enum ApiProviderType { | ||
GITHUB, | ||
GITLAB, | ||
} | ||
|
||
export interface ApiProvider { | ||
upload(syncData: SyncData): Promise<ApiOperationStatus>; | ||
download(): Promise<SyncData>; | ||
getName(): string; | ||
} |
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
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
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
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
Oops, something went wrong.