From 60dcf005f83ee0607df2ae4da0e4559e0fa06c45 Mon Sep 17 00:00:00 2001 From: Micha Mazaheri Date: Fri, 5 Aug 2016 10:17:30 +0200 Subject: [PATCH 01/12] Initial commit --- LICENSE | 21 +++++++++++++++++++++ README.md | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fbe3c93 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Paw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c4549a7 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Paw-HARGenerator +A HAR generator for Paw (WORK IN PROGRESS). From 60da6d785752df52ac3ca0bc4b53a9dc36e941f6 Mon Sep 17 00:00:00 2001 From: JonathanMontane Date: Mon, 8 Aug 2016 10:47:26 +0200 Subject: [PATCH 02/12] created boilerplate for Generators --- .babelrc | 10 + .gitignore | 6 + Makefile | 32 +++ linting/eslint_base.yaml | 248 +++++++++++++++++++++++ linting/prod.yaml | 2 + package.json | 37 ++++ scripts/build.sh | 3 + scripts/lint.sh | 3 + scripts/release.sh | 13 ++ scripts/test.sh | 2 + scripts/transfer.sh | 6 + src/Generator.js | 22 ++ src/__mocks__/Mocks.js | 64 ++++++ src/__mocks__/PawMocks.js | 88 ++++++++ src/__mocks__/Shims.js | 18 ++ src/__mocks__/__tests__/Mocks-test.js | 187 +++++++++++++++++ src/__mocks__/__tests__/PawMocks-test.js | 58 ++++++ src/__tests__/HARGenerator-test.js | 0 src/__utils__/TestUtils.js | 248 +++++++++++++++++++++++ webpack.config.babel.js | 39 ++++ 20 files changed, 1086 insertions(+) create mode 100644 .babelrc create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 linting/eslint_base.yaml create mode 100644 linting/prod.yaml create mode 100644 package.json create mode 100644 scripts/build.sh create mode 100644 scripts/lint.sh create mode 100644 scripts/release.sh create mode 100644 scripts/test.sh create mode 100644 scripts/transfer.sh create mode 100644 src/Generator.js create mode 100644 src/__mocks__/Mocks.js create mode 100644 src/__mocks__/PawMocks.js create mode 100644 src/__mocks__/Shims.js create mode 100644 src/__mocks__/__tests__/Mocks-test.js create mode 100644 src/__mocks__/__tests__/PawMocks-test.js create mode 100644 src/__tests__/HARGenerator-test.js create mode 100644 src/__utils__/TestUtils.js create mode 100644 webpack.config.babel.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..b007506 --- /dev/null +++ b/.babelrc @@ -0,0 +1,10 @@ +{ + 'presets': [ + 'es2015', + 'stage-0', + 'stage-1', + 'stage-2', + 'stage-3' + ], + 'plugins': ['transform-runtime', 'transform-decorators-legacy'] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7b627c3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Build +dist/ +release/ +node_modules/ +lib/ +.DS_Store diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..41ce70f --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +BASE=$(shell pwd) +SCRIPTS=$(BASE)/scripts + +# Setup commands +install: + npm install + +# Validation commands +lint: + sh "$(SCRIPTS)/lint.sh" $(BASE) + +test: + sh "$(SCRIPTS)/test.sh" $(BASE) + +validate: lint test + +# Build commands +build: + sh "$(SCRIPTS)/build.sh" $(BASE) + +release: + sh "$(SCRIPTS)/release.sh" $(BASE) + +deploy: install build release + +transfer: + sh "$(SCRIPTS)/transfer.sh" $(BASE) + +# Super commands +paw-extension: deploy transfer + +paw-fast: build release transfer diff --git a/linting/eslint_base.yaml b/linting/eslint_base.yaml new file mode 100644 index 0000000..6de2a2d --- /dev/null +++ b/linting/eslint_base.yaml @@ -0,0 +1,248 @@ +--- +env: + browser: true + node: true + es6: true +parser: babel-eslint +globals: + ga: true + mixpanel: true + olark: true + Raven: true +ecmaFeatures: + arrowFunctions: true + binaryLiterals: true + blockBindings: true + classes: true + defaultParams: true + destructuring: true + forOf: true + generators: true + modules: true + objectLiteralComputedProperties: true + objectLiteralDuplicateProperties: true + objectLiteralShorthandMethods: true + objectLiteralShorthandProperties: true + octalLiterals: true + regexUFlag: true + regexYFlag: true + spread: true + superInFunctions: true + templateStrings: true + unicodeCodePointEscapes: true + globalReturn: true + jsx: true +rules: + comma-dangle: 2 + no-cond-assign: 2 + no-console: 2 + no-constant-condition: 2 + no-control-regex: 2 + no-debugger: 2 + no-dupe-args: 2 + no-dupe-keys: 2 + no-duplicate-case: 2 + no-empty: 2 + no-empty-character-class: 2 + no-ex-assign: 2 + no-extra-boolean-cast: 2 + no-extra-semi: 2 + no-func-assign: 2 + no-inner-declarations: 2 + no-invalid-regexp: 2 + no-irregular-whitespace: 2 + no-negated-in-lhs: 2 + no-obj-calls: 2 + no-regex-spaces: 2 + no-sparse-arrays: 2 + no-unreachable: 2 + use-isnan: 2 + valid-jsdoc: 2 + valid-typeof: 2 + block-scoped-var: 0 + complexity: 0 + consistent-return: 0 + curly: 2 + default-case: 2 + dot-notation: 2 + eqeqeq: 2 + guard-for-in: 2 + no-alert: 0 + no-caller: 2 + no-div-regex: 2 + no-else-return: 0 # nicer to have strong if/else logic + no-empty-label: 2 + no-eq-null: 2 + no-eval: 2 + no-extend-native: 2 + no-extra-bind: 2 + no-fallthrough: 2 + no-floating-decimal: 2 + no-implied-eval: 2 + no-iterator: 2 + no-labels: 2 + no-lone-blocks: 2 + no-loop-func: 2 + no-multi-spaces: 2 + no-multi-str: 2 + no-native-reassign: 2 + no-new: 2 + no-new-func: 2 + no-new-wrappers: 2 + no-octal: 2 + no-octal-escape: 2 + no-param-reassign: 2 + no-process-env: 0 + no-proto: 2 + no-redeclare: 2 + no-return-assign: 2 + no-script-url: 2 + no-self-compare: 2 + no-sequences: 2 + no-throw-literal: 2 + no-unused-expressions: 2 + no-void: 2 + no-warning-comments: + - 0 + - terms: + - todo + - fixme + location: start + no-with: 2 + radix: 2 + vars-on-top: 2 + wrap-iife: 2 + yoda: 2 + strict: 0 + no-catch-shadow: 2 + no-delete-var: 2 + no-label-var: 2 + no-shadow: 2 + no-shadow-restricted-names: 2 + no-undef: 2 + no-undef-init: 2 + no-undefined: 2 + no-unused-vars: 2 + no-use-before-define: 2 + indent: + - 1 + - 4 + - SwitchCase: 1 + brace-style: + - 1 + - stroustrup + - allowSingleLine: true + camelcase: 0 + comma-spacing: + - 1 + - before: false + after: true + comma-style: + - 1 + - last + consistent-this: + - 1 + - _this + eol-last: 1 + func-names: 0 + func-style: 0 + key-spacing: + - 1 + - beforeColon: false + afterColon: true + max-nested-callbacks: + - 1 + - 3 + new-cap: + - 1 + - newIsCap: true + capIsNew: false + new-parens: 1 + newline-after-var: 0 + no-array-constructor: 1 + no-inline-comments: 1 + no-lonely-if: 1 + no-mixed-spaces-and-tabs: 1 + no-multiple-empty-lines: + - 1 + - max: 2 + no-nested-ternary: 1 + no-new-object: 1 + no-spaced-func: 1 + no-ternary: 0 + no-trailing-spaces: 1 + no-underscore-dangle: 0 + no-extra-parens: 1 + one-var: + - 1 + - never + operator-assignment: 0 + padded-blocks: + - 1 + - never + quote-props: + - 1 + - as-needed + quotes: + - 1 + - single + semi: + - 1 + - "never" + semi-spacing: + - 1 + - before: false + after: true + sort-vars: 0 + space-after-keywords: + - 1 + - always + space-before-blocks: + - 1 + - always + space-before-function-paren: + - 1 + - anonymous: never + named: never + object-curly-spacing: + - 1 + - always + array-bracket-spacing: + - 1 + - always + computed-property-spacing: + - 1 + - never + space-in-parens: + - 1 + - never + space-infix-ops: + - 1 + space-return-throw-case: + - 1 + space-unary-ops: + - 1 + - words: true + nonwords: false + spaced-comment: + - 1 + - always + wrap-regex: 0 + no-var: 2 + generator-star-spacing: + - 2 + - before + max-depth: + - 2 + - 4 + max-len: + - 2 + - 80 + - 2 + max-params: + - 2 + - 6 + max-statements: 0 + no-bitwise: 0 + no-plusplus: 2 + diff --git a/linting/prod.yaml b/linting/prod.yaml new file mode 100644 index 0000000..eaa9fda --- /dev/null +++ b/linting/prod.yaml @@ -0,0 +1,2 @@ +--- +extends: ./eslint_base.yaml diff --git a/package.json b/package.json new file mode 100644 index 0000000..9821dac --- /dev/null +++ b/package.json @@ -0,0 +1,37 @@ +{ + "name": "Paw-HARGenerator", + "version": "0.1.0", + "dependencies": { + "babel-plugin-transform-flow-strip-types": "6.3.15", + "babel-polyfill": "6.3.14", + "babel-runtime": "6.3.19" + }, + "devDependencies": { + "immutable": "3.7.6", + "babel-cli": "6.6.5", + "babel-core": "6.4.0", + "babel-eslint": "4.1.8", + "babel-loader": "6.2.0", + "babel-plugin-rewire": "1.0.0-beta-3", + "babel-plugin-transform-class-properties": "^6.6.0", + "babel-plugin-transform-decorators": "6.3.13", + "babel-plugin-transform-decorators-legacy": "1.3.2", + "babel-plugin-transform-runtime": "6.3.13", + "babel-preset-es2015": "6.3.13", + "babel-preset-stage-0": "6.3.13", + "babel-preset-stage-1": "6.3.13", + "babel-preset-stage-2": "6.3.13", + "babel-preset-stage-3": "6.3.13", + "babel-register": "6.3.13", + "chai": "3.4.1", + "eslint": "1.3.1", + "eslint-loader": "1.0.0", + "json-loader": "^0.5.4", + "mocha": "2.3.4", + "webpack": "1.12.9" + }, + "repository": { + "type": "git", + "url": "git@github.com:luckymarmot/Paw-HARGenerator.git" + } +} diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 0000000..9defbb7 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +base=$1 +node "$base/node_modules/webpack/bin/webpack.js" diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100644 index 0000000..e25edba --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +base=$1 +node "$base/node_modules/eslint/bin/eslint.js" -c "$base/linting/prod.yaml" "$base/src/" diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100644 index 0000000..f6bb8db --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env sh +base=$1 +mkdir -p "$base/release"; +cd "$base/dist/"; +files=./* +for file in $files +do + echo "working on folder -> $file" + package=$(ls "./$file" | sed s/.js$/.zip/); + zip -r "$package" "$file/"; + mv "$package" "$base/release/" +done; +cd $base; diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100644 index 0000000..a12f538 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,2 @@ +base=$1 +node "$base/node_modules/.bin/mocha" --require mocha --compilers js:babel-register --reporter spec "$base/src/**/__tests__/*-test.js" diff --git a/scripts/transfer.sh b/scripts/transfer.sh new file mode 100644 index 0000000..2478dca --- /dev/null +++ b/scripts/transfer.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +base=$1 +extensions_dir="$HOME/Library/Containers/com.luckymarmot.Paw/Data/Library/Application Support/com.luckymarmot.Paw/Extensions/" + +mkdir -p "$extensions_dir" +cp -r "$base/dist/" "$extensions_dir" diff --git a/src/Generator.js b/src/Generator.js new file mode 100644 index 0000000..dea27cd --- /dev/null +++ b/src/Generator.js @@ -0,0 +1,22 @@ +import { + registerCodeGenerator +} from './__mocks__/Shims' + +@registerCodeGenerator +export default class Generator { + static identifier = + 'com.luckymarmot.PawExtensions.HARGenerator' + static title = 'HAR Generator' + static help = + 'https://github.com/luckymarmot/Paw-HARGenerator' + + static languageHighlighter= 'json' + static fileExtension = 'har' + + // args: context, requests, options + generate() { + // TODO implement generate + // console.log(requests.length, JSON.stringify(requests)) + return false + } +} diff --git a/src/__mocks__/Mocks.js b/src/__mocks__/Mocks.js new file mode 100644 index 0000000..816f4db --- /dev/null +++ b/src/__mocks__/Mocks.js @@ -0,0 +1,64 @@ +export class Mock { + constructor(obj, prefix = '') { + let spies = {} + for (let field in obj) { + if ( + obj.hasOwnProperty(field) && + typeof obj[field] === 'function' + ) { + spies[field] = { + count: 0, + calls: [], + func: obj[field] + } + } + } + + this[prefix + 'spy'] = spies + + const setupFuncSpy = (field) => { + return (...args) => { + this[prefix + 'spy'][field].count += 1 + this[prefix + 'spy'][field].calls.push(args) + return this[prefix + 'spy'][field].func.apply(this, args) + } + } + + for (let field in obj) { + if (obj.hasOwnProperty(field)) { + if (typeof obj[field] === 'function') { + this[field] = setupFuncSpy(field) + } + else { + this[field] = obj[field] + } + } + } + + this[prefix + 'spyOn'] = (field, func) => { + this[prefix + 'spy'][field].func = func + return this + } + + this[prefix + 'getSpy'] = (field) => { + return this[prefix + 'spy'][field] + } + } +} + +export class ClassMock extends Mock { + constructor(instance, prefix = '') { + let properties = Object.getOwnPropertyNames( + Object.getPrototypeOf(instance) + ) + + let obj = {} + for (let property of properties) { + if (property !== 'constructor') { + obj[property] = ::Object.getPrototypeOf(instance)[property] + } + } + + super(obj, prefix) + } +} diff --git a/src/__mocks__/PawMocks.js b/src/__mocks__/PawMocks.js new file mode 100644 index 0000000..73c8ce5 --- /dev/null +++ b/src/__mocks__/PawMocks.js @@ -0,0 +1,88 @@ +import { Mock } from './Mocks' + +export class PawContextMock extends Mock { + constructor(baseObj, prefix) { + let obj = { + getCurrentRequest: () => {}, + getRequestByName: () => {}, + getRequestGroupByName: () => {}, + getRootRequestTreeItems: () => {}, + getRootRequests: () => {}, + getAllRequests: () => {}, + getAllGroups: () => {}, + getEnvironmentDomainByName: () => {}, + getEnvironmentVariableByName: () => {}, + getRequestById: () => {}, + getRequestGroupById: () => {}, + getEnvironmentDomainById: () => {}, + getEnvironmentVariableById: () => {}, + getEnvironmentById: () => {}, + createRequest: () => {}, + createRequestGroup: () => {}, + createEnvironmentDomain: () => {} + } + Object.assign(obj, baseObj) + super(obj, prefix) + } +} + +export class EnvironmentDomainMock extends Mock { + constructor(baseObj, prefix) { + let obj = { + getEnvironmentByName: () => {}, + getVariableByName: () => {}, + createEnvironment: () => {} + } + Object.assign(obj, baseObj) + super(obj, prefix) + } +} + +export class EnvironmentVariableMock extends Mock { + constructor(baseObj, prefix) { + let obj = { + getCurrentValue: () => {}, + getValue: () => {}, + setCurrentValue: () => {}, + setValue: () => {} + } + Object.assign(obj, baseObj) + super(obj, prefix) + } +} + +export class InputField extends Mock { + constructor(key, name, type, options, prefix = '') { + let obj = { + key: key, + name: name, + type: type, + options: options + } + super(obj, prefix) + } +} + +export class DynamicString extends Mock { + constructor(...items) { + let obj = { + length: null, + components: items, + toString: () => {}, + getComponentAtIndex: () => {}, + getSimpleString: () => {}, + getOnlyString: () => {}, + getOnlyDynamicValue: () => {}, + getEvaluatedString: () => {}, + copy: () => {}, + appendString: () => {}, + appendDynamicValue: () => {}, + appendDynamicString: () => {} + } + super(obj) + } +} + +export const registerCodeGenerator = (_class) => { + return _class +} diff --git a/src/__mocks__/Shims.js b/src/__mocks__/Shims.js new file mode 100644 index 0000000..e3aba6e --- /dev/null +++ b/src/__mocks__/Shims.js @@ -0,0 +1,18 @@ +if ( + typeof registerDynamicValueClass === 'undefined' || + typeof InputField === 'undefined' +) { + let mocks = require('./PawMocks.js') + module.exports = { + registerCodeGenerator: mocks.registerCodeGenerator, + InputField: mocks.InputField + } +} +else { + /* eslint-disable no-undef */ + module.exports = { + registerCodeGenerator: registerCodeGenerator, + InputField: InputField + } + /* eslint-enable no-undef */ +} diff --git a/src/__mocks__/__tests__/Mocks-test.js b/src/__mocks__/__tests__/Mocks-test.js new file mode 100644 index 0000000..25a6402 --- /dev/null +++ b/src/__mocks__/__tests__/Mocks-test.js @@ -0,0 +1,187 @@ +import { + UnitTest, registerTest, against +} from '../../__utils__/TestUtils' + +import { + Mock +} from '../Mocks' + +@registerTest +@against(Mock) +export class TestMock extends UnitTest { + testSimpleMock() { + let mock = new Mock() + + this.assertEqual( + Object.keys(mock), + [ 'spy', 'spyOn', 'getSpy' ] + ) + this.assertEqual(mock.spy, {}) + } + + testSimpleObjectMock() { + let mock = new Mock({ + a: 12 + }) + + this.assertEqual( + Object.keys(mock), + [ 'spy', 'a', 'spyOn', 'getSpy' ] + ) + this.assertEqual(mock.spy, {}) + } + + testSimpleObjectWithFuncMock() { + let obj = { + a: (arg) => { + return arg * arg + } + } + + let mock = new Mock(obj) + + this.assertEqual( + Object.keys(mock), + [ 'spy', 'a', 'spyOn', 'getSpy' ] + ) + this.assertEqual(Object.keys(mock.spy), [ 'a' ]) + } + + testSimpleObjectWithFuncAndVarsMock() { + let obj = { + a: (arg) => { + return arg * arg + }, + b: true + } + + let mock = new Mock(obj) + + this.assertEqual( + Object.keys(mock), + [ 'spy', 'a', 'b', 'spyOn', 'getSpy' ] + ) + this.assertEqual(Object.keys(mock.spy), [ 'a' ]) + } + + testSpyOn() { + let obj = { + a: (arg) => { + return arg * arg + } + } + + let mock = new Mock(obj) + + mock.spyOn( + 'a', + (arg) => { + return arg * 2 + } + ) + + this.assertEqual( + Object.keys(mock), + [ 'spy', 'a', 'spyOn', 'getSpy' ] + ) + + let expected = 6 + mock.a(10) + let result = mock.a(3) + this.assertEqual(mock.spy.a.count, 2) + this.assertEqual(mock.spy.a.calls, [ [ 10 ], [ 3 ] ]) + this.assertEqual(result, expected) + } + + testGetSpy() { + let obj = { + a: (arg) => { + return arg * arg + } + } + + let mock = new Mock(obj) + + mock.spyOn( + 'a', + (arg) => { + return arg * 2 + } + ) + + this.assertEqual( + Object.keys(mock), + [ 'spy', 'a', 'spyOn', 'getSpy' ] + ) + + mock.a(10) + mock.a(3) + + this.assertEqual(mock.getSpy('a').count, 2) + this.assertEqual(mock.getSpy('a').calls, [ [ 10 ], [ 3 ] ]) + } + + testMultipleSpies() { + let obj = { + a: (arg) => { + return arg * arg + }, + b: (key, value) => { + let result = {} + result[value] = key + return result + } + } + + let mock = new Mock(obj) + + mock + .spyOn( + 'a', + (arg) => { + return arg * 2 + } + ) + .spyOn( + 'b', + (k, v) => { + return k + ',' + v + } + ) + + mock.a(10) + mock.b(3, 10) + + this.assertEqual(mock.getSpy('a').count, 1) + this.assertEqual(mock.getSpy('a').calls, [ [ 10 ] ]) + + this.assertEqual(mock.getSpy('b').count, 1) + this.assertEqual(mock.getSpy('b').calls, [ [ 3, 10 ] ]) + } + + testPrefix() { + let obj = { + a: (arg) => { + return arg * arg + }, + b: true + } + + let mock = new Mock(obj, '__') + + this.assertEqual( + Object.keys(mock), + [ '__spy', 'a', 'b', '__spyOn', '__getSpy' ] + ) + this.assertEqual(Object.keys(mock.__spy), [ 'a' ]) + + // no prefix + mock = new Mock(obj, '') + + this.assertEqual( + Object.keys(mock), + [ 'spy', 'a', 'b', 'spyOn', 'getSpy' ] + ) + this.assertEqual(Object.keys(mock.spy), [ 'a' ]) + } +} diff --git a/src/__mocks__/__tests__/PawMocks-test.js b/src/__mocks__/__tests__/PawMocks-test.js new file mode 100644 index 0000000..6387dbd --- /dev/null +++ b/src/__mocks__/__tests__/PawMocks-test.js @@ -0,0 +1,58 @@ +import { UnitTest, registerTest, against } from '../../__utils__/TestUtils' + +import { + PawContextMock, + InputField +} from '../PawMocks' + +@registerTest +@against(PawContextMock) +export class TestPawContextMock extends UnitTest { + testEmptyPawContextMock() { + const pawContextFields = [ + 'getCurrentRequest', + 'getRequestByName', + 'getRequestGroupByName', + 'getRootRequestTreeItems', + 'getRootRequests', + 'getAllRequests', + 'getAllGroups', + 'getEnvironmentDomainByName', + 'getEnvironmentVariableByName', + 'getRequestById', + 'getRequestGroupById', + 'getEnvironmentDomainById', + 'getEnvironmentVariableById', + 'getEnvironmentById', + 'createRequest', + 'createRequestGroup', + 'createEnvironmentDomain' + ] + + const mock = new PawContextMock(null) + + this.assertEqual( + Object.keys(mock), + [ 'spy', ...pawContextFields, 'spyOn', 'getSpy' ] + ) + + this.assertEqual(Object.keys(mock.spy), pawContextFields) + } +} + +@registerTest +@against(InputField) +export class TestInputFieldMock extends UnitTest { + testSimpleInputFieldMock() { + const pawInputFieldFields = [] + + const mock = new InputField('name', 'Name', 'Checkbox', { a: 12 }) + + this.assertEqual( + Object.keys(mock), + [ 'spy', 'key', 'name', 'type', 'options', 'spyOn', 'getSpy' ] + ) + + this.assertEqual(Object.keys(mock.spy), pawInputFieldFields) + } +} diff --git a/src/__tests__/HARGenerator-test.js b/src/__tests__/HARGenerator-test.js new file mode 100644 index 0000000..e69de29 diff --git a/src/__utils__/TestUtils.js b/src/__utils__/TestUtils.js new file mode 100644 index 0000000..24d7d92 --- /dev/null +++ b/src/__utils__/TestUtils.js @@ -0,0 +1,248 @@ +import { describe, it, before, after, beforeEach, afterEach } from 'mocha' +import { assert } from 'chai' +import Immutable from 'immutable' + + +class UnitTest { + /** + * Override setUpClass + * @return {NULL} NULL + */ + setUpClass() {} + + /** + * Override tearDownClass + * @return {NULL} NULL + */ + tearDownClass() {} + + /** + * Override setUp + * @return {NULL} NULL + */ + setUp() {} + + + /** + * tearDown + * @return {NULL} NULL + */ + tearDown() {} + + + _getTests() { + const prototype = Object.getPrototypeOf(this) + let tests = {} + + for (let fname of Object.getOwnPropertyNames(prototype)) { + if (fname.startsWith('test')) { + const newFnName = this._parseFnName(fname) + + tests[newFnName] = ::Object.getPrototypeOf(this)[fname] + } + } + + return tests + } + + _getSkippedTests() { + const prototype = Object.getPrototypeOf(this) + let tests = {} + + for (let fname of Object.getOwnPropertyNames(prototype)) { + if (fname.startsWith('_test')) { + const newFnName = this._parseSkippedFnName(fname) + + tests[newFnName] = ::Object.getPrototypeOf(this)[fname] + } + } + + return tests + } + + _parseFnName(name) { + return name.replace(/^test/, '') + } + + _parseSkippedFnName(name) { + return name.replace(/^_test/, '') + } + + assert(value) { + assert(value) + } + + assertTrue(value, message) { + let warn = (message ? message + '\n' : '') + '\n' + assert.isTrue(value, warn) + } + + assertFalse(value) { + assert.isFalse(value) + } + + assertEqual(a, b, message) { + let A = Immutable.fromJS(a) + let B = Immutable.fromJS(b) + let comparison = Immutable.is(A, B) + let warn = (message ? message + '\n' : '') + `\n${A} \n!== \n${B}` + assert.isTrue(comparison, warn) + } + + assertJSONEqual(a, b, message) { + let A = JSON.stringify(a, null, ' ') + let B = JSON.stringify(b, null, ' ') + this.assertEqual(A, B, message) + } + + assertNotEqual(a, b, message) { + let A = Immutable.fromJS(a) + let B = Immutable.fromJS(b) + let comparison = Immutable.is(A, B) + let warn = (message ? message + '\n' : '') + `\n${A} \n!== \n${B}` + assert.isFalse(comparison, warn) + } + + assertEqualElements(a, b) { + assert.isTrue(Immutable.is( + Immutable.Set(Immutable.fromJS(a)), + Immutable.Set(Immutable.fromJS(b))), + `${a} !== ${b}`) + } + + assertNotNull(value) { + this.assertTrue(value !== null) + } + + assertNull(value) { + this.assertTrue(value === null) + } + + assertIsInstanceOf(value, cls) { + assert.isTrue(value instanceof cls, `${value} !instanceof ${cls}`) + } +} + +function registerTest(Class) { + const test = new Class() + const tests = test._getTests() + const skipped = test._getSkippedTests() + + function skip(_skipped) { + return () => { + for (let _skip of _skipped) { + it(_skip, () => {}) + } + } + } + + describe(Class.name.replace(/Test$/, ''), () => { + before(test.setUpClass.bind(test)) + after(test.tearDownClass.bind(test)) + beforeEach(test.setUp.bind(test)) + afterEach(test.tearDown.bind(test)) + + for (let fname of Object.keys(tests)) { + if (typeof tests[fname] === 'function') { + it(fname, tests[fname].bind(test)) + } + else { + describe.skip(fname, skip(tests[fname])) + } + } + }) + + describe.skip(Class.name.replace(/Test$/, ''), () => { + for (let fname of Object.keys(skipped)) { + if (typeof skipped[fname] === 'function') { + it(fname, skipped[fname].bind(test)) + } + else { + describe(fname, skip(skipped[fname])) + } + } + }) +} + +function targets(name) { + return function(target, key, descriptor) { + if (!target.constructor.__targets) { + target.constructor.__targets = {} + } + if (!target.constructor.__targets[name]) { + target.constructor.__targets[name] = [] + } + target.constructor.__targets[name].push(key) + return descriptor + } +} + +function against(Against, ignores = [ 'constructor' ]) { + return function(Class) { + Class.__against = Against + Class.prototype.testAllMethodsAreTested = () => { + const names = Object.getOwnPropertyNames( + Object.getPrototypeOf(new Against()) + ) + + let missingTests = [] + for (let name of names) { + if ( + ignores.indexOf(name) < 0 && + ( + typeof Class.__targets === 'undefined' || + typeof Class.__targets[name] === 'undefined' + ) + ) { + missingTests.push(name) + } + } + + let superfluousTests = [] + for (let target of Object.keys(Class.__targets || [])) { + if (names.indexOf(target) < 0) { + superfluousTests.push(Class.__targets[target]) + } + } + + const test = new Class() + test.assertEqual(missingTests, [], 'Some methods are not tested') + test.assertEqual(superfluousTests, [], + 'some non-existing methods are being tested' + ) + } + return Class + } +} + +class MockedFunction { + constructor() { + this.calls = [] + this.returnValue = null + } + + setReturnValue(value) { + this.returnValue = value + } + + func() { + this.calls.push(arguments) + return this.returnValue + } + + getCallBack = ()=> { + return ::this.func + }; +} + +function mockFunction(target, key, descriptor) { + const fn = descriptor.value + descriptor.value = function() { + const mockedFunction = new MockedFunction() + return fn.apply(this, + Immutable.List(arguments).push(mockedFunction).toJS()) + } + return descriptor +} + +export { UnitTest, registerTest, targets, against, mockFunction } diff --git a/webpack.config.babel.js b/webpack.config.babel.js new file mode 100644 index 0000000..fcd9da6 --- /dev/null +++ b/webpack.config.babel.js @@ -0,0 +1,39 @@ +import webpack from 'webpack' +import path from 'path' +import Generator from './src/Generator' + +if (!Generator.identifier) { + let msg = 'Generator requires an identifier like: ' + + 'com.luckymarmot.PawExtensions.MySuperGenerator' + throw new Error(msg) +} + +const name = Generator.identifier.split('.').slice(-1) + +const production = process.env.NODE_ENV === 'production'; + +const config = { + target: 'node-webkit', + entry: [ + './src/Generator.js' + ], + output:{ + path: path.join(__dirname, './dist/' + Generator.identifier), + pathInfo: true, + publicPath: '/dist/', + filename: name + '.js' + }, + module: { + loaders: [ + { + loader: 'babel-loader', + include: [ + path.resolve(__dirname, 'src') + ], + test: /\.js$/ + } + ] + } +}; + +module.exports = config; From f15f81d2bac0ee88d20f7ecd9da5d44edbb1ef6f Mon Sep 17 00:00:00 2001 From: JonathanMontane Date: Mon, 8 Aug 2016 10:58:36 +0200 Subject: [PATCH 03/12] removed name and repository info from package.json --- package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package.json b/package.json index 9821dac..599b6dc 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,4 @@ { - "name": "Paw-HARGenerator", "version": "0.1.0", "dependencies": { "babel-plugin-transform-flow-strip-types": "6.3.15", @@ -29,9 +28,5 @@ "json-loader": "^0.5.4", "mocha": "2.3.4", "webpack": "1.12.9" - }, - "repository": { - "type": "git", - "url": "git@github.com:luckymarmot/Paw-HARGenerator.git" } } From bf3fa2fce66312defa179c0d7907dcc662c277c9 Mon Sep 17 00:00:00 2001 From: Jonathan Montane Date: Mon, 8 Aug 2016 11:04:38 +0200 Subject: [PATCH 04/12] Initial commit --- LICENSE | 21 +++++++++++++++++++++ README.md | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fbe3c93 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Paw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c24031d --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Paw-ES7-Generator-Template +A boilerplate for writing Paw generators using es7 syntax From ed2544e1fad4b972e9293c0820051978283b0ebc Mon Sep 17 00:00:00 2001 From: JonathanMontane Date: Mon, 8 Aug 2016 11:22:37 +0200 Subject: [PATCH 05/12] added some testing functionalities --- src/__tests__/Generator-test.js | 44 ++++++++++++++++++++++ src/__tests__/HARGenerator-test.js | 0 src/__utils__/TestUtils.js | 60 +++++++----------------------- 3 files changed, 57 insertions(+), 47 deletions(-) create mode 100644 src/__tests__/Generator-test.js delete mode 100644 src/__tests__/HARGenerator-test.js diff --git a/src/__tests__/Generator-test.js b/src/__tests__/Generator-test.js new file mode 100644 index 0000000..cc1deb2 --- /dev/null +++ b/src/__tests__/Generator-test.js @@ -0,0 +1,44 @@ +import { + UnitTest, registerTest, against, targets, desc +} from '../__utils__/TestUtils' + +import { + ClassMock +} from '../__mocks__/Mocks' + +import Generator from '../Generator' + +@registerTest +@against(Generator) +export class TestGenerator extends UnitTest { + + @targets('generate') + @desc('dummy test') + testEvaluateCallsGetSchemaDict() { + const gen = this.__init() + + gen.spyOn('generate', () => { + return 42 + }) + + const expected = 42 + const result = gen.generate() + + this.assertEqual(gen.spy.generate.count, 1) + this.assertEqual(expected, result) + } + + @targets('generate') + @desc('tests starting with underscore are ignored') + @desc('@desc decorator is optional, if not used, the name of the func ' + + 'will be used instead') + _testEvaluateCallsMaterializeSchemas() { + // should fail if test is not ignored + this.assertTrue(false) + } + + __init() { + const gen = new ClassMock(new Generator()) + return gen + } +} diff --git a/src/__tests__/HARGenerator-test.js b/src/__tests__/HARGenerator-test.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/__utils__/TestUtils.js b/src/__utils__/TestUtils.js index 24d7d92..ab68e55 100644 --- a/src/__utils__/TestUtils.js +++ b/src/__utils__/TestUtils.js @@ -2,7 +2,6 @@ import { describe, it, before, after, beforeEach, afterEach } from 'mocha' import { assert } from 'chai' import Immutable from 'immutable' - class UnitTest { /** * Override setUpClass @@ -30,12 +29,12 @@ class UnitTest { tearDown() {} - _getTests() { + _getTests(test = 'test') { const prototype = Object.getPrototypeOf(this) let tests = {} for (let fname of Object.getOwnPropertyNames(prototype)) { - if (fname.startsWith('test')) { + if (fname.startsWith(test)) { const newFnName = this._parseFnName(fname) tests[newFnName] = ::Object.getPrototypeOf(this)[fname] @@ -46,18 +45,7 @@ class UnitTest { } _getSkippedTests() { - const prototype = Object.getPrototypeOf(this) - let tests = {} - - for (let fname of Object.getOwnPropertyNames(prototype)) { - if (fname.startsWith('_test')) { - const newFnName = this._parseSkippedFnName(fname) - - tests[newFnName] = ::Object.getPrototypeOf(this)[fname] - } - } - - return tests + return this._getTests('_tests') } _parseFnName(name) { @@ -136,7 +124,7 @@ function registerTest(Class) { } } - describe(Class.name.replace(/Test$/, ''), () => { + describe(Class.name.replace(/^Test/, ''), () => { before(test.setUpClass.bind(test)) after(test.tearDownClass.bind(test)) beforeEach(test.setUp.bind(test)) @@ -144,7 +132,8 @@ function registerTest(Class) { for (let fname of Object.keys(tests)) { if (typeof tests[fname] === 'function') { - it(fname, tests[fname].bind(test)) + let name = tests[fname].__desc || fname + it(name, tests[fname].bind(test)) } else { describe.skip(fname, skip(tests[fname])) @@ -152,7 +141,7 @@ function registerTest(Class) { } }) - describe.skip(Class.name.replace(/Test$/, ''), () => { + describe.skip(Class.name.replace(/^Test/, ''), () => { for (let fname of Object.keys(skipped)) { if (typeof skipped[fname] === 'function') { it(fname, skipped[fname].bind(test)) @@ -199,7 +188,7 @@ function against(Against, ignores = [ 'constructor' ]) { } let superfluousTests = [] - for (let target of Object.keys(Class.__targets || [])) { + for (let target of Object.keys(Class.__targets || {})) { if (names.indexOf(target) < 0) { superfluousTests.push(Class.__targets[target]) } @@ -215,34 +204,11 @@ function against(Against, ignores = [ 'constructor' ]) { } } -class MockedFunction { - constructor() { - this.calls = [] - this.returnValue = null - } - - setReturnValue(value) { - this.returnValue = value - } - - func() { - this.calls.push(arguments) - return this.returnValue - } - - getCallBack = ()=> { - return ::this.func - }; -} - -function mockFunction(target, key, descriptor) { - const fn = descriptor.value - descriptor.value = function() { - const mockedFunction = new MockedFunction() - return fn.apply(this, - Immutable.List(arguments).push(mockedFunction).toJS()) +function desc(description) { + return function(target, key, descriptor) { + descriptor.value.__desc = description + return descriptor } - return descriptor } -export { UnitTest, registerTest, targets, against, mockFunction } +export { UnitTest, registerTest, targets, against, desc } From 1d18c7c3ca6f76c8796af8d144e5a95b13afe6ad Mon Sep 17 00:00:00 2001 From: JonathanMontane Date: Mon, 8 Aug 2016 11:56:57 +0200 Subject: [PATCH 06/12] improved release system --- Makefile | 2 +- scripts/release.sh | 7 ++++--- src/Generator.js | 11 ++++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 41ce70f..577c84f 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ build: sh "$(SCRIPTS)/build.sh" $(BASE) release: - sh "$(SCRIPTS)/release.sh" $(BASE) + sh "$(SCRIPTS)/release.sh" $(BASE) $(VERSION) deploy: install build release diff --git a/scripts/release.sh b/scripts/release.sh index f6bb8db..e969360 100644 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,13 +1,14 @@ #!/usr/bin/env sh base=$1 -mkdir -p "$base/release"; +version=$2 +mkdir -p "$base/releases"; cd "$base/dist/"; files=./* for file in $files do echo "working on folder -> $file" - package=$(ls "./$file" | sed s/.js$/.zip/); + package=$(ls "./$file" | sed "s/.js$/$version.zip/"); zip -r "$package" "$file/"; - mv "$package" "$base/release/" + mv "$package" "$base/releases/" done; cd $base; diff --git a/src/Generator.js b/src/Generator.js index dea27cd..c1e7a58 100644 --- a/src/Generator.js +++ b/src/Generator.js @@ -4,11 +4,13 @@ import { @registerCodeGenerator export default class Generator { - static identifier = - 'com.luckymarmot.PawExtensions.HARGenerator' - static title = 'HAR Generator' + // TODO update static information with correct ones + static identifier = 'com.luckymarmot.PawExtensions.MySuperGenerator' + static title = 'My Super Generator' + static organisation = 'luckymarmot' + static repository = 'Paw-ES7-Generator-Template' static help = - 'https://github.com/luckymarmot/Paw-HARGenerator' + 'https://github.com/' + organisation + '/' + repository static languageHighlighter= 'json' static fileExtension = 'har' @@ -16,7 +18,6 @@ export default class Generator { // args: context, requests, options generate() { // TODO implement generate - // console.log(requests.length, JSON.stringify(requests)) return false } } From e5a459d17c68016551baa7742f65606886f916ca Mon Sep 17 00:00:00 2001 From: JonathanMontane Date: Mon, 8 Aug 2016 11:58:27 +0200 Subject: [PATCH 07/12] clarity --- src/Generator.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Generator.js b/src/Generator.js index c1e7a58..e9376d2 100644 --- a/src/Generator.js +++ b/src/Generator.js @@ -5,16 +5,19 @@ import { @registerCodeGenerator export default class Generator { // TODO update static information with correct ones - static identifier = 'com.luckymarmot.PawExtensions.MySuperGenerator' - static title = 'My Super Generator' + // Organisation static organisation = 'luckymarmot' static repository = 'Paw-ES7-Generator-Template' - static help = - 'https://github.com/' + organisation + '/' + repository + + // Generator + static identifier = 'com.luckymarmot.PawExtensions.MySuperGenerator' + static title = 'My Super Generator' static languageHighlighter= 'json' static fileExtension = 'har' + static help = 'https://github.com/' + organisation + '/' + repository + // args: context, requests, options generate() { // TODO implement generate From 9ffd2d8baa674ffc6241c1207934f233cb3e06fa Mon Sep 17 00:00:00 2001 From: JonathanMontane Date: Mon, 8 Aug 2016 12:12:05 +0200 Subject: [PATCH 08/12] improved release script to include LICENSE and README --- scripts/build.sh | 1 + scripts/release.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/scripts/build.sh b/scripts/build.sh index 9defbb7..615f179 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,3 +1,4 @@ #!/usr/bin/env sh base=$1 +rm -rf "$base/dist" node "$base/node_modules/webpack/bin/webpack.js" diff --git a/scripts/release.sh b/scripts/release.sh index e969360..21147f1 100644 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -8,6 +8,9 @@ for file in $files do echo "working on folder -> $file" package=$(ls "./$file" | sed "s/.js$/$version.zip/"); + echo "pacakge is $package"; + cp "$base/README.md" "$base/dist/$file/"; + cp "$base/LICENSE" "$base/dist/$file/"; zip -r "$package" "$file/"; mv "$package" "$base/releases/" done; From 0f221dec79cb5dc35222ab7dc4e3d1ce8a9044b8 Mon Sep 17 00:00:00 2001 From: JonathanMontane Date: Mon, 8 Aug 2016 12:13:44 +0200 Subject: [PATCH 09/12] fixed gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7b627c3..954ff2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Build dist/ -release/ +releases/ node_modules/ lib/ .DS_Store From fbe5bc51e653196026d5c9a4978a05379deb9376 Mon Sep 17 00:00:00 2001 From: JonathanMontane Date: Mon, 8 Aug 2016 17:38:00 +0200 Subject: [PATCH 10/12] slightly improved README.md --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index c24031d..8cf53da 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,41 @@ # Paw-ES7-Generator-Template A boilerplate for writing Paw generators using es7 syntax + +### How to create a new Code Generator from the template +Create a bare repository that will contain the codebase. +Copy/Paste the following commands when in the repository: +``` +git remote add boilerplate git@github.com:luckymarmot/Paw-ES7-Generator-Template.git +git pull boilerplate master +make +``` + +### Creating a build +``` +make build +``` + +The build will be located in the `dist` folder + +### Creating a release +``` +make deploy VERSION="@2.3.1" +``` + +The `VERSION` variable is optional. +The releases can be found in the `releases` folder as `.zip` files. +The release is only local. + +### How to test locally +``` +make paw-fast +``` + +or +``` +make paw-extension +``` + +The extension will be compiled into a build and immediately copied to the Extension folder in Paw. + +**note:** `paw-extension` is basically `paw-fast` with a `make install` before. From f99dba33d3c895cee5ac806ba6dac223de8dfd80 Mon Sep 17 00:00:00 2001 From: Micha Mazaheri Date: Mon, 8 Aug 2016 18:14:39 +0200 Subject: [PATCH 11/12] Improve Makefile naming --- Makefile | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 577c84f..58c5b3b 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,29 @@ BASE=$(shell pwd) SCRIPTS=$(BASE)/scripts -# Setup commands -install: - npm install - -# Validation commands -lint: - sh "$(SCRIPTS)/lint.sh" $(BASE) - -test: - sh "$(SCRIPTS)/test.sh" $(BASE) +all: configure pack -validate: lint test +# Install the requirements +configure: + npm install -# Build commands +# Build the ES5 script build: sh "$(SCRIPTS)/build.sh" $(BASE) -release: +# Builds a ready-to-deploy ZIP file +pack: build sh "$(SCRIPTS)/release.sh" $(BASE) $(VERSION) -deploy: install build release - -transfer: +# Install in Paw extensions folder +install: build sh "$(SCRIPTS)/transfer.sh" $(BASE) -# Super commands -paw-extension: deploy transfer +# Validation commands +lint: + sh "$(SCRIPTS)/lint.sh" $(BASE) + +test: + sh "$(SCRIPTS)/test.sh" $(BASE) -paw-fast: build release transfer +check: lint test From 37aedeb4e37cecf8377db9df6aab7a90d7388ac7 Mon Sep 17 00:00:00 2001 From: JonathanMontane Date: Tue, 9 Aug 2016 11:19:21 +0200 Subject: [PATCH 12/12] improved naming of make commands --- README.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8cf53da..9a897c0 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The build will be located in the `dist` folder ### Creating a release ``` -make deploy VERSION="@2.3.1" +make pack VERSION="@2.3.1" ``` The `VERSION` variable is optional. @@ -28,14 +28,7 @@ The release is only local. ### How to test locally ``` -make paw-fast -``` - -or -``` -make paw-extension +make install ``` The extension will be compiled into a build and immediately copied to the Extension folder in Paw. - -**note:** `paw-extension` is basically `paw-fast` with a `make install` before.