Skip to content

Commit

Permalink
🌱 initial commit
Browse files Browse the repository at this point in the history
♻️ upgrade and reclaim stuff

♻️ adjustments + upgrade package

♻️ rename and preserve src
  • Loading branch information
leonardoventurini committed Feb 23, 2020
0 parents commit 56cc185
Show file tree
Hide file tree
Showing 51 changed files with 10,211 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015","react"]
}
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
chrome/build/bundle.js
chrome/scripts/lib
node_modules
50 changes: 50 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"parser": "babel-eslint",
"plugins": [
"react"
],
"env": {
"browser": true,
"node": true
},
"rules": {
"react/jsx-boolean-value": 1,
"react/jsx-no-undef": 1,
"jsx-quotes": [2, "prefer-double"],
"react/jsx-sort-props": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-unknown-property": 1,
"react/prop-types": 1,
"react/self-closing-comp": 1,
"react/sort-comp": 0,
"react/wrap-multilines": 1,

// In declarations, required props should be separate
"react/jsx-sort-prop-types": 0,

// Useful for "inner" components
"react/no-multi-comp": 0,

// babel does this automatically
"react/display-name": 0,

// Not needed, and we usually do `var {Component} = require('react');`
"react/react-in-jsx-scope": 0,

// babel removes these
"comma-dangle": 0,

"quotes": [2, "single"],
"no-unused-expressions": 0,
"no-underscore-dangle": 0,
"no-use-before-define": 0,
"strict": 0,
"no-loop-func": 0,
"new-cap": 0,
"no-unused-vars": 0,
"curly": [2, "multi-line"]
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
.idea
node_modules
chrome/build
49 changes: 49 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- "4"
sudo: false
22 changes: 22 additions & 0 deletions GUIDES.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Things **NOT** to do in Meteor

## Overpublishing user data

Limit fields published using Meteor.users.find()

```
Looks harmless right? Yeah, it would seem so, until you go into your browser console and type Meteor.users.find({}).fetch() and inspect the records that come back. You've just published all the data for any users attached to games, such as oauth tokens, bcrypted password hash, resume tokens, etc. This move will earn you the nickname 'LinkedIn' from your peers :)
```
via Josh Owens in [Meteor Security 101](http://joshowens.me/meteor-security-101/)

## Using client-side operations with collections

Do not invoke insert/update/remove directly on collections from client side, user methods instead

```
- Collections can only be updated through methods (no client-side operations).
- We'll use two-tiered methods along with the mutator pattern.
```
via David Weldon in [meteor: how we define methods](https://dweldon.silvrback.com/methods)


38 changes: 38 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
![Meteor DevTools Extension](https://dl.dropboxusercontent.com/u/9224326/meteor-devtools-1.1.1.gif)
# Meteor Dev Tools Chrome Extension
[![Build Status](https://travis-ci.org/thebakeryio/meteor-devtools.svg)](https://travis-ci.org/thebakeryio/meteor-devtools)
[![Dependency Status](https://david-dm.org/thebakeryio/meteor-devtools.svg)](https://david-dm.org/thebakeryio/meteor-devtools)
[![devDependency Status](https://david-dm.org/thebakeryio/meteor-devtools/dev-status.svg)](https://david-dm.org/thebakeryio/meteor-devtools#info=devDependencies)
[![ES-2015](https://img.shields.io/badge/ES-2015-brightgreen.svg)](https://babeljs.io/docs/learn-es2015/)

Meteor Devtools (MD) is an extension for Chrome Developer Tools that makes the process of developing Meteor apps even more enjoyable. It also allows you to look under the hood of existing applications and learn how they are built. MD includes a plugin framework and currrently comes with 3 plugins: DDP Monitor, Blaze Inspector and MiniMongo Explorer. You can [install](https://chrome.google.com/webstore/detail/meteor-devtools/ippapidnnboiophakmmhkdlchoccbgje) it from Chrome Web Store.

## Development

Running local dev server

```bash
npm start
```

Running tests while developing (with reload)

```bash
npm test -- --watch
```

Building chrome extension for local testing (result in ./chrome)

```bash
npm run chrome
```

Building chrome extension for production (result in ./chrome)

```bash
npm run chrome:build
```

## Credits

Meteor Devtools Extension is made by Meteor loving folks at [The Bakery](http://thebakery.io). Blaze Inspector is inspired by [React Devtools](https://github.com/facebook/react-devtools) and uses Element highlighter from that project.
5 changes: 5 additions & 0 deletions chrome/devtools.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<script src="scripts/devtools.js"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions chrome/fontawesome/css/font-awesome.min.css

Large diffs are not rendered by default.

Binary file not shown.
Binary file added chrome/icons/client-added.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/client-changed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/client-connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/client-method.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/client-ping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/client-pong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/client-removed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/client-sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/client.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/icon19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server-added.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server-changed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server-connected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server-ping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server-pong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server-ready.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server-removed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server-result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server-updated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/icons/toolbarButtonGlyphs_2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "Meteor DevTools",
"version": "1.6.0",
"description": "Developer tools for Meteor",
"background" : {
"scripts": ["scripts/background.js"],
"persistent": false
},
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"content_scripts": [{
"matches": ["<all_urls>"],
"js": ["scripts/content.js"],
"run_at": "document_end",
"all_frames": true
}],
"content_security_policy": "script-src 'self' 'unsafe-eval' https://www.google-analytics.com; object-src 'self'",

"devtools_page": "devtools.html",
"options_page": "panel.html",
"manifest_version": 2
}
13 changes: 13 additions & 0 deletions chrome/panel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="/styles/icons.css">
<link rel="stylesheet" href="/fontawesome/css/font-awesome.min.css">
<title>Meteor Devtools</title>
</head>
<body>
<div class="app-container"></div>
<script src="build/bundle.js"></script>
</body>
</html>
37 changes: 37 additions & 0 deletions chrome/scripts/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var connections = {};

// Receive message from content script and relay to the devTools page for the
// current tab
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
// Messages from content scripts should have sender.tab set
if (sender.tab) {
var tabId = sender.tab.id;
if (tabId in connections) {
connections[tabId].postMessage(request);
}
}
return true;
});

chrome.runtime.onConnect.addListener(function(port) {
// Listen to messages sent from the DevTools page
port.onMessage.addListener(function(request) {
// Register initial connection
if (request.name === 'init') {
connections[request.tabId] = port;

port.onDisconnect.addListener(function() {
delete connections[request.tabId];
});

return;
}
});

});

chrome.tabs.onRemoved.addListener(function (tabId) {
if (connections[tabId]) {
delete connections[tabId];
}
});
16 changes: 16 additions & 0 deletions chrome/scripts/content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
window.addEventListener('message', function(event) {
// Only accept messages from same frame
if (event.source !== window) {
return;
}

var message = event.data;

// Only accept messages that we know are ours
if (typeof message !== 'object' || message === null ||
(message.source !== 'ddp-monitor-extension')) {
return;
}

chrome.runtime.sendMessage(message);
});
1 change: 1 addition & 0 deletions chrome/scripts/devtools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chrome.devtools.panels.create('Meteor', 'assets/icons/icon16.png', 'panel.html');
88 changes: 88 additions & 0 deletions chrome/styles/icons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
.client, .server {
height: 24px;
width: 24px;
display: inline-block;
vertical-align: middle;
margin-right: 5px;
background-size: 100%;
}

.server {
background-image: url('../icons/server.png');
}

.server.added {
background-image: url('../icons/server-added.png');
}

.server.removed {
background-image: url('../icons/server-removed.png');
}

.server.updated {
background-image: url('../icons/server-updated.png');
}

.server.changed {
background-image: url('../icons/server-changed.png');
}

.server.ping {
background-image: url('../icons/server-ping.png');
}

.server.pong {
background-image: url('../icons/server-pong.png');
}

.server.ready {
background-image: url('../icons/server-ready.png');
}

.server.connected {
background-image: url('../icons/server-connected.png');
}

.server.result {
background-image: url('../icons/server-result.png');
}

.client {
background-image: url('../icons/client.png');
}

.client.added {
background-image: url('../icons/client-added.png');
}

.client.removed {
background-image: url('../icons/client-removed.png');
}

.client.changed {
background-image: url('../icons/client-changed.png');
}

.client.sub {
background-image: url('../icons/client-sub.png');
}

.client.ping {
background-image: url('../icons/client-ping.png');
}

.client.pong {
background-image: url('../icons/client-pong.png');
}

.client.method {
background-image: url('../icons/client-method.png');
}

.client.connect {
background-image: url('../icons/client-connect.png');
}

.toolbar-glyph {
-webkit-mask-image: url('../icons/toolbarButtonGlyphs_2x.png');
}
Loading

0 comments on commit 56cc185

Please sign in to comment.