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

Ensure watcher snapshot is written to correct FS #15

Merged
merged 5 commits into from
Aug 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion packages/core/core/src/RequestTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ export default class RequestTracker {
let opts = getWatcherOptions(this.options);
let snapshotPath = path.join(this.options.cacheDir, snapshotKey + '.txt');

await this.options.inputFS.writeSnapshot(
await this.options.outputFS.writeSnapshot(
this.options.watchDir,
snapshotPath,
opts,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core/test/TargetRequest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ describe('TargetResolver', () => {
[
{
name: 'default',
distDir: '.atlaspack-cache/dist',
distDir: serveDistDir,
publicUrl: '/',
env: {
id: 'd6ea1d42532a7575',
Expand Down
3 changes: 1 addition & 2 deletions packages/core/core/test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type {Environment, AtlaspackOptions, Target} from '../src/types';
import {DEFAULT_FEATURE_FLAGS} from '@atlaspack/feature-flags';
import {FSCache} from '@atlaspack/cache';
import tempy from 'tempy';
import path from 'path';
import {inputFS, outputFS} from '@atlaspack/test-utils';
import {relativePath} from '@atlaspack/utils';
import {NodePackageManager} from '@atlaspack/package-manager';
Expand All @@ -17,7 +16,7 @@ export let cache: FSCache = new FSCache(outputFS, cacheDir);
cache.ensure();

export const DEFAULT_OPTIONS: AtlaspackOptions = {
cacheDir: path.join(__dirname, '.atlaspack-cache'),
cacheDir,
atlaspackVersion: '',
watchDir: __dirname,
watchIgnore: undefined,
Expand Down
13 changes: 11 additions & 2 deletions packages/core/integration-tests/test/atlaspack-query.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// @flow
import assert from 'assert';
import path from 'path';
import {bundle, describe, fsFixture, overlayFS} from '@atlaspack/test-utils';
import {
bundle,
describe,
fsFixture,
overlayFS,
inputFS,
} from '@atlaspack/test-utils';
import {loadGraphs} from '../../../dev/query/src';

describe.v2('atlaspack-query', () => {
it.skip('loadGraphs', async function () {
it('loadGraphs', async function () {
let entries = 'index.js';
let options = {
mode: 'production',
Expand All @@ -14,6 +20,9 @@ describe.v2('atlaspack-query', () => {
},
shouldDisableCache: false,
inputFS: overlayFS,
// We need to write to the default inputFS (NodeFS) as `loadGraphs` doesn't
// support custom FS's
outputFS: inputFS,
cacheDir: path.join(__dirname, '.atlaspack-cache'),
};

Expand Down
2 changes: 1 addition & 1 deletion packages/core/integration-tests/test/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -3532,7 +3532,7 @@ describe.v2('cache', function () {
assert(!res.includes('BAR'));
});

describe('pnp', function () {
describe.skip('pnp', function () {
it('should invalidate when the .pnp.js file changes', async function () {
let Module = require('module');
let origPnpVersion = process.versions.pnp;
Expand Down