diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml new file mode 100644 index 00000000..3ffd0231 --- /dev/null +++ b/.github/workflows/publish-dev.yml @@ -0,0 +1,56 @@ +name: Publish package to GitHub Packages +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + publish: + # Forbid manual execution on non-main branches + if: github.ref_name == 'main' + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - + uses: actions/checkout@v4 + - + # Setup .npmrc file to publish to GitHub Packages + uses: actions/setup-node@v3 + with: + node-version: '20.x' + registry-url: 'https://npm.pkg.github.com' + # Defaults to the user or organization that owns the workflow file + scope: '@datalayer' + - + if: github.event_name == 'push' + # Bump the version + working-directory: packages/react + run: | + yarn install + npm version --preid dev --no-git-tag-version prerelease + + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git commit -a -m "Bump pre release version" + - + working-directory: packages/react + run: yarn npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - + if: github.event_name == 'push' + # Push version bump + run: | + git push + + # Keep only the 3 latest pre releases + - uses: actions/delete-package-versions@v4 + with: + package-name: '@datalayer/jupyter-react' + package-type: 'npm' + min-versions-to-keep: 3 + delete-only-pre-release-versions: "true" diff --git a/storybook/.storybook/main.ts b/storybook/.storybook/main.ts index 6d68d18c..5fbdec3a 100644 --- a/storybook/.storybook/main.ts +++ b/storybook/.storybook/main.ts @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import type { StorybookConfig } from "@storybook/react-vite"; const config: StorybookConfig = { diff --git a/storybook/.storybook/preview.ts b/storybook/.storybook/preview.ts index ff58bbda..58effbdf 100644 --- a/storybook/.storybook/preview.ts +++ b/storybook/.storybook/preview.ts @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import type { Preview } from "@storybook/react"; const preview: Preview = { diff --git a/storybook/Makefile b/storybook/Makefile index 68324e12..cc3e3315 100644 --- a/storybook/Makefile +++ b/storybook/Makefile @@ -1,3 +1,7 @@ +# Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. +# +# MIT License + # Copyright (c) Datalayer, Inc. https://datalayer.io # Distributed under the terms of the MIT License. diff --git a/storybook/index.html b/storybook/index.html index e4b78eae..6a54b131 100644 --- a/storybook/index.html +++ b/storybook/index.html @@ -1,3 +1,9 @@ + + diff --git a/storybook/src/App.css b/storybook/src/App.css index b9d355df..fbd49790 100644 --- a/storybook/src/App.css +++ b/storybook/src/App.css @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + #root { max-width: 1280px; margin: 0 auto; diff --git a/storybook/src/App.tsx b/storybook/src/App.tsx index afe48ac7..edcdfc82 100644 --- a/storybook/src/App.tsx +++ b/storybook/src/App.tsx @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import { useState } from 'react' import reactLogo from './assets/react.svg' import viteLogo from '/vite.svg' diff --git a/storybook/src/index.css b/storybook/src/index.css index 6119ad9a..26016ca2 100644 --- a/storybook/src/index.css +++ b/storybook/src/index.css @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + :root { font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; line-height: 1.5; diff --git a/storybook/src/main.tsx b/storybook/src/main.tsx index 3d7150da..be0d62b9 100644 --- a/storybook/src/main.tsx +++ b/storybook/src/main.tsx @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import React from 'react' import ReactDOM from 'react-dom/client' import App from './App.tsx' diff --git a/storybook/src/stories/Button.stories.ts b/storybook/src/stories/Button.stories.ts index 742c3aa7..68ae1c72 100644 --- a/storybook/src/stories/Button.stories.ts +++ b/storybook/src/stories/Button.stories.ts @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import type { Meta, StoryObj } from '@storybook/react'; import { Button } from './Button'; diff --git a/storybook/src/stories/Button.tsx b/storybook/src/stories/Button.tsx index 53d4ddb4..735ccdd4 100644 --- a/storybook/src/stories/Button.tsx +++ b/storybook/src/stories/Button.tsx @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import './button.css'; interface ButtonProps { diff --git a/storybook/src/stories/Configure.mdx b/storybook/src/stories/Configure.mdx index 51570900..13b30998 100644 --- a/storybook/src/stories/Configure.mdx +++ b/storybook/src/stories/Configure.mdx @@ -1,3 +1,9 @@ + + import { Meta } from "@storybook/blocks"; import Github from "./assets/github.svg"; diff --git a/storybook/src/stories/Header.stories.ts b/storybook/src/stories/Header.stories.ts index 61cf98aa..e18650e5 100644 --- a/storybook/src/stories/Header.stories.ts +++ b/storybook/src/stories/Header.stories.ts @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import type { Meta, StoryObj } from '@storybook/react'; import { Header } from './Header'; diff --git a/storybook/src/stories/Header.tsx b/storybook/src/stories/Header.tsx index a2b1d868..11521043 100644 --- a/storybook/src/stories/Header.tsx +++ b/storybook/src/stories/Header.tsx @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import { Button } from './Button'; import './header.css'; diff --git a/storybook/src/stories/Page.stories.ts b/storybook/src/stories/Page.stories.ts index f7a06817..50feed9e 100644 --- a/storybook/src/stories/Page.stories.ts +++ b/storybook/src/stories/Page.stories.ts @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import type { Meta, StoryObj } from '@storybook/react'; import { within, userEvent, expect } from '@storybook/test'; diff --git a/storybook/src/stories/Page.tsx b/storybook/src/stories/Page.tsx index e1174830..b1632ef7 100644 --- a/storybook/src/stories/Page.tsx +++ b/storybook/src/stories/Page.tsx @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import React from 'react'; import { Header } from './Header'; diff --git a/storybook/src/stories/button.css b/storybook/src/stories/button.css index dc91dc76..e5b9c9cc 100644 --- a/storybook/src/stories/button.css +++ b/storybook/src/stories/button.css @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + .storybook-button { font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 700; diff --git a/storybook/src/stories/header.css b/storybook/src/stories/header.css index d9a70528..5ff97fff 100644 --- a/storybook/src/stories/header.css +++ b/storybook/src/stories/header.css @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + .storybook-header { font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; border-bottom: 1px solid rgba(0, 0, 0, 0.1); diff --git a/storybook/src/stories/page.css b/storybook/src/stories/page.css index 098dad11..c719c44f 100644 --- a/storybook/src/stories/page.css +++ b/storybook/src/stories/page.css @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + .storybook-page { font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; diff --git a/storybook/src/vite-env.d.ts b/storybook/src/vite-env.d.ts index 11f02fe2..5223f1d1 100644 --- a/storybook/src/vite-env.d.ts +++ b/storybook/src/vite-env.d.ts @@ -1 +1,7 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + /// diff --git a/storybook/vite.config.ts b/storybook/vite.config.ts index 5a33944a..fbf8fa7c 100644 --- a/storybook/vite.config.ts +++ b/storybook/vite.config.ts @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2022-2023 Datalayer Inc. All rights reserved. + * + * MIT License + */ + import { defineConfig } from 'vite' import react from '@vitejs/plugin-react'