feat: docker compose maybe

This commit is contained in:
2023-11-13 16:10:04 -05:00
parent 180b261e40
commit b625ccd8d6
8031 changed files with 2182966 additions and 0 deletions

View File

@ -0,0 +1,2 @@
export declare const throwError: (msg: string) => never;
export declare const throwTypescriptError: () => void;

View File

@ -0,0 +1 @@
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/modules/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAS,MAAM,UAErC,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAEhC,CAAC"}

11
node_modules/svelte-preprocess/dist/modules/errors.js generated vendored Normal file
View File

@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.throwTypescriptError = exports.throwError = void 0;
const throwError = (msg) => {
throw new Error(`[svelte-preprocess] ${msg}`);
};
exports.throwError = throwError;
const throwTypescriptError = () => {
(0, exports.throwError)(`Encountered type error`);
};
exports.throwTypescriptError = throwTypescriptError;

View File

@ -0,0 +1 @@
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/modules/errors.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE;IACxC,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAC;AAChD,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAEK,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,IAAA,kBAAU,EAAC,wBAAwB,CAAC,CAAC;AACvC,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B"}

View File

@ -0,0 +1 @@
export declare function globalifySelector(selector: string): string;

View File

@ -0,0 +1 @@
{"version":3,"file":"globalifySelector.d.ts","sourceRoot":"","sources":["../../src/modules/globalifySelector.ts"],"names":[],"mappings":"AAUA,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,UAyCjD"}

View File

@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.globalifySelector = void 0;
/* eslint-disable line-comment-position */
/*
* Split a selector string (ex: div > foo ~ .potato) by
* separators: space, >, +, ~ and comma (maybe not needed)
* We use a negative lookbehind assertion to prevent matching
* escaped combinators like `\~`.
*/
// TODO: maybe replace this ugly pattern with an actual selector parser? (https://github.com/leaverou/parsel, 2kb)
const combinatorPattern = /(?<!\\)(?:\\\\)*([ >+~,]\s*)(?![^[]+\]|\d)/g;
function globalifySelector(selector) {
const parts = selector.trim().split(combinatorPattern);
const newSelector = [];
for (let i = 0; i < parts.length; i++) {
const part = parts[i];
// if this is a separator or a :global
if (i % 2 !== 0 || part === '' || part.startsWith(':global')) {
newSelector.push(part);
continue;
}
// :local() with scope
if (part.startsWith(':local(')) {
newSelector.push(part.replace(/:local\((.+?)\)/g, '$1'));
continue;
}
// :local inlined in a selector
if (part.startsWith(':local')) {
// + 2 to ignore the :local and space combinator
const startIndex = i + 2;
let endIndex = parts.findIndex((p, idx) => idx > startIndex && p.startsWith(':global'));
endIndex = endIndex === -1 ? parts.length - 1 : endIndex;
newSelector.push(...parts.slice(startIndex, endIndex + 1));
i = endIndex;
continue;
}
newSelector.push(`:global(${part})`);
}
return newSelector.join('');
}
exports.globalifySelector = globalifySelector;

View File

@ -0,0 +1 @@
{"version":3,"file":"globalifySelector.js","sourceRoot":"","sources":["../../src/modules/globalifySelector.ts"],"names":[],"mappings":";;;AAAA,0CAA0C;AAC1C;;;;;GAKG;AACH,kHAAkH;AAClH,MAAM,iBAAiB,GAAG,6CAA6C,CAAC;AAExE,SAAgB,iBAAiB,CAAC,QAAgB;IAChD,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAEvD,MAAM,WAAW,GAAG,EAAE,CAAC;IAEvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtB,sCAAsC;QACtC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YAC5D,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvB,SAAS;SACV;QAED,sBAAsB;QACtB,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YAC9B,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC;YACzD,SAAS;SACV;QAED,+BAA+B;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YAC7B,gDAAgD;YAChD,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;YACzB,IAAI,QAAQ,GAAG,KAAK,CAAC,SAAS,CAC5B,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,UAAU,IAAI,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CACxD,CAAC;YAEF,QAAQ,GAAG,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YAEzD,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;YAE3D,CAAC,GAAG,QAAQ,CAAC;YAEb,SAAS;SACV;QAED,WAAW,CAAC,IAAI,CAAC,WAAW,IAAI,GAAG,CAAC,CAAC;KACtC;IAED,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9B,CAAC;AAzCD,8CAyCC"}

View File

@ -0,0 +1,11 @@
import type { PreprocessorArgs } from '../types';
export declare const ALIAS_MAP: Map<string, string>;
export declare const SOURCE_MAP_PROP_MAP: Record<string, [string[], any]>;
export declare function getLanguageDefaults(lang?: string | null): null | Record<string, any>;
export declare function addLanguageAlias(entries: Array<[string, string]>): void;
export declare function getLanguageFromAlias(alias?: string | null): string | null | undefined;
export declare function isAliasOf(alias?: string | null, lang?: string | null): boolean;
export declare const getLanguage: (attributes: PreprocessorArgs['attributes']) => {
lang: string | null | undefined;
alias: string | null;
};

View File

@ -0,0 +1 @@
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../src/modules/language.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAwBjD,eAAO,MAAM,SAAS,qBAUpB,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,CAS/D,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GACnB,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAY5B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAEhE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,6BAEzD;AAED,wBAAgB,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,WAEpE;AAED,eAAO,MAAM,WAAW,eAAgB,gBAAgB,CAAC,YAAY,CAAC;;;CAyBrE,CAAC"}

View File

@ -0,0 +1,94 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLanguage = exports.isAliasOf = exports.getLanguageFromAlias = exports.addLanguageAlias = exports.getLanguageDefaults = exports.SOURCE_MAP_PROP_MAP = exports.ALIAS_MAP = void 0;
const path_1 = require("path");
const utils_1 = require("./utils");
const LANGUAGE_DEFAULTS = {
sass: {
indentedSyntax: true,
stripIndent: true,
},
pug: {
stripIndent: true,
},
coffeescript: {
stripIndent: true,
},
stylus: {
stripIndent: true,
},
// We need to defer this require to make sugarss an optional dependency.
sugarss: () => ({
stripIndent: true,
// eslint-disable-next-line @typescript-eslint/no-require-imports, node/global-require
parser: require('sugarss'),
}),
};
exports.ALIAS_MAP = new Map([
['pcss', 'css'],
['postcss', 'css'],
['sugarss', 'css'],
['sss', 'css'],
['sass', 'scss'],
['styl', 'stylus'],
['js', 'javascript'],
['coffee', 'coffeescript'],
['ts', 'typescript'],
]);
exports.SOURCE_MAP_PROP_MAP = {
babel: [['sourceMaps'], true],
typescript: [['compilerOptions', 'sourceMap'], true],
scss: [['sourceMap'], true],
less: [['sourceMap'], {}],
stylus: [['sourcemap'], true],
postcss: [['map'], true],
coffeescript: [['sourceMap'], true],
globalStyle: [['sourceMap'], true],
};
function getLanguageDefaults(lang) {
if (lang == null)
return null;
const defaults = LANGUAGE_DEFAULTS[lang];
if (!defaults)
return null;
if (typeof defaults === 'function') {
return defaults();
}
return defaults;
}
exports.getLanguageDefaults = getLanguageDefaults;
function addLanguageAlias(entries) {
return entries.forEach((entry) => exports.ALIAS_MAP.set(...entry));
}
exports.addLanguageAlias = addLanguageAlias;
function getLanguageFromAlias(alias) {
var _a;
return alias == null ? alias : (_a = exports.ALIAS_MAP.get(alias)) !== null && _a !== void 0 ? _a : alias;
}
exports.getLanguageFromAlias = getLanguageFromAlias;
function isAliasOf(alias, lang) {
return lang !== alias && getLanguageFromAlias(alias) === lang;
}
exports.isAliasOf = isAliasOf;
const getLanguage = (attributes) => {
let alias = null;
if (attributes.lang) {
// istanbul ignore if
if (typeof attributes.lang !== 'string') {
throw new Error('lang attribute must be string');
}
alias = attributes.lang;
}
else if (typeof attributes.src === 'string' &&
(0, utils_1.isValidLocalPath)(attributes.src)) {
const parts = (0, path_1.basename)(attributes.src).split('.');
if (parts.length > 1) {
alias = parts.pop();
}
}
return {
lang: getLanguageFromAlias(alias),
alias,
};
};
exports.getLanguage = getLanguage;

View File

@ -0,0 +1 @@
{"version":3,"file":"language.js","sourceRoot":"","sources":["../../src/modules/language.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAEhC,mCAA2C;AAI3C,MAAM,iBAAiB,GAAwB;IAC7C,IAAI,EAAE;QACJ,cAAc,EAAE,IAAI;QACpB,WAAW,EAAE,IAAI;KAClB;IACD,GAAG,EAAE;QACH,WAAW,EAAE,IAAI;KAClB;IACD,YAAY,EAAE;QACZ,WAAW,EAAE,IAAI;KAClB;IACD,MAAM,EAAE;QACN,WAAW,EAAE,IAAI;KAClB;IACD,wEAAwE;IACxE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QACd,WAAW,EAAE,IAAI;QACjB,sFAAsF;QACtF,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC;KAC3B,CAAC;CACH,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,GAAG,CAAC;IAC/B,CAAC,MAAM,EAAE,KAAK,CAAC;IACf,CAAC,SAAS,EAAE,KAAK,CAAC;IAClB,CAAC,SAAS,EAAE,KAAK,CAAC;IAClB,CAAC,KAAK,EAAE,KAAK,CAAC;IACd,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClB,CAAC,IAAI,EAAE,YAAY,CAAC;IACpB,CAAC,QAAQ,EAAE,cAAc,CAAC;IAC1B,CAAC,IAAI,EAAE,YAAY,CAAC;CACrB,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAoC;IAClE,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IAC7B,UAAU,EAAE,CAAC,CAAC,iBAAiB,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC;IACpD,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC;IACzB,MAAM,EAAE,CAAC,CAA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AAI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE;YACvC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;SAClD;QAED,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC;KACzB;SAAM,IACL,OAAO,UAAU,CAAC,GAAG,KAAK,QAAQ;QAClC,IAAA,wBAAgB,EAAC,UAAU,CAAC,GAAG,CAAC,EAChC;QACA,MAAM,KAAK,GAAG,IAAA,eAAQ,EAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAElD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,KAAK,GAAG,KAAK,CAAC,GAAG,EAAY,CAAC;SAC/B;KACF;IAED,OAAO;QACL,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC;QACjC,KAAK;KACN,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,WAAW,eAyBtB"}

View File

@ -0,0 +1,11 @@
import type { Transformer, Preprocessor } from '../types';
/** Create a tag matching regexp. */
export declare function createTagRegex(tagName: string, flags?: string): RegExp;
/** Strip script and style tags from markup. */
export declare function stripTags(markup: string): string;
/** Transform an attribute string into a key-value object */
export declare function parseAttributes(attributesStr: string): Record<string, any>;
export declare function transformMarkup({ content, filename }: {
content: string;
filename?: string;
}, transformer: Preprocessor | Transformer<unknown>, options?: Record<string, any>): Promise<import("../types").Processed>;

View File

@ -0,0 +1 @@
{"version":3,"file":"markup.d.ts","sourceRoot":"","sources":["../../src/modules/markup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE1D,oCAAoC;AACpC,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAKtE;AAED,+CAA+C;AAC/C,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,4DAA4D;AAC5D,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAY1E;AAED,wBAAsB,eAAe,CACnC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7D,WAAW,EAAE,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,EAChD,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,yCAwClC"}

60
node_modules/svelte-preprocess/dist/modules/markup.js generated vendored Normal file
View File

@ -0,0 +1,60 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformMarkup = exports.parseAttributes = exports.stripTags = exports.createTagRegex = void 0;
/** Create a tag matching regexp. */
function createTagRegex(tagName, flags) {
return new RegExp(`/<!--[^]*?-->|<${tagName}(\\s[^]*?)?(?:>([^]*?)<\\/${tagName}>|\\/>)`, flags);
}
exports.createTagRegex = createTagRegex;
/** Strip script and style tags from markup. */
function stripTags(markup) {
return markup
.replace(createTagRegex('style', 'gi'), '')
.replace(createTagRegex('script', 'gi'), '');
}
exports.stripTags = stripTags;
/** Transform an attribute string into a key-value object */
function parseAttributes(attributesStr) {
return attributesStr
.split(/\s+/)
.filter(Boolean)
.reduce((acc, attr) => {
const [name, value] = attr.split('=');
// istanbul ignore next
acc[name] = value ? value.replace(/['"]/g, '') : true;
return acc;
}, {});
}
exports.parseAttributes = parseAttributes;
async function transformMarkup({ content, filename }, transformer, options = {}) {
let { markupTagName = 'template' } = options;
markupTagName = markupTagName.toLocaleLowerCase();
const markupPattern = createTagRegex(markupTagName);
const templateMatch = content.match(markupPattern);
/** If no <template> was found, run the transformer over the whole thing */
if (!templateMatch || templateMatch.index == null) {
return transformer({
content,
markup: content,
attributes: {},
filename,
options,
});
}
const [fullMatch, attributesStr = '', templateCode] = templateMatch;
const attributes = parseAttributes(attributesStr);
/** Transform the found template code */
let { code, map, dependencies } = await transformer({
content: templateCode,
markup: templateCode,
attributes,
filename,
options,
});
code =
content.slice(0, templateMatch.index) +
code +
content.slice(templateMatch.index + fullMatch.length);
return { code, map, dependencies };
}
exports.transformMarkup = transformMarkup;

View File

@ -0,0 +1 @@
{"version":3,"file":"markup.js","sourceRoot":"","sources":["../../src/modules/markup.ts"],"names":[],"mappings":";;;AAEA,oCAAoC;AACpC,SAAgB,cAAc,CAAC,OAAe,EAAE,KAAc;IAC5D,OAAO,IAAI,MAAM,CACf,kBAAkB,OAAO,6BAA6B,OAAO,SAAS,EACtE,KAAK,CACN,CAAC;AACJ,CAAC;AALD,wCAKC;AAED,+CAA+C;AAC/C,SAAgB,SAAS,CAAC,MAAc;IACtC,OAAO,MAAM;SACV,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;SAC1C,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC;AAJD,8BAIC;AAED,4DAA4D;AAC5D,SAAgB,eAAe,CAAC,aAAqB;IACnD,OAAO,aAAa;SACjB,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,OAAO,CAAC;SACf,MAAM,CAAC,CAAC,GAAqC,EAAE,IAAI,EAAE,EAAE;QACtD,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEtC,uBAAuB;QACvB,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEtD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;AAZD,0CAYC;AAEM,KAAK,UAAU,eAAe,CACnC,EAAE,OAAO,EAAE,QAAQ,EAA0C,EAC7D,WAAgD,EAChD,UAA+B,EAAE;IAEjC,IAAI,EAAE,aAAa,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IAE7C,aAAa,GAAG,aAAa,CAAC,iBAAiB,EAAE,CAAC;IAElD,MAAM,aAAa,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;IAEpD,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAEnD,2EAA2E;IAC3E,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,KAAK,IAAI,IAAI,EAAE;QACjD,OAAO,WAAW,CAAC;YACjB,OAAO;YACP,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,EAAE;YACd,QAAQ;YACR,OAAO;SACR,CAAC,CAAC;KACJ;IAED,MAAM,CAAC,SAAS,EAAE,aAAa,GAAG,EAAE,EAAE,YAAY,CAAC,GAAG,aAAa,CAAC;IAEpE,MAAM,UAAU,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;IAElD,wCAAwC;IACxC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,MAAM,WAAW,CAAC;QAClD,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,YAAY;QACpB,UAAU;QACV,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;IAEH,IAAI;QACF,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC;YACrC,IAAI;YACJ,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAExD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;AACrC,CAAC;AA3CD,0CA2CC"}

View File

@ -0,0 +1,4 @@
export declare function prepareContent({ options, content, }: {
options: any;
content: string;
}): string;

View File

@ -0,0 +1 @@
{"version":3,"file":"prepareContent.d.ts","sourceRoot":"","sources":["../../src/modules/prepareContent.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,UAcA"}

View File

@ -0,0 +1,21 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.prepareContent = void 0;
const strip_indent_1 = __importDefault(require("strip-indent"));
// todo: could use magig-string and generate some sourcemaps 🗺
function prepareContent({ options, content, }) {
if (typeof options !== 'object') {
return content;
}
if (options.stripIndent) {
content = (0, strip_indent_1.default)(content);
}
if (options.prependData) {
content = `${options.prependData}\n${content}`;
}
return content;
}
exports.prepareContent = prepareContent;

View File

@ -0,0 +1 @@
{"version":3,"file":"prepareContent.js","sourceRoot":"","sources":["../../src/modules/prepareContent.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAEvC,+DAA+D;AAC/D,SAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAO,GAIR;IACC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,OAAO,CAAC,WAAW,EAAE;QACvB,OAAO,GAAG,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC;KAChC;IAED,IAAI,OAAO,CAAC,WAAW,EAAE;QACvB,OAAO,GAAG,GAAG,OAAO,CAAC,WAAW,KAAK,OAAO,EAAE,CAAC;KAChD;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AApBD,wCAoBC"}

View File

@ -0,0 +1,10 @@
import type { PreprocessorArgs } from '../types';
export declare const getTagInfo: ({ attributes, filename, content, markup, }: PreprocessorArgs) => Promise<{
filename: string | undefined;
attributes: Record<string, string | boolean>;
content: string;
lang: string | null | undefined;
alias: string | null;
dependencies: string[];
markup: string;
}>;

View File

@ -0,0 +1 @@
{"version":3,"file":"tagInfo.d.ts","sourceRoot":"","sources":["../../src/modules/tagInfo.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAmBjD,eAAO,MAAM,UAAU,+CAKpB,gBAAgB;;;;;;;;EAqClB,CAAC"}

58
node_modules/svelte-preprocess/dist/modules/tagInfo.js generated vendored Normal file
View File

@ -0,0 +1,58 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTagInfo = void 0;
/* eslint-disable node/prefer-promises/fs */
const fs_1 = require("fs");
const path_1 = require("path");
const language_1 = require("./language");
const utils_1 = require("./utils");
const resolveSrc = (importerFile, srcPath) => (0, path_1.resolve)((0, path_1.dirname)(importerFile), srcPath);
const getSrcContent = (file) => {
return new Promise((resolve, reject) => {
(0, fs_1.readFile)(file, (error, data) => {
// istanbul ignore if
if (error)
reject(error);
else
resolve(data.toString());
});
});
};
async function doesFileExist(file) {
return new Promise((resolve) => (0, fs_1.access)(file, 0, (err) => resolve(!err)));
}
const getTagInfo = async ({ attributes, filename, content, markup, }) => {
const dependencies = [];
// catches empty content and self-closing tags
const isEmptyContent = content == null || content.trim().length === 0;
/** only include src file if content of tag is empty */
if (attributes.src && isEmptyContent) {
// istanbul ignore if
if (typeof attributes.src !== 'string') {
throw new Error('src attribute must be string');
}
let path = attributes.src;
/** Only try to get local files (path starts with ./ or ../) */
if ((0, utils_1.isValidLocalPath)(path) && filename) {
path = resolveSrc(filename, path);
if (await doesFileExist(path)) {
content = await getSrcContent(path);
dependencies.push(path);
}
else {
console.warn(`[svelte-preprocess] The file "${path}" was not found.`);
}
}
}
const { lang, alias } = (0, language_1.getLanguage)(attributes);
return {
filename,
attributes,
content,
lang,
alias,
dependencies,
markup,
};
};
exports.getTagInfo = getTagInfo;

View File

@ -0,0 +1 @@
{"version":3,"file":"tagInfo.js","sourceRoot":"","sources":["../../src/modules/tagInfo.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2BAAsC;AACtC,+BAAwC;AAExC,yCAAyC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AAG,UAAU,CAAC,GAAG,CAAC;QAE1B,+DAA+D;QAC/D,IAAI,IAAA,wBAAgB,EAAC,IAAI,CAAC,IAAI,QAAQ,EAAE;YACtC,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAClC,IAAI,MAAM,aAAa,CAAC,IAAI,CAAC,EAAE;gBAC7B,OAAO,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;gBACpC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACzB;iBAAM;gBACL,OAAO,CAAC,IAAI,CAAC,kCAAkC,IAAI,kBAAkB,CAAC,CAAC;aACxE;SACF;KACF;IAED,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAA,sBAAW,EAAC,UAAU,CAAC,CAAC;IAEhD,OAAO;QACL,QAAQ;QACR,UAAU;QACV,OAAO;QACP,IAAI;QACJ,KAAK;QACL,YAAY;QACZ,MAAM;KACP,CAAC;AACJ,CAAC,CAAC;AA1CW,QAAA,UAAU,cA0CrB"}

18
node_modules/svelte-preprocess/dist/modules/utils.d.ts generated vendored Normal file
View File

@ -0,0 +1,18 @@
export declare function concat(...arrs: any[]): any[];
/** Paths used by preprocessors to resolve @imports */
export declare function getIncludePaths(fromFilename?: string, base?: string[]): string[];
/**
* Checks if a package is installed.
*
* @export
* @param {string} dep
* @returns boolean
*/
export declare function hasDepInstalled(dep: string): Promise<boolean>;
export declare function isValidLocalPath(path: string): boolean;
export declare function findUp({ what, from }: {
what: string;
from: string;
}): string | null;
export declare function setProp(obj: any, keyList: string[], value: any): void;
export declare const JAVASCRIPT_RESERVED_KEYWORD_SET: Set<string>;

View File

@ -0,0 +1 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/modules/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAM5C;AAED,sDAAsD;AACtD,wBAAgB,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,EAAO,YAMzE;AAID;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,oBAgBhD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,WAE5C;AAGD,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,iBAmBpE;AAGD,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,QAc9D;AAED,eAAO,MAAM,+BAA+B,aAiD1C,CAAC"}

154
node_modules/svelte-preprocess/dist/modules/utils.js generated vendored Normal file
View File

@ -0,0 +1,154 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.JAVASCRIPT_RESERVED_KEYWORD_SET = exports.setProp = exports.findUp = exports.isValidLocalPath = exports.hasDepInstalled = exports.getIncludePaths = exports.concat = void 0;
const fs_1 = require("fs");
const path_1 = require("path");
function concat(...arrs) {
return arrs.reduce((acc, a) => {
if (a)
return acc.concat(a);
return acc;
}, []);
}
exports.concat = concat;
/** Paths used by preprocessors to resolve @imports */
function getIncludePaths(fromFilename, base = []) {
if (fromFilename == null)
return [];
return [
...new Set([...base, 'node_modules', process.cwd(), (0, path_1.dirname)(fromFilename)]),
];
}
exports.getIncludePaths = getIncludePaths;
const depCheckCache = {};
/**
* Checks if a package is installed.
*
* @export
* @param {string} dep
* @returns boolean
*/
async function hasDepInstalled(dep) {
if (depCheckCache[dep] != null) {
return depCheckCache[dep];
}
let result = false;
try {
await Promise.resolve(`${dep}`).then(s => __importStar(require(s)));
result = true;
}
catch (e) {
result = false;
}
return (depCheckCache[dep] = result);
}
exports.hasDepInstalled = hasDepInstalled;
function isValidLocalPath(path) {
return path.startsWith('.');
}
exports.isValidLocalPath = isValidLocalPath;
// finds a existing path up the tree
function findUp({ what, from }) {
const { root, dir } = (0, path_1.parse)(from);
let cur = dir;
try {
while (cur !== root) {
const possiblePath = (0, path_1.join)(cur, what);
if ((0, fs_1.existsSync)(possiblePath)) {
return possiblePath;
}
cur = (0, path_1.dirname)(cur);
}
}
catch (e) {
console.error(e);
}
return null;
}
exports.findUp = findUp;
// set deep property in object
function setProp(obj, keyList, value) {
let i = 0;
for (; i < keyList.length - 1; i++) {
const key = keyList[i];
if (typeof obj[key] !== 'object') {
obj[key] = {};
}
obj = obj[key];
}
obj[keyList[i]] = value;
}
exports.setProp = setProp;
exports.JAVASCRIPT_RESERVED_KEYWORD_SET = new Set([
'arguments',
'await',
'break',
'case',
'catch',
'class',
'const',
'continue',
'debugger',
'default',
'delete',
'do',
'else',
'enum',
'eval',
'export',
'extends',
'false',
'finally',
'for',
'function',
'if',
'implements',
'import',
'in',
'instanceof',
'interface',
'let',
'new',
'null',
'package',
'private',
'protected',
'public',
'return',
'static',
'super',
'switch',
'this',
'throw',
'true',
'try',
'typeof',
'var',
'void',
'while',
'with',
'yield',
]);

View File

@ -0,0 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