UNPKG

1.19 kBJavaScriptView Raw
1'use strict'
2
3module.exports = Object.freeze({
4 // global stuff
5 TEMP_FILE_NAME: /\/[^.~][^~/]+$/,
6 // cli messages TODO: add all the other messages here
7 NO_FILE_FOUND: 'Source path does not exist',
8 // modular output fragments
9 MODULAR_START_FRAG: `
10(function(tagger) {
11 if (typeof define === 'function' && define.amd) {
12 define(function(require, exports, module) { tagger(require('riot'), require, exports, module)})
13 } else if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
14 tagger(require('riot'), require, exports, module)
15 } else {
16 tagger(window.riot)
17 }
18})(function(riot, require, exports, module) {
19`,
20 MODULAR_END_FRAG: '});',
21 TAG_CREATED_CORRECTLY: function(path) {
22 return `${path} created correctly!`
23 },
24 PREPROCESSOR_NOT_REGISTERED: function(type, id) {
25 return `The "${id}" ${type} preprocessor was not found. Have you registered it?`
26 },
27 // default tag template
28 TAG_TEMPLATE: function(tagName) {
29 return `
30<${tagName}>
31 <p>Hi { message() }</p>
32 <script>
33 message() {
34 return 'there'
35 }
36 </script>
37
38 <style scoped>
39 :scope p {
40 color: #000;
41 }
42 </style>
43</${tagName}>
44`
45 }
46})