Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
feat: Feature/rename packages (#62)
Browse files Browse the repository at this point in the history
* Rename package

Signed-off-by: Hernand Azevedo <[email protected]>

* Merge remote-tracking branch 'origin/main' into feature/rename-packages

Signed-off-by: Hernand Azevedo <[email protected]>

* Rename package

Signed-off-by: Hernand Azevedo <[email protected]>

Signed-off-by: Hernand Azevedo <[email protected]>
  • Loading branch information
hernandazevedozup authored Nov 30, 2022
1 parent 62231af commit b64fbbe
Show file tree
Hide file tree
Showing 172 changed files with 654 additions and 654 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.zup.nimbus.core
package br.com.zup.nimbus.core

import com.zup.nimbus.core.dependency.CommonDependency
import com.zup.nimbus.core.tree.ServerDrivenAction
import com.zup.nimbus.core.tree.ServerDrivenEvent
import br.com.zup.nimbus.core.dependency.CommonDependency
import br.com.zup.nimbus.core.tree.ServerDrivenAction
import br.com.zup.nimbus.core.tree.ServerDrivenEvent

interface ActionEvent {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.zup.nimbus.core
package br.com.zup.nimbus.core

import com.zup.nimbus.core.expression.parser.ExpressionParser
import com.zup.nimbus.core.ui.UILibraryManager
import com.zup.nimbus.core.log.DefaultLogger
import com.zup.nimbus.core.network.DefaultHttpClient
import com.zup.nimbus.core.network.DefaultUrlBuilder
import com.zup.nimbus.core.network.DefaultViewClient
import com.zup.nimbus.core.scope.CommonScope
import com.zup.nimbus.core.tree.DefaultIdManager
import com.zup.nimbus.core.tree.dynamic.builder.EventBuilder
import com.zup.nimbus.core.tree.dynamic.builder.NodeBuilder
import com.zup.nimbus.core.ui.coreUILibrary
import br.com.zup.nimbus.core.expression.parser.ExpressionParser
import br.com.zup.nimbus.core.ui.UILibraryManager
import br.com.zup.nimbus.core.log.DefaultLogger
import br.com.zup.nimbus.core.network.DefaultHttpClient
import br.com.zup.nimbus.core.network.DefaultUrlBuilder
import br.com.zup.nimbus.core.network.DefaultViewClient
import br.com.zup.nimbus.core.scope.CommonScope
import br.com.zup.nimbus.core.tree.DefaultIdManager
import br.com.zup.nimbus.core.tree.dynamic.builder.EventBuilder
import br.com.zup.nimbus.core.tree.dynamic.builder.NodeBuilder
import br.com.zup.nimbus.core.ui.coreUILibrary

/**
* The root scope of a nimbus application. Contains important objects like the logger and the httpClient.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.zup.nimbus.core
package br.com.zup.nimbus.core

import com.zup.nimbus.core.ui.UILibrary
import com.zup.nimbus.core.log.Logger
import com.zup.nimbus.core.network.HttpClient
import com.zup.nimbus.core.network.UrlBuilder
import com.zup.nimbus.core.network.ViewClient
import com.zup.nimbus.core.tree.IdManager
import br.com.zup.nimbus.core.ui.UILibrary
import br.com.zup.nimbus.core.log.Logger
import br.com.zup.nimbus.core.network.HttpClient
import br.com.zup.nimbus.core.network.UrlBuilder
import br.com.zup.nimbus.core.network.ViewClient
import br.com.zup.nimbus.core.tree.IdManager

data class ServerDrivenConfig(
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.zup.nimbus.core
package br.com.zup.nimbus.core

import com.zup.nimbus.core.network.ViewRequest
import br.com.zup.nimbus.core.network.ViewRequest

interface ServerDrivenNavigator {
fun push(request: ViewRequest)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.zup.nimbus.core
package br.com.zup.nimbus.core

import com.zup.nimbus.core.dependency.CommonDependency
import com.zup.nimbus.core.dependency.DependencyUpdateManager
import com.zup.nimbus.core.dependency.UpdateError
import com.zup.nimbus.core.utils.deepCopyMutable
import com.zup.nimbus.core.utils.setMapValue
import com.zup.nimbus.core.utils.valueOfPath
import br.com.zup.nimbus.core.dependency.CommonDependency
import br.com.zup.nimbus.core.dependency.DependencyUpdateManager
import br.com.zup.nimbus.core.dependency.UpdateError
import br.com.zup.nimbus.core.utils.deepCopyMutable
import br.com.zup.nimbus.core.utils.setMapValue
import br.com.zup.nimbus.core.utils.valueOfPath

/**
* Represents a state in the scope hierarchy.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.zup.nimbus.core
package br.com.zup.nimbus.core

import com.zup.nimbus.core.scope.CommonScope
import br.com.zup.nimbus.core.scope.CommonScope

/**
* A scope for the current view in a navigator.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.dependency
package br.com.zup.nimbus.core.dependency


abstract class CommonDependency: Dependency {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.dependency
package br.com.zup.nimbus.core.dependency

/**
* Makes this a node in the dependency graph so it can be a dependency of another node.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.dependency
package br.com.zup.nimbus.core.dependency

/**
* Manages a dependency graph by updating the nodes that need to be updated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.dependency
package br.com.zup.nimbus.core.dependency

/**
* Makes this a node in the dependency graph so it can depend on another node.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.dependency
package br.com.zup.nimbus.core.dependency

class UpdateError(errors: List<Throwable>): Error() {
override val message = "There were errors while updating the dependency graph: " +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.zup.nimbus.core.deserialization
package br.com.zup.nimbus.core.deserialization

import com.zup.nimbus.core.tree.ServerDrivenEvent
import com.zup.nimbus.core.tree.dynamic.DynamicEvent
import com.zup.nimbus.core.utils.Null
import br.com.zup.nimbus.core.tree.ServerDrivenEvent
import br.com.zup.nimbus.core.tree.dynamic.DynamicEvent
import br.com.zup.nimbus.core.utils.Null

/**
* This class helps to deserialize data of unknown type. This is very useful for deserializing the data that comes from
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.deserialization
package br.com.zup.nimbus.core.deserialization

class SerializationError(propertyName: String, value: Any?): Error() {
override val message = "Can't serialize \"$propertyName\". Only the types String, Short, Int, Long, Float, Double, " +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.expression
package br.com.zup.nimbus.core.expression

/**
* The compiled version of an expression string, i.e., the Abstract Syntax Tree (AST).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.expression
package br.com.zup.nimbus.core.expression

class Literal(private val value: Any?): Expression {
override fun getValue(): Any? {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.zup.nimbus.core.expression
package br.com.zup.nimbus.core.expression

import com.zup.nimbus.core.Nimbus
import com.zup.nimbus.core.OperationHandler
import com.zup.nimbus.core.dependency.CommonDependency
import com.zup.nimbus.core.dependency.Dependent
import com.zup.nimbus.core.log.Logger
import com.zup.nimbus.core.scope.CloneAfterInitializationError
import com.zup.nimbus.core.scope.DoubleInitializationError
import com.zup.nimbus.core.scope.LazilyScoped
import com.zup.nimbus.core.scope.Scope
import com.zup.nimbus.core.scope.closestScopeWithType
import br.com.zup.nimbus.core.Nimbus
import br.com.zup.nimbus.core.OperationHandler
import br.com.zup.nimbus.core.dependency.CommonDependency
import br.com.zup.nimbus.core.dependency.Dependent
import br.com.zup.nimbus.core.log.Logger
import br.com.zup.nimbus.core.scope.CloneAfterInitializationError
import br.com.zup.nimbus.core.scope.DoubleInitializationError
import br.com.zup.nimbus.core.scope.LazilyScoped
import br.com.zup.nimbus.core.scope.Scope
import br.com.zup.nimbus.core.scope.closestScopeWithType

class Operation(
private val handler: OperationHandler,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.zup.nimbus.core.expression
package br.com.zup.nimbus.core.expression

import com.zup.nimbus.core.ServerDrivenState
import com.zup.nimbus.core.dependency.CommonDependency
import com.zup.nimbus.core.dependency.Dependent
import com.zup.nimbus.core.scope.CloneAfterInitializationError
import com.zup.nimbus.core.scope.DoubleInitializationError
import com.zup.nimbus.core.scope.LazilyScoped
import com.zup.nimbus.core.scope.Scope
import com.zup.nimbus.core.scope.closestState
import com.zup.nimbus.core.utils.valueOfPath
import br.com.zup.nimbus.core.ServerDrivenState
import br.com.zup.nimbus.core.dependency.CommonDependency
import br.com.zup.nimbus.core.dependency.Dependent
import br.com.zup.nimbus.core.scope.CloneAfterInitializationError
import br.com.zup.nimbus.core.scope.DoubleInitializationError
import br.com.zup.nimbus.core.scope.LazilyScoped
import br.com.zup.nimbus.core.scope.Scope
import br.com.zup.nimbus.core.scope.closestState
import br.com.zup.nimbus.core.utils.valueOfPath

class StateReference(
private var id: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.zup.nimbus.core.expression
package br.com.zup.nimbus.core.expression

import com.zup.nimbus.core.dependency.CommonDependency
import com.zup.nimbus.core.dependency.Dependent
import com.zup.nimbus.core.scope.CloneAfterInitializationError
import com.zup.nimbus.core.scope.DoubleInitializationError
import com.zup.nimbus.core.scope.LazilyScoped
import com.zup.nimbus.core.scope.Scope
import br.com.zup.nimbus.core.dependency.CommonDependency
import br.com.zup.nimbus.core.dependency.Dependent
import br.com.zup.nimbus.core.scope.CloneAfterInitializationError
import br.com.zup.nimbus.core.scope.DoubleInitializationError
import br.com.zup.nimbus.core.scope.LazilyScoped
import br.com.zup.nimbus.core.scope.Scope

class StringTemplate(
private val composition: List<Expression>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.zup.nimbus.core.expression.parser
package br.com.zup.nimbus.core.expression.parser

import com.zup.nimbus.core.Nimbus
import com.zup.nimbus.core.expression.Expression
import com.zup.nimbus.core.regex.toFastRegex
import br.com.zup.nimbus.core.Nimbus
import br.com.zup.nimbus.core.expression.Expression
import br.com.zup.nimbus.core.regex.toFastRegex

//Do not remove the Redundant character escape '\}' in RegExp, this causes error when using android regex implementation
private val expressionRegex = """(\\*)@\{(([^'}]|('([^'\\]|\\.)*'))*)\}""".toFastRegex()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.zup.nimbus.core.expression.parser
package br.com.zup.nimbus.core.expression.parser

import com.zup.nimbus.core.expression.Literal
import com.zup.nimbus.core.regex.matches
import com.zup.nimbus.core.regex.toFastRegex
import br.com.zup.nimbus.core.expression.Literal
import br.com.zup.nimbus.core.regex.matches
import br.com.zup.nimbus.core.regex.toFastRegex

private val literalRegex = """^\d+((.)|(.\d+)?)$""".toFastRegex()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.zup.nimbus.core.expression.parser
package br.com.zup.nimbus.core.expression.parser

import com.zup.nimbus.core.Nimbus
import com.zup.nimbus.core.expression.Expression
import com.zup.nimbus.core.expression.Literal
import com.zup.nimbus.core.expression.Operation
import com.zup.nimbus.core.regex.toFastRegex
import br.com.zup.nimbus.core.Nimbus
import br.com.zup.nimbus.core.expression.Expression
import br.com.zup.nimbus.core.expression.Literal
import br.com.zup.nimbus.core.expression.Operation
import br.com.zup.nimbus.core.regex.toFastRegex

private val operationRegex = """^(\w+)\((.*)\)$""".toFastRegex()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.zup.nimbus.core.expression.parser
package br.com.zup.nimbus.core.expression.parser

import com.zup.nimbus.core.Nimbus
import com.zup.nimbus.core.expression.Expression
import com.zup.nimbus.core.expression.Literal
import com.zup.nimbus.core.expression.StateReference
import com.zup.nimbus.core.regex.matches
import com.zup.nimbus.core.regex.toFastRegex
import com.zup.nimbus.core.scope.Scope
import com.zup.nimbus.core.scope.getPathToScope
import br.com.zup.nimbus.core.Nimbus
import br.com.zup.nimbus.core.expression.Expression
import br.com.zup.nimbus.core.expression.Literal
import br.com.zup.nimbus.core.expression.StateReference
import br.com.zup.nimbus.core.regex.matches
import br.com.zup.nimbus.core.regex.toFastRegex
import br.com.zup.nimbus.core.scope.Scope
import br.com.zup.nimbus.core.scope.getPathToScope

private val stateReferenceRegex = """^[\w\d_]+(\[\d+\])*(\.([\w\d_]+(\[\d+\])*))*$""".toFastRegex()
private val pathRegex = """^([^\.\[\]]+)\.?(.*)""".toFastRegex()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.zup.nimbus.core.expression.parser
package br.com.zup.nimbus.core.expression.parser

import com.zup.nimbus.core.Nimbus
import com.zup.nimbus.core.expression.Literal
import com.zup.nimbus.core.expression.StringTemplate
import com.zup.nimbus.core.regex.toFastRegex
import br.com.zup.nimbus.core.Nimbus
import br.com.zup.nimbus.core.expression.Literal
import br.com.zup.nimbus.core.expression.StringTemplate
import br.com.zup.nimbus.core.regex.toFastRegex

private val expressionRegex = """(\\*)@\{(([^'}]|('([^'\\]|\\.)*'))*)\}""".toFastRegex()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@file:Suppress("ComplexCondition") // todo: verify
package com.zup.nimbus.core.expression.parser
package br.com.zup.nimbus.core.expression.parser

import com.zup.nimbus.core.regex.FastRegex
import com.zup.nimbus.core.regex.toFastRegex
import br.com.zup.nimbus.core.regex.FastRegex
import br.com.zup.nimbus.core.regex.toFastRegex

private const val MAX_MEMOIZED_KEYS = 1000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.log
package br.com.zup.nimbus.core.log

class DefaultLogger: Logger {
private var isEnabled = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.log
package br.com.zup.nimbus.core.log

enum class LogLevel {
Info, Warning, Error,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.log
package br.com.zup.nimbus.core.log

interface Logger {
fun enable()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.zup.nimbus.core.network
package br.com.zup.nimbus.core.network

import com.zup.nimbus.core.utils.then
import br.com.zup.nimbus.core.utils.then
import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.engine.HttpClientEngine
Expand All @@ -13,7 +13,7 @@ import io.ktor.http.Headers
import io.ktor.http.HttpMethod
import kotlin.collections.set

class DefaultHttpClient (engine: HttpClientEngine? = null): com.zup.nimbus.core.network.HttpClient {
class DefaultHttpClient (engine: HttpClientEngine? = null): br.com.zup.nimbus.core.network.HttpClient {
constructor() : this(null)

private val client = if (engine == null) HttpClient() else HttpClient(engine)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.zup.nimbus.core.network
package br.com.zup.nimbus.core.network

import com.zup.nimbus.core.utils.removeSuffix
import br.com.zup.nimbus.core.utils.removeSuffix

class DefaultUrlBuilder(
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.zup.nimbus.core.network
package br.com.zup.nimbus.core.network

import com.zup.nimbus.core.Nimbus
import com.zup.nimbus.core.deserialization.AnyServerDrivenData
import com.zup.nimbus.core.tree.dynamic.node.RootNode
import br.com.zup.nimbus.core.Nimbus
import br.com.zup.nimbus.core.deserialization.AnyServerDrivenData
import br.com.zup.nimbus.core.tree.dynamic.node.RootNode
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.network
package br.com.zup.nimbus.core.network

const val FIRST_BAD_STATUS = 400

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zup.nimbus.core.network
package br.com.zup.nimbus.core.network

interface UrlBuilder {
/**
Expand Down
Loading

0 comments on commit b64fbbe

Please sign in to comment.