Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't publish *.coffee files to the npm registry.

Fixes #23
  • Loading branch information...
commit 627ed91049658e2f234839173806d008001e0a80 1 parent da17f5b
@pekim authored
Showing with 80 additions and 89 deletions.
  1. +1 −1  .gitignore
  2. +1 −1  .npmignore
  3. +0 −7 lib/library.coffee
  4. +3 −2 package.json
  5. +4 −0 scripts/build
  6. 0  {lib → src}/all-headers.coffee
  7. 0  {lib → src}/buffertools.coffee
  8. 0  {lib → src}/collation.coffee
  9. 0  {lib → src}/connection.coffee
  10. 0  {lib → src}/data-type.coffee
  11. 0  {lib → src}/debug.coffee
  12. 0  {lib → src}/instance-lookup.coffee
  13. +1 −0  src/library.coffee
  14. 0  {lib → src}/login7-payload.coffee
  15. 0  {lib → src}/message-io.coffee
  16. 0  {lib → src}/metadata-parser.coffee
  17. 0  {lib → src}/packet.coffee
  18. 0  {lib → src}/prelogin-payload.coffee
  19. 0  {lib → src}/request.coffee
  20. 0  {lib → src}/rpcrequest-payload.coffee
  21. 0  {lib → src}/special-stored-procedure.coffee
  22. 0  {lib → src}/sqlbatch-payload.coffee
  23. 0  {lib → src}/tds-versions.coffee
  24. +0 −2  lib/tedious.js → src/tedious.coffee
  25. 0  {lib → src}/token/colmetadata-token-parser.coffee
  26. 0  {lib → src}/token/done-token-parser.coffee
  27. +7 −4 {lib → src}/token/env-change-token-parser.coffee
  28. 0  {lib → src}/token/infoerror-token-parser.coffee
  29. 0  {lib → src}/token/loginack-token-parser.coffee
  30. 0  {lib → src}/token/order-token-parser.coffee
  31. 0  {lib → src}/token/returnstatus-token-parser.coffee
  32. 0  {lib → src}/token/returnvalue-token-parser.coffee
  33. 0  {lib → src}/token/row-token-parser.coffee
  34. 0  {lib → src}/token/token-stream-parser.coffee
  35. 0  {lib → src}/token/token.coffee
  36. 0  {lib → src}/tracking-buffer/bigint.coffee
  37. 0  {lib → src}/tracking-buffer/readable-tracking-buffer.coffee
  38. 0  {lib → src}/tracking-buffer/tracking-buffer.coffee
  39. 0  {lib → src}/tracking-buffer/writable-tracking-buffer.coffee
  40. 0  {lib → src}/value-parser.coffee
  41. +2 −2 test/integration/connection-test.coffee
  42. +2 −2 test/integration/datatypes-in-results-test.coffee
  43. +1 −1  test/integration/instance-lookup-test.coffee
  44. +3 −3 test/integration/parameterised-statements-test.coffee
  45. +3 −3 test/integration/rpc-test.coffee
  46. +3 −3 test/unit/all-headers-test.coffee
  47. +1 −1  test/unit/buffertools-test.coffee
  48. +1 −1  test/unit/debug-test.coffee
  49. +1 −1  test/unit/instance-lookup-test.coffee
  50. +0 −9 test/unit/library-test.coffee
  51. +2 −2 test/unit/login7-payload-test.coffee
  52. +4 −4 test/unit/message-io-test.coffee
  53. +4 −4 test/unit/packet-test.coffee
  54. +1 −1  test/unit/prelogin-payload-test.coffee
  55. +2 −2 test/unit/tedious-test.js
  56. +4 −4 test/unit/token/colmetadata-token-parser-test.coffee
  57. +3 −3 test/unit/token/done-token-parser-test.coffee
  58. +3 −3 test/unit/token/env-change-token-parser-test.coffee
  59. +3 −3 test/unit/token/infoerror-token-parser-test.coffee
  60. +3 −3 test/unit/token/loginack-token-parser-test.coffee
  61. +4 −4 test/unit/token/order-token-parser-test.coffee
  62. +4 −4 test/unit/token/row-token-parser-test.coffee
  63. +4 −4 test/unit/token/token-stream-parser-test.coffee
  64. +1 −1  test/unit/tracking-buffer/bigint-test.coffee
  65. +1 −1  test/unit/tracking-buffer/readable-tracking-buffer-test.coffee
  66. +2 −2 test/unit/tracking-buffer/tracking-buffer-test.coffee
  67. +1 −1  test/unit/tracking-buffer/writable-tracking-buffer-test.coffee
View
2  .gitignore
@@ -5,8 +5,8 @@ node_modules/*
todo
*sublime*
npm-debug.log
-coffee/*
README.html
generated
+lib/
test/unit/perf-buffer.coffee
View
2  .npmignore
@@ -1,4 +1,4 @@
-coffee/
+src/
todo
.git*
.project
View
7 lib/library.coffee
@@ -1,7 +0,0 @@
-fs = require('fs')
-path = require('path')
-
-exports.name = 'Tedious'
-
-packageJsonFile = path.dirname(module.filename) + '/../package.json'
-exports.version = JSON.parse(fs.readFileSync(packageJsonFile, 'utf8')).version
View
5 package.json
@@ -24,16 +24,17 @@
"node": "0.6 || 0.7"
},
"dependencies": {
- "coffee-script": "1.3.1",
"sprintf": "0.1.1"
},
"optionalDependencies": {
"iconv": "1.1.3"
},
"devDependencies": {
+ "coffee-script": "1.3.1",
"nodeunit": "0.7.4"
},
"scripts": {
"test": "scripts/tests-unit"
+ "prepublish": "scripts/build"
}
-}
+}
View
4 scripts/build
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+rm -fr lib/
+node_modules/.bin/coffee -b -c -o lib/ src/
View
0  lib/all-headers.coffee → src/all-headers.coffee
File renamed without changes
View
0  lib/buffertools.coffee → src/buffertools.coffee
File renamed without changes
View
0  lib/collation.coffee → src/collation.coffee
File renamed without changes
View
0  lib/connection.coffee → src/connection.coffee
File renamed without changes
View
0  lib/data-type.coffee → src/data-type.coffee
File renamed without changes
View
0  lib/debug.coffee → src/debug.coffee
File renamed without changes
View
0  lib/instance-lookup.coffee → src/instance-lookup.coffee
File renamed without changes
View
1  src/library.coffee
@@ -0,0 +1 @@
+exports.name = 'Tedious'
View
0  lib/login7-payload.coffee → src/login7-payload.coffee
File renamed without changes
View
0  lib/message-io.coffee → src/message-io.coffee
File renamed without changes
View
0  lib/metadata-parser.coffee → src/metadata-parser.coffee
File renamed without changes
View
0  lib/packet.coffee → src/packet.coffee
File renamed without changes
View
0  lib/prelogin-payload.coffee → src/prelogin-payload.coffee
File renamed without changes
View
0  lib/request.coffee → src/request.coffee
File renamed without changes
View
0  lib/rpcrequest-payload.coffee → src/rpcrequest-payload.coffee
File renamed without changes
View
0  lib/special-stored-procedure.coffee → src/special-stored-procedure.coffee
File renamed without changes
View
0  lib/sqlbatch-payload.coffee → src/sqlbatch-payload.coffee
File renamed without changes
View
0  lib/tds-versions.coffee → src/tds-versions.coffee
File renamed without changes
View
2  lib/tedious.js → src/tedious.coffee
@@ -1,5 +1,3 @@
-require('coffee-script')
-
exports.statemachineLogLevel = 0
exports.Connection = require('./connection')
View
0  lib/token/colmetadata-token-parser.coffee → src/token/colmetadata-token-parser.coffee
File renamed without changes
View
0  lib/token/done-token-parser.coffee → src/token/done-token-parser.coffee
File renamed without changes
View
11 lib/token/env-change-token-parser.coffee → src/token/env-change-token-parser.coffee
@@ -1,5 +1,7 @@
# s2.2.7.8
+EventEmitter = require('events').EventEmitter
+
types =
1:
name: 'DATABASE'
@@ -32,7 +34,7 @@ module.exports = (buffer) ->
if type
switch type.name
- when 'DATABASE', 'LANGUAGE', 'CHARSET'
+ when 'DATABASE', 'LANGUAGE', 'CHARSET', 'PACKET_SIZE'
newValue = buffer.readBVarchar()
oldValue = buffer.readBVarchar()
when 'SQL_COLLATION'
@@ -41,11 +43,12 @@ module.exports = (buffer) ->
valueLength = buffer.readUInt8()
oldValue = buffer.readBuffer(valueLength)
- when 'PACKET_SIZE'
- newValue = parseInt(buffer.readBVarchar())
- oldValue = parseInt(buffer.readBVarchar())
else
throw new Error("Unsupported ENVCHANGE type #{typeNumber} #{type.name} at offset #{buffer.position - 1}")
+
+ if type.name == 'PACKET_SIZE'
+ newValue = parseInt(newValue)
+ oldValue = parseInt(oldValue)
else
throw new Error("Unsupported ENVCHANGE type #{typeNumber} at offset #{buffer.position - 1}")
View
0  lib/token/infoerror-token-parser.coffee → src/token/infoerror-token-parser.coffee
File renamed without changes
View
0  lib/token/loginack-token-parser.coffee → src/token/loginack-token-parser.coffee
File renamed without changes
View
0  lib/token/order-token-parser.coffee → src/token/order-token-parser.coffee
File renamed without changes
View
0  lib/token/returnstatus-token-parser.coffee → src/token/returnstatus-token-parser.coffee
File renamed without changes
View
0  lib/token/returnvalue-token-parser.coffee → src/token/returnvalue-token-parser.coffee
File renamed without changes
View
0  lib/token/row-token-parser.coffee → src/token/row-token-parser.coffee
File renamed without changes
View
0  lib/token/token-stream-parser.coffee → src/token/token-stream-parser.coffee
File renamed without changes
View
0  lib/token/token.coffee → src/token/token.coffee
File renamed without changes
View
0  lib/tracking-buffer/bigint.coffee → src/tracking-buffer/bigint.coffee
File renamed without changes
View
0  ...ng-buffer/readable-tracking-buffer.coffee → ...ng-buffer/readable-tracking-buffer.coffee
File renamed without changes
View
0  lib/tracking-buffer/tracking-buffer.coffee → src/tracking-buffer/tracking-buffer.coffee
File renamed without changes
View
0  ...ng-buffer/writable-tracking-buffer.coffee → ...ng-buffer/writable-tracking-buffer.coffee
File renamed without changes
View
0  lib/value-parser.coffee → src/value-parser.coffee
File renamed without changes
View
4 test/integration/connection-test.coffee
@@ -1,5 +1,5 @@
-Connection = require('../../lib/connection')
-Request = require('../../lib/request')
+Connection = require('../../src/connection')
+Request = require('../../src/request')
fs = require('fs')
getConfig = ->
View
4 test/integration/datatypes-in-results-test.coffee
@@ -1,5 +1,5 @@
-Connection = require('../../lib/connection')
-Request = require('../../lib/request')
+Connection = require('../../src/connection')
+Request = require('../../src/request')
fs = require('fs')
debug = false
View
2  test/integration/instance-lookup-test.coffee
@@ -1,5 +1,5 @@
fs = require('fs')
-instanceLookup = require('../../lib/instance-lookup').instanceLookup
+instanceLookup = require('../../src/instance-lookup').instanceLookup
RESERVED_IP_ADDRESS = '192.0.2.0' # Can never be used, so guaranteed to fail.
View
6 test/integration/parameterised-statements-test.coffee
@@ -1,7 +1,7 @@
-Connection = require('../../lib/connection')
-Request = require('../../lib/request')
+Connection = require('../../src/connection')
+Request = require('../../src/request')
fs = require('fs')
-TYPES = require('../../lib/data-type').typeByName
+TYPES = require('../../src/data-type').typeByName
getConfig = ->
config = JSON.parse(fs.readFileSync(process.env.HOME + '/.tedious/test-connection.json', 'utf8')).config
View
6 test/integration/rpc-test.coffee
@@ -1,6 +1,6 @@
-Connection = require('../../lib/connection')
-Request = require('../../lib/request')
-TYPES = require('../../lib/data-type').typeByName
+Connection = require('../../src/connection')
+Request = require('../../src/request')
+TYPES = require('../../src/data-type').typeByName
fs = require('fs')
getConfig = ->
View
6 test/unit/all-headers-test.coffee
@@ -1,6 +1,6 @@
-WritableTrackingBuffer = require('../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
-require('../../lib/buffertools')
-writeAllHeaders = require('../../lib/all-headers').writeToTrackingBuffer
+WritableTrackingBuffer = require('../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+require('../../src/buffertools')
+writeAllHeaders = require('../../src/all-headers').writeToTrackingBuffer
exports.headers = (test) ->
expected = new Buffer([
View
2  test/unit/buffertools-test.coffee
@@ -1,4 +1,4 @@
-require('../../lib/buffertools')
+require('../../src/buffertools')
exports.concatOneArgument = (test) ->
buffer1 = new Buffer([1, 2])
View
2  test/unit/debug-test.coffee
@@ -1,4 +1,4 @@
-Debug = require('../../lib/debug')
+Debug = require('../../src/debug')
payload = 'payload'
View
2  test/unit/instance-lookup-test.coffee
@@ -1,4 +1,4 @@
-parse = require('../../lib/instance-lookup').parseBrowserResponse
+parse = require('../../src/instance-lookup').parseBrowserResponse
exports.oneInstanceFound = (test) ->
response = 'ServerName;WINDOWS2;InstanceName;SQLEXPRESS;IsClustered;No;Version;10.50.2500.0;tcp;1433;;'
View
9 test/unit/library-test.coffee
@@ -1,9 +0,0 @@
-library = require('../../lib/library')
-
-module.exports.name = (test) ->
- test.strictEqual(library.name, 'Tedious')
- test.done()
-
-module.exports.version = (test) ->
- test.ok(/\d+\.\d+\.\d+/.test(library.version))
- test.done()
View
4 test/unit/login7-payload-test.coffee
@@ -1,5 +1,5 @@
-require('../../lib/buffertools')
-Login7Payload = require('../../lib/login7-payload')
+require('../../src/buffertools')
+Login7Payload = require('../../src/login7-payload')
exports.create = (test) ->
loginData =
View
8 test/unit/message-io-test.coffee
@@ -1,8 +1,8 @@
-Debug = require('../../lib/debug')
+Debug = require('../../src/debug')
EventEmitter = require('events').EventEmitter
-MessageIO = require('../../lib/message-io')
-Packet = require('../../lib/packet').Packet
-require('../../lib/buffertools')
+MessageIO = require('../../src/message-io')
+Packet = require('../../src/packet').Packet
+require('../../src/buffertools')
class Connection extends EventEmitter
setTimeout: ->
View
8 test/unit/packet-test.coffee
@@ -1,8 +1,8 @@
-require('../../lib/buffertools')
+require('../../src/buffertools')
-Packet = require('../../lib/packet').Packet
-TYPE = require('../../lib/packet').TYPE
-isPacketComplete = require('../../lib/packet').isPacketComplete
+Packet = require('../../src/packet').Packet
+TYPE = require('../../src/packet').TYPE
+isPacketComplete = require('../../src/packet').isPacketComplete
exports.createEmpty = (test) ->
packet = new Packet(TYPE.PRELOGIN)
View
2  test/unit/prelogin-payload-test.coffee
@@ -1,4 +1,4 @@
-PreloginPayload = require('../../lib/prelogin-payload')
+PreloginPayload = require('../../src/prelogin-payload')
exports.createFromScratch = (test) ->
payload = new PreloginPayload()
View
4 test/unit/tedious-test.js
@@ -1,5 +1,5 @@
-TYPES = require('../../lib/tedious').TYPES
-Connection = require('../../lib/tedious').Connection
+TYPES = require('../../src/tedious').TYPES
+Connection = require('../../src/tedious').Connection
exports.types = function(test) {
test.ok(TYPES)
View
8 test/unit/token/colmetadata-token-parser-test.coffee
@@ -1,7 +1,7 @@
-parser = require('../../../lib/token/colmetadata-token-parser')
-dataTypeByName = require('../../../lib/data-type').typeByName
-ReadableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
-WritableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+parser = require('../../../src/token/colmetadata-token-parser')
+dataTypeByName = require('../../../src/data-type').typeByName
+ReadableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
+WritableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
module.exports.int = (test) ->
numberOfColumns = 1
View
6 test/unit/token/done-token-parser-test.coffee
@@ -1,6 +1,6 @@
-parser = require('../../../lib/token/done-token-parser').doneParser
-ReadableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
-WritableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+parser = require('../../../src/token/done-token-parser').doneParser
+ReadableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
+WritableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
parse = (status, curCmd, doneRowCount) ->
doneRowCountLow = doneRowCount % 0x100000000
View
6 test/unit/token/env-change-token-parser-test.coffee
@@ -1,6 +1,6 @@
-parser = require('../../../lib/token/env-change-token-parser')
-ReadableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
-WritableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+parser = require('../../../src/token/env-change-token-parser')
+ReadableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
+WritableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
module.exports.database = (test) ->
oldDb = 'old'
View
6 test/unit/token/infoerror-token-parser-test.coffee
@@ -1,6 +1,6 @@
-infoParser = require('../../../lib/token/infoerror-token-parser').infoParser
-ReadableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
-WritableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+infoParser = require('../../../src/token/infoerror-token-parser').infoParser
+ReadableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
+WritableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
module.exports.info = (test) ->
number = 3
View
6 test/unit/token/loginack-token-parser-test.coffee
@@ -1,6 +1,6 @@
-parser = require('../../../lib/token/loginack-token-parser')
-ReadableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
-WritableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+parser = require('../../../src/token/loginack-token-parser')
+ReadableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
+WritableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
module.exports.info = (test) ->
interfaceType = 1
View
8 test/unit/token/order-token-parser-test.coffee
@@ -1,7 +1,7 @@
-parser = require('../../../lib/token/order-token-parser')
-dataTypeByName = require('../../../lib/data-type').typeByName
-ReadableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
-WritableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+parser = require('../../../src/token/order-token-parser')
+dataTypeByName = require('../../../src/data-type').typeByName
+ReadableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
+WritableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
module.exports.oneColumn = (test) ->
numberOfColumns = 1
View
8 test/unit/token/row-token-parser-test.coffee
@@ -1,8 +1,8 @@
-parser = require('../../../lib/token/row-token-parser')
-dataTypeByName = require('../../../lib/data-type').typeByName
+parser = require('../../../src/token/row-token-parser')
+dataTypeByName = require('../../../src/data-type').typeByName
Iconv = require('iconv').Iconv
-ReadableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
-WritableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+ReadableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
+WritableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
module.exports.null = (test) ->
colMetaData = [type: dataTypeByName.Null]
View
8 test/unit/token/token-stream-parser-test.coffee
@@ -1,7 +1,7 @@
-Debug = require('../../../lib/debug')
-Parser = require('../../../lib/token/token-stream-parser').Parser
-TYPE = require('../../../lib/token/token').TYPE
-WritableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+Debug = require('../../../src/debug')
+Parser = require('../../../src/token/token-stream-parser').Parser
+TYPE = require('../../../src/token/token').TYPE
+WritableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
debug = new Debug({token: true})
View
2  test/unit/tracking-buffer/bigint-test.coffee
@@ -1,4 +1,4 @@
-convertLEBytesToString = require('../../../lib/tracking-buffer/bigint').convertLEBytesToString
+convertLEBytesToString = require('../../../src/tracking-buffer/bigint').convertLEBytesToString
module.exports.zero = (test) ->
test.strictEqual('0', convertLEBytesToString(new Buffer([0, 0, 0, 0, 0, 0, 0, 0])))
View
2  test/unit/tracking-buffer/readable-tracking-buffer-test.coffee
@@ -1,4 +1,4 @@
-TrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
+TrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
exports.createNoArgs = (test) ->
buffer = new TrackingBuffer()
View
4 test/unit/tracking-buffer/tracking-buffer-test.coffee
@@ -1,5 +1,5 @@
-ReadableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
-WritableTrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+ReadableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').ReadableTrackingBuffer
+WritableTrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
exports.readableTrackingBuffer = (test) ->
buffer = new ReadableTrackingBuffer()
View
2  test/unit/tracking-buffer/writable-tracking-buffer-test.coffee
@@ -1,4 +1,4 @@
-TrackingBuffer = require('../../../lib/tracking-buffer/tracking-buffer').WritableTrackingBuffer
+TrackingBuffer = require('../../../src/tracking-buffer/tracking-buffer').WritableTrackingBuffer
exports.create = (test) ->
buffer = new TrackingBuffer(2)
Please sign in to comment.
Something went wrong with that request. Please try again.