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 736e539 commit 415fa0d
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 71 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/[email protected]
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-google-maps.min.js'
source: "./dist/CoCreate-google-maps.min.js"
2 changes: 1 addition & 1 deletion demo/autocomplete.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
organization_Id: '5de0387b12e200ea63204d6c'
}
</script>
<script type="text/javascript" src="https://server.cocreate.app/js/CoCreate.min.js"></script>
<script type="text/javascript" src="https://server.cocreate.app/CoCreateJS/dist/CoCreate.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC-HXe_wfCizNwre28UifFdoAS0kJvBNnA&libraries=places&callback=initMapSettings" async defer></script>
</body>
</html>
2 changes: 1 addition & 1 deletion demo/current-location.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
//5ee2eae63e956152355a3446
</script>

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

<script type="text/javascript" src="../dist/CoCreateMap.min.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/direction.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
organization_Id: '5de0387b12e200ea63204d6c'
}
</script>
<script src="https://server.cocreate.app/js/CoCreate.min.js"></script>
<!--<script src="https://server.cocreate.app/CoCreateJS/dist/CoCreate.js"></script>-->
<!--<script src="https://server.cocreate.app/js/CoCreate-sort.js"></script>-->

</body>
Expand Down
2 changes: 1 addition & 1 deletion demo/fleet-tracking.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
//5ee2eae63e956152355a3446
</script>

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

<script type="text/javascript" src="../dist/CoCreateMap.min.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion demo/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
organization_Id: '5de0387b12e200ea63204d6c'
}
</script>
<script type="text/javascript" src="https://server.cocreate.app/js/CoCreate.min.js"></script>
<script type="text/javascript" src="https://server.cocreate.app/CoCreateJS/dist/CoCreate.js"></script>


</body>
Expand Down
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/google-maps",
"version": "1.0.0",
"description": "A simple google-maps component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
"keywords": ["google-maps","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": [
"google-maps",
"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-google-maps/issues"
},
"homepage": "https://cocreate.app/docs/google-maps",
"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" }
}
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-google-maps': './src/CoCreate-google-maps.js',
"CoCreate-google-maps": "./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', 'google-maps'],
path: path.resolve(__dirname, "dist"),
filename: isProduction ? "[name].min.js" : "[name].js",
libraryTarget: "umd",
libraryExport: "default",
library: ["CoCreate", "googleMaps"],
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 415fa0d

Please sign in to comment.