ultimate-jekyll-manager 0.0.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/CHANGELOG.md +20 -0
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/bin/uj +7 -0
- package/dist/cli.js +33 -0
- package/dist/commands/setup.js +77 -0
- package/dist/commands/version.js +5 -0
- package/package copy.json +75 -0
- package/package.json +60 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
|
|
7
|
+
## Changelog Categories
|
|
8
|
+
|
|
9
|
+
- `BREAKING` for breaking changes.
|
|
10
|
+
- `Added` for new features.
|
|
11
|
+
- `Changed` for changes in existing functionality.
|
|
12
|
+
- `Deprecated` for soon-to-be removed features.
|
|
13
|
+
- `Removed` for now removed features.
|
|
14
|
+
- `Fixed` for any bug fixes.
|
|
15
|
+
- `Security` in case of vulnerabilities.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
## [1.0.0] - 2024-06-19
|
|
19
|
+
### Added
|
|
20
|
+
- Initial release of the project 🚀
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Jr. AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/bin/uj
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const jetpack = require('fs-jetpack');
|
|
4
|
+
|
|
5
|
+
// Main Function
|
|
6
|
+
function Main() {
|
|
7
|
+
const self = this;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
Main.prototype.process = async function (options) {
|
|
11
|
+
const self = this;
|
|
12
|
+
|
|
13
|
+
// Determine the command (default to "setup" if none provided)
|
|
14
|
+
const command = options._[0] || 'setup';
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
// Get the command file path
|
|
18
|
+
const commandFile = path.join(__dirname, 'commands', `${command}.js`);
|
|
19
|
+
|
|
20
|
+
// Check if the command file exists
|
|
21
|
+
if (!jetpack.exists(commandFile)) {
|
|
22
|
+
throw new Error(`Error: Command "${command}" not found.`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Execute the command
|
|
26
|
+
const Command = require(commandFile);
|
|
27
|
+
await Command(options);
|
|
28
|
+
} catch (e) {
|
|
29
|
+
console.error(`Error executing command "${command}": ${e.message}`);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
module.exports = Main;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { gte, clean } = require('semver');
|
|
4
|
+
const { execute } = require('node-powertools');
|
|
5
|
+
const NPM = require('npm-api');
|
|
6
|
+
|
|
7
|
+
// Load package
|
|
8
|
+
const package = require('../../package.json');
|
|
9
|
+
const project = require(path.join(process.cwd(), 'package.json'));
|
|
10
|
+
|
|
11
|
+
module.exports = async function (options) {
|
|
12
|
+
console.log(`Welcome to Ultimate Jekyll v${package.version}!`);
|
|
13
|
+
|
|
14
|
+
// Log
|
|
15
|
+
console.log('package:', package);
|
|
16
|
+
console.log('project:', project);
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
// Ensure this package is up-to-date
|
|
20
|
+
await updateManager();
|
|
21
|
+
|
|
22
|
+
// Run the setup
|
|
23
|
+
await ensurePeerDependencies();
|
|
24
|
+
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error(`Error during the prompt: ${e.message}`);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
async function updateManager() {
|
|
31
|
+
const npm = new NPM();
|
|
32
|
+
|
|
33
|
+
const latestVersion = await npm.repo('ultimate-jekyll-manager')
|
|
34
|
+
.package()
|
|
35
|
+
.then((pkg) => {
|
|
36
|
+
return pkg.version;
|
|
37
|
+
}, (e) => {
|
|
38
|
+
return '0.0.0';
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Compare the versions
|
|
42
|
+
console.log('latestVersion:', latestVersion);
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function ensurePeerDependencies() {
|
|
47
|
+
const requiredPeerDependencies = package.requiredPeerDependencies || {};
|
|
48
|
+
|
|
49
|
+
// Loop through and make sure project has AT LEAST the required version
|
|
50
|
+
for (const [dependency, version] of Object.entries(requiredPeerDependencies)) {
|
|
51
|
+
const projectDependencyVersion = project.dependencies[dependency] || project.devDependencies[dependency];
|
|
52
|
+
|
|
53
|
+
// Install if not found
|
|
54
|
+
if (!projectDependencyVersion) {
|
|
55
|
+
await install(dependency, version);
|
|
56
|
+
} else {
|
|
57
|
+
// Clean the version and compare
|
|
58
|
+
const cleanProjectVersion = clean(projectDependencyVersion);
|
|
59
|
+
const cleanRequiredVersion = clean(version);
|
|
60
|
+
|
|
61
|
+
if (!gte(cleanProjectVersion, cleanRequiredVersion)) {
|
|
62
|
+
await install(dependency, version);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function install(package, version) {
|
|
69
|
+
// Default to latest
|
|
70
|
+
version || 'latest';
|
|
71
|
+
|
|
72
|
+
// Build the command
|
|
73
|
+
let command = `npm install ${package}@${version}`;
|
|
74
|
+
|
|
75
|
+
// Execute
|
|
76
|
+
return execute(command, { log: true })
|
|
77
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ultimate-jekyll-manager",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Ultimate Jekyll dependency manager",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
|
|
8
|
+
},
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=18.x"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/itw-creative-works/ultimate-jekyll.git"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"Autoprefixer",
|
|
18
|
+
"Browsersync",
|
|
19
|
+
"gulp",
|
|
20
|
+
"imagemin",
|
|
21
|
+
"Jekyll",
|
|
22
|
+
"PostCSS",
|
|
23
|
+
"Sass",
|
|
24
|
+
"Webpack"
|
|
25
|
+
],
|
|
26
|
+
"author": "ITW Creative Works",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/itw-creative-works/ultimate-jekyll/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://template.itwcreativeworks.com",
|
|
32
|
+
"noteDeps": {
|
|
33
|
+
"browser-sync": "2.23.7 (6-22-2023): Hard lock because every version after uses socket.io@4.7.0 which uses engine.io@6.5.0 which is incompatible with node 10.15.1 due to TextDecoder() in build process",
|
|
34
|
+
"sharp": "0.23.1 (sometime before 2021ish): Hard lock because later versions had issues. Possibly solved in higher node versions"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@babel/core": "7.24.7",
|
|
38
|
+
"@babel/preset-env": "7.24.7",
|
|
39
|
+
"autoprefixer": "9.8.8",
|
|
40
|
+
"browser-sync": "2.23.7",
|
|
41
|
+
"del": "6.1.1",
|
|
42
|
+
"eslint-config-google": "0.14.0",
|
|
43
|
+
"eslint-webpack-plugin": "3.2.0",
|
|
44
|
+
"event-stream": "4.0.1",
|
|
45
|
+
"fs-jetpack": "4.3.1",
|
|
46
|
+
"glob": "7.2.3",
|
|
47
|
+
"gulp": "3.9.1",
|
|
48
|
+
"gulp-babel": "8.0.0",
|
|
49
|
+
"gulp-cached": "1.1.1",
|
|
50
|
+
"gulp-eslint": "6.0.0",
|
|
51
|
+
"gulp-newer": "1.4.0",
|
|
52
|
+
"gulp-plumber": "1.2.1",
|
|
53
|
+
"gulp-postcss": "9.0.1",
|
|
54
|
+
"gulp-responsive": "3.0.1",
|
|
55
|
+
"gulp-sass": "4.1.1",
|
|
56
|
+
"gulp-watch": "5.0.1",
|
|
57
|
+
"js-yaml": "4.1.0",
|
|
58
|
+
"json5": "2.2.3",
|
|
59
|
+
"mocha": "8.4.0",
|
|
60
|
+
"node-fetch": "2.6.12",
|
|
61
|
+
"require-dir": "1.2.0",
|
|
62
|
+
"sharp": "0.23.1",
|
|
63
|
+
"source-map-loader": "2.0.2",
|
|
64
|
+
"terser-webpack-plugin": "5.3.10",
|
|
65
|
+
"through2": "4.0.2",
|
|
66
|
+
"ultimate-jekyll-poster": "1.0.1",
|
|
67
|
+
"vinyl-named": "1.1.0",
|
|
68
|
+
"web-manager": "3.2.60",
|
|
69
|
+
"webpack": "5.89.0",
|
|
70
|
+
"webpack-stream": "6.1.2",
|
|
71
|
+
"wonderful-fetch": "1.1.12",
|
|
72
|
+
"yargs": "16.2.0",
|
|
73
|
+
"zzzzzzzzzz": "9.9.9"
|
|
74
|
+
}
|
|
75
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ultimate-jekyll-manager",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Ultimate Jekyll dependency manager",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"prepare": "node -e \"require('prepare-package')()\"",
|
|
8
|
+
"prepare:watch": "nodemon -w ./src -e '*' --exec 'npm run prepare'"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"uj": "bin/uj",
|
|
12
|
+
"ultimate-jekyll": "bin/uj"
|
|
13
|
+
},
|
|
14
|
+
"preparePackage": {
|
|
15
|
+
"input": "./src",
|
|
16
|
+
"output": "./dist",
|
|
17
|
+
"replace": {}
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": "18"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/itw-creative-works/ultimate-jekyll.git"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"Autoprefixer",
|
|
28
|
+
"Browsersync",
|
|
29
|
+
"gulp",
|
|
30
|
+
"imagemin",
|
|
31
|
+
"Jekyll",
|
|
32
|
+
"PostCSS",
|
|
33
|
+
"Sass",
|
|
34
|
+
"Webpack"
|
|
35
|
+
],
|
|
36
|
+
"author": "ITW Creative Works",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/itw-creative-works/ultimate-jekyll/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://template.itwcreativeworks.com",
|
|
42
|
+
"noteDeps": {
|
|
43
|
+
"browser-sync": "2.23.7 (6-22-2023): Hard lock because every version after uses socket.io@4.7.0 which uses engine.io@6.5.0 which is incompatible with node 10.15.1 due to TextDecoder() in build process",
|
|
44
|
+
"sharp": "0.23.1 (sometime before 2021ish): Hard lock because later versions had issues. Possibly solved in higher node versions"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"itwcw-package-analytics": "^1.0.6",
|
|
48
|
+
"node-powertools": "^2.1.2",
|
|
49
|
+
"npm-api": "^1.0.1",
|
|
50
|
+
"semver": "^7.6.3",
|
|
51
|
+
"wonderful-fetch": "^1.3.0",
|
|
52
|
+
"yargs": "^17.7.2"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"gulp": "^5.0.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"prepare-package": "^1.1.13"
|
|
59
|
+
}
|
|
60
|
+
}
|