Skip to content

Commit

Permalink
Initial upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosdc committed Feb 26, 2017
0 parents commit cf41a57
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .babelrc
@@ -0,0 +1,10 @@
{
'presets': [
'es2015',
'stage-0',
'stage-1',
'stage-2',
'stage-3'
],
'plugins': ['transform-runtime', 'transform-decorators-legacy']
}
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
.idea/
build/
node_modules/
1 change: 1 addition & 0 deletions .nvmrc
@@ -0,0 +1 @@
v5.6.0
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017 Blockchain of Things Inc.

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.
19 changes: 19 additions & 0 deletions Makefile
@@ -0,0 +1,19 @@
identifier=com.blockchainofthings.PawExtensions.UrlPathParamDynValue
extensions_dir=$(HOME)/Library/Containers/com.luckymarmot.Paw/Data/Library/Application Support/com.luckymarmot.Paw/Extensions/

build:
npm run build
cp README.md LICENSE ./build/$(identifier)/

clean:
rm -Rf ./build/

install: clean build
mkdir -p "$(extensions_dir)$(identifier)/"
cp -r ./build/$(identifier)/* "$(extensions_dir)$(identifier)/"

test:
npm test

archive: build
cd ./build/; zip -r UrlPathParamDynValue.zip "$(identifier)/"
44 changes: 44 additions & 0 deletions README.md
@@ -0,0 +1,44 @@
# URL Path Parameter Paw Extension

This is a Dynamic Value Paw extension that can be used to add parameters to the URL path.

## Use

Just add the Dynamic Value to the URL, specify a name for the parameter and its value. The value you enter
is automatically URL-encoded, and the name of the parameter is shown on the URL input field instead of the actual value, which
makes the URL more readable and clean. It also helps for an easier identification of the different parameters that are found
in the URL.

## Development

### Prerequisites

```shell
nvm install
nvm use
npm install
```

### Build

```shell
npm run build
```

### Install

```shell
make install
```

### Test

```shell
npm test
```

## License

This Paw Extension is released under the [MIT License](LICENSE). Feel free to fork, and modify!

Copyright © 2017 Blockchain of Things Inc.
42 changes: 42 additions & 0 deletions package.json
@@ -0,0 +1,42 @@
{
"name": "UrlPathParamDynValue",
"version": "1.0.0",
"main": "src/UrlPathParamDynValue.js",
"license": "MIT",
"homepage": "https://github.com/blockchainofthings/Paw-UrlPathParamDynValue",
"dependencies": {
"babel-plugin-transform-flow-strip-types": "6.3.15",
"babel-polyfill": "6.3.14",
"babel-runtime": "6.3.19",
"immutable": "3.7.6"
},
"devDependencies": {
"babel-core": "6.4.0",
"babel-loader": "6.2.0",
"babel-plugin-rewire": "1.0.0-beta-3",
"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",
"mocha": "2.3.4",
"path": "0.12.7",
"webpack": "1.12.9"
},
"scripts": {
"build": "rm -rf dist/ && BUILD_ENV=build ./node_modules/.bin/webpack --bail --display-error-details",
"test": "exit 0"
},
"options": {
"mocha": "./node_modules/.bin/mocha --require mocha --compilers js:babel-register --reporter spec"
},
"repository": {
"type": "git",
"url": "https://github.com/blockchainofthings/Paw-UrlPathParamDynValue.git"
}
}
26 changes: 26 additions & 0 deletions src/UrlPathParamDynValue.js
@@ -0,0 +1,26 @@
/**
* Created by claudio on 25/02/17.
*/

@registerDynamicValueClass
class UrlPathParamDynValue {

static identifier = 'com.blockchainofthings.PawExtensions.UrlPathParamDynValue';
static title = 'URL Path Parameter';
static inputs = [
DynamicValueInput('paramName', 'Parameter Name', "String"),
DynamicValueInput('paramValue', 'Value', "String")
];

evaluate(context) {
return encodeURIComponent(this.paramValue);
}

title(context) {
return 'Param';
}

text(context) {
return this.paramName;
}
}
34 changes: 34 additions & 0 deletions webpack.config.babel.js
@@ -0,0 +1,34 @@
import webpack from 'webpack';
import path from 'path';

const name = 'UrlPathParamDynValue';

const production = process.env.NODE_ENV === 'production';

const config = {
target: 'web',
entry: [
'immutable',
'./src/UrlPathParamDynValue.js'
],
output:{
path: path.join(__dirname,
'./build/com.blockchainofthings.PawExtensions.UrlPathParamDynValue'),
pathInfo: true,
publicPath: '/build/',
filename: name+'.js'
},
module: {
loaders: [
{
loader: 'babel-loader',
include: [
path.resolve(__dirname, 'src')
],
test: /\.jsx?$/
}
]
}
};

module.exports = config;

0 comments on commit cf41a57

Please sign in to comment.