From 58e645b5250376a7efea68768b3619b3b8d7a3e7 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sat, 23 Jul 2022 13:34:19 -0700 Subject: [PATCH] renamed template to spf --- Changes.md | 28 ++-------------------------- README.md | 30 +++++++++++++++--------------- config/{template.ini => spf.ini} | 0 index.js | 6 +++--- package.json | 10 +++++----- test/index.js | 12 ++++++------ 6 files changed, 31 insertions(+), 55 deletions(-) rename config/{template.ini => spf.ini} (100%) diff --git a/Changes.md b/Changes.md index 27ff6bf..07a5d0d 100644 --- a/Changes.md +++ b/Changes.md @@ -1,27 +1,3 @@ +## 1.0.0 - 2022-07-23 -### Unreleased - - -### [1.0.3] - 2022-06-05 - -- ci: replace hard coded vers with node-lts-versions -- * ci(publish): add secrets: inherit -- ci: use reusable workflows (#18) - - -### 1.0.2 - 2022-05-23 - -- packaging updates - - -### 1.0.1 - 2021-02-04 - -- added example tests that set up conn/txn -- add automated package publishing -- GH actions: consolidate \*nix & win tests - - -### 1.0.0 - 2017-02-02 - -- initial release -[1.0.3]: https://github.com/haraka/haraka-plugin-template/releases/tag/1.0.3 +- Initial release diff --git a/README.md b/README.md index 036ed60..35752c8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Code Climate][clim-img]][clim-url] [![NPM][npm-img]][npm-url] -# haraka-plugin-template +# haraka-plugin-spf Clone me, to create a new Haraka plugin! @@ -23,11 +23,11 @@ export MY_GITHUB_ORG=haraka export MY_PLUGIN_NAME=haraka-plugin-SOMETHING ``` -Clone and rename the template repo: +Clone and rename the spf repo: ```sh -git clone git@github.com:haraka/haraka-plugin-template.git -mv haraka-plugin-template $MY_PLUGIN_NAME +git clone git@github.com:haraka/haraka-plugin-spf.git +mv haraka-plugin-spf $MY_PLUGIN_NAME cd $MY_PLUGIN_NAME git remote rm origin git remote add origin "git@github.com:$MY_GITHUB_ORG/$MY_PLUGIN_NAME.git" @@ -37,7 +37,7 @@ Now you'll have a local git repo to begin authoring your plugin ## rename boilerplate -Replaces all uses of the word `template` with your plugin's name. +Replaces all uses of the word `spf` with your plugin's name. ./redress.sh [something] @@ -50,8 +50,8 @@ You'll then be prompted to update package.json and then force push this repo ont ```sh cd /path/to/local/haraka -npm install haraka-plugin-template -echo "template" >> config/plugins +npm install haraka-plugin-spf +echo "spf" >> config/plugins service haraka restart ``` @@ -60,17 +60,17 @@ service haraka restart If the default configuration is not sufficient, copy the config file from the distribution into your haraka config dir and then modify it: ```sh -cp node_modules/haraka-plugin-template/config/template.ini config/template.ini -$EDITOR config/template.ini +cp node_modules/haraka-plugin-spf/config/spf.ini config/spf.ini +$EDITOR config/spf.ini ``` ## USAGE -[ci-img]: https://github.com/haraka/haraka-plugin-template/actions/workflows/ci.yml/badge.svg -[ci-url]: https://github.com/haraka/haraka-plugin-template/actions/workflows/ci.yml -[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-template/badges/gpa.svg -[clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-template -[npm-img]: https://nodei.co/npm/haraka-plugin-template.png -[npm-url]: https://www.npmjs.com/package/haraka-plugin-template +[ci-img]: https://github.com/haraka/haraka-plugin-spf/actions/workflows/ci.yml/badge.svg +[ci-url]: https://github.com/haraka/haraka-plugin-spf/actions/workflows/ci.yml +[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-spf/badges/gpa.svg +[clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-spf +[npm-img]: https://nodei.co/npm/haraka-plugin-spf.png +[npm-url]: https://www.npmjs.com/package/haraka-plugin-spf diff --git a/config/template.ini b/config/spf.ini similarity index 100% rename from config/template.ini rename to config/spf.ini diff --git a/index.js b/index.js index 7c1b269..dc91b9f 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,13 @@ 'use strict' exports.register = function () { - this.load_template_ini() + this.load_spf_ini() } -exports.load_template_ini = function () { +exports.load_spf_ini = function () { const plugin = this - plugin.cfg = plugin.config.get('template.ini', { + plugin.cfg = plugin.config.get('spf.ini', { booleans: [ '+enabled', // plugin.cfg.main.enabled=true '-disabled', // plugin.cfg.main.disabled=false diff --git a/package.json b/package.json index ee96bb1..5fc46f0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "haraka-plugin-template", + "name": "haraka-plugin-spf", "version": "1.0.3", "description": "Haraka plugin that frobnicates email connections", "main": "index.js", @@ -11,19 +11,19 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/haraka/haraka-plugin-template.git" + "url": "git+https://github.com/haraka/haraka-plugin-spf.git" }, "keywords": [ "haraka", "plugin", - "template" + "spf" ], "author": "Welcome Member ", "license": "MIT", "bugs": { - "url": "https://github.com/haraka/haraka-plugin-template/issues" + "url": "https://github.com/haraka/haraka-plugin-spf/issues" }, - "homepage": "https://github.com/haraka/haraka-plugin-template#readme", + "homepage": "https://github.com/haraka/haraka-plugin-spf#readme", "devDependencies": { "eslint": "8", "eslint-plugin-haraka": "*", diff --git a/test/index.js b/test/index.js index 14aae58..202f419 100644 --- a/test/index.js +++ b/test/index.js @@ -10,26 +10,26 @@ const fixtures = require('haraka-test-fixtures') // mocha: http://mochajs.org beforeEach(function (done) { - this.plugin = new fixtures.plugin('template') + this.plugin = new fixtures.plugin('spf') done() // if a test hangs, assure you called done() }) -describe('template', function () { +describe('spf', function () { it('loads', function (done) { assert.ok(this.plugin) done() }) }) -describe('load_template_ini', function () { - it('loads template.ini from config/template.ini', function (done) { - this.plugin.load_template_ini() +describe('load_spf_ini', function () { + it('loads spf.ini from config/spf.ini', function (done) { + this.plugin.load_spf_ini() assert.ok(this.plugin.cfg) done() }) it('initializes enabled boolean', function (done) { - this.plugin.load_template_ini() + this.plugin.load_spf_ini() assert.equal(this.plugin.cfg.main.enabled, true, this.plugin.cfg) done() })