Skip to content

Commit a0d2a4a

Browse files
committed
Initial commit
0 parents  commit a0d2a4a

File tree

117 files changed

+15272
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+15272
-0
lines changed

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
'root': true,
3+
'env': {
4+
'browser': true
5+
},
6+
'extends': [
7+
'standard',
8+
'plugin:vue/recommended'
9+
],
10+
'globals': {
11+
'bridge': true,
12+
'chrome': true,
13+
'localStorage': true,
14+
'HTMLDocument': true
15+
},
16+
'rules': {
17+
'vue/html-closing-bracket-newline': ['error', {
18+
'singleline': 'never',
19+
'multiline': 'always'
20+
}]
21+
}
22+
}

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
.DS_Store
3+
build
4+
*.zip
5+
*.xpi
6+
tests_output
7+
selenium-debug.log
8+
TODOs.md
9+
.idea
10+
.web-extension-id

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Marcel Pociot
4+
Copyright (c) 2014-2020 Evan You
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Livewire Devtools
2+
3+
Debug your Livewire component state.
4+
5+
<p align="center"><img src="https://raw.githubusercontent.com/beyondcode/livewire-devtools/master/media/screenshot-shadow.png" alt="screenshot"></p>
6+
7+
### Installation
8+
9+
This extension does not yet have a stable version publicly available.
10+
11+
### Manual Installation
12+
13+
**Make sure you are using Node 6+ and NPM 3+**
14+
15+
1. Clone this repo
16+
2. `npm install` (Or `yarn install` if you are using yarn as the package manager)
17+
3. `npm run build`
18+
4. Open Chrome extension page
19+
5. Check "developer mode"
20+
6. Click "load unpacked extension", and choose `shells/chrome`.
21+
22+
### Hacking
23+
24+
1. Clone this repo
25+
2. `npm install`
26+
3. `npm run dev`
27+
4. A plain shell with a test app will be available at `localhost:8080`.
28+
29+
### Testing as Firefox addon
30+
31+
1. Install `web-ext`
32+
33+
~~~~
34+
$ npm install --global web-ext
35+
~~~~
36+
37+
Or, for Yarn:
38+
39+
~~~~
40+
$ yarn global add web-ext
41+
~~~~
42+
43+
Also, make sure `PATH` is set up. Something like this in `~/.bash_profile`:
44+
45+
~~~~
46+
$ PATH=$PATH:$(yarn global bin)
47+
~~~~
48+
49+
2. Build and run in Firefox
50+
51+
~~~~
52+
$ npm run build
53+
$ npm run run:firefox
54+
~~~~
55+
56+
When using Yarn, just replace `npm` with `yarn`.
57+
58+
59+
### License
60+
61+
[MIT](http://opensource.org/licenses/MIT)

media/screenshot-shadow.png

160 KB
Loading

package.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"name": "livewire-devtools",
3+
"version": "1.0.0",
4+
"description": "devtools for Livewire!",
5+
"main": "index.js",
6+
"scripts": {
7+
"dev": "cross-env PORT=8100 npm run dev:shell",
8+
"dev:shell": "cd shells/dev && webpack-dev-server --inline --hot --no-info",
9+
"dev:chrome": "cd shells/chrome && webpack --watch --hide-modules",
10+
"lint": "eslint src --ext=js,vue && eslint shells/chrome/src && eslint shells/dev/src && eslint shells/electron/src",
11+
"build": "cd shells/chrome && cross-env NODE_ENV=production webpack --progress --hide-modules",
12+
"run:firefox": "web-ext run -s shells/chrome -a dist -i src",
13+
"zip": "npm run zip:chrome && npm run zip:firefox",
14+
"zip:chrome": "cd shells && zip -r -FS ../dist/chrome.zip chrome -x *src/* -x *webpack.config.js",
15+
"zip:firefox": "web-ext build -s shells/chrome -a dist -i src --overwrite-dest",
16+
"sign:firefox": "cross-env web-ext sign --api-key=$LIVEWIRE_DEVTOOLS_AMO_KEY --api-secret=$LIVEWIRE_DEVTOOLS_AMO_SECRET -s shells/chrome -a dist -i src --id='{b432f069-95af-4ac7-8306-a5476489c281}'",
17+
"release": "node release.js && npm run test && npm run build && npm run zip",
18+
"release:beta": "cross-env RELEASE_CHANNEL=beta npm run release && npm run sign:firefox",
19+
"test": "npm run lint && npm run test:e2e",
20+
"test:e2e": "cross-env PORT=4040 start-server-and-test dev:shell http://localhost:4040 test:e2e:run",
21+
"test:e2e:run": "cypress run --config baseUrl=http://localhost:4040",
22+
"test:open": "cypress open --config baseUrl=http://localhost:8100"
23+
},
24+
"repository": {
25+
"type": "git",
26+
"url": "git+https://github.com/beyondcode/livewire-devtools.git"
27+
},
28+
"keywords": [
29+
"livewire",
30+
"devtools"
31+
],
32+
"author": "Marcel Pociot",
33+
"license": "MIT",
34+
"bugs": {
35+
"url": "https://github.com/beyondcode/livewire-devtools/issues"
36+
},
37+
"homepage": "https://github.com/beyondcode/livewire-devtools#readme",
38+
"dependencies": {
39+
"@vue/ui": "^0.5.1",
40+
"circular-json-es6": "^2.0.1",
41+
"lodash.debounce": "^4.0.8",
42+
"lodash.groupby": "^4.6.0",
43+
"uglifyjs-webpack-plugin": "^1.1.4",
44+
"vue": "^2.5.13",
45+
"vue-router": "^3.0.1",
46+
"vuex": "^3.0.1"
47+
},
48+
"devDependencies": {
49+
"buble": "^0.19.0",
50+
"buble-loader": "^0.4.1",
51+
"cross-env": "^5.1.3",
52+
"css-loader": "^0.28.7",
53+
"cypress": "^3.0.2",
54+
"eslint": "^5.2.0",
55+
"eslint-config-standard": "^11.0.0",
56+
"eslint-plugin-cypress": "^2.0.1",
57+
"eslint-plugin-import": "^2.13.0",
58+
"eslint-plugin-node": "^7.0.1",
59+
"eslint-plugin-promise": "^3.8.0",
60+
"eslint-plugin-standard": "^3.1.0",
61+
"eslint-plugin-vue": "next",
62+
"file-loader": "^1.1.6",
63+
"friendly-errors-webpack-plugin": "^1.6.1",
64+
"inquirer": "^5.0.0",
65+
"launch-editor-middleware": "^2.1.0",
66+
"raw-loader": "^0.5.1",
67+
"semver": "^5.4.1",
68+
"start-server-and-test": "^1.5.0",
69+
"stylus": "^0.54.5",
70+
"stylus-loader": "^3.0.1",
71+
"url-loader": "^0.6.2",
72+
"vue-loader": "^15.0.0-beta.1",
73+
"vue-template-compiler": "^2.5.13",
74+
"webpack": "^3.10.0",
75+
"webpack-dev-server": "^2.9.7",
76+
"webpack-merge": "^4.1.2"
77+
},
78+
"engines": {
79+
"node": ">=8.10"
80+
}
81+
}

release.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
const fs = require('fs')
2+
const inquirer = require('inquirer')
3+
const semver = require('semver')
4+
const pkg = require('./package.json')
5+
const manifest = require('./shells/chrome/manifest.json')
6+
7+
const curVersion = pkg.version
8+
9+
;(async () => {
10+
const { newVersion } = await inquirer.prompt([{
11+
type: 'input',
12+
name: 'newVersion',
13+
message: `Please provide a version (current: ${curVersion}):`,
14+
}])
15+
16+
if (!semver.valid(newVersion)) {
17+
console.error(`Invalid version: ${newVersion}`)
18+
process.exit(1)
19+
}
20+
21+
if (semver.lt(newVersion, curVersion)) {
22+
console.error(`New version (${newVersion}) cannot be lower than current version (${curVersion}).`)
23+
process.exit(1)
24+
}
25+
26+
const { yes } = await inquirer.prompt([{
27+
name: 'yes',
28+
message: `Release ${newVersion}?`,
29+
type: 'confirm'
30+
}])
31+
32+
if (yes) {
33+
const isBeta = newVersion.includes('beta')
34+
pkg.version = newVersion
35+
if (isBeta) {
36+
const [, baseVersion, betaVersion] = /(.*)-beta\.(\w+)/.exec(newVersion)
37+
manifest.version = `${baseVersion}.${betaVersion}`
38+
applyIcons(manifest, '-beta')
39+
} else {
40+
manifest.version = newVersion
41+
applyIcons(manifest)
42+
}
43+
44+
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2))
45+
fs.writeFileSync('./shells/chrome/manifest.json', JSON.stringify(manifest, null, 2))
46+
} else {
47+
process.exit(1)
48+
}
49+
})()
50+
51+
function applyIcons (manifest, suffix = '') {
52+
[16, 48, 128].forEach(size => {
53+
manifest.icons[size] = `icons/${size}${suffix}.png`
54+
})
55+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<meta charset="utf-8">
2+
<script src="./build/devtools-background.js"></script>

shells/chrome/devtools.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title></title>
6+
<style>
7+
html, body {
8+
height: 100%;
9+
}
10+
#container {
11+
display: flex;
12+
height: 100%;
13+
}
14+
</style>
15+
</head>
16+
<body>
17+
<div id="container">
18+
<div id="app"></div>
19+
</div>
20+
<script src="./build/devtools.js"></script>
21+
</body>
22+
</html>

shells/chrome/icons/128-gray.png

8.94 KB
Loading

0 commit comments

Comments
 (0)