Skip to content

Commit

Permalink
Merge branch 'main' into fix-snapshot-write
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcompiles authored Aug 20, 2024
2 parents d42616c + 0d6dfc8 commit 31f94b5
Show file tree
Hide file tree
Showing 36 changed files with 194 additions and 184 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ jobs:
- run: yarn --frozen-lockfile
- run: yarn build-native-release
- run: yarn test:unit
- name: Upload @atlaspack/rust artifacts on Linux with Node v20
if: ${{ runner.os == 'Linux' && matrix.node == 20 }}
uses: actions/upload-artifact@v3
with:
name: Rust Linux Binaries
path: |
packages/core/rust/index.d.ts
packages/core/rust/index.js
packages/core/rust/*.node

integration_tests:
name: Integration tests (${{ matrix.version == 'v3' && 'v3, ' || '' }}${{ matrix.os }}, Node ${{ matrix.node }})
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ jobs:
if: ${{ runner.os == 'macOS' && inputs.profile == 'canary' }}
run: dsymutil packages/*/*/*.node
- name: Upload debug symbols
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ inputs.profile == 'canary' }}
with:
name: debug-symbols-${{ matrix.name }}
path: packages/*/*/*.node.dSYM/Contents/Resources/DWARF/*.node
- name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034
run: strip -x packages/*/*/*.node # Must use -x on macOS. This produces larger results on linux.
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.name }}
path: packages/*/*/*.node
Expand All @@ -85,7 +85,7 @@ jobs:
container:
image: node:22.4-bullseye
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -102,19 +102,19 @@ jobs:
find packages -name "*.node" -type f -exec objcopy --strip-debug --strip-unneeded {} \;
find packages -name "*.node" -type f -exec objcopy --add-gnu-debuglink={}.debug {} \;
- name: Upload debug symbols
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ inputs.profile == 'canary' }}
with:
name: debug-symbols-linux-gnu-x64
path: packages/*/*/*.node.debug
- name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034
run: strip packages/*/*/*.node
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-linux-gnu-x64
path: packages/*/*/*.node
- name: debug
- name: Debug
run: ls -l packages/*/*/*.node
- name: Smoke test
run: node -e 'require("@atlaspack/rust")'
Expand Down Expand Up @@ -164,24 +164,24 @@ jobs:
find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --strip-debug --strip-unneeded {} \;
find packages -name "*.node" -type f -exec ${{ matrix.objcopy }} --add-gnu-debuglink={}.debug {} \;
- name: Upload debug symbols
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ inputs.profile == 'canary' }}
with:
name: debug-symbols-${{ matrix.target }}
path: packages/*/*/*.node.debug
- name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034
run: ${{ matrix.strip }} packages/*/*/*.node
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.target }}
path: packages/*/*/*.node
- name: debug
- name: Debug
run: ls -l packages/*/*/*.node
- name: Configure binfmt-support
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Smoke test
uses: addnab/docker-run-action@v1
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/devongovett/multiarch-node:node14-${{ matrix.arch }}-focal
options: -v ${{github.workspace}}:/work
Expand All @@ -202,7 +202,7 @@ jobs:
- name: Build native packages
run: yarn build-native-${{ inputs.profile }}
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Move bindings
Expand All @@ -215,14 +215,13 @@ jobs:
find artifacts -name "*.node" -path "**/DWARF/**" -exec cp {} debug-symbols/ \;
ls -l debug-symbols
- name: Upload combined debug symbols artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ inputs.profile == 'canary' }}
with:
name: debug-symbols
path: debug-symbols/**
- name: Debug
run: |
ls -l packages/*/*/*.node
run: ls -l packages/*/*/*.node
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.idea/
.nyc_output/
.atlaspack-cache/
.parcel-cache/
.vscode/*
!.vscode/extensions.json
coverage/
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ tmp
# Ignoring main README for now because generated Table of Contents adds a line that prettier removes
# in precommit hook, causing `yarn lint:readme` to fail
/README.md
/packages/core/atlaspack/README.md
/packages/core/cli/README.md
14 changes: 7 additions & 7 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ We are committed to making participation in this project a harassment-free exper

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
* Submitting contributions or comments that you know to violate the intellectual property or privacy rights of others
* Other unethical or unprofessional conduct
- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information, such as physical or electronic addresses, without explicit permission
- Submitting contributions or comments that you know to violate the intellectual property or privacy rights of others
- Other unethical or unprofessional conduct

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Thank you for considering a contribution to Atlaspack! Unfortunately pull reques

For pull requests, please:

* Add tests for new features and bug fixes
* Follow the existing style
* Separate unrelated changes into multiple pull requests
- Add tests for new features and bug fixes
- Follow the existing style
- Separate unrelated changes into multiple pull requests

See the existing issues for things to start contributing.

Expand All @@ -18,5 +18,5 @@ Atlassian requires contributors to sign a Contributor License Agreement, known a

Prior to accepting your contributions we ask that you please follow the appropriate link below to digitally sign the CLA. The Corporate CLA is for those who are contributing as a member of an organization and the individual CLA is for those contributing as an individual.

* [CLA for corporate contributors](https://opensource.atlassian.com/corporate)
* [CLA for individuals](https://opensource.atlassian.com/individual)
- [CLA for corporate contributors](https://opensource.atlassian.com/corporate)
- [CLA for individuals](https://opensource.atlassian.com/individual)
9 changes: 3 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion README.md
1 change: 0 additions & 1 deletion crates/atlaspack_filesystem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition = "2021"
description = "FileSystem wrapper trait for use in Atlaspack codebase."

[dependencies]
dashmap = "5.5.3"
mockall = "0.12.1"
xxhash-rust = { version = "0.8.2", features = ["xxh3"] }
anyhow = "1.0.86"
Expand Down
7 changes: 3 additions & 4 deletions crates/atlaspack_filesystem/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::collections::HashMap;
use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc;

use dashmap::DashMap;
use std::sync::{Arc, RwLock};

/// In-memory file-system for testing
pub mod in_memory_file_system;
Expand All @@ -18,7 +17,7 @@ pub mod os_file_system;
pub type FileSystemRef = Arc<dyn FileSystem + Send + Sync>;

pub type FileSystemRealPathCache =
DashMap<PathBuf, Option<PathBuf>, xxhash_rust::xxh3::Xxh3Builder>;
RwLock<HashMap<PathBuf, Option<PathBuf>, xxhash_rust::xxh3::Xxh3Builder>>;

/// Trait abstracting file-system operations
/// .
Expand Down
16 changes: 11 additions & 5 deletions crates/atlaspack_filesystem/src/os_file_system/canonicalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,27 @@ pub fn canonicalize(path: &Path, cache: &FileSystemRealPathCache) -> std::io::Re
ret.push(c);

// First, check the cache for the path up to this point.
let link = if let Some(cached) = cache.get(&ret) {
if let Some(link) = &*cached {
link.clone()
let read = cache.read().unwrap();
let cached = read.get(&ret).cloned();
drop(read);
let link = if let Some(cached) = cached {
if let Some(link) = cached {
link
} else {
continue;
}
} else {
let stat = std::fs::symlink_metadata(&ret)?;
if !stat.is_symlink() {
cache.insert(ret.clone(), None);
cache.write().unwrap().insert(ret.clone(), None);
continue;
}

let link = std::fs::read_link(&ret)?;
cache.insert(ret.clone(), Some(link.clone()));
cache
.write()
.unwrap()
.insert(ret.clone(), Some(link.clone()));
link
};

Expand Down
1 change: 0 additions & 1 deletion crates/node-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ atlaspack_plugin_transformer_js = { path = "../atlaspack_plugin_transformer_js"
atlaspack_napi_helpers = { path = "../atlaspack_napi_helpers" }

anyhow = "1.0.82"
dashmap = "5.4.0"
glob = "0.3.1"
log = "0.4.21"
mockall = "0.12.1"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Special thanks to [Devon](https://github.com/devongovett) for his invaluable con
## Installation

```sh
npm install --save-dev atlaspack
npm install --save-dev @atlaspack/cli
```

## Usage
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "atlaspack",
"name": "@atlaspack/cli",
"version": "2.12.0",
"description": "Blazing fast, zero configuration web application bundler",
"license": "MIT",
Expand All @@ -10,7 +10,9 @@
"type": "git",
"url": "https://github.com/atlassian-labs/atlaspack.git"
},
"bin": "bin/atlaspack.js",
"bin": {
"atlaspack": "bin/atlaspack.js"
},
"main": "lib/bin.js",
"source": "src/bin.js",
"scripts": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/core/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"test-ci": "yarn test --config .mocharc.ci.json --reporter mocha-multi-reporters --reporter-options configFile=./test/mochareporters.json"
},
"devDependencies": {
"@atlaspack/cli": "2.12.0",
"@babel/core": "^7.22.11",
"@babel/plugin-syntax-class-properties": "^7.12.13",
"@babel/plugin-syntax-export-default-from": "^7.22.5",
Expand Down Expand Up @@ -39,7 +40,6 @@
"lodash": "^4.17.15",
"ncp": "^2.0.0",
"nib": "^1.1.2",
"atlaspack": "2.12.0",
"postcss": "^8.4.5",
"postcss-custom-properties": "^12.1.2",
"postcss-import": "^14.0.2",
Expand Down
Loading

0 comments on commit 31f94b5

Please sign in to comment.