Skip to content

Commit

Permalink
Add extension directory dist building
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrov-adrian committed Jul 21, 2021
1 parent 778da33 commit 8c86a7a
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 51 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/npm-publish.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Release Packages

on:
release:
types: [created]

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm ci
- run: npm run dist
- run: npm pack
- name: Upload Artifacts
uses: softprops/action-gh-release@v1
with:
files: |
editorjs.zip
directus-extension-editorjs*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
/editorjs
/dist
/*.tgz
/index.js
/*.zip
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*
!/index.js
!/dist/index.js
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ More info at https://editorjs.io/
If using Directus as npm package, you can include the extension as package in your `package.json` file as:

```json
"dependencies": {
"directus-extension-editorjs": "latest"
}
"dependencies": {
"directus-extension-editorjs": "latest"
}
```

### Docker installation / extensions directory
Expand All @@ -24,9 +24,8 @@ manualy from the package tar

```bash
cd <your directus extensions directory>/interfaces
curl -LO directus-extension-editorjs-interface.tgz
tar xvf directus-extension-editorjs*.tgz
mv package editorjs
curl -LO https://github.com/dimitrov-adrian/directus-extension-editorjs-interface/releases/latest/download/editorjs.zip
unzip editorjs.zip
```

### Build by yourself
Expand All @@ -41,21 +40,21 @@ To use this custom interface into a data model, you have to:
- In the **Interface** section on the left choose **Editor.js**
- Enjoy ! 🎉

### Output
### Example output of the interface

```javascript
```json
{
"version": "2.19.0", // block editor version,
"time": 1607174917790, // timestamp of content change>,
"blocks": [
// ...
{
"type" : "paragraph",
"data" : {
"text" : "Paragraph from editorjs interface in Directus."
}
},
// ...
]
"version": "2.19.0",
"time": 1607174917790,
"blocks": [
{
"type": "paragraph",
"data": {
"text": "Paragraph from editorjs interface in Directus."
}
}
]
}
```

For more info check https://editorjs.io/base-concepts#what-is-clean-data
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@
],
"directus:extension": {
"type": "interface",
"path": "index.js",
"path": "dist/index.js",
"source": "src/index.js",
"host": "v9.0.0-rc.85",
"hidden": false
},
"scripts": {
"build": "directus-extension build",
"prepack": "npm run build"
"dist": "directus-extension build && mv dist editorjs && zip -r editorjs.zip editorjs",
"prepack": "directus-extension build"
},
"devDependencies": {
"@canburaks/text-align-editorjs": "^1.0.4",
"@directus/extension-sdk": "^9.0.0-rc.85",
"@editorjs/attaches": "^1.1.0",
"@editorjs/checklist": "^1.3.0",
"@editorjs/code": "^2.7.0",
Expand All @@ -47,7 +48,6 @@
"@itech-indrustries/editorjs-strikethrough": "^1.0.0",
"debounce": "^1.2.1",
"editorjs-alert": "^1.0.3",
"editorjs-list": "^2.1.4",
"@directus/extension-sdk": "*"
"editorjs-list": "^2.1.4"
}
}

0 comments on commit 8c86a7a

Please sign in to comment.