Skip to content

Commit

Permalink
Merge branch 'master' into module-federation/disallow-remotes-with-dash
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored Oct 14, 2024
2 parents 5823e47 + c7d2745 commit 78a8128
Show file tree
Hide file tree
Showing 30 changed files with 637 additions and 308 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,35 @@ There are four different ways to authenticate with AWS. They will be attempted i

Both the `AWS_ACCESS_KEY_ID` and the `AWS_SECRET_ACCESS_KEY` environment variables are required to use the environment variable authentication method.

Here's an example of using OICD in GitHub Actions to set the environment variables in CI:

```yaml {% fileName=".github/workflows/ci.yml" %}
name: CI
...
permissions:
id-token: write
...

env:
NX_DB_CACHE: true

jobs:
main:
runs-on: ubuntu-latest
steps:
...

- name: 'Configure AWS Credentials'
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
role-to-assume: arn:aws:iam::123456789123:role/GhAIBucketUserRole
aws-region: us-east-1

...

- run: pnpm exec nx affected -t lint test build
```
#### INI Config Files
AWS can read your authentication credentials from [shared INI config files](https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html). The files are located at `~/.aws/credentials` and `~/.aws/config`. Both files are expected to be INI formatted with section names corresponding to profiles. Sections in the credentials file are treated as profile names, whereas profile sections in the config file must have the format of `[profile profile-name]`, except for the default profile. Profiles that appear in both files will not be merged, and the version that appears in the credentials file will be given precedence over the profile found in the config file.
Expand Down
2 changes: 2 additions & 0 deletions docs/generated/packages/js/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
"type": "string",
"enum": ["swc", "tsc", "rollup", "vite", "esbuild", "none"],
"default": "tsc",
"x-prompt": "Which bundler would you like to use to build the library? Choose 'none' to skip build setup.",
"x-priority": "important"
},
"linter": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,35 @@ There are four different ways to authenticate with AWS. They will be attempted i

Both the `AWS_ACCESS_KEY_ID` and the `AWS_SECRET_ACCESS_KEY` environment variables are required to use the environment variable authentication method.

Here's an example of using OICD in GitHub Actions to set the environment variables in CI:

```yaml {% fileName=".github/workflows/ci.yml" %}
name: CI
...
permissions:
id-token: write
...

env:
NX_DB_CACHE: true

jobs:
main:
runs-on: ubuntu-latest
steps:
...

- name: 'Configure AWS Credentials'
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
role-to-assume: arn:aws:iam::123456789123:role/GhAIBucketUserRole
aws-region: us-east-1

...

- run: pnpm exec nx affected -t lint test build
```
#### INI Config Files
AWS can read your authentication credentials from [shared INI config files](https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html). The files are located at `~/.aws/credentials` and `~/.aws/config`. Both files are expected to be INI formatted with section names corresponding to profiles. Sections in the credentials file are treated as profile names, whereas profile sections in the config file must have the format of `[profile profile-name]`, except for the default profile. Profiles that appear in both files will not be merged, and the version that appears in the credentials file will be given precedence over the profile found in the config file.
Expand Down
64 changes: 32 additions & 32 deletions docs/shared/reference/environment-variables.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions e2e/esbuild/src/esbuild.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe('EsBuild Plugin', () => {
private: true,
type: 'commonjs',
main: './index.cjs',
typings: './index.d.ts',
dependencies: {},
});

Expand Down
41 changes: 31 additions & 10 deletions nx-dev/ui-common/src/lib/live-stream-notifier.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
import { useState, useEffect, ReactElement } from 'react';
import { motion } from 'framer-motion';
import { MonorepoWorldIcon } from '@nx/nx-dev/ui-icons';
import { XMarkIcon, VideoCameraIcon } from '@heroicons/react/24/outline';
import { ButtonLink } from './button';
import {
PlayIcon,
XMarkIcon,
ChatBubbleLeftRightIcon,
} from '@heroicons/react/24/outline';

export function LiveStreamNotifier(): ReactElement {
export function LiveStreamNotifier(): ReactElement | null {
const [isVisible, setIsVisible] = useState<boolean>(true);

useEffect(() => {
Expand Down Expand Up @@ -57,33 +62,49 @@ export function LiveStreamNotifier(): ReactElement {
aria-hidden="true"
className="size-8 flex-shrink-0"
/>
<span>Monorepo World just ended!</span>
<span>Monorepo World live replays available!</span>
</motion.h3>
<motion.div key="live-event" className="mt-4 space-y-4">
<p className="mb-2 text-sm">
In case you missed Monorepo World, it is now available for replay.
Watch the replays of exciting talks on developer tooling and
monorepos! Catch all the insightful presentations from the event
on our YouTube channel.
</p>
<div className="flex flex-wrap items-center gap-1 sm:gap-4">
<a
title="Track 1 replay"
title="Watch track 1"
href="http://go.nx.dev/MWTrack1"
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center justify-center gap-2 rounded-lg bg-[#DDFB24] px-2 py-2 text-sm font-semibold text-black transition hover:bg-[#B2CF04] focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 active:text-black/70 md:px-4"
>
<VideoCameraIcon aria-hidden="true" className="size-5" />
<span>Track 1 replay</span>
<PlayIcon aria-hidden="true" className="size-4" />
<span>Track 1</span>
</a>
<a
href="http://go.nx.dev/MWTrack2"
target="_blank"
title="Track 2 replay"
title="Watch track 2"
rel="noopener noreferrer"
className="inline-flex items-center justify-center gap-2 rounded-lg bg-[#DDFB24] px-2 py-2 text-sm font-semibold text-black transition hover:bg-[#B2CF04] focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 active:text-black/70 md:px-4"
>
<VideoCameraIcon aria-hidden="true" className="size-5" />
<span>Track 2 replay</span>
<PlayIcon aria-hidden="true" className="size-4" />
<span>Track 2</span>
</a>
<ButtonLink
variant="secondary"
size="small"
href="https://discord.gg/7yFabzBP"
target="_blank"
title="Join the discussion on Discord"
rel="noopener noreferrer"
>
<ChatBubbleLeftRightIcon
aria-hidden="true"
className="size-4"
/>
<span>#monorepo-world</span>
</ButtonLink>
</div>
</motion.div>
</div>
Expand Down
14 changes: 13 additions & 1 deletion nx-dev/ui-home/src/lib/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { Theme, useTheme } from '@nx/nx-dev/ui-theme';
import { useState } from 'react';
import Link from 'next/link';
import { useIsomorphicLayoutEffect } from '@nx/nx-dev/ui-primitives';
import { MonorepoWorldIcon } from '@nx/nx-dev/ui-icons';
import {
MonorepoWorldIcon,
RustIcon,
TypeScriptIcon,
} from '@nx/nx-dev/ui-icons';
import { motion, MotionConfig } from 'framer-motion';

export function Hero(): JSX.Element {
Expand Down Expand Up @@ -80,6 +84,14 @@ export function Hero(): JSX.Element {
Contact us
</ButtonLink>
</div>

<div className="mt-4 flex items-center justify-center gap-2 text-sm italic">
Built with
<RustIcon aria-hidden="true" className="size-5 shrink-0" />
<span className="sr-only">Rust</span> for speed &
<TypeScriptIcon aria-hidden="true" className="size-4 shrink-0" />
<span className="sr-only">TypeScript</span> for extensibility.
</div>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"@jest/reporters": "^29.4.1",
"@jest/test-result": "^29.4.1",
"@jest/types": "^29.4.1",
"@module-federation/enhanced": "0.6.6",
"@module-federation/sdk": "0.6.6",
"@module-federation/enhanced": "0.6.9",
"@module-federation/sdk": "0.6.9",
"@monodon/rust": "2.0.0-beta.1",
"@napi-rs/cli": "3.0.0-alpha.56",
"@napi-rs/wasm-runtime": "0.2.4",
Expand Down
4 changes: 4 additions & 0 deletions packages/angular/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,10 @@
"ng-packagr": {
"version": "~18.2.0",
"alwaysAddToPackageJson": false
},
"zone.js": {
"version": "~0.14.10",
"alwaysAddToPackageJson": false
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"tslib": "^2.3.0",
"webpack-merge": "^5.8.0",
"webpack": "^5.88.0",
"@module-federation/enhanced": "0.6.6",
"@module-federation/enhanced": "0.6.9",
"@nx/devkit": "file:../devkit",
"@nx/js": "file:../js",
"@nx/eslint": "file:../eslint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { UsersFacade } from './+state/users.facade';
imports: [
BrowserModule,
RouterModule.forRoot(appRoutes),
EffectsModule.forRoot([]),
StoreModule.forRoot(
{},
{
Expand All @@ -29,7 +30,6 @@ import { UsersFacade } from './+state/users.facade';
},
}
),
EffectsModule.forRoot([]),
StoreRouterConnectingModule.forRoot(),
StoreModule.forFeature(fromUsers.USERS_FEATURE_KEY, fromUsers.usersReducer),
EffectsModule.forFeature([UsersEffects]),
Expand Down Expand Up @@ -90,6 +90,7 @@ import { UsersEffects } from './+state/users.effects';
imports: [
BrowserModule,
RouterModule.forRoot(appRoutes),
EffectsModule.forRoot([]),
StoreModule.forRoot(
{},
{
Expand All @@ -100,7 +101,6 @@ import { UsersEffects } from './+state/users.effects';
},
}
),
EffectsModule.forRoot([]),
StoreRouterConnectingModule.forRoot(),
StoreModule.forFeature(fromUsers.USERS_FEATURE_KEY, fromUsers.usersReducer),
EffectsModule.forFeature([UsersEffects]),
Expand Down Expand Up @@ -373,14 +373,14 @@ import { StoreRouterConnectingModule } from '@ngrx/router-store';
imports: [
BrowserModule,
RouterModule.forRoot(appRoutes),
EffectsModule.forRoot([]),
StoreModule.forRoot({}, {
metaReducers: [],
runtimeChecks: {
strictActionImmutability: true,
strictStateImmutability: true
}
}),
EffectsModule.forRoot([]),
StoreRouterConnectingModule.forRoot(),
],
providers: [],
Expand All @@ -399,24 +399,24 @@ import { appRoutes } from './app.routes';
import { NxWelcomeComponent } from './nx-welcome.component';
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { StoreRouterConnectingModule } from '@ngrx/router-store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { StoreRouterConnectingModule } from '@ngrx/router-store';
@NgModule({
declarations: [AppComponent, NxWelcomeComponent],
imports: [
BrowserModule,
RouterModule.forRoot(appRoutes),
EffectsModule.forRoot([]),
StoreDevtoolsModule.instrument({ logOnly: !isDevMode() }),
StoreModule.forRoot({}, {
metaReducers: [],
runtimeChecks: {
strictActionImmutability: true,
strictStateImmutability: true
}
}),
EffectsModule.forRoot([]),
StoreRouterConnectingModule.forRoot(),
StoreDevtoolsModule.instrument({ logOnly: !isDevMode() }),
],
providers: [],
bootstrap: [AppComponent],
Expand All @@ -436,7 +436,7 @@ import { UsersEffects } from './+state/users.effects';
import { UsersFacade } from './+state/users.facade';
export const appConfig: ApplicationConfig = {
providers: [provideEffects(UsersEffects),provideState(fromUsers.USERS_FEATURE_KEY, fromUsers.usersReducer),UsersFacade,provideEffects(),provideStore(),provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(appRoutes) ]
providers: [provideEffects(UsersEffects),provideState(fromUsers.USERS_FEATURE_KEY, fromUsers.usersReducer),UsersFacade,provideStore(),provideEffects(),provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(appRoutes) ]
};
"
`;
Expand Down Expand Up @@ -482,7 +482,7 @@ import * as fromUsers from './+state/users.reducer';
import { UsersEffects } from './+state/users.effects';
export const appConfig: ApplicationConfig = {
providers: [provideEffects(UsersEffects),provideState(fromUsers.USERS_FEATURE_KEY, fromUsers.usersReducer),provideEffects(),provideStore(),provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(appRoutes) ]
providers: [provideEffects(UsersEffects),provideState(fromUsers.USERS_FEATURE_KEY, fromUsers.usersReducer),provideStore(),provideEffects(),provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(appRoutes) ]
};
"
`;
Expand Down Expand Up @@ -729,7 +729,7 @@ import { provideStore } from '@ngrx/store';
import { provideEffects } from '@ngrx/effects';
export const appConfig: ApplicationConfig = {
providers: [provideEffects(),provideStore(),provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(appRoutes) ]
providers: [provideStore(),provideEffects(),provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(appRoutes) ]
};
"
`;
Expand All @@ -743,7 +743,7 @@ import { provideEffects } from '@ngrx/effects';
import { provideStoreDevtools } from '@ngrx/store-devtools';
export const appConfig: ApplicationConfig = {
providers: [provideStoreDevtools({ logOnly: !isDevMode() }),provideEffects(),provideStore(),provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(appRoutes) ]
providers: [provideStore(),provideStoreDevtools({ logOnly: !isDevMode() }),provideEffects(),provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(appRoutes) ]
};
"
`;
32 changes: 16 additions & 16 deletions packages/angular/src/generators/ngrx-root-store/lib/add-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,22 +181,32 @@ export function addImportsToModule(
sourceFile = addImport(sourceFile, 'EffectsModule', '@ngrx/effects');
}

sourceFile = addRootStoreImport(
sourceFile = addRootEffectsImport(
tree,
isParentStandalone,
sourceFile,
parentPath,
provideRootStore,
storeForRoot
provideRootEffects,
effectsForEmptyRoot
);

sourceFile = addRootEffectsImport(
if (options.addDevTools) {
sourceFile = addStoreDevTools(
tree,
sourceFile,
parentPath,
isParentStandalone,
addImport
);
}

sourceFile = addRootStoreImport(
tree,
isParentStandalone,
sourceFile,
parentPath,
provideRootEffects,
effectsForEmptyRoot
provideRootStore,
storeForRoot
);

// this is just a heuristic
Expand All @@ -211,14 +221,4 @@ export function addImportsToModule(
storeRouterModule
);
}

if (options.addDevTools) {
sourceFile = addStoreDevTools(
tree,
sourceFile,
parentPath,
isParentStandalone,
addImport
);
}
}
Loading

0 comments on commit 78a8128

Please sign in to comment.