terraform 1.25.2 → 1.26.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.
@@ -53,7 +53,7 @@ exports.compile = function(rootPath, filePath, options, callback){
53
53
  paths: dirs, // Specify search paths for @import directives
54
54
  filename: filePath, // Specify a filename, for better error messages
55
55
  compress: false, // Minify CSS output
56
- sourceMap: true
56
+ sourceMap: { disableSourcemapAnnotation: true } // return map separately, don't embed the /*# sourceMappingURL */ comment
57
57
  }, function(e, css){
58
58
  if (e) return callback(formatError(e))
59
59
  var map = css.map || ""
@@ -1,4 +1,5 @@
1
1
  var sass = require("sass")
2
+ var url = require("url")
2
3
  var TerraformError = require("../../error").TerraformError
3
4
  var path = require("path")
4
5
  var fs = require("fs")
@@ -6,7 +7,7 @@ var fs = require("fs")
6
7
  exports.compile = function(rootPath, filePath, options, callback){
7
8
 
8
9
  var srcFullPath = path.resolve(rootPath, filePath)
9
-
10
+
10
11
  try{
11
12
  var fileContents = fs.readFileSync(srcFullPath)
12
13
  }catch(e){
@@ -18,28 +19,25 @@ exports.compile = function(rootPath, filePath, options, callback){
18
19
  path.dirname(path.resolve(rootPath))
19
20
  ]
20
21
 
21
- sass.render({
22
- file: srcFullPath,
23
- includePaths: dirs,
24
- outputStyle: 'compressed',
25
- sourceMap: true,
26
- sourceMapEmbed: false,
27
- sourceMapContents: true,
28
- outFile: filePath,
29
- omitSourceMapUrl: true
30
- }, function (e, css) {
31
- if (e) {
32
- var error = new TerraformError ({
33
- source: "Sass",
34
- dest: "CSS",
35
- lineno: e.line || 99,
36
- name: "Sass Error",
37
- message: e.message,
38
- filename: e.file || filePath,
39
- stack: fileContents.toString()
40
- })
41
- return callback(error)
42
- }
43
- callback(null, css.css.toString(), css.map.toString())
44
- });
22
+ try{
23
+ var result = sass.compile(srcFullPath, {
24
+ loadPaths: dirs,
25
+ style: 'compressed',
26
+ sourceMap: true,
27
+ sourceMapIncludeSources: true
28
+ })
29
+ }catch(e){
30
+ var error = new TerraformError({
31
+ source: "Sass",
32
+ dest: "CSS",
33
+ lineno: (e.span && e.span.start ? e.span.start.line + 1 : null) || 99,
34
+ name: "Sass Error",
35
+ message: e.sassMessage || e.message,
36
+ filename: (e.span && e.span.url ? url.fileURLToPath(e.span.url) : null) || filePath,
37
+ stack: fileContents.toString()
38
+ })
39
+ return callback(error)
40
+ }
41
+
42
+ callback(null, result.css.toString(), JSON.stringify(result.sourceMap))
45
43
  }
@@ -1,4 +1,5 @@
1
- var scss = require("sass")
1
+ var sass = require("sass")
2
+ var url = require("url")
2
3
  var TerraformError = require("../../error").TerraformError
3
4
  var path = require("path")
4
5
  var fs = require("fs")
@@ -6,7 +7,7 @@ var fs = require("fs")
6
7
  exports.compile = function(rootPath, filePath, options, callback){
7
8
 
8
9
  var srcFullPath = path.resolve(rootPath, filePath)
9
-
10
+
10
11
  try{
11
12
  var fileContents = fs.readFileSync(srcFullPath)
12
13
  }catch(e){
@@ -18,28 +19,25 @@ exports.compile = function(rootPath, filePath, options, callback){
18
19
  path.dirname(path.resolve(rootPath))
19
20
  ]
20
21
 
21
- scss.render({
22
- file: srcFullPath,
23
- includePaths: dirs,
24
- outputStyle: 'compressed',
25
- sourceMap: true,
26
- sourceMapEmbed: false,
27
- sourceMapContents: true,
28
- outFile: filePath,
29
- omitSourceMapUrl: true
30
- }, function (e, css) {
31
- if (e) {
32
- var error = new TerraformError ({
33
- source: "Sass",
34
- dest: "CSS",
35
- lineno: e.line || 99,
36
- name: "Sass Error",
37
- message: e.message,
38
- filename: e.file || filePath,
39
- stack: fileContents.toString()
40
- })
41
- return callback(error)
42
- }
43
- callback(null, css.css.toString(), css.map.toString())
44
- });
22
+ try{
23
+ var result = sass.compile(srcFullPath, {
24
+ loadPaths: dirs,
25
+ style: 'compressed',
26
+ sourceMap: true,
27
+ sourceMapIncludeSources: true
28
+ })
29
+ }catch(e){
30
+ var error = new TerraformError({
31
+ source: "Sass",
32
+ dest: "CSS",
33
+ lineno: (e.span && e.span.start ? e.span.start.line + 1 : null) || 99,
34
+ name: "Sass Error",
35
+ message: e.sassMessage || e.message,
36
+ filename: (e.span && e.span.url ? url.fileURLToPath(e.span.url) : null) || filePath,
37
+ stack: fileContents.toString()
38
+ })
39
+ return callback(error)
40
+ }
41
+
42
+ callback(null, result.css.toString(), JSON.stringify(result.sourceMap))
45
43
  }
@@ -1,30 +1,24 @@
1
1
 
2
2
  var TerraformError = require("../../error").TerraformError
3
- var marked = require("marked").setOptions({
4
- langPrefix: 'language-',
5
- headerPrefix: '',
6
- gfm: true,
7
- tables: true,
8
- mangle: false,
9
- headerIds: false
10
- })
11
- var renderer = new marked.Renderer()
3
+ var marked = require("marked")
12
4
 
13
- // This overrides Marked’s default headings with IDs,
14
- // since this changed after v0.2.9
15
- // https://github.com/sintaxi/harp/issues/328
16
- renderer.heading = function(text, level){
17
- return '<h' + level + '>' + text + '</h' + level + '>'
18
- }
5
+ /**
6
+ * marked v18 defaults already produce the output this processor
7
+ * needs:
8
+ * - headings without ids (e.g. <h1>hello markdown</h1>)
9
+ * - code blocks with a <code class="language-xxx"> prefix
10
+ * - GFM + tables enabled
11
+ *
12
+ * so the old setOptions()/custom-renderer/langPrefix/headerIds
13
+ * configuration (removed from marked years ago) is no longer needed.
14
+ */
19
15
 
20
16
  module.exports = function(fileContents, options){
21
17
 
22
18
  return {
23
19
  compile: function(){
24
20
  return function (locals){
25
- return marked(fileContents.toString().replace(/^\uFEFF/, ''), {
26
- renderer: renderer
27
- })
21
+ return marked.parse(fileContents.toString().replace(/^\uFEFF/, ''))
28
22
  }
29
23
  },
30
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terraform",
3
- "version": "1.25.2",
3
+ "version": "1.26.1",
4
4
  "description": "pre-processor engine that powers the harp web server",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,14 +48,14 @@
48
48
  "ejs": "3.1.9",
49
49
  "esbuild": "0.28.1",
50
50
  "lru-cache": "10.0.0",
51
- "marked": "5.1.2",
52
- "sass": "1.64.1"
51
+ "marked": "18.0.5",
52
+ "sass": "1.101.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "coffeescript": "2.7.0",
56
- "less": "4.1.3",
57
- "mocha": "10.2.0",
58
- "should": "3.3.2",
59
- "stylus": "0.59.0"
56
+ "less": "4.6.7",
57
+ "mocha": "11.7.6",
58
+ "should": "13.2.3",
59
+ "stylus": "0.64.0"
60
60
  }
61
61
  }