Skip to content

Commit

Permalink
fix!: support for node v16+ by migrating node-saas to saas and updati…
Browse files Browse the repository at this point in the history
…ng webpack from v4 -> v5 (#94)

* fix: support for node v16+ by migrating node-saas to saas and updating webpack from v4 -> v5 fixes #85
* fix!: removes support for node v10 and node v12. Node v16+ is now required (mostly for current versions of babel)
  • Loading branch information
activescott committed Sep 10, 2023
1 parent fa8333a commit 033714a
Show file tree
Hide file tree
Showing 14 changed files with 7,042 additions and 19,702 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -33,10 +33,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js v12.x
- name: Select Node.js Version
uses: actions/setup-node@v1
with:
node-version: v12.x
node-version: v18.x

- name: build
run: |
Expand Down
Binary file not shown.
Binary file not shown.
40 changes: 17 additions & 23 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
module.exports = proc => {
module.exports = (proc) => {
const isTest = proc.env("test")
const plugins = [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-flow-strip-types",
"@babel/plugin-transform-runtime"
]
if ( isTest ){
plugins.push( "transform-es2015-modules-commonjs" )
const plugins = ["@babel/plugin-transform-runtime"]
if (isTest) {
plugins.push("transform-es2015-modules-commonjs")
}
return {
"presets": [
[ "@babel/preset-env", { targets: { node: "current" } } ]
presets: [
[
"@babel/preset-env",
{
targets: {
esmodules: true,
},
},
],
],
plugins,
"ignore": [
"node_modules/**/*"
],
"sourceMaps": true,
"sourceType": "unambiguous"
ignore: ["node_modules/**/*"],
sourceMaps: true,
sourceType: "unambiguous",
}
}
}
26 changes: 0 additions & 26 deletions bower.json

This file was deleted.

5 changes: 2 additions & 3 deletions examples-new/events/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
<head>
<title>Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- By loading a UMD module this way, it will expose the library on window.CookieConsent -->
<script src="https://unpkg.com/@activescott/cookieconsent@>=5"></script>

<!-- For local dev (assumes npm install from package.json installs local package): -->
<!--
<script src="node_modules/@activescott/cookieconsent/dist/umd/index.js"></script>
-->
<!-- <script src="node_modules/@activescott/cookieconsent/dist/umd/index.js"></script> -->

<script>
/** This is just a quick & dirty way to allow deleting this page's cookies and refreshing the page to easily trigger cookie consent again */
Expand Down
5 changes: 4 additions & 1 deletion examples-new/simplest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
},
"devDependencies": {
"serve": "^12.0.1"
},
"dependencies": {
"@activescott/cookieconsent": "file:../.."
}
}
}
69 changes: 36 additions & 33 deletions examples-new/simplest/simplest.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<head>
<title>Example</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<!-- By loading a UMD module this way, it will expose the libray on window.CookieConsent -->
<script src="https://unpkg.com/@activescott/cookieconsent@>=5">
</script>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- By loading a UMD module this way, it will expose the library on window.CookieConsent -->
<script src="https://unpkg.com/@activescott/cookieconsent@>=5"></script>

<!-- For local dev (assumes npm install from package.json installs local package): -->
<!-- <script src="node_modules/@activescott/cookieconsent/dist/umd/index.js"></script> -->

<script>
function main() {
const options = {
// all of this is optional:
palette: {
popup: {
background: "#4586c6",
text: "#ffffffc0",
},
button: {
background: "transparent",
text: "#ffffffc0",
border: "#ffffffc0",
},
},
content: {
link: "Learn More",
href: "/policy/privacy",
},
}
new window.CookieConsent(options)
function main() {
const options = {
// all of this is optional:
palette: {
popup: {
background: "#4586c6",
text: "#ffffffc0",
},
button: {
background: "transparent",
text: "#ffffffc0",
border: "#ffffffc0",
},
},
content: {
link: "Learn More",
href: "/policy/privacy",
},
}
document.addEventListener("DOMContentLoaded", main)
new window.CookieConsent(options)
}
document.addEventListener("DOMContentLoaded", main)
</script>
</head>

<body>
You should see the cookie consent prompt in a new browser session (try a private window). Or look in the browser
console for errors.
</body>
</head>

</html>
<body>
You should see the cookie consent prompt in a new browser session (try a
private window). Or look in the browser console for errors.
</body>
</html>
Loading

0 comments on commit 033714a

Please sign in to comment.