Skip to content

Commit

Permalink
ci: test npm publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Loxeris committed Jul 16, 2024
1 parent 5f678b9 commit 6431ea5
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 46 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ jobs:

build-deploy-library-package:
runs-on: ubuntu-latest
needs: release-please
if: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/diracx-web' && needs.release-please.outputs.release_created == 'true' }}
if: ${{ github.event_name == 'push' }}
permissions:
contents: read
packages: write
Expand All @@ -41,18 +40,16 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 'latest'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@diracgrid'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

# Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to GitHub here
- name: Publish to GitHub Packages
# need to publish all unpublished versions to NPM here
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx lerna publish from-package --no-push --no-private --yes

build-deploy-dev-image:
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

6 changes: 3 additions & 3 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"dev": "lerna run dev --parallel",
"test": "lerna run test",
"build": "lerna run build",
"build-lib": "lerna run build --scope @diracgrid/diracx-web-components",
"build-lib": "lerna run build --scope @dirac-grid/test-lib",
"lint": "lerna run lint",
"ts-lint": "lerna run ts-lint",
"pack": "npm pack -w @diracgrid/diracx-web-components"
"pack": "npm pack -w @dirac-grid/test-lib"
}
}
7 changes: 5 additions & 2 deletions packages/diracx-web-components/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "@diracgrid/diracx-web-components",
"version": "0.1.0-a1",
"name": "@dirac-grid/test-lib",
"version": "0.1.0-a1-test",
"repository": "https://github.com/DIRACGrid/diracx-web",
"description": "Useful components for diracx-web",
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsup --minify",
"dev": "tsup --watch",
Expand Down
4 changes: 2 additions & 2 deletions packages/diracx-web-extension-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ To add new apps to your extension, you can create new components in your extensi
It is then pretty easy to add them to DiracX Web by extending the `applicationList` from `diracx-web-components/components`, and passing the new list to the `ApplicationProvider` from `diracx-web-components/contexts`.

```tsx
import { ApplicationProvider } from "@diracgrid/diracx-web-components/contexts";
import { applicationList } from "@diracgrid/diracx-web-components/components";
import { ApplicationProvider } from "@dirac-grid/test-lib/contexts";
import { applicationList } from "@dirac-grid/test-lib/components";

const newApp = {
name: "New App",
Expand Down
2 changes: 1 addition & 1 deletion packages/diracx-web-extension-example/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/diracx-web-extension-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"postinstall": "node ./node_modules/@axa-fr/react-oidc/bin/copy-service-worker-files.mjs public"
},
"dependencies": {
"@diracgrid/diracx-web-components": "file:diracx-web-components-0.1.0.tgz",
"@dirac-grid/test-lib": "file:diracx-web-components-0.1.0.tgz",
"autoprefixer": "10.4.19",
"next": "14.2.3",
"react": "^18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ import * as React from "react";
import CssBaseline from "@mui/material/CssBaseline";
import { Box } from "@mui/material";
import { ThemeProvider as MUIThemeProvider } from "@mui/material/styles";
import {
OIDCSecure,
Dashboard,
} from "@diracgrid/diracx-web-components/components";
import { OIDCSecure, Dashboard } from "@dirac-grid/test-lib/components";
import {
ApplicationsProvider,
NavigationProvider,
} from "@diracgrid/diracx-web-components/contexts";
import { useMUITheme } from "@diracgrid/diracx-web-components/hooks";
} from "@dirac-grid/test-lib/contexts";
import { useMUITheme } from "@dirac-grid/test-lib/hooks";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { applicationList } from "@/example-extension/applicationList";
import { defaultSections } from "@/example-extension/defaultSections";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import React, { useEffect } from "react";
import { UserDashboard } from "@diracgrid/diracx-web-components/components";
import { ApplicationsContext } from "@diracgrid/diracx-web-components/contexts";
import { useSearchParamsUtils } from "@diracgrid/diracx-web-components/hooks";
import { UserDashboard } from "@dirac-grid/test-lib/components";
import { ApplicationsContext } from "@dirac-grid/test-lib/contexts";
import { useSearchParamsUtils } from "@dirac-grid/test-lib/hooks";
import { applicationList } from "@/example-extension/applicationList";

export default function Page() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import React from "react";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { NavigationProvider } from "@diracgrid/diracx-web-components/contexts";
import { NavigationProvider } from "@dirac-grid/test-lib/contexts";

export default function AuthLayout({
children,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { LoginForm } from "@diracgrid/diracx-web-components/components";
import { LoginForm } from "@dirac-grid/test-lib/components";

export default function Page() {
return <LoginForm />;
Expand Down
2 changes: 1 addition & 1 deletion packages/diracx-web-extension-example/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Inter } from "next/font/google";
import {
OIDCConfigurationProvider,
ThemeProvider,
} from "@diracgrid/diracx-web-components/contexts";
} from "@dirac-grid/test-lib/contexts";

const inter = Inter({ subsets: ["latin"] });

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { applicationList } from "@diracgrid/diracx-web-components/components";
import { ApplicationConfig } from "@diracgrid/diracx-web-components/types";
import { applicationList } from "@dirac-grid/test-lib/components";
import { ApplicationConfig } from "@dirac-grid/test-lib/types";
import { BugReport } from "@mui/icons-material";
import TestApp from "@/example-extension/components/applications/testApp";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import * as React from "react";
import { useOidcAccessToken } from "@axa-fr/react-oidc";
import { ApplicationHeader } from "@diracgrid/diracx-web-components/components";
import { useOIDCContext } from "@diracgrid/diracx-web-components/hooks";
import { ApplicationHeader } from "@dirac-grid/test-lib/components";
import { useOIDCContext } from "@dirac-grid/test-lib/hooks";
import { Box } from "@mui/material";

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/diracx-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@axa-fr/react-oidc": "^7.22.6",
"@diracgrid/diracx-web-components": "^0.1.0-a1",
"@dirac-grid/test-lib": "^0.1.0-a1",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/icons-material": "^5.15.18",
Expand Down
7 changes: 2 additions & 5 deletions packages/diracx-web/src/app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"use client";
import React from "react";
import { Box } from "@mui/material";
import { DiracXWebProviders } from "@diracgrid/diracx-web-components/contexts";
import {
OIDCSecure,
Dashboard,
} from "@diracgrid/diracx-web-components/components";
import { DiracXWebProviders } from "@dirac-grid/test-lib/contexts";
import { OIDCSecure, Dashboard } from "@dirac-grid/test-lib/components";
import { usePathname, useRouter, useSearchParams } from "next/navigation";

export default function DashboardLayout({
Expand Down
4 changes: 2 additions & 2 deletions packages/diracx-web/src/app/(dashboard)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useSearchParams } from "next/navigation";
import {
UserDashboard,
applicationList,
} from "@diracgrid/diracx-web-components/components";
import { ApplicationsContext } from "@diracgrid/diracx-web-components/contexts";
} from "@dirac-grid/test-lib/components";
import { ApplicationsContext } from "@dirac-grid/test-lib/contexts";

export default function Page() {
const searchParams = useSearchParams();
Expand Down
2 changes: 1 addition & 1 deletion packages/diracx-web/src/app/auth/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import React from "react";
import { DiracXWebProviders } from "@diracgrid/diracx-web-components/contexts";
import { DiracXWebProviders } from "@dirac-grid/test-lib/contexts";
import { usePathname, useRouter, useSearchParams } from "next/navigation";

export default function AuthLayout({
Expand Down
2 changes: 1 addition & 1 deletion packages/diracx-web/src/app/auth/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { LoginForm } from "@diracgrid/diracx-web-components/components";
import { LoginForm } from "@dirac-grid/test-lib/components";

export default function Page() {
return <LoginForm />;
Expand Down

0 comments on commit 6431ea5

Please sign in to comment.