@movable/behavioral-app
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -1,17 +0,57 @@ | ||
const rollupConfig = require("./rollup.config.js"); | ||
const babel = require('rollup-plugin-babel'); | ||
const resolve = require('rollup-plugin-node-resolve'); | ||
const commonjs = require('rollup-plugin-commonjs'); | ||
const replace = require('rollup-plugin-replace'); | ||
const postcss = require('rollup-plugin-postcss'); | ||
const image = require('rollup-plugin-image'); | ||
const babelrc = require('./babel-config'); | ||
const watchMode = process.env.KARMA_WATCH === 'true'; | ||
module.exports = function(config) { | ||
config.set({ | ||
browsers: ["ChromeHeadless"], | ||
frameworks: ["qunit"], | ||
files: ["app/js/index.js", "tests/helper.js", "tests/**/*.js", "app/index.html"], | ||
browsers: ['Chrome'], | ||
frameworks: ['qunit'], | ||
files: ['tests/tests.js'], | ||
crossOriginAttribute: false, // otherwise can't load remote scripts | ||
preprocessors: { | ||
"app/index.html": ["html2js"], | ||
"app/js/index.js": ["rollup"] | ||
'app/index.html': ['html2js'], | ||
'tests/tests.js': ['rollup'] | ||
}, | ||
rollupPreprocessor: rollupConfig | ||
html2jsPreprocessor: {}, | ||
rollupPreprocessor: { | ||
input: 'tests/index.js', | ||
context: 'window', | ||
plugins: [ | ||
babel(babelrc), | ||
resolve({ jsnext: true, browser: true }), | ||
commonjs(), | ||
postcss({ | ||
extract: 'dist/styles.css' | ||
}), | ||
image(), | ||
replace({ | ||
'process.env.NODE_ENV': JSON.stringify('production') | ||
}) | ||
], | ||
output: { | ||
format: 'iife', | ||
name: 'appTests', | ||
sourcemap: 'inline' | ||
} | ||
}, | ||
autoWatch: watchMode, | ||
singleRun: !watchMode, | ||
client: { | ||
clearContext: false, | ||
qunit: { | ||
showUI: true, | ||
testTimeout: 60000 | ||
} | ||
} | ||
}); | ||
}; |
{ | ||
"name": "<%= name %>", | ||
"version": "1.0.0", | ||
"private": true, | ||
"description": "Small description for <%= name %> goes here", | ||
"main": "app/js/index.js", | ||
"main": "app/index.js", | ||
"directories": { | ||
@@ -10,5 +11,7 @@ "test": "tests" | ||
"scripts": { | ||
"build": "node_modules/.bin/rollup -c rollup.config.js", | ||
"start": "SERVE=true node_modules/.bin/rollup -c rollup.config.js", | ||
"test": "node_modules/.bin/karma start --single-run --browsers ChromeHeadless" | ||
"build": "rollup -c -m", | ||
"start": "SERVE=true rollup -c rollup.config.js -w", | ||
"test": "karma start --single-run --browsers ChromeHeadless", | ||
"develop-test": "KARMA_WATCH=true karma start", | ||
"push-local": "rm -rf dist && ../../bin/push-dev-cartridge" | ||
}, | ||
@@ -20,18 +23,44 @@ "repository": "", | ||
"dependencies": { | ||
"cropduster": "^6.0.0", | ||
"jquery": "^3.2.1", | ||
"studio-app": "^1.5.0", | ||
"sherlockapi": "git+ssh://git@github.com/movableink/sherlockAPI.git#10.0.0" | ||
"@babel/runtime-corejs2": "^7.1.2", | ||
"@movable-internal/sherlockapi": "11.0.0", | ||
"@movable/studio-framework": "^1.0.0", | ||
"@movable/studio-framework-test-helpers": "^1.0.0", | ||
"cropduster": "^6.0.1", | ||
"react": "^16.6.0", | ||
"react-dom": "^16.6.0" | ||
}, | ||
"devDependencies": { | ||
"karma": "^1.7.1", | ||
"@babel/core": "^7.1.2", | ||
"@babel/plugin-external-helpers": "^7.0.0", | ||
"@babel/plugin-transform-runtime": "^7.1.0", | ||
"@babel/preset-env": "^7.1.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"karma": "^3.1.1", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-html2js-preprocessor": "^1.1.0", | ||
"karma-qunit": "^1.2.1", | ||
"karma-rollup-preprocessor": "https://github.com/movableink/karma-rollup-preprocessor#multi-config", | ||
"qunit": "^1.0.0", | ||
"rollup": "^0.51.3", | ||
"rollup-plugin-serve": "0.4.2", | ||
"rollup-split-index": "https://github.com/movableink/rollup-split-index.git#e4d355d" | ||
"karma-qunit": "^2.1.0", | ||
"karma-rollup-preprocessor": "^6.1.0", | ||
"qunit": "^2.7.1", | ||
"rollup": "^0.66.6", | ||
"rollup-plugin-babel": "^4.0.0", | ||
"rollup-plugin-babel-minify": "^6.1.1", | ||
"rollup-plugin-commonjs": "^9.2.0", | ||
"rollup-plugin-image": "^1.0.2", | ||
"rollup-plugin-node-resolve": "^3.4.0", | ||
"rollup-plugin-postcss": "^1.6.1", | ||
"rollup-plugin-replace": "^2.1.0", | ||
"rollup-plugin-serve": "^0.6.0", | ||
"rollup-plugin-url": "^2.0.1", | ||
"rollup-split-index": "https://github.com/movableink/rollup-split-index.git#e4d355d", | ||
"sinon": "^7.1.0" | ||
}, | ||
"workspaces": { | ||
"nohoist": [ | ||
"karma", | ||
"karma-chrome-launcher", | ||
"karma-html2js-preprocessor", | ||
"karma-qunit", | ||
"karma-rollup-preprocessor" | ||
] | ||
} | ||
} |
@@ -1,18 +0,42 @@ | ||
const config = require("./package.json"); | ||
const resolve = require("rollup-plugin-node-resolve"); | ||
const commonjs = require("rollup-plugin-commonjs"); | ||
const serve = require("rollup-plugin-serve"); | ||
const { importExportToGlobal, dependenciesOnly } = require("rollup-split-index"); | ||
const inputFile = config.main; // likely index.js | ||
const config = require('./package.json'); | ||
const resolve = require('rollup-plugin-node-resolve'); | ||
const commonjs = require('rollup-plugin-commonjs'); | ||
const serve = require('rollup-plugin-serve'); | ||
const babel = require('rollup-plugin-babel'); | ||
const postcss = require('rollup-plugin-postcss'); | ||
const image = require('rollup-plugin-image'); | ||
const replace = require('rollup-plugin-replace'); | ||
const babelrc = require('./babel-config'); | ||
const minify = require('rollup-plugin-babel-minify'); | ||
const { | ||
importExportToGlobal, | ||
dependenciesOnly | ||
} = require('rollup-split-index'); | ||
const inputFile = config.main; | ||
const vendorTree = { | ||
// only used to determine which files to include in vendor tree | ||
input: inputFile, | ||
plugins: [resolve(), commonjs(), dependenciesOnly()], | ||
plugins: [ | ||
babel(babelrc), | ||
resolve({ jsnext: true, browser: true }), | ||
commonjs(), | ||
postcss({ | ||
extract: 'dist/styles.css' | ||
}), | ||
image(), | ||
dependenciesOnly(), | ||
replace({ | ||
'process.env.NODE_ENV': JSON.stringify('production') | ||
}), | ||
minify({ comments: false, sourceMap: true }) | ||
], | ||
output: { | ||
// Vendor dependencies will be stored in the global namespace under this variable name | ||
name: "studioDependencies", | ||
file: "dist/vendor.js", | ||
format: "iife" | ||
name: 'studioDependencies', | ||
file: 'dist/vendor.js', | ||
format: 'iife' | ||
} | ||
}; | ||
const indexTree = { | ||
@@ -22,2 +46,7 @@ input: inputFile, | ||
resolve(), | ||
postcss({ | ||
extract: 'dist/styles.css' | ||
}), | ||
image(), | ||
babel(babelrc), | ||
commonjs(), | ||
@@ -27,8 +56,27 @@ importExportToGlobal({ importName: vendorTree.output.name }) | ||
output: { | ||
file: "dist/index.js", | ||
// output format is es6, but with imports/exports rewritten to es5 | ||
format: "es" | ||
file: 'dist/index.js', | ||
format: 'iife' | ||
} | ||
}; | ||
const dummyTree = { | ||
input: 'app/dummy/dummy.js', | ||
plugins: [ | ||
resolve(), | ||
postcss({ | ||
extract: 'dist/styles.css' | ||
}), | ||
image(), | ||
babel(babelrc), | ||
commonjs(), | ||
replace({ | ||
'process.env.NODE_ENV': JSON.stringify('development') | ||
}) | ||
], | ||
output: { | ||
file: 'dist/dummy/dummy.js', | ||
format: 'iife' | ||
} | ||
}; | ||
if (process.env.SERVE) { | ||
@@ -38,2 +86,2 @@ vendorTree.plugins.push(serve()); | ||
module.exports = [vendorTree, indexTree]; | ||
module.exports = [vendorTree, indexTree, dummyTree]; |
@@ -1,20 +0,1 @@ | ||
const container = document.createElement('div'); | ||
container.classNames = 'container'; | ||
document.body.appendChild(container); | ||
QUnit.module('<%= name %>', { | ||
beforeEach: function(assert) { | ||
container.innerHTML = wysiwygContent(); | ||
}, | ||
afterEach: function(assert) { | ||
container.innerHTML = ''; | ||
} | ||
}); | ||
QUnit.test('an app', function(assert) { | ||
CD._urlParams = { mi_bar: 'a_value' }; | ||
const app = new <%= namespace %>(); | ||
assert.equal(app.tags.length, 1, 'has a tag'); | ||
}); | ||
import './app/app-test'; |
{ | ||
"name": "@movable/behavioral-app", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Movable CLI blueprint for initializing a new behavioral application.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"release": "release-it" | ||
}, | ||
@@ -25,3 +26,6 @@ "repository": { | ||
"main": "ember-addon-main.js" | ||
}, | ||
"devDependencies": { | ||
"release-it": "^10.2.0" | ||
} | ||
} |
@@ -15,1 +15,7 @@ # Behavioral App Blueprint | ||
Copyright 2018 Movable, Inc. All rights reserved. | ||
## Releasing Updates | ||
This package is deployed to npm using [`release-it`](https://github.com/webpro/release-it#readme). | ||
To release, run `npm run release`, and choose the appropriate version based on [SemVer](https://semver.org) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
210626
26
555
21
1
3
2