@caweb/webpack 1.3.44 → 1.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -9
- package/{plugins/html/webpack.config.js → webpack.config.js} +77 -49
- package/.github/workflows/config-publish.yml +0 -23
- package/.github/workflows/plugins-publish.yml +0 -31
- package/.github/workflows/test +0 -29
- package/.gitmodules +0 -3
- package/CHANGELOG.md +0 -273
- package/plugins/a11y/README.md +0 -19
- package/plugins/a11y/aceconfig.js +0 -44
- package/plugins/a11y/changelog.txt +0 -31
- package/plugins/a11y/index.js +0 -271
- package/plugins/a11y/package-lock.json +0 -3303
- package/plugins/a11y/package.json +0 -42
- package/plugins/css-audit/README.md +0 -20
- package/plugins/css-audit/changelog.txt +0 -41
- package/plugins/css-audit/css-audit.config.cjs +0 -5
- package/plugins/css-audit/default.config.js +0 -19
- package/plugins/css-audit/index.js +0 -326
- package/plugins/css-audit/package-lock.json +0 -1522
- package/plugins/css-audit/package.json +0 -53
- package/plugins/css-audit/sample/no-files.html +0 -9
- package/plugins/html/CHANGELOG.md +0 -300
- package/plugins/html/README.md +0 -62
- package/plugins/html/entry/delta.js +0 -19
- package/plugins/html/entry/eureka.js +0 -19
- package/plugins/html/entry/mono.js +0 -19
- package/plugins/html/entry/oceanside.js +0 -19
- package/plugins/html/entry/orangecounty.js +0 -19
- package/plugins/html/entry/pasorobles.js +0 -19
- package/plugins/html/entry/sacramento.js +0 -19
- package/plugins/html/entry/santabarbara.js +0 -19
- package/plugins/html/entry/santacruz.js +0 -19
- package/plugins/html/entry/shasta.js +0 -19
- package/plugins/html/entry/sierra.js +0 -19
- package/plugins/html/entry/trinity.js +0 -19
- package/plugins/html/index.js +0 -105
- package/plugins/html/package-lock.json +0 -22895
- package/plugins/html/package.json +0 -135
- package/plugins/html/sample/blank.html +0 -13
- package/plugins/html/sample/components/alerts.html +0 -32
- package/plugins/html/sample/components/animations.html +0 -7
- package/plugins/html/sample/components/buttons.html +0 -5
- package/plugins/html/sample/components/cards.html +0 -88
- package/plugins/html/sample/components/lists.html +0 -75
- package/plugins/html/sample/components/locations.html +0 -49
- package/plugins/html/sample/components/profile-banners.html +0 -48
- package/plugins/html/sample/components/sections.html +0 -16
- package/plugins/html/sample/components/service-tiles.html +0 -73
- package/plugins/html/sample/components/typography.html +0 -42
- package/plugins/html/sample/default.html +0 -53
- package/plugins/html/sample/favicon.ico +0 -0
- package/plugins/html/sample/images/black_puppy.jpg +0 -0
- package/plugins/html/sample/images/dolphin_marine_mammals_water.jpg +0 -0
- package/plugins/html/sample/images/grayscale_mountain.jpg +0 -0
- package/plugins/html/sample/images/silhouette.png +0 -0
- package/plugins/html/sample/images/squirrel_tail_bushy_tail.jpg +0 -0
- package/plugins/html/sample/index.html +0 -47
- package/plugins/html/sample/missing/content.html +0 -4
- package/plugins/html/sample/search.html +0 -55
- package/plugins/html/sample/structural/branding.html +0 -21
- package/plugins/html/sample/structural/footer.html +0 -47
- package/plugins/html/sample/structural/header.html +0 -16
- package/plugins/html/sample/structural/mobile-controls.html +0 -5
- package/plugins/html/sample/structural/navigation.html +0 -30
- package/plugins/html/sample/structural/search.html +0 -13
- package/plugins/html/sample/structural/utility-header.html +0 -23
- package/plugins/html/scripts/create-entrypoints.js +0 -60
- package/plugins/html/scripts/schemes.js +0 -123
- package/plugins/html/scripts/update-scripts.js +0 -47
- package/plugins/html/scripts/webpack.test.js +0 -41
- package/plugins/jshint/.customrc +0 -29
- package/plugins/jshint/.jshintrc +0 -31
- package/plugins/jshint/README.md +0 -24
- package/plugins/jshint/changelog.txt +0 -36
- package/plugins/jshint/index.js +0 -291
- package/plugins/jshint/package-lock.json +0 -24453
- package/plugins/jshint/package.json +0 -50
- package/plugins/jshint/reporter.cjs +0 -301
- package/plugins/jshint/sample/no-files.html +0 -9
- package/plugins/jshint/scripts/webpack.test.js +0 -18
- package/sample/index.html +0 -364
- package/scripts/update-deps.js +0 -38
- /package/{plugins/html/helpers → helpers}/logic/endsWith.js +0 -0
- /package/{plugins/html/helpers → helpers}/logic/ifCond.js +0 -0
- /package/{plugins/html/helpers → helpers}/object/jsonParse.js +0 -0
- /package/{plugins/html/helpers → helpers}/object/jsonStringify.js +0 -0
- /package/{plugins/html/helpers → helpers}/string/replace.js +0 -0
- /package/{plugins/html/helpers → helpers}/string/toLower.js +0 -0
- /package/{plugins/html/helpers → helpers}/string/toTitleCase.js +0 -0
- /package/{plugins/html/helpers → helpers}/string/toUpper.js +0 -0
- /package/{plugins/html/tsconfig.json → tsconfig.json} +0 -0
package/plugins/html/index.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* External dependencies
|
|
5
|
-
*/
|
|
6
|
-
import fs from 'fs';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import chalk from 'chalk';
|
|
9
|
-
import deepmerge from 'deepmerge';
|
|
10
|
-
import { fileURLToPath, URL } from 'url';
|
|
11
|
-
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
12
|
-
/*
|
|
13
|
-
import spawn from 'cross-spawn';
|
|
14
|
-
import { getAllFilesSync } from 'get-all-files'
|
|
15
|
-
import EntryDependency from "webpack/lib/dependencies/EntryDependency.js";
|
|
16
|
-
import fs from 'fs';
|
|
17
|
-
|
|
18
|
-
const boldWhite = chalk.bold.white;
|
|
19
|
-
const boldGreen = chalk.bold.green;
|
|
20
|
-
const boldBlue = chalk.bold.hex('#03a7fc');
|
|
21
|
-
*/
|
|
22
|
-
const currentPath = path.dirname(fileURLToPath(import.meta.url));
|
|
23
|
-
const appPath = process.cwd();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Launches CAWeb HTML Markup
|
|
28
|
-
*
|
|
29
|
-
* Requires the devServer to be able to writeToDisk
|
|
30
|
-
* devMiddleware: {
|
|
31
|
-
* writeToDisk: true,
|
|
32
|
-
* }
|
|
33
|
-
*
|
|
34
|
-
* @class CAWebHTMLPlugin
|
|
35
|
-
* @typedef {CAWebHTMLPlugin}
|
|
36
|
-
* @extends {HtmlWebpackPlugin}
|
|
37
|
-
*/
|
|
38
|
-
class CAWebHTMLPlugin extends HtmlWebpackPlugin{
|
|
39
|
-
|
|
40
|
-
// we change some of the html-webpack-plugin defaults
|
|
41
|
-
constructor(opts = {}) {
|
|
42
|
-
let templates = ['blank', 'default', 'search'];
|
|
43
|
-
|
|
44
|
-
let defaultOptions = {
|
|
45
|
-
title: path.basename( appPath ),
|
|
46
|
-
favicon: fs.existsSync(path.join(appPath, 'sample', 'favicon.ico')) ? path.join(appPath, 'sample', 'favicon.ico') : path.join(currentPath, 'sample', 'favicon.ico'),
|
|
47
|
-
inject: 'body',
|
|
48
|
-
template: path.join( currentPath, 'sample', 'default.html'),
|
|
49
|
-
scriptLoading: 'blocking',
|
|
50
|
-
meta: {
|
|
51
|
-
"Author": "CAWebPublishing",
|
|
52
|
-
"Description": "State of California",
|
|
53
|
-
"Keywords": "California,government",
|
|
54
|
-
"viewport": "width=device-width, initial-scale=1.0, maximum-scale=2.0"
|
|
55
|
-
},
|
|
56
|
-
templateParameters: {
|
|
57
|
-
"template": "default",
|
|
58
|
-
"title": path.basename( appPath ),
|
|
59
|
-
"scheme": "oceanside",
|
|
60
|
-
"logo": "https://caweb.cdt.ca.gov/wp-content/uploads/sites/221/2023/06/caweb-publishing-logo.png"
|
|
61
|
-
},
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// update templateParameters.title to match user options.
|
|
65
|
-
if( opts.title ){
|
|
66
|
-
defaultOptions.templateParameters.title = opts.title;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// if template selection is one of ours
|
|
70
|
-
if( opts.template && templates.includes(opts.template) ){
|
|
71
|
-
let template = opts.template;
|
|
72
|
-
// update template file based on template selection
|
|
73
|
-
opts.template = path.join( currentPath, 'sample', `${template}.html`);
|
|
74
|
-
|
|
75
|
-
// update default.templateParameters.template to match user options.
|
|
76
|
-
defaultOptions.templateParameters.template = template;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// if there is a caweb.json file we merge the site data with the templateParameters
|
|
80
|
-
if( fs.existsSync( path.join(appPath, 'caweb.json') ) ){
|
|
81
|
-
|
|
82
|
-
let dataFile = JSON.parse( fs.readFileSync( path.join(appPath, 'caweb.json') ) );
|
|
83
|
-
|
|
84
|
-
// if there is a dataFile.site we merge the defaultOptions.templateParameters, user options.templateParameters, and the dataFile.site
|
|
85
|
-
if( dataFile.site ){
|
|
86
|
-
opts.templateParameters = {
|
|
87
|
-
...defaultOptions.templateParameters,
|
|
88
|
-
...opts.templateParameters,
|
|
89
|
-
...dataFile.site
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
super(deepmerge(defaultOptions, opts));
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
apply(compiler) {
|
|
100
|
-
super.apply(compiler);
|
|
101
|
-
}
|
|
102
|
-
} // end of class
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
export default CAWebHTMLPlugin;
|