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

WIP: @atlaspack/cli exports #294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 0 additions & 1 deletion packages/core/cli/.npmignore

This file was deleted.

2 changes: 2 additions & 0 deletions packages/core/cli/bin/atlaspack-lib.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../lib/cli.js');
2 changes: 2 additions & 0 deletions packages/core/cli/bin/atlaspack-src.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('@atlaspack/babel-register');
require('../src/cli.js');
13 changes: 13 additions & 0 deletions packages/core/cli/bin/atlaspack.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node

/*
This will conditionally require the source or dist files
based on the condition supplied when initializing Atlaspack

# Will use dist
npx atlaspack build

# Will use sources
env NODE_OPTIONS="conditions=@atlaspack::sources" npx atlaspack build
*/
require("#bin")
2 changes: 0 additions & 2 deletions packages/core/cli/bin/atlaspack.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/core/cli/bin/dev-bin.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/cli/ensure-no-dev-lib.sh

This file was deleted.

12 changes: 9 additions & 3 deletions packages/core/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@
"url": "https://github.com/atlassian-labs/atlaspack.git"
},
"bin": {
"atlaspack": "bin/atlaspack.js"
"atlaspack": "./bin/atlaspack.cjs"
},
"main": "./bin/atlaspack-lib.cjs",
"source": "./bin/atlaspack-src.cjs",
"imports": {
"#bin": {
"@atlaspack::sources": "./bin/atlaspack-src.cjs",
"default": "./bin/atlaspack-lib.cjs"
}
},
"main": "lib/bin.js",
"source": "src/bin.js",
"scripts": {
"prepack": "./ensure-no-dev-lib.sh",
"dev:prepare": "rimraf ./lib/ && mkdir -p lib && cp ./bin/dev-bin.js ./lib/bin.js"
Expand Down
12 changes: 0 additions & 12 deletions packages/core/cli/src/bin.js

This file was deleted.

Loading