Skip to content

Commit

Permalink
feat: Initial Release
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Mar 24, 2021
1 parent d6cd122 commit 5085bc0
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 79 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ name: CI
on:
push:
branches:
- master
- master
pull_request:
branches:
- master
- master
create:
branches:
- master
- master

jobs:
updateKeyword:
about:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Jaid/action-sync-node-meta
uses: jaid/action-sync-node-meta@v1.4.0
with:
direction: overwrite-github # default is overwrite-file
githubToken: ${{ secrets.GITHUB }}
ci:

release:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -41,27 +41,26 @@ jobs:
@semantic-release/github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator

docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: update documentation
uses: CoCreate-app/CoCreate-docs@master



cdn:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: upload cdn
uses: CoCreate-app/CoCreate-s3@master
with:
aws-key-id: ${{ secrets.AWSACCESSKEYID }}
aws-access-key: ${{ secrets.AWSSECERTACCESSKEY }}
source: './dist/CoCreate-linkedin.min.js'
source: "./dist/CoCreate-linkedin.min.js"
2 changes: 1 addition & 1 deletion demo/getProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ <h3 class="margin-right:10px" value="{{data.firstName.preferredLocale.country}}"
<script src="https://server.cocreate.app/js/CoCreate.min.js"></script>

<!--CoCreate Plugins-->
<script src="https://server.cocreate.app/js/CoCreate-api.js"></script>
<script src="https://server.cocreate.app/CoCreate-components/CoCreate-api/dist/CoCreate-api.js"></script>

<script src="../src/CoCreate-linkedin.js"></script>
2 changes: 1 addition & 1 deletion demo/managePost.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ <h3 class="margin-right:10px" value="{{data.status}}">Delete Status</h3>
<script src="https://server.cocreate.app/js/CoCreate.min.js"></script>

<!--CoCreate Plugins-->
<script src="https://server.cocreate.app/js/CoCreate-api.js"></script>
<script src="https://server.cocreate.app/CoCreate-components/CoCreate-api/dist/CoCreate-api.js"></script>

<script src="../src/CoCreate-linkedin.js"></script>
55 changes: 37 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@
"name": "@cocreate/linkedin",
"version": "1.0.0",
"description": "A simple linkedin component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
"keywords": ["linkedin","cocreate","low-code-framework","no-code-framework","cocreatejs","cocreatejs-component","cocreate-framework","no-code","low-code","collaborative-framework","realtime","realtime-framework","collaboration","shared-editing","html5-framework","javascript-framework"],
"publishConfig": {
"access": "public"
},
"keywords": [
"linkedin",
"cocreate",
"low-code-framework",
"no-code-framework",
"cocreatejs",
"cocreatejs-component",
"cocreate-framework",
"no-code",
"low-code",
"collaborative-framework",
"realtime",
"realtime-framework",
"collaboration",
"shared-editing",
"html5-framework",
"javascript-framework"
],
"publishConfig": { "access": "public" },
"scripts": {
"start": "npx webpack --config webpack.config.js --watch",
"start": "npx webpack --config webpack.config.js",
"build": "NODE_ENV=production npx webpack --config webpack.config.js",
"dev": "npx webpack --config webpack.config.js --watch",
"docs": "node ./node_modules/@cocreate/docs/src/index.js"
},
"repository": {
Expand All @@ -17,23 +33,26 @@
},
"author": "CoCreate LLC",
"license": "MIT",
"bugs": {
"url": "https://github.com/CoCreate-app/CoCreate-linkedin/issues"
},
"bugs": { "url": "https://github.com/CoCreate-app/CoCreate-linkedin/issues" },
"homepage": "https://cocreate.app/docs/linkedin",
"funding": {
"type": "GitHub Sponsors ❤",
"url": "https://github.com/sponsors/CoCreate-app"
},
"main": "./src/index.js",
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"babel-loader": "^8.2.2",
"@babel/core": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^3.0.0",
"html-webpack-plugin": "^4.5.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^5.14.0",
"webpack-cli": "^4.3.1",
"webpack-log": "^3.0.1"
"webpack": "^5.24.4",
"webpack-cli": "^4.5.0",
"webpack-log": "^3.0.1",
"file-loader": "^6.2.0",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.1.1"
},

"dependencies": {
"@cocreate/docs": "^1.0.3"
}
"dependencies": { "@cocreate/docs": "^1.0.3" }
}
16 changes: 8 additions & 8 deletions src/CoCreate-linkedin.js → src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ const CoCreateLinkedin = {

action_getLinkedinProfile: function(element, data) {
let container = document;
let form_data = CoCreateApi.getFormData('linkedin', 'getLinkedinProfile', container);
let form_data = CoCreate.api.getFormData('linkedin', 'getLinkedinProfile', container);
console.log(form_data);
CoCreateApi.send('linkedin', 'getLinkedinProfile', form_data);
CoCreate.api.send('linkedin', 'getLinkedinProfile', form_data);
console.log(data);
},

action_publishPost: function(element, data) {
let container = document;
let form_data = CoCreateApi.getFormData('linkedin', 'publishPost', container);
CoCreateApi.send('linkedin', 'publishPost', form_data);
let form_data = CoCreate.api.getFormData('linkedin', 'publishPost', container);
CoCreate.api.send('linkedin', 'publishPost', form_data);
console.log(data);
},

action_updatePost: function(element, data) {
let container = document;
let form_data = CoCreateApi.getFormData('linkedin', 'updatePost', container);
CoCreateApi.send('linkedin', 'updatePost', form_data);
let form_data = CoCreate.api.getFormData('linkedin', 'updatePost', container);
CoCreate.api.send('linkedin', 'updatePost', form_data);
console.log(data);
},

action_deletePost: function(element, data) {
let container = document;
let form_data = CoCreateApi.getFormData('linkedin', 'deletePost', container);
CoCreateApi.send('linkedin', 'deletePost', form_data);
let form_data = CoCreate.api.getFormData('linkedin', 'deletePost', container);
CoCreate.api.send('linkedin', 'deletePost', form_data);
console.log(data);
}

Expand Down
98 changes: 61 additions & 37 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,85 @@
// Webpack uses this to work with directories
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
// const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const path = require("path")
const TerserPlugin = require("terser-webpack-plugin")
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
let isProduction = process.env.NODE_ENV === "production"
const { CleanWebpackPlugin } = require("clean-webpack-plugin")

let isProduction = process.env.NODE_ENV === 'production';

// This is main configuration object.
// Here you write different options and tell Webpack what to do
module.exports = {

// Path to your entry point. From this file Webpack will begin his work
entry: {
'CoCreate-linkedin': './src/CoCreate-linkedin.js',
"CoCreate-linkedin": "./src/index.js",
},

// Path and filename of your result bundle.
// Webpack will bundle all JavaScript into this file
output: {
path: path.resolve(__dirname, 'dist'),
filename: isProduction ? '[name].min.js' : '[name].js',
libraryTarget: 'umd',
libraryExport: 'default',
library: ['CoCreate', 'linkedin'],
path: path.resolve(__dirname, "dist"),
filename: isProduction ? "[name].min.js" : "[name].js",
libraryTarget: "umd",
libraryExport: "default",
library: ["CoCreate", "linkedin"],
globalObject: "this",
// publicPath: 'https://server.cocreate.app/CoCreateJS/dist/'
},

plugins: [
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: "[name].css",
}),
],
// Default mode for Webpack is production.
// Depending on mode Webpack will apply different things
// on final bundle. For now we don't need production's JavaScript
// minifying and other thing so let's set mode to development
mode: isProduction ? 'production' : 'development',
mode: isProduction ? "production" : "development",
module: {
rules: [{
test: /\.js$/,
rules: [
{
test: /.js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
loader: "babel-loader",
options: {
presets: ['@babel/preset-env']
}
}
plugins: ["@babel/plugin-transform-modules-commonjs"],
},
},
},
]
{
test: /.css$/i,
use: [
{ loader: "style-loader", options: { injectType: "linkTag" } },
"file-loader",
],
},
],
},

// add source map
...(isProduction ? {} : { devtool: 'eval-source-map' }),
...(isProduction ? {} : { devtool: "eval-source-map" }),

// add uglifyJs
optimization: {
minimizer: [new UglifyJsPlugin({
uglifyOptions: {
// get options: https://github.com/mishoo/UglifyJS
drop_console: isProduction
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: true,
// cache: true,
parallel: true,
// sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
// https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
// extractComments: 'all',
compress: {
drop_console: true,
},
},
}),
],
splitChunks: {
chunks: "all",
minSize: 200,
// maxSize: 99999,
//minChunks: 1,

cacheGroups: {
defaultVendors: false,
},
})],
},
},

};
}

0 comments on commit 5085bc0

Please sign in to comment.