Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

magpie-base

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magpie-base - npm Package Compare versions

Comparing version 0.1.8 to 0.2.1

lib/templates/src/magpie.config.js

10

lib/templates/package.json

@@ -13,11 +13,13 @@ {

"babel-eslint": "^10.1.0",
"csv-loader": "^3.0.3",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"stylelint": "^13.7.2",
"vue-template-compiler": "^2.6.11"
"vue-template-compiler": "^2.6.11",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-prettier": "^3.1.4"
},
"dependencies": {
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-prettier": "^3.1.4",
"magpie-base": "^0.1.8",
"lodash": "^4.17.20",
"magpie-base": "^0.2.0",
"vue": "^2.6.11"

@@ -24,0 +26,0 @@ },

3

lib/templates/src/main.js
import Vue from 'vue';
import VueMagpie from 'magpie-base';
import App from './App.vue';
import magpieConfig from './magpie.config.js';
Vue.config.productionTip = false;
Vue.use(VueMagpie);
Vue.use(VueMagpie, magpieConfig);

@@ -8,0 +9,0 @@ new Vue({

{
"name": "magpie-base",
"version": "0.1.8",
"version": "0.2.1",
"description": "Provides base components for _magpie frontend projects",

@@ -18,4 +18,6 @@ "author": "_magpie project",

"commander": "^5.1.0",
"csv-stringify": "^5.5.1",
"fs-extra": "^9.0.1",
"lodash": "^4.17.20",
"phoenix": "^1.5.6",
"slash": "^3.0.0",

@@ -22,0 +24,0 @@ "validate-npm-package-name": "^3.0.0",

@@ -15,7 +15,17 @@ # magpie-base

## Development
In order to spin up a web server with the docs run `npm run docs`.
The docs for the latest version are available at https://epic-bhabha-7e0966.netlify.app/
## Core Development
### Docs
In order to spin up a local web server with the docs run `npm run docs`.
In order to build the docs run `npm run docs:build`.
The docs for the latest version are available at https://epic-bhabha-7e0966.netlify.app/
The contents and organization of the docs are declared in `styleguide.config.js`. Each source folder should have a `docs.md` file with a general introduction to the feature in said folder.
The online docs are automatically built from the latest commit of the master branch.
### Vue components
All Vue components must be exported in `src/components/index.js` in order to be available in downstream projects without importing them.

@@ -10,2 +10,5 @@ export { default as Experiment } from './Experiment';

export { default as TextareaInput } from './inputs/TextareaInput';
export { default as Rsvp } from './stimuli/Rsvp';
export { default as ConnectInteractive } from './screens/ConnectInteractive';
export { default as Chat } from './interactive/Chat';
export { default as CategorizationMousetracking } from './screens/CategorizationMousetracking';

@@ -12,0 +15,0 @@ export { default as SelfPacedReading } from './screens/SelfPacedReading';

import * as components from './components';
export default function (Vue) {
export default function (Vue, config) {
// auto-import all components

@@ -8,8 +8,32 @@ Vue.mixin({

inject: {
$exp: {
$magpie: {
from: 'experiment',
default: () => ({})
}
},
magpie: config,
/**
* Register all socket events
*/
mounted() {
if (this.$options.socket) {
if (this.$magpie.socket) {
this.$magpie.socket.setUpSubscriptions(this.$options.socket, this);
}
}
},
/**
* unsubscribe when component unmounting
*/
beforeDestroy() {
if (this.$options.socket) {
if (this.$magpie.socket) {
this.$magpie.socket.tearDownSubscriptions(this.$options.socket);
}
}
}
});
}

@@ -11,2 +11,6 @@ const path = require('path');

{
name: 'Magpie',
content: 'src/docs.md'
},
{
name: 'Base Components',

@@ -17,9 +21,21 @@ components: 'src/components/*.vue'

name: 'Inputs',
content: 'src/components/inputs/docs.md',
components: 'src/components/inputs/*.vue'
},
{
name: 'Stimuli',
content: 'src/components/stimuli/docs.md',
components: 'src/components/stimuli/*.vue'
},
{
name: 'Screens',
content: 'src/components/screens/docs.md',
components: 'src/components/screens/*.vue'
},
{
name: 'Interactive',
content: 'src/components/interactive/docs.md',
components: 'src/components/interactive/*.vue'
},
{
name: 'Helpers',

@@ -32,3 +48,4 @@ components: 'src/components/helpers/*.vue'

// },
exampleMode: 'expand'
exampleMode: 'expand',
usageMode: 'expand'
};
import Vue from 'vue';
import MagpieVue from '../src/index';
Vue.use(MagpieVue);
Vue.mixin({
data() {
// For the timer docs
return { timer: null };
}
Vue.use(MagpieVue, {
experimentId: '171',
submissionUrl: 'https://magpie-demo.herokuapp.com/api/submit_experiment/',
socketUrl: 'wss://magpie-demo.herokuapp.com/socket',
contactEmail: 'test@random.com'
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc