-
Notifications
You must be signed in to change notification settings - Fork 1
Document the current implementation #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NicoVogel
wants to merge
7
commits into
develop
Choose a base branch
from
NicoVogel/issue45
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+58
−0
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0b30579
Document the current implementation
NicoVogel e3621b1
Add GitHub Action to push documentation to wiki
PKief d3e8fc4
Restrict workflow to branches
PKief bd94c62
Test rsync version of action
PKief 1a6fc48
Adjust path name
PKief 4883e8f
Restrict action to main and develop branches
PKief cd4a7c2
Change images based on review comments
PKief File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: Documentation | ||
|
|
||
| on: | ||
| # Trigger the workflow on push, | ||
| # but only for the main and develop branches | ||
| push: | ||
| branches: | ||
| - main | ||
| - develop | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - name: Upload Documentation to Wiki | ||
| uses: SwiftDocOrg/github-wiki-publish-action@rsync | ||
| with: | ||
| path: "doc/" | ||
| env: | ||
| GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # How the angular-component-extractor works | ||
|
|
||
| When the extension is triggered, then it first reads the currently selected content of the html file. | ||
| After ensuring that all requirements for a successful execution are met (see `Startup Requirements`), the following steps are processed: | ||
|
|
||
| 1. Extract interpolation | ||
| 2. Create one `update change` for each interpolation which adds a `@Input` to the new component ts | ||
| 3. Create one `replace change` for the new component html, which inserts the selection | ||
| 4. Provide the replacement for the selected html | ||
| 5. Apply changes | ||
|
|
||
|  | ||
|
|
||
| # Startup Requirements | ||
|
|
||
| - Angular Language Service is available | ||
| - The selected range has no errors (Diagnostic messages) | ||
|
|
||
| # Architecture goal | ||
|
|
||
| The goal of the application architecture is to be decoupled it from vscode whenever possible. | ||
| Hence, the `VSCodeAbstraction` namespace was created to decouple it via interfaces. | ||
| This approach allows us to test the code without actually starting vscode. | ||
| The actual logic is within the `src/angular` directory while the others contain either cross functional or vscode dependent code. | ||
|
|
||
| # Concept behind `Changes` | ||
|
|
||
| The idea behind `Changes` (`src/types/index.ts > Changes`) is to define what needs to be done in order to extract the component, but without actually doing it. | ||
| This enables us to test it freely without mocking anything, as we only need to provide the selection, directory and component name to get changes. | ||
|
|
||
| But there are changes which are dynamic. For example when extending the generated component ts with the `@Input` properties. Thats why there are two types of changes. | ||
|
|
||
| 1. update file changes | ||
| 2. replace file changes | ||
|
|
||
| As the names imply, one changes the content of a file, while the other replaces it. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.