quackage 1.0.33 → 1.0.34
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/.quackage-templates.json +3 -3
- package/gulp/Quackage-Gulpfile-Watch.js +71 -0
- package/gulp/Quackage-Gulpfile.js +24 -24
- package/package.json +70 -70
- package/source/Default-Quackage-Configuration.json +5 -1
- package/source/Quackage-CLIProgram.js +1 -0
- package/source/commands/Quackage-Command-Watch.js +145 -0
- package/source/services/Quackage-Documentation-Compile.js +37 -36
- package/templates/pictview/source/views/QUACKAGEPROJECTNAMECAP-View-QUACKAGESCOPE.js +79 -0
- package/templates/pictview/source/Pict-View-QUACKAGEPROJECTNAMECAP-QUACKAGESCOPE.js +0 -63
package/.quackage-templates.json
CHANGED
|
@@ -139,9 +139,9 @@
|
|
|
139
139
|
"Description": "A template set for pictview ...",
|
|
140
140
|
"Files": [
|
|
141
141
|
{
|
|
142
|
-
"Hash": "
|
|
143
|
-
"Path": "source/
|
|
144
|
-
"Content": "const libPictView = require('pict-view');\n\
|
|
142
|
+
"Hash": "sourceviewsQUACKAGEPROJECTNAMECAPViewQUACKAGESCOPEjs",
|
|
143
|
+
"Path": "source/views/QUACKAGEPROJECTNAMECAP-View-QUACKAGESCOPE.js",
|
|
144
|
+
"Content": "const libPictView = require('pict-view');\n\n_DEFAULT_CONFIGURATION_{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~} = (\n\t{\n\t\tViewIdentifier: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}',\n\n\t\tDefaultRenderable: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',\n\t\tDefaultDestinationAddress: '#{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}_Container',\n\t\tDefaultTemplateRecordAddress: false,\n\n\t\t// If this is set to true, when the App initializes this will.\n\t\t// While the App initializes, initialize will be called.\n\t\tAutoInitialize: true,\n\t\tAutoInitializeOrdinal: 0,\n\n\t\t// If this is set to true, when the App autorenders (on load) this will.\n\t\t// After the App initializes, render will be called.\n\t\tAutoRender: true,\n\t\tAutoRenderOrdinal: 0,\n\n\t\tAutoSolveWithApp: true,\n\t\tAutoSolveOrdinal: 0,\n\n\t\tCSS: false,\n\t\tCSSPriority: 500,\n\n\t\tTemplates:\n\t\t[\n\t\t\t{\n\t\t\t\tHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',\n\t\t\t\tTemplate: /*html*/`\n\t<!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} pict view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->\n\t<!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} end view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->\n\t`\n\t\t\t}\n\t\t],\n\n\t\tRenderables:\n\t\t[\n\t\t\t{\n\t\t\t\tRenderableHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',\n\t\t\t\tTemplateHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',\n\t\t\t\tDestinationAddress: '#{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}_Container',\n\t\t\t\tRenderMethod: 'replace'\n\t\t\t}\n\t\t],\n\n\t\tManifests: {}\n\t});\n\nclass {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~} extends libPictView\n{\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\tlet tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}, pOptions);\n\t\tsuper(pFable, tmpOptions, pServiceHash);\n\t}\n}\n\nmodule.exports = {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~};\n\n/*\n\t# Quackage Boilerplate Usage:\n\n\tTo add this view to the app, add the following code:\n\n\t// Require the {~PascalCaseIdentifier:Record.Scope~} view class prototype\n\tconst lib{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}View = require(`${__dirname}/views/{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-View-{~PascalCaseIdentifier:Record.Scope~}.js`);\n\n\t// Add the {~PascalCaseIdentifier:Record.Scope~} view to the pict application\n\tthis.pict.addView('{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}', {}, lib{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}View);\n\n\t// Profit!\n*/\n\n/**************************************\n * {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~} Default View Configuration\n **************************************/\nmodule.exports.default_configuration = _DEFAULT_CONFIGURATION_{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~};"
|
|
145
145
|
}
|
|
146
146
|
]
|
|
147
147
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
console.log(`[ Quackage-Gulpfile.js ] ---> Loading the gulp config...`);
|
|
4
|
+
let _CONFIG = require(`${process.cwd()}/.gulpfile-quackage-config.json`);
|
|
5
|
+
if (process.env.QuackageBuildConfig)
|
|
6
|
+
{
|
|
7
|
+
_CONFIG = JSON.parse(process.env.QuackageBuildConfig);
|
|
8
|
+
}
|
|
9
|
+
//process.env['BABEL_SHOW_CONFIG_FOR'] = `${_CONFIG.EntrypointInputSourceFile} npm start`;
|
|
10
|
+
console.log(` > Building to [${_CONFIG.LibraryUniminifiedFileName}] and [${_CONFIG.LibraryMinifiedFileName}]`);
|
|
11
|
+
console.log(`--> Gulp is taking over!`);
|
|
12
|
+
console.log('BROWSERSLIST: ', process.env['BROWSERSLIST']);
|
|
13
|
+
const libBrowserify = require('browserify');
|
|
14
|
+
const libGulp = require('gulp');
|
|
15
|
+
|
|
16
|
+
const libVinylSourceStream = require('vinyl-source-stream');
|
|
17
|
+
const libVinylBuffer = require('vinyl-buffer');
|
|
18
|
+
|
|
19
|
+
const libSourcemaps = require('gulp-sourcemaps');
|
|
20
|
+
const libBabel = require('gulp-babel');
|
|
21
|
+
const libTerser = require('gulp-terser');
|
|
22
|
+
|
|
23
|
+
const libWatchify = require('watchify');
|
|
24
|
+
|
|
25
|
+
libGulp.task
|
|
26
|
+
(
|
|
27
|
+
'watch',
|
|
28
|
+
() => {
|
|
29
|
+
const customOptions = {
|
|
30
|
+
entries: _CONFIG.EntrypointInputSourceFile,
|
|
31
|
+
standalone: _CONFIG.LibraryObjectName,
|
|
32
|
+
debug: true,
|
|
33
|
+
cache: {},
|
|
34
|
+
packageCache: {}
|
|
35
|
+
}
|
|
36
|
+
const options = Object.assign({}, libWatchify.args, customOptions);
|
|
37
|
+
const browserify = libWatchify(libBrowserify(options), { poll: true });
|
|
38
|
+
const babelOptions = { 'targets': process.env['BROWSERSLIST']};
|
|
39
|
+
|
|
40
|
+
browserify.on('update', () => {
|
|
41
|
+
buildUnminified(browserify, babelOptions);
|
|
42
|
+
buildMinified(browserify, babelOptions);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
browserify.on('log', console.log);
|
|
46
|
+
browserify.on('error', console.error);
|
|
47
|
+
|
|
48
|
+
buildUnminified(browserify, babelOptions);
|
|
49
|
+
buildMinified(browserify, babelOptions);
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
function buildUnminified(browserify, babelOptions) {
|
|
54
|
+
browserify.bundle()
|
|
55
|
+
.pipe(libVinylSourceStream(_CONFIG.LibraryUniminifiedFileName))
|
|
56
|
+
.pipe(libVinylBuffer())
|
|
57
|
+
.pipe(libSourcemaps.init({loadMaps: true}))
|
|
58
|
+
.pipe(libBabel(babelOptions)).on('error', console.log)
|
|
59
|
+
.pipe(libGulp.dest(_CONFIG.LibraryOutputFolder));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function buildMinified(browserify, babelOptions) {
|
|
63
|
+
browserify.bundle()
|
|
64
|
+
.pipe(libVinylSourceStream(_CONFIG.LibraryMinifiedFileName))
|
|
65
|
+
.pipe(libVinylBuffer())
|
|
66
|
+
.pipe(libSourcemaps.init({loadMaps: true}))
|
|
67
|
+
.pipe(libBabel(babelOptions))
|
|
68
|
+
.pipe(libTerser()).on('error', console.log)
|
|
69
|
+
.pipe(libSourcemaps.write('./'))
|
|
70
|
+
.pipe(libGulp.dest(_CONFIG.LibraryOutputFolder));
|
|
71
|
+
}
|
|
@@ -81,37 +81,37 @@ const libTerser = require('gulp-terser');
|
|
|
81
81
|
|
|
82
82
|
// Build the module for the browser
|
|
83
83
|
libGulp.task('minified',
|
|
84
|
-
() => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
() => {
|
|
85
|
+
// set up the custom browserify instance for this task
|
|
86
|
+
var tmpBrowserify = libBrowserify(
|
|
87
|
+
{
|
|
88
|
+
entries: _CONFIG.EntrypointInputSourceFile,
|
|
89
|
+
standalone: _CONFIG.LibraryObjectName,
|
|
90
|
+
debug: true
|
|
91
|
+
});
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
93
|
+
return tmpBrowserify.bundle()
|
|
94
|
+
.pipe(libVinylSourceStream(_CONFIG.LibraryMinifiedFileName))
|
|
95
|
+
.pipe(libVinylBuffer())
|
|
96
|
+
.pipe(libSourcemaps.init({loadMaps: true}))
|
|
97
|
+
// Oddly, having a .babelrc with this same thing behaves differently, and is the behavior we want
|
|
98
|
+
//.pipe(libBabel({"presets": ["@babel/preset-env"]}))
|
|
99
|
+
.pipe(libBabel())
|
|
100
|
+
.pipe(libTerser()).on('error', console.log)
|
|
101
|
+
.pipe(libSourcemaps.write('./'))
|
|
102
|
+
.pipe(libGulp.dest(_CONFIG.LibraryOutputFolder));
|
|
103
|
+
});
|
|
104
104
|
|
|
105
105
|
// Build the module for the browser
|
|
106
106
|
libGulp.task('debug',
|
|
107
107
|
() => {
|
|
108
108
|
// set up the custom browserify instance for this task
|
|
109
109
|
var tmpBrowserify = libBrowserify(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
{
|
|
111
|
+
entries: _CONFIG.EntrypointInputSourceFile,
|
|
112
|
+
standalone: _CONFIG.LibraryObjectName,
|
|
113
|
+
debug: true
|
|
114
|
+
});
|
|
115
115
|
|
|
116
116
|
return tmpBrowserify.bundle()
|
|
117
117
|
.pipe(libVinylSourceStream(_CONFIG.LibraryUniminifiedFileName))
|
package/package.json
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
"name": "quackage",
|
|
3
|
+
"version": "1.0.34",
|
|
4
|
+
"description": "Building. Testing. Quacking. Reloading.",
|
|
5
|
+
"main": "source/Quackage-CLIProgram.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node source/Quackage-Run.js",
|
|
8
|
+
"coverage": "npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec",
|
|
9
|
+
"test": "npx mocha -u tdd -R spec",
|
|
10
|
+
"build": "./source/Quackage-Run.js buildtemplates ./templates",
|
|
11
|
+
"tests": "npx mocha -u tdd --exit -R spec --grep"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"quack": "./source/Quackage-Run.js",
|
|
15
|
+
"qua": "./source/Quackage-Run.js"
|
|
16
|
+
},
|
|
17
|
+
"mocha": {
|
|
18
|
+
"diff": true,
|
|
19
|
+
"extension": [
|
|
20
|
+
"js"
|
|
21
|
+
],
|
|
22
|
+
"package": "./package.json",
|
|
23
|
+
"reporter": "spec",
|
|
24
|
+
"slow": "75",
|
|
25
|
+
"timeout": "5000",
|
|
26
|
+
"ui": "tdd",
|
|
27
|
+
"watch-files": [
|
|
28
|
+
"source/**/*.js",
|
|
29
|
+
"test/**/*.js"
|
|
30
|
+
],
|
|
31
|
+
"watch-ignore": [
|
|
32
|
+
"lib/vendor"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/stevenvelozo/quackage.git"
|
|
38
|
+
},
|
|
39
|
+
"browser": {
|
|
40
|
+
"./source/utility/Quackage-Execute-Process.js": "./source/utility/Quackage-Execute-Process-Base.js"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"templates",
|
|
44
|
+
"metapackage"
|
|
21
45
|
],
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"url": "https://github.com/stevenvelozo/quackage/issues"
|
|
50
|
-
},
|
|
51
|
-
"homepage": "https://github.com/stevenvelozo/quackage",
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"@babel/core": "^7.25.2",
|
|
54
|
-
"@babel/preset-env": "^7.25.3",
|
|
55
|
-
"browserify": "^17.0.0",
|
|
56
|
-
"chai": "4.3.10",
|
|
57
|
-
"copy-files-from-to": "^3.11.0",
|
|
58
|
-
"devextreme-showdown": "^1.0.1",
|
|
59
|
-
"gulp": "^4.0.2",
|
|
60
|
-
"gulp-babel": "^8.0.0",
|
|
61
|
-
"gulp-env": "^0.4.0",
|
|
62
|
-
"gulp-sourcemaps": "^3.0.0",
|
|
63
|
-
"gulp-terser": "^2.1.0",
|
|
64
|
-
"marked": "^13.0.3",
|
|
65
|
-
"marked-tex-renderer": "^1.1.1",
|
|
66
|
-
"mocha": "10.7.0",
|
|
67
|
-
"npm-check-updates": "^17.0.2",
|
|
68
|
-
"nyc": "^15.1.0",
|
|
69
|
-
"pict-service-commandlineutility": "^1.0.15",
|
|
70
|
-
"vinyl-buffer": "^1.0.1",
|
|
71
|
-
"vinyl-source-stream": "^2.0.0"
|
|
72
|
-
}
|
|
46
|
+
"author": "Steven Velozo <steven@velozo.com> (http://velozo.com/)",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/stevenvelozo/quackage/issues"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://github.com/stevenvelozo/quackage",
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@babel/core": "^7.23.9",
|
|
54
|
+
"@babel/preset-env": "^7.23.9",
|
|
55
|
+
"browserify": "^17.0.0",
|
|
56
|
+
"chai": "4.3.10",
|
|
57
|
+
"copy-files-from-to": "^3.11.0",
|
|
58
|
+
"devextreme-showdown": "^1.0.1",
|
|
59
|
+
"gulp": "^4.0.2",
|
|
60
|
+
"gulp-babel": "^8.0.0",
|
|
61
|
+
"gulp-env": "^0.4.0",
|
|
62
|
+
"gulp-sourcemaps": "^3.0.0",
|
|
63
|
+
"gulp-terser": "^2.1.0",
|
|
64
|
+
"marked": "~10.0.0",
|
|
65
|
+
"marked-tex-renderer": "^1.1.1",
|
|
66
|
+
"mocha": "10.4.0",
|
|
67
|
+
"npm-check-updates": "^16.14.20",
|
|
68
|
+
"nyc": "^15.1.0",
|
|
69
|
+
"pict-service-commandlineutility": "^1.0.14",
|
|
70
|
+
"vinyl-buffer": "^1.0.1",
|
|
71
|
+
"vinyl-source-stream": "^2.0.0"
|
|
72
|
+
}
|
|
73
73
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"QuackageBaseGulpfile": "require('{~Data:AppData.QuackageFolder~}/gulp/Quackage-Gulpfile.js');",
|
|
2
|
+
"QuackageBaseGulpfile": "require('{~Data:AppData.QuackageFolder~}/gulp/Quackage-Gulpfile.js');\nrequire('{~Data:AppData.QuackageFolder~}/gulp/Quackage-Gulpfile-Watch.js');",
|
|
3
3
|
"GulpfileConfiguration": {
|
|
4
4
|
"EntrypointInputSourceFile": "{~Data:AppData.CWD~}/{~Data:AppData.Package.main~}",
|
|
5
5
|
"LibraryObjectName": "{~PascalCaseIdentifier:AppData.Package.name~}",
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
"LibraryUniminifiedFileName": "{~Data:AppData.Package.name~}.{~Data:Record.BuildFileLabel~}js",
|
|
8
8
|
"LibraryMinifiedFileName": "{~Data:AppData.Package.name~}.{~Data:Record.BuildFileLabel~}min.js"
|
|
9
9
|
},
|
|
10
|
+
"WatchSettings": {
|
|
11
|
+
"MonitorFolders": ["./html", "./css", "./assets"],
|
|
12
|
+
"OnFilesChangedCommand": "npx quack copy"
|
|
13
|
+
},
|
|
10
14
|
"DefaultBabelRC": {
|
|
11
15
|
"presets": [
|
|
12
16
|
"@babel/preset-env"
|
|
@@ -26,6 +26,7 @@ let _Pict = new libCLIProgram(
|
|
|
26
26
|
|
|
27
27
|
// Gulp build execution (for multiple build targets)
|
|
28
28
|
require('./commands/Quackage-Command-Build.js'),
|
|
29
|
+
require('./commands/Quackage-Command-Watch.js'),
|
|
29
30
|
require('./commands/Quackage-Command-CopyFilesFromTo.js'),
|
|
30
31
|
|
|
31
32
|
// Build documentation from a folder, with configuration magic if you want
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
const libCommandLineCommand = require('pict-service-commandlineutility').ServiceCommandLineCommand;
|
|
2
|
+
const libFS = require('fs');
|
|
3
|
+
const { spawn } = require('node:child_process');
|
|
4
|
+
const {exec} = require("child_process");
|
|
5
|
+
const {watch} = require("fs");
|
|
6
|
+
|
|
7
|
+
class QuackageCommandWatchOld extends libCommandLineCommand
|
|
8
|
+
{
|
|
9
|
+
constructor(pFable, pManifest, pServiceHash)
|
|
10
|
+
{
|
|
11
|
+
super(pFable, pManifest, pServiceHash);
|
|
12
|
+
|
|
13
|
+
this.logDesignation = 'Quackage Watcher';
|
|
14
|
+
this.reloadCommand = '';
|
|
15
|
+
this.configOverrides;
|
|
16
|
+
this.options.CommandKeyword = 'watch';
|
|
17
|
+
this.options.Description = 'Build your npm module into a dist folder and watch for changes to automatically rebuild';
|
|
18
|
+
|
|
19
|
+
// Auto add the command on initialization
|
|
20
|
+
this.addCommand();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
onRunAsync(fCallback)
|
|
24
|
+
{
|
|
25
|
+
this.log.info(`[${this.logDesignation}] Running quackage watcher...`);
|
|
26
|
+
this.fable.TemplateProvider.addTemplate('Gulpfile-Configuration', JSON.stringify(this.pict.ProgramConfiguration.GulpfileConfiguration, null, 4));
|
|
27
|
+
this.fable.TemplateProvider.addTemplate('Gulpfile-QuackageBase', this.pict.ProgramConfiguration.QuackageBaseGulpfile);
|
|
28
|
+
|
|
29
|
+
let watchSettings = this.pict.ProgramConfiguration.WatchSettings
|
|
30
|
+
let tmpActionSet = [];
|
|
31
|
+
|
|
32
|
+
this.log.info(`Checking for override config at ${process.cwd()}/gulpfile-quackage-config-overrides.json`);
|
|
33
|
+
if (libFS.existsSync(`${process.cwd()}/gulpfile-quackage-config-overrides.json`))
|
|
34
|
+
{
|
|
35
|
+
console.log("Found overrides");
|
|
36
|
+
this.configOverrides = require(`${process.cwd()}/gulpfile-quackage-config-overrides.json`);
|
|
37
|
+
watchSettings = {...watchSettings, ...this.configOverrides.WatchSettings};
|
|
38
|
+
}
|
|
39
|
+
this.log.info(`Config settings are: ${JSON.stringify(watchSettings)}`);
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
const directories = watchSettings.MonitorFolders;
|
|
44
|
+
this.reloadCommand = watchSettings.OnFilesChangedCommand;
|
|
45
|
+
|
|
46
|
+
// ##. Figure out which actions to execute
|
|
47
|
+
for (let i = 0; i < this.pict.ProgramConfiguration.GulpExecutions.length; i++)
|
|
48
|
+
{
|
|
49
|
+
tmpActionSet.push(this.pict.ProgramConfiguration.GulpExecutions[i]);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (tmpActionSet.length < 1)
|
|
53
|
+
{
|
|
54
|
+
this.log.error(`No actions to execute for building -- check your quackage configuration!`);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
directories.forEach((dir) => {
|
|
59
|
+
try {
|
|
60
|
+
if (!libFS.existsSync(dir)) {
|
|
61
|
+
libFS.mkdirSync(dir);
|
|
62
|
+
}
|
|
63
|
+
libFS.watch(dir,{ recursive: true }, (event, filename) => this.reload(event, filename));
|
|
64
|
+
}
|
|
65
|
+
catch (exception) {
|
|
66
|
+
this.log.error(`[${this.logDesignation}]: Error watching ${dir} `, exception.message);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
tmpActionSet.forEach(action => {
|
|
71
|
+
this.setupBabel();
|
|
72
|
+
const browsersListSettings = action.BrowsersListRC;
|
|
73
|
+
let tmpGulpLocation = this.setupGulp(action);
|
|
74
|
+
let buildConfig = {...JSON.parse(this.fable.parseTemplateByHash('Gulpfile-Configuration', action), this.configOverrides?.GulpfileConfiguration)};
|
|
75
|
+
let executionEnvironment = {...process.env};
|
|
76
|
+
executionEnvironment['QuackageBuildConfig'] = JSON.stringify(buildConfig);
|
|
77
|
+
executionEnvironment['BROWSERSLIST'] = browsersListSettings;
|
|
78
|
+
this.fable.QuackageProcess.execute(`${tmpGulpLocation}`, [`--gulpfile`, `${this.fable.AppData.CWD}/.gulpfile-quackage.js`, `watch`],
|
|
79
|
+
{ cwd: this.fable.AppData.CWD, env: executionEnvironment }, () => { this.log.info('Completed execution'); });
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
reload(event, filename) {
|
|
84
|
+
this.log.info(`[${this.logDesignation}]: File change detected in `, filename);
|
|
85
|
+
exec(this.reloadCommand, (err, stdout, stderr) => {
|
|
86
|
+
if (err) {
|
|
87
|
+
this.log.error(`[${this.logDesignation}]: `);
|
|
88
|
+
this.log.error(`[${this.logDesignation}]: Error:`);
|
|
89
|
+
this.log.error(`[${this.logDesignation}]: ` + err);
|
|
90
|
+
this.log.error(`[${this.logDesignation}]: `);
|
|
91
|
+
}
|
|
92
|
+
this.log.info(`[${this.logDesignation}]: Files rebuilt`);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
setupBabel() {
|
|
97
|
+
if (this.pict.ProgramConfiguration.DefaultBabelRC)
|
|
98
|
+
{
|
|
99
|
+
if (libFS.existsSync(`${this.fable.AppData.CWD}/.babelrc`))
|
|
100
|
+
{
|
|
101
|
+
this.log.info(`Leaving the existing .babelrc file in place. Please make sure it is compatible with the build you are trying to make.`);
|
|
102
|
+
}
|
|
103
|
+
else
|
|
104
|
+
{
|
|
105
|
+
libFS.writeFileSync(`${this.fable.AppData.CWD}/.babelrc`, JSON.stringify(this.pict.ProgramConfiguration.DefaultBabelRC, null, 4));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
setupGulp(pAction) {
|
|
111
|
+
// ## .gulpfile-quackage-config.json
|
|
112
|
+
libFS.writeFileSync(`${this.fable.AppData.CWD}/.gulpfile-quackage-config.json`, this.fable.parseTemplateByHash('Gulpfile-Configuration', pAction));
|
|
113
|
+
// ## .gulpfile-quackage.js
|
|
114
|
+
libFS.writeFileSync(`${this.fable.AppData.CWD}/.gulpfile-quackage.js`, this.fable.parseTemplateByHash('Gulpfile-QuackageBase', { AppData: this.fable.AppData, Record: pAction }));
|
|
115
|
+
// Now execute the gulpfile using our custom service provider!
|
|
116
|
+
// We are forcing the gulp to run from the node_modules folder of the package -- this allows you to run quackage globally or from the root of a monorepo
|
|
117
|
+
let tmpCWDGulpLocation = `${this.fable.AppData.CWD}/node_modules/.bin/gulp`;
|
|
118
|
+
let tmpRelativePackageGulpLocation = `${__dirname}/../../../.bin/gulp`;
|
|
119
|
+
let tmpGitRepositoryGulpLocation = `${__dirname}/../../node_modules/.bin/gulp`;
|
|
120
|
+
let tmpGulpLocation = tmpCWDGulpLocation;
|
|
121
|
+
// Check that gulp exists here
|
|
122
|
+
if (!libFS.existsSync(tmpGulpLocation))
|
|
123
|
+
{
|
|
124
|
+
this.log.info(`CWD Location does not contain an installation of gulp at [${tmpCWDGulpLocation}]; checking relative to the quackage package...`);
|
|
125
|
+
// Try the folder relative to quackage (wherever this packages' node modules are)
|
|
126
|
+
tmpGulpLocation = tmpRelativePackageGulpLocation;
|
|
127
|
+
}
|
|
128
|
+
if (!libFS.existsSync(tmpGulpLocation))
|
|
129
|
+
{
|
|
130
|
+
this.log.info(`Relative Quackage Package Location does not contain an installation of gulp at [${tmpRelativePackageGulpLocation}]; checking if you're running from the direct git repository...`);
|
|
131
|
+
// Try the folder relative to quackage (wherever this packages' node modules are)
|
|
132
|
+
tmpGulpLocation = tmpGitRepositoryGulpLocation;
|
|
133
|
+
}
|
|
134
|
+
if (!libFS.existsSync(tmpGulpLocation))
|
|
135
|
+
{
|
|
136
|
+
let tmpErrorMessage = `Not even the git checkout location has an installation of gulp at [${tmpGulpLocation}]... building cannot commence. We also tried CWD [${tmpCWDGulpLocation}] and relative node_modules [${tmpRelativePackageGulpLocation}]. Sorry! Maybe you need to run "npm install" somewhere??`;
|
|
137
|
+
this.log.info(tmpErrorMessage)
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
this.log.info(`Quackage found gulp at [${tmpGulpLocation}] ... executing build from there.`);
|
|
141
|
+
return tmpGulpLocation;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
module.exports = QuackageCommandWatchOld;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const libPict = require('pict');
|
|
2
2
|
|
|
3
|
-
const libMarked = require('marked');
|
|
4
|
-
const libMarkedTexRenderer = require('marked-tex-renderer');
|
|
3
|
+
//const libMarked = require('marked');
|
|
4
|
+
//const libMarkedTexRenderer = require('marked-tex-renderer');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class DocumentationCompile extends libPict.ServiceProviderBase
|
|
@@ -19,40 +19,41 @@ class DocumentationCompile extends libPict.ServiceProviderBase
|
|
|
19
19
|
|
|
20
20
|
getLaTeXFromMarkdown(pMarkdown)
|
|
21
21
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
\\
|
|
48
|
-
\\
|
|
49
|
-
\\
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
22
|
+
return false;
|
|
23
|
+
// let tmpTexRenderer = new libMarkedTexRenderer()
|
|
24
|
+
// tmpTexRenderer.heading = this.latexHeadingSections;
|
|
25
|
+
// tmpTexRenderer.checkbox = (pChecked) => { return ''; };
|
|
26
|
+
|
|
27
|
+
// // Set the renderer to be markdown
|
|
28
|
+
// libMarked.setOptions(
|
|
29
|
+
// {
|
|
30
|
+
// renderer: tmpTexRenderer,
|
|
31
|
+
// gfm: true,
|
|
32
|
+
// failOnUnsupported: false,
|
|
33
|
+
// delRenderer: (pText) =>
|
|
34
|
+
// {
|
|
35
|
+
// // return TeX source to render deleted text
|
|
36
|
+
// return ``;
|
|
37
|
+
// },
|
|
38
|
+
// linkRenderer: (pHref, pTitle, pText) =>
|
|
39
|
+
// {
|
|
40
|
+
// // return TeX source to render hyperlinks
|
|
41
|
+
// return `\\href{${pHref}}{${pTitle} - ${pText}`;
|
|
42
|
+
// },
|
|
43
|
+
// imageRenderer: (pHref, pTitle, pText) =>
|
|
44
|
+
// {
|
|
45
|
+
// // return TeX source to render images
|
|
46
|
+
// return `
|
|
47
|
+
// \\bigskip
|
|
48
|
+
// \\begin{center}
|
|
49
|
+
// \\includegraphics[width=0.7\\textwidth]{${pHref}}
|
|
50
|
+
// \\end{center}
|
|
51
|
+
|
|
52
|
+
// `;
|
|
53
|
+
// }
|
|
54
|
+
// });
|
|
55
|
+
|
|
56
|
+
// return libMarked.parse(pMarkdown);
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
latexHeadingSections(pHeadingText, pHeadingLevel, pHeadingRaw)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const libPictView = require('pict-view');
|
|
2
|
+
|
|
3
|
+
_DEFAULT_CONFIGURATION_{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~} = (
|
|
4
|
+
{
|
|
5
|
+
ViewIdentifier: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}',
|
|
6
|
+
|
|
7
|
+
DefaultRenderable: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',
|
|
8
|
+
DefaultDestinationAddress: '#{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}_Container',
|
|
9
|
+
DefaultTemplateRecordAddress: false,
|
|
10
|
+
|
|
11
|
+
// If this is set to true, when the App initializes this will.
|
|
12
|
+
// While the App initializes, initialize will be called.
|
|
13
|
+
AutoInitialize: true,
|
|
14
|
+
AutoInitializeOrdinal: 0,
|
|
15
|
+
|
|
16
|
+
// If this is set to true, when the App autorenders (on load) this will.
|
|
17
|
+
// After the App initializes, render will be called.
|
|
18
|
+
AutoRender: true,
|
|
19
|
+
AutoRenderOrdinal: 0,
|
|
20
|
+
|
|
21
|
+
AutoSolveWithApp: true,
|
|
22
|
+
AutoSolveOrdinal: 0,
|
|
23
|
+
|
|
24
|
+
CSS: false,
|
|
25
|
+
CSSPriority: 500,
|
|
26
|
+
|
|
27
|
+
Templates:
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
Hash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',
|
|
31
|
+
Template: /*html*/`
|
|
32
|
+
<!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} pict view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->
|
|
33
|
+
<!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} end view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->
|
|
34
|
+
`
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
|
|
38
|
+
Renderables:
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
RenderableHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',
|
|
42
|
+
TemplateHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',
|
|
43
|
+
DestinationAddress: '#{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}_Container',
|
|
44
|
+
RenderMethod: 'replace'
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
Manifests: {}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
class {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~} extends libPictView
|
|
52
|
+
{
|
|
53
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
54
|
+
{
|
|
55
|
+
let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}, pOptions);
|
|
56
|
+
super(pFable, tmpOptions, pServiceHash);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~};
|
|
61
|
+
|
|
62
|
+
/*
|
|
63
|
+
# Quackage Boilerplate Usage:
|
|
64
|
+
|
|
65
|
+
To add this view to the app, add the following code:
|
|
66
|
+
|
|
67
|
+
// Require the {~PascalCaseIdentifier:Record.Scope~} view class prototype
|
|
68
|
+
const lib{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}View = require(`${__dirname}/views/{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-View-{~PascalCaseIdentifier:Record.Scope~}.js`);
|
|
69
|
+
|
|
70
|
+
// Add the {~PascalCaseIdentifier:Record.Scope~} view to the pict application
|
|
71
|
+
this.pict.addView('{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}', {}, lib{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}View);
|
|
72
|
+
|
|
73
|
+
// Profit!
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**************************************
|
|
77
|
+
* {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~} Default View Configuration
|
|
78
|
+
**************************************/
|
|
79
|
+
module.exports.default_configuration = _DEFAULT_CONFIGURATION_{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const libPictView = require('pict-view');
|
|
2
|
-
|
|
3
|
-
class {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~} extends libPictView
|
|
4
|
-
{
|
|
5
|
-
constructor(pFable, pOptions, pServiceHash)
|
|
6
|
-
{
|
|
7
|
-
super(pFable, pOptions, pServiceHash);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**************************************
|
|
15
|
-
* Default View Configuration *
|
|
16
|
-
**************************************/
|
|
17
|
-
module.exports.default_configuration =
|
|
18
|
-
{
|
|
19
|
-
ViewIdentifier: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}',
|
|
20
|
-
|
|
21
|
-
DefaultRenderable: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',
|
|
22
|
-
DefaultDestinationAddress: '#{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}_Container',
|
|
23
|
-
DefaultTemplateRecordAddress: false,
|
|
24
|
-
|
|
25
|
-
// If this is set to true, when the App initializes this will.
|
|
26
|
-
// While the App initializes, initialize will be called.
|
|
27
|
-
AutoInitialize: true,
|
|
28
|
-
AutoInitializeOrdinal: 0,
|
|
29
|
-
|
|
30
|
-
// If this is set to true, when the App autorenders (on load) this will.
|
|
31
|
-
// After the App initializes, render will be called.
|
|
32
|
-
AutoRender: true,
|
|
33
|
-
AutoRenderOrdinal: 0,
|
|
34
|
-
|
|
35
|
-
AutoSolveWithApp: true,
|
|
36
|
-
AutoSolveOrdinal: 0,
|
|
37
|
-
|
|
38
|
-
CSS: false,
|
|
39
|
-
CSSPriority: 500,
|
|
40
|
-
|
|
41
|
-
Templates:
|
|
42
|
-
[
|
|
43
|
-
{
|
|
44
|
-
Hash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',
|
|
45
|
-
Template: /*html*/`
|
|
46
|
-
<!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} pict view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->
|
|
47
|
-
<!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} end view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->
|
|
48
|
-
`
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
|
|
52
|
-
Renderables:
|
|
53
|
-
[
|
|
54
|
-
{
|
|
55
|
-
RenderableHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',
|
|
56
|
-
TemplateHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',
|
|
57
|
-
DestinationAddress: '#{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}_Container',
|
|
58
|
-
RenderMethod: 'replace'
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
|
|
62
|
-
Manifests: {}
|
|
63
|
-
};
|