Transition to monorepo on a new Dev branch

This commit is contained in:
2023-02-22 10:29:46 +01:00
parent 8436f03ec7
commit 3a483dc0ef
3712 changed files with 751 additions and 11 deletions

View File

@@ -0,0 +1,7 @@
Copyright (c) 2015 Tiancheng “Timothy” Gu
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

70
App/Source/node_modules/pug-strip-comments/index.js generated vendored Normal file
View File

@@ -0,0 +1,70 @@
'use strict';
var error = require('pug-error');
module.exports = stripComments;
function unexpectedToken (type, occasion, filename, line) {
var msg = '`' + type + '` encountered when ' + occasion;
throw error('UNEXPECTED_TOKEN', msg, { filename: filename, line: line });
}
function stripComments (input, options) {
options = options || {};
// Default: strip unbuffered comments and leave buffered ones alone
var stripUnbuffered = options.stripUnbuffered !== false;
var stripBuffered = options.stripBuffered === true;
var filename = options.filename;
var out = [];
// If we have encountered a comment token and are not sure if we have gotten
// out of the comment or not
var inComment = false;
// If we are sure that we are in a block comment and all tokens except
// `end-pipeless-text` should be ignored
var inPipelessText = false;
return input.filter(function (tok) {
switch (tok.type) {
case 'comment':
if (inComment) {
unexpectedToken(
'comment', 'already in a comment', filename, tok.line
);
} else {
inComment = tok.buffer ? stripBuffered : stripUnbuffered;
return !inComment;
}
case 'start-pipeless-text':
if (!inComment) return true;
if (inPipelessText) {
unexpectedToken(
'start-pipeless-text', 'already in pipeless text mode',
filename, tok.line
);
}
inPipelessText = true;
return false;
case 'end-pipeless-text':
if (!inComment) return true;
if (!inPipelessText) {
unexpectedToken(
'end-pipeless-text', 'not in pipeless text mode',
filename, tok.line
);
}
inPipelessText = false;
inComment = false;
return false;
// There might be a `text` right after `comment` but before
// `start-pipeless-text`. Treat it accordingly.
case 'text':
return !inComment;
default:
if (inPipelessText) return false;
inComment = false;
return true;
}
});
}

View File

@@ -0,0 +1,24 @@
{
"name": "pug-strip-comments",
"version": "1.0.4",
"description": "Strip comments from a Pug token stream (from the lexer)",
"keywords": [
"pug"
],
"dependencies": {
"pug-error": "^1.3.3"
},
"devDependencies": {
"line-json": "^1.0.0"
},
"files": [
"index.js"
],
"repository": {
"type": "git",
"url": "https://github.com/pugjs/pug/tree/master/packages/pug-strip-comments"
},
"author": "Timothy Gu <timothygu99@gmail.com>",
"license": "MIT",
"gitHead": "1bdf628a70fda7a0d840c52f3abce54b1c6b0130"
}