rename
This commit is contained in:
parent
5d459f40c8
commit
e2018dbbef
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "purescript-tower",
|
||||
"name": "purescript-axon",
|
||||
"private": true,
|
||||
"module": "index.js",
|
||||
"type": "module",
|
||||
|
14
rename.js
14
rename.js
@ -1,14 +0,0 @@
|
||||
import File from 'fs/promises'
|
||||
import Path from 'path'
|
||||
|
||||
const contents = new Map()
|
||||
|
||||
const files = (await File.readdir('./src', {recursive: true})).map(a => Path.resolve('./src', a)).filter(a => a.endsWith('.purs') || a.endsWith('.js'))
|
||||
for (const f of files) {
|
||||
const fc = await File.readFile(f, 'utf8')
|
||||
const fc_ = fc.replaceAll(/\bTower\b/g, 'Axon')
|
||||
await File.writeFile(f, fc_)
|
||||
const f_ = f.replace(/\bTower\b/, 'Axon')
|
||||
await File.rename(f, f_)
|
||||
console.log(`${f} -> ${f_}`)
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
package:
|
||||
name: tower
|
||||
name: axon
|
||||
dependencies:
|
||||
- aff
|
||||
- argonaut-codecs
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Tower.Request.Method where
|
||||
module Axon.Request.Method where
|
||||
|
||||
import Prelude
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Tower.Request.Parts.Body where
|
||||
module Axon.Request.Parts.Body where
|
||||
|
||||
import Prelude
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Tower.Request.Parts.Class (class RequestParts, extractRequestParts, module Parts.Method, module Parts.Body, module Path.Parts) where
|
||||
module Axon.Request.Parts.Class (class RequestParts, extractRequestParts, module Parts.Method, module Parts.Body, module Path.Parts) where
|
||||
|
||||
import Prelude
|
||||
|
||||
@ -17,18 +17,18 @@ import Data.URL as URL
|
||||
import Effect.Aff (Aff)
|
||||
import Effect.Class (liftEffect)
|
||||
import Node.Buffer (Buffer)
|
||||
import Tower.Request (Request)
|
||||
import Tower.Request as Request
|
||||
import Tower.Request.Method (Method)
|
||||
import Tower.Request.Method as Method
|
||||
import Tower.Request.Parts.Body (Json(..), Stream(..))
|
||||
import Tower.Request.Parts.Body (Json(..), Stream(..)) as Parts.Body
|
||||
import Tower.Request.Parts.Method (Connect, Delete, Get, Options, Patch, Post, Put, Trace)
|
||||
import Tower.Request.Parts.Method (Get(..), Post(..), Put(..), Patch(..), Delete(..), Trace(..), Options(..), Connect(..)) as Parts.Method
|
||||
import Tower.Request.Parts.Path (Path(..)) as Path.Parts
|
||||
import Tower.Request.Parts.Path (class PathParts, Path(..), extractPathParts)
|
||||
import Tower.Response (Response)
|
||||
import Tower.Response as Response
|
||||
import Axon.Request (Request)
|
||||
import Axon.Request as Request
|
||||
import Axon.Request.Method (Method)
|
||||
import Axon.Request.Method as Method
|
||||
import Axon.Request.Parts.Body (Json(..), Stream(..))
|
||||
import Axon.Request.Parts.Body (Json(..), Stream(..)) as Parts.Body
|
||||
import Axon.Request.Parts.Method (Connect, Delete, Get, Options, Patch, Post, Put, Trace)
|
||||
import Axon.Request.Parts.Method (Get(..), Post(..), Put(..), Patch(..), Delete(..), Trace(..), Options(..), Connect(..)) as Parts.Method
|
||||
import Axon.Request.Parts.Path (Path(..)) as Path.Parts
|
||||
import Axon.Request.Parts.Path (class PathParts, Path(..), extractPathParts)
|
||||
import Axon.Response (Response)
|
||||
import Axon.Response as Response
|
||||
|
||||
extractMethod :: forall @t a. RequestParts a => Newtype t a => Method -> Request -> Aff (Either Response (Maybe t))
|
||||
extractMethod method r =
|
@ -1,4 +1,4 @@
|
||||
module Tower.Request.Parts.Method where
|
||||
module Axon.Request.Parts.Method where
|
||||
|
||||
import Prelude
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Tower.Request.Parts.Path where
|
||||
module Axon.Request.Parts.Path where
|
||||
|
||||
import Prelude
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Tower.Request (Request, BodyReadableError(..), BodyStringError(..), BodyJSONError(..), BodyBufferError(..), bodyReadable, bodyString, bodyJSON, bodyBuffer, headers, method, address, url, contentType, accept, contentLength, lookupHeader) where
|
||||
module Axon.Request (Request, BodyReadableError(..), BodyStringError(..), BodyJSONError(..), BodyBufferError(..), bodyReadable, bodyString, bodyJSON, bodyBuffer, headers, method, address, url, contentType, accept, contentLength, lookupHeader) where
|
||||
|
||||
import Prelude
|
||||
|
||||
@ -35,7 +35,7 @@ import Node.Encoding (Encoding(..))
|
||||
import Node.Net.Types (IPv4, IPv6, SocketAddress)
|
||||
import Node.Stream as Stream
|
||||
import Node.Stream.Aff as Stream.Aff
|
||||
import Tower.Request.Method (Method)
|
||||
import Axon.Request.Method (Method)
|
||||
|
||||
data BodyReadableError
|
||||
= BodyReadableErrorHasBeenConsumed
|
@ -1,4 +1,4 @@
|
||||
module Tower.Response.Body where
|
||||
module Axon.Response.Body where
|
||||
|
||||
import Prelude
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Tower.Response (Response, response, body, status, headers, withHeader, withBody, withStatus, fromStatus, ok, module Body) where
|
||||
module Axon.Response (Response, response, body, status, headers, withHeader, withBody, withStatus, fromStatus, ok, module Body) where
|
||||
|
||||
import Prelude
|
||||
|
||||
@ -7,8 +7,8 @@ import Data.Map (Map)
|
||||
import Data.Map as Map
|
||||
import Data.String.Lower (StringLower)
|
||||
import Data.String.Lower as String.Lower
|
||||
import Tower.Response.Body (Body(..))
|
||||
import Tower.Response.Body (Body(..), formBody) as Body
|
||||
import Axon.Response.Body (Body(..))
|
||||
import Axon.Response.Body (Body(..), formBody) as Body
|
||||
|
||||
data Response = Response {body :: Body, headers :: Map StringLower String, status :: Int}
|
||||
|
2
src/Axon.Service.Class.purs
Normal file
2
src/Axon.Service.Class.purs
Normal file
@ -0,0 +1,2 @@
|
||||
module Axon.Service.Class where
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Tower.Web.Headers where
|
||||
module Axon.Web.Headers where
|
||||
|
||||
import Data.Tuple.Nested (type (/\))
|
||||
import Effect (Effect)
|
@ -1,10 +1,10 @@
|
||||
module Tower.Web.Request where
|
||||
module Axon.Web.Request where
|
||||
|
||||
import Data.ArrayBuffer.Types (Uint8Array)
|
||||
import Data.Nullable (Nullable)
|
||||
import Effect (Effect)
|
||||
import Node.Stream as Stream
|
||||
import Tower.Request.Web (WebHeaders)
|
||||
import Axon.Request.Web (WebHeaders)
|
||||
import Web.Streams.ReadableStream (ReadableStream)
|
||||
|
||||
foreign import data WebRequest :: Type
|
1
src/Axon.Web.Response.purs
Normal file
1
src/Axon.Web.Response.purs
Normal file
@ -0,0 +1 @@
|
||||
module Axon.Web.Response where
|
@ -1,2 +0,0 @@
|
||||
module Tower.Service.Class where
|
||||
|
@ -1 +0,0 @@
|
||||
module Tower.Web.Response where
|
Loading…
Reference in New Issue
Block a user