@ctx-core/source-map 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,56 +1,57 @@
1
1
  {
2
- "name": "@ctx-core/source-map",
3
- "version": "0.1.1",
4
- "description": "Extensions to source-map...like sourcemap_writable_stream_",
5
- "type": "module",
6
- "keywords": [
7
- "ctx-core",
8
- "source-map"
9
- ],
10
- "homepage": "https://github.com/ctx-core/source-map#readme",
11
- "bugs": {
12
- "url": "https://github.com/ctx-core/source-map/issues"
13
- },
14
- "repository": {
15
- "type": "git",
16
- "url": "https://github.com/ctx-core/source-map.git"
17
- },
18
- "license": "Apache-2.0",
19
- "author": "Brian Takita",
20
- "files": [
21
- "*.d.ts",
22
- "*.js",
23
- "*.json",
24
- "sourcemap_writable_stream"
25
- ],
26
- "types": "./index.d.ts",
27
- "exports": {
28
- ".": "./index.js",
29
- "./package.json": "./package.json"
30
- },
31
- "dependencies": {
32
- "ctx-core": "^5.19.0",
33
- "source-map": "^0.7.4"
34
- },
35
- "devDependencies": {
36
- "c8": "^9.1.0",
37
- "check-dts": "^0.7.2",
38
- "tsx": "^4.7.0",
39
- "typescript": "next",
40
- "uvu": "^0.5.6"
41
- },
42
- "publishConfig": {
43
- "access": "public",
44
- "cache": "~/.npm"
45
- },
46
- "sideEffects": false,
47
- "scripts": {
48
- "build": ":",
49
- "clean": ":",
50
- "exec": "$@",
51
- "test": "pnpm test:unit && pnpm test:types",
52
- "test:types": "check-dts",
53
- "test:unit": "tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
54
- "test:unit:coverage": "c8 pnpm test:unit"
55
- }
56
- }
2
+ "name": "@ctx-core/source-map",
3
+ "version": "0.1.2",
4
+ "description": "Extensions to source-map...like sourcemap_writable_stream_",
5
+ "type": "module",
6
+ "keywords": [
7
+ "ctx-core",
8
+ "source-map"
9
+ ],
10
+ "homepage": "https://github.com/ctx-core/source-map#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/ctx-core/source-map/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/ctx-core/source-map.git"
17
+ },
18
+ "license": "Apache-2.0",
19
+ "author": "Brian Takita",
20
+ "files": [
21
+ "*.d.ts",
22
+ "*.js",
23
+ "*.json",
24
+ "sourcemap_writable_stream"
25
+ ],
26
+ "types": "./index.d.ts",
27
+ "exports": {
28
+ ".": "./index.js",
29
+ "./package.json": "./package.json"
30
+ },
31
+ "scripts": {
32
+ "build": ":",
33
+ "clean": ":",
34
+ "exec": "$@",
35
+ "prepublishOnly": "pnpm clean && pnpm build && pnpm test",
36
+ "test": "pnpm test:unit && pnpm test:types",
37
+ "test:types": "check-dts",
38
+ "test:unit": "tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
39
+ "test:unit:coverage": "c8 pnpm test:unit"
40
+ },
41
+ "dependencies": {
42
+ "ctx-core": "^5.19.0",
43
+ "source-map": "^0.7.4"
44
+ },
45
+ "devDependencies": {
46
+ "c8": "^9.1.0",
47
+ "check-dts": "^0.7.2",
48
+ "tsx": "^4.7.0",
49
+ "typescript": "next",
50
+ "uvu": "^0.5.6"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "cache": "~/.npm"
55
+ },
56
+ "sideEffects": false
57
+ }
@@ -18,7 +18,7 @@ export function sourcemap_writable_stream_(write_stream) {
18
18
  const match =
19
19
  stream_line.match(/^\s+at ([^(]+ )?\(?(.*):(.*):([^)]*)\)?/)
20
20
  if (!match) {
21
- write_stream.write(stream_line)
21
+ write_stream.write(stream_line + '\n')
22
22
  return
23
23
  }
24
24
  const [
@@ -29,7 +29,7 @@ export function sourcemap_writable_stream_(write_stream) {
29
29
  column_str
30
30
  ] = match
31
31
  if (!path || !await file_exists_(path + '.map')) {
32
- write_stream.write(stream_line)
32
+ write_stream.write(stream_line + '\n')
33
33
  return
34
34
  }
35
35
  const methodName = methodName_match ? methodName_match.trim() : ''
@@ -41,7 +41,7 @@ export function sourcemap_writable_stream_(write_stream) {
41
41
  JSON.parse(
42
42
  await readFile(path + '.map').then(buf=>'' + buf)))
43
43
  if (line == null || line < 1) {
44
- write_stream.write(' ' + (methodName || '[unknown]'))
44
+ write_stream.write(' ' + (methodName || '[unknown]') + '\n')
45
45
  } else {
46
46
  const pos =
47
47
  smc.originalPositionFor({ line, column })
@@ -49,12 +49,12 @@ export function sourcemap_writable_stream_(write_stream) {
49
49
  write_stream.write(
50
50
  ' at '
51
51
  + (pos.name || methodName || '[unknown]')
52
- + ' (' + pos.source + ':' + pos.line + ':' + pos.column + ')')
52
+ + ' (' + pos.source + ':' + pos.line + ':' + pos.column + ')\n')
53
53
  }
54
54
  }
55
55
  } catch (err) {
56
56
  console.error(err)
57
- write_stream.write(' at FAILED_TO_PARSE_LINE')
57
+ write_stream.write(' at FAILED_TO_PARSE_LINE\n')
58
58
  }
59
59
  }
60
60
  }))
@@ -39,7 +39,7 @@ error: test error
39
39
  .pipeThrough(new TextEncoderStream())
40
40
  .pipeTo(sourcemap_writable_stream_(write_stream))
41
41
  await sleep(100)
42
- equal(write_stream_out_a.join('\n'), `
42
+ equal(write_stream_out_a.join(''), `
43
43
  server__build|watch
44
44
  browser__build|watch
45
45
  server started on port 3000
@@ -54,6 +54,6 @@ http://localhost:3000/
54
54
  error: test error
55
55
  at [unknown] (../../src/app/index.server.ts:8:9)
56
56
  at processTicksAndRejections (:61:77)
57
- `.trim())
57
+ `.trim() + '\n')
58
58
  })
59
59
  test.run()