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 29, 2021
1 parent 6fe627c commit 61524ce
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 75 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-instagram.min.js'
source: "./dist/CoCreate-instagram.min.js"
8 changes: 4 additions & 4 deletions demo/getUserProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ <h1>testing success</h1>
apiKey: 'c2b08663-06e3-440c-ef6f-13978b42883a',
securityKey: 'f26baf68-e3a9-45fc-effe-502e47116265',
organization_Id: '5de0387b12e200ea63204d6c',
host: '52.203.210.252:8081'

}
</script>

<!--CoCreateJS-->
<script src="https://server.cocreate.app/js/CoCreate.min.js"></script>
<!--<script src="https://server.cocreate.app/CoCreateJS/dist/CoCreate.js"></script>-->

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

<script src="../dist/CoCreate-instagram.js"></script>


</html>
8 changes: 4 additions & 4 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>List of API - Instagram</h1>
apiKey: 'c2b08663-06e3-440c-ef6f-13978b42883a',
securityKey: 'f26baf68-e3a9-45fc-effe-502e47116265',
organization_Id: '5de0387b12e200ea63204d6c',
host: '52.203.210.252:8081'

}

function navigate(name){
Expand All @@ -47,10 +47,10 @@ <h1>List of API - Instagram</h1>
</script>

<!--CoCreateJS-->
<script src="https://server.cocreate.app/js/CoCreate.min.js"></script>
<!--<script src="https://server.cocreate.app/CoCreateJS/dist/CoCreate.js"></script>-->

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

<script src="../dist/CoCreate-instagram.js"></script>

</html>
51 changes: 36 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@
"name": "@cocreate/instagram",
"version": "1.0.0",
"description": "A simple instagram component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
"keywords": ["instagram","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": [
"instagram",
"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 @@ -21,19 +37,24 @@
"url": "https://github.com/CoCreate-app/CoCreate-instagram/issues"
},
"homepage": "https://cocreate.app/docs/instagram",
"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" }
}
2 changes: 1 addition & 1 deletion src/CoCreate-instagram.js → src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const CoCreateInstagram = {
}
};

CoCreate.api.init({
api.init({
name: CoCreateInstagram.id,
module: CoCreateInstagram,
});
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-instagram': './src/CoCreate-instagram.js',
"CoCreate-instagram": "./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', 'instagram'],
path: path.resolve(__dirname, "dist"),
filename: isProduction ? "[name].min.js" : "[name].js",
libraryTarget: "umd",
libraryExport: "default",
library: ["CoCreate", "instagram"],
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 61524ce

Please sign in to comment.