Skip to content

Commit

Permalink
chore: monorepo setup
Browse files Browse the repository at this point in the history
Setup monorepo and bump up dependencies
  • Loading branch information
kimlimjustin committed Sep 25, 2021
1 parent aceea59 commit 54ff3e6
Show file tree
Hide file tree
Showing 18 changed files with 4,804 additions and 701 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ outs/**/*
scripts/*
src/Components/Functions/log.ts
gruntfile.js
docs/**/*
docs/**/*
packages/**/*
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ dist
build
outs
out
temp
temp
yarn-error.log
.DS_Store
5 changes: 5 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"packages": ["packages/*"],
"npmCLient": "yarn",
"version": "0.0.0"
}
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"author": "Justin Maximillian Kimlim <kimlimjustin@gmail.com>",
"main": "outs/src/main.js",
"icon": "build/icon.icns",
"private": "true",
"homepage": "https://xplorer.vercel.app",
"repository": {
"type": "git",
Expand Down Expand Up @@ -55,7 +56,9 @@
"!scripts/**/*",
"!paths/**/*",
"!.vscode/**/*",
".github/**/*"
"!packages/**/*",
"!.github/**/*",
"!.git/**/*"
],
"directories": {
"buildResources": "icons"
Expand Down Expand Up @@ -87,9 +90,13 @@
"Folders",
"Directory"
],
"workspaces": [
"packages/*"
],
"license": "Apache-2.0",
"devDependencies": {
"@crowdin/cli": "^3.6.5",
"@electron/remote": "1.2.1",
"@types/ejs": "^3.1.0",
"@types/marked": "^3.0.0",
"@types/mv": "^2.1.2",
Expand All @@ -107,6 +114,7 @@
"grunt-cli": "^1.4.3",
"grunt-contrib-uglify": "^5.0.1",
"grunt-contrib-watch": "^1.1.0",
"lerna": "^4.0.0",
"node-sass": "^6.0.1",
"node-watch": "^0.7.1",
"patch-package": "^6.4.7",
Expand All @@ -116,19 +124,18 @@
"typescript": "^4.4.2"
},
"dependencies": {
"@electron/remote": "^1.2.1",
"cpy": "^8.1.2",
"ejs": "^3.1.6",
"electron-acrylic-window": "^0.5.8",
"electron-is-dev": "^2.0.0",
"electron-json-storage-sync": "^1.2.0",
"electron-log": "^4.4.1",
"electron-prompt": "^1.6.2",
"electron-prompt": "^1.7.0",
"electron-updater": "^4.3.9",
"electron-window-state": "^5.0.3",
"fswin": "^3.21.905",
"highlight.js": "^11.2.0",
"is-hidden-file": "1.1.2",
"is-hidden-file": "^1.1.2",
"jest": "^27.1.0",
"mammoth": "^1.4.18",
"marked": "^3.0.2",
Expand Down
1 change: 1 addition & 0 deletions packages/generator-xplorer-theme/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/templates
11 changes: 11 additions & 0 deletions packages/generator-xplorer-theme/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
};
2 changes: 2 additions & 0 deletions packages/generator-xplorer-theme/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
generators
21 changes: 21 additions & 0 deletions packages/generator-xplorer-theme/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Liviu Grigorescu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions packages/generator-xplorer-theme/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Theme generator for Xplorer
52 changes: 52 additions & 0 deletions packages/generator-xplorer-theme/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "generator-xplorer-theme",
"version": "0.0.0",
"description": "Theme generator for Xplorer",
"private": "true",
"author": "Justin Maximillian Kimlim",
"files": [
"generators"
],
"main": "generators/index.js",
"scripts": {
"build": "rimraf generators && tsc && yarn run copydeps && yarn run lint",
"copydeps": "copyfiles src/app/templates/** generators/app --up 2",
"lint": "eslint ./src --ext .js,.ts",
"clean": "rimraf -rf ./generators",
"watch": "yarn run watch-tsc --silent & yarn run watch-deps --silent",
"watch-deps": "onchange 'src/*/templates/**' --initial -- yarn run copydeps --silent",
"watch-tsc": "tsc-watch --onSuccess 'yarn run lint --silent'"
},
"dependencies": {
"@crowdin/cli": "^3.7.0",
"@electron/remote": "^2.0.1",
"chalk": "4.1.0",
"electron": "15.0.0",
"electron-acrylic-window": "^0.5.9",
"electron-prompt": "^1.7.0",
"fswin": "^3.21.914",
"jest": "^27.2.1",
"marked": "^3.0.4",
"node-watch": "^0.7.2",
"prettier": "2.4.1",
"xlsx": "^0.17.2",
"yeoman-generator": "4.12.0",
"yosay": "2.0.2"
},
"devDependencies": {
"@types/marked": "^3.0.1",
"@types/node": "14.14.19",
"@types/yeoman-generator": "4.11.3",
"@types/yosay": "0.0.29",
"@typescript-eslint/eslint-plugin": "4.12.0",
"@typescript-eslint/parser": "4.12.0",
"copyfiles": "2.4.1",
"eslint": "6.6.0",
"onchange": "7.1.0",
"rimraf": "^3.0.2",
"tsc-watch": "4.2.9",
"typescript": "4.1.3",
"yeoman-assert": "3.1.0",
"yeoman-test": "1.7.0"
}
}
74 changes: 74 additions & 0 deletions packages/generator-xplorer-theme/src/app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import Generator from 'yeoman-generator';
import { green } from 'chalk';
import yosay from 'yosay';

interface Answers {
answer1: string;
}

interface Arguments {
arg1: string;
arg2: string;
argRest: string[];
option1: boolean;
option2: string;
}

module.exports = class extends Generator<Arguments> {
answers: Answers;
constructor(args, opts: Arguments) {
super(args, opts);

this.argument('arg1', {
type: String,
required: false,
default: 'arg1default',
description: 'Argument 1',
});
this.argument('arg2', {
type: String,
required: false,
default: 'arg2default',
description: 'Argument 2',
});
this.argument('argRest', {
type: Array,
required: false,
default: [],
description: 'Rest arguments',
});

this.option('option1', {
type: Boolean,
default: false,
description: 'Option 1',
alias: 'o',
});
this.option('option2', {
type: String,
default: 'opt2default',
description: 'Option 2',
alias: 'p',
});
}

async prompting() {
this.log(yosay(`Welcome to ${green("Xplorer's theme")} generator !`));
}

writing() {
const templateData = {
...this.answers,
...this.options,
};
this.fs.copyTpl(
this.templatePath('dummyfile.txt'),
this.destinationPath('dummyfile.txt'),
templateData
);
}

install() {
console.log('Nothing to install');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummyfile answer1:<%= answer1 %>, arg1: <%= arg1 %>, option1: <%= option2 %>
14 changes: 14 additions & 0 deletions packages/generator-xplorer-theme/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "commonjs",
"outDir": "generators",
"esModuleInterop": true,
"rootDir": "src",
"sourceMap": true,
"declaration": true,
"declarationMap": true
},
"include": ["src"],
"exclude": ["node_modules", "src/*/templates"]
}
13 changes: 0 additions & 13 deletions patches/cpy+8.1.2.patch

This file was deleted.

15 changes: 0 additions & 15 deletions patches/electron-prompt+1.6.2.patch

This file was deleted.

12 changes: 12 additions & 0 deletions patches/fast-glob+2.2.7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/node_modules/fast-glob/index.d.ts b/node_modules/fast-glob/index.d.ts
index e08a6c3..bcfc709 100644
--- a/node_modules/fast-glob/index.d.ts
+++ b/node_modules/fast-glob/index.d.ts
@@ -7,6 +7,7 @@ declare namespace FastGlob {
type Options<T = EntryItem> = IPartialOptions<T>;
type TransformFunction<T> = Transform<T>;
type Task = ITask;
+ type Entry = EntryItem;

interface IApi {
<T = EntryItem>(patterns: Pattern | Pattern[], options?: IPartialOptions<T>): Promise<T[]>;
16 changes: 16 additions & 0 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const spawn = require('cross-spawn');
const fs = require('fs');

if (fs.existsSync('temp/postinstalled')) {
spawn('yarn', ['run', 'rimraf', 'temp']);
return;
} else {
if (!fs.existsSync('temp')) {
fs.mkdirSync('temp');
}
fs.writeFileSync('temp/postinstalled', '');
spawn.sync('npm', ['run', 'patch-package'], {
input: 'Installing dependencies once again to patch packages',
stdio: 'inherit',
});
}
Loading

0 comments on commit 54ff3e6

Please sign in to comment.