Skip to content
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

[Focused Improvement] Consolidate packages #824

Merged
merged 32 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e26fab2
Add index to layout folder
CobyPear Sep 30, 2021
ae33d33
Consolidate modules
CobyPear Sep 30, 2021
91dc1c1
Move pipelines, manifest to dev-tools
CobyPear Oct 1, 2021
3f44886
replaced sitecore-jss-manifest with sitecore-jss-dev-tools in all sam…
addy-pathania Oct 1, 2021
1c4ee77
Remove some references to manifest package
CobyPear Oct 4, 2021
98c7f08
Update path in test
CobyPear Oct 4, 2021
445e71a
added tacking to the base package and replaced tracking with base pac…
addy-pathania Oct 6, 2021
421981a
added update package to dev tools
addy-pathania Oct 7, 2021
6fed8cc
added submodules to the base package
addy-pathania Oct 7, 2021
8f3a813
added submodules imports to nextjs base package index file
addy-pathania Oct 8, 2021
26448e8
added submodules to angular, vue, react base package index files
addy-pathania Oct 13, 2021
8fa1dc6
made changes asked in review comments
addy-pathania Oct 14, 2021
edf7b2b
resolved merge conflicts
addy-pathania Oct 14, 2021
ffdfda4
Merge remote-tracking branch 'origin/dev' into feature/479456
addy-pathania Oct 14, 2021
0934104
resolved merge conflicts
addy-pathania Oct 14, 2021
7adc339
updated changelog
addy-pathania Oct 14, 2021
e899f98
fixed nextjs sample build issue
addy-pathania Oct 14, 2021
da7325c
added comparison table doc
addy-pathania Oct 18, 2021
8c201cc
fixed CI failure issue
addy-pathania Oct 18, 2021
1514ba5
fixed CI failure issue for vue sample app
addy-pathania Oct 18, 2021
7baccf3
fixed failing test
addy-pathania Oct 18, 2021
9590b2d
resolved merge conflicts
addy-pathania Oct 19, 2021
083eb99
resolved merge conflicts
addy-pathania Oct 21, 2021
43a6297
added imports from submodules to all sample apps
addy-pathania Oct 22, 2021
0ce252c
added utils as submodule to base package
addy-pathania Oct 22, 2021
f5e5dda
added submodule import
addy-pathania Oct 22, 2021
1879f6a
updated upgrade-guide.md and added aliases
addy-pathania Oct 22, 2021
82de9ec
adde line endings, removed extra exports, added aliases for index file
addy-pathania Oct 25, 2021
428b78f
moved common shared files out of utils, updated upgrade-guide
addy-pathania Oct 25, 2021
8378495
removed comments, moved out shared files
addy-pathania Oct 25, 2021
e0bf24b
added editing back to utils, fixed failing tests
addy-pathania Oct 25, 2021
8129389
fixed failing test in vue base package
addy-pathania Oct 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This project does NOT adhere to [Semantic Versioning](https://semver.org/spec/v2

### New Features & Improvements

`[sitecore-jss-*]` Consolidated tightly coupled packages together and refactored the sitecore base package into submodules. ([#824](https://github.com/Sitecore/jss/pull/824))

`[samples/angular]` Language is now preserved when navigating to another page ([#793](https://github.com/Sitecore/jss/pull/793))

`[samples/nextjs][samples/react][samples/vue][samples/angular][sitecore-jss-cli]` Prefix added to templates which is replaced on jss create ([#800](https://github.com/Sitecore/jss/pull/800), [#811](https://github.com/Sitecore/jss/pull/811), [#813](https://github.com/Sitecore/jss/pull/813), [#814](https://github.com/Sitecore/jss/pull/814), [#816](https://github.com/Sitecore/jss/pull/816))
Expand Down
37 changes: 37 additions & 0 deletions docs/upgrade-guides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Refactoring JSS base packages

1. Create submodules in base package
2. Move all tightly couples packages together.
3. Remove circular Dependency.

## API changes in `sitecore-jss/*` packages

The JSS base packages have been refactored to make the API reference generation better. As a result, some reorganizing was done in the base packages, which causes breaking changes for how some services, classes and functions are exported.

If you are importing any of these into your project, the imports need to be updated per the table below.

|Package Name|Submodule Added | change description
addy-pathania marked this conversation as resolved.
Show resolved Hide resolved
|---|------|---
|**Sitecore-jss**||Broken into submodules so now all function, classes and interfaces within this package gets imported directly into all other packages and sample apps from individual submodules.|
||`graphql` | E.g. 'import { GraphQLClient } from @sitecore-jss/sitecore-jss/graphql'
||`i18` | E.g. 'import { RestDictionaryService } from @sitecore-jss/sitecore-jss/i18n'
|| `layout` | E.g. 'import { LayoutServiceData } from @sitecore-jss/sitecore-jss/layout'
||`media` | E.g. 'import { mediaApi } from @sitecore-jss/sitecore-jss/media'
||`utils` | E.g. 'import { isServer } from @sitecore-jss/sitecore-jss/utils'
||`tracking` | Moved as a submodule from being a separate package. E.g. 'import { trackingApi } from @sitecore-jss/sitecore-jss/tracking'
|**Sitecore-jss-angular**||*No Change*
|**Sitecore-jss-angular-schematics**||*No Change*
|**Sitecore-jss-cli**||*No Change*
|**Sitecore-jss-dev-tools**|| Now manifest, pipelines and update package are part of this package.|
|**Sitecore-jss-tracking**||Moved to Sitecore-jss
|**Sitecore-jss-manifest**||Moved to Sitecore-jss-dev-tools
|**Sitecore-jss-pipelines**||Moved to Sitecore-jss-dev-tools
|**Sitecore-jss-update**||Moved to Sitecore-jss-dev-tools
|**Sitecore-jss-forms**||*No Change*
|**Sitecore-jss-nextjs**||*No Change*
|**Sitecore-jss-proxy**||*No Change*
|**Sitecore-jss-react**||*No Change*
|**Sitecore-jss-react-forms**||*No Change*
|**Sitecore-jss-react-native**||*No Change*
|**Sitecore-jss-rendering-host**||*No Change*
|**Sitecore-jss-vue**||*No Change*
88 changes: 88 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"lint-packages": "lerna run lint --ignore *-sample*",
"lint-apps": "lerna run lint --ignore @sitecore-jss/*",
"coverage-packages": "lerna run coverage --ignore *-sample*",
"install-git-hooks": "node ./scripts/install-hooks.js"
"install-git-hooks": "node ./scripts/install-hooks.js",
"generate-docs": "lerna run generate-docs"
},
"author": {
"name": "Sitecore Corporation",
Expand All @@ -31,6 +32,9 @@
"lerna": "^3.22.0",
"nyc": "^14.1.1",
"prettier": "^1.14.3",
"typedoc": "^0.22.5",
"typedoc-plugin-markdown": "^3.11.3",
"typescript": "^3.9.6"
}
}
},
"dependencies": {}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CommonFieldTypes, SitecoreIcon, Manifest } from '@sitecore-jss/sitecore-jss-manifest';
import { CommonFieldTypes, SitecoreIcon, Manifest } from '@sitecore-jss/sitecore-jss-dev-tools';

/**
* Adds the <%= name %> component to the disconnected manifest.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TemplateRef,
ViewContainerRef,
} from '@angular/core';
import { mediaApi } from '@sitecore-jss/sitecore-jss';
import { mediaApi } from '@sitecore-jss/sitecore-jss/media';
import { ImageField, ImageFieldValue } from './rendering-field';

@Directive({ selector: '[scImage]' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Input } from '@angular/core';
import { ComponentRendering } from '@sitecore-jss/sitecore-jss';
import { ComponentRendering } from '@sitecore-jss/sitecore-jss/layout';

@Component({
selector: 'sc-missing-component',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Output,
} from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentRendering } from '@sitecore-jss/sitecore-jss';
import { ComponentRendering } from '@sitecore-jss/sitecore-jss/layout';
import { By } from '@angular/platform-browser';
import { SpyNgModuleFactoryLoader } from '@angular/router/testing';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
ViewChild,
ViewContainerRef,
} from '@angular/core';
import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss';
import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss/layout';
import { Observable } from 'rxjs';
import { takeWhile } from 'rxjs/operators';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, ElementRef, Input, OnInit, Renderer2 } from '@angular/core';
import { HtmlElementRendering } from '@sitecore-jss/sitecore-jss';
import { HtmlElementRendering } from '@sitecore-jss/sitecore-jss/layout';

@Component({
selector: 'sc-raw',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ViewChild,
ViewContainerRef,
} from '@angular/core';
import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss';
import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss/layout';
import { Observable } from 'rxjs';
import { takeWhile } from 'rxjs/operators';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss-angular/src/components/rendering.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss';
import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss/layout';

/**
* @param {HtmlElementRendering | ComponentRendering} rendering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Compiler,
NgModuleFactory,
} from '@angular/core';
import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss';
import { ComponentRendering, HtmlElementRendering } from '@sitecore-jss/sitecore-jss/layout';
import {
ComponentNameAndModule,
ComponentNameAndType,
Expand Down
30 changes: 18 additions & 12 deletions packages/sitecore-jss-angular/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@ export {
export { RichTextDirective } from './components/rich-text.directive';
export { TextDirective } from './components/text.directive';
export { JssModule } from './lib.module';
export { mediaApi } from '@sitecore-jss/sitecore-jss/media';
export { handleEditorAnchors } from './utils';
export {
mediaApi,
isEditorActive,
resetEditorChromes,
constants,
isExperienceEditorActive,
resetExperienceEditorChromes,
DictionaryService,
RestDictionaryService,
GraphQLDictionaryService,
RestLayoutService,
GraphQLLayoutService,
RestDictionaryService,
} from '@sitecore-jss/sitecore-jss/i18n';
export {
LayoutService,
LayoutServiceData,
LayoutServiceContextData,
PlaceholderData,
GraphQLLayoutService,
RestLayoutService,
PlaceholdersData,
RouteData,
Field,
HtmlElementRendering,
Expand All @@ -43,7 +40,16 @@ export {
ComponentRendering,
ComponentFields,
ComponentParams,
} from '@sitecore-jss/sitecore-jss/layout';
export {
constants,
HttpDataFetcher,
HttpResponse,
isServer,
HttpResponse
} from '@sitecore-jss/sitecore-jss';
export {
isServer,
isExperienceEditorActive,
resetExperienceEditorChromes,
isEditorActive,
resetEditorChromes, }
from '@sitecore-jss/sitecore-jss/utils'
2 changes: 1 addition & 1 deletion packages/sitecore-jss-angular/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExperienceEditor } from '@sitecore-jss/sitecore-jss';
import { ExperienceEditor } from '@sitecore-jss/sitecore-jss/utils';

/**
* @description in Experience Editor with an Angular sample app, anchor tags
Expand Down
3 changes: 1 addition & 2 deletions packages/sitecore-jss-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"url": "https://github.com/sitecore/jss/issues"
},
"dependencies": {
"@sitecore-jss/sitecore-jss-dev-tools": "^20.0.0-canary.34",
"@sitecore-jss/sitecore-jss-manifest": "^20.0.0-canary.34",
"@sitecore-jss/sitecore-jss-dev-tools": "^20.0.0-canary.23",
"axios": "^0.21.1",
"chalk": "^2.4.2",
"cross-spawn": "^7.0.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/sitecore-jss-cli/src/scripts/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { clean } from '@sitecore-jss/sitecore-jss-dev-tools';
import { generateToFile } from '@sitecore-jss/sitecore-jss-manifest';
import { clean, generateToFile } from '@sitecore-jss/sitecore-jss-dev-tools';
import chalk from 'chalk';
import { existsSync } from 'fs';
import path from 'path';
Expand Down
3 changes: 2 additions & 1 deletion packages/sitecore-jss-dev-tools/.nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"exclude": [
"**/*.d.ts",
"**/*.test.ts",
"src/testData",
"src/**/testData",
"src/pipelines/test",
"dist",
"types"
],
Expand Down
Loading