Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
Bump dependencies and update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurconexia committed Feb 10, 2020
1 parent 47e31a6 commit ef57a57
Show file tree
Hide file tree
Showing 18 changed files with 3,082 additions and 3,353 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": [
"env"
"@babel/preset-env"
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Arthur Arioli Bergamaschi
Copyright (c) 2020 Arthur Arioli Bergamaschi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# webpack-pwa-manifest

> [_Click here and take a look at my latest project: **Organi**ser_](https://github.com/fatec-taquaritinga/organiser)
> Looking for people willing to help! [More info](https://github.com/arthurbergmz/webpack-pwa-manifest/issues/119)
`webpack-pwa-manifest` is a webpack plugin that generates a 'manifest.json' for your Progressive Web Application, with auto icon resizing and fingerprinting support.

Expand Down
6,364 changes: 3,034 additions & 3,330 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"application"
],
"scripts": {
"build": "babel src --out-dir dist",
"build": "npx babel src --out-dir dist",
"clean": "rimraf -rf tests/*/output && rimraf -rf dist",
"test": "npm run clean && npm run build && node tests/index.js",
"test:debug": "npm run clean && npm run build && node --inspect-brk ./tests/index.js"
Expand All @@ -35,17 +35,17 @@
"mime": "^2.4.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^10.0.1",
"babel-preset-env": "^1.6.1",
"eslint": "^5.10.0",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"babel-eslint": "^10.0.3",
"eslint": "^6.8.0",
"extract-text-webpack-plugin": "^3.0.2",
"html-webpack-plugin": ">=3.0.6",
"html-webpack-plugin": ">=3.2.0",
"list-directory-contents": "0.0.3",
"rimraf": "^2.6.2",
"rimraf": "^3.0.2",
"webpack": "^4.41.5",
"webpack-cli": "^3.1.2"
"webpack-cli": "^3.3.10"
},
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion tests/basic/test/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-icon sizes=1024x1024 href=/icons/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=manifest href=/manifest.b71cbf253213cc7cedb8b846c4e8ea0a.json><link rel=mask-icon href=/icons/icon_512x512.dd60b11e9762b6e25f6d4ce981a1eeae.svg color=#ffffff></head><body><script type=text/javascript src=/main.72d5eaca4af91e626344.bundle.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-icon sizes=1024x1024 href=/icons/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=manifest href=/manifest.b71cbf253213cc7cedb8b846c4e8ea0a.json><link rel=mask-icon href=/icons/icon_512x512.dd60b11e9762b6e25f6d4ce981a1eeae.svg color=#ffffff></head><body><script type=text/javascript src=/main.c2a880b33508651abef9.bundle.js></script></body></html>
2 changes: 1 addition & 1 deletion tests/complex/test/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-startup-image sizes=1024x1024 href=/icons/ios/startup/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=apple-touch-icon sizes=1024x1024 href=/icons/ios/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=apple-touch-icon sizes=180x180 href=/icons/ios/icon_180x180.ff39561a8e4bf67913868a5caa412712.png><link rel=apple-touch-icon sizes=167x167 href=/icons/ios/icon_167x167.26d2d10196ca0a32493134fb5a4510ba.png><link rel=apple-touch-icon sizes=152x152 href=/icons/ios/icon_152x152.8f7dadbad509ff949e7da5488f44b686.png><link rel=apple-touch-icon sizes=120x120 href=/icons/ios/icon_120x120.463a6f38bcc879bee49facdf208464c4.png><link rel=manifest href=/manifest.aa33c28d24e1121925cfa150e2ec52a9.json crossorigin=use-credentials></head><body><script type=text/javascript src=/main.72d5eaca4af91e626344.bundle.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-startup-image sizes=1024x1024 href=/icons/ios/startup/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=apple-touch-icon sizes=1024x1024 href=/icons/ios/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=apple-touch-icon sizes=180x180 href=/icons/ios/icon_180x180.ff39561a8e4bf67913868a5caa412712.png><link rel=apple-touch-icon sizes=167x167 href=/icons/ios/icon_167x167.26d2d10196ca0a32493134fb5a4510ba.png><link rel=apple-touch-icon sizes=152x152 href=/icons/ios/icon_152x152.8f7dadbad509ff949e7da5488f44b686.png><link rel=apple-touch-icon sizes=120x120 href=/icons/ios/icon_120x120.463a6f38bcc879bee49facdf208464c4.png><link rel=manifest href=/manifest.aa33c28d24e1121925cfa150e2ec52a9.json crossorigin=use-credentials></head><body><script type=text/javascript src=/main.c2a880b33508651abef9.bundle.js></script></body></html>
2 changes: 1 addition & 1 deletion tests/issue-84/test/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-icon sizes=1024x1024 href=/icons/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=manifest href=/manifest.81200e1d24c270411245b5a63a4b91e7.json><link rel=mask-icon href=/icons/icon_512x512.dd60b11e9762b6e25f6d4ce981a1eeae.svg color=#ffffff></head><body><script type=text/javascript src=/main.72d5eaca4af91e626344.bundle.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-icon sizes=1024x1024 href=/icons/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=manifest href=/manifest.81200e1d24c270411245b5a63a4b91e7.json><link rel=mask-icon href=/icons/icon_512x512.dd60b11e9762b6e25f6d4ce981a1eeae.svg color=#ffffff></head><body><script type=text/javascript src=/main.c2a880b33508651abef9.bundle.js></script></body></html>
2 changes: 1 addition & 1 deletion tests/issue-87/test/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-startup-image sizes=768x768 href=/icons/icon_768x768.f85b060e02c421c52e530e23fe1df50e.png><link rel=apple-touch-startup-image sizes=750x750 href=/icons/icon_750x750.6d93014782b03254bb1f640a67ed0590.png><link rel=apple-touch-startup-image sizes=640x640 href=/icons/icon_640x640.3e80720306149c1cca44f6fa41d3dffd.png><link rel=manifest href=/manifest.24abfacd4846fab249f8fe94967260b9.json></head><body><script type=text/javascript src=/main.72d5eaca4af91e626344.bundle.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-startup-image sizes=768x768 href=/icons/icon_768x768.f85b060e02c421c52e530e23fe1df50e.png><link rel=apple-touch-startup-image sizes=750x750 href=/icons/icon_750x750.6d93014782b03254bb1f640a67ed0590.png><link rel=apple-touch-startup-image sizes=640x640 href=/icons/icon_640x640.3e80720306149c1cca44f6fa41d3dffd.png><link rel=manifest href=/manifest.24abfacd4846fab249f8fe94967260b9.json></head><body><script type=text/javascript src=/main.c2a880b33508651abef9.bundle.js></script></body></html>
2 changes: 1 addition & 1 deletion tests/rgb-background/test/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-icon sizes=1024x1024 href=/icons/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=manifest href=/manifest.836308dd4105e7779e96d575bbcb3984.json><link rel=mask-icon href=/icons/icon_512x512.dd60b11e9762b6e25f6d4ce981a1eeae.svg color=#ffffff></head><body><script type=text/javascript src=/main.72d5eaca4af91e626344.bundle.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-icon sizes=1024x1024 href=/icons/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=manifest href=/manifest.836308dd4105e7779e96d575bbcb3984.json><link rel=mask-icon href=/icons/icon_512x512.dd60b11e9762b6e25f6d4ce981a1eeae.svg color=#ffffff></head><body><script type=text/javascript src=/main.c2a880b33508651abef9.bundle.js></script></body></html>
2 changes: 1 addition & 1 deletion tests/rgba-background/test/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-icon sizes=1024x1024 href=/icons/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=manifest href=/manifest.82c3c467821f8c1b613bc6f741480697.json><link rel=mask-icon href=/icons/icon_512x512.dd60b11e9762b6e25f6d4ce981a1eeae.svg color=#ffffff></head><body><script type=text/javascript src=/main.72d5eaca4af91e626344.bundle.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=UTF-8><title>Webpack App</title><meta name=apple-mobile-web-app-title content="My Progressive Web App"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=default><link rel=apple-touch-icon sizes=1024x1024 href=/icons/icon_1024x1024.35f4891d98af6eb0c3dee2853ea0f190.png><link rel=manifest href=/manifest.82c3c467821f8c1b613bc6f741480697.json><link rel=mask-icon href=/icons/icon_512x512.dd60b11e9762b6e25f6d4ce981a1eeae.svg color=#ffffff></head><body><script type=text/javascript src=/main.c2a880b33508651abef9.bundle.js></script></body></html>
35 changes: 30 additions & 5 deletions tests/runTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,64 @@ const assert = require('assert')

function run (name, next) {
if (!name) return console.log('End.')

const config = require(path.resolve(`./tests/${name}/build/webpack.config.js`))
console.log(`"${name}": building...`)

webpack(config, (err, stats) => {

if (err) throw err

console.log(`"${name}": testing...`)

const testPath = path.join(__dirname, name, 'test')
const testPathLength = testPath.length

ls(testPath, (err, tree) => {
if (err) throw err

const testTree = tree.filter((i) => /.*\..+/.test(i))
const testContent = testTree.map((i) => i.substring(testPathLength))
const testContentLength = testContent.length
const outputPath = path.join(__dirname, name, 'output')
const outputPathLength = outputPath.length

ls(outputPath, (err, outputTree) => {
if (err) throw err

const outputContent = outputTree.filter((i) => /.*\..+/.test(i))
const outputContentLength = outputContent.length

// console.log('outputContent: ', outputContent)
// console.log('outputContentLength: ', outputContentLength)

if (testContentLength === outputContentLength) {
const result = outputContent.reduce((previous, current) => {
const p = current.substring(outputPathLength)
const f = testContent.indexOf(p)
return f > -1 && fs.readFileSync(current).equals(fs.readFileSync(testTree[f])) ? previous + 1 : previous
const result = outputContent.reduce((successfulTests, outputToTest) => {
const outputFilename = outputToTest.substring(outputPathLength)
const testAgainst = testContent.indexOf(outputFilename)

const success = testAgainst > -1 && fs.readFileSync(outputToTest).equals(fs.readFileSync(testTree[testAgainst]))

// if (!success) {
// console.log(`FAILED: "${outputFilename}" AGAINST "${testTree[testAgainst]}..."`)
// }

return success ? successfulTests + 1 : successfulTests
}, 0)

// console.log('RESULT: ', result)
// console.log('TEST CONTENT LENGTH: ', testContentLength)

if (result === testContentLength) {
console.log(`Test "${name}" passed.`)
run(next.shift(), next)
} else {
console.log('There are files missing or with different content.')
console.log(`Test "${name}" failedon file ${outputContent}.`)
console.log(`Test "${name}" failed on file ${outputContent}.`)
assert(result === testContentLength)
}
} else {

console.log(`Expected ${testContentLength} file(s).`)
console.log(`Found ${outputContentLength} file(s).`)
console.log(`Test "${name}" failed.`)
Expand Down

0 comments on commit ef57a57

Please sign in to comment.