Просмотр исходного кода

ensure to correspond to pluginSchemaVersion 2

Yuki Takei 9 лет назад
Родитель
Сommit
0dcc114390

+ 2 - 10
packages/growi-plugin-pukiwiki-like-linker/README.md

@@ -41,15 +41,7 @@ Install
 1. install plugin
 
     ```
-    $ npm run install-plugin https://github.com/yuki-takei/crowi-plugin-pukiwiki-like-linker.git
+    $ npm install --save crowi-plugin-pukiwiki-like-linker
     ```
 
-1. modify `${CROWI_INSTALLED_DIR}/plugin/plugin.js`
-
-   ```
-   const plugins = [
-     require('crowi-plugin-pukiwiki-like-linker')
-   ]
-   ```
-
-1. build plugin (see official documents)
+1. build client app (see official documents)

+ 0 - 1
packages/growi-plugin-pukiwiki-like-linker/index.js

@@ -1 +0,0 @@
-export { default as meta } from './meta';

+ 0 - 10
packages/growi-plugin-pukiwiki-like-linker/meta.js

@@ -1,10 +0,0 @@
-import { PukiwikiLikeLinker } from './resource/js/util/PreProcessor/PukiwikiLikeLinker';
-
-export default {
-  pluginSchemaVersion: 1,
-  preProcessorFactories: [
-    (crowi) => {
-      return new PukiwikiLikeLinker();
-    }
-  ]
-}

+ 28 - 3
packages/growi-plugin-pukiwiki-like-linker/package.json

@@ -2,9 +2,21 @@
   "name": "crowi-plugin-pukiwiki-like-linker",
   "version": "1.0.0",
   "description": "The Crowi Plugin to add PukiwikiLikeLinker",
-  "main": "index.js",
+  "keywords": [
+    "crowi-plus",
+    "crowi-plugin"
+  ],
+  "main": "lib/index.js",
+  "files": [
+    "lib"
+  ],
   "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
+    "build": "babel src --out-dir lib --source-maps inline",
+    "clean": "npm cache clean && npm run rimraf -- lib",
+    "prebuild": "npm run clean",
+    "watch": "babel src --out-dir lib --watch --source-maps inline",
+    "rimraf": "rimraf",
+    "test": ""
   },
   "repository": {
     "type": "git",
@@ -15,5 +27,18 @@
   "bugs": {
     "url": "https://github.com/yuki-takei/crowi-plugin-pukiwiki-like-linker/issues"
   },
-  "homepage": "https://github.com/yuki-takei/crowi-plugin-pukiwiki-like-linker#readme"
+  "homepage": "https://github.com/yuki-takei/crowi-plugin-pukiwiki-like-linker#readme",
+  "dependencies": {
+  },
+  "devDependencies": {
+    "babel-cli": "^6.23.0",
+    "babel-plugin-add-module-exports": "^0.2.1",
+    "babel-plugin-transform-class-properties": "^6.23.0",
+    "babel-preset-es2015": "^6.22.0",
+    "babel-preset-power-assert": "^1.0.0",
+    "babel-preset-react": "^6.23.0",
+    "babel-register": "^6.23.0",
+    "power-assert": "^1.4.2",
+    "rimraf": "^2.6.1"
+  }
 }

+ 6 - 0
packages/growi-plugin-pukiwiki-like-linker/resource/client-entry.js

@@ -0,0 +1,6 @@
+import { PukiwikiLikeLinker } from './resource/js/util/PreProcessor/PukiwikiLikeLinker';
+
+export default (crowi, crowiRenderer) => {
+  // add preprocessor to head of array
+  crowiRenderer.preProcessors.unshift(new PukiwikiLikeLinker());
+}

+ 1 - 0
packages/growi-plugin-pukiwiki-like-linker/resource/index.js

@@ -0,0 +1 @@
+export * from './meta';

+ 10 - 0
packages/growi-plugin-pukiwiki-like-linker/resource/meta.js

@@ -0,0 +1,10 @@
+const path = require('path');
+
+export default {
+  pluginSchemaVersion: 2,
+  serverEntries: [
+  ],
+  clientEntries: [
+    path.join(__dirname, 'client-entry.js')
+  ]
+}