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

Experiment: @atlassian/atlaspack package unifying everything in one package #353

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alshdavid
Copy link
Contributor

@alshdavid alshdavid commented Feb 22, 2025

This is just a little weekend experiment. I created the @atlassian/atlaspack package which combines all of the packages in the repo and distributes them under a single package @atlassian/atlaspack.

One package to rule them all

Usage

import { Atlaspack } from '@atlassian/atlaspack'
import { Resolver } from '@atlassian/atlaspack/plugin'
import { FileSystem } from '@atlassian/atlaspack/fs'
import { Asset } from '@atlassian/atlaspack/types'

// Currently only @atlaspack/core is re-exported on the top level
// I could re-export other packages on the top level too as there are no collisions

import { Atlaspack, Resolver, FileSystem } from '@atlassian/atlaspack'

Try it out

npm install @alshdavid/atlaspack
npx atlaspack build

Motivation

  • I was curious to see if there was a better way of managing the upgrade path for consumers
  • Perhaps this could lead to a better approach to compiling Atlaspack
  • Distribute Atlaspack as a single file executable?

Changes

  • Added support to the PackageManager for resolving package.json#import statements docs
  • Added the @atlassian/atlaspack package
    • Includes core
    • Includes all configs/plugins/runtimes/bundlers/etc

Building

Requires Node 22+ to build and Node 14+ to run

yarn build-native-release
yarn build
yarn build-ts
yarn build-unified

Copy link

changeset-bot bot commented Feb 22, 2025

⚠️ No Changeset found

Latest commit: a20b213

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@alshdavid alshdavid changed the title Experiment: @atlassian/atlaspack package unifying project Experiment: @atlassian/atlaspack package unifying everything in one package Feb 22, 2025
@alshdavid alshdavid force-pushed the alsh/unified-package branch 5 times, most recently from fc69bfa to 6ad69bd Compare February 22, 2025 04:24
"bin": {
"atlaspack": "./cli/index.js"
},
"dependencies": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@atlaspack/core and related non-plugin packages have fairly few dependencies however the plugins have many.

I tried to bundle the plugins with rspack so they bring their dependencies with them. That worked well but simply copying them is more direct.

@alshdavid alshdavid force-pushed the alsh/unified-package branch 4 times, most recently from 565b630 to cbf9a12 Compare February 22, 2025 08:28
@alshdavid alshdavid force-pushed the alsh/unified-package branch from cbf9a12 to 45b8e49 Compare February 22, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant