Skip to content

Commit

Permalink
basic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LabhanshAgrawal committed Dec 26, 2022
1 parent 45fe2a6 commit de9dd14
Show file tree
Hide file tree
Showing 13 changed files with 261 additions and 237 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ website
bin
dist
target
cache
cache
schema.json
53 changes: 30 additions & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
Expand Down Expand Up @@ -63,28 +62,6 @@
"eslint-comments/no-unused-disable": "error"
},
"overrides": [
{
"files": [
"app/config/config-default.js",
".hyper.js"
],
"rules": {
"prettier/prettier": [
"error",
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": false,
"semi": true,
"useTabs": false,
"parser": "babel",
"bracketSameLine": false
}
]
}
},
{
"files": [
"**.ts",
Expand All @@ -108,6 +85,36 @@
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/restrict-template-expressions": "off"
}
},
{
"extends": [
"plugin:jsonc/recommended-with-json",
"plugin:json-schema-validator/recommended"
],
"files": [
"*.json"
],
"parser": "jsonc-eslint-parser",
"plugins": [
"jsonc",
"json-schema-validator"
],
"rules": {
"jsonc/array-element-newline": [
"error",
"consistent"
],
"jsonc/array-bracket-newline": [
"error",
"consistent"
],
"jsonc/indent": [
"error",
2
],
"prettier/prettier": "off",
"json-schema-validator/no-invalid": "error"
}
}
]
}
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ assignees: ''

- **OS version and name**: <!-- Replace with version + name -->
- **Hyper.app version**: <!-- Replace with version -->
- **Link of a [Gist](https://gist.github.com/) with the contents of your .hyper.js**: <!-- Gist Link Here -->
- **Link of a [Gist](https://gist.github.com/) with the contents of your hyper.json**: <!-- Gist Link Here -->
- **Relevant information from devtools** _(CMD+ALT+I on macOS, CTRL+SHIFT+I elsewhere)_: <!-- Replace with info if applicable, or N/A -->
- **The issue is reproducible in vanilla Hyper.app**: <!-- Replace with info if applicable, or `Is Vanilla`. (Vanilla means Hyper.app without any add-ons or extras. Straight out of the box.) -->

Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ npm-debug.log
yarn-error.log

# optional dev config file and plugins directory
.hyper.js
.hyper_plugins
hyper.json
plugins

.DS_Store
.vscode/*
Expand Down
6 changes: 3 additions & 3 deletions PLUGINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Prerequisites and steps are described in the ["Contributing" section of our READ
Be sure to use the `canary` branch.

### Create a dev config file
Copy your config file `.hyper.js` to the root of your cloned repository. Hyper, in dev mode, will use this copied config file. That means that you can continue to use your main installation of Hyper with your day-to-day configuration.
After the first run, Hyper, in dev mode, will have created a new `.hyper_plugins` directory in your repository directory.
Copy your config file `hyper.json` to the root of your cloned repository. Hyper, in dev mode, will use this copied config file. That means that you can continue to use your main installation of Hyper with your day-to-day configuration.
After the first run, Hyper, in dev mode, will have created a new `plugins` directory in your repository directory.

### Setup your plugin
Go to your recently created `<repository_root>/.hyper_plugins/local` directory and create/clone your plugin repo. An even better method on macOS/Linux is to add a symlink to your plugin directory.
Go to your recently created `<repository_root>/plugins/local` directory and create/clone your plugin repo. An even better method on macOS/Linux is to add a symlink to your plugin directory.

Edit your dev config file, and add your plugin name (directory name in your `local` directory) in the `localPlugins` array.
```js
Expand Down
189 changes: 0 additions & 189 deletions app/config/config-default.js

This file was deleted.

5 changes: 3 additions & 2 deletions app/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {cfgPath} from './config/paths';

// Print diagnostic information for a few arguments instead of running Hyper.
if (['--help', '-v', '--version'].includes(process.argv[1])) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const {version} = require('./package');
const configLocation = process.platform === 'win32' ? `${process.env.userprofile}\\.hyper.js` : '~/.hyper.js';
console.log(`Hyper version ${version}`);
console.log('Hyper does not accept any command line arguments. Please modify the config file instead.');
console.log(`Hyper configuration file located at: ${configLocation}`);
console.log(`Hyper configuration file located at: ${cfgPath}`);
process.exit();
}

Expand Down
4 changes: 2 additions & 2 deletions app/menus/menus/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export default (commands: Record<string, string>, showAbout: () => void): MenuIt
---
<!-- ~/.hyper.js config -->
<!-- hyper.json config -->
- **${app.name} version**: ${env.TERM_PROGRAM_VERSION} "${app.getVersion()}"
- **OS ARCH VERSION:** ${platform} ${arch} ${release()}
- **Electron:** ${versions.electron} **LANG:** ${env.LANG}
- **SHELL:** ${env.SHELL} **TERM:** ${env.TERM}
<details><summary><strong>.hyper.js contents</strong></summary>
<details><summary><strong>hyper.json contents</strong></summary>
\`\`\`json
${JSON.stringify(getConfig(), null, 2)}
Expand Down
2 changes: 1 addition & 1 deletion app/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function syncPackageJSON() {
const dependencies = toDependencies(plugins);
const pkg = {
name: 'hyper-plugins',
description: 'Auto-generated from `~/.hyper.js`!',
description: 'Auto-generated from `hyper.json`!',
private: true,
version: '0.0.1',
repository: 'vercel/hyper',
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@
"app": "cross-env ELECTRONMON_LOGLEVEL=error electronmon target",
"dev": "concurrently -n \"Webpack,TypeScript\" -c \"cyan.bold,blue.bold\" \"webpack -w\" \"tsc --build -v --pretty --watch --preserveWatchOutput\" -k",
"build": "cross-env NODE_ENV=production webpack && tsc -b -v",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.json",
"test": "yarn run lint && yarn run test:unit",
"test:unit": "ava",
"test:unit:watch": "yarn run test:unit -- --watch",
"test:e2e": "ava --config ava-e2e.config.js",
"postinstall": "yarn run v8-snapshot && webpack --config-name hyper-app && electron-builder install-app-deps && yarn run rebuild-node-pty && cpy --cwd=target --parents \"node_modules/**/*\" \"../app/\" && husky install",
"postinstall": "yarn run v8-snapshot && webpack --config-name hyper-app && electron-builder install-app-deps && yarn run rebuild-node-pty && cpy --cwd=target --parents \"node_modules/**/*\" \"../app/\" && husky install && yarn run generate-schema",
"rebuild-node-pty": "electron-rebuild -f -o node-pty -m target",
"dist": "yarn run build && cross-env BABEL_ENV=production babel target/renderer/bundle.js --out-file target/renderer/bundle.js --no-comments --minified && electron-builder",
"clean": "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer",
"v8-snapshot": "cross-env npm_config_arch=x64 yarn run v8-snapshot:arch && cross-env npm_config_arch=arm64 yarn run v8-snapshot:arch",
"v8-snapshot:arch":"yarn run mk-snapshot && yarn run cp-snapshot",
"v8-snapshot:arch": "yarn run mk-snapshot && yarn run cp-snapshot",
"mk-snapshot": "cross-env ELECTRON_CUSTOM_VERSION=$npm_package_devDependencies_electron node node_modules/electron-mksnapshot/download-mksnapshot.js && node bin/mk-snapshot.js",
"cp-snapshot": "node bin/cp-snapshot.js"
"cp-snapshot": "node bin/cp-snapshot.js",
"generate-schema": "typescript-json-schema ./lib/config.d.ts rawConfig -o ./app/config/schema.json --required"
},
"license": "MIT",
"author": {
Expand Down Expand Up @@ -55,6 +56,7 @@
"shebang-loader": "0.0.1",
"styled-jsx": "5.1.1",
"stylis": "3.5.4",
"typescript-json-schema": "0.54.0",
"uuid": "9.0.0",
"webpack-cli": "5.0.1",
"xterm": "4.19.0",
Expand Down Expand Up @@ -114,6 +116,8 @@
"eslint": "7.32.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-json-schema-validator": "^4.0.2",
"eslint-plugin-jsonc": "^2.5.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.31.1",
"husky": "8.0.2",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"./lib/",
"./test/",
"./cli/",
"./",
"./"
],
"files": [
"./app/index.d.ts"
Expand Down
Loading

0 comments on commit de9dd14

Please sign in to comment.