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

USWDS-Compile - Bug: pnpm support #75

Closed
2 tasks done
danielnaab opened this issue Oct 18, 2023 · 1 comment · Fixed by #76
Closed
2 tasks done

USWDS-Compile - Bug: pnpm support #75

danielnaab opened this issue Oct 18, 2023 · 1 comment · Fixed by #76
Assignees
Labels
Type: Bug A problem in the code

Comments

@danielnaab
Copy link
Contributor

Describe the bug

Using gulp-compile within a pnpm workspace fails in the buildSass function. pnpm is a package manager that has a local package cache with a unique directory structure.

Steps to reproduce the bug

  1. Use gulpfile.js example from documentation
  2. pnpm gulp build

Expected Behavior

Same as via npx gulp build

Related code

The path resolved here does not exist:

const pkg = require(`../../${uswdsPath}/package.json`).version;

Screenshots

The corresponding exception is:

[14:05:47] 'buildSass' errored after 536 μs
[14:05:47] Error: Cannot find module '../../uswds/package.json'
Require stack:
- /Users/danielnaab/src/10x/atj-platform/node_modules/.pnpm/@[email protected][email protected]/node_modules/@uswds/compile/gulpfile.js
- /Users/danielnaab/src/10x/atj-platform/packages/design/gulpfile.js
- /Users/danielnaab/src/10x/atj-platform/node_modules/.pnpm/[email protected]/node_modules/gulp-cli/lib/shared/require-or-import.js
- /Users/danielnaab/src/10x/atj-platform/node_modules/.pnpm/[email protected]/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js
- /Users/danielnaab/src/10x/atj-platform/node_modules/.pnpm/[email protected]/node_modules/gulp-cli/index.js
- /Users/danielnaab/src/10x/atj-platform/node_modules/.pnpm/[email protected]/node_modules/gulp/bin/gulp.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at buildSass (/Users/danielnaab/src/10x/atj-platform/node_modules/.pnpm/@[email protected][email protected]/node_modules/@uswds/compile/gulpfile.js:159:15)
    at bound (node:domain:433:15)
    at runBound (node:domain:444:12)
    at asyncRunner (/Users/danielnaab/src/10x/atj-platform/node_modules/.pnpm/[email protected]/node_modules/async-done/index.js:55:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
[14:05:47] 'compile' errored after 2.47 ms
 ELIFECYCLE  Command failed with exit code 1.

System setup

  • USWDS Compile version: 1.0.0
  • USWDS version: 3.6.0
  • Device: m1 Macbook Pro
  • Operating system: macOS 13.5.2
  • Browser and version: n/a

Additional context

No response

Code of Conduct

@danielnaab danielnaab added Needs: Confirmation We need to confirm that this is an issue Type: Bug A problem in the code labels Oct 18, 2023
@github-actions github-actions bot added the Status: Triage We're triaging this issue and grooming if necessary label Oct 18, 2023
danielnaab added a commit to GSA-TTS/forms that referenced this issue Oct 18, 2023
NOTE: this uses a uswds-compile fork that fixes an issue with pnpm. see: uswds/uswds-compile#75
danielnaab added a commit to GSA-TTS/forms that referenced this issue Oct 18, 2023
NOTE: this uses a uswds-compile fork that fixes an issue with pnpm. see: uswds/uswds-compile#75
danielnaab added a commit to GSA-TTS/forms that referenced this issue Oct 19, 2023
* Add ADR for initial deployment choices.

* Add cloud.gov pages build (I don't expect it to work with pnpm)

* Try to install pnpm in the container

* Install dependencies with pnpm after the cloud.gov pages initialization

* Use "pnpm i" instead of "pnpm ci" (which isn't implemented in pnpm) in the Pages build.

* Tweak pnpm / Cloud.gov Pages hack

* Try wiping out the Cloud.gov dependencies before manually installing.

* Update Vite config to handle a BASEURL.

* Remove unused script

* Turn off Cloud.gov Pages build container caching.

* Add a footer and links to the Github repository

* Remove unused "infra" package reference.

* Initial cloud.gov docassemble configuration. NOTE: This is failing to deploy, because the available space in the 10x sandbox account doesn't accomodate docassemble.

* Initial attempt at docassemble docker configuration, to be pared down.

* Pare down docker config

* Fill in Docassemble client API and corresponding CLI commands.
TODO: Determine why populating a docassemble package from a git repository is not working.

* In Github action, update pnpm version to 8.

* Tweak tests to get passing

* Label docassemble tests as integration tests, so they don't get run by CI (yet).

* Add scaffold for Terraform CDK project.

* Add ADR for Terraform usage.

* Add initial docassemble deploy to AWS Lightsail.

* Put userData script in root namespace

* Use recommended medium-sized instance.

* Add recreate.sh to force-rebuild the docassemble instance.

* Remove currently unused deps to save build container space

* Hack in skip cli build step

* Add Turborepo for more managable builds.

* Add ADR for pnpm and Turborepo.

* Add Turborepo to Cloud.gov pages build.

* Add turbo to project dependencies

* Scaffold Astro "Spotlight" app.

* React components rendering.

* Add React components from prior site

* React and Astro components split up and functional

* Remove React starter frontend

* Remove unused route

* Cleanup env handling with Astro

* Add design package that compiles uswds via uswds-compile.
NOTE: this uses a uswds-compile fork that fixes an issue with pnpm. see: uswds/uswds-compile#75

* Design CSS and JS loading via base template, wrapped via @atj/design.

* Add ADR for Astro usage.

* Add ADR for CSS usage patterns.
@amyleadem amyleadem added this to the compile 1.2.0 milestone Nov 9, 2023
@amyleadem amyleadem removed the Status: Triage We're triaging this issue and grooming if necessary label Nov 9, 2023
@mejiaj
Copy link
Contributor

mejiaj commented Nov 13, 2023

I'm able to reproduce the error.

How I tested

  1. Install pnpm via brew install pnpm.
  2. Go to uswds/uswds-sandbox repo.
  3. Install dependencies with pnpm install
  4. Try a build task, like pnpm run uswds:buildSass
  5. Confirm error

System setup

  • USWDS Compile version: 1.0.0
  • USWDS version: 3.7.0
  • Device: M1 Macbook Pro
  • Operating system: macOS 14.1
  • pnpm version: 8.10.4

@mejiaj mejiaj removed the Needs: Confirmation We need to confirm that this is an issue label Nov 13, 2023
@mejiaj mejiaj moved this to Review in USWDS Core Project Data Nov 13, 2023
@github-project-automation github-project-automation bot moved this from Review to Done in USWDS Core Project Data Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug A problem in the code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants