React with Native

Bringing together React and React Native

GitHub

README

Rebuild operation

rebuild-operation (

OperationClassification

TODO: Ensure embedding this will embed the actual docs in my markdown renderer. I guess it might already do so!

TODO: It would be great to learn more about this topic and see if I can make more cross-environment packages. A great use case would be to create a wrapper around the current fs-orm to enable using it at the frontend too.

OperationClassification node-cjs)

Operation that makes it possible to rebuild an operation (re-index, re-build, etc.)

Api reference
rebuildOperation()

This function rebuilds an operation and re-indexes (part of) its files.

Input
config{ updatedAt?: number,
typerepoManualProjectRoot?: string,
operationManualProjectRoot?: string,
operationBasePath: string,
filePaths?: string[],
noUnresolvedRebuilding?: boolean,
force?: boolean,
debug?: boolean,
noExit?: boolean,
stack?: string[],
}
Output
📄 rebuildOperation (exported const)

This function rebuilds an operation and re-indexes (part of) its files.

yarnBuild()

Builds and minifies the src

Input
operationBasePathstring
Output
📄 yarnBuild (exported const)

Builds and minifies the src

clearTsDatabase()

Clears all typescript indexation models, and removes all indexation from the oprations

TODO: test first, not sure about the Operation one

Input
operationName (optional)string
Output
getAllDbModels()
Input
manualProjectRoot (optional)string
Output
📄 clearTsDatabase (exported const)

Clears all typescript indexation models, and removes all indexation from the oprations

TODO: test first, not sure about the Operation one

📄 getAllDbModels (exported const)
CLI
Show CLI information (8)
rebuildOperationCli()

rebuildOperation

This function rebuilds an operation and re-indexes (part of) its files.

rebuildOperation CLI syntax:

rebuildOperation [...operations]

Operations can be a list of differnt operation names you want to rebuild. It's also possible to specify a relative path instead of an operation name.

for example:

rebuildOperation ./packages/operation-x would rebuild operation-x in your packages folder

another handy one is rebuildOperation . because it will rebuild the operation in your current folder.

Input
-
Output
📄 cwdProjectRoot (unexported const)
📄 isRebuildingProcessUpdated (unexported const)
📄 [isUpdatedString] (unexported const)
📄 manualProjectRoot (unexported const)
📄 [operationName] (unexported const)
📄 rebuildOperationCli (unexported const)

rebuildOperation

This function rebuilds an operation and re-indexes (part of) its files.

rebuildOperation CLI syntax:

rebuildOperation [...operations]

Operations can be a list of differnt operation names you want to rebuild. It's also possible to specify a relative path instead of an operation name.

for example:

rebuildOperation ./packages/operation-x would rebuild operation-x in your packages folder

another handy one is rebuildOperation . because it will rebuild the operation in your current folder.

📄 thisProjectRoot (unexported const)
Tests
Show test information(2)
test()
Input
-
Output
📄 test (unexported const)
Internal
Show internal (20)
executeCommandQuietUnlessFail()

Executes a command without showing the result, unless the command fails, then it will log the output.,

Input
config{ command: string,
cwd?: string,
description?: string,
}
Output{ }
exitIfProcessDependenciesChanged()

exits the process if our own dependencies change

Input
operationNamestring
Output
generateJsonSchemas()

generates schemas for db models

Is done every time you run

rebuildOperation

This function rebuilds an operation and re-indexes (part of) its files.

rebuildOperation and generateSdkOperations

TODO: there are some problems with references that cannot be found with references to generic types... This can probably be solved, but it's not going to be easy!

IDEA:

  1. find all referencing definitions in the main schema
  2. find those in all other interfaces
  3. recursively find references in those as well
  4. if you can't find the reference, remove the reference and replace type to "any" (add WARNING to description "reference not found")

This will result in a valid schema that has no unresolved references

TODO: apply Storage to db-models

TODO: apply Array to db-models with json-multiple

TODO: apply special config conventions (MergedDbConfig) like tsconfig.json and package.json

TODO: Make a validator that validates the whole database to this schema.

Input
manualProjectRoot (optional)string
Output
getFileIds()

gets all identifiers of files, which are the relative path to a file without the extension

Input
{
operationFolderPath,
pathSuffix,
extension,
}{ operationFolderPath: string,
extension?: { },
pathSuffix: string,
}
Output
getIndexFileIds()

gets identifiers of ts and tsx files, which are the relative path to a file without the extension

Input
operationFolderPathstring
Output
getSrcIds()

gets identifiers of ts and tsx files, which are the relative path to a file without the extension

in order for them to be unique, we assume here that there's never a file with the ts extension when there's also a tsx file in the same folder with the same name. This would create duplicate ids.

Input
operationFolderPathstring
Output
isOperationBuildNeeded()

returns a boolean indicating whether or not the operation should be able to be built, based on the OperationClassification

Input
operationBasePathstring
Output
isSdkOperation()
Input
operationBasePathstring
Output{ }
rebuildAllOperations()

Rebuilds all operations that are needed to be rebuilt

Input
isRebuildingProcessUpdated (optional)booleanIf true, you are indicating that the rebuilding process has changed and all operations should be rebuilt after this date.
Output
shouldSkip()

if you don't force it, there's an operation index, there's an index folder, the src has not been touched since hte last indexation, and there's a buildfolder (if needed), then the rebuildOperation can be skipped

Input
config{ operationBasePath: string,
debug?: boolean,
force?: boolean,
operationManualProjectRoot?: string,
rebuildUpdatedAt?: number,
}
Output
📄 executeCommandQuietUnlessFail (exported const)

Executes a command without showing the result, unless the command fails, then it will log the output.,

📄 exitIfProcessDependenciesChanged (exported const)

exits the process if our own dependencies change

📄 generateJsonSchemas (exported const)

generates schemas for db models

Is done every time you run

rebuildOperation

This function rebuilds an operation and re-indexes (part of) its files.

rebuildOperation and generateSdkOperations

TODO: there are some problems with references that cannot be found with references to generic types... This can probably be solved, but it's not going to be easy!

IDEA:

  1. find all referencing definitions in the main schema
  2. find those in all other interfaces
  3. recursively find references in those as well
  4. if you can't find the reference, remove the reference and replace type to "any" (add WARNING to description "reference not found")

This will result in a valid schema that has no unresolved references

TODO: apply Storage to db-models

TODO: apply Array to db-models with json-multiple

TODO: apply special config conventions (MergedDbConfig) like tsconfig.json and package.json

TODO: Make a validator that validates the whole database to this schema.

📄 getFileIds (exported const)

gets all identifiers of files, which are the relative path to a file without the extension

📄 getIndexFileIds (exported const)

gets identifiers of ts and tsx files, which are the relative path to a file without the extension

📄 getSrcIds (exported const)

gets identifiers of ts and tsx files, which are the relative path to a file without the extension

in order for them to be unique, we assume here that there's never a file with the ts extension when there's also a tsx file in the same folder with the same name. This would create duplicate ids.

📄 isOperationBuildNeeded (exported const)

returns a boolean indicating whether or not the operation should be able to be built, based on the OperationClassification

📄 isSdkOperation (exported const)
📄 rebuildAllOperations (exported const)

Rebuilds all operations that are needed to be rebuilt

📄 shouldSkip (exported const)

if you don't force it, there's an operation index, there's an index folder, the src has not been touched since hte last indexation, and there's a buildfolder (if needed), then the rebuildOperation can be skipped