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

feat(outline-core-link): Updated tooling and build for component. #436

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

himerus
Copy link
Contributor

@himerus himerus commented Feb 26, 2024

Summary by CodeRabbit

  • New Features
    • Introduced a basic HTML page showcasing the outline-core-link component, enhancing user interaction by displaying a link to the Outline GitHub repository.
  • Refactor
    • Updated the OutlineCoreLink component to extend LitElement for improved performance and style handling.
  • Chores
    • Updated build tooling for the outline-core-link component and configured project-wide build settings to support ES module format and external dependencies like 'lit'.

Copy link

changeset-bot bot commented Feb 26, 2024

🦋 Changeset detected

Latest commit: e433ced

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@phase2/outline-core-link Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

coderabbitai bot commented Feb 26, 2024

Walkthrough

The recent update introduces a patch for the @phase2/outline-core-link component, enhancing its build tooling. It includes a new basic HTML page showcasing the outline-core-link custom element, which now extends LitElement for improved functionality and style management. Additionally, the update configures the build settings specifically for this component within a Vite project, alongside a broader Vite configuration tailored for building a library that efficiently handles external dependencies and global mappings for the 'lit' library.

Changes

File Path Change Summary
.changeset/kind-singers-tease.md Introduces a patch for build tooling update for @phase2/outline-core-link.
packages/components/outline-core-link/... Adds a basic HTML page (index.html) and refactors outline-core-link.ts to extend LitElement.
.../outline-core-link/vite.config.js Configures build settings for the component in a Vite project.
vite.config.js Sets up Vite configuration for building a library, specifying ES module output and handling 'lit'.

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@himerus himerus self-assigned this Feb 26, 2024
Copy link

netlify bot commented Feb 26, 2024

Deploy Preview for outlinejs failed.

Name Link
🔨 Latest commit e433ced
🔍 Latest deploy log https://app.netlify.com/sites/outlinejs/deploys/65dcbac769aa1a0008fd3958

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@phase2/[email protected] Transitive: environment +18 24.6 MB himerus
npm/@phase2/[email protected] None 0 12.5 kB himerus
npm/[email protected] eval Transitive: environment, filesystem +1 463 kB vitaly
npm/[email protected] None 0 235 kB jordanbtucker
npm/[email protected] filesystem, network Transitive: environment, eval +6 125 kB niftylettuce
npm/[email protected] environment, shell 0 9.84 kB mrexox
npm/[email protected] environment, filesystem Transitive: shell, unsafe +35 1.52 MB okonet
npm/[email protected] filesystem +1 1.05 MB runebm
npm/[email protected] None 0 1.81 MB lit-robot
npm/[email protected] Transitive: environment +6 4.6 MB lit-robot
npm/[email protected] None 0 1.41 MB bnjmnt4n
npm/[email protected] None +1 493 kB antfu
npm/[email protected] filesystem +1 78.4 kB sindresorhus
npm/[email protected] None +4 234 kB jonschlinkert
npm/[email protected] None 0 206 kB dougwilson
npm/[email protected] None +1 224 kB dougwilson
npm/[email protected] None +1 46 kB isaacs
npm/[email protected] None 0 8.53 kB vdemedes
npm/[email protected] None 0 54.5 kB ljharb
npm/[email protected] environment, filesystem 0 19.1 kB isaacs
npm/[email protected] None 0 9.22 kB jonschlinkert
npm/[email protected] environment Transitive: filesystem, shell +8 221 kB mysticatea
npm/[email protected] environment +1 12.7 kB sindresorhus
npm/[email protected] Transitive: eval +14 339 kB ljharb
npm/[email protected] Transitive: eval +50 3.12 MB ljharb
npm/[email protected] Transitive: eval +50 3.13 MB ljharb
npm/[email protected] unsafe 0 13.7 kB dougwilson
npm/[email protected] None 0 6.17 kB sindresorhus
npm/[email protected] environment, filesystem, shell 0 46.3 kB sindresorhus
npm/[email protected] None 0 7.39 kB sindresorhus
npm/[email protected] None 0 5.41 kB sindresorhus
npm/[email protected] None 0 10.3 kB dougwilson
npm/[email protected] None 0 4.55 kB sindresorhus
npm/[email protected] None 0 90 kB mrmlnc
npm/[email protected] unsafe 0 13.5 kB danez
npm/[email protected] Transitive: environment, filesystem +1 199 kB ludovicofischer
npm/[email protected] eval, unsafe Transitive: environment, filesystem +9 983 kB evilebottnawi
npm/[email protected] filesystem Transitive: environment +7 426 kB royston
npm/[email protected] filesystem Transitive: environment, shell +6 2.36 MB alaguna
npm/[email protected] environment, filesystem 0 186 kB ai
npm/[email protected] environment, eval, filesystem, unsafe +1 11.9 MB bradlc
npm/[email protected] environment, filesystem, unsafe 0 11.2 MB prettier-bot
npm/[email protected] None 0 15.5 kB turbopope
npm/[email protected] Transitive: eval +14 583 kB ljharb
npm/[email protected] environment +1 4.82 MB gnoff
npm/[email protected] Transitive: environment +3 3.11 MB simmerer
npm/[email protected] environment 0 316 kB gnoff
npm/[email protected] filesystem Transitive: environment, eval +25 1.73 MB eventualbuddha
npm/[email protected] Transitive: eval +14 306 kB ljharb
npm/[email protected] filesystem 0 6.62 kB stephenhandley
npm/[email protected] filesystem, unsafe 0 5.82 kB sindresorhus
npm/[email protected] None 0 4.34 kB sindresorhus
npm/[email protected] environment, filesystem +5 232 kB ljharb
npm/[email protected] filesystem +3 518 kB isaacs
npm/[email protected] environment, unsafe Transitive: filesystem +30 68.8 MB swatinem
npm/[email protected] None 0 0 B lukastaegert
npm/[email protected] environment, shell 0 79.5 kB mattijs
npm/[email protected] None 0 31.7 kB feross
npm/[email protected] None 0 68.3 kB lukekarrys
npm/[email protected] None 0 9.96 kB isaacs
npm/[email protected] None 0 17.2 kB matteo.collina
npm/[email protected] None 0 1.25 kB ndelangen, shilman, usulpro
npm/[email protected] None +1 9.19 kB sindresorhus
npm/[email protected] None 0 4.03 kB sindresorhus
npm/[email protected] None 0 6.96 kB sindresorhus
npm/[email protected] filesystem 0 975 kB trysound
npm/[email protected] environment, filesystem Transitive: unsafe +30 5.01 MB malfaitrobin
npm/[email protected] None 0 26.6 kB tamino-martinius
npm/[email protected] filesystem +2 1.14 MB runebm
npm/[email protected] None 0 2.26 kB orta
npm/[email protected] None 0 84 kB typescript-bot
npm/[email protected] None 0 30.6 kB turbobot
npm/[email protected] None +2 242 kB dougwilson
npm/[email protected] None 0 4.31 kB dougwilson
npm/[email protected] None 0 5.48 kB tootallnate
npm/[email protected] environment Transitive: eval +16 363 kB goto-bus-stop
npm/[email protected] None 0 8.75 kB dougwilson
npm/[email protected] environment, eval, filesystem, network, shell, unsafe +25 215 MB vitebot
npm/[email protected] Transitive: environment, filesystem, network, shell +44 263 MB antfu, patak, soda, ...2 more
npm/[email protected] Transitive: eval +14 306 kB ljharb
npm/[email protected] environment, filesystem +3 426 kB oss-bot

🚮 Removed packages: npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@csstools/[email protected], npm/@csstools/[email protected], npm/@nodelib/[email protected], npm/@types/[email protected], npm/@yarnpkg/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/[email protected]
  • Install script: postinstall
  • Source: node postinstall.js

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 06d1475 and e433ced.
Files ignored due to path filters (7)
  • package.json is excluded by: !**/*.json
  • packages/components/outline-core-link/package.json is excluded by: !**/*.json
  • packages/components/outline-core-link/tsconfig.build.json is excluded by: !**/*.json
  • packages/components/outline-core-link/yarn.lock is excluded by: !**/*.lock
  • tsconfig.build.json is excluded by: !**/*.json
  • tsconfig.json is excluded by: !**/*.json
  • yarn.lock is excluded by: !**/*.lock
Files selected for processing (5)
  • .changeset/kind-singers-tease.md (1 hunks)
  • packages/components/outline-core-link/index.html (1 hunks)
  • packages/components/outline-core-link/src/outline-core-link.ts (3 hunks)
  • packages/components/outline-core-link/vite.config.js (1 hunks)
  • vite.config.js (1 hunks)
Files skipped from review due to trivial changes (1)
  • .changeset/kind-singers-tease.md
Additional comments: 7
vite.config.js (1)
  • 1-17: The configuration correctly specifies the library format as ES modules and marks 'lit' as an external dependency. This setup is aligned with modern JavaScript practices and ensures compatibility with various module systems. No issues detected.
packages/components/outline-core-link/vite.config.js (1)
  • 1-17: The component-specific Vite configuration effectively reuses the base configuration and extends it with specific settings for the outline-core-link component. This approach promotes maintainability and ensures consistency across the project. No issues detected.
packages/components/outline-core-link/src/outline-core-link.ts (5)
  • 1-7: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-19]

The import statements and component documentation are correctly updated to reflect the component's new base class (LitElement) and its capabilities. The documentation provides clear information about the component's purpose, usage, and CSS properties.

  • 34-42: The introduction of AdoptedStylesheets for managing global and encapsulated styles is a good practice for maintaining style isolation and performance in web components. However, ensure that the AdoptedStylesheets controller is thoroughly tested, especially in browsers that do not natively support adopted stylesheets.
  • 42-42: The component's properties (linkHref, linkText, linkTarget, linkRel) are well-defined with appropriate types and reflectivity to attributes. This setup ensures that the component can be easily configured through HTML attributes.
  • 42-42: The createRenderRoot method correctly sets up adopted stylesheets for encapsulated styles. This approach is efficient for style encapsulation but ensure compatibility with all target browsers.
  • 42-42: The render method and helper functions (isURLExternal, linkRelRender, linkTargetRender, generateLink) are well-implemented, providing clear logic for rendering the component based on its properties. The use of ifDefined from lit/directives/if-defined.js for conditional attribute rendering is a best practice.

@himerus himerus merged commit 69bcf17 into next Feb 26, 2024
4 of 10 checks passed
@himerus himerus deleted the feature/vite-test branch February 26, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant