quackage 1.0.60 → 1.0.62
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/gulp/Quackage-Gulpfile.js +18 -0
- package/package.json +5 -5
- package/source/Default-Quackage-Configuration.json +2 -1
- package/source/Quackage-CLIProgram.js +1 -0
- package/source/commands/Quackage-Command-CheckDependencies.js +134 -0
- package/source/commands/Quackage-Command-CopyFilesFromTo.js +1 -1
- package/source/commands/Quackage-Command-RunMochaTests.js +1 -1
|
@@ -90,6 +90,15 @@ libGulp.task('minified',
|
|
|
90
90
|
debug: true
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
+
// Ignore modules that should not be bundled (e.g. WASM loaders loaded via <script> tag)
|
|
94
|
+
if (Array.isArray(_CONFIG.BrowserifyIgnore))
|
|
95
|
+
{
|
|
96
|
+
for (var i = 0; i < _CONFIG.BrowserifyIgnore.length; i++)
|
|
97
|
+
{
|
|
98
|
+
tmpBrowserify.ignore(_CONFIG.BrowserifyIgnore[i]);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
93
102
|
return tmpBrowserify.bundle()
|
|
94
103
|
.pipe(libVinylSourceStream(_CONFIG.LibraryMinifiedFileName))
|
|
95
104
|
.pipe(libVinylBuffer())
|
|
@@ -113,6 +122,15 @@ libGulp.task('debug',
|
|
|
113
122
|
debug: true
|
|
114
123
|
});
|
|
115
124
|
|
|
125
|
+
// Ignore modules that should not be bundled (e.g. WASM loaders loaded via <script> tag)
|
|
126
|
+
if (Array.isArray(_CONFIG.BrowserifyIgnore))
|
|
127
|
+
{
|
|
128
|
+
for (var i = 0; i < _CONFIG.BrowserifyIgnore.length; i++)
|
|
129
|
+
{
|
|
130
|
+
tmpBrowserify.ignore(_CONFIG.BrowserifyIgnore[i]);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
116
134
|
return tmpBrowserify.bundle()
|
|
117
135
|
.pipe(libVinylSourceStream(_CONFIG.LibraryUniminifiedFileName))
|
|
118
136
|
.pipe(libVinylBuffer())
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quackage",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.62",
|
|
4
4
|
"description": "Building. Testing. Quacking. Reloading.",
|
|
5
5
|
"main": "source/Quackage-CLIProgram.js",
|
|
6
6
|
"scripts": {
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://github.com/stevenvelozo/quackage",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@babel/core": "^7.
|
|
54
|
-
"@babel/preset-env": "^7.
|
|
55
|
-
"browserify": "^17.0.
|
|
53
|
+
"@babel/core": "^7.29.0",
|
|
54
|
+
"@babel/preset-env": "^7.29.0",
|
|
55
|
+
"browserify": "^17.0.1",
|
|
56
56
|
"chai": "4.3.10",
|
|
57
57
|
"copy-files-from-to": "^3.11.0",
|
|
58
58
|
"gulp": "^4.0.2",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"mocha": "10.4.0",
|
|
66
66
|
"npm-check-updates": "^18.0.1",
|
|
67
67
|
"nyc": "^15.1.0",
|
|
68
|
-
"pict-docuserve": "^0.0.
|
|
68
|
+
"pict-docuserve": "^0.0.32",
|
|
69
69
|
"pict-service-commandlineutility": "^1.0.19",
|
|
70
70
|
"retold-harness": "^1.1.2",
|
|
71
71
|
"vinyl-buffer": "^1.0.1",
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"LibraryObjectName": "{~PascalCaseIdentifier:AppData.Package.name~}",
|
|
7
7
|
"LibraryOutputFolder": "{~Data:AppData.CWD~}/dist/",
|
|
8
8
|
"LibraryUniminifiedFileName": "{~Data:AppData.Package.name~}.{~Data:Record.BuildFileLabel~}js",
|
|
9
|
-
"LibraryMinifiedFileName": "{~Data:AppData.Package.name~}.{~Data:Record.BuildFileLabel~}min.js"
|
|
9
|
+
"LibraryMinifiedFileName": "{~Data:AppData.Package.name~}.{~Data:Record.BuildFileLabel~}min.js",
|
|
10
|
+
"BrowserifyIgnore": []
|
|
10
11
|
},
|
|
11
12
|
"WatchSettings": {
|
|
12
13
|
"MonitorFolders": ["./html", "./css", "./assets"],
|
|
@@ -20,6 +20,7 @@ let _Pict = new libCLIProgram(
|
|
|
20
20
|
require('./commands/Quackage-Command-UpdatePackage.js'),
|
|
21
21
|
require('./commands/Quackage-Command-UpdatePackage-Luxury.js'),
|
|
22
22
|
require('./commands/Quackage-Command-Lint.js'),
|
|
23
|
+
require('./commands/Quackage-Command-CheckDependencies.js'),
|
|
23
24
|
require('./commands/Quackage-Command-UpdateNodeGitignore.js'),
|
|
24
25
|
|
|
25
26
|
// Mocha test execution
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
const libCommandLineCommand = require('pict-service-commandlineutility').ServiceCommandLineCommand;
|
|
2
|
+
const libFS = require('fs');
|
|
3
|
+
const libPath = require('path');
|
|
4
|
+
|
|
5
|
+
class QuackageCommandCheckDependencies extends libCommandLineCommand
|
|
6
|
+
{
|
|
7
|
+
constructor(pFable, pManifest, pServiceHash)
|
|
8
|
+
{
|
|
9
|
+
super(pFable, pManifest, pServiceHash);
|
|
10
|
+
|
|
11
|
+
this.options.CommandKeyword = 'check-dependencies';
|
|
12
|
+
this.options.Description = 'Check package.json for local file:// references and list all dependency versions';
|
|
13
|
+
this.options.Aliases.push('check-deps');
|
|
14
|
+
this.options.Aliases.push('checkdeps');
|
|
15
|
+
|
|
16
|
+
this.options.CommandOptions.push({ Name: '-a, --allow-file-package-references', Description: 'Allow file:// references without returning an error exit code', Default: false });
|
|
17
|
+
|
|
18
|
+
this.addCommand();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
onRunAsync(fCallback)
|
|
22
|
+
{
|
|
23
|
+
let tmpPackage = this.fable.AppData.Package;
|
|
24
|
+
let tmpCWD = this.fable.AppData.CWD;
|
|
25
|
+
let tmpAllowFileReferences = this.CommandOptions.allowFilePackageReferences ? true : false;
|
|
26
|
+
|
|
27
|
+
let tmpFileReferenceCount = 0;
|
|
28
|
+
let tmpMismatchCount = 0;
|
|
29
|
+
|
|
30
|
+
this.log.info(`Checking dependencies for ${tmpPackage.name}@${tmpPackage.version} ...`);
|
|
31
|
+
|
|
32
|
+
let tmpDependencySections = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
|
|
33
|
+
|
|
34
|
+
for (let i = 0; i < tmpDependencySections.length; i++)
|
|
35
|
+
{
|
|
36
|
+
let tmpSectionName = tmpDependencySections[i];
|
|
37
|
+
|
|
38
|
+
if (!tmpPackage.hasOwnProperty(tmpSectionName))
|
|
39
|
+
{
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let tmpDependencies = tmpPackage[tmpSectionName];
|
|
44
|
+
let tmpDependencyNames = Object.keys(tmpDependencies);
|
|
45
|
+
|
|
46
|
+
if (tmpDependencyNames.length < 1)
|
|
47
|
+
{
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log('');
|
|
52
|
+
this.log.info(`--- ${tmpSectionName} ---`);
|
|
53
|
+
|
|
54
|
+
for (let j = 0; j < tmpDependencyNames.length; j++)
|
|
55
|
+
{
|
|
56
|
+
let tmpDepName = tmpDependencyNames[j];
|
|
57
|
+
let tmpDepVersion = tmpDependencies[tmpDepName];
|
|
58
|
+
let tmpIsFileReference = (typeof(tmpDepVersion) === 'string') && tmpDepVersion.startsWith('file://');
|
|
59
|
+
|
|
60
|
+
// Try to read the installed version from node_modules
|
|
61
|
+
let tmpInstalledVersion = '(not installed)';
|
|
62
|
+
try
|
|
63
|
+
{
|
|
64
|
+
let tmpInstalledPackagePath = libPath.join(tmpCWD, 'node_modules', tmpDepName, 'package.json');
|
|
65
|
+
if (libFS.existsSync(tmpInstalledPackagePath))
|
|
66
|
+
{
|
|
67
|
+
let tmpInstalledPackage = JSON.parse(libFS.readFileSync(tmpInstalledPackagePath, 'utf8'));
|
|
68
|
+
tmpInstalledVersion = tmpInstalledPackage.version || '(unknown)';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (pError)
|
|
72
|
+
{
|
|
73
|
+
tmpInstalledVersion = '(error reading)';
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let tmpVersionMatch = true;
|
|
77
|
+
// For non-file references, check if the installed version satisfies the specified range
|
|
78
|
+
if (!tmpIsFileReference && tmpInstalledVersion !== '(not installed)' && tmpInstalledVersion !== '(error reading)' && tmpInstalledVersion !== '(unknown)')
|
|
79
|
+
{
|
|
80
|
+
// Simple display check -- show mismatch if the specified version doesn't contain the installed version
|
|
81
|
+
// This is intentionally simple; a full semver check would require a library
|
|
82
|
+
if (tmpDepVersion !== tmpInstalledVersion && !tmpDepVersion.includes(tmpInstalledVersion))
|
|
83
|
+
{
|
|
84
|
+
tmpVersionMatch = false;
|
|
85
|
+
tmpMismatchCount++;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (tmpIsFileReference)
|
|
90
|
+
{
|
|
91
|
+
tmpFileReferenceCount++;
|
|
92
|
+
this.log.warn(` [FILE REF] ${tmpDepName}: ${tmpDepVersion} --> installed: ${tmpInstalledVersion}`);
|
|
93
|
+
}
|
|
94
|
+
else if (!tmpVersionMatch)
|
|
95
|
+
{
|
|
96
|
+
this.log.info(` [MISMATCH] ${tmpDepName}: ${tmpDepVersion} --> installed: ${tmpInstalledVersion}`);
|
|
97
|
+
}
|
|
98
|
+
else
|
|
99
|
+
{
|
|
100
|
+
this.log.info(` [OK] ${tmpDepName}: ${tmpDepVersion} --> installed: ${tmpInstalledVersion}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
console.log('');
|
|
106
|
+
|
|
107
|
+
if (tmpMismatchCount > 0)
|
|
108
|
+
{
|
|
109
|
+
this.log.warn(`Found ${tmpMismatchCount} version mismatch(es) between package.json and node_modules.`);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (tmpFileReferenceCount > 0)
|
|
113
|
+
{
|
|
114
|
+
this.log.warn(`Found ${tmpFileReferenceCount} file:// reference(s) in package.json!`);
|
|
115
|
+
if (!tmpAllowFileReferences)
|
|
116
|
+
{
|
|
117
|
+
this.log.error(`Refusing to publish with local file:// references. Use --allow-file-package-references to override.`);
|
|
118
|
+
this.fable.QuackageProcess.exitParentProcess(1);
|
|
119
|
+
}
|
|
120
|
+
else
|
|
121
|
+
{
|
|
122
|
+
this.log.info(`File references allowed by --allow-file-package-references flag.`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else
|
|
126
|
+
{
|
|
127
|
+
this.log.info(`No file:// references found. All clear for publishing!`);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return fCallback();
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
module.exports = QuackageCommandCheckDependencies;
|
|
@@ -43,7 +43,7 @@ class QuackageCommandCopyFilesFromTo extends libCommandLineCommand
|
|
|
43
43
|
{
|
|
44
44
|
let tmpErrorMessage = `Not even the git checkout location has an installation of copy-files-from-to at [${tmpCFFTLocation}]... building cannot commence. We also tried CWD [${tmpCWDCFFTLocation}] and relative node_modules [${tmpRelativePackageCFFTLocation}]. Sorry! Maybe you need to run "npm install" somewhere??`;
|
|
45
45
|
this.log.info(tmpErrorMessage)
|
|
46
|
-
return
|
|
46
|
+
return fCallback(new Error(tmpErrorMessage));
|
|
47
47
|
}
|
|
48
48
|
this.log.info(`Quackage found copy-files-from-to at [${tmpCFFTLocation}] ... executing build from there.`);
|
|
49
49
|
|
|
@@ -44,7 +44,7 @@ class QuackageCommandBuild extends libCommandLineCommand
|
|
|
44
44
|
{
|
|
45
45
|
let tmpErrorMessage = `Not even the git checkout location has an installation of mocha at [${tmpMochaLocation}]... building cannot commence. We also tried CWD [${tmpCWDMochaLocation}] and relative node_modules [${tmpRelativePackageMochaLocation}]. Sorry! Maybe you need to run "npm install" somewhere??`;
|
|
46
46
|
this.log.info(tmpErrorMessage)
|
|
47
|
-
return
|
|
47
|
+
return fCallback(new Error(tmpErrorMessage));
|
|
48
48
|
}
|
|
49
49
|
this.log.info(`Quackage found mocha at [${tmpMochaLocation}] ... executing build from there.`);
|
|
50
50
|
|