From 86ac4211bf59d3c0e46226b93497bf8ddc259799 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Mon, 19 Aug 2024 11:49:23 +1000 Subject: [PATCH] Rename to atlaspack (#4) --- .eslintrc.json | 2 +- .flowconfig | 2 +- .gitignore | 3 +- .mocharc.json | 5 +- .prettierignore | 6 +- .vscode/launch.json | 6 +- Cargo.lock | 622 +++++++++--------- babel.config.json | 2 +- crates/atlaspack/Cargo.toml | 36 + .../parcel.rs => atlaspack/src/atlaspack.rs} | 54 +- crates/atlaspack/src/lib.rs | 13 + crates/{parcel => atlaspack}/src/plugins.rs | 20 +- .../src/plugins/config_plugins.rs | 78 +-- .../{parcel => atlaspack}/src/project_root.rs | 8 +- .../src/request_tracker/mod.rs | 0 .../src/request_tracker/request.rs | 16 +- .../src/request_tracker/request_graph.rs | 0 .../src/request_tracker/request_tracker.rs | 18 +- .../src/request_tracker/test.rs | 0 crates/{parcel => atlaspack}/src/requests.rs | 0 .../src/requests/asset_graph_request.rs | 28 +- .../src/requests/asset_request.rs | 24 +- .../src/requests/entry_request.rs | 6 +- .../src/requests/path_request.rs | 20 +- .../src/requests/target_request.rs | 38 +- .../requests/target_request/package_json.rs | 10 +- .../{parcel => atlaspack}/src/test_utils.rs | 26 +- .../Cargo.toml | 8 +- .../src/atlaspack_config.rs} | 24 +- .../src/atlaspack_config_fixtures.rs} | 94 +-- .../src/atlaspack_rc.rs} | 20 +- .../src/atlaspack_rc_config_loader.rs} | 301 +++++---- crates/atlaspack_config/src/lib.rs | 9 + .../src/map.rs | 0 .../src/map/matcher.rs | 0 .../src/map/named_pipelines_map.rs | 20 +- .../src/map/pipeline_map.rs | 16 +- .../src/map/pipelines_map.rs | 16 +- .../src/partial_atlaspack_config.rs} | 157 +++-- .../Cargo.toml | 6 +- .../src/asset_graph.rs | 0 .../src/bundle_graph.rs | 0 .../src/cache.rs | 0 .../src/config_loader.rs | 8 +- .../src/hash.rs | 2 +- .../src/lib.rs | 0 .../src/plugin.rs | 2 +- .../src/plugin/bundler_plugin.rs | 0 .../src/plugin/compressor_plugin.rs | 0 .../src/plugin/namer_plugin.rs | 0 .../src/plugin/optimizer_plugin.rs | 0 .../src/plugin/packager_plugin.rs | 0 .../src/plugin/reporter_plugin.rs | 4 +- .../composite_reporter_plugin.rs | 0 .../src/plugin/resolver_plugin.rs | 2 +- .../src/plugin/runtime_plugin.rs | 0 .../src/plugin/transformer_plugin.rs | 4 +- .../src/plugin/validator_plugin.rs | 6 +- .../src/types.rs | 6 +- .../src/types/asset.rs | 4 +- .../src/types/atlaspack_options.rs} | 6 +- .../src/types/bundle.rs | 0 .../src/types/bundle_graph.rs | 0 .../src/types/dependency.rs | 2 +- .../src/types/diagnostic.rs | 2 +- .../src/types/environment.rs | 6 +- .../src/types/environment/browsers.rs | 0 .../src/types/environment/engines.rs | 2 +- .../src/types/environment/output_format.rs | 0 .../src/types/environment/version.rs | 0 .../src/types/file.rs | 0 .../src/types/file_type.rs | 0 .../src/types/invalidation.rs | 0 .../src/types/json.rs | 0 .../src/types/package_json.rs | 0 .../src/types/source.rs | 0 .../src/types/symbol.rs | 0 .../src/types/target.rs | 2 +- .../src/types/utils.rs | 0 .../Cargo.toml | 4 +- .../src/in_memory_file_system.rs | 2 +- .../src/lib.rs | 0 .../src/os_file_system.rs | 0 .../src/os_file_system/canonicalize.rs | 0 .../src/search.rs | 84 +-- .../Cargo.toml | 4 +- crates/atlaspack_monitoring/README.md | 54 ++ .../examples/sample_usage.rs | 2 +- .../src/crash_reporter.rs | 36 +- .../src/from_env.rs | 0 .../src/lib.rs | 0 .../src/sentry_integration.rs | 42 +- .../src/tracer.rs | 14 +- .../Cargo.toml | 2 +- .../src/anyhow.rs | 0 .../src/call_method.rs | 0 .../src/console_log.rs | 0 .../src/get_function.rs | 0 .../src/js_callable/js_callable.rs | 0 .../src/js_callable/js_value.rs | 0 .../src/js_callable/mod.rs | 0 .../src/js_callable/serde.rs | 0 .../src/lib.rs | 0 .../src/transferable.rs | 0 .../Cargo.toml | 6 +- .../src/lib.rs | 0 .../src/node_package_manager.rs | 10 +- .../src/package_manager.rs | 0 crates/atlaspack_plugin_resolver/Cargo.toml | 13 + .../src/atlaspack_resolver.rs} | 108 +-- crates/atlaspack_plugin_resolver/src/lib.rs | 3 + .../Cargo.toml | 12 +- .../src/lib.rs | 0 .../src/nodejs/mod.rs | 0 .../src/nodejs/rpc_conn_nodejs.rs | 4 +- .../src/nodejs/rpc_conns_nodejs.rs | 0 .../src/nodejs/rpc_host_nodejs.rs | 0 .../src/plugin/bundler.rs | 8 +- .../src/plugin/compressor.rs | 8 +- .../src/plugin/mod.rs | 0 .../src/plugin/namer.rs | 10 +- .../src/plugin/optimizer.rs | 10 +- .../src/plugin/packager.rs | 10 +- .../src/plugin/reporter.rs | 8 +- .../src/plugin/resolver.rs | 10 +- .../src/plugin/runtime.rs | 12 +- .../src/plugin/transformer.rs | 8 +- .../src/rpc_host.rs | 0 .../Cargo.toml | 15 + .../src/lib.rs | 2 +- .../src/transformer.rs | 38 +- .../src/transformer/conversion.rs | 38 +- .../transformer/conversion/dependency_kind.rs | 16 +- .../src/transformer/conversion/loc.rs | 4 +- .../src/transformer/conversion/symbol.rs | 18 +- .../src/transformer/test_helpers.rs | 8 +- .../src/ts_config.rs | 0 crates/macros/Cargo.toml | 2 +- crates/node-bindings/Cargo.toml | 30 +- .../parcel.rs => atlaspack/atlaspack.rs} | 54 +- .../src/{parcel => atlaspack}/mod.rs | 2 +- .../node-bindings/src/atlaspack/monitoring.rs | 12 + .../package_manager_napi.rs | 4 +- .../src/{parcel => atlaspack}/worker.rs | 4 +- .../src/file_system/file_system_napi.rs | 4 +- crates/node-bindings/src/lib.rs | 2 +- crates/node-bindings/src/parcel/monitoring.rs | 11 - crates/node-bindings/src/resolver.rs | 50 +- crates/node-bindings/src/resolver_old.rs | 50 +- crates/node-bindings/src/transformer.rs | 10 +- crates/parcel/Cargo.toml | 36 - crates/parcel/src/lib.rs | 13 - crates/parcel_config/src/lib.rs | 9 - crates/parcel_monitoring/README.md | 54 -- crates/parcel_plugin_resolver/Cargo.toml | 13 - crates/parcel_plugin_resolver/src/lib.rs | 3 - .../parcel_plugin_transformer_js/Cargo.toml | 15 - docs/AdjacencyList.md | 8 +- docs/BundlerExamples.md | 10 +- .../Native Binary Builds.md | 4 +- docs/DefaultBundler.md | 12 +- docs/ManualBundling.md | 8 +- docs/Scopehoisting Packager.md | 20 +- docs/Scopehoisting Transformer.md | 6 +- docs/Scopehoisting.md | 22 +- docs/swc Visitors.md | 4 +- flow-libs/less.js.flow | 6 +- flow-libs/postcss.js.flow | 2 +- flow-libs/stylus.js.flow | 2 +- package.json | 22 +- packages/bundlers/default/package.json | 20 +- .../bundlers/default/src/DefaultBundler.js | 32 +- packages/bundlers/library/package.json | 12 +- .../bundlers/library/src/LibraryBundler.js | 2 +- packages/compressors/brotli/package.json | 12 +- .../brotli/src/BrotliCompressor.js | 2 +- packages/compressors/gzip/package.json | 12 +- .../compressors/gzip/src/GzipCompressor.js | 2 +- packages/compressors/raw/package.json | 12 +- packages/compressors/raw/src/RawCompressor.js | 2 +- packages/configs/default/index.json | 121 ++-- packages/configs/default/package.json | 120 ++-- packages/configs/default/test/.babelrc | 2 +- packages/configs/default/test/config.test.js | 6 +- packages/configs/repl/index.json | 49 +- packages/configs/repl/package.json | 54 +- packages/configs/webextension/index.json | 10 +- packages/configs/webextension/package.json | 20 +- .../core/{parcel => atlaspack}/.npmignore | 0 packages/core/{parcel => atlaspack}/README.md | 11 +- .../parcel.js => atlaspack/bin/atlaspack.js} | 0 .../core/{parcel => atlaspack}/bin/dev-bin.js | 0 .../ensure-no-dev-lib.sh | 0 packages/core/atlaspack/package.json | 45 ++ .../{parcel => atlaspack}/src/.eslintrc.json | 2 +- packages/core/atlaspack/src/bin.js | 12 + .../core/{parcel => atlaspack}/src/cli.js | 63 +- packages/core/cache/index.d.ts | 2 +- packages/core/cache/package.json | 16 +- packages/core/cache/src/FSCache.js | 14 +- packages/core/cache/src/IDBCache.browser.js | 10 +- packages/core/cache/src/LMDBCache.js | 12 +- packages/core/cache/src/types.js | 2 +- packages/core/codeframe/package.json | 8 +- packages/core/codeframe/src/codeframe.js | 2 +- packages/core/core/index.d.ts | 14 +- packages/core/core/package.json | 38 +- packages/core/core/src/AssetGraph.js | 10 +- .../core/core/src/{Parcel.js => Atlaspack.js} | 99 +-- .../{ParcelConfig.js => AtlaspackConfig.js} | 96 +-- ...ig.schema.js => AtlaspackConfig.schema.js} | 29 +- packages/core/core/src/BundleGraph.js | 20 +- packages/core/core/src/CommittedAsset.js | 10 +- packages/core/core/src/Dependency.js | 4 +- packages/core/core/src/Environment.js | 4 +- packages/core/core/src/InternalConfig.js | 4 +- packages/core/core/src/PackagerRunner.js | 30 +- packages/core/core/src/ReporterRunner.js | 20 +- packages/core/core/src/RequestTracker.js | 90 +-- packages/core/core/src/SymbolPropagation.js | 20 +- .../core/core/src/TargetDescriptor.schema.js | 2 +- packages/core/core/src/Transformation.js | 48 +- packages/core/core/src/UncommittedAsset.js | 16 +- packages/core/core/src/Validation.js | 34 +- packages/core/core/src/applyRuntimes.js | 22 +- packages/core/core/src/assetUtils.js | 16 +- .../AtlaspackV3.js} | 18 +- .../src/{parcel-v3 => atlaspack-v3}/fs.js | 6 +- packages/core/core/src/atlaspack-v3/index.js | 5 + .../{parcel-v3 => atlaspack-v3}/jsCallable.js | 0 .../plugins/Resolver.js | 0 .../plugins/index.js | 0 .../core/src/atlaspack-v3/worker/index.js | 8 + .../worker/worker.js | 6 +- packages/core/core/src/constants.js | 2 +- packages/core/core/src/dumpGraphToGraphViz.js | 22 +- packages/core/core/src/index.js | 6 +- ...ParcelPlugin.js => loadAtlaspackPlugin.js} | 65 +- packages/core/core/src/loadDotEnv.js | 6 +- packages/core/core/src/parcel-v3/index.js | 5 - .../core/core/src/parcel-v3/worker/index.js | 8 - packages/core/core/src/projectPath.js | 4 +- packages/core/core/src/public/Asset.js | 8 +- packages/core/core/src/public/Bundle.js | 34 +- packages/core/core/src/public/BundleGraph.js | 12 +- packages/core/core/src/public/BundleGroup.js | 11 +- packages/core/core/src/public/Config.js | 12 +- packages/core/core/src/public/Dependency.js | 13 +- packages/core/core/src/public/Environment.js | 14 +- .../core/src/public/MutableBundleGraph.js | 10 +- .../core/core/src/public/PluginOptions.js | 24 +- packages/core/core/src/public/Symbols.js | 16 +- packages/core/core/src/public/Target.js | 8 +- .../core/src/registerCoreWithSerializer.js | 6 +- .../core/src/requests/AssetGraphRequest.js | 26 +- .../src/requests/AssetGraphRequestRust.js | 10 +- .../core/core/src/requests/AssetRequest.js | 16 +- ...ildRequest.js => AtlaspackBuildRequest.js} | 34 +- ...igRequest.js => AtlaspackConfigRequest.js} | 175 +++-- .../core/src/requests/BundleGraphRequest.js | 51 +- .../core/core/src/requests/ConfigRequest.js | 22 +- .../core/core/src/requests/DevDepRequest.js | 12 +- .../core/core/src/requests/EntryRequest.js | 20 +- .../core/core/src/requests/PackageRequest.js | 14 +- .../core/core/src/requests/PathRequest.js | 42 +- .../core/core/src/requests/TargetRequest.js | 78 +-- .../core/src/requests/ValidationRequest.js | 14 +- .../core/src/requests/WriteBundleRequest.js | 40 +- .../core/src/requests/WriteBundlesRequest.js | 8 +- packages/core/core/src/resolveOptions.js | 34 +- packages/core/core/src/summarizeRequest.js | 4 +- packages/core/core/src/types.js | 48 +- packages/core/core/src/utils.js | 12 +- packages/core/core/src/worker.js | 52 +- .../{Parcel.test.js => Atlaspack.test.js} | 68 +- ...Config.test.js => AtlaspackConfig.test.js} | 120 ++-- ...test.js => AtlaspackConfigRequest.test.js} | 401 +++++------ packages/core/core/test/EntryRequest.test.js | 12 +- .../core/core/test/PackagerRunner.test.js | 4 +- packages/core/core/test/PublicBundle.test.js | 2 +- .../test/PublicMutableBundleGraph.test.js | 2 +- .../core/core/test/RequestTracker.test.js | 4 +- .../core/core/test/SymbolPropagation.test.js | 18 +- packages/core/core/test/TargetRequest.test.js | 32 +- .../fixtures/{parcel => atlaspack}/index.js | 0 .../fixtures/{parcel => atlaspack}/other.js | 0 .../{parcel => atlaspack}/package.json | 0 .../fixtures/{parcel => atlaspack}/yarn.lock | 0 .../config-extends-not-found/.atlaspackrc | 3 + .../.atlaspackrc-json5 | 3 + .../.atlaspackrc-multiple | 3 + .../.atlaspackrc-node-modules | 3 + .../config-extends-not-found/.parcelrc | 3 - .../config-extends-not-found/.parcelrc-json5 | 3 - .../.parcelrc-multiple | 3 - .../.parcelrc-node-modules | 3 - .../{.parcelrc => .atlaspackrc} | 0 .../config-node-pipeline/.atlaspackrc | 6 + .../fixtures/config-node-pipeline/.parcelrc | 6 - .../config-plugin-not-found/.atlaspackrc | 6 + .../config-plugin-not-found/.parcelrc | 6 - .../core/test/fixtures/config/.atlaspackrc | 6 + .../core/core/test/fixtures/config/.parcelrc | 6 - .../fixtures/config/subfolder/.atlaspackrc | 6 + .../test/fixtures/config/subfolder/.parcelrc | 6 - .../local-plugin-config-pkg/.atlaspackrc | 3 + .../local-plugin-config-pkg/.parcelrc | 3 - .../index.json | 4 +- .../local-plugin.js | 2 +- .../atlaspack-config-local/package.json | 7 + .../parcel-config-local/package.json | 7 - .../test/fixtures/plugins/local-plugin.js | 2 +- .../index.js | 2 +- .../package.json | 7 + .../index.js | 2 +- .../package.json | 4 + .../package.json | 7 - .../package.json | 4 - .../core/test/requests/ConfigRequest.test.js | 6 +- packages/core/core/test/test-utils.js | 18 +- packages/core/diagnostic/package.json | 8 +- packages/core/diagnostic/src/diagnostic.js | 2 +- packages/core/feature-flags/package.json | 10 +- packages/core/feature-flags/src/index.js | 2 +- packages/core/feature-flags/src/types.js | 2 +- packages/core/fs/index.d.ts | 6 +- packages/core/fs/package.json | 52 +- packages/core/fs/src/MemoryFS.js | 8 +- packages/core/fs/src/NodeFS.browser.js | 2 +- packages/core/fs/src/NodeFS.js | 14 +- packages/core/fs/src/OverlayFS.js | 8 +- packages/core/fs/src/find.js | 2 +- packages/core/fs/src/index.js | 6 +- packages/core/fs/test/OverlayFS.test.js | 6 +- packages/core/graph/package.json | 10 +- packages/core/graph/src/Graph.js | 2 +- packages/core/graph/src/shared-buffer.js | 2 +- packages/core/graph/test/Graph.test.js | 2 +- .../adjacency-list-shared-array.js | 2 +- packages/core/integration-tests/.mocharc.json | 5 +- .../integration-tests/data/lastTestRun.json | 24 +- packages/core/integration-tests/package.json | 8 +- .../integration-tests/test/BundleGraph.js | 10 +- packages/core/integration-tests/test/api.js | 22 +- .../{parcel-link.js => atlaspack-link.js} | 321 ++++----- .../{parcel-query.js => atlaspack-query.js} | 6 +- ...rcel-register.js => atlaspack-register.js} | 28 +- .../integration-tests/test/atlaspack-v3.js | 42 ++ packages/core/integration-tests/test/babel.js | 62 +- .../core/integration-tests/test/blob-url.js | 9 +- .../core/integration-tests/test/bundler.js | 74 +-- packages/core/integration-tests/test/cache.js | 514 ++++++++------- .../integration-tests/test/compressors.js | 2 +- .../integration-tests/test/config-merging.js | 2 +- .../integration-tests/test/contentHashing.js | 2 +- .../integration-tests/test/css-modules.js | 6 +- packages/core/integration-tests/test/css.js | 8 +- packages/core/integration-tests/test/elm.js | 10 +- .../core/integration-tests/test/encodedURI.js | 2 +- .../test/eslint-validation.js | 8 +- .../integration-tests/test/feature-flags.js | 20 +- packages/core/integration-tests/test/fs.js | 2 +- packages/core/integration-tests/test/glob.js | 10 +- .../core/integration-tests/test/globals.js | 8 +- packages/core/integration-tests/test/glsl.js | 8 +- .../core/integration-tests/test/graphql.js | 2 +- packages/core/integration-tests/test/hmr.js | 16 +- packages/core/integration-tests/test/html.js | 20 +- packages/core/integration-tests/test/image.js | 2 +- .../test/incremental-bundling.js | 40 +- .../integration/atlaspack-register/.babelrc | 3 + .../dispose-resolve.js | 2 +- .../dispose-transform.js | 2 +- .../integration/atlaspack-register/entry.js | 2 + .../foo.js | 0 .../index.js | 0 .../resolver.js | 0 .../atlaspackrc-custom/.atlaspackrc | 6 + .../integration/atlaspackrc-custom/configCopy | 6 + .../index.js | 0 .../index.js | 2 +- .../package.json | 4 + .../atlaspack-transformer-mock}/index.js | 2 +- .../atlaspack-transformer-mock/package.json | 4 + .../atlaspackrc-custom/package.json | 4 + .../yarn.lock | 0 .../atlaspackrc-monorepo/app/.atlaspackrc | 6 + .../app/icon.svg | 0 .../app/index.js | 0 .../app/package.json | 0 .../package.json | 0 .../yarn.lock | 0 .../package.json | 2 +- .../package.json | 2 +- .../babel-browserslist/package.json | 2 +- .../babel.config.js | 4 +- .../package.json | 2 +- .../babel.config.js | 2 +- .../babel-config-js-require/yarn.lock | 2 +- .../integration/babel-config-js/yarn.lock | 2 +- .../babel-config-json-custom/yarn.lock | 2 +- .../integration/babel-core-js/package.json | 2 +- .../integration/babel-default/package.json | 2 +- .../package.json | 2 +- .../babel-node-modules-jsx/package.json | 2 +- .../package.json | 2 +- .../babel-node-modules-source/package.json | 2 +- .../babel-node-modules/package.json | 2 +- .../.babelrc | 2 +- .../babel-warn-some-json5/.babelrc | 2 +- .../test/integration/babel-warn-some/.babelrc | 2 +- .../test/integration/babelrc-custom/yarn.lock | 2 +- .../test/integration/blob-url/.atlaspackrc | 10 + .../test/integration/blob-url/.parcelrc | 10 - .../cache-add-dep-referenced/package.json | 2 +- .../index.js | 2 +- .../atlaspack-bundler-test/package.json | 4 + .../index.js | 2 +- .../atlaspack-compressor-test/package.json | 4 + .../atlaspack-namer-test}/index.js | 2 +- .../atlaspack-namer-test/package.json | 4 + .../index.js | 2 +- .../atlaspack-optimizer-test/package.json | 4 + .../index.js | 2 +- .../atlaspack-packager-test/package.json | 4 + .../index.js | 2 +- .../atlaspack-resolver-test/package.json | 4 + .../atlaspack-runtime-test}/index.js | 2 +- .../atlaspack-runtime-test/package.json | 4 + .../constants.js | 0 .../data/a.js | 0 .../data/b.js | 0 .../dep.cjs | 0 .../index.js | 2 +- .../package.json | 4 +- .../constants.js | 0 .../index.js | 2 +- .../atlaspack-transformer-mock/package.json | 4 + .../parcel-bundler-test/package.json | 4 - .../parcel-compressor-test/package.json | 4 - .../parcel-namer-test/package.json | 4 - .../parcel-optimizer-test/package.json | 4 - .../parcel-packager-test/package.json | 4 - .../parcel-resolver-test/package.json | 4 - .../parcel-runtime-test/package.json | 4 - .../parcel-transformer-mock/package.json | 4 - .../test/integration/cache/package.json | 2 +- .../compressors-disable-default/.atlaspackrc | 6 + .../compressors-disable-default/.parcelrc | 6 - .../test/integration/compressors/.atlaspackrc | 6 + .../test/integration/compressors/.parcelrc | 6 - .../integration/config-merging/.atlaspackrc | 3 + .../test/integration/config-merging/.parcelrc | 3 - .../atlaspack-config-test1/index.json | 3 + .../package.json | 4 +- .../atlaspack-config-test2/index.json | 5 + .../package.json | 4 +- .../index.js | 4 +- .../package.json | 0 .../index.js | 4 +- .../package.json | 0 .../parcel-config-test1/index.json | 3 - .../parcel-config-test2/index.json | 5 - .../integration/config-merging/package.json | 2 +- .../test/integration/css-exports/package.json | 2 +- .../css-modules-global/a/package.json | 4 +- .../css-modules-global/b/package.json | 4 +- .../css-modules-import/package.json | 4 +- .../css-modules-style/package.json | 2 +- .../integration/css-modules-vars/package.json | 4 +- .../test/integration/css-nesting/package.json | 2 +- .../custom-configs/.atlaspackrc-build-metrics | 6 + .../custom-configs/.atlaspackrc-dev-server | 6 + .../custom-configs/.atlaspackrc-eslint | 7 + .../custom-configs/.atlaspackrc-json-reporter | 6 + .../custom-configs/.atlaspackrc-svg-react | 7 + .../.atlaspackrc-typescript-validation | 6 + .../custom-configs/.parcelrc-build-metrics | 6 - .../custom-configs/.parcelrc-dev-server | 6 - .../custom-configs/.parcelrc-eslint | 7 - .../custom-configs/.parcelrc-json-reporter | 6 - .../custom-configs/.parcelrc-svg-react | 7 - .../.parcelrc-typescript-validation | 6 - .../data-url/{parcel.webp => atlaspack.webp} | Bin .../test/integration/data-url/binary.css | 2 +- .../test/integration/data-url/binary.js | 2 +- .../dont-autoinstall-if-env-var-is-false/.env | 2 +- .../elm-multiple-apps/package.json | 2 +- .../test/integration/encodedURI/index.html | 4 +- .../env-disabled-glob/package.json | 2 +- .../integration/env-disabled/package.json | 2 +- .../test/integration/env-nodeenv/package.json | 2 +- .../test/integration/fs-disabled/package.json | 2 +- .../integration/glob-absolute/.atlaspackrc | 4 + .../test/integration/glob-absolute/.parcelrc | 4 - .../test/integration/glob-async/.atlaspackrc | 4 + .../test/integration/glob-async/.parcelrc | 4 - .../test/integration/glob-css/.atlaspackrc | 4 + .../test/integration/glob-css/.parcelrc | 4 - .../test/integration/glob-deep/.atlaspackrc | 4 + .../test/integration/glob-deep/.parcelrc | 4 - .../test/integration/glob-error/.atlaspackrc | 4 + .../test/integration/glob-error/.parcelrc | 4 - .../glob-package-async/.atlaspackrc | 4 + .../integration/glob-package-async/.parcelrc | 4 - .../integration/glob-package/.atlaspackrc | 4 + .../test/integration/glob-package/.parcelrc | 4 - .../integration/glob-pipeline/.atlaspackrc | 4 + .../test/integration/glob-pipeline/.parcelrc | 4 - .../test/integration/glob-tilde/.atlaspackrc | 4 + .../test/integration/glob-tilde/.parcelrc | 4 - .../test/integration/glob/.atlaspackrc | 4 + .../test/integration/glob/.parcelrc | 4 - .../integration/global-redeclare/package.json | 2 +- .../html-inline-coffeescript/index.html | 4 +- .../html-inline-js-module/index.html | 2 +- .../html-inline-js-shared/index.html | 2 +- .../integration/html-inline-js/index.html | 4 +- .../integration/html-inline-sass/index.html | 2 +- .../integration/html-inline-styles/index.html | 4 +- .../html-js-shared-head/package.json | 4 +- .../integration/html-js-shared/package.json | 4 +- .../html-multi-targets/package.json | 2 +- .../html-shared-referenced/package.json | 2 +- .../integration/included-file/.atlaspackrc | 6 + .../test/integration/included-file/.parcelrc | 6 - .../index.js | 2 +- .../package.json | 4 + .../parcel-transformer-included/package.json | 4 - .../index.js | 2 +- .../atlaspack-bundler-test/package.json | 4 + .../atlaspack-namer-test}/index.js | 2 +- .../atlaspack-namer-test/package.json | 4 + .../atlaspack-runtime-test}/index.js | 2 +- .../atlaspack-runtime-test/package.json | 4 + .../parcel-bundler-test/package.json | 4 - .../parcel-namer-test/package.json | 4 - .../parcel-runtime-test/package.json | 4 - .../incremental-bundling/package.json | 2 +- .../package.json | 6 +- .../integration/inline-constants/package.json | 4 +- .../invalid-bundler-config/package.json | 2 +- .../integration/less-exports/package.json | 2 +- .../{.parcelrc => .atlaspackrc} | 2 +- .../library-parallel-deps/ParallelResolver.js | 2 +- .../test/integration/min-bundles/package.json | 2 +- .../.atlaspackrc | 6 + .../multi-asset-transformer-export/.parcelrc | 6 - .../index.js | 2 +- .../atlaspack-transformer-test/package.json | 4 + .../parcel-transformer-test/package.json | 4 - .../multi-asset-transformer/.atlaspackrc | 6 + .../multi-asset-transformer/.parcelrc | 6 - .../index.js | 2 +- .../atlaspack-transformer-test/package.json | 4 + .../parcel-transformer-test/package.json | 4 - .../integration/multi-css-bug/src/entry.js | 2 +- .../optimizer-changing-type/.atlaspackrc | 6 + .../optimizer-changing-type/.parcelrc | 6 - .../ChangingTypeOptimizer.js | 2 +- .../package.json | 4 +- .../packager-loadBundleConfig/.atlaspackrc | 9 + .../packager-loadBundleConfig/.parcelrc | 9 - .../index.js | 2 +- .../atlaspack-packager-config/package.json | 13 + .../parcel-packager-config/package.json | 13 - .../packager-loadConfig/.atlaspackrc | 9 + .../integration/packager-loadConfig/.parcelrc | 9 - .../index.js | 4 +- .../atlaspack-packager-config/package.json | 13 + .../parcel-packager-config/package.json | 13 - .../test/integration/parcel-register/.babelrc | 3 - .../test/integration/parcel-register/entry.js | 2 - .../integration/parcelrc-custom/.parcelrc | 6 - .../integration/parcelrc-custom/configCopy | 6 - .../package.json | 4 - .../parcel-transformer-mock/package.json | 4 - .../integration/parcelrc-custom/package.json | 4 - .../parcelrc-monorepo/app/.parcelrc | 6 - .../pipeline-type-change/.atlaspackrc | 6 + .../pipeline-type-change/.parcelrc | 6 - .../atlaspack-transformer-a/index.js | 9 + .../atlaspack-transformer-a/package.json | 11 + .../atlaspack-transformer-b/index.js | 8 + .../atlaspack-transformer-b/package.json | 11 + .../parcel-transformer-a/index.js | 9 - .../parcel-transformer-a/package.json | 11 - .../parcel-transformer-b/index.js | 8 - .../parcel-transformer-b/package.json | 11 - .../test/integration/pnp-builtin/.pnp.js | 4 +- .../test/integration/pnp-require/.pnp.js | 4 +- .../postcss-autoinstall/npm/package.json | 2 +- .../postcss-autoinstall/yarn/package.json | 2 +- .../posthtml-plugin-deps/base.html | 2 +- .../test/integration/proxyrc-cjs/index.js | 2 +- .../test/integration/proxyrc-js/index.js | 2 +- .../test/integration/proxyrc-json/index.js | 2 +- .../test/integration/proxyrc-mjs/index.js | 2 +- .../test/integration/proxyrc-ts/index.js | 2 +- .../test/integration/proxyrc/index.js | 2 +- .../test/integration/pug-mixins/index.pug | 2 +- .../react-refresh-library-target/package.json | 2 +- .../reporters-failure/.atlaspackrc | 4 + .../integration/reporters-failure/.parcelrc | 4 - .../reporters-failure/test-reporter/index.js | 2 +- .../reporters-load-failure/.atlaspackrc | 4 + .../reporters-load-failure/.parcelrc | 4 - .../reporters-success/.atlaspackrc | 4 + .../integration/reporters-success/.parcelrc | 4 - .../reporters-success/test-reporter/index.js | 2 +- .../require-async/{parcel.js => atlaspack.js} | 0 .../integration/resolve-exports/package.json | 2 +- .../resolve-mode-condition/package.json | 2 +- .../.atlaspackrc | 4 + .../.parcelrc | 4 - .../index.js | 4 +- .../package.json | 4 +- .../resolver-canDefer/.atlaspackrc | 5 + .../integration/resolver-canDefer/.parcelrc | 5 - .../index.js | 10 +- .../atlaspack-bundler-no-defer}/package.json | 4 +- .../index.js | 4 +- .../atlaspack-resolver-no-defer}/package.json | 4 +- .../resolver-dependency-meta/.atlaspackrc | 5 + .../resolver-dependency-meta/.parcelrc | 5 - .../index.js | 2 +- .../atlaspack-resolver-meta}/package.json | 4 +- .../index.js | 2 +- .../atlaspack-runtime-meta}/package.json | 4 +- .../runtime-deferred-excluded/.atlaspackrc | 4 + .../runtime-deferred-excluded/.parcelrc | 4 - .../index.js | 2 +- .../atlaspack-runtime-test/package.json | 4 + .../parcel-runtime-test/package.json | 4 - .../runtime-symbol-merging/.atlaspackrc | 4 + .../runtime-symbol-merging/.parcelrc | 4 - .../index.js | 2 +- .../atlaspack-runtime-mock/package.json | 4 + .../parcel-runtime-mock/package.json | 4 - .../integration/runtime-update/.atlaspackrc | 6 + .../test/integration/runtime-update/.parcelrc | 6 - .../index.js | 2 +- .../atlaspack-runtime-mock/package.json | 4 + .../parcel-runtime-mock/package.json | 4 - .../integration/sass-exports/package.json | 2 +- .../test/integration/schema-jsonld/index.html | 2 +- .../live-bindings-cross-bundle/package.json | 2 +- .../package.json | 2 +- .../.atlaspackrc | 6 + .../.parcelrc | 6 - .../index.js | 2 +- .../atlaspack-transformer-test/package.json | 8 + .../parcel-transformer-test/package.json | 8 - .../service-worker/manifest-worker.js | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../shared-bundle-single-source/package.json | 2 +- .../test/integration/shared-many/package.json | 2 +- .../package.json | 4 +- .../shared-sibling-entries/package.json | 4 +- .../package.json | 2 +- .../sourcemap-css-import/package.json | 2 +- .../integration/sourcemap-css/package.json | 2 +- .../sourcemap-generate-inline/package.json | 2 +- .../sourcemap-inline-sources/package.json | 2 +- .../integration/sourcemap-less/package.json | 2 +- .../sourcemap-nested-minified/package.json | 2 +- .../integration/sourcemap-nested/package.json | 2 +- .../integration/sourcemap-node/package.json | 2 +- .../sourcemap-sass-imported/package.json | 2 +- .../integration/sourcemap-sass/package.json | 2 +- .../sourcemap-typescript-nested/package.json | 2 +- .../sourcemap-typescript-tsc/.atlaspackrc | 6 + .../sourcemap-typescript-tsc/.parcelrc | 6 - .../sourcemap-typescript-tsc/package.json | 2 +- .../sourcemap-typescript/package.json | 2 +- .../test/integration/sourcemap/package.json | 2 +- .../split-manifest-bundle/package.json | 4 +- .../integration/stylus-exports/package.json | 2 +- .../sync-async-when-needed/package.json | 2 +- .../target-overwrite-source/app/src/file.js | 2 +- .../target-overwrite-source/browser/index.js | 2 +- .../target-overwrite-source/main/index.js | 2 +- .../target-overwrite-source/module/index.js | 2 +- .../integration/target-source/package.json | 10 +- .../packages/package-a/package.json | 6 +- .../packages/package-b/package.json | 6 +- .../integration/terser-codeframe/.atlaspackrc | 10 + .../integration/terser-codeframe/.parcelrc | 10 - .../ts-types/windows-paths/tsconfig.json | 2 +- .../typescript-config-extends/.atlaspackrc | 6 + .../typescript-config-extends/.parcelrc | 6 - .../typescript-config/.atlaspackrc | 6 + .../integration/typescript-config/.parcelrc | 6 - .../typescript-types-atlaspackrc/.atlaspackrc | 8 + .../index.ts | 0 .../package.json | 2 +- .../yarn.lock | 0 .../typescript-types-parcelrc/.parcelrc | 8 - .../test/integration/vue-script-setup/App.vue | 4 +- .../wasm-sourcemap-transformer/.atlaspackrc | 6 + .../wasm-sourcemap-transformer/.parcelrc | 6 - .../index.js | 2 +- .../atlaspack-transformer-test/package.json | 4 + .../parcel-transformer-test/package.json | 4 - .../integration/webextension-mv3/.atlaspackrc | 3 + .../integration/webextension-mv3/.parcelrc | 3 - .../.atlaspackrc | 3 + .../.parcelrc | 3 - .../manifest.json | 4 +- .../integration/webextension/.atlaspackrc | 3 + .../test/integration/webextension/.parcelrc | 3 - .../integration/webextension/manifest.json | 4 +- .../integration/webextension/src/assets/a.txt | 2 +- .../webextension/src/assets/nested/b.txt | 2 +- .../webextension/src/background.ts | 2 +- .../integration/webextension/src/content.css | 4 +- .../integration/webextension/src/content.js | 2 +- .../core/integration-tests/test/javascript.js | 72 +- .../integration-tests/test/json-reporter.js | 4 +- .../core/integration-tests/test/kotlin.js | 8 +- .../integration-tests/test/lazy-compile.js | 2 +- packages/core/integration-tests/test/less.js | 6 +- .../integration-tests/test/library-bundler.js | 58 +- .../core/integration-tests/test/macros.js | 36 +- .../core/integration-tests/test/markdown.js | 2 +- packages/core/integration-tests/test/mdx.js | 2 +- .../test/metrics-reporter.js | 14 +- .../core/integration-tests/test/monorepos.js | 22 +- packages/core/integration-tests/test/namer.js | 2 +- .../integration-tests/test/output-formats.js | 22 +- .../core/integration-tests/test/packager.js | 8 +- .../core/integration-tests/test/parcel-v3.js | 36 - .../core/integration-tests/test/parser.js | 2 +- .../core/integration-tests/test/plugin.js | 10 +- packages/core/integration-tests/test/pnp.js | 2 +- .../core/integration-tests/test/postcss.js | 6 +- .../core/integration-tests/test/posthtml.js | 4 +- packages/core/integration-tests/test/proxy.js | 10 +- packages/core/integration-tests/test/pug.js | 4 +- .../integration-tests/test/react-refresh.js | 18 +- .../core/integration-tests/test/reason.js | 2 +- .../test/registered-plugins.js | 10 +- .../core/integration-tests/test/reporters.js | 10 +- .../core/integration-tests/test/resolver.js | 4 +- packages/core/integration-tests/test/rust.js | 2 +- packages/core/integration-tests/test/sass.js | 2 +- .../integration-tests/test/schema-jsonld.js | 2 +- .../integration-tests/test/scope-hoisting.js | 84 +-- .../core/integration-tests/test/server.js | 10 +- .../core/integration-tests/test/sourcemaps.js | 22 +- .../core/integration-tests/test/stylus.js | 2 +- .../core/integration-tests/test/sugarss.js | 2 +- .../core/integration-tests/test/svg-react.js | 8 +- packages/core/integration-tests/test/svg.js | 2 +- .../test/symbol-propagation.js | 2 +- .../integration-tests/test/tailwind-tests.js | 2 +- .../core/integration-tests/test/tracing.js | 6 +- .../integration-tests/test/transpilation.js | 8 +- .../core/integration-tests/test/ts-types.js | 8 +- .../integration-tests/test/ts-validation.js | 11 +- .../integration-tests/test/typescript-tsc.js | 12 +- .../core/integration-tests/test/typescript.js | 6 +- packages/core/integration-tests/test/vue.js | 9 +- packages/core/integration-tests/test/wasm.js | 2 +- .../core/integration-tests/test/watcher.js | 12 +- .../integration-tests/test/webextension.js | 4 +- .../integration-tests/test/webmanifest.js | 10 +- .../core/integration-tests/test/workers.js | 20 +- .../core/integration-tests/test/worklets.js | 8 +- packages/core/integration-tests/test/xml.js | 2 +- .../core/integration-tests/test/yarn.lock | 2 +- packages/core/logger/package.json | 12 +- packages/core/logger/src/Logger.js | 8 +- packages/core/markdown-ansi/package.json | 8 +- packages/core/package-manager/index.d.ts | 6 +- packages/core/package-manager/package.json | 40 +- .../package-manager/src/JSONParseStream.js | 6 +- .../src/MockPackageInstaller.js | 10 +- .../package-manager/src/NodePackageManager.js | 40 +- packages/core/package-manager/src/Npm.js | 14 +- packages/core/package-manager/src/Pnpm.js | 18 +- packages/core/package-manager/src/Yarn.js | 20 +- packages/core/package-manager/src/index.js | 4 +- .../package-manager/src/installPackage.js | 20 +- packages/core/package-manager/src/utils.js | 12 +- .../test/NodePackageManager.test.js | 10 +- .../test/validateModuleSpecifiers.test.js | 4 +- packages/core/parcel/package.json | 49 -- packages/core/parcel/src/bin.js | 12 - packages/core/plugin/package.json | 10 +- packages/core/plugin/src/PluginAPI.d.ts | 2 +- packages/core/plugin/src/PluginAPI.js | 4 +- packages/core/profiler/package.json | 14 +- .../core/profiler/src/SamplingProfiler.js | 4 +- packages/core/profiler/src/Trace.js | 4 +- packages/core/profiler/src/Tracer.js | 4 +- packages/core/profiler/src/types.js | 2 +- packages/core/register/package.json | 18 +- packages/core/register/src/register.js | 34 +- packages/core/rust/browser.js | 4 +- packages/core/rust/index.js.flow | 24 +- packages/core/rust/package.json | 14 +- packages/core/test-utils/.eslintrc.json | 2 +- packages/core/test-utils/package.json | 14 +- .../test-utils/src/.atlaspackrc-no-reporters | 4 + .../test-utils/src/.parcelrc-no-reporters | 4 - packages/core/test-utils/src/fsFixture.js | 4 +- packages/core/test-utils/src/utils.js | 104 +-- .../core/test-utils/test/fsFixture.test.js | 39 +- packages/core/types-internal/package.json | 8 +- packages/core/types-internal/src/index.js | 60 +- packages/core/types/package.json | 8 +- packages/core/types/src/index.js | 9 +- packages/core/utils/.eslintrc.js | 4 +- packages/core/utils/package.json | 30 +- packages/core/utils/src/alternatives.js | 2 +- packages/core/utils/src/blob.js | 2 +- packages/core/utils/src/config.js | 8 +- .../core/utils/src/generateBuildMetrics.js | 4 +- .../core/utils/src/generateCertificate.js | 8 +- packages/core/utils/src/getCertificate.js | 4 +- packages/core/utils/src/getRootDir.js | 2 +- packages/core/utils/src/glob.js | 4 +- packages/core/utils/src/hash.js | 8 +- packages/core/utils/src/http-server.js | 4 +- packages/core/utils/src/isDirectoryInside.js | 2 +- packages/core/utils/src/openInBrowser.js | 6 +- packages/core/utils/src/path.js | 2 +- packages/core/utils/src/prettyDiagnostic.js | 8 +- packages/core/utils/src/progress-message.js | 2 +- packages/core/utils/src/relativeBundlePath.js | 2 +- .../core/utils/src/replaceBundleReferences.js | 4 +- packages/core/utils/src/schema.js | 2 +- packages/core/utils/src/sourcemap.js | 4 +- packages/core/utils/src/stream.js | 2 +- packages/core/utils/test/config.test.js | 2 +- .../test/replaceBundleReferences.test.js | 2 +- packages/core/utils/test/sourcemap.test.js | 4 +- packages/core/workers/index.d.ts | 2 +- packages/core/workers/package.json | 20 +- packages/core/workers/src/Handle.js | 2 +- packages/core/workers/src/Worker.js | 6 +- packages/core/workers/src/WorkerFarm.js | 28 +- packages/core/workers/src/backend.js | 4 +- packages/core/workers/src/bus.js | 4 +- packages/core/workers/src/child.js | 12 +- .../core/workers/src/core-worker.browser.js | 2 +- packages/core/workers/src/index.js | 6 +- .../core/workers/src/process/ProcessChild.js | 2 +- .../core/workers/src/process/ProcessWorker.js | 2 +- .../core/workers/src/threads/ThreadsChild.js | 5 +- .../core/workers/src/threads/ThreadsWorker.js | 5 +- packages/core/workers/src/types.js | 4 +- packages/core/workers/src/web/WebChild.js | 5 +- packages/core/workers/src/web/WebWorker.js | 9 +- .../test/integration/workerfarm/logging.js | 2 +- packages/core/workers/test/workerfarm.js | 2 +- packages/dev/atlaspack-link/README.md | 72 ++ .../{parcel-link => atlaspack-link}/bin.js | 2 +- packages/dev/atlaspack-link/package.json | 21 + .../src/AtlaspackLinkConfig.js} | 16 +- .../src/cli.js | 2 +- .../src/index.js | 2 +- .../src/link.js | 86 +-- .../src/unlink.js | 58 +- .../src/utils.js | 28 +- packages/dev/babel-preset/index.js | 18 +- packages/dev/babel-preset/package.json | 4 +- .../babel-plugin-module-translate.js | 6 +- packages/dev/babel-register/index.js | 4 +- packages/dev/babel-register/package.json | 6 +- packages/dev/bundle-stats-cli/README.md | 2 +- packages/dev/bundle-stats-cli/package.json | 24 +- packages/dev/bundle-stats-cli/src/bin.js | 6 +- packages/dev/bundle-stats-cli/src/cli.js | 22 +- .../dev/bundle-stats-cli/src/deep-imports.js | 20 +- packages/dev/eslint-config-browser/index.js | 2 +- .../dev/eslint-config-browser/package.json | 4 +- packages/dev/eslint-config/index.js | 6 +- packages/dev/eslint-config/package.json | 4 +- packages/dev/eslint-plugin/package.json | 2 +- .../src/rules/no-self-package-imports.js | 2 +- packages/dev/eslint-plugin/src/utils.js | 2 +- .../rules/no-self-package-imports.test.js | 16 +- packages/dev/eslint-plugin/test/utils.test.js | 12 +- packages/dev/esm-fuzzer/.eslintrc.json | 2 +- .../esm-fuzzer/{parcel.js => atlaspack.js} | 12 +- packages/dev/esm-fuzzer/config.json | 14 +- packages/dev/esm-fuzzer/index.js | 24 +- packages/dev/esm-fuzzer/package.json | 6 +- packages/dev/esm-fuzzer/writeExample.js | 2 +- packages/dev/parcel-link/README.md | 72 -- packages/dev/parcel-link/package.json | 21 - packages/dev/query/README.md | 12 +- .../{parcel-query.js => atlaspack-query.js} | 0 packages/dev/query/package.json | 18 +- packages/dev/query/src/bin.js | 6 +- packages/dev/query/src/cli.js | 10 +- packages/dev/query/src/deep-imports.js | 42 +- packages/dev/query/src/index.js | 6 +- packages/dev/repl/NOTES.md | 4 +- .../dev/repl/SimplePackageInstaller/index.js | 8 +- packages/dev/repl/package.json | 14 +- .../src/assets/{parcel.png => atlaspack.png} | Bin .../AtlaspackWorker.js} | 36 +- .../BrowserPackageManager.js | 128 ++-- .../{parcel => atlaspack}/ExtendedMemoryFS.js | 6 +- .../repl/src/{parcel => atlaspack}/index.js | 8 +- .../repl/src/{parcel => atlaspack}/yarn.js | 2 +- .../dev/repl/src/components/FileBrowser.js | 6 +- packages/dev/repl/src/components/Options.js | 4 +- packages/dev/repl/src/components/helper.js | 4 +- packages/dev/repl/src/graphs/index.js | 2 +- packages/dev/repl/src/index.html | 4 +- packages/dev/repl/src/index.js | 16 +- packages/dev/repl/src/repl.webmanifest | 6 +- packages/dev/repl/src/styles/index.css | 4 +- packages/dev/repl/src/sw.js | 6 +- packages/dev/repl/src/utils/assets.js | 6 +- packages/dev/repl/src/utils/options.js | 2 +- packages/examples/.eslintrc.json | 2 +- packages/examples/eslint-example/.atlaspackrc | 6 + packages/examples/eslint-example/.parcelrc | 6 - packages/examples/eslint-example/package.json | 12 +- packages/examples/html/package.json | 8 +- packages/examples/kitchen-sink/.atlaspackrc | 7 + packages/examples/kitchen-sink/.parcelrc | 7 - packages/examples/kitchen-sink/package.json | 18 +- .../src/{parcel.webp => atlaspack.webp} | Bin packages/examples/kitchen-sink/src/index.js | 2 +- packages/examples/react-hmr/package.json | 6 +- .../examples/react-hmr/src/.eslintrc.json | 2 +- packages/examples/react-hmr/src/index.html | 2 +- packages/examples/react-refresh/package.json | 8 +- .../examples/react-refresh/src/.eslintrc.json | 2 +- packages/examples/simple/.atlaspackrc | 3 + packages/examples/simple/.parcelrc | 3 - packages/examples/simple/package.json | 10 +- packages/examples/three/.atlaspackrc | 6 + packages/examples/three/.parcelrc | 6 - packages/examples/three/package.json | 12 +- packages/examples/ts-example/package.json | 8 +- .../ts-typecheck-example/.atlaspackrc | 6 + .../examples/ts-typecheck-example/.parcelrc | 6 - .../ts-typecheck-example/package.json | 10 +- packages/namers/default/package.json | 14 +- packages/namers/default/src/DefaultNamer.js | 6 +- packages/optimizers/blob-url/package.json | 14 +- .../blob-url/src/BlobURLOptimizer.js | 4 +- packages/optimizers/css/package.json | 16 +- packages/optimizers/css/src/CSSOptimizer.js | 10 +- packages/optimizers/cssnano/package.json | 12 +- .../cssnano/src/CSSNanoOptimizer.js | 2 +- packages/optimizers/data-url/package.json | 14 +- .../data-url/src/DataURLOptimizer.js | 4 +- packages/optimizers/esbuild/package.json | 16 +- .../esbuild/src/ESBuildOptimizer.js | 4 +- packages/optimizers/htmlnano/package.json | 12 +- .../htmlnano/src/HTMLNanoOptimizer.js | 2 +- packages/optimizers/image/package.json | 22 +- .../optimizers/image/src/ImageOptimizer.js | 8 +- packages/optimizers/inline-requires/README.md | 12 +- .../optimizers/inline-requires/package.json | 14 +- .../inline-requires/src/InlineRequires.js | 12 +- .../src/RequireInliningVisitor.js | 12 +- .../test/RequireInliningVisitor.test.js | 6 +- packages/optimizers/svgo/package.json | 16 +- packages/optimizers/svgo/src/SVGOOptimizer.js | 6 +- packages/optimizers/swc/package.json | 16 +- packages/optimizers/swc/src/SwcOptimizer.js | 10 +- packages/optimizers/terser/package.json | 16 +- .../optimizers/terser/src/TerserOptimizer.js | 10 +- packages/packagers/css/package.json | 16 +- packages/packagers/css/src/CSSPackager.js | 8 +- packages/packagers/html/package.json | 16 +- packages/packagers/html/src/HTMLPackager.js | 14 +- packages/packagers/js/package.json | 20 +- packages/packagers/js/src/.eslintrc.json | 2 +- packages/packagers/js/src/DevPackager.js | 20 +- packages/packagers/js/src/ESMOutputFormat.js | 4 +- .../packagers/js/src/ScopeHoistingPackager.js | 118 ++-- packages/packagers/js/src/dev-prelude.js | 16 +- packages/packagers/js/src/helpers.js | 92 +-- packages/packagers/js/src/index.js | 24 +- packages/packagers/js/src/utils.js | 55 +- packages/packagers/raw-url/package.json | 14 +- .../packagers/raw-url/src/RawUrlPackager.js | 4 +- packages/packagers/raw/package.json | 12 +- packages/packagers/raw/src/RawPackager.js | 2 +- packages/packagers/svg/package.json | 16 +- packages/packagers/svg/src/SVGPackager.js | 12 +- packages/packagers/ts/package.json | 12 +- packages/packagers/ts/src/TSPackager.js | 2 +- packages/packagers/wasm/package.json | 12 +- packages/packagers/wasm/src/WasmPackager.js | 2 +- packages/packagers/webextension/package.json | 14 +- .../webextension/src/WebExtensionPackager.js | 4 +- packages/packagers/xml/package.json | 16 +- packages/packagers/xml/src/XMLPackager.js | 6 +- packages/reporters/build-metrics/package.json | 14 +- .../build-metrics/src/BuildMetricsReporter.js | 6 +- .../reporters/bundle-analyzer/client/index.js | 13 +- .../reporters/bundle-analyzer/package.json | 16 +- .../src/BundleAnalyzerReporter.js | 10 +- packages/reporters/bundle-buddy/package.json | 12 +- .../bundle-buddy/src/BundleBuddyReporter.js | 4 +- packages/reporters/bundle-stats/package.json | 14 +- .../bundle-stats/src/BundleStatsReporter.js | 8 +- packages/reporters/cli/package.json | 24 +- packages/reporters/cli/src/CLIReporter.js | 10 +- packages/reporters/cli/src/bundleReport.js | 6 +- packages/reporters/cli/src/phaseReport.js | 2 +- packages/reporters/cli/src/utils.js | 2 +- .../reporters/cli/test/CLIReporter.test.js | 20 +- packages/reporters/dev-server-sw/package.json | 16 +- .../reporters/dev-server-sw/src/HMRServer.js | 14 +- .../dev-server-sw/src/ServerReporter.js | 8 +- packages/reporters/dev-server/package.json | 22 +- .../reporters/dev-server/src/HMRServer.js | 14 +- packages/reporters/dev-server/src/Server.js | 20 +- .../dev-server/src/ServerReporter.js | 2 +- .../dev-server/src/templates/500.html | 4 +- .../reporters/dev-server/src/types.js.flow | 8 +- packages/reporters/json/package.json | 16 +- packages/reporters/json/src/JSONReporter.js | 10 +- packages/reporters/lsp-reporter/README.md | 6 +- packages/reporters/lsp-reporter/package.json | 16 +- .../reporters/lsp-reporter/src/LspReporter.js | 36 +- packages/reporters/lsp-reporter/src/utils.js | 10 +- .../sourcemap-visualiser/package.json | 16 +- .../src/SourceMapVisualiser.js | 4 +- packages/reporters/tracer/package.json | 14 +- .../reporters/tracer/src/TracerReporter.js | 6 +- packages/resolvers/default/package.json | 14 +- .../resolvers/default/src/DefaultResolver.js | 8 +- packages/resolvers/glob/package.json | 18 +- packages/resolvers/glob/src/GlobResolver.js | 8 +- packages/resolvers/repl-runtimes/package.json | 12 +- .../repl-runtimes/src/REPLRuntimesResolver.js | 6 +- packages/runtimes/hmr/package.json | 14 +- packages/runtimes/hmr/src/HMRRuntime.js | 8 +- .../runtimes/hmr/src/loaders/.eslintrc.json | 2 +- .../runtimes/hmr/src/loaders/hmr-runtime.js | 71 +- packages/runtimes/js/package.json | 16 +- packages/runtimes/js/src/JSRuntime.js | 26 +- .../runtimes/js/src/helpers/.eslintrc.json | 2 +- .../helpers/browser/esm-js-loader-retry.js | 12 +- .../js/src/helpers/browser/esm-js-loader.js | 2 +- .../js/src/helpers/worker/js-loader.js | 4 +- packages/runtimes/react-refresh/package.json | 14 +- .../react-refresh/src/ReactRefreshRuntime.js | 8 +- packages/runtimes/service-worker/package.json | 14 +- .../src/ServiceWorkerRuntime.js | 8 +- packages/runtimes/webextension/package.json | 14 +- .../webextension/src/WebExtensionRuntime.js | 4 +- .../webextension/src/autoreload-bg.js | 4 +- packages/transformers/babel/README.md | 12 +- packages/transformers/babel/package.json | 18 +- .../babel/src/BabelTransformer.js | 4 +- packages/transformers/babel/src/babel7.js | 10 +- .../transformers/babel/src/babelErrorUtils.js | 2 +- packages/transformers/babel/src/config.js | 22 +- packages/transformers/babel/src/flow.js | 2 +- packages/transformers/babel/src/jsx.js | 2 +- packages/transformers/babel/src/utils.js | 8 +- .../transformers/coffeescript/package.json | 14 +- .../src/CoffeeScriptTransformer.js | 4 +- packages/transformers/css/package.json | 16 +- .../transformers/css/src/CSSTransformer.js | 12 +- packages/transformers/elm/package.json | 14 +- .../transformers/elm/src/ElmTransformer.js | 15 +- packages/transformers/elm/src/loadConfig.js | 8 +- packages/transformers/glsl/package.json | 12 +- .../transformers/glsl/src/GLSLTransformer.js | 2 +- packages/transformers/graphql/package.json | 12 +- .../graphql/src/GraphQLTransformer.js | 2 +- packages/transformers/html/package.json | 16 +- .../transformers/html/src/HTMLTransformer.js | 8 +- .../transformers/html/src/dependencies.js | 4 +- packages/transformers/html/src/inline.js | 22 +- packages/transformers/image/package.json | 14 +- .../image/src/ImageTransformer.js | 4 +- packages/transformers/image/src/loadSharp.js | 4 +- .../transformers/image/src/validateConfig.js | 6 +- .../transformers/inline-string/package.json | 12 +- .../src/InlineStringTransformer.js | 2 +- packages/transformers/inline/package.json | 12 +- .../inline/src/InlineTransformer.js | 2 +- packages/transformers/js/core/Cargo.toml | 4 +- .../js/core/src/dependency_collector.rs | 24 +- .../transformers/js/core/src/env_replacer.rs | 8 +- packages/transformers/js/core/src/fs.rs | 2 +- packages/transformers/js/core/src/hoist.rs | 8 +- packages/transformers/js/core/src/lib.rs | 6 +- packages/transformers/js/core/src/modules.rs | 6 +- .../transformers/js/core/src/node_replacer.rs | 26 +- packages/transformers/js/hoist.md | 26 +- packages/transformers/js/package.json | 22 +- packages/transformers/js/src/JSTransformer.js | 34 +- packages/transformers/json/package.json | 12 +- .../transformers/json/src/JSONTransformer.js | 2 +- packages/transformers/jsonld/package.json | 16 +- .../jsonld/src/JSONLDTransformer.js | 2 +- packages/transformers/less/package.json | 12 +- .../transformers/less/src/LessTransformer.js | 4 +- packages/transformers/less/src/loadConfig.js | 2 +- packages/transformers/mdx/package.json | 12 +- .../transformers/mdx/src/MDXTransformer.js | 2 +- packages/transformers/postcss/package.json | 18 +- .../postcss/src/PostCSSTransformer.js | 25 +- .../transformers/postcss/src/loadConfig.js | 10 +- .../transformers/postcss/src/loadPlugins.js | 4 +- packages/transformers/posthtml/package.json | 14 +- .../posthtml/src/PostHTMLTransformer.js | 4 +- .../transformers/posthtml/src/loadPlugins.js | 4 +- packages/transformers/pug/package.json | 12 +- .../transformers/pug/src/PugTransformer.js | 2 +- packages/transformers/raw/package.json | 12 +- .../transformers/raw/src/RawTransformer.js | 2 +- .../react-refresh-wrap/package.json | 14 +- .../src/ReactRefreshWrapTransformer.js | 6 +- .../src/helpers/.eslintrc.json | 2 +- packages/transformers/sass/package.json | 12 +- .../transformers/sass/src/SassTransformer.js | 8 +- packages/transformers/stylus/package.json | 14 +- .../stylus/src/StylusTransformer.js | 25 +- packages/transformers/sugarss/package.json | 12 +- .../sugarss/src/SugarssTransformer.js | 2 +- packages/transformers/svg-react/package.json | 12 +- .../svg-react/src/SvgReactTransformer.js | 4 +- packages/transformers/svg/package.json | 16 +- .../transformers/svg/src/SVGTransformer.js | 6 +- packages/transformers/svg/src/dependencies.js | 2 +- packages/transformers/svg/src/inline.js | 26 +- packages/transformers/toml/package.json | 12 +- .../transformers/toml/src/TOMLTransformer.js | 2 +- .../transformers/typescript-tsc/package.json | 14 +- .../typescript-tsc/src/TSCTransformer.js | 4 +- .../typescript-types/package.json | 18 +- .../src/TSTypesTransformer.js | 16 +- .../typescript-types/src/collect.js | 2 +- packages/transformers/vue/package.json | 16 +- .../transformers/vue/src/VueTransformer.js | 22 +- .../transformers/webextension/package.json | 16 +- .../src/WebExtensionTransformer.js | 18 +- .../webextension/src/runtime/autoreload.js | 4 +- .../transformers/webextension/src/schema.js | 2 +- .../transformers/webmanifest/package.json | 16 +- .../webmanifest/src/WebManifestTransformer.js | 10 +- packages/transformers/worklet/package.json | 12 +- .../worklet/src/WorkletTransformer.js | 2 +- packages/transformers/xml/package.json | 12 +- .../transformers/xml/src/XMLTransformer.js | 2 +- packages/transformers/xml/src/atom.js | 10 +- .../xml/src/processing-instruction.js | 2 +- packages/transformers/xml/src/rss.js | 10 +- packages/transformers/xml/src/utils.js | 2 +- packages/transformers/yaml/package.json | 12 +- .../transformers/yaml/src/YAMLTransformer.js | 2 +- .../index.ts | 0 .../package.json | 8 +- .../src/index.js | 10 +- .../tsconfig.json | 0 .../{parcel-lsp => atlaspack-lsp}/.gitignore | 0 .../package.json | 12 +- .../src/LspServer.ts | 12 +- .../tsconfig.json | 0 .../README.md | 2 +- .../package.json | 6 +- .../src/index.js | 4 +- .../src/wrapper.js | 8 +- .../.eslintrc.json | 0 .../.gitignore | 0 .../.vscodeignore | 2 +- .../.yarnrc | 0 .../CHANGELOG.md | 0 .../CONTRIBUTING.md | 12 +- .../LICENSE | 0 packages/utils/atlaspackforvscode/README.md | 8 + .../logo.png | Bin .../package.json | 30 +- .../schemas/atlaspackrc.schema.json} | 6 +- .../schemas/package-targets.schema.json | 6 +- .../src/extension.ts | 15 +- .../src/importersView.ts | 2 +- .../utils/atlaspackforvscode/src/server.ts | 1 + .../atlaspackforvscode/src/test/runTest.ts | 23 + .../src/test/suite/extension.test.ts | 10 +- .../src/test/suite/index.ts | 38 ++ .../tsconfig.json | 0 .../vsc-extension-quickstart.md | 2 +- .../vscode-extension-TODO.md | 32 + .../yarn.lock | 0 .../package.json | 10 +- .../src/index.js | 8 +- .../babel-plugin-transform-runtime.test.js | 8 +- packages/utils/babel-preset-env/package.json | 8 +- packages/utils/babel-preset-env/src/index.js | 8 +- .../babel-preset-env/test/preset-env.test.js | 8 +- packages/utils/create-react-app/package.json | 8 +- packages/utils/create-react-app/src/bin.js | 4 +- packages/utils/create-react-app/src/cli.js | 10 +- .../templates/default/.gitignore | 2 +- .../templates/default/src/App.js | 4 +- .../src/{parcel => atlaspack}/back.png | Bin .../src/{parcel => atlaspack}/front.png | Bin .../src/{parcel => atlaspack}/index.css | 10 +- .../src/{parcel => atlaspack}/index.js | 14 +- .../src/{parcel => atlaspack}/logo.svg | 0 .../create-react-app/templates/package.json | 4 +- .../utils/dev-dep-resolver-old/Cargo.toml | 4 +- .../utils/dev-dep-resolver-old/src/lib.rs | 22 +- .../utils/dev-dep-resolver-old/src/main.rs | 16 +- packages/utils/dev-dep-resolver/Cargo.toml | 4 +- packages/utils/dev-dep-resolver/src/lib.rs | 22 +- packages/utils/dev-dep-resolver/src/main.rs | 16 +- packages/utils/events/package.json | 8 +- packages/utils/macros/macros.d.ts | 2 +- packages/utils/macros/package.json | 10 +- .../utils/node-resolver-core/package.json | 18 +- .../utils/node-resolver-core/src/Wrapper.js | 20 +- .../utils/node-resolver-core/src/index.js | 8 +- .../utils/node-resolver-core/test/resolver.js | 12 +- .../utils/node-resolver-rs-old/Cargo.toml | 6 +- .../utils/node-resolver-rs-old/src/cache.rs | 4 +- .../utils/node-resolver-rs-old/src/lib.rs | 20 +- .../node-resolver-rs-old/src/package_json.rs | 2 +- .../node-resolver-rs-old/src/specifier.rs | 2 +- packages/utils/node-resolver-rs/Cargo.toml | 8 +- .../benches/node_resolver_bench.rs | 26 +- packages/utils/node-resolver-rs/src/cache.rs | 4 +- packages/utils/node-resolver-rs/src/lib.rs | 20 +- .../node-resolver-rs/src/package_json.rs | 2 +- .../utils/node-resolver-rs/src/specifier.rs | 2 +- packages/utils/parcelforvscode/README.md | 8 - packages/utils/parcelforvscode/src/server.ts | 1 - .../utils/parcelforvscode/src/test/runTest.ts | 23 - .../parcelforvscode/src/test/suite/index.ts | 38 -- .../parcelforvscode/vscode-extension-TODO.md | 32 - packages/utils/service-worker/package.json | 10 +- packages/utils/ts-utils/package.json | 8 +- packages/utils/ts-utils/src/CompilerHost.js | 4 +- packages/utils/ts-utils/src/FSHost.js | 4 +- .../utils/ts-utils/src/LanguageServiceHost.js | 4 +- .../utils/ts-utils/src/ParseConfigHost.js | 4 +- packages/utils/ts-utils/src/loadTSConfig.js | 2 +- packages/validators/eslint/package.json | 16 +- .../validators/eslint/src/EslintValidator.js | 6 +- packages/validators/typescript/package.json | 20 +- .../typescript/src/TypeScriptValidator.js | 14 +- scripts/build-native.js | 2 +- scripts/to-fs-fixture.js | 10 +- scripts/update-config-dependencies.js | 8 +- scripts/update-engines-peerdeps.js | 10 +- 1258 files changed, 7369 insertions(+), 7516 deletions(-) create mode 100644 crates/atlaspack/Cargo.toml rename crates/{parcel/src/parcel.rs => atlaspack/src/atlaspack.rs} (73%) create mode 100644 crates/atlaspack/src/lib.rs rename crates/{parcel => atlaspack}/src/plugins.rs (79%) rename crates/{parcel => atlaspack}/src/plugins/config_plugins.rs (77%) rename crates/{parcel => atlaspack}/src/project_root.rs (98%) rename crates/{parcel => atlaspack}/src/request_tracker/mod.rs (100%) rename crates/{parcel => atlaspack}/src/request_tracker/request.rs (88%) rename crates/{parcel => atlaspack}/src/request_tracker/request_graph.rs (100%) rename crates/{parcel => atlaspack}/src/request_tracker/request_tracker.rs (95%) rename crates/{parcel => atlaspack}/src/request_tracker/test.rs (100%) rename crates/{parcel => atlaspack}/src/requests.rs (100%) rename crates/{parcel => atlaspack}/src/requests/asset_graph_request.rs (95%) rename crates/{parcel => atlaspack}/src/requests/asset_request.rs (88%) rename crates/{parcel => atlaspack}/src/requests/entry_request.rs (95%) rename crates/{parcel => atlaspack}/src/requests/path_request.rs (96%) rename crates/{parcel => atlaspack}/src/requests/target_request.rs (97%) rename crates/{parcel => atlaspack}/src/requests/target_request/package_json.rs (97%) rename crates/{parcel => atlaspack}/src/test_utils.rs (75%) rename crates/{parcel_config => atlaspack_config}/Cargo.toml (68%) rename crates/{parcel_config/src/parcel_config.rs => atlaspack_config/src/atlaspack_config.rs} (83%) rename crates/{parcel_config/src/parcel_config_fixtures.rs => atlaspack_config/src/atlaspack_config_fixtures.rs} (66%) rename crates/{parcel_config/src/parcel_rc.rs => atlaspack_config/src/atlaspack_rc.rs} (68%) rename crates/{parcel_config/src/parcel_rc_config_loader.rs => atlaspack_config/src/atlaspack_rc_config_loader.rs} (68%) create mode 100644 crates/atlaspack_config/src/lib.rs rename crates/{parcel_config => atlaspack_config}/src/map.rs (100%) rename crates/{parcel_config => atlaspack_config}/src/map/matcher.rs (100%) rename crates/{parcel_config => atlaspack_config}/src/map/named_pipelines_map.rs (95%) rename crates/{parcel_config => atlaspack_config}/src/map/pipeline_map.rs (86%) rename crates/{parcel_config => atlaspack_config}/src/map/pipelines_map.rs (86%) rename crates/{parcel_config/src/partial_parcel_config.rs => atlaspack_config/src/partial_atlaspack_config.rs} (78%) rename crates/{parcel_core => atlaspack_core}/Cargo.toml (78%) rename crates/{parcel_core => atlaspack_core}/src/asset_graph.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/bundle_graph.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/cache.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/config_loader.rs (98%) rename crates/{parcel_core => atlaspack_core}/src/hash.rs (85%) rename crates/{parcel_core => atlaspack_core}/src/lib.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/plugin.rs (96%) rename crates/{parcel_core => atlaspack_core}/src/plugin/bundler_plugin.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/plugin/compressor_plugin.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/plugin/namer_plugin.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/plugin/optimizer_plugin.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/plugin/packager_plugin.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/plugin/reporter_plugin.rs (91%) rename crates/{parcel_core => atlaspack_core}/src/plugin/reporter_plugin/composite_reporter_plugin.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/plugin/resolver_plugin.rs (97%) rename crates/{parcel_core => atlaspack_core}/src/plugin/runtime_plugin.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/plugin/transformer_plugin.rs (97%) rename crates/{parcel_core => atlaspack_core}/src/plugin/validator_plugin.rs (91%) rename crates/{parcel_core => atlaspack_core}/src/types.rs (85%) rename crates/{parcel_core => atlaspack_core}/src/types/asset.rs (97%) rename crates/{parcel_core/src/types/parcel_options.rs => atlaspack_core/src/types/atlaspack_options.rs} (91%) rename crates/{parcel_core => atlaspack_core}/src/types/bundle.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/bundle_graph.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/dependency.rs (98%) rename crates/{parcel_core => atlaspack_core}/src/types/diagnostic.rs (99%) rename crates/{parcel_core => atlaspack_core}/src/types/environment.rs (96%) rename crates/{parcel_core => atlaspack_core}/src/types/environment/browsers.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/environment/engines.rs (99%) rename crates/{parcel_core => atlaspack_core}/src/types/environment/output_format.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/environment/version.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/file.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/file_type.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/invalidation.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/json.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/package_json.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/source.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/symbol.rs (100%) rename crates/{parcel_core => atlaspack_core}/src/types/target.rs (93%) rename crates/{parcel_core => atlaspack_core}/src/types/utils.rs (100%) rename crates/{parcel_filesystem => atlaspack_filesystem}/Cargo.toml (73%) rename crates/{parcel_filesystem => atlaspack_filesystem}/src/in_memory_file_system.rs (99%) rename crates/{parcel_filesystem => atlaspack_filesystem}/src/lib.rs (100%) rename crates/{parcel_filesystem => atlaspack_filesystem}/src/os_file_system.rs (100%) rename crates/{parcel_filesystem => atlaspack_filesystem}/src/os_file_system/canonicalize.rs (100%) rename crates/{parcel_filesystem => atlaspack_filesystem}/src/search.rs (76%) rename crates/{parcel_monitoring => atlaspack_monitoring}/Cargo.toml (95%) create mode 100644 crates/atlaspack_monitoring/README.md rename crates/{parcel_monitoring => atlaspack_monitoring}/examples/sample_usage.rs (99%) rename crates/{parcel_monitoring => atlaspack_monitoring}/src/crash_reporter.rs (80%) rename crates/{parcel_monitoring => atlaspack_monitoring}/src/from_env.rs (100%) rename crates/{parcel_monitoring => atlaspack_monitoring}/src/lib.rs (100%) rename crates/{parcel_monitoring => atlaspack_monitoring}/src/sentry_integration.rs (77%) rename crates/{parcel_monitoring => atlaspack_monitoring}/src/tracer.rs (90%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/Cargo.toml (94%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/anyhow.rs (100%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/call_method.rs (100%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/console_log.rs (100%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/get_function.rs (100%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/js_callable/js_callable.rs (100%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/js_callable/js_value.rs (100%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/js_callable/mod.rs (100%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/js_callable/serde.rs (100%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/lib.rs (100%) rename crates/{parcel_napi_helpers => atlaspack_napi_helpers}/src/transferable.rs (100%) rename crates/{parcel_package_manager => atlaspack_package_manager}/Cargo.toml (56%) rename crates/{parcel_package_manager => atlaspack_package_manager}/src/lib.rs (100%) rename crates/{parcel_package_manager => atlaspack_package_manager}/src/node_package_manager.rs (73%) rename crates/{parcel_package_manager => atlaspack_package_manager}/src/package_manager.rs (100%) create mode 100644 crates/atlaspack_plugin_resolver/Cargo.toml rename crates/{parcel_plugin_resolver/src/parcel_resolver.rs => atlaspack_plugin_resolver/src/atlaspack_resolver.rs} (85%) create mode 100644 crates/atlaspack_plugin_resolver/src/lib.rs rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/Cargo.toml (57%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/lib.rs (100%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/nodejs/mod.rs (100%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/nodejs/rpc_conn_nodejs.rs (86%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/nodejs/rpc_conns_nodejs.rs (100%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/nodejs/rpc_host_nodejs.rs (100%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/bundler.rs (79%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/compressor.rs (77%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/mod.rs (100%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/namer.rs (75%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/optimizer.rs (73%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/packager.rs (73%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/reporter.rs (76%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/resolver.rs (71%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/runtime.rs (71%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/plugin/transformer.rs (76%) rename crates/{parcel_plugin_rpc => atlaspack_plugin_rpc}/src/rpc_host.rs (100%) create mode 100644 crates/atlaspack_plugin_transformer_js/Cargo.toml rename crates/{parcel_plugin_transformer_js => atlaspack_plugin_transformer_js}/src/lib.rs (57%) rename crates/{parcel_plugin_transformer_js => atlaspack_plugin_transformer_js}/src/transformer.rs (91%) rename crates/{parcel_plugin_transformer_js => atlaspack_plugin_transformer_js}/src/transformer/conversion.rs (94%) rename crates/{parcel_plugin_transformer_js => atlaspack_plugin_transformer_js}/src/transformer/conversion/dependency_kind.rs (91%) rename crates/{parcel_plugin_transformer_js => atlaspack_plugin_transformer_js}/src/transformer/conversion/loc.rs (74%) rename crates/{parcel_plugin_transformer_js => atlaspack_plugin_transformer_js}/src/transformer/conversion/symbol.rs (89%) rename crates/{parcel_plugin_transformer_js => atlaspack_plugin_transformer_js}/src/transformer/test_helpers.rs (57%) rename crates/{parcel_plugin_transformer_js => atlaspack_plugin_transformer_js}/src/ts_config.rs (100%) rename crates/node-bindings/src/{parcel/parcel.rs => atlaspack/atlaspack.rs} (72%) rename crates/node-bindings/src/{parcel => atlaspack}/mod.rs (77%) create mode 100644 crates/node-bindings/src/atlaspack/monitoring.rs rename crates/node-bindings/src/{parcel => atlaspack}/package_manager_napi.rs (84%) rename crates/node-bindings/src/{parcel => atlaspack}/worker.rs (93%) delete mode 100644 crates/node-bindings/src/parcel/monitoring.rs delete mode 100644 crates/parcel/Cargo.toml delete mode 100644 crates/parcel/src/lib.rs delete mode 100644 crates/parcel_config/src/lib.rs delete mode 100644 crates/parcel_monitoring/README.md delete mode 100644 crates/parcel_plugin_resolver/Cargo.toml delete mode 100644 crates/parcel_plugin_resolver/src/lib.rs delete mode 100644 crates/parcel_plugin_transformer_js/Cargo.toml rename packages/core/{parcel => atlaspack}/.npmignore (100%) rename packages/core/{parcel => atlaspack}/README.md (94%) rename packages/core/{parcel/bin/parcel.js => atlaspack/bin/atlaspack.js} (100%) rename packages/core/{parcel => atlaspack}/bin/dev-bin.js (100%) rename packages/core/{parcel => atlaspack}/ensure-no-dev-lib.sh (100%) create mode 100644 packages/core/atlaspack/package.json rename packages/core/{parcel => atlaspack}/src/.eslintrc.json (52%) create mode 100755 packages/core/atlaspack/src/bin.js rename packages/core/{parcel => atlaspack}/src/cli.js (89%) rename packages/core/core/src/{Parcel.js => Atlaspack.js} (86%) rename packages/core/core/src/{ParcelConfig.js => AtlaspackConfig.js} (83%) rename packages/core/core/src/{ParcelConfig.schema.js => AtlaspackConfig.schema.js} (75%) rename packages/core/core/src/{parcel-v3/ParcelV3.js => atlaspack-v3/AtlaspackV3.js} (76%) rename packages/core/core/src/{parcel-v3 => atlaspack-v3}/fs.js (83%) create mode 100644 packages/core/core/src/atlaspack-v3/index.js rename packages/core/core/src/{parcel-v3 => atlaspack-v3}/jsCallable.js (100%) rename packages/core/core/src/{parcel-v3 => atlaspack-v3}/plugins/Resolver.js (100%) rename packages/core/core/src/{parcel-v3 => atlaspack-v3}/plugins/index.js (100%) create mode 100644 packages/core/core/src/atlaspack-v3/worker/index.js rename packages/core/core/src/{parcel-v3 => atlaspack-v3}/worker/worker.js (58%) rename packages/core/core/src/{loadParcelPlugin.js => loadAtlaspackPlugin.js} (75%) delete mode 100644 packages/core/core/src/parcel-v3/index.js delete mode 100644 packages/core/core/src/parcel-v3/worker/index.js rename packages/core/core/src/requests/{ParcelBuildRequest.js => AtlaspackBuildRequest.js} (76%) rename packages/core/core/src/requests/{ParcelConfigRequest.js => AtlaspackConfigRequest.js} (81%) rename packages/core/core/test/{Parcel.test.js => Atlaspack.test.js} (58%) rename packages/core/core/test/{ParcelConfig.test.js => AtlaspackConfig.test.js} (71%) rename packages/core/core/test/{ParcelConfigRequest.test.js => AtlaspackConfigRequest.test.js} (64%) rename packages/core/core/test/fixtures/{parcel => atlaspack}/index.js (100%) rename packages/core/core/test/fixtures/{parcel => atlaspack}/other.js (100%) rename packages/core/core/test/fixtures/{parcel => atlaspack}/package.json (100%) rename packages/core/core/test/fixtures/{parcel => atlaspack}/yarn.lock (100%) create mode 100644 packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc create mode 100644 packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-json5 create mode 100644 packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-multiple create mode 100644 packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-node-modules delete mode 100644 packages/core/core/test/fixtures/config-extends-not-found/.parcelrc delete mode 100644 packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-json5 delete mode 100644 packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-multiple delete mode 100644 packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-node-modules rename packages/core/core/test/fixtures/config-malformed/{.parcelrc => .atlaspackrc} (100%) create mode 100644 packages/core/core/test/fixtures/config-node-pipeline/.atlaspackrc delete mode 100644 packages/core/core/test/fixtures/config-node-pipeline/.parcelrc create mode 100644 packages/core/core/test/fixtures/config-plugin-not-found/.atlaspackrc delete mode 100644 packages/core/core/test/fixtures/config-plugin-not-found/.parcelrc create mode 100644 packages/core/core/test/fixtures/config/.atlaspackrc delete mode 100644 packages/core/core/test/fixtures/config/.parcelrc create mode 100644 packages/core/core/test/fixtures/config/subfolder/.atlaspackrc delete mode 100644 packages/core/core/test/fixtures/config/subfolder/.parcelrc create mode 100644 packages/core/core/test/fixtures/local-plugin-config-pkg/.atlaspackrc delete mode 100644 packages/core/core/test/fixtures/local-plugin-config-pkg/.parcelrc rename packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/{parcel-config-local => atlaspack-config-local}/index.json (61%) rename packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/{parcel-config-local => atlaspack-config-local}/local-plugin.js (62%) create mode 100644 packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/package.json delete mode 100644 packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/package.json rename packages/core/core/test/fixtures/plugins/node_modules/{parcel-transformer-bad-engines => atlaspack-transformer-bad-engines}/index.js (62%) create mode 100644 packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-bad-engines/package.json rename packages/core/core/test/fixtures/plugins/node_modules/{parcel-transformer-no-engines => atlaspack-transformer-no-engines}/index.js (62%) create mode 100644 packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-no-engines/package.json delete mode 100644 packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-bad-engines/package.json delete mode 100644 packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-no-engines/package.json rename packages/core/integration-tests/test/{parcel-link.js => atlaspack-link.js} (51%) rename packages/core/integration-tests/test/{parcel-query.js => atlaspack-query.js} (82%) rename packages/core/integration-tests/test/{parcel-register.js => atlaspack-register.js} (71%) create mode 100644 packages/core/integration-tests/test/atlaspack-v3.js create mode 100644 packages/core/integration-tests/test/integration/atlaspack-register/.babelrc rename packages/core/integration-tests/test/integration/{parcel-register => atlaspack-register}/dispose-resolve.js (65%) rename packages/core/integration-tests/test/integration/{parcel-register => atlaspack-register}/dispose-transform.js (72%) create mode 100644 packages/core/integration-tests/test/integration/atlaspack-register/entry.js rename packages/core/integration-tests/test/integration/{parcel-register => atlaspack-register}/foo.js (100%) rename packages/core/integration-tests/test/integration/{parcel-register => atlaspack-register}/index.js (100%) rename packages/core/integration-tests/test/integration/{parcel-register => atlaspack-register}/resolver.js (100%) create mode 100644 packages/core/integration-tests/test/integration/atlaspackrc-custom/.atlaspackrc create mode 100644 packages/core/integration-tests/test/integration/atlaspackrc-custom/configCopy rename packages/core/integration-tests/test/integration/{parcelrc-custom => atlaspackrc-custom}/index.js (100%) rename packages/core/integration-tests/test/integration/{parcelrc-custom/node_modules/parcel-transformer-do-nothing => atlaspackrc-custom/node_modules/atlaspack-transformer-do-nothing}/index.js (58%) create mode 100644 packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-do-nothing/package.json rename packages/core/integration-tests/test/integration/{parcelrc-custom/node_modules/parcel-transformer-mock => atlaspackrc-custom/node_modules/atlaspack-transformer-mock}/index.js (72%) create mode 100644 packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-mock/package.json create mode 100644 packages/core/integration-tests/test/integration/atlaspackrc-custom/package.json rename packages/core/integration-tests/test/integration/{parcelrc-custom => atlaspackrc-custom}/yarn.lock (100%) create mode 100644 packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/.atlaspackrc rename packages/core/integration-tests/test/integration/{parcelrc-monorepo => atlaspackrc-monorepo}/app/icon.svg (100%) rename packages/core/integration-tests/test/integration/{parcelrc-monorepo => atlaspackrc-monorepo}/app/index.js (100%) rename packages/core/integration-tests/test/integration/{parcelrc-monorepo => atlaspackrc-monorepo}/app/package.json (100%) rename packages/core/integration-tests/test/integration/{parcelrc-monorepo => atlaspackrc-monorepo}/package.json (100%) rename packages/core/integration-tests/test/integration/{parcelrc-monorepo => atlaspackrc-monorepo}/yarn.lock (100%) create mode 100644 packages/core/integration-tests/test/integration/blob-url/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/blob-url/.parcelrc rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-bundler-test => atlaspack-bundler-test}/index.js (95%) create mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-bundler-test/package.json rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-compressor-test => atlaspack-compressor-test}/index.js (66%) create mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-compressor-test/package.json rename packages/core/integration-tests/test/integration/{incremental-bundling/node_modules/parcel-namer-test => cache/node_modules/atlaspack-namer-test}/index.js (68%) create mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-namer-test/package.json rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-optimizer-test => atlaspack-optimizer-test}/index.js (84%) create mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-optimizer-test/package.json rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-packager-test => atlaspack-packager-test}/index.js (84%) create mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-packager-test/package.json rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-resolver-test => atlaspack-resolver-test}/index.js (91%) create mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-resolver-test/package.json rename packages/core/integration-tests/test/integration/{incremental-bundling/node_modules/parcel-runtime-test => cache/node_modules/atlaspack-runtime-test}/index.js (81%) create mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-runtime-test/package.json rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-transformer-esm => atlaspack-transformer-esm}/constants.js (100%) rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-transformer-esm => atlaspack-transformer-esm}/data/a.js (100%) rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-transformer-esm => atlaspack-transformer-esm}/data/b.js (100%) rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-transformer-esm => atlaspack-transformer-esm}/dep.cjs (100%) rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-transformer-esm => atlaspack-transformer-esm}/index.js (92%) rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-transformer-esm => atlaspack-transformer-esm}/package.json (61%) rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-transformer-mock => atlaspack-transformer-mock}/constants.js (100%) rename packages/core/integration-tests/test/integration/cache/node_modules/{parcel-transformer-mock => atlaspack-transformer-mock}/index.js (84%) create mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-mock/package.json delete mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/parcel-bundler-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/parcel-compressor-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/parcel-namer-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/parcel-optimizer-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/parcel-packager-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/parcel-resolver-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/parcel-runtime-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-mock/package.json create mode 100644 packages/core/integration-tests/test/integration/compressors-disable-default/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/compressors-disable-default/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/compressors/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/compressors/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/config-merging/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/config-merging/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test1/index.json rename packages/core/integration-tests/test/integration/config-merging/node_modules/{parcel-config-test1 => atlaspack-config-test1}/package.json (56%) create mode 100644 packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test2/index.json rename packages/core/integration-tests/test/integration/config-merging/node_modules/{parcel-config-test2 => atlaspack-config-test2}/package.json (54%) rename packages/core/integration-tests/test/integration/config-merging/node_modules/{parcel-runtime-nothing => atlaspack-runtime-nothing}/index.js (77%) rename packages/core/integration-tests/test/integration/config-merging/node_modules/{parcel-runtime-nothing => atlaspack-runtime-nothing}/package.json (100%) rename packages/core/integration-tests/test/integration/config-merging/node_modules/{parcel-transformer-string => atlaspack-transformer-string}/index.js (75%) rename packages/core/integration-tests/test/integration/config-merging/node_modules/{parcel-transformer-string => atlaspack-transformer-string}/package.json (100%) delete mode 100644 packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test1/index.json delete mode 100644 packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test2/index.json create mode 100644 packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-build-metrics create mode 100644 packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-dev-server create mode 100644 packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-eslint create mode 100644 packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-json-reporter create mode 100644 packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-svg-react create mode 100644 packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-typescript-validation delete mode 100644 packages/core/integration-tests/test/integration/custom-configs/.parcelrc-build-metrics delete mode 100644 packages/core/integration-tests/test/integration/custom-configs/.parcelrc-dev-server delete mode 100644 packages/core/integration-tests/test/integration/custom-configs/.parcelrc-eslint delete mode 100644 packages/core/integration-tests/test/integration/custom-configs/.parcelrc-json-reporter delete mode 100644 packages/core/integration-tests/test/integration/custom-configs/.parcelrc-svg-react delete mode 100644 packages/core/integration-tests/test/integration/custom-configs/.parcelrc-typescript-validation rename packages/core/integration-tests/test/integration/data-url/{parcel.webp => atlaspack.webp} (100%) create mode 100644 packages/core/integration-tests/test/integration/glob-absolute/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob-absolute/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/glob-async/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob-async/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/glob-css/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob-css/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/glob-deep/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob-deep/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/glob-error/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob-error/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/glob-package-async/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob-package-async/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/glob-package/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob-package/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/glob-pipeline/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob-pipeline/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/glob-tilde/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob-tilde/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/glob/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/glob/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/included-file/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/included-file/.parcelrc rename packages/core/integration-tests/test/integration/included-file/node_modules/{parcel-transformer-included => atlaspack-transformer-included}/index.js (86%) create mode 100644 packages/core/integration-tests/test/integration/included-file/node_modules/atlaspack-transformer-included/package.json delete mode 100644 packages/core/integration-tests/test/integration/included-file/node_modules/parcel-transformer-included/package.json rename packages/core/integration-tests/test/integration/incremental-bundling/node_modules/{parcel-bundler-test => atlaspack-bundler-test}/index.js (95%) create mode 100644 packages/core/integration-tests/test/integration/incremental-bundling/node_modules/atlaspack-bundler-test/package.json rename packages/core/integration-tests/test/integration/{cache/node_modules/parcel-namer-test => incremental-bundling/node_modules/atlaspack-namer-test}/index.js (68%) create mode 100644 packages/core/integration-tests/test/integration/incremental-bundling/node_modules/atlaspack-namer-test/package.json rename packages/core/integration-tests/test/integration/{cache/node_modules/parcel-runtime-test => incremental-bundling/node_modules/atlaspack-runtime-test}/index.js (81%) create mode 100644 packages/core/integration-tests/test/integration/incremental-bundling/node_modules/atlaspack-runtime-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/incremental-bundling/node_modules/parcel-bundler-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/incremental-bundling/node_modules/parcel-namer-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/incremental-bundling/node_modules/parcel-runtime-test/package.json rename packages/core/integration-tests/test/integration/library-parallel-deps/{.parcelrc => .atlaspackrc} (53%) create mode 100644 packages/core/integration-tests/test/integration/multi-asset-transformer-export/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/multi-asset-transformer-export/.parcelrc rename packages/core/integration-tests/test/integration/multi-asset-transformer-export/node_modules/{parcel-transformer-test => atlaspack-transformer-test}/index.js (82%) create mode 100644 packages/core/integration-tests/test/integration/multi-asset-transformer-export/node_modules/atlaspack-transformer-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/multi-asset-transformer-export/node_modules/parcel-transformer-test/package.json create mode 100644 packages/core/integration-tests/test/integration/multi-asset-transformer/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/multi-asset-transformer/.parcelrc rename packages/core/integration-tests/test/integration/multi-asset-transformer/node_modules/{parcel-transformer-test => atlaspack-transformer-test}/index.js (81%) create mode 100644 packages/core/integration-tests/test/integration/multi-asset-transformer/node_modules/atlaspack-transformer-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/multi-asset-transformer/node_modules/parcel-transformer-test/package.json create mode 100644 packages/core/integration-tests/test/integration/optimizer-changing-type/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/optimizer-changing-type/.parcelrc rename packages/core/integration-tests/test/integration/optimizer-changing-type/node_modules/{parcel-optimizer-changing-type => atlaspack-optimizer-changing-type}/ChangingTypeOptimizer.js (70%) rename packages/core/integration-tests/test/integration/optimizer-changing-type/node_modules/{parcel-optimizer-changing-type => atlaspack-optimizer-changing-type}/package.json (54%) create mode 100644 packages/core/integration-tests/test/integration/packager-loadBundleConfig/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/packager-loadBundleConfig/.parcelrc rename packages/core/integration-tests/test/integration/packager-loadBundleConfig/node_modules/{parcel-packager-config => atlaspack-packager-config}/index.js (92%) create mode 100644 packages/core/integration-tests/test/integration/packager-loadBundleConfig/node_modules/atlaspack-packager-config/package.json delete mode 100644 packages/core/integration-tests/test/integration/packager-loadBundleConfig/node_modules/parcel-packager-config/package.json create mode 100644 packages/core/integration-tests/test/integration/packager-loadConfig/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/packager-loadConfig/.parcelrc rename packages/core/integration-tests/test/integration/packager-loadConfig/node_modules/{parcel-packager-config => atlaspack-packager-config}/index.js (81%) create mode 100644 packages/core/integration-tests/test/integration/packager-loadConfig/node_modules/atlaspack-packager-config/package.json delete mode 100644 packages/core/integration-tests/test/integration/packager-loadConfig/node_modules/parcel-packager-config/package.json delete mode 100644 packages/core/integration-tests/test/integration/parcel-register/.babelrc delete mode 100644 packages/core/integration-tests/test/integration/parcel-register/entry.js delete mode 100644 packages/core/integration-tests/test/integration/parcelrc-custom/.parcelrc delete mode 100644 packages/core/integration-tests/test/integration/parcelrc-custom/configCopy delete mode 100644 packages/core/integration-tests/test/integration/parcelrc-custom/node_modules/parcel-transformer-do-nothing/package.json delete mode 100644 packages/core/integration-tests/test/integration/parcelrc-custom/node_modules/parcel-transformer-mock/package.json delete mode 100644 packages/core/integration-tests/test/integration/parcelrc-custom/package.json delete mode 100644 packages/core/integration-tests/test/integration/parcelrc-monorepo/app/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/node_modules/atlaspack-transformer-a/index.js create mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/node_modules/atlaspack-transformer-a/package.json create mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/node_modules/atlaspack-transformer-b/index.js create mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/node_modules/atlaspack-transformer-b/package.json delete mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/node_modules/parcel-transformer-a/index.js delete mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/node_modules/parcel-transformer-a/package.json delete mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/node_modules/parcel-transformer-b/index.js delete mode 100644 packages/core/integration-tests/test/integration/pipeline-type-change/node_modules/parcel-transformer-b/package.json create mode 100644 packages/core/integration-tests/test/integration/reporters-failure/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/reporters-failure/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/reporters-load-failure/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/reporters-load-failure/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/reporters-success/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/reporters-success/.parcelrc rename packages/core/integration-tests/test/integration/require-async/{parcel.js => atlaspack.js} (100%) create mode 100644 packages/core/integration-tests/test/integration/resolver-can-invalidateonenvchange/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/resolver-can-invalidateonenvchange/.parcelrc rename packages/core/integration-tests/test/integration/resolver-can-invalidateonenvchange/node_modules/{parcel-resolver-can-invalidateonenvchange => atlaspack-resolver-can-invalidateonenvchange}/index.js (85%) rename packages/core/integration-tests/test/integration/resolver-can-invalidateonenvchange/node_modules/{parcel-resolver-can-invalidateonenvchange => atlaspack-resolver-can-invalidateonenvchange}/package.json (54%) create mode 100644 packages/core/integration-tests/test/integration/resolver-canDefer/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/resolver-canDefer/.parcelrc rename packages/core/integration-tests/test/integration/resolver-canDefer/node_modules/{parcel-bundler-no-defer => atlaspack-bundler-no-defer}/index.js (96%) rename packages/core/integration-tests/test/integration/{resolver-dependency-meta/node_modules/parcel-resolver-meta => resolver-canDefer/node_modules/atlaspack-bundler-no-defer}/package.json (53%) rename packages/core/integration-tests/test/integration/resolver-canDefer/node_modules/{parcel-resolver-no-defer => atlaspack-resolver-no-defer}/index.js (86%) rename packages/core/integration-tests/test/integration/{resolver-dependency-meta/node_modules/parcel-runtime-meta => resolver-canDefer/node_modules/atlaspack-resolver-no-defer}/package.json (52%) create mode 100644 packages/core/integration-tests/test/integration/resolver-dependency-meta/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/resolver-dependency-meta/.parcelrc rename packages/core/integration-tests/test/integration/resolver-dependency-meta/node_modules/{parcel-resolver-meta => atlaspack-resolver-meta}/index.js (79%) rename packages/core/integration-tests/test/integration/{resolver-canDefer/node_modules/parcel-bundler-no-defer => resolver-dependency-meta/node_modules/atlaspack-resolver-meta}/package.json (54%) rename packages/core/integration-tests/test/integration/resolver-dependency-meta/node_modules/{parcel-runtime-meta => atlaspack-runtime-meta}/index.js (90%) rename packages/core/integration-tests/test/integration/{resolver-canDefer/node_modules/parcel-resolver-no-defer => resolver-dependency-meta/node_modules/atlaspack-runtime-meta}/package.json (54%) create mode 100644 packages/core/integration-tests/test/integration/runtime-deferred-excluded/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/runtime-deferred-excluded/.parcelrc rename packages/core/integration-tests/test/integration/runtime-deferred-excluded/node_modules/{parcel-runtime-test => atlaspack-runtime-test}/index.js (86%) create mode 100644 packages/core/integration-tests/test/integration/runtime-deferred-excluded/node_modules/atlaspack-runtime-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/runtime-deferred-excluded/node_modules/parcel-runtime-test/package.json create mode 100644 packages/core/integration-tests/test/integration/runtime-symbol-merging/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/runtime-symbol-merging/.parcelrc rename packages/core/integration-tests/test/integration/runtime-symbol-merging/node_modules/{parcel-runtime-mock => atlaspack-runtime-mock}/index.js (82%) create mode 100644 packages/core/integration-tests/test/integration/runtime-symbol-merging/node_modules/atlaspack-runtime-mock/package.json delete mode 100644 packages/core/integration-tests/test/integration/runtime-symbol-merging/node_modules/parcel-runtime-mock/package.json create mode 100644 packages/core/integration-tests/test/integration/runtime-update/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/runtime-update/.parcelrc rename packages/core/integration-tests/test/integration/runtime-update/node_modules/{parcel-runtime-mock => atlaspack-runtime-mock}/index.js (84%) create mode 100644 packages/core/integration-tests/test/integration/runtime-update/node_modules/atlaspack-runtime-mock/package.json delete mode 100644 packages/core/integration-tests/test/integration/runtime-update/node_modules/parcel-runtime-mock/package.json create mode 100644 packages/core/integration-tests/test/integration/scope-hoisting/es6/update-used-symbols-dependency-add-inline/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/scope-hoisting/es6/update-used-symbols-dependency-add-inline/.parcelrc rename packages/core/integration-tests/test/integration/scope-hoisting/es6/update-used-symbols-dependency-add-inline/node_modules/{parcel-transformer-test => atlaspack-transformer-test}/index.js (89%) create mode 100644 packages/core/integration-tests/test/integration/scope-hoisting/es6/update-used-symbols-dependency-add-inline/node_modules/atlaspack-transformer-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/scope-hoisting/es6/update-used-symbols-dependency-add-inline/node_modules/parcel-transformer-test/package.json create mode 100644 packages/core/integration-tests/test/integration/sourcemap-typescript-tsc/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/sourcemap-typescript-tsc/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/terser-codeframe/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/terser-codeframe/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/typescript-config-extends/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/typescript-config-extends/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/typescript-config/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/typescript-config/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/typescript-types-atlaspackrc/.atlaspackrc rename packages/core/integration-tests/test/integration/{typescript-types-parcelrc => typescript-types-atlaspackrc}/index.ts (100%) rename packages/core/integration-tests/test/integration/{typescript-types-parcelrc => typescript-types-atlaspackrc}/package.json (66%) rename packages/core/integration-tests/test/integration/{typescript-types-parcelrc => typescript-types-atlaspackrc}/yarn.lock (100%) delete mode 100644 packages/core/integration-tests/test/integration/typescript-types-parcelrc/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/wasm-sourcemap-transformer/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/wasm-sourcemap-transformer/.parcelrc rename packages/core/integration-tests/test/integration/wasm-sourcemap-transformer/node_modules/{parcel-transformer-test => atlaspack-transformer-test}/index.js (88%) create mode 100644 packages/core/integration-tests/test/integration/wasm-sourcemap-transformer/node_modules/atlaspack-transformer-test/package.json delete mode 100644 packages/core/integration-tests/test/integration/wasm-sourcemap-transformer/node_modules/parcel-transformer-test/package.json create mode 100644 packages/core/integration-tests/test/integration/webextension-mv3/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/webextension-mv3/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/webextension-resolve-web-accessible-resources/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/webextension-resolve-web-accessible-resources/.parcelrc create mode 100644 packages/core/integration-tests/test/integration/webextension/.atlaspackrc delete mode 100644 packages/core/integration-tests/test/integration/webextension/.parcelrc delete mode 100644 packages/core/integration-tests/test/parcel-v3.js delete mode 100644 packages/core/parcel/package.json delete mode 100755 packages/core/parcel/src/bin.js create mode 100644 packages/core/test-utils/src/.atlaspackrc-no-reporters delete mode 100644 packages/core/test-utils/src/.parcelrc-no-reporters create mode 100644 packages/dev/atlaspack-link/README.md rename packages/dev/{parcel-link => atlaspack-link}/bin.js (89%) create mode 100644 packages/dev/atlaspack-link/package.json rename packages/dev/{parcel-link/src/ParcelLinkConfig.js => atlaspack-link/src/AtlaspackLinkConfig.js} (86%) rename packages/dev/{parcel-link => atlaspack-link}/src/cli.js (92%) rename packages/dev/{parcel-link => atlaspack-link}/src/index.js (81%) rename packages/dev/{parcel-link => atlaspack-link}/src/link.js (60%) rename packages/dev/{parcel-link => atlaspack-link}/src/unlink.js (70%) rename packages/dev/{parcel-link => atlaspack-link}/src/utils.js (84%) rename packages/dev/esm-fuzzer/{parcel.js => atlaspack.js} (84%) delete mode 100644 packages/dev/parcel-link/README.md delete mode 100644 packages/dev/parcel-link/package.json rename packages/dev/query/bin/{parcel-query.js => atlaspack-query.js} (100%) rename packages/dev/repl/src/assets/{parcel.png => atlaspack.png} (100%) rename packages/dev/repl/src/{parcel/ParcelWorker.js => atlaspack/AtlaspackWorker.js} (92%) rename packages/dev/repl/src/{parcel => atlaspack}/BrowserPackageManager.js (56%) rename packages/dev/repl/src/{parcel => atlaspack}/ExtendedMemoryFS.js (98%) rename packages/dev/repl/src/{parcel => atlaspack}/index.js (94%) rename packages/dev/repl/src/{parcel => atlaspack}/yarn.js (99%) create mode 100644 packages/examples/eslint-example/.atlaspackrc delete mode 100644 packages/examples/eslint-example/.parcelrc create mode 100644 packages/examples/kitchen-sink/.atlaspackrc delete mode 100644 packages/examples/kitchen-sink/.parcelrc rename packages/examples/kitchen-sink/src/{parcel.webp => atlaspack.webp} (100%) create mode 100644 packages/examples/simple/.atlaspackrc delete mode 100644 packages/examples/simple/.parcelrc create mode 100644 packages/examples/three/.atlaspackrc delete mode 100644 packages/examples/three/.parcelrc create mode 100644 packages/examples/ts-typecheck-example/.atlaspackrc delete mode 100644 packages/examples/ts-typecheck-example/.parcelrc rename packages/utils/{parcel-lsp-protocol => atlaspack-lsp-protocol}/index.ts (100%) rename packages/utils/{parcel-lsp-protocol => atlaspack-lsp-protocol}/package.json (71%) rename packages/utils/{parcel-lsp-protocol => atlaspack-lsp-protocol}/src/index.js (86%) rename packages/utils/{parcel-lsp-protocol => atlaspack-lsp-protocol}/tsconfig.json (100%) rename packages/utils/{parcel-lsp => atlaspack-lsp}/.gitignore (100%) rename packages/utils/{parcel-lsp => atlaspack-lsp}/package.json (78%) rename packages/utils/{parcel-lsp => atlaspack-lsp}/src/LspServer.ts (96%) rename packages/utils/{parcel-lsp => atlaspack-lsp}/tsconfig.json (100%) rename packages/utils/{parcel-watcher-watchman-js => atlaspack-watcher-watchman-js}/README.md (88%) rename packages/utils/{parcel-watcher-watchman-js => atlaspack-watcher-watchman-js}/package.json (69%) rename packages/utils/{parcel-watcher-watchman-js => atlaspack-watcher-watchman-js}/src/index.js (71%) rename packages/utils/{parcel-watcher-watchman-js => atlaspack-watcher-watchman-js}/src/wrapper.js (96%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/.eslintrc.json (100%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/.gitignore (100%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/.vscodeignore (88%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/.yarnrc (100%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/CHANGELOG.md (100%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/CONTRIBUTING.md (67%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/LICENSE (100%) create mode 100644 packages/utils/atlaspackforvscode/README.md rename packages/utils/{parcelforvscode => atlaspackforvscode}/logo.png (100%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/package.json (79%) rename packages/utils/{parcelforvscode/schemas/parcelrc.schema.json => atlaspackforvscode/schemas/atlaspackrc.schema.json} (94%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/schemas/package-targets.schema.json (93%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/src/extension.ts (87%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/src/importersView.ts (96%) create mode 100644 packages/utils/atlaspackforvscode/src/server.ts create mode 100644 packages/utils/atlaspackforvscode/src/test/runTest.ts rename packages/utils/{parcelforvscode => atlaspackforvscode}/src/test/suite/extension.test.ts (57%) create mode 100644 packages/utils/atlaspackforvscode/src/test/suite/index.ts rename packages/utils/{parcelforvscode => atlaspackforvscode}/tsconfig.json (100%) rename packages/utils/{parcelforvscode => atlaspackforvscode}/vsc-extension-quickstart.md (95%) create mode 100644 packages/utils/atlaspackforvscode/vscode-extension-TODO.md rename packages/utils/{parcelforvscode => atlaspackforvscode}/yarn.lock (100%) rename packages/utils/create-react-app/templates/default/src/{parcel => atlaspack}/back.png (100%) rename packages/utils/create-react-app/templates/default/src/{parcel => atlaspack}/front.png (100%) rename packages/utils/create-react-app/templates/default/src/{parcel => atlaspack}/index.css (70%) rename packages/utils/create-react-app/templates/default/src/{parcel => atlaspack}/index.js (58%) rename packages/utils/create-react-app/templates/default/src/{parcel => atlaspack}/logo.svg (100%) delete mode 100644 packages/utils/parcelforvscode/README.md delete mode 100644 packages/utils/parcelforvscode/src/server.ts delete mode 100644 packages/utils/parcelforvscode/src/test/runTest.ts delete mode 100644 packages/utils/parcelforvscode/src/test/suite/index.ts delete mode 100644 packages/utils/parcelforvscode/vscode-extension-TODO.md diff --git a/.eslintrc.json b/.eslintrc.json index 9d24a6c42..dbbf22877 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "@parcel/eslint-config" + "extends": "@atlaspack/eslint-config" } diff --git a/.flowconfig b/.flowconfig index dafbedb00..af6c3db46 100644 --- a/.flowconfig +++ b/.flowconfig @@ -5,7 +5,7 @@ .*/node_modules/resolve/test/**/.* /.nyc_output/.* .*/tmp/**/.* -.*/.parcel-cache/.* +.*/.atlaspack-cache/.* /packages/core/integration-tests/dist/** /packages/core/integration-tests/test/input/** /packages/core/integration-tests/test/integration/babel-strip-flow-types/** diff --git a/.gitignore b/.gitignore index 2fd3023fe..306522600 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .cache/ .idea/ .nyc_output/ -.parcel-cache/ +.atlaspack-cache/ .verdaccio_storage/ .vscode/* !.vscode/extensions.json @@ -10,7 +10,6 @@ dist/ lib/ logs/ node_modules/ -parcel-bundle-reports/ tmp /target/ diff --git a/.mocharc.json b/.mocharc.json index 090b32f35..b75f693a3 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,6 +1,9 @@ { "spec": "packages/*/!(integration-tests)/test/{*.js,**/*.{test,spec}.js}", - "require": ["@parcel/babel-register", "@parcel/test-utils/src/mochaSetup.js"], + "require": [ + "@atlaspack/babel-register", + "@atlaspack/test-utils/src/mochaSetup.js" + ], // TODO: Remove this when https://github.com/nodejs/node/pull/28788 is resolved "exit": true } diff --git a/.prettierignore b/.prettierignore index a39f9ef85..5e12a29bc 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,12 +5,12 @@ packages/*/*/test/input packages/*/*/test/dist packages/*/*/test/mochareporters.json packages/*/*/test/fixtures -packages/*/*/test/.parcel-cache +packages/*/*/test/.atlaspack-cache vendor tmp -.parcel-cache +.atlaspack-cache # 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/parcel/README.md +/packages/core/atlaspack/README.md diff --git a/.vscode/launch.json b/.vscode/launch.json index 498e98fa8..b643a8879 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,11 +15,11 @@ }, { "args": [ - "--extensionDevelopmentPath=${workspaceFolder}/packages/utils/parcelforvscode" + "--extensionDevelopmentPath=${workspaceFolder}/packages/utils/atlaspackforvscode" ], - "name": "Launch Parcel for VSCode Extension", + "name": "Launch atlaspack for VSCode Extension", "outFiles": [ - "${workspaceFolder}/packages/utils/parcelforvscode/out/**/*.js" + "${workspaceFolder}/packages/utils/atlaspackforvscode/out/**/*.js" ], "preLaunchTask": "Watch VSCode Extension", "request": "launch", diff --git a/Cargo.lock b/Cargo.lock index c6e0ec759..252baf210 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,6 +119,317 @@ dependencies = [ "syn", ] +[[package]] +name = "atlaspack" +version = "0.1.0" +dependencies = [ + "anyhow", + "atlaspack-resolver", + "atlaspack_config", + "atlaspack_core", + "atlaspack_filesystem", + "atlaspack_package_manager", + "atlaspack_plugin_resolver", + "atlaspack_plugin_rpc", + "atlaspack_plugin_transformer_js", + "dyn-hash", + "mockall", + "num_cpus", + "pathdiff", + "petgraph", + "rand", + "rayon", + "regex", + "serde", + "serde-bool", + "serde_json", + "tracing", + "tracing-subscriber", + "xxhash-rust", +] + +[[package]] +name = "atlaspack-dev-dep-resolver" +version = "0.1.0" +dependencies = [ + "atlaspack-resolver", + "dashmap", + "es-module-lexer", + "glob", + "rayon", + "serde_json", +] + +[[package]] +name = "atlaspack-dev-dep-resolver-old" +version = "0.1.0" +dependencies = [ + "atlaspack-resolver-old", + "dashmap", + "es-module-lexer", + "glob", + "rayon", + "serde_json", +] + +[[package]] +name = "atlaspack-js-swc-core" +version = "0.1.0" +dependencies = [ + "Inflector", + "atlaspack-macros", + "data-encoding", + "dunce", + "indexmap 1.9.3", + "indoc", + "parking_lot", + "path-slash", + "pathdiff", + "serde", + "serde_bytes", + "sha-1", + "swc_core", +] + +[[package]] +name = "atlaspack-macros" +version = "0.1.0" +dependencies = [ + "crossbeam-channel", + "indexmap 1.9.3", + "napi", + "napi-derive", + "serde", + "swc_core", +] + +[[package]] +name = "atlaspack-node-bindings" +version = "0.1.0" +dependencies = [ + "anyhow", + "atlaspack", + "atlaspack-dev-dep-resolver", + "atlaspack-dev-dep-resolver-old", + "atlaspack-js-swc-core", + "atlaspack-macros", + "atlaspack-resolver", + "atlaspack-resolver-old", + "atlaspack_core", + "atlaspack_monitoring", + "atlaspack_napi_helpers", + "atlaspack_package_manager", + "atlaspack_plugin_transformer_js", + "crossbeam-channel", + "dashmap", + "getrandom", + "glob", + "indexmap 1.9.3", + "jemallocator", + "libc", + "log", + "mimalloc", + "mockall", + "mozjpeg-sys", + "napi", + "napi-build", + "napi-derive", + "num_cpus", + "once_cell", + "oxipng", + "parking_lot", + "rayon", + "serde", + "serde_json", + "toml", + "tracing", + "tracing-appender", + "tracing-subscriber", + "xxhash-rust", +] + +[[package]] +name = "atlaspack-resolver" +version = "0.1.0" +dependencies = [ + "assert_fs", + "atlaspack-resolver-old", + "atlaspack_core", + "atlaspack_filesystem", + "bitflags 1.3.2", + "criterion", + "dashmap", + "glob-match", + "indexmap 1.9.3", + "is_elevated", + "itertools 0.10.5", + "json_comments", + "once_cell", + "parking_lot", + "percent-encoding", + "serde", + "serde_json", + "serde_json5", + "thiserror", + "tracing", + "tracing-subscriber", + "url", + "xxhash-rust", +] + +[[package]] +name = "atlaspack-resolver-old" +version = "0.1.0" +dependencies = [ + "assert_fs", + "atlaspack_core", + "atlaspack_filesystem", + "bitflags 1.3.2", + "dashmap", + "elsa", + "glob-match", + "indexmap 1.9.3", + "is_elevated", + "itertools 0.10.5", + "json_comments", + "once_cell", + "parking_lot", + "percent-encoding", + "serde", + "serde_json", + "thiserror", + "tracing", + "typed-arena", + "url", + "xxhash-rust", +] + +[[package]] +name = "atlaspack_config" +version = "0.1.0" +dependencies = [ + "anyhow", + "atlaspack_core", + "atlaspack_filesystem", + "atlaspack_package_manager", + "derive_builder", + "glob-match", + "indexmap 2.2.6", + "mockall", + "pathdiff", + "serde", + "serde_json5", +] + +[[package]] +name = "atlaspack_core" +version = "0.1.0" +dependencies = [ + "anyhow", + "atlaspack_filesystem", + "bitflags 2.6.0", + "browserslist-rs", + "derive_builder", + "dyn-hash", + "mockall", + "nodejs-semver", + "petgraph", + "serde", + "serde-value", + "serde_json", + "serde_repr", + "xxhash-rust", +] + +[[package]] +name = "atlaspack_filesystem" +version = "0.1.0" +dependencies = [ + "anyhow", + "assert_fs", + "dashmap", + "is_elevated", + "mockall", + "xxhash-rust", +] + +[[package]] +name = "atlaspack_monitoring" +version = "0.1.0" +dependencies = [ + "anyhow", + "cfg-if", + "crash-handler", + "minidumper", + "sentry", + "serde", + "serde_json", + "thiserror", + "tracing", + "tracing-appender", + "tracing-subscriber", + "whoami", +] + +[[package]] +name = "atlaspack_napi_helpers" +version = "0.1.0" +dependencies = [ + "anyhow", + "napi", + "napi-build", + "once_cell", + "serde", +] + +[[package]] +name = "atlaspack_package_manager" +version = "0.1.0" +dependencies = [ + "anyhow", + "atlaspack-resolver", + "atlaspack_filesystem", + "mockall", + "serde", +] + +[[package]] +name = "atlaspack_plugin_resolver" +version = "0.1.0" +dependencies = [ + "anyhow", + "atlaspack-resolver", + "atlaspack_core", + "atlaspack_filesystem", +] + +[[package]] +name = "atlaspack_plugin_rpc" +version = "0.1.0" +dependencies = [ + "anyhow", + "atlaspack_config", + "atlaspack_core", + "atlaspack_napi_helpers", + "napi", + "once_cell", + "parking_lot", + "serde", +] + +[[package]] +name = "atlaspack_plugin_transformer_js" +version = "0.1.0" +dependencies = [ + "anyhow", + "atlaspack-js-swc-core", + "atlaspack_core", + "atlaspack_filesystem", + "indexmap 2.2.6", + "serde", + "swc_core", +] + [[package]] name = "atty" version = "0.2.14" @@ -2008,317 +2319,6 @@ dependencies = [ "zopfli", ] -[[package]] -name = "parcel" -version = "0.1.0" -dependencies = [ - "anyhow", - "dyn-hash", - "mockall", - "num_cpus", - "parcel-resolver", - "parcel_config", - "parcel_core", - "parcel_filesystem", - "parcel_package_manager", - "parcel_plugin_resolver", - "parcel_plugin_rpc", - "parcel_plugin_transformer_js", - "pathdiff", - "petgraph", - "rand", - "rayon", - "regex", - "serde", - "serde-bool", - "serde_json", - "tracing", - "tracing-subscriber", - "xxhash-rust", -] - -[[package]] -name = "parcel-dev-dep-resolver" -version = "0.1.0" -dependencies = [ - "dashmap", - "es-module-lexer", - "glob", - "parcel-resolver", - "rayon", - "serde_json", -] - -[[package]] -name = "parcel-dev-dep-resolver-old" -version = "0.1.0" -dependencies = [ - "dashmap", - "es-module-lexer", - "glob", - "parcel-resolver-old", - "rayon", - "serde_json", -] - -[[package]] -name = "parcel-js-swc-core" -version = "0.1.0" -dependencies = [ - "Inflector", - "data-encoding", - "dunce", - "indexmap 1.9.3", - "indoc", - "parcel-macros", - "parking_lot", - "path-slash", - "pathdiff", - "serde", - "serde_bytes", - "sha-1", - "swc_core", -] - -[[package]] -name = "parcel-macros" -version = "0.1.0" -dependencies = [ - "crossbeam-channel", - "indexmap 1.9.3", - "napi", - "napi-derive", - "serde", - "swc_core", -] - -[[package]] -name = "parcel-node-bindings" -version = "0.1.0" -dependencies = [ - "anyhow", - "crossbeam-channel", - "dashmap", - "getrandom", - "glob", - "indexmap 1.9.3", - "jemallocator", - "libc", - "log", - "mimalloc", - "mockall", - "mozjpeg-sys", - "napi", - "napi-build", - "napi-derive", - "num_cpus", - "once_cell", - "oxipng", - "parcel", - "parcel-dev-dep-resolver", - "parcel-dev-dep-resolver-old", - "parcel-js-swc-core", - "parcel-macros", - "parcel-resolver", - "parcel-resolver-old", - "parcel_core", - "parcel_monitoring", - "parcel_napi_helpers", - "parcel_package_manager", - "parcel_plugin_transformer_js", - "parking_lot", - "rayon", - "serde", - "serde_json", - "toml", - "tracing", - "tracing-appender", - "tracing-subscriber", - "xxhash-rust", -] - -[[package]] -name = "parcel-resolver" -version = "0.1.0" -dependencies = [ - "assert_fs", - "bitflags 1.3.2", - "criterion", - "dashmap", - "glob-match", - "indexmap 1.9.3", - "is_elevated", - "itertools 0.10.5", - "json_comments", - "once_cell", - "parcel-resolver-old", - "parcel_core", - "parcel_filesystem", - "parking_lot", - "percent-encoding", - "serde", - "serde_json", - "serde_json5", - "thiserror", - "tracing", - "tracing-subscriber", - "url", - "xxhash-rust", -] - -[[package]] -name = "parcel-resolver-old" -version = "0.1.0" -dependencies = [ - "assert_fs", - "bitflags 1.3.2", - "dashmap", - "elsa", - "glob-match", - "indexmap 1.9.3", - "is_elevated", - "itertools 0.10.5", - "json_comments", - "once_cell", - "parcel_core", - "parcel_filesystem", - "parking_lot", - "percent-encoding", - "serde", - "serde_json", - "thiserror", - "tracing", - "typed-arena", - "url", - "xxhash-rust", -] - -[[package]] -name = "parcel_config" -version = "0.1.0" -dependencies = [ - "anyhow", - "derive_builder", - "glob-match", - "indexmap 2.2.6", - "mockall", - "parcel_core", - "parcel_filesystem", - "parcel_package_manager", - "pathdiff", - "serde", - "serde_json5", -] - -[[package]] -name = "parcel_core" -version = "0.1.0" -dependencies = [ - "anyhow", - "bitflags 2.6.0", - "browserslist-rs", - "derive_builder", - "dyn-hash", - "mockall", - "nodejs-semver", - "parcel_filesystem", - "petgraph", - "serde", - "serde-value", - "serde_json", - "serde_repr", - "xxhash-rust", -] - -[[package]] -name = "parcel_filesystem" -version = "0.1.0" -dependencies = [ - "anyhow", - "assert_fs", - "dashmap", - "is_elevated", - "mockall", - "xxhash-rust", -] - -[[package]] -name = "parcel_monitoring" -version = "0.1.0" -dependencies = [ - "anyhow", - "cfg-if", - "crash-handler", - "minidumper", - "sentry", - "serde", - "serde_json", - "thiserror", - "tracing", - "tracing-appender", - "tracing-subscriber", - "whoami", -] - -[[package]] -name = "parcel_napi_helpers" -version = "0.1.0" -dependencies = [ - "anyhow", - "napi", - "napi-build", - "once_cell", - "serde", -] - -[[package]] -name = "parcel_package_manager" -version = "0.1.0" -dependencies = [ - "anyhow", - "mockall", - "parcel-resolver", - "parcel_filesystem", - "serde", -] - -[[package]] -name = "parcel_plugin_resolver" -version = "0.1.0" -dependencies = [ - "anyhow", - "parcel-resolver", - "parcel_core", - "parcel_filesystem", -] - -[[package]] -name = "parcel_plugin_rpc" -version = "0.1.0" -dependencies = [ - "anyhow", - "napi", - "once_cell", - "parcel_config", - "parcel_core", - "parcel_napi_helpers", - "parking_lot", - "serde", -] - -[[package]] -name = "parcel_plugin_transformer_js" -version = "0.1.0" -dependencies = [ - "anyhow", - "indexmap 2.2.6", - "parcel-js-swc-core", - "parcel_core", - "parcel_filesystem", - "serde", - "swc_core", -] - [[package]] name = "parking_lot" version = "0.12.3" diff --git a/babel.config.json b/babel.config.json index be26495ef..bfabf3864 100644 --- a/babel.config.json +++ b/babel.config.json @@ -1,3 +1,3 @@ { - "presets": ["@parcel/babel-preset"] + "presets": ["@atlaspack/babel-preset"] } diff --git a/crates/atlaspack/Cargo.toml b/crates/atlaspack/Cargo.toml new file mode 100644 index 000000000..be01d1ac1 --- /dev/null +++ b/crates/atlaspack/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "atlaspack" +version = "0.1.0" +edition = "2021" +description = "Atlaspack Bundler" + +[features] +nodejs = ["atlaspack_plugin_rpc/nodejs"] + +[dependencies] +atlaspack_config = { path = "../atlaspack_config" } +atlaspack_core = { path = "../atlaspack_core" } +atlaspack_filesystem = { path = "../atlaspack_filesystem" } +atlaspack_package_manager = { path = "../atlaspack_package_manager" } +atlaspack_plugin_resolver = { path = "../atlaspack_plugin_resolver" } +atlaspack_plugin_transformer_js = { path = "../atlaspack_plugin_transformer_js" } +atlaspack_plugin_rpc = { path = "../atlaspack_plugin_rpc" } +atlaspack-resolver = { path = "../../packages/utils/node-resolver-rs" } + +anyhow = "1.0.82" +dyn-hash = "0.x" +num_cpus = "1.16.0" +pathdiff = "0.2.1" +petgraph = "0.x" +rand = "0.8.5" +rayon = "1.10.0" +regex = "1.10.5" +serde = { version = "1.0.200", features = ["derive"] } +serde-bool = "0.1.3" +serde_json = "1.0.116" +tracing = "0.1.40" +tracing-subscriber = "0.3.18" +xxhash-rust = { version = "0.8.2", features = ["xxh3"] } + +[dev-dependencies] +mockall = "0.12.1" diff --git a/crates/parcel/src/parcel.rs b/crates/atlaspack/src/atlaspack.rs similarity index 73% rename from crates/parcel/src/parcel.rs rename to crates/atlaspack/src/atlaspack.rs index 690401fd2..73781e094 100644 --- a/crates/parcel/src/parcel.rs +++ b/crates/atlaspack/src/atlaspack.rs @@ -1,21 +1,21 @@ use std::path::PathBuf; use std::sync::Arc; -use parcel_config::parcel_rc_config_loader::LoadConfigOptions; -use parcel_config::parcel_rc_config_loader::ParcelRcConfigLoader; -use parcel_core::asset_graph::AssetGraph; -use parcel_core::config_loader::ConfigLoader; -use parcel_core::plugin::PluginContext; -use parcel_core::plugin::PluginLogger; -use parcel_core::plugin::PluginOptions; -use parcel_core::plugin::ReporterEvent; -use parcel_core::types::ParcelOptions; -use parcel_filesystem::os_file_system::OsFileSystem; -use parcel_filesystem::FileSystemRef; -use parcel_package_manager::NodePackageManager; -use parcel_package_manager::PackageManagerRef; -use parcel_plugin_rpc::RpcHostRef; -use parcel_plugin_rpc::RpcWorkerRef; +use atlaspack_config::atlaspack_rc_config_loader::AtlaspackRcConfigLoader; +use atlaspack_config::atlaspack_rc_config_loader::LoadConfigOptions; +use atlaspack_core::asset_graph::AssetGraph; +use atlaspack_core::config_loader::ConfigLoader; +use atlaspack_core::plugin::PluginContext; +use atlaspack_core::plugin::PluginLogger; +use atlaspack_core::plugin::PluginOptions; +use atlaspack_core::plugin::ReporterEvent; +use atlaspack_core::types::AtlaspackOptions; +use atlaspack_filesystem::os_file_system::OsFileSystem; +use atlaspack_filesystem::FileSystemRef; +use atlaspack_package_manager::NodePackageManager; +use atlaspack_package_manager::PackageManagerRef; +use atlaspack_plugin_rpc::RpcHostRef; +use atlaspack_plugin_rpc::RpcWorkerRef; use crate::plugins::config_plugins::ConfigPlugins; use crate::plugins::PluginsRef; @@ -25,24 +25,24 @@ use crate::requests::AssetGraphRequest; use crate::requests::RequestResult; #[derive(Clone)] -struct ParcelState { +struct AtlaspackState { config: Arc, plugins: PluginsRef, } -pub struct Parcel { +pub struct Atlaspack { pub fs: FileSystemRef, - pub options: ParcelOptions, + pub options: AtlaspackOptions, pub package_manager: PackageManagerRef, pub project_root: PathBuf, pub rpc: Option, - state: Option, + state: Option, } -impl Parcel { +impl Atlaspack { pub fn new( fs: Option, - options: ParcelOptions, + options: AtlaspackOptions, package_manager: Option, rpc: Option, ) -> Result { @@ -65,8 +65,8 @@ impl Parcel { pub struct BuildResult; -impl Parcel { - fn state(&mut self) -> anyhow::Result { +impl Atlaspack { + fn state(&mut self) -> anyhow::Result { if let Some(state) = self.state.clone() { return Ok(state); } @@ -78,7 +78,7 @@ impl Parcel { } let (config, _files) = - ParcelRcConfigLoader::new(Arc::clone(&self.fs), Arc::clone(&self.package_manager)).load( + AtlaspackRcConfigLoader::new(Arc::clone(&self.fs), Arc::clone(&self.package_manager)).load( &self.project_root, LoadConfigOptions { additional_reporters: vec![], // TODO @@ -110,7 +110,7 @@ impl Parcel { }, )); - let state = ParcelState { + let state = AtlaspackState { config: config_loader, plugins, }; @@ -121,7 +121,7 @@ impl Parcel { } pub fn build(&mut self) -> anyhow::Result<()> { - let ParcelState { config, plugins } = self.state()?; + let AtlaspackState { config, plugins } = self.state()?; plugins.reporter().report(&ReporterEvent::BuildStart)?; @@ -137,7 +137,7 @@ impl Parcel { } pub fn build_asset_graph(&mut self) -> anyhow::Result { - let ParcelState { config, plugins } = self.state()?; + let AtlaspackState { config, plugins } = self.state()?; let mut request_tracker = RequestTracker::new( config.clone(), diff --git a/crates/atlaspack/src/lib.rs b/crates/atlaspack/src/lib.rs new file mode 100644 index 000000000..bd1b4f1c6 --- /dev/null +++ b/crates/atlaspack/src/lib.rs @@ -0,0 +1,13 @@ +pub use atlaspack::*; +pub use atlaspack_filesystem as file_system; +pub use atlaspack_plugin_rpc as rpc; + +pub mod atlaspack; +pub(crate) mod request_tracker; + +mod plugins; +mod project_root; +mod requests; + +#[cfg(test)] +mod test_utils; diff --git a/crates/parcel/src/plugins.rs b/crates/atlaspack/src/plugins.rs similarity index 79% rename from crates/parcel/src/plugins.rs rename to crates/atlaspack/src/plugins.rs index fb533947f..bde4f08ce 100644 --- a/crates/parcel/src/plugins.rs +++ b/crates/atlaspack/src/plugins.rs @@ -5,16 +5,16 @@ use std::u64; #[cfg(test)] use mockall::automock; -use parcel_core::plugin::BundlerPlugin; -use parcel_core::plugin::CompressorPlugin; -use parcel_core::plugin::NamerPlugin; -use parcel_core::plugin::OptimizerPlugin; -use parcel_core::plugin::PackagerPlugin; -use parcel_core::plugin::ReporterPlugin; -use parcel_core::plugin::ResolverPlugin; -use parcel_core::plugin::RuntimePlugin; -use parcel_core::plugin::TransformerPlugin; -use parcel_core::plugin::ValidatorPlugin; +use atlaspack_core::plugin::BundlerPlugin; +use atlaspack_core::plugin::CompressorPlugin; +use atlaspack_core::plugin::NamerPlugin; +use atlaspack_core::plugin::OptimizerPlugin; +use atlaspack_core::plugin::PackagerPlugin; +use atlaspack_core::plugin::ReporterPlugin; +use atlaspack_core::plugin::ResolverPlugin; +use atlaspack_core::plugin::RuntimePlugin; +use atlaspack_core::plugin::TransformerPlugin; +use atlaspack_core::plugin::ValidatorPlugin; pub type PluginsRef = Arc; diff --git a/crates/parcel/src/plugins/config_plugins.rs b/crates/atlaspack/src/plugins/config_plugins.rs similarity index 77% rename from crates/parcel/src/plugins/config_plugins.rs rename to crates/atlaspack/src/plugins/config_plugins.rs index bdc255168..d9ea8ce06 100644 --- a/crates/parcel/src/plugins/config_plugins.rs +++ b/crates/atlaspack/src/plugins/config_plugins.rs @@ -3,40 +3,40 @@ use std::hash::Hasher; use std::path::Path; use std::sync::Arc; -use parcel_config::map::NamedPattern; -use parcel_config::ParcelConfig; -use parcel_core::diagnostic_error; -use parcel_core::plugin::composite_reporter_plugin::CompositeReporterPlugin; -use parcel_core::plugin::BundlerPlugin; -use parcel_core::plugin::CompressorPlugin; -use parcel_core::plugin::NamerPlugin; -use parcel_core::plugin::OptimizerPlugin; -use parcel_core::plugin::PackagerPlugin; -use parcel_core::plugin::PluginContext; -use parcel_core::plugin::ReporterPlugin; -use parcel_core::plugin::ResolverPlugin; -use parcel_core::plugin::RuntimePlugin; -use parcel_core::plugin::TransformerPlugin; -use parcel_core::plugin::ValidatorPlugin; -use parcel_plugin_resolver::ParcelResolver; -use parcel_plugin_rpc::plugin::RpcBundlerPlugin; -use parcel_plugin_rpc::plugin::RpcCompressorPlugin; -use parcel_plugin_rpc::plugin::RpcNamerPlugin; -use parcel_plugin_rpc::plugin::RpcOptimizerPlugin; -use parcel_plugin_rpc::plugin::RpcPackagerPlugin; -use parcel_plugin_rpc::plugin::RpcReporterPlugin; -use parcel_plugin_rpc::plugin::RpcResolverPlugin; -use parcel_plugin_rpc::plugin::RpcRuntimePlugin; -use parcel_plugin_rpc::plugin::RpcTransformerPlugin; -use parcel_plugin_transformer_js::ParcelJsTransformerPlugin; +use atlaspack_config::map::NamedPattern; +use atlaspack_config::AtlaspackConfig; +use atlaspack_core::diagnostic_error; +use atlaspack_core::plugin::composite_reporter_plugin::CompositeReporterPlugin; +use atlaspack_core::plugin::BundlerPlugin; +use atlaspack_core::plugin::CompressorPlugin; +use atlaspack_core::plugin::NamerPlugin; +use atlaspack_core::plugin::OptimizerPlugin; +use atlaspack_core::plugin::PackagerPlugin; +use atlaspack_core::plugin::PluginContext; +use atlaspack_core::plugin::ReporterPlugin; +use atlaspack_core::plugin::ResolverPlugin; +use atlaspack_core::plugin::RuntimePlugin; +use atlaspack_core::plugin::TransformerPlugin; +use atlaspack_core::plugin::ValidatorPlugin; +use atlaspack_plugin_resolver::AtlaspackResolver; +use atlaspack_plugin_rpc::plugin::RpcBundlerPlugin; +use atlaspack_plugin_rpc::plugin::RpcCompressorPlugin; +use atlaspack_plugin_rpc::plugin::RpcNamerPlugin; +use atlaspack_plugin_rpc::plugin::RpcOptimizerPlugin; +use atlaspack_plugin_rpc::plugin::RpcPackagerPlugin; +use atlaspack_plugin_rpc::plugin::RpcReporterPlugin; +use atlaspack_plugin_rpc::plugin::RpcResolverPlugin; +use atlaspack_plugin_rpc::plugin::RpcRuntimePlugin; +use atlaspack_plugin_rpc::plugin::RpcTransformerPlugin; +use atlaspack_plugin_transformer_js::AtlaspackJsTransformerPlugin; use super::Plugins; use super::TransformerPipeline; -/// Loads plugins based on the Parcel config +/// Loads plugins based on the Atlaspack config pub struct ConfigPlugins { - /// The Parcel config that determines what plugins will be loaded - config: ParcelConfig, + /// The Atlaspack config that determines what plugins will be loaded + config: AtlaspackConfig, /// Dependencies available to all plugin types ctx: PluginContext, @@ -46,7 +46,7 @@ pub struct ConfigPlugins { } impl ConfigPlugins { - pub fn new(config: ParcelConfig, ctx: PluginContext) -> Self { + pub fn new(config: AtlaspackConfig, ctx: PluginContext) -> Self { let mut reporters: Vec> = Vec::new(); for reporter in config.reporters.iter() { @@ -150,8 +150,8 @@ impl Plugins for ConfigPlugins { let mut resolvers: Vec> = Vec::new(); for resolver in self.config.resolvers.iter() { - if resolver.package_name == "@parcel/resolver-default" { - resolvers.push(Box::new(ParcelResolver::new(&self.ctx))); + if resolver.package_name == "@atlaspack/resolver-default" { + resolvers.push(Box::new(AtlaspackResolver::new(&self.ctx))); continue; } @@ -184,12 +184,12 @@ impl Plugins for ConfigPlugins { use_fallback: false, }); - let mut hasher = parcel_core::hash::IdentifierHasher::default(); + let mut hasher = atlaspack_core::hash::IdentifierHasher::default(); for transformer in self.config.transformers.get(path, named_pattern).iter() { transformer.hash(&mut hasher); - if transformer.package_name == "@parcel/transformer-babel" - || transformer.package_name == "@parcel/transformer-react-refresh-wrap" + if transformer.package_name == "@atlaspack/transformer-babel" + || transformer.package_name == "@atlaspack/transformer-react-refresh-wrap" { // Currently JS plugins don't work and it's easier to just skip these. // We also will probably remove babel from the defaults and support @@ -197,8 +197,8 @@ impl Plugins for ConfigPlugins { continue; } - if transformer.package_name == "@parcel/transformer-js" { - transformers.push(Box::new(ParcelJsTransformerPlugin::new(&self.ctx)?)); + if transformer.package_name == "@atlaspack/transformer-js" { + transformers.push(Box::new(AtlaspackJsTransformerPlugin::new(&self.ctx)?)); continue; } @@ -291,7 +291,7 @@ mod tests { .resolvers() .expect("Not to panic"); - assert_eq!(format!("{:?}", resolvers), "[ParcelResolver]") + assert_eq!(format!("{:?}", resolvers), "[AtlaspackResolver]") } #[test] @@ -315,7 +315,7 @@ mod tests { "{:?}", TransformerPipeline { transformers: vec![Box::new( - ParcelJsTransformerPlugin::new(&make_test_plugin_context()).unwrap() + AtlaspackJsTransformerPlugin::new(&make_test_plugin_context()).unwrap() )], hash: 1 } diff --git a/crates/parcel/src/project_root.rs b/crates/atlaspack/src/project_root.rs similarity index 98% rename from crates/parcel/src/project_root.rs rename to crates/atlaspack/src/project_root.rs index 61a3970b5..93e8e5b21 100644 --- a/crates/parcel/src/project_root.rs +++ b/crates/atlaspack/src/project_root.rs @@ -1,6 +1,6 @@ use std::path::{Component, Components, Path, PathBuf}; -use parcel_filesystem::{ +use atlaspack_filesystem::{ search::{find_ancestor_directory, find_ancestor_file}, FileSystemRef, }; @@ -107,8 +107,8 @@ pub fn infer_project_root( mod tests { use std::sync::Arc; - use parcel_filesystem::in_memory_file_system::InMemoryFileSystem; - use parcel_resolver::FileSystem; + use atlaspack_filesystem::in_memory_file_system::InMemoryFileSystem; + use atlaspack_resolver::FileSystem; use super::*; @@ -222,7 +222,7 @@ mod tests { } fn cwd() -> PathBuf { - root().join("parcel") + root().join("atlaspack") } #[test] diff --git a/crates/parcel/src/request_tracker/mod.rs b/crates/atlaspack/src/request_tracker/mod.rs similarity index 100% rename from crates/parcel/src/request_tracker/mod.rs rename to crates/atlaspack/src/request_tracker/mod.rs diff --git a/crates/parcel/src/request_tracker/request.rs b/crates/atlaspack/src/request_tracker/request.rs similarity index 88% rename from crates/parcel/src/request_tracker/request.rs rename to crates/atlaspack/src/request_tracker/request.rs index 6f9dfb417..d16e2e4c2 100644 --- a/crates/parcel/src/request_tracker/request.rs +++ b/crates/atlaspack/src/request_tracker/request.rs @@ -5,15 +5,15 @@ use std::path::PathBuf; use std::sync::mpsc::Sender; use std::sync::Arc; +use atlaspack_core::config_loader::ConfigLoaderRef; +use atlaspack_core::types::AtlaspackOptions; use dyn_hash::DynHash; -use parcel_core::config_loader::ConfigLoaderRef; -use parcel_core::types::ParcelOptions; use crate::plugins::PluginsRef; use crate::requests::RequestResult; -use parcel_core::plugin::ReporterEvent; -use parcel_core::types::Invalidation; -use parcel_filesystem::FileSystemRef; +use atlaspack_core::plugin::ReporterEvent; +use atlaspack_core::types::Invalidation; +use atlaspack_filesystem::FileSystemRef; #[derive(Debug)] pub struct RunRequestMessage { @@ -31,7 +31,7 @@ type RunRequestFn = Box; pub struct RunRequestContext { config_loader: ConfigLoaderRef, file_system: FileSystemRef, - pub options: Arc, + pub options: Arc, parent_request_id: Option, plugins: PluginsRef, pub project_root: PathBuf, @@ -42,7 +42,7 @@ impl RunRequestContext { pub(crate) fn new( config_loader: ConfigLoaderRef, file_system: FileSystemRef, - options: Arc, + options: Arc, parent_request_id: Option, plugins: PluginsRef, project_root: PathBuf, @@ -103,7 +103,7 @@ pub type RequestId = u64; pub trait Request: DynHash + Send + Debug + 'static { fn id(&self) -> RequestId { - let mut hasher = parcel_core::hash::IdentifierHasher::default(); + let mut hasher = atlaspack_core::hash::IdentifierHasher::default(); std::any::type_name::().hash(&mut hasher); self.dyn_hash(&mut hasher); hasher.finish() diff --git a/crates/parcel/src/request_tracker/request_graph.rs b/crates/atlaspack/src/request_tracker/request_graph.rs similarity index 100% rename from crates/parcel/src/request_tracker/request_graph.rs rename to crates/atlaspack/src/request_tracker/request_graph.rs diff --git a/crates/parcel/src/request_tracker/request_tracker.rs b/crates/atlaspack/src/request_tracker/request_tracker.rs similarity index 95% rename from crates/parcel/src/request_tracker/request_tracker.rs rename to crates/atlaspack/src/request_tracker/request_tracker.rs index 98a74a8b4..b536d5e64 100644 --- a/crates/parcel/src/request_tracker/request_tracker.rs +++ b/crates/atlaspack/src/request_tracker/request_tracker.rs @@ -4,10 +4,10 @@ use std::sync::mpsc::Sender; use std::sync::Arc; use anyhow::anyhow; -use parcel_core::config_loader::ConfigLoaderRef; -use parcel_core::diagnostic_error; -use parcel_core::types::ParcelOptions; -use parcel_filesystem::FileSystemRef; +use atlaspack_core::config_loader::ConfigLoaderRef; +use atlaspack_core::diagnostic_error; +use atlaspack_core::types::AtlaspackOptions; +use atlaspack_filesystem::FileSystemRef; use petgraph::graph::NodeIndex; use petgraph::stable_graph::StableDiGraph; @@ -23,7 +23,7 @@ use super::ResultAndInvalidations; use super::RunRequestError; use super::{RunRequestContext, RunRequestMessage}; -/// [`RequestTracker`] runs parcel work items and constructs a graph of their dependencies. +/// [`RequestTracker`] runs atlaspack work items and constructs a graph of their dependencies. /// /// Whenever a [`Request`] implementation needs to get the result of another piece of work, it'll /// make a call into [`RequestTracker`] through its [`RunRequestContext`] abstraction. The request @@ -38,7 +38,7 @@ pub struct RequestTracker { config_loader: ConfigLoaderRef, file_system: FileSystemRef, graph: RequestGraph, - options: Arc, + options: Arc, plugins: PluginsRef, project_root: PathBuf, request_index: HashMap, @@ -49,7 +49,7 @@ impl RequestTracker { pub fn new( config_loader: ConfigLoaderRef, file_system: FileSystemRef, - options: Arc, + options: Arc, plugins: PluginsRef, project_root: PathBuf, ) -> Self { @@ -99,7 +99,9 @@ impl RequestTracker { .thread_name(|count| format!("RequestTracker-{}", count)) .num_threads(num_cpus::get() + 4) .panic_handler(|failure| { - tracing::error!("Lost thread from thread-pool. This is a bug in parcel. Builds may stall."); + tracing::error!( + "Lost thread from thread-pool. This is a bug in atlaspack. Builds may stall." + ); std::process::exit(1); }) .build()?; diff --git a/crates/parcel/src/request_tracker/test.rs b/crates/atlaspack/src/request_tracker/test.rs similarity index 100% rename from crates/parcel/src/request_tracker/test.rs rename to crates/atlaspack/src/request_tracker/test.rs diff --git a/crates/parcel/src/requests.rs b/crates/atlaspack/src/requests.rs similarity index 100% rename from crates/parcel/src/requests.rs rename to crates/atlaspack/src/requests.rs diff --git a/crates/parcel/src/requests/asset_graph_request.rs b/crates/atlaspack/src/requests/asset_graph_request.rs similarity index 95% rename from crates/parcel/src/requests/asset_graph_request.rs rename to crates/atlaspack/src/requests/asset_graph_request.rs index 0d8afae02..9ad331d26 100644 --- a/crates/parcel/src/requests/asset_graph_request.rs +++ b/crates/atlaspack/src/requests/asset_graph_request.rs @@ -6,8 +6,8 @@ use anyhow::anyhow; use pathdiff::diff_paths; use petgraph::graph::NodeIndex; -use parcel_core::asset_graph::{AssetGraph, DependencyNode, DependencyState}; -use parcel_core::types::Dependency; +use atlaspack_core::asset_graph::{AssetGraph, DependencyNode, DependencyState}; +use atlaspack_core::types::Dependency; use crate::request_tracker::{Request, ResultAndInvalidations, RunRequestContext, RunRequestError}; @@ -348,9 +348,9 @@ mod test { use tracing::Level; - use parcel_core::types::{Code, ParcelOptions}; - use parcel_filesystem::in_memory_file_system::InMemoryFileSystem; - use parcel_filesystem::FileSystem; + use atlaspack_core::types::{AtlaspackOptions, Code}; + use atlaspack_filesystem::in_memory_file_system::InMemoryFileSystem; + use atlaspack_filesystem::FileSystem; use crate::requests::{AssetGraphRequest, RequestResult}; use crate::test_utils::{request_tracker, RequestTrackerTestOptions}; @@ -381,14 +381,14 @@ mod test { let mut options = RequestTrackerTestOptions::default(); let fs = InMemoryFileSystem::default(); #[cfg(not(target_os = "windows"))] - let temporary_dir = PathBuf::from("/parcel_tests"); + let temporary_dir = PathBuf::from("/atlaspack_tests"); #[cfg(target_os = "windows")] - let temporary_dir = PathBuf::from("c:/windows/parcel_tests"); + let temporary_dir = PathBuf::from("c:/windows/atlaspack_tests"); assert!(temporary_dir.is_absolute()); fs.create_directory(&temporary_dir).unwrap(); fs.set_current_working_directory(&temporary_dir); // <- resolver is broken without this options - .parcel_options + .atlaspack_options .entries .push(temporary_dir.join("entry.js").to_str().unwrap().to_string()); options.project_root = temporary_dir.clone(); @@ -450,11 +450,11 @@ console.log('hello world'); #[test] fn test_asset_graph_request_with_a_couple_of_entries() { #[cfg(not(target_os = "windows"))] - let temporary_dir = PathBuf::from("/parcel_tests"); + let temporary_dir = PathBuf::from("/atlaspack_tests"); #[cfg(target_os = "windows")] - let temporary_dir = PathBuf::from("C:\\windows\\parcel_tests"); + let temporary_dir = PathBuf::from("C:\\windows\\atlaspack_tests"); - let core_path = temporary_dir.join("parcel_core"); + let core_path = temporary_dir.join("atlaspack_core"); let fs = InMemoryFileSystem::default(); fs.create_directory(&temporary_dir).unwrap(); @@ -493,10 +493,10 @@ console.log('hello world'); let mut request_tracker = request_tracker(RequestTrackerTestOptions { fs: Arc::new(fs), - parcel_options: ParcelOptions { + atlaspack_options: AtlaspackOptions { core_path, entries: vec![temporary_dir.join("entry.js").to_str().unwrap().to_string()], - ..ParcelOptions::default() + ..AtlaspackOptions::default() }, project_root: temporary_dir.clone(), search_path: temporary_dir.clone(), @@ -532,7 +532,7 @@ console.log('hello world'); fn setup_core_modules(fs: &InMemoryFileSystem, core_path: &Path) { let transformer_path = core_path .join("node_modules") - .join("@parcel/transformer-js"); + .join("@atlaspack/transformer-js"); fs.write_file(&transformer_path.join("package.json"), String::from("{}")); fs.write_file( diff --git a/crates/parcel/src/requests/asset_request.rs b/crates/atlaspack/src/requests/asset_request.rs similarity index 88% rename from crates/parcel/src/requests/asset_request.rs rename to crates/atlaspack/src/requests/asset_request.rs index 69f2c01a4..fd6d16cec 100644 --- a/crates/parcel/src/requests/asset_request.rs +++ b/crates/atlaspack/src/requests/asset_request.rs @@ -2,18 +2,18 @@ use std::hash::Hash; use std::path::PathBuf; use std::sync::Arc; -use parcel_core::diagnostic_error; -use parcel_core::plugin::AssetBuildEvent; -use parcel_core::plugin::BuildProgressEvent; -use parcel_core::plugin::InitialAsset; -use parcel_core::plugin::ReporterEvent; -use parcel_core::plugin::TransformResult; -use parcel_core::plugin::TransformationInput; -use parcel_core::types::Asset; -use parcel_core::types::AssetStats; -use parcel_core::types::Dependency; -use parcel_core::types::Environment; -use parcel_core::types::FileType; +use atlaspack_core::diagnostic_error; +use atlaspack_core::plugin::AssetBuildEvent; +use atlaspack_core::plugin::BuildProgressEvent; +use atlaspack_core::plugin::InitialAsset; +use atlaspack_core::plugin::ReporterEvent; +use atlaspack_core::plugin::TransformResult; +use atlaspack_core::plugin::TransformationInput; +use atlaspack_core::types::Asset; +use atlaspack_core::types::AssetStats; +use atlaspack_core::types::Dependency; +use atlaspack_core::types::Environment; +use atlaspack_core::types::FileType; use crate::plugins::PluginsRef; use crate::plugins::TransformerPipeline; diff --git a/crates/parcel/src/requests/entry_request.rs b/crates/atlaspack/src/requests/entry_request.rs similarity index 95% rename from crates/parcel/src/requests/entry_request.rs rename to crates/atlaspack/src/requests/entry_request.rs index 3724e7d0b..7a9244482 100644 --- a/crates/parcel/src/requests/entry_request.rs +++ b/crates/atlaspack/src/requests/entry_request.rs @@ -57,7 +57,7 @@ impl Request for EntryRequest { mod tests { use std::sync::Arc; - use parcel_filesystem::in_memory_file_system::InMemoryFileSystem; + use atlaspack_filesystem::in_memory_file_system::InMemoryFileSystem; use crate::test_utils::{request_tracker, RequestTrackerTestOptions}; @@ -80,7 +80,7 @@ mod tests { #[test] fn returns_file_entry_from_project_root() { let fs = Arc::new(InMemoryFileSystem::default()); - let project_root = PathBuf::from("parcel"); + let project_root = PathBuf::from("atlaspack"); let request = EntryRequest { entry: String::from("src/a.js"), }; @@ -126,7 +126,7 @@ mod tests { let entry = request_tracker(RequestTrackerTestOptions { fs, - project_root: PathBuf::from("parcel"), + project_root: PathBuf::from("atlaspack"), ..RequestTrackerTestOptions::default() }) .run_request(request); diff --git a/crates/parcel/src/requests/path_request.rs b/crates/atlaspack/src/requests/path_request.rs similarity index 96% rename from crates/parcel/src/requests/path_request.rs rename to crates/atlaspack/src/requests/path_request.rs index c810a9cdd..37a0fbba6 100644 --- a/crates/parcel/src/requests/path_request.rs +++ b/crates/atlaspack/src/requests/path_request.rs @@ -2,15 +2,15 @@ use std::hash::Hash; use std::path::PathBuf; use std::sync::Arc; -use parcel_core::diagnostic_error; -use parcel_core::plugin::BuildProgressEvent; -use parcel_core::plugin::ReporterEvent; -use parcel_core::plugin::Resolution; -use parcel_core::plugin::ResolveContext; -use parcel_core::plugin::ResolvedResolution; -use parcel_core::plugin::ResolvingEvent; -use parcel_core::types::Dependency; -use parcel_resolver::parse_scheme; +use atlaspack_core::diagnostic_error; +use atlaspack_core::plugin::BuildProgressEvent; +use atlaspack_core::plugin::ReporterEvent; +use atlaspack_core::plugin::Resolution; +use atlaspack_core::plugin::ResolveContext; +use atlaspack_core::plugin::ResolvedResolution; +use atlaspack_core::plugin::ResolvingEvent; +use atlaspack_core::types::Dependency; +use atlaspack_resolver::parse_scheme; use crate::request_tracker::Request; use crate::request_tracker::ResultAndInvalidations; @@ -151,7 +151,7 @@ impl Request for PathRequest { mod tests { use std::fmt::Debug; - use parcel_core::plugin::{ + use atlaspack_core::plugin::{ composite_reporter_plugin::CompositeReporterPlugin, Resolved, ResolverPlugin, }; diff --git a/crates/parcel/src/requests/target_request.rs b/crates/atlaspack/src/requests/target_request.rs similarity index 97% rename from crates/parcel/src/requests/target_request.rs rename to crates/atlaspack/src/requests/target_request.rs index 50b8ada36..d85f56b14 100644 --- a/crates/parcel/src/requests/target_request.rs +++ b/crates/atlaspack/src/requests/target_request.rs @@ -4,6 +4,22 @@ use std::path::Path; use std::path::PathBuf; use std::sync::Arc; +use atlaspack_core::config_loader::ConfigFile; +use atlaspack_core::diagnostic_error; +use atlaspack_core::types::engines::Engines; +use atlaspack_core::types::BuildMode; +use atlaspack_core::types::CodeFrame; +use atlaspack_core::types::DefaultTargetOptions; +use atlaspack_core::types::Diagnostic; +use atlaspack_core::types::DiagnosticBuilder; +use atlaspack_core::types::Environment; +use atlaspack_core::types::EnvironmentContext; +use atlaspack_core::types::ErrorKind; +use atlaspack_core::types::OutputFormat; +use atlaspack_core::types::SourceType; +use atlaspack_core::types::Target; +use atlaspack_core::types::TargetSourceMapOptions; +use atlaspack_resolver::IncludeNodeModules; use package_json::BrowserField; use package_json::BrowsersList; use package_json::BuiltInTargetDescriptor; @@ -12,22 +28,6 @@ use package_json::PackageJson; use package_json::SourceField; use package_json::SourceMapField; use package_json::TargetDescriptor; -use parcel_core::config_loader::ConfigFile; -use parcel_core::diagnostic_error; -use parcel_core::types::engines::Engines; -use parcel_core::types::BuildMode; -use parcel_core::types::CodeFrame; -use parcel_core::types::DefaultTargetOptions; -use parcel_core::types::Diagnostic; -use parcel_core::types::DiagnosticBuilder; -use parcel_core::types::Environment; -use parcel_core::types::EnvironmentContext; -use parcel_core::types::ErrorKind; -use parcel_core::types::OutputFormat; -use parcel_core::types::SourceType; -use parcel_core::types::Target; -use parcel_core::types::TargetSourceMapOptions; -use parcel_resolver::IncludeNodeModules; use crate::request_tracker::Request; use crate::request_tracker::ResultAndInvalidations; @@ -41,7 +41,7 @@ mod package_json; /// Infers how and where source code is outputted /// -/// Targets will be generated from the project package.json file and input Parcel options. +/// Targets will be generated from the project package.json file and input Atlaspack options. /// #[derive(Debug)] pub struct TargetRequest { @@ -592,8 +592,8 @@ mod tests { use regex::Regex; - use parcel_core::types::{browsers::Browsers, version::Version}; - use parcel_filesystem::in_memory_file_system::InMemoryFileSystem; + use atlaspack_core::types::{browsers::Browsers, version::Version}; + use atlaspack_filesystem::in_memory_file_system::InMemoryFileSystem; use crate::test_utils::{request_tracker, RequestTrackerTestOptions}; diff --git a/crates/parcel/src/requests/target_request/package_json.rs b/crates/atlaspack/src/requests/target_request/package_json.rs similarity index 97% rename from crates/parcel/src/requests/target_request/package_json.rs rename to crates/atlaspack/src/requests/target_request/package_json.rs index 12f300c2e..b2475a925 100644 --- a/crates/parcel/src/requests/target_request/package_json.rs +++ b/crates/atlaspack/src/requests/target_request/package_json.rs @@ -3,11 +3,11 @@ use std::ffi::OsStr; use std::fmt::Display; use std::path::PathBuf; -use parcel_core::types::engines::Engines; -use parcel_core::types::EnvironmentContext; -use parcel_core::types::OutputFormat; -use parcel_core::types::TargetSourceMapOptions; -use parcel_resolver::IncludeNodeModules; +use atlaspack_core::types::engines::Engines; +use atlaspack_core::types::EnvironmentContext; +use atlaspack_core::types::OutputFormat; +use atlaspack_core::types::TargetSourceMapOptions; +use atlaspack_resolver::IncludeNodeModules; use serde::Deserialize; use serde::Deserializer; diff --git a/crates/parcel/src/test_utils.rs b/crates/atlaspack/src/test_utils.rs similarity index 75% rename from crates/parcel/src/test_utils.rs rename to crates/atlaspack/src/test_utils.rs index 4642fc0a4..1b3c38b86 100644 --- a/crates/parcel/src/test_utils.rs +++ b/crates/atlaspack/src/test_utils.rs @@ -1,13 +1,13 @@ use std::path::PathBuf; use std::sync::Arc; -use parcel_config::parcel_config_fixtures::default_config; -use parcel_core::{ +use atlaspack_config::atlaspack_config_fixtures::default_config; +use atlaspack_core::{ config_loader::ConfigLoader, plugin::{PluginContext, PluginLogger, PluginOptions}, - types::ParcelOptions, + types::AtlaspackOptions, }; -use parcel_filesystem::{in_memory_file_system::InMemoryFileSystem, FileSystemRef}; +use atlaspack_filesystem::{in_memory_file_system::InMemoryFileSystem, FileSystemRef}; use crate::{ plugins::{config_plugins::ConfigPlugins, PluginsRef}, @@ -32,7 +32,7 @@ pub(crate) fn make_test_plugin_context() -> PluginContext { pub(crate) fn config_plugins(ctx: PluginContext) -> PluginsRef { let fixture = default_config(Arc::new(PathBuf::default())); - Arc::new(ConfigPlugins::new(fixture.parcel_config, ctx)) + Arc::new(ConfigPlugins::new(fixture.atlaspack_config, ctx)) } pub struct RequestTrackerTestOptions { @@ -40,7 +40,7 @@ pub struct RequestTrackerTestOptions { pub plugins: Option, pub project_root: PathBuf, pub search_path: PathBuf, - pub parcel_options: ParcelOptions, + pub atlaspack_options: AtlaspackOptions, } impl Default for RequestTrackerTestOptions { @@ -50,7 +50,7 @@ impl Default for RequestTrackerTestOptions { plugins: None, project_root: PathBuf::default(), search_path: PathBuf::default(), - parcel_options: ParcelOptions::default(), + atlaspack_options: AtlaspackOptions::default(), } } } @@ -61,7 +61,7 @@ pub(crate) fn request_tracker(options: RequestTrackerTestOptions) -> RequestTrac plugins, project_root, search_path, - parcel_options, + atlaspack_options, } = options; let config_loader = Arc::new(ConfigLoader { @@ -75,10 +75,10 @@ pub(crate) fn request_tracker(options: RequestTrackerTestOptions) -> RequestTrac config: Arc::clone(&config_loader), file_system: fs.clone(), options: Arc::new(PluginOptions { - core_path: parcel_options.core_path.clone(), - env: parcel_options.env.clone(), - log_level: parcel_options.log_level.clone(), - mode: parcel_options.mode.clone(), + core_path: atlaspack_options.core_path.clone(), + env: atlaspack_options.env.clone(), + log_level: atlaspack_options.log_level.clone(), + mode: atlaspack_options.mode.clone(), project_root: project_root.clone(), }), logger: PluginLogger::default(), @@ -88,7 +88,7 @@ pub(crate) fn request_tracker(options: RequestTrackerTestOptions) -> RequestTrac RequestTracker::new( Arc::clone(&config_loader), fs, - Arc::new(parcel_options), + Arc::new(atlaspack_options), plugins, project_root, ) diff --git a/crates/parcel_config/Cargo.toml b/crates/atlaspack_config/Cargo.toml similarity index 68% rename from crates/parcel_config/Cargo.toml rename to crates/atlaspack_config/Cargo.toml index 75c7314b0..b9909aa65 100644 --- a/crates/parcel_config/Cargo.toml +++ b/crates/atlaspack_config/Cargo.toml @@ -3,14 +3,14 @@ authors = [ "Monica Olejniczak ", "Devon Govett ", ] -name = "parcel_config" +name = "atlaspack_config" version = "0.1.0" edition = "2021" [dependencies] -parcel_core = { path = "../parcel_core" } -parcel_filesystem = { path = "../parcel_filesystem" } -parcel_package_manager = { path = "../parcel_package_manager" } +atlaspack_core = { path = "../atlaspack_core" } +atlaspack_filesystem = { path = "../atlaspack_filesystem" } +atlaspack_package_manager = { path = "../atlaspack_package_manager" } derive_builder = "0.20.0" glob-match = "0.2.1" diff --git a/crates/parcel_config/src/parcel_config.rs b/crates/atlaspack_config/src/atlaspack_config.rs similarity index 83% rename from crates/parcel_config/src/parcel_config.rs rename to crates/atlaspack_config/src/atlaspack_config.rs index dd4fd570d..a29965eca 100644 --- a/crates/parcel_config/src/parcel_config.rs +++ b/crates/atlaspack_config/src/atlaspack_config.rs @@ -1,13 +1,13 @@ use std::path::PathBuf; use std::sync::Arc; +use atlaspack_core::diagnostic_error; +use atlaspack_core::types::DiagnosticError; use indexmap::IndexMap; -use parcel_core::diagnostic_error; -use parcel_core::types::DiagnosticError; use serde::Deserialize; use serde::Serialize; -use super::partial_parcel_config::PartialParcelConfig; +use super::partial_atlaspack_config::PartialAtlaspackConfig; use crate::map::NamedPipelinesMap; use crate::map::PipelineMap; use crate::map::PipelinesMap; @@ -19,9 +19,9 @@ pub struct PluginNode { pub resolve_from: Arc, } -/// Represents a fully merged and validated .parcel_rc config +/// Represents a fully merged and validated .atlaspack_rc config #[derive(Debug, Deserialize, PartialEq, Serialize)] -pub struct ParcelConfig { +pub struct AtlaspackConfig { pub bundler: PluginNode, pub compressors: PipelinesMap, pub namers: Vec, @@ -34,10 +34,10 @@ pub struct ParcelConfig { pub validators: PipelinesMap, } -impl TryFrom for ParcelConfig { +impl TryFrom for AtlaspackConfig { type Error = DiagnosticError; - fn try_from(config: PartialParcelConfig) -> Result { + fn try_from(config: PartialAtlaspackConfig) -> Result { // The final stage of merging filters out any ... extensions as they are a noop fn filter_out_extends(pipelines: Vec) -> Vec { pipelines @@ -78,7 +78,7 @@ impl TryFrom for ParcelConfig { )); } - Ok(ParcelConfig { + Ok(AtlaspackConfig { bundler: config.bundler.unwrap(), compressors: PipelinesMap::new(filter_out_extends_from_map(config.compressors)), namers, @@ -98,12 +98,12 @@ mod tests { use super::*; mod try_from { use super::*; - use crate::partial_parcel_config::PartialParcelConfigBuilder; + use crate::partial_atlaspack_config::PartialAtlaspackConfigBuilder; #[test] fn returns_an_error_when_required_phases_are_optional() { assert_eq!( - ParcelConfig::try_from(PartialParcelConfig::default()).map_err(|e| e.to_string()), + AtlaspackConfig::try_from(PartialAtlaspackConfig::default()).map_err(|e| e.to_string()), Err( diagnostic_error!( "Missing plugins for the following phases: {:?}", @@ -130,14 +130,14 @@ mod tests { } } - let partial_config = PartialParcelConfigBuilder::default() + let partial_config = PartialAtlaspackConfigBuilder::default() .bundler(Some(plugin())) .namers(vec![plugin()]) .resolvers(vec![extension(), plugin()]) .build() .unwrap(); - let config = ParcelConfig::try_from(partial_config); + let config = AtlaspackConfig::try_from(partial_config); assert!(config.is_ok_and(|c| !c.resolvers.contains(&extension()))); } diff --git a/crates/parcel_config/src/parcel_config_fixtures.rs b/crates/atlaspack_config/src/atlaspack_config_fixtures.rs similarity index 66% rename from crates/parcel_config/src/parcel_config_fixtures.rs rename to crates/atlaspack_config/src/atlaspack_config_fixtures.rs index db3423264..95b4685c8 100644 --- a/crates/parcel_config/src/parcel_config_fixtures.rs +++ b/crates/atlaspack_config/src/atlaspack_config_fixtures.rs @@ -5,27 +5,27 @@ use std::sync::Arc; use indexmap::indexmap; use indexmap::IndexMap; +use super::atlaspack_config::AtlaspackConfig; use super::map::NamedPipelinesMap; -use super::parcel_config::ParcelConfig; +use crate::atlaspack_config::PluginNode; use crate::map::PipelineMap; use crate::map::PipelinesMap; -use crate::parcel_config::PluginNode; pub struct ConfigFixture { - pub parcel_config: ParcelConfig, - pub parcel_rc: String, + pub atlaspack_config: AtlaspackConfig, + pub atlaspack_rc: String, pub path: PathBuf, } pub struct PartialConfigFixture { - pub parcel_rc: String, + pub atlaspack_rc: String, pub path: PathBuf, } pub struct ExtendedConfigFixture { pub base_config: PartialConfigFixture, pub extended_config: PartialConfigFixture, - pub parcel_config: ParcelConfig, + pub atlaspack_config: AtlaspackConfig, } pub fn config(project_root: &Path) -> (String, ConfigFixture) { @@ -42,11 +42,11 @@ pub fn config(project_root: &Path) -> (String, ConfigFixture) { pub fn fallback_config(project_root: &Path) -> (String, ConfigFixture) { ( - String::from("@parcel/config-default"), + String::from("@atlaspack/config-default"), default_config(Arc::new( project_root .join("node_modules") - .join("@parcel/config-default") + .join("@atlaspack/config-default") .join("index.json"), )), ) @@ -54,73 +54,73 @@ pub fn fallback_config(project_root: &Path) -> (String, ConfigFixture) { pub fn default_config(resolve_from: Arc) -> ConfigFixture { ConfigFixture { - parcel_config: ParcelConfig { + atlaspack_config: AtlaspackConfig { bundler: PluginNode { - package_name: String::from("@parcel/bundler-default"), + package_name: String::from("@atlaspack/bundler-default"), resolve_from: resolve_from.clone(), }, compressors: PipelinesMap::new(indexmap! { String::from("*") => vec!(PluginNode { - package_name: String::from("@parcel/compressor-raw"), + package_name: String::from("@atlaspack/compressor-raw"), resolve_from: resolve_from.clone(), }) }), namers: vec![PluginNode { - package_name: String::from("@parcel/namer-default"), + package_name: String::from("@atlaspack/namer-default"), resolve_from: resolve_from.clone(), }], optimizers: NamedPipelinesMap::new(indexmap! { String::from("*.{js,mjs,cjs}") => vec!(PluginNode { - package_name: String::from("@parcel/optimizer-swc"), + package_name: String::from("@atlaspack/optimizer-swc"), resolve_from: resolve_from.clone(), }) }), packagers: PipelineMap::new(indexmap! { String::from("*.{js,mjs,cjs}") => PluginNode { - package_name: String::from("@parcel/packager-js"), + package_name: String::from("@atlaspack/packager-js"), resolve_from: resolve_from.clone(), } }), reporters: vec![PluginNode { - package_name: String::from("@parcel/reporter-dev-server"), + package_name: String::from("@atlaspack/reporter-dev-server"), resolve_from: resolve_from.clone(), }], resolvers: vec![PluginNode { - package_name: String::from("@parcel/resolver-default"), + package_name: String::from("@atlaspack/resolver-default"), resolve_from: resolve_from.clone(), }], runtimes: vec![PluginNode { - package_name: String::from("@parcel/runtime-js"), + package_name: String::from("@atlaspack/runtime-js"), resolve_from: resolve_from.clone(), }], transformers: NamedPipelinesMap::new(indexmap! { String::from("*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}") => vec!(PluginNode { - package_name: String::from("@parcel/transformer-js"), + package_name: String::from("@atlaspack/transformer-js"), resolve_from: resolve_from.clone(), }) }), validators: PipelinesMap::new(IndexMap::new()), }, - parcel_rc: String::from( + atlaspack_rc: String::from( r#" { - "bundler": "@parcel/bundler-default", + "bundler": "@atlaspack/bundler-default", "compressors": { - "*": ["@parcel/compressor-raw"] + "*": ["@atlaspack/compressor-raw"] }, - "namers": ["@parcel/namer-default"], + "namers": ["@atlaspack/namer-default"], "optimizers": { - "*.{js,mjs,cjs}": ["@parcel/optimizer-swc"] + "*.{js,mjs,cjs}": ["@atlaspack/optimizer-swc"] }, "packagers": { - "*.{js,mjs,cjs}": "@parcel/packager-js" + "*.{js,mjs,cjs}": "@atlaspack/packager-js" }, - "reporters": ["@parcel/reporter-dev-server"], - "resolvers": ["@parcel/resolver-default"], - "runtimes": ["@parcel/runtime-js"], + "reporters": ["@atlaspack/reporter-dev-server"], + "resolvers": ["@atlaspack/resolver-default"], + "runtimes": ["@atlaspack/runtime-js"], "transformers": { "*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": [ - "@parcel/transformer-js" + "@atlaspack/transformer-js" ], } } @@ -137,65 +137,65 @@ fn extended_config_from( let extended_resolve_from = Arc::new( project_root .join("node_modules") - .join("@parcel/config-default") + .join("@atlaspack/config-default") .join("index.json"), ); let extended_config = default_config(extended_resolve_from.clone()); ExtendedConfigFixture { - parcel_config: ParcelConfig { + atlaspack_config: AtlaspackConfig { bundler: PluginNode { - package_name: String::from("@parcel/bundler-default"), + package_name: String::from("@atlaspack/bundler-default"), resolve_from: extended_resolve_from.clone(), }, compressors: PipelinesMap::new(indexmap! { String::from("*") => vec!(PluginNode { - package_name: String::from("@parcel/compressor-raw"), + package_name: String::from("@atlaspack/compressor-raw"), resolve_from: extended_resolve_from.clone(), }) }), namers: vec![PluginNode { - package_name: String::from("@parcel/namer-default"), + package_name: String::from("@atlaspack/namer-default"), resolve_from: extended_resolve_from.clone(), }], optimizers: NamedPipelinesMap::new(indexmap! { String::from("*.{js,mjs,cjs}") => vec!(PluginNode { - package_name: String::from("@parcel/optimizer-swc"), + package_name: String::from("@atlaspack/optimizer-swc"), resolve_from: extended_resolve_from.clone(), }) }), packagers: PipelineMap::new(indexmap! { String::from("*.{js,mjs,cjs}") => PluginNode { - package_name: String::from("@parcel/packager-js"), + package_name: String::from("@atlaspack/packager-js"), resolve_from: extended_resolve_from.clone(), } }), reporters: vec![ PluginNode { - package_name: String::from("@parcel/reporter-dev-server"), + package_name: String::from("@atlaspack/reporter-dev-server"), resolve_from: extended_resolve_from.clone(), }, PluginNode { - package_name: String::from("@scope/parcel-metrics-reporter"), + package_name: String::from("@scope/atlaspack-metrics-reporter"), resolve_from: base_resolve_from.clone(), }, ], resolvers: vec![PluginNode { - package_name: String::from("@parcel/resolver-default"), + package_name: String::from("@atlaspack/resolver-default"), resolve_from: extended_resolve_from.clone(), }], runtimes: vec![PluginNode { - package_name: String::from("@parcel/runtime-js"), + package_name: String::from("@atlaspack/runtime-js"), resolve_from: extended_resolve_from.clone(), }], transformers: NamedPipelinesMap::new(indexmap! { String::from("*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}") => vec!(PluginNode { - package_name: String::from("@parcel/transformer-js"), + package_name: String::from("@atlaspack/transformer-js"), resolve_from: extended_resolve_from.clone(), }), String::from("*.{ts,tsx}") => vec!(PluginNode { - package_name: String::from("@scope/parcel-transformer-ts"), + package_name: String::from("@scope/atlaspack-transformer-ts"), resolve_from: base_resolve_from.clone(), }), }), @@ -203,14 +203,14 @@ fn extended_config_from( }, base_config: PartialConfigFixture { path: PathBuf::from(base_resolve_from.as_os_str()), - parcel_rc: String::from( + atlaspack_rc: String::from( r#" { - "extends": "@parcel/config-default", - "reporters": ["...", "@scope/parcel-metrics-reporter"], + "extends": "@atlaspack/config-default", + "reporters": ["...", "@scope/atlaspack-metrics-reporter"], "transformers": { "*.{ts,tsx}": [ - "@scope/parcel-transformer-ts", + "@scope/atlaspack-transformer-ts", "..." ] } @@ -220,13 +220,13 @@ fn extended_config_from( }, extended_config: PartialConfigFixture { path: extended_config.path, - parcel_rc: extended_config.parcel_rc, + atlaspack_rc: extended_config.atlaspack_rc, }, } } pub fn default_extended_config(project_root: &Path) -> ExtendedConfigFixture { - let base_resolve_from = Arc::from(project_root.join(".parcelrc")); + let base_resolve_from = Arc::from(project_root.join(".atlaspackrc")); extended_config_from(project_root, base_resolve_from) } diff --git a/crates/parcel_config/src/parcel_rc.rs b/crates/atlaspack_config/src/atlaspack_rc.rs similarity index 68% rename from crates/parcel_config/src/parcel_rc.rs rename to crates/atlaspack_config/src/atlaspack_rc.rs index 21b0f65d1..5fb316f3e 100644 --- a/crates/parcel_config/src/parcel_rc.rs +++ b/crates/atlaspack_config/src/atlaspack_rc.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; +use atlaspack_core::types::File; use indexmap::IndexMap; -use parcel_core::types::File; use serde::Deserialize; #[derive(Debug, Deserialize)] @@ -11,9 +11,9 @@ pub enum Extends { Many(Vec), } -/// Deserialized .parcel_rc config +/// Deserialized .atlaspack_rc config #[derive(Debug, Deserialize)] -pub struct ParcelRc { +pub struct AtlaspackRc { pub extends: Option, pub bundler: Option, pub compressors: Option>>, @@ -27,19 +27,19 @@ pub struct ParcelRc { pub validators: Option>>, } -/// Represents the .parcel_rc config file +/// Represents the .atlaspack_rc config file #[derive(Debug)] -pub struct ParcelRcFile { - pub contents: ParcelRc, +pub struct AtlaspackRcFile { + pub contents: AtlaspackRc, pub path: PathBuf, pub raw: String, } -impl From<&ParcelRcFile> for File { - fn from(parcel_rc: &ParcelRcFile) -> Self { +impl From<&AtlaspackRcFile> for File { + fn from(atlaspack_rc: &AtlaspackRcFile) -> Self { File { - contents: parcel_rc.raw.clone(), - path: parcel_rc.path.clone(), + contents: atlaspack_rc.raw.clone(), + path: atlaspack_rc.path.clone(), } } } diff --git a/crates/parcel_config/src/parcel_rc_config_loader.rs b/crates/atlaspack_config/src/atlaspack_rc_config_loader.rs similarity index 68% rename from crates/parcel_config/src/parcel_rc_config_loader.rs rename to crates/atlaspack_config/src/atlaspack_rc_config_loader.rs index fb733b246..d21b85d28 100644 --- a/crates/parcel_config/src/parcel_rc_config_loader.rs +++ b/crates/atlaspack_config/src/atlaspack_rc_config_loader.rs @@ -1,23 +1,23 @@ use std::path::Path; use std::path::PathBuf; -use parcel_core::diagnostic_error; -use parcel_core::types::CodeFrame; -use parcel_core::types::CodeHighlight; -use parcel_core::types::DiagnosticBuilder; -use parcel_core::types::DiagnosticError; -use parcel_core::types::File; -use parcel_filesystem::search::find_ancestor_file; -use parcel_filesystem::FileSystemRef; -use parcel_package_manager::PackageManagerRef; +use atlaspack_core::diagnostic_error; +use atlaspack_core::types::CodeFrame; +use atlaspack_core::types::CodeHighlight; +use atlaspack_core::types::DiagnosticBuilder; +use atlaspack_core::types::DiagnosticError; +use atlaspack_core::types::File; +use atlaspack_filesystem::search::find_ancestor_file; +use atlaspack_filesystem::FileSystemRef; +use atlaspack_package_manager::PackageManagerRef; use pathdiff::diff_paths; use serde_json5::Location; -use super::parcel_config::ParcelConfig; -use super::parcel_config::PluginNode; -use super::parcel_rc::Extends; -use super::parcel_rc::ParcelRcFile; -use super::partial_parcel_config::PartialParcelConfig; +use super::atlaspack_config::AtlaspackConfig; +use super::atlaspack_config::PluginNode; +use super::atlaspack_rc::AtlaspackRcFile; +use super::atlaspack_rc::Extends; +use super::partial_atlaspack_config::PartialAtlaspackConfig; #[derive(Default)] pub struct LoadConfigOptions<'a> { @@ -26,19 +26,19 @@ pub struct LoadConfigOptions<'a> { /// A file path or package specifier that will be used to load the config from pub config: Option<&'a str>, /// A file path or package specifier that will be used to load the config from when no other - /// .parcelrc can be found + /// .atlaspackrc can be found pub fallback_config: Option<&'a str>, } -/// Loads and validates .parcel_rc config -pub struct ParcelRcConfigLoader { +/// Loads and validates .atlaspack_rc config +pub struct AtlaspackRcConfigLoader { fs: FileSystemRef, package_manager: PackageManagerRef, } -impl ParcelRcConfigLoader { +impl AtlaspackRcConfigLoader { pub fn new(fs: FileSystemRef, package_manager: PackageManagerRef) -> Self { - ParcelRcConfigLoader { + AtlaspackRcConfigLoader { fs, package_manager, } @@ -47,8 +47,8 @@ impl ParcelRcConfigLoader { fn find_config(&self, project_root: &Path, path: &Path) -> Result { let from = path.parent().unwrap_or(path); - find_ancestor_file(&*self.fs, &[".parcelrc"], from, project_root) - .ok_or_else(|| diagnostic_error!("Unable to locate .parcelrc from {}", from.display())) + find_ancestor_file(&*self.fs, &[".atlaspackrc"], from, project_root) + .ok_or_else(|| diagnostic_error!("Unable to locate .atlaspackrc from {}", from.display())) } fn resolve_from(&self, project_root: &Path) -> PathBuf { @@ -69,7 +69,7 @@ impl ParcelRcConfigLoader { fn load_config( &self, path: PathBuf, - ) -> Result<(PartialParcelConfig, Vec), DiagnosticError> { + ) -> Result<(PartialAtlaspackConfig, Vec), DiagnosticError> { let raw = self.fs.read_to_string(&path).map_err(|source| { diagnostic_error!(DiagnosticBuilder::default() .message(source.to_string()) @@ -86,7 +86,7 @@ impl ParcelRcConfigLoader { ) })?; - self.process_config(ParcelRcFile { + self.process_config(AtlaspackRcFile { contents, path, raw, @@ -95,26 +95,26 @@ impl ParcelRcConfigLoader { fn resolve_extends( &self, - parcel_rc_file: &ParcelRcFile, + atlaspack_rc_file: &AtlaspackRcFile, extend: &str, ) -> Result { let path = if extend.starts_with(".") { - parcel_rc_file + atlaspack_rc_file .path .parent() - .unwrap_or(&parcel_rc_file.path) + .unwrap_or(&atlaspack_rc_file.path) .join(extend) } else { self .package_manager - .resolve(extend, &parcel_rc_file.path) + .resolve(extend, &atlaspack_rc_file.path) .map_err(|source| { source.context(diagnostic_error!(DiagnosticBuilder::default() .message(format!( "Failed to resolve extended config {extend} from {}", - parcel_rc_file.path.display() + atlaspack_rc_file.path.display() )) - .code_frames(vec![CodeFrame::from(File::from(parcel_rc_file))]))) + .code_frames(vec![CodeFrame::from(File::from(atlaspack_rc_file))]))) })? .resolved }; @@ -123,14 +123,14 @@ impl ParcelRcConfigLoader { diagnostic_error!("{}", source).context(diagnostic_error!(DiagnosticBuilder::default() .message(format!( "Failed to resolve extended config {extend} from {}", - parcel_rc_file.path.display() + atlaspack_rc_file.path.display() )) - .code_frames(vec![CodeFrame::from(File::from(parcel_rc_file))]))) + .code_frames(vec![CodeFrame::from(File::from(atlaspack_rc_file))]))) }) } - /// Processes a .parcelrc file by loading and merging "extends" configurations into a single - /// PartialParcelConfig struct + /// Processes a .atlaspackrc file by loading and merging "extends" configurations into a single + /// PartialAtlaspackConfig struct /// /// Configuration merging will be applied to all "extends" configurations, before being merged /// into the base config for a more natural merging order. It will replace any "..." seen in @@ -138,10 +138,10 @@ impl ParcelRcConfigLoader { /// fn process_config( &self, - parcel_rc_file: ParcelRcFile, - ) -> Result<(PartialParcelConfig, Vec), DiagnosticError> { - let mut files = vec![parcel_rc_file.path.clone()]; - let extends = parcel_rc_file.contents.extends.as_ref(); + atlaspack_rc_file: AtlaspackRcFile, + ) -> Result<(PartialAtlaspackConfig, Vec), DiagnosticError> { + let mut files = vec![atlaspack_rc_file.path.clone()]; + let extends = atlaspack_rc_file.contents.extends.as_ref(); let extends = match extends { None => Vec::new(), Some(extends) => match extends { @@ -151,33 +151,33 @@ impl ParcelRcConfigLoader { }; if extends.is_empty() { - return Ok((PartialParcelConfig::try_from(parcel_rc_file)?, files)); + return Ok((PartialAtlaspackConfig::try_from(atlaspack_rc_file)?, files)); } - let mut merged_config: Option = None; + let mut merged_config: Option = None; for extend in extends { - let extended_file_path = self.resolve_extends(&parcel_rc_file, &extend)?; + let extended_file_path = self.resolve_extends(&atlaspack_rc_file, &extend)?; let (extended_config, mut extended_file_paths) = self.load_config(extended_file_path)?; merged_config = match merged_config { None => Some(extended_config), - Some(config) => Some(PartialParcelConfig::merge(config, extended_config)), + Some(config) => Some(PartialAtlaspackConfig::merge(config, extended_config)), }; files.append(&mut extended_file_paths); } - let config = PartialParcelConfig::merge( - PartialParcelConfig::try_from(parcel_rc_file)?, + let config = PartialAtlaspackConfig::merge( + PartialAtlaspackConfig::try_from(atlaspack_rc_file)?, merged_config.unwrap(), ); Ok((config, files)) } - /// Finds and loads a .parcelrc file + /// Finds and loads a .atlaspackrc file /// - /// By default the nearest .parcelrc ancestor file from the current working directory will be + /// By default the nearest .atlaspackrc ancestor file from the current working directory will be /// loaded, unless the config or fallback_config option are specified. In cases where the /// current working directory does not live within the project root, the default config will be /// loaded from the project root. @@ -186,7 +186,7 @@ impl ParcelRcConfigLoader { &self, project_root: &Path, options: LoadConfigOptions, - ) -> Result<(ParcelConfig, Vec), DiagnosticError> { + ) -> Result<(AtlaspackConfig, Vec), DiagnosticError> { let resolve_from = self.resolve_from(project_root); let mut config_path = match options.config { Some(config) => self @@ -218,15 +218,17 @@ impl ParcelRcConfigLoader { } let config_path = config_path?; - let (mut parcel_config, files) = self.load_config(config_path)?; + let (mut atlaspack_config, files) = self.load_config(config_path)?; if options.additional_reporters.len() > 0 { - parcel_config.reporters.extend(options.additional_reporters); + atlaspack_config + .reporters + .extend(options.additional_reporters); } - let parcel_config = ParcelConfig::try_from(parcel_config)?; + let atlaspack_config = AtlaspackConfig::try_from(atlaspack_config)?; - Ok((parcel_config, files)) + Ok((atlaspack_config, files)) } } @@ -256,12 +258,12 @@ mod tests { use std::sync::Arc; use anyhow::anyhow; + use atlaspack_filesystem::in_memory_file_system::InMemoryFileSystem; + use atlaspack_filesystem::FileSystem; + use atlaspack_package_manager::MockPackageManager; + use atlaspack_package_manager::PackageManager; + use atlaspack_package_manager::Resolution; use mockall::predicate::eq; - use parcel_filesystem::in_memory_file_system::InMemoryFileSystem; - use parcel_filesystem::FileSystem; - use parcel_package_manager::MockPackageManager; - use parcel_package_manager::PackageManager; - use parcel_package_manager::Resolution; use super::*; @@ -323,110 +325,122 @@ mod tests { } mod empty_config_and_fallback { - use crate::parcel_config_fixtures::default_config; - use crate::parcel_config_fixtures::default_extended_config; + use crate::atlaspack_config_fixtures::default_config; + use crate::atlaspack_config_fixtures::default_extended_config; use super::*; #[test] - fn errors_on_missing_parcelrc_file() { + fn errors_on_missing_atlaspackrc_file() { let fs = Arc::new(InMemoryFileSystem::default()); let project_root = fs.cwd().unwrap(); - let err = ParcelRcConfigLoader::new(fs, Arc::new(MockPackageManager::new())) + let err = AtlaspackRcConfigLoader::new(fs, Arc::new(MockPackageManager::new())) .load(&project_root, LoadConfigOptions::default()) .map_err(|e| e.to_string()); assert_eq!( err, Err(format!( - "Unable to locate .parcelrc from {}", + "Unable to locate .atlaspackrc from {}", project_root.display() )) ); } #[test] - fn errors_on_failed_extended_parcelrc_resolution() { + fn errors_on_failed_extended_atlaspackrc_resolution() { let fs = Arc::new(InMemoryFileSystem::default()); let project_root = fs.cwd().unwrap(); let config = default_extended_config(&project_root); - fs.write_file(&config.base_config.path, config.base_config.parcel_rc); + fs.write_file(&config.base_config.path, config.base_config.atlaspack_rc); let fs: FileSystemRef = fs; let package_manager = Arc::new(TestPackageManager { fs: Arc::clone(&fs), }); - let err = ParcelRcConfigLoader::new(Arc::clone(&fs), package_manager) + let err = AtlaspackRcConfigLoader::new(Arc::clone(&fs), package_manager) .load(&project_root, LoadConfigOptions::default()) .map_err(|e| e.to_string()); assert_eq!( err, Err(format!( - "Failed to resolve extended config @parcel/config-default from {}", + "Failed to resolve extended config @atlaspack/config-default from {}", config.base_config.path.display() )) ); } #[test] - fn returns_default_parcel_config() { + fn returns_default_atlaspack_config() { let fs = Arc::new(InMemoryFileSystem::default()); let project_root = fs.cwd().unwrap(); - let default_config = default_config(Arc::new(project_root.join(".parcelrc"))); + let default_config = default_config(Arc::new(project_root.join(".atlaspackrc"))); let files = vec![default_config.path.clone()]; - fs.write_file(&default_config.path, default_config.parcel_rc); + fs.write_file(&default_config.path, default_config.atlaspack_rc); - let parcel_config = ParcelRcConfigLoader::new(fs, Arc::new(MockPackageManager::default())) - .load(&project_root, LoadConfigOptions::default()) - .map_err(|e| e.to_string()); + let atlaspack_config = + AtlaspackRcConfigLoader::new(fs, Arc::new(MockPackageManager::default())) + .load(&project_root, LoadConfigOptions::default()) + .map_err(|e| e.to_string()); - assert_eq!(parcel_config, Ok((default_config.parcel_config, files))); + assert_eq!( + atlaspack_config, + Ok((default_config.atlaspack_config, files)) + ); } #[test] - fn returns_default_parcel_config_from_project_root() { + fn returns_default_atlaspack_config_from_project_root() { let fs = Arc::new(InMemoryFileSystem::default()); let project_root = fs.cwd().unwrap().join("src").join("packages").join("root"); - let default_config = default_config(Arc::new(project_root.join(".parcelrc"))); + let default_config = default_config(Arc::new(project_root.join(".atlaspackrc"))); let files = vec![default_config.path.clone()]; - fs.write_file(&default_config.path, default_config.parcel_rc); + fs.write_file(&default_config.path, default_config.atlaspack_rc); - let parcel_config = ParcelRcConfigLoader::new(fs, Arc::new(MockPackageManager::default())) - .load(&project_root, LoadConfigOptions::default()) - .map_err(|e| e.to_string()); + let atlaspack_config = + AtlaspackRcConfigLoader::new(fs, Arc::new(MockPackageManager::default())) + .load(&project_root, LoadConfigOptions::default()) + .map_err(|e| e.to_string()); - assert_eq!(parcel_config, Ok((default_config.parcel_config, files))); + assert_eq!( + atlaspack_config, + Ok((default_config.atlaspack_config, files)) + ); } #[test] - fn returns_default_parcel_config_from_project_root_when_outside_cwd() { + fn returns_default_atlaspack_config_from_project_root_when_outside_cwd() { let fs = Arc::new(InMemoryFileSystem::default()); let project_root = PathBuf::from("/root"); - let default_config = default_config(Arc::new(project_root.join(".parcelrc"))); + let default_config = default_config(Arc::new(project_root.join(".atlaspackrc"))); let files = vec![default_config.path.clone()]; fs.set_current_working_directory(Path::new("/cwd")); - fs.write_file(&default_config.path, default_config.parcel_rc); + fs.write_file(&default_config.path, default_config.atlaspack_rc); - let parcel_config = ParcelRcConfigLoader::new(fs, Arc::new(MockPackageManager::default())) - .load(&project_root, LoadConfigOptions::default()) - .map_err(|e| e.to_string()); + let atlaspack_config = + AtlaspackRcConfigLoader::new(fs, Arc::new(MockPackageManager::default())) + .load(&project_root, LoadConfigOptions::default()) + .map_err(|e| e.to_string()); - assert_eq!(parcel_config, Ok((default_config.parcel_config, files))); + assert_eq!( + atlaspack_config, + Ok((default_config.atlaspack_config, files)) + ); } #[test] - fn returns_merged_default_parcel_config() { + fn returns_merged_default_atlaspack_config() { let fs = Arc::new(InMemoryFileSystem::default()); let project_root = fs.cwd().unwrap(); @@ -438,12 +452,12 @@ mod tests { fs.write_file( &default_config.base_config.path, - default_config.base_config.parcel_rc, + default_config.base_config.atlaspack_rc, ); fs.write_file( &default_config.extended_config.path, - default_config.extended_config.parcel_rc, + default_config.extended_config.atlaspack_rc, ); let fs: FileSystemRef = fs; @@ -451,19 +465,22 @@ mod tests { fs: Arc::clone(&fs), }); - let parcel_config = ParcelRcConfigLoader::new(Arc::clone(&fs), package_manager) + let atlaspack_config = AtlaspackRcConfigLoader::new(Arc::clone(&fs), package_manager) .load(&project_root, LoadConfigOptions::default()) .map_err(|e| e.to_string()); - assert_eq!(parcel_config, Ok((default_config.parcel_config, files))); + assert_eq!( + atlaspack_config, + Ok((default_config.atlaspack_config, files)) + ); } } mod config { - use parcel_core::types::Diagnostic; + use atlaspack_core::types::Diagnostic; - use crate::parcel_config_fixtures::config; - use crate::parcel_config_fixtures::extended_config; + use crate::atlaspack_config_fixtures::config; + use crate::atlaspack_config_fixtures::extended_config; use super::*; @@ -477,7 +494,7 @@ mod tests { let package_manager = Arc::new(package_manager); - let err = ParcelRcConfigLoader::new(fs, package_manager) + let err = AtlaspackRcConfigLoader::new(fs, package_manager) .load( &&project_root, LoadConfigOptions { @@ -504,14 +521,14 @@ mod tests { let (specifier, config) = extended_config(&project_root); - fs.write_file(&config.base_config.path, config.base_config.parcel_rc); + fs.write_file(&config.base_config.path, config.base_config.atlaspack_rc); let fs: FileSystemRef = fs; let package_manager = Arc::new(TestPackageManager { fs: Arc::clone(&fs), }); - let err = ParcelRcConfigLoader::new(Arc::clone(&fs), package_manager) + let err = AtlaspackRcConfigLoader::new(Arc::clone(&fs), package_manager) .load( &project_root, LoadConfigOptions { @@ -525,7 +542,7 @@ mod tests { assert_eq!( err, Err(format!( - "Failed to resolve extended config @parcel/config-default from {}", + "Failed to resolve extended config @atlaspack/config-default from {}", config.base_config.path.display() )) ); @@ -537,7 +554,7 @@ mod tests { let mut package_manager = MockPackageManager::new(); let project_root = fs.cwd().unwrap(); - fs.write_file(&project_root.join(".parcelrc"), String::from("{}")); + fs.write_file(&project_root.join(".atlaspackrc"), String::from("{}")); let config_path = package_manager_resolution( &mut package_manager, @@ -548,7 +565,7 @@ mod tests { let fs: FileSystemRef = fs; let package_manager = Arc::new(package_manager); - let err = ParcelRcConfigLoader::new(fs, package_manager) + let err = AtlaspackRcConfigLoader::new(fs, package_manager) .load( &project_root, LoadConfigOptions { @@ -566,7 +583,9 @@ mod tests { DiagnosticBuilder::default() .code_frames(vec![CodeFrame::from(config_path)]) .message("File not found") - .origin(Some(String::from("parcel_config::parcel_rc_config_loader"))) + .origin(Some(String::from( + "atlaspack_config::atlaspack_rc_config_loader" + ))) .build() .unwrap() ); @@ -580,15 +599,15 @@ mod tests { let (specifier, specified_config) = config(&project_root); let files = vec![specified_config.path.clone()]; - fs.write_file(&project_root.join(".parcelrc"), String::from("{}")); - fs.write_file(&specified_config.path, specified_config.parcel_rc); + fs.write_file(&project_root.join(".atlaspackrc"), String::from("{}")); + fs.write_file(&specified_config.path, specified_config.atlaspack_rc); let fs: FileSystemRef = fs; let package_manager = Arc::new(TestPackageManager { fs: Arc::clone(&fs), }); - let parcel_config = ParcelRcConfigLoader::new(Arc::clone(&fs), package_manager) + let atlaspack_config = AtlaspackRcConfigLoader::new(Arc::clone(&fs), package_manager) .load( &project_root, LoadConfigOptions { @@ -599,16 +618,19 @@ mod tests { ) .map_err(|e| e.to_string()); - assert_eq!(parcel_config, Ok((specified_config.parcel_config, files))); + assert_eq!( + atlaspack_config, + Ok((specified_config.atlaspack_config, files)) + ); } } mod fallback_config { - use parcel_core::types::Diagnostic; + use atlaspack_core::types::Diagnostic; - use crate::parcel_config_fixtures::default_config; - use crate::parcel_config_fixtures::extended_config; - use crate::parcel_config_fixtures::fallback_config; + use crate::atlaspack_config_fixtures::default_config; + use crate::atlaspack_config_fixtures::extended_config; + use crate::atlaspack_config_fixtures::fallback_config; use super::*; @@ -622,13 +644,13 @@ mod tests { let package_manager = Arc::new(package_manager); - let err = ParcelRcConfigLoader::new(fs, package_manager) + let err = AtlaspackRcConfigLoader::new(fs, package_manager) .load( &project_root, LoadConfigOptions { additional_reporters: Vec::new(), config: None, - fallback_config: Some("@parcel/config-default"), + fallback_config: Some("@atlaspack/config-default"), }, ) .map_err(|e| e.to_string()); @@ -636,7 +658,7 @@ mod tests { assert_eq!( err, Err(format!( - "Failed to resolve fallback @parcel/config-default from {}", + "Failed to resolve fallback @atlaspack/config-default from {}", project_root.join("index").display() )) ); @@ -649,14 +671,17 @@ mod tests { let (fallback_specifier, fallback) = extended_config(&project_root); - fs.write_file(&fallback.base_config.path, fallback.base_config.parcel_rc); + fs.write_file( + &fallback.base_config.path, + fallback.base_config.atlaspack_rc, + ); let fs: FileSystemRef = fs; let package_manager = Arc::new(TestPackageManager { fs: Arc::clone(&fs), }); - let err = ParcelRcConfigLoader::new(Arc::clone(&fs), package_manager) + let err = AtlaspackRcConfigLoader::new(Arc::clone(&fs), package_manager) .load( &project_root, LoadConfigOptions { @@ -670,7 +695,7 @@ mod tests { assert_eq!( err, Err(format!( - "Failed to resolve extended config @parcel/config-default from {}", + "Failed to resolve extended config @atlaspack/config-default from {}", fallback.base_config.path.display() )) ); @@ -684,19 +709,19 @@ mod tests { let fallback_config_path = package_manager_resolution( &mut package_manager, - String::from("@parcel/config-default"), + String::from("@atlaspack/config-default"), project_root.join("index"), ); let package_manager = Arc::new(package_manager); - let err = ParcelRcConfigLoader::new(fs, package_manager) + let err = AtlaspackRcConfigLoader::new(fs, package_manager) .load( &project_root, LoadConfigOptions { additional_reporters: Vec::new(), config: None, - fallback_config: Some("@parcel/config-default"), + fallback_config: Some("@atlaspack/config-default"), }, ) .unwrap_err() @@ -708,21 +733,23 @@ mod tests { DiagnosticBuilder::default() .code_frames(vec![CodeFrame::from(fallback_config_path)]) .message("File not found") - .origin(Some(String::from("parcel_config::parcel_rc_config_loader"))) + .origin(Some(String::from( + "atlaspack_config::atlaspack_rc_config_loader" + ))) .build() .unwrap() ); } #[test] - fn returns_project_root_parcel_rc() { + fn returns_project_root_atlaspack_rc() { let fs = Arc::new(InMemoryFileSystem::default()); let project_root = fs.cwd().unwrap(); let (fallback_specifier, fallback) = fallback_config(&project_root); - let project_root_config = default_config(Arc::new(project_root.join(".parcelrc"))); + let project_root_config = default_config(Arc::new(project_root.join(".atlaspackrc"))); - fs.write_file(&project_root_config.path, project_root_config.parcel_rc); + fs.write_file(&project_root_config.path, project_root_config.atlaspack_rc); fs.write_file(&fallback.path, String::from("{}")); let fs: FileSystemRef = fs; @@ -730,7 +757,7 @@ mod tests { fs: Arc::clone(&fs), }); - let parcel_config = ParcelRcConfigLoader::new(Arc::clone(&fs), package_manager) + let atlaspack_config = AtlaspackRcConfigLoader::new(Arc::clone(&fs), package_manager) .load( &project_root, LoadConfigOptions { @@ -742,30 +769,30 @@ mod tests { .map_err(|e| e.to_string()); assert_eq!( - parcel_config, + atlaspack_config, Ok(( - project_root_config.parcel_config, + project_root_config.atlaspack_config, vec!(project_root_config.path) )) ); } #[test] - fn returns_fallback_config_when_parcel_rc_is_missing() { + fn returns_fallback_config_when_atlaspack_rc_is_missing() { let fs = Arc::new(InMemoryFileSystem::default()); let project_root = fs.cwd().unwrap(); let (fallback_specifier, fallback) = fallback_config(&project_root); let files = vec![fallback.path.clone()]; - fs.write_file(&fallback.path, fallback.parcel_rc); + fs.write_file(&fallback.path, fallback.atlaspack_rc); let fs: FileSystemRef = fs; let package_manager = Arc::new(TestPackageManager { fs: Arc::clone(&fs), }); - let parcel_config = ParcelRcConfigLoader::new(Arc::clone(&fs), package_manager) + let atlaspack_config = AtlaspackRcConfigLoader::new(Arc::clone(&fs), package_manager) .load( &project_root, LoadConfigOptions { @@ -776,13 +803,13 @@ mod tests { ) .map_err(|e| e.to_string()); - assert_eq!(parcel_config, Ok((fallback.parcel_config, files))); + assert_eq!(atlaspack_config, Ok((fallback.atlaspack_config, files))); } } mod fallback_with_config { - use crate::parcel_config_fixtures::config; - use crate::parcel_config_fixtures::fallback_config; + use crate::atlaspack_config_fixtures::config; + use crate::atlaspack_config_fixtures::fallback_config; use super::*; @@ -796,15 +823,15 @@ mod tests { let files = vec![config.path.clone()]; - fs.write_file(&config.path, config.parcel_rc); - fs.write_file(&fallback_config.path, fallback_config.parcel_rc); + fs.write_file(&config.path, config.atlaspack_rc); + fs.write_file(&fallback_config.path, fallback_config.atlaspack_rc); let fs: FileSystemRef = fs; let package_manager = Arc::new(TestPackageManager { fs: Arc::clone(&fs), }); - let parcel_config = ParcelRcConfigLoader::new(Arc::clone(&fs), package_manager) + let atlaspack_config = AtlaspackRcConfigLoader::new(Arc::clone(&fs), package_manager) .load( &project_root, LoadConfigOptions { @@ -815,7 +842,7 @@ mod tests { ) .map_err(|e| e.to_string()); - assert_eq!(parcel_config, Ok((config.parcel_config, files))); + assert_eq!(atlaspack_config, Ok((config.atlaspack_config, files))); } #[test] @@ -828,14 +855,14 @@ mod tests { let files = vec![fallback.path.clone()]; - fs.write_file(&fallback.path, fallback.parcel_rc); + fs.write_file(&fallback.path, fallback.atlaspack_rc); let fs: FileSystemRef = fs; let package_manager = Arc::new(TestPackageManager { fs: Arc::clone(&fs), }); - let parcel_config = ParcelRcConfigLoader::new(Arc::clone(&fs), package_manager) + let atlaspack_config = AtlaspackRcConfigLoader::new(Arc::clone(&fs), package_manager) .load( &project_root, LoadConfigOptions { @@ -846,7 +873,7 @@ mod tests { ) .map_err(|e| e.to_string()); - assert_eq!(parcel_config, Ok((fallback.parcel_config, files))); + assert_eq!(atlaspack_config, Ok((fallback.atlaspack_config, files))); } } } diff --git a/crates/atlaspack_config/src/lib.rs b/crates/atlaspack_config/src/lib.rs new file mode 100644 index 000000000..3597a1447 --- /dev/null +++ b/crates/atlaspack_config/src/lib.rs @@ -0,0 +1,9 @@ +pub mod atlaspack_config; +pub mod atlaspack_config_fixtures; +pub mod atlaspack_rc; +pub mod atlaspack_rc_config_loader; +pub mod map; +mod partial_atlaspack_config; + +pub use atlaspack_config::AtlaspackConfig; +pub use atlaspack_config::PluginNode; diff --git a/crates/parcel_config/src/map.rs b/crates/atlaspack_config/src/map.rs similarity index 100% rename from crates/parcel_config/src/map.rs rename to crates/atlaspack_config/src/map.rs diff --git a/crates/parcel_config/src/map/matcher.rs b/crates/atlaspack_config/src/map/matcher.rs similarity index 100% rename from crates/parcel_config/src/map/matcher.rs rename to crates/atlaspack_config/src/map/matcher.rs diff --git a/crates/parcel_config/src/map/named_pipelines_map.rs b/crates/atlaspack_config/src/map/named_pipelines_map.rs similarity index 95% rename from crates/parcel_config/src/map/named_pipelines_map.rs rename to crates/atlaspack_config/src/map/named_pipelines_map.rs index a92eff3b2..e46432aba 100644 --- a/crates/parcel_config/src/map/named_pipelines_map.rs +++ b/crates/atlaspack_config/src/map/named_pipelines_map.rs @@ -21,7 +21,7 @@ pub struct NamedPattern<'a> { pub use_fallback: bool, } -/// Represents fields in .parcelrc that map a pattern or named pattern to a list of plugin names +/// Represents fields in .atlaspackrc that map a pattern or named pattern to a list of plugin names /// /// # Examples /// @@ -30,12 +30,12 @@ pub struct NamedPattern<'a> { /// use std::sync::Arc; /// /// use indexmap::indexmap; -/// use parcel_config::map::NamedPipelinesMap; -/// use parcel_config::PluginNode; +/// use atlaspack_config::map::NamedPipelinesMap; +/// use atlaspack_config::PluginNode; /// /// NamedPipelinesMap::new(indexmap! { /// String::from("*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}") => vec![PluginNode { -/// package_name: String::from("@parcel/transformer-js"), +/// package_name: String::from("@atlaspack/transformer-js"), /// resolve_from: Arc::new(PathBuf::default()), /// }] /// }); @@ -75,17 +75,17 @@ impl NamedPipelinesMap { /// use std::sync::Arc; /// /// use indexmap::indexmap; - /// use parcel_config::map::NamedPattern; - /// use parcel_config::map::NamedPipelinesMap; - /// use parcel_config::PluginNode; + /// use atlaspack_config::map::NamedPattern; + /// use atlaspack_config::map::NamedPipelinesMap; + /// use atlaspack_config::PluginNode; /// /// let pipelines_map = NamedPipelinesMap::new(indexmap! { /// String::from("types:*.{ts,tsx}") => vec![PluginNode { - /// package_name: String::from("@parcel/transformer-typescript-types"), + /// package_name: String::from("@atlaspack/transformer-typescript-types"), /// resolve_from: Arc::new(PathBuf::default()), /// }], /// String::from("*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}") => vec![PluginNode { - /// package_name: String::from("@parcel/transformer-js"), + /// package_name: String::from("@atlaspack/transformer-js"), /// resolve_from: Arc::new(PathBuf::default()), /// }], /// }); @@ -166,7 +166,7 @@ mod tests { fn pipelines(name: &str) -> Vec { vec![PluginNode { - package_name: format!("@parcel/plugin-{}", name), + package_name: format!("@atlaspack/plugin-{}", name), resolve_from: Arc::new(PathBuf::default()), }] } diff --git a/crates/parcel_config/src/map/pipeline_map.rs b/crates/atlaspack_config/src/map/pipeline_map.rs similarity index 86% rename from crates/parcel_config/src/map/pipeline_map.rs rename to crates/atlaspack_config/src/map/pipeline_map.rs index b2ad6767d..49d8306d2 100644 --- a/crates/parcel_config/src/map/pipeline_map.rs +++ b/crates/atlaspack_config/src/map/pipeline_map.rs @@ -7,7 +7,7 @@ use serde::Serialize; use super::pattern_matcher; use crate::PluginNode; -/// Represents fields in .parcelrc that map a pattern to a single plugin name +/// Represents fields in .atlaspackrc that map a pattern to a single plugin name /// /// # Examples /// @@ -16,12 +16,12 @@ use crate::PluginNode; /// use std::sync::Arc; /// /// use indexmap::indexmap; -/// use parcel_config::map::PipelineMap; -/// use parcel_config::PluginNode; +/// use atlaspack_config::map::PipelineMap; +/// use atlaspack_config::PluginNode; /// /// PipelineMap::new(indexmap! { /// String::from("*.{js,mjs,cjs}") => PluginNode { -/// package_name: String::from("@parcel/packager-js"), +/// package_name: String::from("@atlaspack/packager-js"), /// resolve_from: Arc::new(PathBuf::default()), /// } /// }); @@ -48,12 +48,12 @@ impl PipelineMap { /// use std::sync::Arc; /// /// use indexmap::indexmap; - /// use parcel_config::map::PipelineMap; - /// use parcel_config::PluginNode; + /// use atlaspack_config::map::PipelineMap; + /// use atlaspack_config::PluginNode; /// /// let pipeline_map = PipelineMap::new(indexmap! { /// String::from("*.{js,mjs,cjs}") => PluginNode { - /// package_name: String::from("@parcel/packager-js"), + /// package_name: String::from("@atlaspack/packager-js"), /// resolve_from: Arc::new(PathBuf::default()), /// } /// }); @@ -88,7 +88,7 @@ mod tests { fn pipeline(name: &str) -> PluginNode { PluginNode { - package_name: format!("@parcel/plugin-{}", name), + package_name: format!("@atlaspack/plugin-{}", name), resolve_from: Arc::new(PathBuf::default()), } } diff --git a/crates/parcel_config/src/map/pipelines_map.rs b/crates/atlaspack_config/src/map/pipelines_map.rs similarity index 86% rename from crates/parcel_config/src/map/pipelines_map.rs rename to crates/atlaspack_config/src/map/pipelines_map.rs index 9f6895ef8..a342ec13d 100644 --- a/crates/parcel_config/src/map/pipelines_map.rs +++ b/crates/atlaspack_config/src/map/pipelines_map.rs @@ -7,7 +7,7 @@ use serde::Serialize; use super::pattern_matcher; use crate::PluginNode; -/// Represents fields in .parcelrc that map a pattern to a list of plugin names +/// Represents fields in .atlaspackrc that map a pattern to a list of plugin names /// /// # Examples /// @@ -16,12 +16,12 @@ use crate::PluginNode; /// use std::sync::Arc; /// /// use indexmap::indexmap; -/// use parcel_config::map::PipelinesMap; -/// use parcel_config::PluginNode; +/// use atlaspack_config::map::PipelinesMap; +/// use atlaspack_config::PluginNode; /// /// PipelinesMap::new(indexmap! { /// String::from("*") => vec![PluginNode { -/// package_name: String::from("@parcel/compressor-raw"), +/// package_name: String::from("@atlaspack/compressor-raw"), /// resolve_from: Arc::new(PathBuf::default()), /// }] /// }); @@ -48,12 +48,12 @@ impl PipelinesMap { /// use std::sync::Arc; /// /// use indexmap::indexmap; - /// use parcel_config::map::PipelinesMap; - /// use parcel_config::PluginNode; + /// use atlaspack_config::map::PipelinesMap; + /// use atlaspack_config::PluginNode; /// /// let pipelines_map = PipelinesMap::new(indexmap! { /// String::from("*") => vec![PluginNode { - /// package_name: String::from("@parcel/compressor-raw"), + /// package_name: String::from("@atlaspack/compressor-raw"), /// resolve_from: Arc::new(PathBuf::default()), /// }] /// }); @@ -84,7 +84,7 @@ mod tests { fn pipelines(name: &str) -> Vec { vec![PluginNode { - package_name: format!("@parcel/plugin-{}", name), + package_name: format!("@atlaspack/plugin-{}", name), resolve_from: Arc::new(PathBuf::default()), }] } diff --git a/crates/parcel_config/src/partial_parcel_config.rs b/crates/atlaspack_config/src/partial_atlaspack_config.rs similarity index 78% rename from crates/parcel_config/src/partial_parcel_config.rs rename to crates/atlaspack_config/src/partial_atlaspack_config.rs index 525de5e08..a31c6899f 100644 --- a/crates/parcel_config/src/partial_parcel_config.rs +++ b/crates/atlaspack_config/src/partial_atlaspack_config.rs @@ -1,20 +1,20 @@ use std::collections::HashSet; use std::sync::Arc; +use atlaspack_core::types::DiagnosticError; use derive_builder::Builder; use indexmap::IndexMap; -use parcel_core::types::DiagnosticError; -use super::parcel_config::PluginNode; -use super::parcel_rc::ParcelRcFile; +use super::atlaspack_config::PluginNode; +use super::atlaspack_rc::AtlaspackRcFile; -/// An intermediate representation of the .parcelrc config +/// An intermediate representation of the .atlaspackrc config /// -/// This data structure is used to perform configuration merging, to eventually create a compelete ParcelConfig. +/// This data structure is used to perform configuration merging, to eventually create a compelete AtlaspackConfig. /// #[derive(Clone, Debug, Default, Builder, PartialEq)] #[builder(default)] -pub struct PartialParcelConfig { +pub struct PartialAtlaspackConfig { pub bundler: Option, pub compressors: IndexMap>, pub namers: Vec, @@ -27,10 +27,10 @@ pub struct PartialParcelConfig { pub validators: IndexMap>, } -impl TryFrom for PartialParcelConfig { +impl TryFrom for PartialAtlaspackConfig { type Error = DiagnosticError; - fn try_from(file: ParcelRcFile) -> Result { + fn try_from(file: AtlaspackRcFile) -> Result { // TODO Add validation here: multiple ..., plugin name format, reserved pipelines, etc let resolve_from = Arc::new(file.path.clone()); @@ -73,7 +73,7 @@ impl TryFrom for PartialParcelConfig { .unwrap_or(IndexMap::new()) }; - Ok(PartialParcelConfig { + Ok(PartialAtlaspackConfig { bundler: file .contents .bundler @@ -95,7 +95,7 @@ impl TryFrom for PartialParcelConfig { } } -impl PartialParcelConfig { +impl PartialAtlaspackConfig { fn merge_map( map: IndexMap, extend_map: IndexMap, @@ -137,14 +137,18 @@ impl PartialParcelConfig { map: IndexMap, extend_map: IndexMap, ) -> IndexMap { - PartialParcelConfig::merge_map(map, extend_map, |map, _extend_map| map) + PartialAtlaspackConfig::merge_map(map, extend_map, |map, _extend_map| map) } fn merge_pipelines_map( from_map: IndexMap>, extend_map: IndexMap>, ) -> IndexMap> { - PartialParcelConfig::merge_map(from_map, extend_map, PartialParcelConfig::merge_pipelines) + PartialAtlaspackConfig::merge_map( + from_map, + extend_map, + PartialAtlaspackConfig::merge_pipelines, + ) } fn merge_pipelines( @@ -178,36 +182,39 @@ impl PartialParcelConfig { } } - pub fn merge(from_config: PartialParcelConfig, extend_config: PartialParcelConfig) -> Self { - PartialParcelConfig { + pub fn merge(from_config: PartialAtlaspackConfig, extend_config: PartialAtlaspackConfig) -> Self { + PartialAtlaspackConfig { bundler: from_config.bundler.or(extend_config.bundler), - compressors: PartialParcelConfig::merge_pipelines_map( + compressors: PartialAtlaspackConfig::merge_pipelines_map( from_config.compressors, extend_config.compressors, ), - namers: PartialParcelConfig::merge_pipelines(from_config.namers, extend_config.namers), - optimizers: PartialParcelConfig::merge_pipelines_map( + namers: PartialAtlaspackConfig::merge_pipelines(from_config.namers, extend_config.namers), + optimizers: PartialAtlaspackConfig::merge_pipelines_map( from_config.optimizers, extend_config.optimizers, ), - packagers: PartialParcelConfig::merge_pipeline_map( + packagers: PartialAtlaspackConfig::merge_pipeline_map( from_config.packagers, extend_config.packagers, ), - reporters: PartialParcelConfig::merge_pipelines( + reporters: PartialAtlaspackConfig::merge_pipelines( from_config.reporters, extend_config.reporters, ), - resolvers: PartialParcelConfig::merge_pipelines( + resolvers: PartialAtlaspackConfig::merge_pipelines( from_config.resolvers, extend_config.resolvers, ), - runtimes: PartialParcelConfig::merge_pipelines(from_config.runtimes, extend_config.runtimes), - transformers: PartialParcelConfig::merge_pipelines_map( + runtimes: PartialAtlaspackConfig::merge_pipelines( + from_config.runtimes, + extend_config.runtimes, + ), + transformers: PartialAtlaspackConfig::merge_pipelines_map( from_config.transformers, extend_config.transformers, ), - validators: PartialParcelConfig::merge_pipelines_map( + validators: PartialAtlaspackConfig::merge_pipelines_map( from_config.validators, extend_config.validators, ), @@ -230,7 +237,7 @@ mod tests { #[test] fn uses_from_when_extend_missing() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .bundler(Some(PluginNode { package_name: String::from("a"), resolve_from: Arc::new(PathBuf::from("/")), @@ -238,16 +245,16 @@ mod tests { .build() .unwrap(); - let extend = PartialParcelConfig::default(); + let extend = PartialAtlaspackConfig::default(); let expected = from.clone(); - assert_eq!(PartialParcelConfig::merge(from, extend), expected); + assert_eq!(PartialAtlaspackConfig::merge(from, extend), expected); } #[test] fn uses_extend_when_from_missing() { - let from = PartialParcelConfig::default(); - let extend = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfig::default(); + let extend = PartialAtlaspackConfigBuilder::default() .bundler(Some(PluginNode { package_name: String::from("a"), resolve_from: Arc::new(PathBuf::from("/")), @@ -257,12 +264,12 @@ mod tests { let expected = extend.clone(); - assert_eq!(PartialParcelConfig::merge(from, extend), expected); + assert_eq!(PartialAtlaspackConfig::merge(from, extend), expected); } #[test] fn merges_using_from() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .bundler(Some(PluginNode { package_name: String::from("a"), resolve_from: Arc::new(PathBuf::from("/")), @@ -270,7 +277,7 @@ mod tests { .build() .unwrap(); - let extend = PartialParcelConfigBuilder::default() + let extend = PartialAtlaspackConfigBuilder::default() .bundler(Some(PluginNode { package_name: String::from("b"), resolve_from: Arc::new(PathBuf::from("/")), @@ -280,7 +287,7 @@ mod tests { let expected = from.clone(); - assert_eq!(PartialParcelConfig::merge(from, extend), expected); + assert_eq!(PartialAtlaspackConfig::merge(from, extend), expected); } } @@ -296,7 +303,7 @@ mod tests { #[test] fn uses_from_when_extend_missing() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("a"), @@ -306,16 +313,16 @@ mod tests { .build() .unwrap(); - let extend = PartialParcelConfig::default(); + let extend = PartialAtlaspackConfig::default(); let expected = from.clone(); - assert_eq!(PartialParcelConfig::merge(from, extend), expected); + assert_eq!(PartialAtlaspackConfig::merge(from, extend), expected); } #[test] fn uses_extend_when_from_missing() { - let from = PartialParcelConfig::default(); - let extend = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfig::default(); + let extend = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("a"), @@ -327,12 +334,12 @@ mod tests { let expected = extend.clone(); - assert_eq!(PartialParcelConfig::merge(from, extend), expected); + assert_eq!(PartialAtlaspackConfig::merge(from, extend), expected); } #[test] fn merges_patterns() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("a"), @@ -342,7 +349,7 @@ mod tests { .build() .unwrap(); - let extend = PartialParcelConfigBuilder::default() + let extend = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.{cjs,js,mjs}") => vec!(PluginNode { package_name: String::from("b"), @@ -353,8 +360,8 @@ mod tests { .unwrap(); assert_eq!( - PartialParcelConfig::merge(from, extend), - PartialParcelConfigBuilder::default() + PartialAtlaspackConfig::merge(from, extend), + PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("a"), @@ -372,7 +379,7 @@ mod tests { #[test] fn merges_pipelines_with_missing_dot_dot_dot() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("a"), @@ -385,7 +392,7 @@ mod tests { .build() .unwrap(); - let extend = PartialParcelConfigBuilder::default() + let extend = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("c"), @@ -397,12 +404,12 @@ mod tests { let expected = from.clone(); - assert_eq!(PartialParcelConfig::merge(from, extend), expected); + assert_eq!(PartialAtlaspackConfig::merge(from, extend), expected); } #[test] fn merges_pipelines_with_dot_dot_dot() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("a"), @@ -420,7 +427,7 @@ mod tests { .build() .unwrap(); - let extend = PartialParcelConfigBuilder::default() + let extend = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("b"), @@ -431,8 +438,8 @@ mod tests { .unwrap(); assert_eq!( - PartialParcelConfig::merge(from, extend), - PartialParcelConfigBuilder::default() + PartialAtlaspackConfig::merge(from, extend), + PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("a"), @@ -454,7 +461,7 @@ mod tests { #[test] fn merges_pipelines_with_dot_dot_dot_match_in_grandparent() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("a"), @@ -472,8 +479,8 @@ mod tests { .build() .unwrap(); - let extend_1 = PartialParcelConfig::default(); - let extend_2 = PartialParcelConfigBuilder::default() + let extend_1 = PartialAtlaspackConfig::default(); + let extend_2 = PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("b"), @@ -484,8 +491,11 @@ mod tests { .unwrap(); assert_eq!( - PartialParcelConfig::merge(PartialParcelConfig::merge(from, extend_1), extend_2), - PartialParcelConfigBuilder::default() + PartialAtlaspackConfig::merge( + PartialAtlaspackConfig::merge(from, extend_1), + extend_2 + ), + PartialAtlaspackConfigBuilder::default() .$property(indexmap! { String::from("*.js") => vec!(PluginNode { package_name: String::from("a"), @@ -518,7 +528,7 @@ mod tests { #[test] fn uses_from_when_extend_missing() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .$property(vec![PluginNode { package_name: String::from("a"), resolve_from: Arc::new(PathBuf::from("/")), @@ -526,16 +536,16 @@ mod tests { .build() .unwrap(); - let extend = PartialParcelConfig::default(); + let extend = PartialAtlaspackConfig::default(); let expected = from.clone(); - assert_eq!(PartialParcelConfig::merge(from, extend), expected); + assert_eq!(PartialAtlaspackConfig::merge(from, extend), expected); } #[test] fn uses_extend_when_from_missing() { - let from = PartialParcelConfig::default(); - let extend = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfig::default(); + let extend = PartialAtlaspackConfigBuilder::default() .$property(vec![PluginNode { package_name: String::from("a"), resolve_from: Arc::new(PathBuf::from("/")), @@ -545,12 +555,12 @@ mod tests { let expected = extend.clone(); - assert_eq!(PartialParcelConfig::merge(from, extend), expected); + assert_eq!(PartialAtlaspackConfig::merge(from, extend), expected); } #[test] fn merges_pipelines_with_missing_dot_dot_dot() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .$property(vec![ PluginNode { package_name: String::from("a"), @@ -564,7 +574,7 @@ mod tests { .build() .unwrap(); - let extend = PartialParcelConfigBuilder::default() + let extend = PartialAtlaspackConfigBuilder::default() .$property(vec![PluginNode { package_name: String::from("c"), resolve_from: Arc::new(PathBuf::from("/")), @@ -574,12 +584,12 @@ mod tests { let expected = from.clone(); - assert_eq!(PartialParcelConfig::merge(from, extend), expected); + assert_eq!(PartialAtlaspackConfig::merge(from, extend), expected); } #[test] fn merges_pipelines_with_dot_dot_dot() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .$property(vec![ PluginNode { package_name: String::from("a"), @@ -597,7 +607,7 @@ mod tests { .build() .unwrap(); - let extend = PartialParcelConfigBuilder::default() + let extend = PartialAtlaspackConfigBuilder::default() .$property(vec![PluginNode { package_name: String::from("b"), resolve_from: Arc::new(PathBuf::from("~")), @@ -606,8 +616,8 @@ mod tests { .unwrap(); assert_eq!( - PartialParcelConfig::merge(from, extend), - PartialParcelConfigBuilder::default() + PartialAtlaspackConfig::merge(from, extend), + PartialAtlaspackConfigBuilder::default() .$property(vec!( PluginNode { package_name: String::from("a"), @@ -629,7 +639,7 @@ mod tests { #[test] fn merges_pipelines_with_dot_dot_dot_match_in_grandparent() { - let from = PartialParcelConfigBuilder::default() + let from = PartialAtlaspackConfigBuilder::default() .$property(vec![ PluginNode { package_name: String::from("a"), @@ -647,8 +657,8 @@ mod tests { .build() .unwrap(); - let extend_1 = PartialParcelConfig::default(); - let extend_2 = PartialParcelConfigBuilder::default() + let extend_1 = PartialAtlaspackConfig::default(); + let extend_2 = PartialAtlaspackConfigBuilder::default() .$property(vec![PluginNode { package_name: String::from("b"), resolve_from: Arc::new(PathBuf::from("~")), @@ -657,8 +667,11 @@ mod tests { .unwrap(); assert_eq!( - PartialParcelConfig::merge(PartialParcelConfig::merge(from, extend_1), extend_2), - PartialParcelConfigBuilder::default() + PartialAtlaspackConfig::merge( + PartialAtlaspackConfig::merge(from, extend_1), + extend_2 + ), + PartialAtlaspackConfigBuilder::default() .$property(vec!( PluginNode { package_name: String::from("a"), diff --git a/crates/parcel_core/Cargo.toml b/crates/atlaspack_core/Cargo.toml similarity index 78% rename from crates/parcel_core/Cargo.toml rename to crates/atlaspack_core/Cargo.toml index c01f2a576..c77643dbf 100644 --- a/crates/parcel_core/Cargo.toml +++ b/crates/atlaspack_core/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "parcel_core" +name = "atlaspack_core" version = "0.1.0" edition = "2021" -description = "Core logic and types for the parcel bundler" +description = "Core logic and types for the atlaspack bundler" [features] default = [] [dependencies] -parcel_filesystem = { path = "../parcel_filesystem" } +atlaspack_filesystem = { path = "../atlaspack_filesystem" } anyhow = "1.0.82" bitflags = "2.5.0" diff --git a/crates/parcel_core/src/asset_graph.rs b/crates/atlaspack_core/src/asset_graph.rs similarity index 100% rename from crates/parcel_core/src/asset_graph.rs rename to crates/atlaspack_core/src/asset_graph.rs diff --git a/crates/parcel_core/src/bundle_graph.rs b/crates/atlaspack_core/src/bundle_graph.rs similarity index 100% rename from crates/parcel_core/src/bundle_graph.rs rename to crates/atlaspack_core/src/bundle_graph.rs diff --git a/crates/parcel_core/src/cache.rs b/crates/atlaspack_core/src/cache.rs similarity index 100% rename from crates/parcel_core/src/cache.rs rename to crates/atlaspack_core/src/cache.rs diff --git a/crates/parcel_core/src/config_loader.rs b/crates/atlaspack_core/src/config_loader.rs similarity index 98% rename from crates/parcel_core/src/config_loader.rs rename to crates/atlaspack_core/src/config_loader.rs index 3cc08d6df..18f6fd271 100644 --- a/crates/parcel_core/src/config_loader.rs +++ b/crates/atlaspack_core/src/config_loader.rs @@ -1,8 +1,8 @@ use std::path::PathBuf; use std::sync::Arc; -use parcel_filesystem::search::find_ancestor_file; -use parcel_filesystem::FileSystemRef; +use atlaspack_filesystem::search::find_ancestor_file; +use atlaspack_filesystem::FileSystemRef; use serde::de::DeserializeOwned; use crate::{ @@ -77,7 +77,7 @@ impl ConfigLoader { #[cfg(test)] mod tests { - use parcel_filesystem::in_memory_file_system::InMemoryFileSystem; + use atlaspack_filesystem::in_memory_file_system::InMemoryFileSystem; use super::*; @@ -230,7 +230,7 @@ mod tests { String::from( r#" { - "name": "parcel", + "name": "atlaspack", "version": "1.0.0", "plugin": { "enabled": true diff --git a/crates/parcel_core/src/hash.rs b/crates/atlaspack_core/src/hash.rs similarity index 85% rename from crates/parcel_core/src/hash.rs rename to crates/atlaspack_core/src/hash.rs index 1ae73da4e..0c30b8bf5 100644 --- a/crates/parcel_core/src/hash.rs +++ b/crates/atlaspack_core/src/hash.rs @@ -1,7 +1,7 @@ use xxhash_rust::xxh3::xxh3_64; use xxhash_rust::xxh3::Xxh3; -/// Parcel needs to use a hasher for generating certain identifiers used in caches. +/// Atlaspack needs to use a hasher for generating certain identifiers used in caches. /// /// The hashes don't need to be incredibly fast, but they should be stable across /// runs, machines, platforms and versions. diff --git a/crates/parcel_core/src/lib.rs b/crates/atlaspack_core/src/lib.rs similarity index 100% rename from crates/parcel_core/src/lib.rs rename to crates/atlaspack_core/src/lib.rs diff --git a/crates/parcel_core/src/plugin.rs b/crates/atlaspack_core/src/plugin.rs similarity index 96% rename from crates/parcel_core/src/plugin.rs rename to crates/atlaspack_core/src/plugin.rs index 6e8129feb..5f0f8c571 100644 --- a/crates/parcel_core/src/plugin.rs +++ b/crates/atlaspack_core/src/plugin.rs @@ -18,7 +18,7 @@ mod packager_plugin; pub use packager_plugin::*; mod reporter_plugin; -use parcel_filesystem::FileSystemRef; +use atlaspack_filesystem::FileSystemRef; pub use reporter_plugin::*; mod resolver_plugin; diff --git a/crates/parcel_core/src/plugin/bundler_plugin.rs b/crates/atlaspack_core/src/plugin/bundler_plugin.rs similarity index 100% rename from crates/parcel_core/src/plugin/bundler_plugin.rs rename to crates/atlaspack_core/src/plugin/bundler_plugin.rs diff --git a/crates/parcel_core/src/plugin/compressor_plugin.rs b/crates/atlaspack_core/src/plugin/compressor_plugin.rs similarity index 100% rename from crates/parcel_core/src/plugin/compressor_plugin.rs rename to crates/atlaspack_core/src/plugin/compressor_plugin.rs diff --git a/crates/parcel_core/src/plugin/namer_plugin.rs b/crates/atlaspack_core/src/plugin/namer_plugin.rs similarity index 100% rename from crates/parcel_core/src/plugin/namer_plugin.rs rename to crates/atlaspack_core/src/plugin/namer_plugin.rs diff --git a/crates/parcel_core/src/plugin/optimizer_plugin.rs b/crates/atlaspack_core/src/plugin/optimizer_plugin.rs similarity index 100% rename from crates/parcel_core/src/plugin/optimizer_plugin.rs rename to crates/atlaspack_core/src/plugin/optimizer_plugin.rs diff --git a/crates/parcel_core/src/plugin/packager_plugin.rs b/crates/atlaspack_core/src/plugin/packager_plugin.rs similarity index 100% rename from crates/parcel_core/src/plugin/packager_plugin.rs rename to crates/atlaspack_core/src/plugin/packager_plugin.rs diff --git a/crates/parcel_core/src/plugin/reporter_plugin.rs b/crates/atlaspack_core/src/plugin/reporter_plugin.rs similarity index 91% rename from crates/parcel_core/src/plugin/reporter_plugin.rs rename to crates/atlaspack_core/src/plugin/reporter_plugin.rs index 8d6d9824b..5d8839bd7 100644 --- a/crates/parcel_core/src/plugin/reporter_plugin.rs +++ b/crates/atlaspack_core/src/plugin/reporter_plugin.rs @@ -30,14 +30,14 @@ pub enum ReporterEvent { WatchEnd, } -/// Receives events from Parcel as they occur throughout the build process +/// Receives events from Atlaspack as they occur throughout the build process /// /// For example, reporters may write status information to stdout, run a dev server, or generate a /// bundle analysis report at the end of a build. /// #[mockall::automock] pub trait ReporterPlugin: Debug + Send + Sync { - /// Processes the event from Parcel + /// Processes the event from Atlaspack fn report(&self, event: &ReporterEvent) -> Result<(), anyhow::Error>; } diff --git a/crates/parcel_core/src/plugin/reporter_plugin/composite_reporter_plugin.rs b/crates/atlaspack_core/src/plugin/reporter_plugin/composite_reporter_plugin.rs similarity index 100% rename from crates/parcel_core/src/plugin/reporter_plugin/composite_reporter_plugin.rs rename to crates/atlaspack_core/src/plugin/reporter_plugin/composite_reporter_plugin.rs diff --git a/crates/parcel_core/src/plugin/resolver_plugin.rs b/crates/atlaspack_core/src/plugin/resolver_plugin.rs similarity index 97% rename from crates/parcel_core/src/plugin/resolver_plugin.rs rename to crates/atlaspack_core/src/plugin/resolver_plugin.rs index 6008de2b3..d5162bbd7 100644 --- a/crates/parcel_core/src/plugin/resolver_plugin.rs +++ b/crates/atlaspack_core/src/plugin/resolver_plugin.rs @@ -19,7 +19,7 @@ pub struct ResolveContext { #[derive(Clone, Debug, Default, PartialEq)] pub struct ResolvedResolution { - /// Whether this dependency can be deferred by Parcel itself + /// Whether this dependency can be deferred by Atlaspack itself pub can_defer: bool, /// The code of the resolved asset diff --git a/crates/parcel_core/src/plugin/runtime_plugin.rs b/crates/atlaspack_core/src/plugin/runtime_plugin.rs similarity index 100% rename from crates/parcel_core/src/plugin/runtime_plugin.rs rename to crates/atlaspack_core/src/plugin/runtime_plugin.rs diff --git a/crates/parcel_core/src/plugin/transformer_plugin.rs b/crates/atlaspack_core/src/plugin/transformer_plugin.rs similarity index 97% rename from crates/parcel_core/src/plugin/transformer_plugin.rs rename to crates/atlaspack_core/src/plugin/transformer_plugin.rs index ed2c06c55..dcaf76585 100644 --- a/crates/parcel_core/src/plugin/transformer_plugin.rs +++ b/crates/atlaspack_core/src/plugin/transformer_plugin.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use serde::Serialize; -use parcel_filesystem::FileSystemRef; +use atlaspack_filesystem::FileSystemRef; use crate::types::{Asset, Code, Dependency, Environment, FileType, SpecifierType}; @@ -104,7 +104,7 @@ pub struct TransformResult { /// Compile a single asset, discover dependencies, or convert the asset to a different format /// /// Many transformers are wrappers around other tools such as compilers and preprocessors, and are -/// designed to integrate with Parcel. +/// designed to integrate with Atlaspack. /// pub trait TransformerPlugin: Debug + Send + Sync { /// Transform the asset and/or add new assets diff --git a/crates/parcel_core/src/plugin/validator_plugin.rs b/crates/atlaspack_core/src/plugin/validator_plugin.rs similarity index 91% rename from crates/parcel_core/src/plugin/validator_plugin.rs rename to crates/atlaspack_core/src/plugin/validator_plugin.rs index 4805cb02b..c0458b4e0 100644 --- a/crates/parcel_core/src/plugin/validator_plugin.rs +++ b/crates/atlaspack_core/src/plugin/validator_plugin.rs @@ -14,8 +14,8 @@ pub struct Validation { /// to verify linting, type safety, etc and are run after a build has completed. This enables more /// important compilation errors to occur first. /// -/// When Parcel runs in watch mode, the built bundles are served even if a validator throws an -/// error. But when running a build, Parcel exits with a failure and status code to ensure code is +/// When Atlaspack runs in watch mode, the built bundles are served even if a validator throws an +/// error. But when running a build, Atlaspack exits with a failure and status code to ensure code is /// not deployed for assets that do not meet the validation criteria. This ensures developers /// remain productive, and do not have to worry about every small typing or linting issue while /// trying to solve a problem. @@ -40,7 +40,7 @@ pub trait ValidatorPlugin: Debug { /// Validates all assets /// /// Some validators may wish to maintain a project-wide state or cache for efficiency. For these - /// cases, it is appropriate to use a different interface where Parcel passses all the changed + /// cases, it is appropriate to use a different interface where Atlaspack passses all the changed /// files to the validator at the same time. /// /// This type of validator is slower than a stateless validator, as it runs everything on a diff --git a/crates/parcel_core/src/types.rs b/crates/atlaspack_core/src/types.rs similarity index 85% rename from crates/parcel_core/src/types.rs rename to crates/atlaspack_core/src/types.rs index 6be1d7b97..16a9398b9 100644 --- a/crates/parcel_core/src/types.rs +++ b/crates/atlaspack_core/src/types.rs @@ -1,5 +1,5 @@ // Re-export this from core, probably want to move this type here -pub use parcel_filesystem::FileSystem; +pub use atlaspack_filesystem::FileSystem; pub use self::asset::*; pub use self::bundle::*; @@ -11,7 +11,7 @@ pub use self::file_type::*; pub use self::invalidation::*; pub use self::json::*; pub use self::package_json::*; -pub use self::parcel_options::*; +pub use self::atlaspack_options::*; pub use self::source::*; pub use self::symbol::*; pub use self::target::*; @@ -26,7 +26,7 @@ mod file_type; mod invalidation; mod json; mod package_json; -mod parcel_options; +mod atlaspack_options; mod source; mod symbol; mod target; diff --git a/crates/parcel_core/src/types/asset.rs b/crates/atlaspack_core/src/types/asset.rs similarity index 97% rename from crates/parcel_core/src/types/asset.rs rename to crates/atlaspack_core/src/types/asset.rs index 6d143b731..a0379c97f 100644 --- a/crates/parcel_core/src/types/asset.rs +++ b/crates/atlaspack_core/src/types/asset.rs @@ -72,7 +72,7 @@ pub struct Asset { /// Plugin specific metadata for the asset pub meta: JSONObject, - /// The pipeline defined in .parcelrc that the asset should be processed with + /// The pipeline defined in .atlaspackrc that the asset should be processed with pub pipeline: Option, /// The transformer options for the asset from the dependency query string @@ -128,7 +128,7 @@ pub struct Asset { /// True if this is a 'constant module', meaning it only exports constant assignment statements, /// on this case this module may be inlined on its usage depending on whether it is only used - /// once and the parcel configuration. + /// once and the atlaspack configuration. /// /// An example of a 'constant module' would be: /// diff --git a/crates/parcel_core/src/types/parcel_options.rs b/crates/atlaspack_core/src/types/atlaspack_options.rs similarity index 91% rename from crates/parcel_core/src/types/parcel_options.rs rename to crates/atlaspack_core/src/types/atlaspack_options.rs index ce1fa1a47..4e58caefc 100644 --- a/crates/parcel_core/src/types/parcel_options.rs +++ b/crates/atlaspack_core/src/types/atlaspack_options.rs @@ -9,13 +9,13 @@ use serde::Serialize; use super::engines::Engines; use super::OutputFormat; -/// The options passed into Parcel either through the CLI or the programmatic API +/// The options passed into Atlaspack either through the CLI or the programmatic API #[derive(Clone, Debug, Default, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] -pub struct ParcelOptions { +pub struct AtlaspackOptions { pub config: Option, - /// Path to the parcel core node_module. This will be used to resolve built-ins or runtime files. + /// Path to the atlaspack core node_module. This will be used to resolve built-ins or runtime files. /// /// In the future this may be replaced with embedding those files into the rust binary. pub core_path: PathBuf, diff --git a/crates/parcel_core/src/types/bundle.rs b/crates/atlaspack_core/src/types/bundle.rs similarity index 100% rename from crates/parcel_core/src/types/bundle.rs rename to crates/atlaspack_core/src/types/bundle.rs diff --git a/crates/parcel_core/src/types/bundle_graph.rs b/crates/atlaspack_core/src/types/bundle_graph.rs similarity index 100% rename from crates/parcel_core/src/types/bundle_graph.rs rename to crates/atlaspack_core/src/types/bundle_graph.rs diff --git a/crates/parcel_core/src/types/dependency.rs b/crates/atlaspack_core/src/types/dependency.rs similarity index 98% rename from crates/parcel_core/src/types/dependency.rs rename to crates/atlaspack_core/src/types/dependency.rs index f850ea20c..be5b7842a 100644 --- a/crates/parcel_core/src/types/dependency.rs +++ b/crates/atlaspack_core/src/types/dependency.rs @@ -46,7 +46,7 @@ pub struct Dependency { #[serde(default)] pub package_conditions: ExportsCondition, - /// The pipeline defined in .parcelrc that the dependency should be processed with + /// The pipeline defined in .atlaspackrc that the dependency should be processed with #[serde(default)] pub pipeline: Option, diff --git a/crates/parcel_core/src/types/diagnostic.rs b/crates/atlaspack_core/src/types/diagnostic.rs similarity index 99% rename from crates/parcel_core/src/types/diagnostic.rs rename to crates/atlaspack_core/src/types/diagnostic.rs index 711c61c18..55e68ca1f 100644 --- a/crates/parcel_core/src/types/diagnostic.rs +++ b/crates/atlaspack_core/src/types/diagnostic.rs @@ -19,7 +19,7 @@ pub enum ErrorKind { Unknown, } -/// This is a user facing error for Parcel. +/// This is a user facing error for Atlaspack. /// /// Usually but not always this is linked to a source-code location. #[derive(Builder, Debug, Deserialize, PartialEq, Serialize)] diff --git a/crates/parcel_core/src/types/environment.rs b/crates/atlaspack_core/src/types/environment.rs similarity index 96% rename from crates/parcel_core/src/types/environment.rs rename to crates/atlaspack_core/src/types/environment.rs index 1e7b206cd..44bbba5a8 100644 --- a/crates/parcel_core/src/types/environment.rs +++ b/crates/atlaspack_core/src/types/environment.rs @@ -23,7 +23,7 @@ pub struct EnvironmentId(pub NonZeroU32); /// The environment the built code will run in /// -/// This influences how Parcel compiles your code, including what syntax to transpile. +/// This influences how Atlaspack compiles your code, including what syntax to transpile. /// #[derive(Clone, Debug, Default, Deserialize, Eq, Serialize)] #[serde(rename_all = "camelCase")] @@ -102,7 +102,7 @@ impl PartialEq for Environment { /// The environment the output should run in /// -/// This informs Parcel what environment-specific APIs are available. +/// This informs Atlaspack what environment-specific APIs are available. /// #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)] #[serde(rename_all = "kebab-case")] @@ -210,7 +210,7 @@ pub struct TargetSourceMapOptions { /// The URL to load the original source code from /// - /// This is set automatically in development when using the builtin Parcel development server. + /// This is set automatically in development when using the builtin Atlaspack development server. /// Otherwise, it defaults to a relative path to the bundle from the project root. /// source_root: Option, diff --git a/crates/parcel_core/src/types/environment/browsers.rs b/crates/atlaspack_core/src/types/environment/browsers.rs similarity index 100% rename from crates/parcel_core/src/types/environment/browsers.rs rename to crates/atlaspack_core/src/types/environment/browsers.rs diff --git a/crates/parcel_core/src/types/environment/engines.rs b/crates/atlaspack_core/src/types/environment/engines.rs similarity index 99% rename from crates/parcel_core/src/types/environment/engines.rs rename to crates/atlaspack_core/src/types/environment/engines.rs index a755764e1..80a70dce5 100644 --- a/crates/parcel_core/src/types/environment/engines.rs +++ b/crates/atlaspack_core/src/types/environment/engines.rs @@ -14,7 +14,7 @@ pub struct Engines { pub browsers: Browsers, pub electron: Option, pub node: Option, - pub parcel: Option, + pub atlaspack: Option, } /// List of environment features that may be supported by an engine diff --git a/crates/parcel_core/src/types/environment/output_format.rs b/crates/atlaspack_core/src/types/environment/output_format.rs similarity index 100% rename from crates/parcel_core/src/types/environment/output_format.rs rename to crates/atlaspack_core/src/types/environment/output_format.rs diff --git a/crates/parcel_core/src/types/environment/version.rs b/crates/atlaspack_core/src/types/environment/version.rs similarity index 100% rename from crates/parcel_core/src/types/environment/version.rs rename to crates/atlaspack_core/src/types/environment/version.rs diff --git a/crates/parcel_core/src/types/file.rs b/crates/atlaspack_core/src/types/file.rs similarity index 100% rename from crates/parcel_core/src/types/file.rs rename to crates/atlaspack_core/src/types/file.rs diff --git a/crates/parcel_core/src/types/file_type.rs b/crates/atlaspack_core/src/types/file_type.rs similarity index 100% rename from crates/parcel_core/src/types/file_type.rs rename to crates/atlaspack_core/src/types/file_type.rs diff --git a/crates/parcel_core/src/types/invalidation.rs b/crates/atlaspack_core/src/types/invalidation.rs similarity index 100% rename from crates/parcel_core/src/types/invalidation.rs rename to crates/atlaspack_core/src/types/invalidation.rs diff --git a/crates/parcel_core/src/types/json.rs b/crates/atlaspack_core/src/types/json.rs similarity index 100% rename from crates/parcel_core/src/types/json.rs rename to crates/atlaspack_core/src/types/json.rs diff --git a/crates/parcel_core/src/types/package_json.rs b/crates/atlaspack_core/src/types/package_json.rs similarity index 100% rename from crates/parcel_core/src/types/package_json.rs rename to crates/atlaspack_core/src/types/package_json.rs diff --git a/crates/parcel_core/src/types/source.rs b/crates/atlaspack_core/src/types/source.rs similarity index 100% rename from crates/parcel_core/src/types/source.rs rename to crates/atlaspack_core/src/types/source.rs diff --git a/crates/parcel_core/src/types/symbol.rs b/crates/atlaspack_core/src/types/symbol.rs similarity index 100% rename from crates/parcel_core/src/types/symbol.rs rename to crates/atlaspack_core/src/types/symbol.rs diff --git a/crates/parcel_core/src/types/target.rs b/crates/atlaspack_core/src/types/target.rs similarity index 93% rename from crates/parcel_core/src/types/target.rs rename to crates/atlaspack_core/src/types/target.rs index a04a5c0c5..9ffc4ae50 100644 --- a/crates/parcel_core/src/types/target.rs +++ b/crates/atlaspack_core/src/types/target.rs @@ -23,7 +23,7 @@ pub struct Target { /// The environment the code will run in /// - /// This influences how Parcel compiles your code, including what syntax to transpile. + /// This influences how Atlaspack compiles your code, including what syntax to transpile. /// pub env: Arc, diff --git a/crates/parcel_core/src/types/utils.rs b/crates/atlaspack_core/src/types/utils.rs similarity index 100% rename from crates/parcel_core/src/types/utils.rs rename to crates/atlaspack_core/src/types/utils.rs diff --git a/crates/parcel_filesystem/Cargo.toml b/crates/atlaspack_filesystem/Cargo.toml similarity index 73% rename from crates/parcel_filesystem/Cargo.toml rename to crates/atlaspack_filesystem/Cargo.toml index 3e3d37a5e..072323c4c 100644 --- a/crates/parcel_filesystem/Cargo.toml +++ b/crates/atlaspack_filesystem/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "parcel_filesystem" +name = "atlaspack_filesystem" version = "0.1.0" edition = "2021" -description = "FileSystem wrapper trait for use in Parcel codebase." +description = "FileSystem wrapper trait for use in Atlaspack codebase." [dependencies] dashmap = "5.5.3" diff --git a/crates/parcel_filesystem/src/in_memory_file_system.rs b/crates/atlaspack_filesystem/src/in_memory_file_system.rs similarity index 99% rename from crates/parcel_filesystem/src/in_memory_file_system.rs rename to crates/atlaspack_filesystem/src/in_memory_file_system.rs index d792456f7..5a732f307 100644 --- a/crates/parcel_filesystem/src/in_memory_file_system.rs +++ b/crates/atlaspack_filesystem/src/in_memory_file_system.rs @@ -200,7 +200,7 @@ mod test { #[test] fn test_is_file() { - let cwd = PathBuf::from("parcel"); + let cwd = PathBuf::from("atlaspack"); let fs = InMemoryFileSystem::default(); fs.write_file(&PathBuf::from("/foo/bar"), String::default()); diff --git a/crates/parcel_filesystem/src/lib.rs b/crates/atlaspack_filesystem/src/lib.rs similarity index 100% rename from crates/parcel_filesystem/src/lib.rs rename to crates/atlaspack_filesystem/src/lib.rs diff --git a/crates/parcel_filesystem/src/os_file_system.rs b/crates/atlaspack_filesystem/src/os_file_system.rs similarity index 100% rename from crates/parcel_filesystem/src/os_file_system.rs rename to crates/atlaspack_filesystem/src/os_file_system.rs diff --git a/crates/parcel_filesystem/src/os_file_system/canonicalize.rs b/crates/atlaspack_filesystem/src/os_file_system/canonicalize.rs similarity index 100% rename from crates/parcel_filesystem/src/os_file_system/canonicalize.rs rename to crates/atlaspack_filesystem/src/os_file_system/canonicalize.rs diff --git a/crates/parcel_filesystem/src/search.rs b/crates/atlaspack_filesystem/src/search.rs similarity index 76% rename from crates/parcel_filesystem/src/search.rs rename to crates/atlaspack_filesystem/src/search.rs index 1b1a8c9fd..c64084fe6 100644 --- a/crates/parcel_filesystem/src/search.rs +++ b/crates/atlaspack_filesystem/src/search.rs @@ -107,17 +107,17 @@ mod tests { fs.create_directory(Path::new("srcs")).unwrap(); - fs.create_directory(Path::new("packages/parcel/srcs")) + fs.create_directory(Path::new("packages/atlaspack/srcs")) .unwrap(); - fs.create_directory(Path::new("packages/parcel/descendent/src")) + fs.create_directory(Path::new("packages/atlaspack/descendent/src")) .unwrap(); assert_eq!( find_ancestor_directory( &fs, &["src"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), None @@ -131,12 +131,12 @@ mod tests { fs.write_file(Path::new("packages.json"), String::from("{}")); fs.write_file( - Path::new("packages/parcel/packages.json"), + Path::new("packages/atlaspack/packages.json"), String::from("{}"), ); fs.write_file( - Path::new("packages/parcel/descendent/package.json"), + Path::new("packages/atlaspack/descendent/package.json"), String::from("{}"), ); @@ -144,7 +144,7 @@ mod tests { find_ancestor_file( &fs, &["package.json"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), None @@ -155,13 +155,13 @@ mod tests { fn returns_none_when_ancestor_directory_is_a_file() { let fs = InMemoryFileSystem::default(); - fs.write_file(Path::new("packages/parcel/src.js"), String::default()); + fs.write_file(Path::new("packages/atlaspack/src.js"), String::default()); assert_eq!( find_ancestor_directory( &fs, &["src"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), None @@ -172,14 +172,14 @@ mod tests { fn returns_none_when_ancestor_file_is_a_directory() { let fs = InMemoryFileSystem::default(); - fs.create_directory(Path::new("packages/parcel/package.json")) + fs.create_directory(Path::new("packages/atlaspack/package.json")) .unwrap(); assert_eq!( find_ancestor_file( &fs, &["package.json"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), None @@ -196,7 +196,7 @@ mod tests { find_ancestor_directory( &fs, &["src"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::from("packages") ), None @@ -213,7 +213,7 @@ mod tests { find_ancestor_file( &fs, &["package.json"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::from("packages") ), None @@ -226,52 +226,52 @@ mod tests { fs.create_directory(Path::new("dist")).unwrap(); fs.create_directory(Path::new("packages/dist")).unwrap(); - fs.create_directory(Path::new("packages/parcel/dist")) + fs.create_directory(Path::new("packages/atlaspack/dist")) .unwrap(); fs.create_directory(Path::new("src")).unwrap(); fs.create_directory(Path::new("packages/src")).unwrap(); - fs.create_directory(Path::new("packages/parcel/src")) + fs.create_directory(Path::new("packages/atlaspack/src")) .unwrap(); assert_eq!( find_ancestor_directory( &fs, &["dist"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/dist")) + Some(PathBuf::from("packages/atlaspack/dist")) ); assert_eq!( find_ancestor_directory( &fs, &["src"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/src")) + Some(PathBuf::from("packages/atlaspack/src")) ); assert_eq!( find_ancestor_directory( &fs, &["dist", "src"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/dist")) + Some(PathBuf::from("packages/atlaspack/dist")) ); assert_eq!( find_ancestor_directory( &fs, &["src", "dist"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/src")) + Some(PathBuf::from("packages/atlaspack/src")) ); } @@ -281,13 +281,13 @@ mod tests { fs.create_directory(Path::new("src")).unwrap(); fs.create_directory(Path::new("packages/src")).unwrap(); - fs.create_directory(Path::new("packages/parcel/src")) + fs.create_directory(Path::new("packages/atlaspack/src")) .unwrap(); fs.write_file(Path::new("package.json"), String::from("{}")); fs.write_file(Path::new("packages/package.json"), String::from("{}")); fs.write_file( - Path::new("packages/parcel/package.json"), + Path::new("packages/atlaspack/package.json"), String::from("{}"), ); @@ -295,40 +295,40 @@ mod tests { find_ancestor( &fs, &[Entry::Directory("src")], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/src")) + Some(PathBuf::from("packages/atlaspack/src")) ); assert_eq!( find_ancestor( &fs, &[Entry::File("package.json")], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/package.json")) + Some(PathBuf::from("packages/atlaspack/package.json")) ); assert_eq!( find_ancestor( &fs, &[Entry::Directory("src"), Entry::File("package.json")], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/src")) + Some(PathBuf::from("packages/atlaspack/src")) ); assert_eq!( find_ancestor( &fs, &[Entry::File("package.json"), Entry::Directory("src")], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/package.json")) + Some(PathBuf::from("packages/atlaspack/package.json")) ); } @@ -339,14 +339,14 @@ mod tests { fs.write_file(Path::new("package.json"), String::from("{}")); fs.write_file(Path::new("packages/package.json"), String::from("{}")); fs.write_file( - Path::new("packages/parcel/package.json"), + Path::new("packages/atlaspack/package.json"), String::from("{}"), ); fs.write_file(Path::new("package-lock.json"), String::from("{}")); fs.write_file(Path::new("packages/package-lock.json"), String::from("{}")); fs.write_file( - Path::new("packages/parcel/package-lock.json"), + Path::new("packages/atlaspack/package-lock.json"), String::from("{}"), ); @@ -354,40 +354,40 @@ mod tests { find_ancestor_file( &fs, &["package.json"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/package.json")) + Some(PathBuf::from("packages/atlaspack/package.json")) ); assert_eq!( find_ancestor_file( &fs, &["package-lock.json"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/package-lock.json")) + Some(PathBuf::from("packages/atlaspack/package-lock.json")) ); assert_eq!( find_ancestor_file( &fs, &["package.json", "package-lock.json"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/package.json")) + Some(PathBuf::from("packages/atlaspack/package.json")) ); assert_eq!( find_ancestor_file( &fs, &["package-lock.json", "package.json"], - PathBuf::from("packages/parcel"), + PathBuf::from("packages/atlaspack"), PathBuf::default() ), - Some(PathBuf::from("packages/parcel/package-lock.json")) + Some(PathBuf::from("packages/atlaspack/package-lock.json")) ); } } diff --git a/crates/parcel_monitoring/Cargo.toml b/crates/atlaspack_monitoring/Cargo.toml similarity index 95% rename from crates/parcel_monitoring/Cargo.toml rename to crates/atlaspack_monitoring/Cargo.toml index 29b4272e5..430f55e37 100644 --- a/crates/parcel_monitoring/Cargo.toml +++ b/crates/atlaspack_monitoring/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "parcel_monitoring" -description = "Provides tracing, error and crash reporting system for parcel" +name = "atlaspack_monitoring" +description = "Provides tracing, error and crash reporting system for atlaspack" version = "0.1.0" edition = "2021" diff --git a/crates/atlaspack_monitoring/README.md b/crates/atlaspack_monitoring/README.md new file mode 100644 index 000000000..a0f0f76bb --- /dev/null +++ b/crates/atlaspack_monitoring/README.md @@ -0,0 +1,54 @@ +# atlaspack_monitoring + +This crate wraps functionality provided to: + +- Set-up sentry +- Set-up crash reporting +- Set-up tracing subscriber + +It's provided as a separate crate than node-bindings so that we can provide example integration of the `minidumper` +system. + +--- + +## Configuring monitoring / reporting + +### Tracing + +Tracing is turned off by default. + +Atlaspack uses [`tracing`](https://github.com/tokio-rs/tracing) for logging and traces. This aims to aid debugging and bug +fixing. + +- By default, traces/logs won't be written +- `ATLASPACK_TRACING_MODE=stdout` will write to standard-output +- `ATLASPACK_TRACING_MODE=file` will write to a temporary log file, with log rotation this file will be under + `$TMPDIR/atlaspack_trace` + +## Sentry integration + +Sentry integration is turned off by default. + +Atlaspack uses [sentry](https://sentry.io/) only on `canary` nightly releases for error monitoring. + +- `ATLASPACK_ENABLE_SENTRY` will enable sentry integration +- `ATLASPACK_SENTRY_TAGS` should contain a JSON string with a dictionary of tags to add to sentry +- `ATLASPACK_SENTRY_DSN` should contain the Sentry DSN + +## Crash reporting + +Crash reporting is disabled by default. + +Atlaspack uses +[crash-handling](https://github.com/EmbarkStudios/crash-handling/blob/e2891a4c6a8d43374ec63d791c7e6d42ff2e6545/README.md) +utilities to write [minidumps](https://github.com/EmbarkStudios/crash-handling/tree/main/minidumper) on crashes. + +When this feature is enabled, the atlaspack process will try to IPC with a server process using the +[`minidumper`](https://github.com/EmbarkStudios/crash-handling/tree/main/minidumper) library. The server should write +and report the crash. + +A default server implementation is not provided, but an example can be seen on `examples/sample_usage.rs`. + +- `ATLASPACK_ENABLE_MINIDUMPER` will enable the minidumper client +- `ATLASPACK_MINIDUMPER_SERVER_PID_FILE` should contain a file path to a pid-file with the PID of the server process +- `ATLASPACK_MINIDUMPER_SERVER_SOCKET_NAME` should contain the path to the socket to use diff --git a/crates/parcel_monitoring/examples/sample_usage.rs b/crates/atlaspack_monitoring/examples/sample_usage.rs similarity index 99% rename from crates/parcel_monitoring/examples/sample_usage.rs rename to crates/atlaspack_monitoring/examples/sample_usage.rs index b3e51eba5..49673b55e 100644 --- a/crates/parcel_monitoring/examples/sample_usage.rs +++ b/crates/atlaspack_monitoring/examples/sample_usage.rs @@ -2,7 +2,7 @@ use minidumper::Server; -use parcel_monitoring::{ +use atlaspack_monitoring::{ initialize_monitoring, CrashReporterOptions, MonitoringOptions, MONITORING_GUARD, }; diff --git a/crates/parcel_monitoring/src/crash_reporter.rs b/crates/atlaspack_monitoring/src/crash_reporter.rs similarity index 80% rename from crates/parcel_monitoring/src/crash_reporter.rs rename to crates/atlaspack_monitoring/src/crash_reporter.rs index 762e2c041..f1b356cee 100644 --- a/crates/parcel_monitoring/src/crash_reporter.rs +++ b/crates/atlaspack_monitoring/src/crash_reporter.rs @@ -17,11 +17,11 @@ pub struct CrashReporterOptions { impl CrashReporterOptions { pub fn from_env() -> Result, FromEnvError> { - if optional_var("PARCEL_ENABLE_MINIDUMPER").is_none() { + if optional_var("ATLASPACK_ENABLE_MINIDUMPER").is_none() { return Ok(None); } - let minidumper_server_pid_var = String::from("PARCEL_MINIDUMPER_SERVER_PID_FILE"); + let minidumper_server_pid_var = String::from("ATLASPACK_MINIDUMPER_SERVER_PID_FILE"); let pid_file = required_var(&minidumper_server_pid_var)?; let server_pid_string = std::fs::read_to_string(&pid_file).map_err(|err| { @@ -40,7 +40,7 @@ impl CrashReporterOptions { })?; Ok(Some(Self { - minidumper_server_socket_name: required_var("PARCEL_MINIDUMPER_SERVER_SOCKET_NAME")?, + minidumper_server_socket_name: required_var("ATLASPACK_MINIDUMPER_SERVER_SOCKET_NAME")?, minidumper_server_pid: server_pid, })) } @@ -57,7 +57,7 @@ pub fn init_crash_reporter(options: CrashReporterOptions) -> anyhow::Result Result, FromEnvError> { - if optional_var("PARCEL_ENABLE_SENTRY").is_none() { + if optional_var("ATLASPACK_ENABLE_SENTRY").is_none() { return Ok(None); } - let sentry_tags = match optional_var("PARCEL_SENTRY_TAGS") { + let sentry_tags = match optional_var("ATLASPACK_SENTRY_TAGS") { Some(tags_string) => { let sentry_tags = serde_json::from_str::>(&tags_string).map_err(|err| { FromEnvError::InvalidKey( - String::from("PARCEL_SENTRY_TAGS"), + String::from("ATLASPACK_SENTRY_TAGS"), anyhow!("Invalid JSON on tags: {:#?}", err), ) })?; @@ -50,7 +50,7 @@ impl SentryOptions { }; Ok(Some(SentryOptions { - sentry_dsn: required_var("PARCEL_SENTRY_DSN")?, + sentry_dsn: required_var("ATLASPACK_SENTRY_DSN")?, sentry_tags, })) } @@ -86,7 +86,7 @@ pub fn init_sentry(options: SentryOptions) -> anyhow::Result { scope.set_tag(&key, val); } }); - tracing::info!("Parcel Sentry for rust setup done!"); + tracing::info!("Atlaspack Sentry for rust setup done!"); Ok(guard) } @@ -100,7 +100,7 @@ mod test { #[test] fn test_sentry_options_from_env_if_disabled_returns_none() { let _guard = TEST_LOCK.lock(); - std::env::remove_var("PARCEL_ENABLE_SENTRY"); + std::env::remove_var("ATLASPACK_ENABLE_SENTRY"); let options = SentryOptions::from_env().unwrap(); assert!(options.is_none()); } @@ -108,9 +108,9 @@ mod test { #[test] fn test_sentry_options_from_env_returns_some_if_dsn_is_set() { let _guard = TEST_LOCK.lock(); - std::env::set_var("PARCEL_ENABLE_SENTRY", "1"); - std::env::set_var("PARCEL_SENTRY_DSN", "1234"); - std::env::remove_var("PARCEL_SENTRY_TAGS"); + std::env::set_var("ATLASPACK_ENABLE_SENTRY", "1"); + std::env::set_var("ATLASPACK_SENTRY_DSN", "1234"); + std::env::remove_var("ATLASPACK_SENTRY_TAGS"); let options = SentryOptions::from_env().unwrap().expect("missing options"); assert_eq!(options.sentry_dsn, "1234"); assert_eq!(options.sentry_tags, HashMap::new()); @@ -119,9 +119,9 @@ mod test { #[test] fn test_sentry_options_from_env_parses_tags_properly() { let _guard = TEST_LOCK.lock(); - std::env::set_var("PARCEL_ENABLE_SENTRY", "1"); - std::env::set_var("PARCEL_SENTRY_DSN", "1234"); - std::env::set_var("PARCEL_SENTRY_TAGS", "{\"key\":\"value\"}"); + std::env::set_var("ATLASPACK_ENABLE_SENTRY", "1"); + std::env::set_var("ATLASPACK_SENTRY_DSN", "1234"); + std::env::set_var("ATLASPACK_SENTRY_TAGS", "{\"key\":\"value\"}"); let options = SentryOptions::from_env().unwrap().expect("missing options"); assert_eq!(options.sentry_dsn, "1234"); assert_eq!( @@ -133,9 +133,9 @@ mod test { #[test] fn test_sentry_options_from_env_stringifies_non_string_tags() { let _guard = TEST_LOCK.lock(); - std::env::set_var("PARCEL_ENABLE_SENTRY", "1"); - std::env::set_var("PARCEL_SENTRY_DSN", "1234"); - std::env::set_var("PARCEL_SENTRY_TAGS", "{\"key\":1234,\"other\":[]}"); + std::env::set_var("ATLASPACK_ENABLE_SENTRY", "1"); + std::env::set_var("ATLASPACK_SENTRY_DSN", "1234"); + std::env::set_var("ATLASPACK_SENTRY_TAGS", "{\"key\":1234,\"other\":[]}"); let options = SentryOptions::from_env().unwrap().expect("missing options"); assert_eq!(options.sentry_dsn, "1234"); assert_eq!( @@ -150,9 +150,9 @@ mod test { #[test] fn test_sentry_options_from_env_fails_if_dsn_is_missing() { let _guard = TEST_LOCK.lock(); - std::env::set_var("PARCEL_ENABLE_SENTRY", "1"); - std::env::remove_var("PARCEL_SENTRY_DSN"); - std::env::set_var("PARCEL_SENTRY_TAGS", "{\"key\":1234,\"other\":[]}"); + std::env::set_var("ATLASPACK_ENABLE_SENTRY", "1"); + std::env::remove_var("ATLASPACK_SENTRY_DSN"); + std::env::set_var("ATLASPACK_SENTRY_TAGS", "{\"key\":1234,\"other\":[]}"); let options = SentryOptions::from_env(); assert!(options.is_err()); assert!(matches!(options, Err(FromEnvError::MissingKey(_, _)))); @@ -161,9 +161,9 @@ mod test { #[test] fn test_sentry_options_from_env_fails_if_tags_are_invalid() { let _guard = TEST_LOCK.lock(); - std::env::set_var("PARCEL_ENABLE_SENTRY", "1"); - std::env::set_var("PARCEL_SENTRY_DSN", "1234"); - std::env::set_var("PARCEL_SENTRY_TAGS", "asdf"); + std::env::set_var("ATLASPACK_ENABLE_SENTRY", "1"); + std::env::set_var("ATLASPACK_SENTRY_DSN", "1234"); + std::env::set_var("ATLASPACK_SENTRY_TAGS", "asdf"); let options = SentryOptions::from_env(); assert!(options.is_err()); assert!(matches!(options, Err(FromEnvError::InvalidKey(_, _)))); diff --git a/crates/parcel_monitoring/src/tracer.rs b/crates/atlaspack_monitoring/src/tracer.rs similarity index 90% rename from crates/parcel_monitoring/src/tracer.rs rename to crates/atlaspack_monitoring/src/tracer.rs index ddfe430a3..e5a644046 100644 --- a/crates/parcel_monitoring/src/tracer.rs +++ b/crates/atlaspack_monitoring/src/tracer.rs @@ -29,7 +29,7 @@ pub enum TracerMode { impl TracerMode { pub fn from_env() -> Result, FromEnvError> { - let Some(mode) = optional_var("PARCEL_TRACING_MODE") else { + let Some(mode) = optional_var("ATLASPACK_TRACING_MODE") else { return Ok(None); }; @@ -37,7 +37,7 @@ impl TracerMode { "file" => Ok(Some(Self::file())), "stdout" => Ok(Some(Self::stdout())), value => Err(FromEnvError::InvalidKey( - String::from("PARCEL_TRACING_MODE"), + String::from("ATLASPACK_TRACING_MODE"), anyhow!("Invalid value: {}", value), )), } @@ -52,10 +52,10 @@ impl TracerMode { pub fn file() -> Self { Self::File { directory: std::env::temp_dir() - .join("parcel_trace") + .join("atlaspack_trace") .to_string_lossy() .to_string(), - prefix: "parcel-tracing".to_string(), + prefix: "atlaspack-tracing".to_string(), max_files: 4, } } @@ -117,7 +117,7 @@ mod test { #[test] fn test_tracing_options_sets_to_none_if_no_mode_is_set() { let _guard = TEST_LOCK.lock(); - std::env::remove_var("PARCEL_TRACING_MODE"); + std::env::remove_var("ATLASPACK_TRACING_MODE"); let options = TracerMode::from_env().unwrap(); assert!(options.is_none()); } @@ -125,7 +125,7 @@ mod test { #[test] fn test_tracing_options_sets_to_file() { let _guard = TEST_LOCK.lock(); - std::env::set_var("PARCEL_TRACING_MODE", "stdout"); + std::env::set_var("ATLASPACK_TRACING_MODE", "stdout"); let options = TracerMode::from_env().unwrap().unwrap(); assert!(matches!(options, TracerMode::Stdout)); } @@ -133,7 +133,7 @@ mod test { #[test] fn test_tracing_options_sets_to_stdout() { let _guard = TEST_LOCK.lock(); - std::env::set_var("PARCEL_TRACING_MODE", "file"); + std::env::set_var("ATLASPACK_TRACING_MODE", "file"); let options = TracerMode::from_env().unwrap().unwrap(); assert!(matches!(options, TracerMode::File { .. })); } diff --git a/crates/parcel_napi_helpers/Cargo.toml b/crates/atlaspack_napi_helpers/Cargo.toml similarity index 94% rename from crates/parcel_napi_helpers/Cargo.toml rename to crates/atlaspack_napi_helpers/Cargo.toml index 49b5c285e..f25e7382e 100644 --- a/crates/parcel_napi_helpers/Cargo.toml +++ b/crates/atlaspack_napi_helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Devon Govett "] -name = "parcel_napi_helpers" +name = "atlaspack_napi_helpers" version = "0.1.0" edition = "2021" diff --git a/crates/parcel_napi_helpers/src/anyhow.rs b/crates/atlaspack_napi_helpers/src/anyhow.rs similarity index 100% rename from crates/parcel_napi_helpers/src/anyhow.rs rename to crates/atlaspack_napi_helpers/src/anyhow.rs diff --git a/crates/parcel_napi_helpers/src/call_method.rs b/crates/atlaspack_napi_helpers/src/call_method.rs similarity index 100% rename from crates/parcel_napi_helpers/src/call_method.rs rename to crates/atlaspack_napi_helpers/src/call_method.rs diff --git a/crates/parcel_napi_helpers/src/console_log.rs b/crates/atlaspack_napi_helpers/src/console_log.rs similarity index 100% rename from crates/parcel_napi_helpers/src/console_log.rs rename to crates/atlaspack_napi_helpers/src/console_log.rs diff --git a/crates/parcel_napi_helpers/src/get_function.rs b/crates/atlaspack_napi_helpers/src/get_function.rs similarity index 100% rename from crates/parcel_napi_helpers/src/get_function.rs rename to crates/atlaspack_napi_helpers/src/get_function.rs diff --git a/crates/parcel_napi_helpers/src/js_callable/js_callable.rs b/crates/atlaspack_napi_helpers/src/js_callable/js_callable.rs similarity index 100% rename from crates/parcel_napi_helpers/src/js_callable/js_callable.rs rename to crates/atlaspack_napi_helpers/src/js_callable/js_callable.rs diff --git a/crates/parcel_napi_helpers/src/js_callable/js_value.rs b/crates/atlaspack_napi_helpers/src/js_callable/js_value.rs similarity index 100% rename from crates/parcel_napi_helpers/src/js_callable/js_value.rs rename to crates/atlaspack_napi_helpers/src/js_callable/js_value.rs diff --git a/crates/parcel_napi_helpers/src/js_callable/mod.rs b/crates/atlaspack_napi_helpers/src/js_callable/mod.rs similarity index 100% rename from crates/parcel_napi_helpers/src/js_callable/mod.rs rename to crates/atlaspack_napi_helpers/src/js_callable/mod.rs diff --git a/crates/parcel_napi_helpers/src/js_callable/serde.rs b/crates/atlaspack_napi_helpers/src/js_callable/serde.rs similarity index 100% rename from crates/parcel_napi_helpers/src/js_callable/serde.rs rename to crates/atlaspack_napi_helpers/src/js_callable/serde.rs diff --git a/crates/parcel_napi_helpers/src/lib.rs b/crates/atlaspack_napi_helpers/src/lib.rs similarity index 100% rename from crates/parcel_napi_helpers/src/lib.rs rename to crates/atlaspack_napi_helpers/src/lib.rs diff --git a/crates/parcel_napi_helpers/src/transferable.rs b/crates/atlaspack_napi_helpers/src/transferable.rs similarity index 100% rename from crates/parcel_napi_helpers/src/transferable.rs rename to crates/atlaspack_napi_helpers/src/transferable.rs diff --git a/crates/parcel_package_manager/Cargo.toml b/crates/atlaspack_package_manager/Cargo.toml similarity index 56% rename from crates/parcel_package_manager/Cargo.toml rename to crates/atlaspack_package_manager/Cargo.toml index f33497654..61632670c 100644 --- a/crates/parcel_package_manager/Cargo.toml +++ b/crates/atlaspack_package_manager/Cargo.toml @@ -1,12 +1,12 @@ [package] authors = ["Monica Olejniczak "] -name = "parcel_package_manager" +name = "atlaspack_package_manager" version = "0.1.0" edition = "2021" [dependencies] anyhow = "1.0.82" mockall = "0.12.1" -parcel-resolver = { path = "../../packages/utils/node-resolver-rs" } -parcel_filesystem = { path = "../parcel_filesystem" } +atlaspack-resolver = { path = "../../packages/utils/node-resolver-rs" } +atlaspack_filesystem = { path = "../atlaspack_filesystem" } serde = { version = "1.0.200", features = ["derive"] } diff --git a/crates/parcel_package_manager/src/lib.rs b/crates/atlaspack_package_manager/src/lib.rs similarity index 100% rename from crates/parcel_package_manager/src/lib.rs rename to crates/atlaspack_package_manager/src/lib.rs diff --git a/crates/parcel_package_manager/src/node_package_manager.rs b/crates/atlaspack_package_manager/src/node_package_manager.rs similarity index 73% rename from crates/parcel_package_manager/src/node_package_manager.rs rename to crates/atlaspack_package_manager/src/node_package_manager.rs index b45391f22..7036c1ff5 100644 --- a/crates/parcel_package_manager/src/node_package_manager.rs +++ b/crates/atlaspack_package_manager/src/node_package_manager.rs @@ -1,21 +1,21 @@ use std::{borrow::Cow, path::PathBuf}; use anyhow::anyhow; -use parcel_filesystem::FileSystemRef; -use parcel_resolver::{Resolution, SpecifierType}; +use atlaspack_filesystem::FileSystemRef; +use atlaspack_resolver::{Resolution, SpecifierType}; use crate::PackageManager; pub struct NodePackageManager<'a> { - resolver: parcel_resolver::Resolver<'a>, + resolver: atlaspack_resolver::Resolver<'a>, } impl<'a> NodePackageManager<'a> { pub fn new(project_root: PathBuf, fs: FileSystemRef) -> Self { Self { - resolver: parcel_resolver::Resolver::node( + resolver: atlaspack_resolver::Resolver::node( Cow::Owned(project_root), - parcel_resolver::CacheCow::Owned(parcel_resolver::Cache::new(fs)), + atlaspack_resolver::CacheCow::Owned(atlaspack_resolver::Cache::new(fs)), ), } } diff --git a/crates/parcel_package_manager/src/package_manager.rs b/crates/atlaspack_package_manager/src/package_manager.rs similarity index 100% rename from crates/parcel_package_manager/src/package_manager.rs rename to crates/atlaspack_package_manager/src/package_manager.rs diff --git a/crates/atlaspack_plugin_resolver/Cargo.toml b/crates/atlaspack_plugin_resolver/Cargo.toml new file mode 100644 index 000000000..6019a09d7 --- /dev/null +++ b/crates/atlaspack_plugin_resolver/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "atlaspack_plugin_resolver" +version = "0.1.0" +edition = "2021" +description = "Resolver Plugin for the Atlaspack Bundler" + +[dependencies] +atlaspack_core = { path = "../atlaspack_core" } +atlaspack-resolver = { path = "../../packages/utils/node-resolver-rs" } +anyhow = "1" + +[dev-dependencies] +atlaspack_filesystem = { path = "../atlaspack_filesystem" } diff --git a/crates/parcel_plugin_resolver/src/parcel_resolver.rs b/crates/atlaspack_plugin_resolver/src/atlaspack_resolver.rs similarity index 85% rename from crates/parcel_plugin_resolver/src/parcel_resolver.rs rename to crates/atlaspack_plugin_resolver/src/atlaspack_resolver.rs index a18b688e0..0c5872551 100644 --- a/crates/parcel_plugin_resolver/src/parcel_resolver.rs +++ b/crates/atlaspack_plugin_resolver/src/atlaspack_resolver.rs @@ -5,44 +5,44 @@ use std::hash::Hash; use std::path::Path; use std::sync::Arc; -use parcel_core::diagnostic_error; -use parcel_core::plugin::PluginContext; -use parcel_core::plugin::PluginOptions; -use parcel_core::plugin::Resolution; -use parcel_core::plugin::ResolveContext; -use parcel_core::plugin::Resolved; -use parcel_core::plugin::ResolvedResolution; -use parcel_core::plugin::ResolverPlugin; -use parcel_core::types::BuildMode; -use parcel_core::types::CodeFrame; -use parcel_core::types::CodeHighlight; -use parcel_core::types::DiagnosticBuilder; -use parcel_core::types::EnvironmentContext; -use parcel_core::types::ErrorKind; -use parcel_core::types::SpecifierType; -use parcel_resolver::Cache; -use parcel_resolver::CacheCow; -use parcel_resolver::ExportsCondition; -use parcel_resolver::Fields; -use parcel_resolver::IncludeNodeModules; -use parcel_resolver::PackageJsonError; -use parcel_resolver::ResolveOptions; -use parcel_resolver::Resolver; -use parcel_resolver::ResolverError; -use parcel_resolver::SpecifierError; - -pub struct ParcelResolver { +use atlaspack_core::diagnostic_error; +use atlaspack_core::plugin::PluginContext; +use atlaspack_core::plugin::PluginOptions; +use atlaspack_core::plugin::Resolution; +use atlaspack_core::plugin::ResolveContext; +use atlaspack_core::plugin::Resolved; +use atlaspack_core::plugin::ResolvedResolution; +use atlaspack_core::plugin::ResolverPlugin; +use atlaspack_core::types::BuildMode; +use atlaspack_core::types::CodeFrame; +use atlaspack_core::types::CodeHighlight; +use atlaspack_core::types::DiagnosticBuilder; +use atlaspack_core::types::EnvironmentContext; +use atlaspack_core::types::ErrorKind; +use atlaspack_core::types::SpecifierType; +use atlaspack_resolver::Cache; +use atlaspack_resolver::CacheCow; +use atlaspack_resolver::ExportsCondition; +use atlaspack_resolver::Fields; +use atlaspack_resolver::IncludeNodeModules; +use atlaspack_resolver::PackageJsonError; +use atlaspack_resolver::ResolveOptions; +use atlaspack_resolver::Resolver; +use atlaspack_resolver::ResolverError; +use atlaspack_resolver::SpecifierError; + +pub struct AtlaspackResolver { cache: Cache, options: Arc, } -impl Debug for ParcelResolver { +impl Debug for AtlaspackResolver { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "ParcelResolver") + write!(f, "AtlaspackResolver") } } -impl ParcelResolver { +impl AtlaspackResolver { pub fn new(ctx: &PluginContext) -> Self { Self { cache: Cache::new(ctx.config.fs.clone()), @@ -235,7 +235,7 @@ impl ParcelResolver { } } -impl Hash for ParcelResolver { +impl Hash for AtlaspackResolver { fn hash(&self, state: &mut H) { env!("CARGO_PKG_VERSION").hash(state); self.options.mode.hash(state); @@ -243,9 +243,9 @@ impl Hash for ParcelResolver { } } -impl ResolverPlugin for ParcelResolver { +impl ResolverPlugin for AtlaspackResolver { fn resolve(&self, ctx: ResolveContext) -> anyhow::Result { - let mut resolver = Resolver::parcel( + let mut resolver = Resolver::atlaspack( Cow::Borrowed(&self.options.project_root), CacheCow::Borrowed(&self.cache), ); @@ -305,16 +305,16 @@ impl ResolverPlugin for ParcelResolver { &ctx.specifier, &resolve_from, match ctx.dependency.specifier_type { - SpecifierType::CommonJS => parcel_resolver::SpecifierType::Cjs, - SpecifierType::Esm => parcel_resolver::SpecifierType::Esm, - SpecifierType::Url => parcel_resolver::SpecifierType::Url, + SpecifierType::CommonJS => atlaspack_resolver::SpecifierType::Cjs, + SpecifierType::Esm => atlaspack_resolver::SpecifierType::Esm, + SpecifierType::Url => atlaspack_resolver::SpecifierType::Url, // TODO: what should specifier custom map to? - SpecifierType::Custom => parcel_resolver::SpecifierType::Esm, + SpecifierType::Custom => atlaspack_resolver::SpecifierType::Esm, }, resolve_options, ); - let side_effects = if let Ok((parcel_resolver::Resolution::Path(p), _)) = &res.result { + let side_effects = if let Ok((atlaspack_resolver::Resolution::Path(p), _)) = &res.result { match resolver.resolve_side_effects(p, &res.invalidations) { Ok(side_effects) => side_effects, Err(err) => { @@ -333,7 +333,7 @@ impl ResolverPlugin for ParcelResolver { .map_err(|err| self.to_diagnostic_error(&ctx.specifier, err))?; match resolution { - (parcel_resolver::Resolution::Path(path), _invalidations) => Ok(Resolved { + (atlaspack_resolver::Resolution::Path(path), _invalidations) => Ok(Resolved { invalidations: Vec::new(), resolution: Resolution::Resolved(ResolvedResolution { file_path: path, @@ -341,10 +341,10 @@ impl ResolverPlugin for ParcelResolver { ..ResolvedResolution::default() }), }), - (parcel_resolver::Resolution::Builtin(builtin), _invalidations) => { + (atlaspack_resolver::Resolution::Builtin(builtin), _invalidations) => { self.resolve_builtin(&ctx, builtin) } - (parcel_resolver::Resolution::Empty, _invalidations) => Ok(Resolved { + (atlaspack_resolver::Resolution::Empty, _invalidations) => Ok(Resolved { invalidations: Vec::new(), resolution: Resolution::Resolved(ResolvedResolution { file_path: self @@ -355,7 +355,7 @@ impl ResolverPlugin for ParcelResolver { ..ResolvedResolution::default() }), }), - (parcel_resolver::Resolution::External, _invalidations) => { + (atlaspack_resolver::Resolution::External, _invalidations) => { if let Some(_source_path) = &ctx.dependency.source_path { if ctx.dependency.env.is_library && ctx.dependency.specifier_type != SpecifierType::Url { todo!("check excluded dependency for libraries"); @@ -367,7 +367,7 @@ impl ResolverPlugin for ParcelResolver { resolution: Resolution::Excluded, }) } - (parcel_resolver::Resolution::Global(global), _invalidations) => Ok(Resolved { + (atlaspack_resolver::Resolution::Global(global), _invalidations) => Ok(Resolved { invalidations: Vec::new(), resolution: Resolution::Resolved(ResolvedResolution { code: Some(format!("module.exports={};", global)), @@ -384,14 +384,14 @@ fn should_include_node_module(include_node_modules: &IncludeNodeModules, name: & match include_node_modules { IncludeNodeModules::Bool(b) => *b, IncludeNodeModules::Array(arr) => { - let Ok((module, _)) = parcel_resolver::parse_package_specifier(name) else { + let Ok((module, _)) = atlaspack_resolver::parse_package_specifier(name) else { return true; }; arr.iter().any(|m| m.as_str() == module) } IncludeNodeModules::Map(map) => { - let Ok((module, _)) = parcel_resolver::parse_package_specifier(name) else { + let Ok((module, _)) = atlaspack_resolver::parse_package_specifier(name) else { return true; }; @@ -403,12 +403,12 @@ fn should_include_node_module(include_node_modules: &IncludeNodeModules, name: & #[cfg(test)] mod test { use super::*; - use parcel_core::{ + use atlaspack_core::{ config_loader::ConfigLoader, plugin::PluginLogger, types::{Dependency, Diagnostic, ErrorKind}, }; - use parcel_filesystem::in_memory_file_system::InMemoryFileSystem; + use atlaspack_filesystem::in_memory_file_system::InMemoryFileSystem; use std::path::PathBuf; fn plugin_context(fs: InMemoryFileSystem) -> PluginContext { @@ -438,7 +438,7 @@ mod test { #[test] fn returns_module_not_found_error_diagnostic() { let plugin_context = plugin_context(InMemoryFileSystem::default()); - let resolver = ParcelResolver::new(&plugin_context); + let resolver = AtlaspackResolver::new(&plugin_context); let ctx = resolve_context("foo.js"); let err = resolver @@ -455,7 +455,9 @@ mod test { kind: ErrorKind::NotFound, hints: Vec::new(), message: String::from("Cannot find module 'foo.js'"), - origin: Some(String::from("parcel_plugin_resolver::parcel_resolver")) + origin: Some(String::from( + "atlaspack_plugin_resolver::atlaspack_resolver" + )) } ); } @@ -471,7 +473,7 @@ mod test { ); let plugin_context = plugin_context(fs); - let resolver = ParcelResolver::new(&plugin_context); + let resolver = AtlaspackResolver::new(&plugin_context); let ctx = resolve_context("foo/bar"); let err = resolver @@ -488,7 +490,9 @@ mod test { hints: Vec::new(), kind: ErrorKind::Unknown, message: String::from("Module 'foo/bar' is not exported from the 'foo' package"), - origin: Some(String::from("parcel_plugin_resolver::parcel_resolver")) + origin: Some(String::from( + "atlaspack_plugin_resolver::atlaspack_resolver" + )) } ); } @@ -511,7 +515,7 @@ mod test { options: Arc::new(PluginOptions::default()), }; - let resolver = ParcelResolver::new(&plugin_context); + let resolver = AtlaspackResolver::new(&plugin_context); let specifier = String::from("./something.js"); let ctx = ResolveContext { diff --git a/crates/atlaspack_plugin_resolver/src/lib.rs b/crates/atlaspack_plugin_resolver/src/lib.rs new file mode 100644 index 000000000..375321349 --- /dev/null +++ b/crates/atlaspack_plugin_resolver/src/lib.rs @@ -0,0 +1,3 @@ +mod atlaspack_resolver; + +pub use atlaspack_resolver::*; diff --git a/crates/parcel_plugin_rpc/Cargo.toml b/crates/atlaspack_plugin_rpc/Cargo.toml similarity index 57% rename from crates/parcel_plugin_rpc/Cargo.toml rename to crates/atlaspack_plugin_rpc/Cargo.toml index 9ab187fe8..620141524 100644 --- a/crates/parcel_plugin_rpc/Cargo.toml +++ b/crates/atlaspack_plugin_rpc/Cargo.toml @@ -1,16 +1,16 @@ [package] -name = "parcel_plugin_rpc" +name = "atlaspack_plugin_rpc" version = "0.1.0" edition = "2021" -description = "Parcel Bundler" +description = "Atlaspack Bundler" [features] -nodejs = ["dep:napi", "dep:serde", "dep:parking_lot", "dep:once_cell", "dep:parcel_napi_helpers"] +nodejs = ["dep:napi", "dep:serde", "dep:parking_lot", "dep:once_cell", "dep:atlaspack_napi_helpers"] [dependencies] -parcel_config = { path = "../parcel_config" } -parcel_core = { path = "../parcel_core" } -parcel_napi_helpers = { path = "../parcel_napi_helpers", optional = true } +atlaspack_config = { path = "../atlaspack_config" } +atlaspack_core = { path = "../atlaspack_core" } +atlaspack_napi_helpers = { path = "../atlaspack_napi_helpers", optional = true } anyhow = "1.0.82" napi = { version = "2.16.4", features = ["serde"], optional = true } diff --git a/crates/parcel_plugin_rpc/src/lib.rs b/crates/atlaspack_plugin_rpc/src/lib.rs similarity index 100% rename from crates/parcel_plugin_rpc/src/lib.rs rename to crates/atlaspack_plugin_rpc/src/lib.rs diff --git a/crates/parcel_plugin_rpc/src/nodejs/mod.rs b/crates/atlaspack_plugin_rpc/src/nodejs/mod.rs similarity index 100% rename from crates/parcel_plugin_rpc/src/nodejs/mod.rs rename to crates/atlaspack_plugin_rpc/src/nodejs/mod.rs diff --git a/crates/parcel_plugin_rpc/src/nodejs/rpc_conn_nodejs.rs b/crates/atlaspack_plugin_rpc/src/nodejs/rpc_conn_nodejs.rs similarity index 86% rename from crates/parcel_plugin_rpc/src/nodejs/rpc_conn_nodejs.rs rename to crates/atlaspack_plugin_rpc/src/nodejs/rpc_conn_nodejs.rs index 9ca35fa18..ba1743504 100644 --- a/crates/parcel_plugin_rpc/src/nodejs/rpc_conn_nodejs.rs +++ b/crates/atlaspack_plugin_rpc/src/nodejs/rpc_conn_nodejs.rs @@ -1,6 +1,6 @@ use napi::{JsObject, JsUnknown}; -use parcel_napi_helpers::anyhow_from_napi; -use parcel_napi_helpers::js_callable::JsCallable; +use atlaspack_napi_helpers::anyhow_from_napi; +use atlaspack_napi_helpers::js_callable::JsCallable; use crate::RpcWorker; diff --git a/crates/parcel_plugin_rpc/src/nodejs/rpc_conns_nodejs.rs b/crates/atlaspack_plugin_rpc/src/nodejs/rpc_conns_nodejs.rs similarity index 100% rename from crates/parcel_plugin_rpc/src/nodejs/rpc_conns_nodejs.rs rename to crates/atlaspack_plugin_rpc/src/nodejs/rpc_conns_nodejs.rs diff --git a/crates/parcel_plugin_rpc/src/nodejs/rpc_host_nodejs.rs b/crates/atlaspack_plugin_rpc/src/nodejs/rpc_host_nodejs.rs similarity index 100% rename from crates/parcel_plugin_rpc/src/nodejs/rpc_host_nodejs.rs rename to crates/atlaspack_plugin_rpc/src/nodejs/rpc_host_nodejs.rs diff --git a/crates/parcel_plugin_rpc/src/plugin/bundler.rs b/crates/atlaspack_plugin_rpc/src/plugin/bundler.rs similarity index 79% rename from crates/parcel_plugin_rpc/src/plugin/bundler.rs rename to crates/atlaspack_plugin_rpc/src/plugin/bundler.rs index fa9d65f8b..d8d597433 100644 --- a/crates/parcel_plugin_rpc/src/plugin/bundler.rs +++ b/crates/atlaspack_plugin_rpc/src/plugin/bundler.rs @@ -1,10 +1,10 @@ use std::fmt; use std::fmt::Debug; -use parcel_config::PluginNode; -use parcel_core::bundle_graph::BundleGraph; -use parcel_core::plugin::BundlerPlugin; -use parcel_core::plugin::PluginContext; +use atlaspack_config::PluginNode; +use atlaspack_core::bundle_graph::BundleGraph; +use atlaspack_core::plugin::BundlerPlugin; +use atlaspack_core::plugin::PluginContext; pub struct RpcBundlerPlugin { _name: String, diff --git a/crates/parcel_plugin_rpc/src/plugin/compressor.rs b/crates/atlaspack_plugin_rpc/src/plugin/compressor.rs similarity index 77% rename from crates/parcel_plugin_rpc/src/plugin/compressor.rs rename to crates/atlaspack_plugin_rpc/src/plugin/compressor.rs index 060b6495a..eb8df293b 100644 --- a/crates/parcel_plugin_rpc/src/plugin/compressor.rs +++ b/crates/atlaspack_plugin_rpc/src/plugin/compressor.rs @@ -2,10 +2,10 @@ use std::fmt; use std::fmt::Debug; use std::fs::File; -use parcel_config::PluginNode; -use parcel_core::plugin::CompressedFile; -use parcel_core::plugin::CompressorPlugin; -use parcel_core::plugin::PluginContext; +use atlaspack_config::PluginNode; +use atlaspack_core::plugin::CompressedFile; +use atlaspack_core::plugin::CompressorPlugin; +use atlaspack_core::plugin::PluginContext; pub struct RpcCompressorPlugin { _name: String, diff --git a/crates/parcel_plugin_rpc/src/plugin/mod.rs b/crates/atlaspack_plugin_rpc/src/plugin/mod.rs similarity index 100% rename from crates/parcel_plugin_rpc/src/plugin/mod.rs rename to crates/atlaspack_plugin_rpc/src/plugin/mod.rs diff --git a/crates/parcel_plugin_rpc/src/plugin/namer.rs b/crates/atlaspack_plugin_rpc/src/plugin/namer.rs similarity index 75% rename from crates/parcel_plugin_rpc/src/plugin/namer.rs rename to crates/atlaspack_plugin_rpc/src/plugin/namer.rs index ee9e6dad8..da9fdf4c2 100644 --- a/crates/parcel_plugin_rpc/src/plugin/namer.rs +++ b/crates/atlaspack_plugin_rpc/src/plugin/namer.rs @@ -1,11 +1,11 @@ use std::fmt; use std::fmt::Debug; -use parcel_config::PluginNode; -use parcel_core::bundle_graph::BundleGraph; -use parcel_core::plugin::NamerPlugin; -use parcel_core::plugin::PluginContext; -use parcel_core::types::Bundle; +use atlaspack_config::PluginNode; +use atlaspack_core::bundle_graph::BundleGraph; +use atlaspack_core::plugin::NamerPlugin; +use atlaspack_core::plugin::PluginContext; +use atlaspack_core::types::Bundle; pub struct RpcNamerPlugin { _name: String, diff --git a/crates/parcel_plugin_rpc/src/plugin/optimizer.rs b/crates/atlaspack_plugin_rpc/src/plugin/optimizer.rs similarity index 73% rename from crates/parcel_plugin_rpc/src/plugin/optimizer.rs rename to crates/atlaspack_plugin_rpc/src/plugin/optimizer.rs index a7e129e46..d5a67ce4c 100644 --- a/crates/parcel_plugin_rpc/src/plugin/optimizer.rs +++ b/crates/atlaspack_plugin_rpc/src/plugin/optimizer.rs @@ -1,11 +1,11 @@ use std::fmt; use std::fmt::Debug; -use parcel_config::PluginNode; -use parcel_core::plugin::OptimizeContext; -use parcel_core::plugin::OptimizedBundle; -use parcel_core::plugin::OptimizerPlugin; -use parcel_core::plugin::PluginContext; +use atlaspack_config::PluginNode; +use atlaspack_core::plugin::OptimizeContext; +use atlaspack_core::plugin::OptimizedBundle; +use atlaspack_core::plugin::OptimizerPlugin; +use atlaspack_core::plugin::PluginContext; pub struct RpcOptimizerPlugin { _name: String, diff --git a/crates/parcel_plugin_rpc/src/plugin/packager.rs b/crates/atlaspack_plugin_rpc/src/plugin/packager.rs similarity index 73% rename from crates/parcel_plugin_rpc/src/plugin/packager.rs rename to crates/atlaspack_plugin_rpc/src/plugin/packager.rs index 2c76fd316..1e8a4eb4c 100644 --- a/crates/parcel_plugin_rpc/src/plugin/packager.rs +++ b/crates/atlaspack_plugin_rpc/src/plugin/packager.rs @@ -1,11 +1,11 @@ use std::fmt; use std::fmt::Debug; -use parcel_config::PluginNode; -use parcel_core::plugin::PackageContext; -use parcel_core::plugin::PackagedBundle; -use parcel_core::plugin::PackagerPlugin; -use parcel_core::plugin::PluginContext; +use atlaspack_config::PluginNode; +use atlaspack_core::plugin::PackageContext; +use atlaspack_core::plugin::PackagedBundle; +use atlaspack_core::plugin::PackagerPlugin; +use atlaspack_core::plugin::PluginContext; pub struct RpcPackagerPlugin { _name: String, diff --git a/crates/parcel_plugin_rpc/src/plugin/reporter.rs b/crates/atlaspack_plugin_rpc/src/plugin/reporter.rs similarity index 76% rename from crates/parcel_plugin_rpc/src/plugin/reporter.rs rename to crates/atlaspack_plugin_rpc/src/plugin/reporter.rs index eb34bf481..4f823e0d2 100644 --- a/crates/parcel_plugin_rpc/src/plugin/reporter.rs +++ b/crates/atlaspack_plugin_rpc/src/plugin/reporter.rs @@ -1,10 +1,10 @@ use std::fmt; use std::fmt::Debug; -use parcel_config::PluginNode; -use parcel_core::plugin::PluginContext; -use parcel_core::plugin::ReporterEvent; -use parcel_core::plugin::ReporterPlugin; +use atlaspack_config::PluginNode; +use atlaspack_core::plugin::PluginContext; +use atlaspack_core::plugin::ReporterEvent; +use atlaspack_core::plugin::ReporterPlugin; pub struct RpcReporterPlugin { _name: String, diff --git a/crates/parcel_plugin_rpc/src/plugin/resolver.rs b/crates/atlaspack_plugin_rpc/src/plugin/resolver.rs similarity index 71% rename from crates/parcel_plugin_rpc/src/plugin/resolver.rs rename to crates/atlaspack_plugin_rpc/src/plugin/resolver.rs index 774a36626..e0d2f8980 100644 --- a/crates/parcel_plugin_rpc/src/plugin/resolver.rs +++ b/crates/atlaspack_plugin_rpc/src/plugin/resolver.rs @@ -1,11 +1,11 @@ use std::fmt; use std::fmt::Debug; -use parcel_config::PluginNode; -use parcel_core::plugin::PluginContext; -use parcel_core::plugin::ResolveContext; -use parcel_core::plugin::Resolved; -use parcel_core::plugin::ResolverPlugin; +use atlaspack_config::PluginNode; +use atlaspack_core::plugin::PluginContext; +use atlaspack_core::plugin::ResolveContext; +use atlaspack_core::plugin::Resolved; +use atlaspack_core::plugin::ResolverPlugin; #[derive(Hash)] pub struct RpcResolverPlugin {} diff --git a/crates/parcel_plugin_rpc/src/plugin/runtime.rs b/crates/atlaspack_plugin_rpc/src/plugin/runtime.rs similarity index 71% rename from crates/parcel_plugin_rpc/src/plugin/runtime.rs rename to crates/atlaspack_plugin_rpc/src/plugin/runtime.rs index f74c5307d..bba542643 100644 --- a/crates/parcel_plugin_rpc/src/plugin/runtime.rs +++ b/crates/atlaspack_plugin_rpc/src/plugin/runtime.rs @@ -1,12 +1,12 @@ use std::fmt; use std::fmt::Debug; -use parcel_config::PluginNode; -use parcel_core::bundle_graph::BundleGraph; -use parcel_core::plugin::PluginContext; -use parcel_core::plugin::RuntimeAsset; -use parcel_core::plugin::RuntimePlugin; -use parcel_core::types::Bundle; +use atlaspack_config::PluginNode; +use atlaspack_core::bundle_graph::BundleGraph; +use atlaspack_core::plugin::PluginContext; +use atlaspack_core::plugin::RuntimeAsset; +use atlaspack_core::plugin::RuntimePlugin; +use atlaspack_core::types::Bundle; pub struct RpcRuntimePlugin { _name: String, diff --git a/crates/parcel_plugin_rpc/src/plugin/transformer.rs b/crates/atlaspack_plugin_rpc/src/plugin/transformer.rs similarity index 76% rename from crates/parcel_plugin_rpc/src/plugin/transformer.rs rename to crates/atlaspack_plugin_rpc/src/plugin/transformer.rs index 7cf289476..6fcd5915f 100644 --- a/crates/parcel_plugin_rpc/src/plugin/transformer.rs +++ b/crates/atlaspack_plugin_rpc/src/plugin/transformer.rs @@ -3,10 +3,10 @@ use std::fmt::Debug; use anyhow::Error; -use parcel_config::PluginNode; -use parcel_core::plugin::PluginContext; -use parcel_core::plugin::TransformerPlugin; -use parcel_core::plugin::{TransformResult, TransformationInput}; +use atlaspack_config::PluginNode; +use atlaspack_core::plugin::PluginContext; +use atlaspack_core::plugin::TransformerPlugin; +use atlaspack_core::plugin::{TransformResult, TransformationInput}; pub struct RpcTransformerPlugin { _name: String, diff --git a/crates/parcel_plugin_rpc/src/rpc_host.rs b/crates/atlaspack_plugin_rpc/src/rpc_host.rs similarity index 100% rename from crates/parcel_plugin_rpc/src/rpc_host.rs rename to crates/atlaspack_plugin_rpc/src/rpc_host.rs diff --git a/crates/atlaspack_plugin_transformer_js/Cargo.toml b/crates/atlaspack_plugin_transformer_js/Cargo.toml new file mode 100644 index 000000000..b59afb069 --- /dev/null +++ b/crates/atlaspack_plugin_transformer_js/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "atlaspack_plugin_transformer_js" +version = "0.1.0" +edition = "2021" +description = "JavaScript Transformer Plugin for the Atlaspack Bundler" + +[dependencies] +atlaspack_core = { path = "../atlaspack_core" } +atlaspack_filesystem = { path = "../atlaspack_filesystem" } + +anyhow = "1" +indexmap = "2.2.6" +atlaspack-js-swc-core = { path = "../../packages/transformers/js/core" } +serde = { version = "1.0.200", features = ["derive"] } +swc_core = { version = "0.96", features = ["ecma_ast"] } diff --git a/crates/parcel_plugin_transformer_js/src/lib.rs b/crates/atlaspack_plugin_transformer_js/src/lib.rs similarity index 57% rename from crates/parcel_plugin_transformer_js/src/lib.rs rename to crates/atlaspack_plugin_transformer_js/src/lib.rs index 818b4a498..dce3ea3a6 100644 --- a/crates/parcel_plugin_transformer_js/src/lib.rs +++ b/crates/atlaspack_plugin_transformer_js/src/lib.rs @@ -1,6 +1,6 @@ #![deny(unused_crate_dependencies)] -pub use transformer::ParcelJsTransformerPlugin; +pub use transformer::AtlaspackJsTransformerPlugin; mod transformer; mod ts_config; diff --git a/crates/parcel_plugin_transformer_js/src/transformer.rs b/crates/atlaspack_plugin_transformer_js/src/transformer.rs similarity index 91% rename from crates/parcel_plugin_transformer_js/src/transformer.rs rename to crates/atlaspack_plugin_transformer_js/src/transformer.rs index 4037c1922..ce15cce80 100644 --- a/crates/parcel_plugin_transformer_js/src/transformer.rs +++ b/crates/atlaspack_plugin_transformer_js/src/transformer.rs @@ -4,13 +4,13 @@ use std::sync::Arc; use anyhow::{anyhow, Error}; -use parcel_core::plugin::{PluginContext, PluginOptions, TransformerPlugin}; -use parcel_core::plugin::{TransformResult, TransformationInput}; -use parcel_core::types::engines::EnvironmentFeature; -use parcel_core::types::{ +use atlaspack_core::plugin::{PluginContext, PluginOptions, TransformerPlugin}; +use atlaspack_core::plugin::{TransformResult, TransformationInput}; +use atlaspack_core::types::engines::EnvironmentFeature; +use atlaspack_core::types::{ Asset, BuildMode, Diagnostic, ErrorKind, FileType, LogLevel, OutputFormat, SourceType, }; -use parcel_filesystem::FileSystemRef; +use atlaspack_filesystem::FileSystemRef; use crate::ts_config::{Jsx, Target, TsConfig}; @@ -29,13 +29,13 @@ mod test_helpers; /// `Dependency` as well as exported, imported and re-exported symbols (as `Symbol`, usually /// mapping to a mangled name that the SWC transformer replaced in the source file + the source /// module and the source name that has been imported) -pub struct ParcelJsTransformerPlugin { +pub struct AtlaspackJsTransformerPlugin { file_system: FileSystemRef, options: Arc, ts_config: Option, } -impl ParcelJsTransformerPlugin { +impl AtlaspackJsTransformerPlugin { pub fn new(ctx: &PluginContext) -> Result { let ts_config = ctx .config @@ -60,15 +60,15 @@ impl ParcelJsTransformerPlugin { } } -impl fmt::Debug for ParcelJsTransformerPlugin { +impl fmt::Debug for AtlaspackJsTransformerPlugin { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("ParcelJsTransformerPlugin") + f.debug_struct("AtlaspackJsTransformerPlugin") .field("options", &self.options) .finish() } } -impl TransformerPlugin for ParcelJsTransformerPlugin { +impl TransformerPlugin for AtlaspackJsTransformerPlugin { /// This does a lot of equivalent work to `JSTransformer::transform` in /// `packages/transformers/js` fn transform(&mut self, input: TransformationInput) -> Result { @@ -112,8 +112,8 @@ impl TransformerPlugin for ParcelJsTransformerPlugin { } } - let transformation_result = parcel_js_swc_core::transform( - parcel_js_swc_core::Config { + let transformation_result = atlaspack_js_swc_core::transform( + atlaspack_js_swc_core::Config { // TODO: Infer from package.json automatic_jsx_runtime: compiler_options .map(|co| { @@ -169,8 +169,8 @@ impl TransformerPlugin for ParcelJsTransformerPlugin { scope_hoist: env.should_scope_hoist && env.source_type != SourceType::Script, source_maps: env.source_map.is_some(), source_type: match env.source_type { - SourceType::Module => parcel_js_swc_core::SourceType::Module, - SourceType::Script => parcel_js_swc_core::SourceType::Script, + SourceType::Module => atlaspack_js_swc_core::SourceType::Module, + SourceType::Script => atlaspack_js_swc_core::SourceType::Script, }, supports_module_workers: env.should_scope_hoist && env.engines.supports(EnvironmentFeature::WorkerModule), @@ -187,7 +187,7 @@ impl TransformerPlugin for ParcelJsTransformerPlugin { }) }) .unwrap_or_default(), - ..parcel_js_swc_core::Config::default() + ..atlaspack_js_swc_core::Config::default() }, None, )?; @@ -213,7 +213,7 @@ impl TransformerPlugin for ParcelJsTransformerPlugin { ..Asset::default() }; - let config = parcel_js_swc_core::Config::default(); + let config = atlaspack_js_swc_core::Config::default(); let result = conversion::convert_result(asset, &config, transformation_result, &self.options) // TODO handle errors properly .map_err(|_err| anyhow!("Failed to transform"))?; @@ -226,12 +226,12 @@ impl TransformerPlugin for ParcelJsTransformerPlugin { mod test { use std::path::PathBuf; - use parcel_core::{ + use atlaspack_core::{ config_loader::ConfigLoader, plugin::PluginLogger, types::{Code, Dependency, Location, SourceLocation, SpecifierType, Symbol}, }; - use parcel_filesystem::in_memory_file_system::InMemoryFileSystem; + use atlaspack_filesystem::in_memory_file_system::InMemoryFileSystem; use super::*; @@ -403,7 +403,7 @@ exports.hello = function() {}; options: Arc::new(PluginOptions::default()), }; - let mut transformer = ParcelJsTransformerPlugin::new(&ctx).expect("Expected transformer"); + let mut transformer = AtlaspackJsTransformerPlugin::new(&ctx).expect("Expected transformer"); let result = transformer.transform(TransformationInput::Asset(asset))?; Ok(result) diff --git a/crates/parcel_plugin_transformer_js/src/transformer/conversion.rs b/crates/atlaspack_plugin_transformer_js/src/transformer/conversion.rs similarity index 94% rename from crates/parcel_plugin_transformer_js/src/transformer/conversion.rs rename to crates/atlaspack_plugin_transformer_js/src/transformer/conversion.rs index a19c6697a..99252e266 100644 --- a/crates/parcel_plugin_transformer_js/src/transformer/conversion.rs +++ b/crates/atlaspack_plugin_transformer_js/src/transformer/conversion.rs @@ -1,13 +1,13 @@ use std::path::PathBuf; use std::sync::Arc; +use atlaspack_core::diagnostic; use indexmap::IndexMap; -use parcel_core::diagnostic; use swc_core::atoms::Atom; -use parcel_core::plugin::{PluginOptions, TransformResult}; -use parcel_core::types::engines::EnvironmentFeature; -use parcel_core::types::{ +use atlaspack_core::plugin::{PluginOptions, TransformResult}; +use atlaspack_core::types::engines::EnvironmentFeature; +use atlaspack_core::types::{ Asset, BundleBehavior, Code, CodeFrame, CodeHighlight, Dependency, Diagnostic, DiagnosticBuilder, Environment, EnvironmentContext, File, FileType, IncludeNodeModules, OutputFormat, SourceLocation, SourceType, SpecifierType, Symbol, @@ -27,8 +27,8 @@ mod symbol; pub(crate) fn convert_result( mut asset: Asset, - transformer_config: &parcel_js_swc_core::Config, - result: parcel_js_swc_core::TransformResult, + transformer_config: &atlaspack_js_swc_core::Config, + result: atlaspack_js_swc_core::TransformResult, options: &PluginOptions, ) -> Result> { let asset_file_path = asset.file_path.to_path_buf(); @@ -279,7 +279,7 @@ pub(crate) fn convert_result( /// ``` /// /// See [`HoistResult::re_exports`] -pub(crate) fn is_re_export_all_symbol(symbol: &parcel_js_swc_core::ImportedSymbol) -> bool { +pub(crate) fn is_re_export_all_symbol(symbol: &atlaspack_js_swc_core::ImportedSymbol) -> bool { symbol.local == "*" && symbol.imported == "*" } @@ -291,8 +291,8 @@ pub(crate) fn is_re_export_all_symbol(symbol: &parcel_js_swc_core::ImportedSymbo /// /// This will be used to find dependencies corresponding to imported symbols' `local` mangled names. pub(crate) fn convert_dependencies( - transformer_config: &parcel_js_swc_core::Config, - dependencies: Vec, + transformer_config: &atlaspack_js_swc_core::Config, + dependencies: Vec, asset: &Asset, asset_id: u64, ) -> Result<(IndexMap, Vec), Vec> { @@ -341,12 +341,12 @@ fn make_esm_helpers_dependency( ) -> Dependency { Dependency { source_asset_id: Some(format!("{:016x}", asset_id)), - specifier: "@parcel/transformer-js/src/esmodule-helpers.js".into(), + specifier: "@atlaspack/transformer-js/src/esmodule-helpers.js".into(), specifier_type: SpecifierType::Esm, source_path: Some(asset_file_path.clone()), env: Environment { include_node_modules: IncludeNodeModules::Map( - [("@parcel/transformer-js".to_string(), true)] + [("@atlaspack/transformer-js".to_string(), true)] .into_iter() .collect(), ), @@ -375,20 +375,20 @@ fn make_export_all_symbol(loc: Option) -> Symbol { enum DependencyConversionResult { Dependency(Dependency), - /// Only for [`parcel_js_swc_core::DependencyKind::File`] dependencies, the output will not be a + /// Only for [`atlaspack_js_swc_core::DependencyKind::File`] dependencies, the output will not be a /// [`Dependency`] but just an invalidation. InvalidateOnFileChange(PathBuf), } -/// Convert dependency from the transformer `parcel_js_swc_core::DependencyDescriptor` into a +/// Convert dependency from the transformer `atlaspack_js_swc_core::DependencyDescriptor` into a /// `DependencyConversionResult`. fn convert_dependency( - transformer_config: &parcel_js_swc_core::Config, + transformer_config: &atlaspack_js_swc_core::Config, asset: &Asset, asset_id: u64, - transformer_dependency: parcel_js_swc_core::DependencyDescriptor, + transformer_dependency: atlaspack_js_swc_core::DependencyDescriptor, ) -> Result> { - use parcel_js_swc_core::DependencyKind; + use atlaspack_js_swc_core::DependencyKind; let loc = convert_loc(asset.file_path.clone(), &transformer_dependency.loc); let mut base_dependency = Dependency { @@ -428,7 +428,7 @@ fn convert_dependency( if output_format == OutputFormat::EsModule && matches!( transformer_dependency.source_type, - Some(parcel_js_swc_core::SourceType::Module) + Some(atlaspack_js_swc_core::SourceType::Module) ) && transformer_config.supports_module_workers { @@ -595,8 +595,8 @@ fn convert_dependency( } } -fn convert_source_type(source_type: &Option) -> SourceType { - if matches!(source_type, Some(parcel_js_swc_core::SourceType::Module)) { +fn convert_source_type(source_type: &Option) -> SourceType { + if matches!(source_type, Some(atlaspack_js_swc_core::SourceType::Module)) { SourceType::Module } else { SourceType::Script diff --git a/crates/parcel_plugin_transformer_js/src/transformer/conversion/dependency_kind.rs b/crates/atlaspack_plugin_transformer_js/src/transformer/conversion/dependency_kind.rs similarity index 91% rename from crates/parcel_plugin_transformer_js/src/transformer/conversion/dependency_kind.rs rename to crates/atlaspack_plugin_transformer_js/src/transformer/conversion/dependency_kind.rs index feaa28116..a4fcf7a47 100644 --- a/crates/parcel_plugin_transformer_js/src/transformer/conversion/dependency_kind.rs +++ b/crates/atlaspack_plugin_transformer_js/src/transformer/conversion/dependency_kind.rs @@ -1,9 +1,9 @@ -use parcel_core::types::{Priority, SpecifierType}; +use atlaspack_core::types::{Priority, SpecifierType}; pub(crate) fn convert_priority( - transformer_dependency: &parcel_js_swc_core::DependencyDescriptor, + transformer_dependency: &atlaspack_js_swc_core::DependencyDescriptor, ) -> Priority { - use parcel_js_swc_core::DependencyKind; + use atlaspack_js_swc_core::DependencyKind; match transformer_dependency.kind { DependencyKind::DynamicImport => Priority::Lazy, @@ -19,9 +19,9 @@ pub(crate) fn convert_priority( } pub(crate) fn convert_specifier_type( - transformer_dependency: &parcel_js_swc_core::DependencyDescriptor, + transformer_dependency: &atlaspack_js_swc_core::DependencyDescriptor, ) -> SpecifierType { - use parcel_js_swc_core::DependencyKind; + use atlaspack_js_swc_core::DependencyKind; match transformer_dependency.kind { DependencyKind::Require => SpecifierType::CommonJS, @@ -39,7 +39,7 @@ pub(crate) fn convert_specifier_type( #[cfg(test)] mod test { use crate::transformer::test_helpers::run_swc_core_transform; - use parcel_js_swc_core::DependencyKind; + use atlaspack_js_swc_core::DependencyKind; use super::*; @@ -142,7 +142,7 @@ mod test { } // This test-case can't be written right now because in order to parse inline-fs - // declarations, parcel needs to canonicalize paths, meaning that it does not work + // declarations, atlaspack needs to canonicalize paths, meaning that it does not work // unless the source/project and read files exist on disk. // // Running this test at the moment will fail because the `import fs` will be returned @@ -163,7 +163,7 @@ mod test { } /// Run the SWC transformer and return the last dependency descriptor listed. - fn get_last_dependency(source: &str) -> parcel_js_swc_core::DependencyDescriptor { + fn get_last_dependency(source: &str) -> atlaspack_js_swc_core::DependencyDescriptor { let swc_output = run_swc_core_transform(source); swc_output.dependencies.last().unwrap().clone() } diff --git a/crates/parcel_plugin_transformer_js/src/transformer/conversion/loc.rs b/crates/atlaspack_plugin_transformer_js/src/transformer/conversion/loc.rs similarity index 74% rename from crates/parcel_plugin_transformer_js/src/transformer/conversion/loc.rs rename to crates/atlaspack_plugin_transformer_js/src/transformer/conversion/loc.rs index 7f018f363..b98b52f8b 100644 --- a/crates/parcel_plugin_transformer_js/src/transformer/conversion/loc.rs +++ b/crates/atlaspack_plugin_transformer_js/src/transformer/conversion/loc.rs @@ -1,10 +1,10 @@ use std::path::PathBuf; -use parcel_core::types::{Location, SourceLocation}; +use atlaspack_core::types::{Location, SourceLocation}; pub(crate) fn convert_loc( file_path: PathBuf, - loc: &parcel_js_swc_core::SourceLocation, + loc: &atlaspack_js_swc_core::SourceLocation, ) -> SourceLocation { SourceLocation { file_path, diff --git a/crates/parcel_plugin_transformer_js/src/transformer/conversion/symbol.rs b/crates/atlaspack_plugin_transformer_js/src/transformer/conversion/symbol.rs similarity index 89% rename from crates/parcel_plugin_transformer_js/src/transformer/conversion/symbol.rs rename to crates/atlaspack_plugin_transformer_js/src/transformer/conversion/symbol.rs index 190591d2c..6bc1787be 100644 --- a/crates/parcel_plugin_transformer_js/src/transformer/conversion/symbol.rs +++ b/crates/atlaspack_plugin_transformer_js/src/transformer/conversion/symbol.rs @@ -1,6 +1,6 @@ use std::path::Path; -use parcel_core::types::Symbol; +use atlaspack_core::types::Symbol; use crate::transformer::conversion::loc::convert_loc; @@ -19,7 +19,7 @@ macro_rules! convert_symbol { /// Convert from `[CollectImportedSymbol]` to `[Symbol]` pub(crate) fn transformer_collect_imported_symbol_to_symbol( asset_file_path: &Path, - symbol: &parcel_js_swc_core::CollectImportedSymbol, + symbol: &atlaspack_js_swc_core::CollectImportedSymbol, ) -> Symbol { convert_symbol!(asset_file_path, symbol) } @@ -29,7 +29,7 @@ pub(crate) fn transformer_collect_imported_symbol_to_symbol( /// `ImportedSymbol` corresponds to `x`, `y` in `import { x, y } from 'other';` pub(crate) fn transformer_imported_symbol_to_symbol( asset_file_path: &Path, - symbol: &parcel_js_swc_core::ImportedSymbol, + symbol: &atlaspack_js_swc_core::ImportedSymbol, ) -> Symbol { convert_symbol!(asset_file_path, symbol) } @@ -37,7 +37,7 @@ pub(crate) fn transformer_imported_symbol_to_symbol( /// Convert from `[ExportedSymbol]` to `[Symbol]` pub(crate) fn transformer_exported_symbol_into_symbol( asset_file_path: &Path, - symbol: &parcel_js_swc_core::ExportedSymbol, + symbol: &atlaspack_js_swc_core::ExportedSymbol, ) -> Symbol { Symbol { exported: symbol.exported.as_ref().into(), @@ -52,7 +52,7 @@ pub(crate) fn transformer_exported_symbol_into_symbol( mod test { use std::path::PathBuf; - use parcel_core::types::{Location, SourceLocation}; + use atlaspack_core::types::{Location, SourceLocation}; use crate::transformer::test_helpers::{make_test_swc_config, run_swc_core_transform}; @@ -60,10 +60,10 @@ mod test { #[test] fn test_convert_collect_imported_symbol_to_symbol() { - use parcel_core::types::Symbol; + use atlaspack_core::types::Symbol; - let result = parcel_js_swc_core::transform( - parcel_js_swc_core::Config { + let result = atlaspack_js_swc_core::transform( + atlaspack_js_swc_core::Config { scope_hoist: false, ..make_test_swc_config( r#" @@ -76,7 +76,7 @@ mod test { ) .unwrap(); let collect_result = result.symbol_result.unwrap(); - let import: parcel_js_swc_core::CollectImportedSymbol = collect_result.imports[0].clone(); + let import: atlaspack_js_swc_core::CollectImportedSymbol = collect_result.imports[0].clone(); let result = transformer_collect_imported_symbol_to_symbol(&Path::new("test.js"), &import); assert_eq!( diff --git a/crates/parcel_plugin_transformer_js/src/transformer/test_helpers.rs b/crates/atlaspack_plugin_transformer_js/src/transformer/test_helpers.rs similarity index 57% rename from crates/parcel_plugin_transformer_js/src/transformer/test_helpers.rs rename to crates/atlaspack_plugin_transformer_js/src/transformer/test_helpers.rs index c89c1518b..f927890c0 100644 --- a/crates/parcel_plugin_transformer_js/src/transformer/test_helpers.rs +++ b/crates/atlaspack_plugin_transformer_js/src/transformer/test_helpers.rs @@ -1,15 +1,15 @@ -use parcel_js_swc_core::{Config, TransformResult}; +use atlaspack_js_swc_core::{Config, TransformResult}; -/// Parse a file with the `parcel_js_swc_core` parser for testing +/// Parse a file with the `atlaspack_js_swc_core` parser for testing pub(crate) fn run_swc_core_transform(source: &str) -> TransformResult { - let swc_output = parcel_js_swc_core::transform(make_test_swc_config(source), None).unwrap(); + let swc_output = atlaspack_js_swc_core::transform(make_test_swc_config(source), None).unwrap(); swc_output } /// SWC configuration for testing pub(crate) fn make_test_swc_config(source: &str) -> Config { Config { - source_type: parcel_js_swc_core::SourceType::Module, + source_type: atlaspack_js_swc_core::SourceType::Module, is_browser: true, filename: "something/file.js".to_string(), inline_fs: true, diff --git a/crates/parcel_plugin_transformer_js/src/ts_config.rs b/crates/atlaspack_plugin_transformer_js/src/ts_config.rs similarity index 100% rename from crates/parcel_plugin_transformer_js/src/ts_config.rs rename to crates/atlaspack_plugin_transformer_js/src/ts_config.rs diff --git a/crates/macros/Cargo.toml b/crates/macros/Cargo.toml index df332a2fe..2ddd38fd7 100644 --- a/crates/macros/Cargo.toml +++ b/crates/macros/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Devon Govett "] -name = "parcel-macros" +name = "atlaspack-macros" version = "0.1.0" edition = "2021" diff --git a/crates/node-bindings/Cargo.toml b/crates/node-bindings/Cargo.toml index 6bb56c167..bc414c226 100644 --- a/crates/node-bindings/Cargo.toml +++ b/crates/node-bindings/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Devon Govett "] -name = "parcel-node-bindings" +name = "atlaspack-node-bindings" version = "0.1.0" edition = "2021" @@ -8,18 +8,18 @@ edition = "2021" crate-type = ["cdylib"] [features] -canary = ["parcel_monitoring/canary"] +canary = ["atlaspack_monitoring/canary"] [dependencies] -parcel = { path = "../parcel" } -parcel_core = { path = "../parcel_core" } -parcel-js-swc-core = { path = "../../packages/transformers/js/core" } -parcel_monitoring = { path = "../parcel_monitoring" } -parcel-resolver = { path = "../../packages/utils/node-resolver-rs" } -parcel-resolver-old = { path = "../../packages/utils/node-resolver-rs-old" } -parcel_package_manager = { path = "../parcel_package_manager" } -parcel_plugin_transformer_js = { path = "../parcel_plugin_transformer_js" } -parcel_napi_helpers = { path = "../parcel_napi_helpers" } +atlaspack = { path = "../atlaspack" } +atlaspack_core = { path = "../atlaspack_core" } +atlaspack-js-swc-core = { path = "../../packages/transformers/js/core" } +atlaspack_monitoring = { path = "../atlaspack_monitoring" } +atlaspack-resolver = { path = "../../packages/utils/node-resolver-rs" } +atlaspack-resolver-old = { path = "../../packages/utils/node-resolver-rs-old" } +atlaspack_package_manager = { path = "../atlaspack_package_manager" } +atlaspack_plugin_transformer_js = { path = "../atlaspack_plugin_transformer_js" } +atlaspack_napi_helpers = { path = "../atlaspack_napi_helpers" } anyhow = "1.0.82" dashmap = "5.4.0" @@ -38,10 +38,10 @@ tracing-subscriber = "0.3.18" xxhash-rust = { version = "0.8.2", features = ["xxh3"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -parcel = { path = "../parcel", features = ["nodejs"] } -parcel-dev-dep-resolver = { path = "../../packages/utils/dev-dep-resolver" } -parcel-dev-dep-resolver-old = { path = "../../packages/utils/dev-dep-resolver-old" } -parcel-macros = { path = "../macros", features = ["napi"] } +atlaspack = { path = "../atlaspack", features = ["nodejs"] } +atlaspack-dev-dep-resolver = { path = "../../packages/utils/dev-dep-resolver" } +atlaspack-dev-dep-resolver-old = { path = "../../packages/utils/dev-dep-resolver-old" } +atlaspack-macros = { path = "../macros", features = ["napi"] } crossbeam-channel = "0.5.6" indexmap = "1.9.2" diff --git a/crates/node-bindings/src/parcel/parcel.rs b/crates/node-bindings/src/atlaspack/atlaspack.rs similarity index 72% rename from crates/node-bindings/src/parcel/parcel.rs rename to crates/node-bindings/src/atlaspack/atlaspack.rs index 76e5b0970..c996e677a 100644 --- a/crates/node-bindings/src/parcel/parcel.rs +++ b/crates/node-bindings/src/atlaspack/atlaspack.rs @@ -9,29 +9,29 @@ use napi::JsObject; use napi::JsUnknown; use napi_derive::napi; -use parcel::file_system::FileSystemRef; -use parcel::rpc::nodejs::NodejsWorker; -use parcel::rpc::nodejs::RpcHostNodejs; -use parcel::rpc::RpcHostRef; -use parcel::Parcel; -use parcel_core::types::ParcelOptions; -use parcel_napi_helpers::JsTransferable; -use parcel_package_manager::PackageManagerRef; +use atlaspack::file_system::FileSystemRef; +use atlaspack::rpc::nodejs::NodejsWorker; +use atlaspack::rpc::nodejs::RpcHostNodejs; +use atlaspack::rpc::RpcHostRef; +use atlaspack::Atlaspack; +use atlaspack_core::types::AtlaspackOptions; +use atlaspack_napi_helpers::JsTransferable; +use atlaspack_package_manager::PackageManagerRef; use crate::file_system::FileSystemNapi; use super::package_manager_napi::PackageManagerNapi; #[napi(object)] -pub struct ParcelNapiBuildOptions { +pub struct AtlaspackNapiBuildOptions { pub register_worker: JsFunction, } #[napi(object)] -pub struct ParcelNapiBuildResult {} +pub struct AtlaspackNapiBuildResult {} #[napi(object)] -pub struct ParcelNapiOptions { +pub struct AtlaspackNapiOptions { pub fs: Option, pub node_workers: Option, pub options: JsObject, @@ -40,21 +40,21 @@ pub struct ParcelNapiOptions { } #[napi] -pub struct ParcelNapi { +pub struct AtlaspackNapi { pub node_worker_count: u32, fs: Option, - options: ParcelOptions, + options: AtlaspackOptions, package_manager: Option, rpc: Option, tx_worker: Sender, } #[napi] -impl ParcelNapi { +impl AtlaspackNapi { #[napi(constructor)] - pub fn new(napi_options: ParcelNapiOptions, env: Env) -> napi::Result { + pub fn new(napi_options: AtlaspackNapiOptions, env: Env) -> napi::Result { let thread_id = std::thread::current().id(); - tracing::trace!(?thread_id, "parcel-napi initialize"); + tracing::trace!(?thread_id, "atlaspack-napi initialize"); // Wrap the JavaScript-supplied FileSystem let fs: Option = if let Some(fs) = napi_options.fs { @@ -97,12 +97,12 @@ impl ParcelNapi { } #[napi] - pub fn build(&self, env: Env, options: ParcelNapiBuildOptions) -> napi::Result { + pub fn build(&self, env: Env, options: AtlaspackNapiBuildOptions) -> napi::Result { let (deferred, promise) = env.create_deferred()?; self.register_workers(&options)?; - // Both the parcel initialization and build must be run a dedicated system thread so that + // Both the atlaspack initialization and build must be run a dedicated system thread so that // the napi threadsafe functions do not panic thread::spawn({ let fs = self.fs.clone(); @@ -111,12 +111,12 @@ impl ParcelNapi { let rpc = self.rpc.clone(); move || { - let parcel = Parcel::new(fs, options, package_manager, rpc); + let atlaspack = Atlaspack::new(fs, options, package_manager, rpc); let to_napi_error = |error| napi::Error::from_reason(format!("{:?}", error)); - match parcel { + match atlaspack { Err(error) => deferred.reject(to_napi_error(error)), - Ok(mut parcel) => match parcel.build() { + Ok(mut atlaspack) => match atlaspack.build() { Ok(build_result) => deferred.resolve(move |env| env.to_js_value(&build_result)), Err(error) => deferred.reject(to_napi_error(error)), }, @@ -131,13 +131,13 @@ impl ParcelNapi { pub fn build_asset_graph( &self, env: Env, - options: ParcelNapiBuildOptions, + options: AtlaspackNapiBuildOptions, ) -> napi::Result { let (deferred, promise) = env.create_deferred()?; self.register_workers(&options)?; - // Both the parcel initialisation and build must be run a dedicated system thread so that + // Both the atlaspack initialisation and build must be run a dedicated system thread so that // the napi threadsafe functions do not panic thread::spawn({ let fs = self.fs.clone(); @@ -146,12 +146,12 @@ impl ParcelNapi { let rpc = self.rpc.clone(); move || { - let parcel = Parcel::new(fs, options, package_manager, rpc); + let atlaspack = Atlaspack::new(fs, options, package_manager, rpc); let to_napi_error = |error| napi::Error::from_reason(format!("{:?}", error)); - match parcel { + match atlaspack { Err(error) => deferred.reject(to_napi_error(error)), - Ok(mut parcel) => match parcel.build_asset_graph() { + Ok(mut atlaspack) => match atlaspack.build_asset_graph() { Ok(asset_graph) => deferred.resolve(move |env| env.to_js_value(&asset_graph)), Err(error) => deferred.reject(to_napi_error(error)), }, @@ -162,7 +162,7 @@ impl ParcelNapi { Ok(promise) } - fn register_workers(&self, options: &ParcelNapiBuildOptions) -> napi::Result<()> { + fn register_workers(&self, options: &AtlaspackNapiBuildOptions) -> napi::Result<()> { for _ in 0..self.node_worker_count { let transferable = JsTransferable::new(self.tx_worker.clone()); diff --git a/crates/node-bindings/src/parcel/mod.rs b/crates/node-bindings/src/atlaspack/mod.rs similarity index 77% rename from crates/node-bindings/src/parcel/mod.rs rename to crates/node-bindings/src/atlaspack/mod.rs index 9d60bb583..d8f70c958 100644 --- a/crates/node-bindings/src/parcel/mod.rs +++ b/crates/node-bindings/src/atlaspack/mod.rs @@ -1,4 +1,4 @@ +pub mod atlaspack; pub mod monitoring; pub mod package_manager_napi; -pub mod parcel; pub mod worker; diff --git a/crates/node-bindings/src/atlaspack/monitoring.rs b/crates/node-bindings/src/atlaspack/monitoring.rs new file mode 100644 index 000000000..cae8d9832 --- /dev/null +++ b/crates/node-bindings/src/atlaspack/monitoring.rs @@ -0,0 +1,12 @@ +use napi_derive::napi; + +#[napi] +pub fn initialize_monitoring() -> napi::Result<()> { + atlaspack_monitoring::initialize_from_env() + .map_err(|err| napi::Error::from_reason(err.to_string())) +} + +#[napi] +pub fn close_monitoring() { + atlaspack_monitoring::close_monitoring(); +} diff --git a/crates/node-bindings/src/parcel/package_manager_napi.rs b/crates/node-bindings/src/atlaspack/package_manager_napi.rs similarity index 84% rename from crates/node-bindings/src/parcel/package_manager_napi.rs rename to crates/node-bindings/src/atlaspack/package_manager_napi.rs index cd94ce809..ce141daaa 100644 --- a/crates/node-bindings/src/parcel/package_manager_napi.rs +++ b/crates/node-bindings/src/atlaspack/package_manager_napi.rs @@ -3,8 +3,8 @@ use std::path::Path; use anyhow::anyhow; use napi::{Env, JsObject}; -use parcel_napi_helpers::js_callable::JsCallable; -use parcel_package_manager::{PackageManager, Resolution}; +use atlaspack_napi_helpers::js_callable::JsCallable; +use atlaspack_package_manager::{PackageManager, Resolution}; pub struct PackageManagerNapi { resolve_fn: JsCallable, diff --git a/crates/node-bindings/src/parcel/worker.rs b/crates/node-bindings/src/atlaspack/worker.rs similarity index 93% rename from crates/node-bindings/src/parcel/worker.rs rename to crates/node-bindings/src/atlaspack/worker.rs index 71e9a82fa..4f915ddd8 100644 --- a/crates/node-bindings/src/parcel/worker.rs +++ b/crates/node-bindings/src/atlaspack/worker.rs @@ -1,9 +1,9 @@ use std::sync::mpsc::Sender; +use atlaspack::rpc::nodejs::NodejsWorker; +use atlaspack_napi_helpers::JsTransferable; use napi::{Env, JsObject, JsUndefined}; use napi_derive::napi; -use parcel::rpc::nodejs::NodejsWorker; -use parcel_napi_helpers::JsTransferable; /// This function is run in the Nodejs worker context upon initialization /// to notify the main thread that a Nodejs worker thread has started diff --git a/crates/node-bindings/src/file_system/file_system_napi.rs b/crates/node-bindings/src/file_system/file_system_napi.rs index f213f9d51..c0af6ba64 100644 --- a/crates/node-bindings/src/file_system/file_system_napi.rs +++ b/crates/node-bindings/src/file_system/file_system_napi.rs @@ -4,9 +4,9 @@ use std::{ }; use napi::{Env, JsObject}; -use parcel::file_system::FileSystem; +use atlaspack::file_system::FileSystem; -use parcel_napi_helpers::js_callable::JsCallable; +use atlaspack_napi_helpers::js_callable::JsCallable; // TODO error handling diff --git a/crates/node-bindings/src/lib.rs b/crates/node-bindings/src/lib.rs index 2c5cdd0b9..9367acb19 100644 --- a/crates/node-bindings/src/lib.rs +++ b/crates/node-bindings/src/lib.rs @@ -24,7 +24,7 @@ mod hash; mod image; #[cfg(not(target_arch = "wasm32"))] -mod parcel; +mod atlaspack; mod resolver; mod resolver_old; mod transformer; diff --git a/crates/node-bindings/src/parcel/monitoring.rs b/crates/node-bindings/src/parcel/monitoring.rs deleted file mode 100644 index 7a6e8bfb6..000000000 --- a/crates/node-bindings/src/parcel/monitoring.rs +++ /dev/null @@ -1,11 +0,0 @@ -use napi_derive::napi; - -#[napi] -pub fn initialize_monitoring() -> napi::Result<()> { - parcel_monitoring::initialize_from_env().map_err(|err| napi::Error::from_reason(err.to_string())) -} - -#[napi] -pub fn close_monitoring() { - parcel_monitoring::close_monitoring(); -} diff --git a/crates/node-bindings/src/resolver.rs b/crates/node-bindings/src/resolver.rs index bbdc14db2..3be7b5f4b 100644 --- a/crates/node-bindings/src/resolver.rs +++ b/crates/node-bindings/src/resolver.rs @@ -18,21 +18,21 @@ use napi::Ref; use napi::Result; use napi_derive::napi; -use parcel::file_system::{FileSystemRealPathCache, FileSystemRef}; -use parcel_resolver::ExportsCondition; -use parcel_resolver::Extensions; -use parcel_resolver::Fields; -use parcel_resolver::FileCreateInvalidation; -use parcel_resolver::FileSystem; -use parcel_resolver::Flags; -use parcel_resolver::IncludeNodeModules; -use parcel_resolver::Invalidations; -use parcel_resolver::ModuleType; +use atlaspack::file_system::{FileSystemRealPathCache, FileSystemRef}; +use atlaspack_resolver::ExportsCondition; +use atlaspack_resolver::Extensions; +use atlaspack_resolver::Fields; +use atlaspack_resolver::FileCreateInvalidation; +use atlaspack_resolver::FileSystem; +use atlaspack_resolver::Flags; +use atlaspack_resolver::IncludeNodeModules; +use atlaspack_resolver::Invalidations; +use atlaspack_resolver::ModuleType; #[cfg(not(target_arch = "wasm32"))] -use parcel_resolver::OsFileSystem; -use parcel_resolver::Resolution; -use parcel_resolver::ResolverError; -use parcel_resolver::SpecifierType; +use atlaspack_resolver::OsFileSystem; +use atlaspack_resolver::Resolution; +use atlaspack_resolver::ResolverError; +use atlaspack_resolver::SpecifierType; type NapiSideEffectsVariants = Either3, HashMap>; @@ -192,9 +192,9 @@ pub struct JsInvalidations { #[napi] pub struct Resolver { mode: u8, - resolver: parcel_resolver::Resolver<'static>, + resolver: atlaspack_resolver::Resolver<'static>, #[cfg(not(target_arch = "wasm32"))] - invalidations_cache: parcel_dev_dep_resolver::Cache, + invalidations_cache: atlaspack_dev_dep_resolver::Cache, supports_async: bool, } @@ -227,13 +227,13 @@ impl Resolver { }; let mut resolver = match options.mode { - 1 => parcel_resolver::Resolver::parcel( + 1 => atlaspack_resolver::Resolver::atlaspack( Cow::Owned(project_root.into()), - parcel_resolver::CacheCow::Owned(parcel_resolver::Cache::new(fs)), + atlaspack_resolver::CacheCow::Owned(atlaspack_resolver::Cache::new(fs)), ), - 2 => parcel_resolver::Resolver::node( + 2 => atlaspack_resolver::Resolver::node( Cow::Owned(project_root.into()), - parcel_resolver::CacheCow::Owned(parcel_resolver::Cache::new(fs)), + atlaspack_resolver::CacheCow::Owned(atlaspack_resolver::Cache::new(fs)), ), _ => return Err(napi::Error::new(napi::Status::InvalidArg, "Invalid mode")), }; @@ -295,7 +295,7 @@ impl Resolver { fn resolve_internal( &self, options: ResolveOptions, - ) -> napi::Result<(parcel_resolver::ResolveResult, bool, u8)> { + ) -> napi::Result<(atlaspack_resolver::ResolveResult, bool, u8)> { let mut res = self.resolver.resolve_with_options( &options.filename, Path::new(&options.parent), @@ -358,7 +358,7 @@ impl Resolver { fn resolve_result_to_js( &self, env: Env, - res: parcel_resolver::ResolveResult, + res: atlaspack_resolver::ResolveResult, side_effects: bool, module_type: u8, ) -> napi::Result { @@ -434,7 +434,7 @@ impl Resolver { #[napi] pub fn get_invalidations(&self, path: String) -> napi::Result { let path = Path::new(&path); - match parcel_dev_dep_resolver::build_esm_graph( + match atlaspack_dev_dep_resolver::build_esm_graph( path, &self.resolver.project_root, &self.resolver.cache, @@ -492,7 +492,7 @@ fn convert_invalidations( (invalidate_on_file_change, invalidate_on_file_create) } -fn get_resolve_options(mut custom_conditions: Vec) -> parcel_resolver::ResolveOptions { +fn get_resolve_options(mut custom_conditions: Vec) -> atlaspack_resolver::ResolveOptions { let mut conditions = ExportsCondition::empty(); custom_conditions.retain(|condition| { if let Ok(cond) = ExportsCondition::try_from(condition.as_ref()) { @@ -503,7 +503,7 @@ fn get_resolve_options(mut custom_conditions: Vec) -> parcel_resolver::R } }); - parcel_resolver::ResolveOptions { + atlaspack_resolver::ResolveOptions { conditions, custom_conditions, } diff --git a/crates/node-bindings/src/resolver_old.rs b/crates/node-bindings/src/resolver_old.rs index 01d29954d..2034c8a3a 100644 --- a/crates/node-bindings/src/resolver_old.rs +++ b/crates/node-bindings/src/resolver_old.rs @@ -18,21 +18,21 @@ use napi::Ref; use napi::Result; use napi_derive::napi; -use parcel::file_system::{FileSystemRealPathCache, FileSystemRef}; -use parcel_resolver_old::ExportsCondition; -use parcel_resolver_old::Extensions; -use parcel_resolver_old::Fields; -use parcel_resolver_old::FileCreateInvalidation; -use parcel_resolver_old::FileSystem; -use parcel_resolver_old::Flags; -use parcel_resolver_old::IncludeNodeModules; -use parcel_resolver_old::Invalidations; -use parcel_resolver_old::ModuleType; +use atlaspack::file_system::{FileSystemRealPathCache, FileSystemRef}; +use atlaspack_resolver_old::ExportsCondition; +use atlaspack_resolver_old::Extensions; +use atlaspack_resolver_old::Fields; +use atlaspack_resolver_old::FileCreateInvalidation; +use atlaspack_resolver_old::FileSystem; +use atlaspack_resolver_old::Flags; +use atlaspack_resolver_old::IncludeNodeModules; +use atlaspack_resolver_old::Invalidations; +use atlaspack_resolver_old::ModuleType; #[cfg(not(target_arch = "wasm32"))] -use parcel_resolver_old::OsFileSystem; -use parcel_resolver_old::Resolution; -use parcel_resolver_old::ResolverError; -use parcel_resolver_old::SpecifierType; +use atlaspack_resolver_old::OsFileSystem; +use atlaspack_resolver_old::Resolution; +use atlaspack_resolver_old::ResolverError; +use atlaspack_resolver_old::SpecifierType; type NapiSideEffectsVariants = Either3, HashMap>; @@ -202,9 +202,9 @@ pub struct JsInvalidationsOld { #[napi] pub struct ResolverOld { mode: u8, - resolver: parcel_resolver_old::Resolver<'static>, + resolver: atlaspack_resolver_old::Resolver<'static>, #[cfg(not(target_arch = "wasm32"))] - invalidations_cache: parcel_dev_dep_resolver_old::Cache, + invalidations_cache: atlaspack_dev_dep_resolver_old::Cache, supports_async: bool, } @@ -237,13 +237,13 @@ impl ResolverOld { }; let mut resolver = match options.mode { - 1 => parcel_resolver_old::Resolver::parcel( + 1 => atlaspack_resolver_old::Resolver::atlaspack( Cow::Owned(project_root.into()), - parcel_resolver_old::CacheCow::Owned(parcel_resolver_old::Cache::new(fs)), + atlaspack_resolver_old::CacheCow::Owned(atlaspack_resolver_old::Cache::new(fs)), ), - 2 => parcel_resolver_old::Resolver::node( + 2 => atlaspack_resolver_old::Resolver::node( Cow::Owned(project_root.into()), - parcel_resolver_old::CacheCow::Owned(parcel_resolver_old::Cache::new(fs)), + atlaspack_resolver_old::CacheCow::Owned(atlaspack_resolver_old::Cache::new(fs)), ), _ => return Err(napi::Error::new(napi::Status::InvalidArg, "Invalid mode")), }; @@ -305,7 +305,7 @@ impl ResolverOld { fn resolve_internal( &self, options: ResolveOptionsOld, - ) -> napi::Result<(parcel_resolver_old::ResolveResult, bool, u8)> { + ) -> napi::Result<(atlaspack_resolver_old::ResolveResult, bool, u8)> { let mut res = self.resolver.resolve_with_options( &options.filename, Path::new(&options.parent), @@ -368,7 +368,7 @@ impl ResolverOld { fn resolve_result_to_js( &self, env: Env, - res: parcel_resolver_old::ResolveResult, + res: atlaspack_resolver_old::ResolveResult, side_effects: bool, module_type: u8, ) -> napi::Result { @@ -444,7 +444,7 @@ impl ResolverOld { #[napi] pub fn get_invalidations(&self, path: String) -> napi::Result { let path = Path::new(&path); - match parcel_dev_dep_resolver_old::build_esm_graph( + match atlaspack_dev_dep_resolver_old::build_esm_graph( path, &self.resolver.project_root, &self.resolver.cache, @@ -504,7 +504,7 @@ fn convert_invalidations( (invalidate_on_file_change, invalidate_on_file_create) } -fn get_resolve_options(mut custom_conditions: Vec) -> parcel_resolver_old::ResolveOptions { +fn get_resolve_options(mut custom_conditions: Vec) -> atlaspack_resolver_old::ResolveOptions { let mut conditions = ExportsCondition::empty(); custom_conditions.retain(|condition| { if let Ok(cond) = ExportsCondition::try_from(condition.as_ref()) { @@ -515,7 +515,7 @@ fn get_resolve_options(mut custom_conditions: Vec) -> parcel_resolver_ol } }); - parcel_resolver_old::ResolveOptions { + atlaspack_resolver_old::ResolveOptions { conditions, custom_conditions, } diff --git a/crates/node-bindings/src/transformer.rs b/crates/node-bindings/src/transformer.rs index 44b9f32a8..5a2b03658 100644 --- a/crates/node-bindings/src/transformer.rs +++ b/crates/node-bindings/src/transformer.rs @@ -5,15 +5,15 @@ use napi_derive::napi; #[napi] pub fn transform(opts: JsObject, env: Env) -> napi::Result { - let config: parcel_js_swc_core::Config = env.from_js_value(opts)?; + let config: atlaspack_js_swc_core::Config = env.from_js_value(opts)?; - let result = parcel_js_swc_core::transform(config, None)?; + let result = atlaspack_js_swc_core::transform(config, None)?; env.to_js_value(&result) } #[cfg(not(target_arch = "wasm32"))] mod native_only { - use parcel_macros::napi::create_macro_callback; + use atlaspack_macros::napi::create_macro_callback; use super::*; @@ -30,11 +30,11 @@ mod native_only { None }; - let config: parcel_js_swc_core::Config = env.from_js_value(opts)?; + let config: atlaspack_js_swc_core::Config = env.from_js_value(opts)?; let (deferred, promise) = env.create_deferred()?; rayon::spawn(move || { - let res = parcel_js_swc_core::transform(config, call_macro); + let res = atlaspack_js_swc_core::transform(config, call_macro); match res { Ok(result) => deferred.resolve(move |env| env.to_js_value(&result)), Err(err) => deferred.reject(err.into()), diff --git a/crates/parcel/Cargo.toml b/crates/parcel/Cargo.toml deleted file mode 100644 index c9f8b3fcf..000000000 --- a/crates/parcel/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "parcel" -version = "0.1.0" -edition = "2021" -description = "Parcel Bundler" - -[features] -nodejs = ["parcel_plugin_rpc/nodejs"] - -[dependencies] -parcel_config = { path = "../parcel_config" } -parcel_core = { path = "../parcel_core" } -parcel_filesystem = { path = "../parcel_filesystem" } -parcel_package_manager = { path = "../parcel_package_manager" } -parcel_plugin_resolver = { path = "../parcel_plugin_resolver" } -parcel_plugin_transformer_js = { path = "../parcel_plugin_transformer_js" } -parcel_plugin_rpc = { path = "../parcel_plugin_rpc" } -parcel-resolver = { path = "../../packages/utils/node-resolver-rs" } - -anyhow = "1.0.82" -dyn-hash = "0.x" -num_cpus = "1.16.0" -pathdiff = "0.2.1" -petgraph = "0.x" -rand = "0.8.5" -rayon = "1.10.0" -regex = "1.10.5" -serde = { version = "1.0.200", features = ["derive"] } -serde-bool = "0.1.3" -serde_json = "1.0.116" -tracing = "0.1.40" -tracing-subscriber = "0.3.18" -xxhash-rust = { version = "0.8.2", features = ["xxh3"] } - -[dev-dependencies] -mockall = "0.12.1" diff --git a/crates/parcel/src/lib.rs b/crates/parcel/src/lib.rs deleted file mode 100644 index 283c2613b..000000000 --- a/crates/parcel/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub use parcel::*; -pub use parcel_filesystem as file_system; -pub use parcel_plugin_rpc as rpc; - -pub mod parcel; -pub(crate) mod request_tracker; - -mod plugins; -mod project_root; -mod requests; - -#[cfg(test)] -mod test_utils; diff --git a/crates/parcel_config/src/lib.rs b/crates/parcel_config/src/lib.rs deleted file mode 100644 index 0ddb34ce9..000000000 --- a/crates/parcel_config/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub mod map; -pub mod parcel_config; -pub mod parcel_config_fixtures; -pub mod parcel_rc; -pub mod parcel_rc_config_loader; -mod partial_parcel_config; - -pub use parcel_config::ParcelConfig; -pub use parcel_config::PluginNode; diff --git a/crates/parcel_monitoring/README.md b/crates/parcel_monitoring/README.md deleted file mode 100644 index aa17ee220..000000000 --- a/crates/parcel_monitoring/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# parcel_monitoring - -This crate wraps functionality provided to: - -- Set-up sentry -- Set-up crash reporting -- Set-up tracing subscriber - -It's provided as a separate crate than node-bindings so that we can provide example integration of the `minidumper` -system. - ---- - -## Configuring monitoring / reporting - -### Tracing - -Tracing is turned off by default. - -Parcel uses [`tracing`](https://github.com/tokio-rs/tracing) for logging and traces. This aims to aid debugging and bug -fixing. - -- By default, traces/logs won't be written -- `PARCEL_TRACING_MODE=stdout` will write to standard-output -- `PARCEL_TRACING_MODE=file` will write to a temporary log file, with log rotation this file will be under - `$TMPDIR/parcel_trace` - -## Sentry integration - -Sentry integration is turned off by default. - -Parcel uses [sentry](https://sentry.io/) only on `canary` nightly releases for error monitoring. - -- `PARCEL_ENABLE_SENTRY` will enable sentry integration -- `PARCEL_SENTRY_TAGS` should contain a JSON string with a dictionary of tags to add to sentry -- `PARCEL_SENTRY_DSN` should contain the Sentry DSN - -## Crash reporting - -Crash reporting is disabled by default. - -Parcel uses -[crash-handling](https://github.com/EmbarkStudios/crash-handling/blob/e2891a4c6a8d43374ec63d791c7e6d42ff2e6545/README.md) -utilities to write [minidumps](https://github.com/EmbarkStudios/crash-handling/tree/main/minidumper) on crashes. - -When this feature is enabled, the parcel process will try to IPC with a server process using the -[`minidumper`](https://github.com/EmbarkStudios/crash-handling/tree/main/minidumper) library. The server should write -and report the crash. - -A default server implementation is not provided, but an example can be seen on `examples/sample_usage.rs`. - -- `PARCEL_ENABLE_MINIDUMPER` will enable the minidumper client -- `PARCEL_MINIDUMPER_SERVER_PID_FILE` should contain a file path to a pid-file with the PID of the server process -- `PARCEL_MINIDUMPER_SERVER_SOCKET_NAME` should contain the path to the socket to use diff --git a/crates/parcel_plugin_resolver/Cargo.toml b/crates/parcel_plugin_resolver/Cargo.toml deleted file mode 100644 index e32e5ec1a..000000000 --- a/crates/parcel_plugin_resolver/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "parcel_plugin_resolver" -version = "0.1.0" -edition = "2021" -description = "Resolver Plugin for the Parcel Bundler" - -[dependencies] -parcel_core = { path = "../parcel_core" } -parcel-resolver = { path = "../../packages/utils/node-resolver-rs" } -anyhow = "1" - -[dev-dependencies] -parcel_filesystem = { path = "../parcel_filesystem" } diff --git a/crates/parcel_plugin_resolver/src/lib.rs b/crates/parcel_plugin_resolver/src/lib.rs deleted file mode 100644 index 2db5b4bb8..000000000 --- a/crates/parcel_plugin_resolver/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod parcel_resolver; - -pub use parcel_resolver::*; diff --git a/crates/parcel_plugin_transformer_js/Cargo.toml b/crates/parcel_plugin_transformer_js/Cargo.toml deleted file mode 100644 index dcb5ab7e9..000000000 --- a/crates/parcel_plugin_transformer_js/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "parcel_plugin_transformer_js" -version = "0.1.0" -edition = "2021" -description = "JavaScript Transformer Plugin for the Parcel Bundler" - -[dependencies] -parcel_core = { path = "../parcel_core" } -parcel_filesystem = { path = "../parcel_filesystem" } - -anyhow = "1" -indexmap = "2.2.6" -parcel-js-swc-core = { path = "../../packages/transformers/js/core" } -serde = { version = "1.0.200", features = ["derive"] } -swc_core = { version = "0.96", features = ["ecma_ast"] } diff --git a/docs/AdjacencyList.md b/docs/AdjacencyList.md index 4f359a98f..8cba8cb40 100644 --- a/docs/AdjacencyList.md +++ b/docs/AdjacencyList.md @@ -1,6 +1,6 @@ # AdjacencyList -The `AdjacencyList` in Parcel is a complex implementation of +The `AdjacencyList` in Atlaspack is a complex implementation of an otherwise [straightforward data structure](https://en.wikipedia.org/wiki/Adjacency_list). The core ideas behind the `AdjacencyList` are: @@ -11,7 +11,7 @@ The core ideas behind the `AdjacencyList` are: Conceptually, this is achieved by associating each edge that is added _to or from_ a node with a previous edge that was added to or from that node. -Where Parcel's `AdjacencyList` gets complex is in its _data layer_, which is +Where Atlaspack's `AdjacencyList` gets complex is in its _data layer_, which is designed for: - shared access in a multithreaded runtime @@ -85,7 +85,7 @@ a straightforward process of following the links. Under the hood, things are less straightforward. -Since Parcel is multi-threaded, its implementation of `AdjacencyList` +Since Atlaspack is multi-threaded, its implementation of `AdjacencyList` features another core idea: - The data stored in the `AdjacencyList` should be accessible @@ -108,7 +108,7 @@ a hash function to produce stable key for storing and retrieving that data. ### Why _Type_, though? -Two nodes in a Parcel graph may be related to in each other in more than one way. +Two nodes in a Atlaspack graph may be related to in each other in more than one way. In order to represent multiple relationships between the same two nodes, each _edge_ that connects the nodes has a _type_. diff --git a/docs/BundlerExamples.md b/docs/BundlerExamples.md index f698a56c1..8c8159b37 100644 --- a/docs/BundlerExamples.md +++ b/docs/BundlerExamples.md @@ -249,12 +249,12 @@ _The full test case can be found in the `shared-bundle-single-source/` case in ` ## Manual Bundles -Manual Bundles override Parcel's automatic code splitting. Consider the code below, with the following config in `package.json`. +Manual Bundles override Atlaspack's automatic code splitting. Consider the code below, with the following config in `package.json`. ```json package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "manualSharedBundles": [{ "name": "vendor", "root": "math/math.js", @@ -329,7 +329,7 @@ After **Step Create Bundles**, we are left with two bundles, one bundle group. T ![image info](./BundlerGraphs/manual-bundles/msb_step1.png) -The remaining assets left to place during asset placement are, `math.js`, `add.js`, `subtract.js`, and `divide.js`. From `reachable` you can infer what Parcel would/should do. Simply place all remaining assets into `index.js`, right? +The remaining assets left to place during asset placement are, `math.js`, `add.js`, `subtract.js`, and `divide.js`. From `reachable` you can infer what Atlaspack would/should do. Simply place all remaining assets into `index.js`, right? However, we've specified via config that we want `math` and its imports which match the glob `!(divide)` in one bundle with nothing else. @@ -349,7 +349,7 @@ _The full test case can be found in the `bundler.js` test suite._ ## Debugging Notes -There are many more intricate and complex cases than what I've discussed above within Parcel's test suite. To understand the algorithm fully, debugging and visualizing the idealGraph structure is extremely beneficial. To do so, you may add the following in between steps within `DefaultBundler.js`, +There are many more intricate and complex cases than what I've discussed above within Atlaspack's test suite. To understand the algorithm fully, debugging and visualizing the idealGraph structure is extremely beneficial. To do so, you may add the following in between steps within `DefaultBundler.js`, ``` dumpGraphToGraphViz( @@ -361,4 +361,4 @@ dumpGraphToGraphViz( and run your example test case with the command below. -` PARCEL_DUMP_GRAPHVIZ=1yarn test test/` +` ATLASPACK_DUMP_GRAPHVIZ=1yarn test test/` diff --git a/docs/Continuous Integration/Native Binary Builds.md b/docs/Continuous Integration/Native Binary Builds.md index fda40f280..4f218dd69 100644 --- a/docs/Continuous Integration/Native Binary Builds.md +++ b/docs/Continuous Integration/Native Binary Builds.md @@ -1,6 +1,6 @@ -# Parcel • Continuous Integration • Native Binary Builds +# Atlaspack • Continuous Integration • Native Binary Builds -Parcel relies on a few native artifacts that need to be built for multiple target platforms and architectures. +Atlaspack relies on a few native artifacts that need to be built for multiple target platforms and architectures. To support this, there are a number of different runner jobs running on different images/os: diff --git a/docs/DefaultBundler.md b/docs/DefaultBundler.md index eacb73975..4053c71d6 100644 --- a/docs/DefaultBundler.md +++ b/docs/DefaultBundler.md @@ -1,6 +1,6 @@ ## `bundle()` -During the bundling phase, we hand over control to the bundler plugin via `bundle()`. This mutative function is called in the `BundleGraphRequest`, and is passed in a stripped version of the AssetGraph, called the `mutableBundleGraph`. Users can specify custom bundler plugins in their `.parcelrc`. In this document we will go through the default bundler plugin. +During the bundling phase, we hand over control to the bundler plugin via `bundle()`. This mutative function is called in the `BundleGraphRequest`, and is passed in a stripped version of the AssetGraph, called the `mutableBundleGraph`. Users can specify custom bundler plugins in their `.atlaspackrc`. In this document we will go through the default bundler plugin. ``` await bundler.bundle({ @@ -323,9 +323,9 @@ That's it! The next few steps only kick in if your bundler config specifies. ## Step: Merge Shared Bundles -Users of Parcel can specify a bundler config, which sets `minbundleSize`, `maxParallelRequests`, and `minBundles`. In this step we merge back and shared bundles that are smaller than `minBundleSize`. +Users of Atlaspack can specify a bundler config, which sets `minbundleSize`, `maxParallelRequests`, and `minBundles`. In this step we merge back and shared bundles that are smaller than `minBundleSize`. -These config options only affect shared bundles. For more on the config options, visit the [Parcel Docs on Shared Bundles](https://parceljs.org/features/code-splitting/#shared-bundles). +These config options only affect shared bundles. For more on the config options, visit the [Atlaspack Docs on Shared Bundles](https://parceljs.org/features/code-splitting/#shared-bundles). ## Step: Remove Shared Bundles @@ -335,7 +335,7 @@ One difference between the previous implementation and the current is here, wher # BundleGraph Decoration -BundleGraph decoration takes an idealGraph and mutates the passed-in assetGraph aka Mutable bundleGraph, in order to back port our idealGraph to what Parcel expects. +BundleGraph decoration takes an idealGraph and mutates the passed-in assetGraph aka Mutable bundleGraph, in order to back port our idealGraph to what Atlaspack expects. ## Definitions @@ -353,7 +353,7 @@ BundleGraph decoration takes an idealGraph and mutates the passed-in assetGraph - **local BundleGraph:** Within `CreateIdealGraph()`, we maintain a local BundleGraph which represents only bundles that load in parallel, represented by being attached to the root dummy node. -- **Default:** The Default BundleGraph (which you will most commonly see throughout Parcel) maintains the nodes mentioned above and is a modified version of the AssetGraph. +- **Default:** The Default BundleGraph (which you will most commonly see throughout Atlaspack) maintains the nodes mentioned above and is a modified version of the AssetGraph. - **IdealGraph:** Structure which contains the local bundleGraph, dependencyBundleGraph, BundleGroupIds, and a mapping of asset references. This stores all info needed to back-port our structures to the “standard” bundleGraph @@ -367,7 +367,7 @@ BundleGraph decoration takes an idealGraph and mutates the passed-in assetGraph - **Entries** - - **Entry to Project:** A file the user points Parcel at, in the bundler, this is a set of assets + - **Entry to Project:** A file the user points Atlaspack at, in the bundler, this is a set of assets - **Entry to A Bundle:** The main or first asset in a bundle diff --git a/docs/ManualBundling.md b/docs/ManualBundling.md index b7ef1dc0a..aec8efd5c 100644 --- a/docs/ManualBundling.md +++ b/docs/ManualBundling.md @@ -2,9 +2,9 @@ _Note: This feature is EXPERIMENTAL, meaning it may act strange in unusual cases, and may not have full test coverage._ -Parcel automatically code splits for certain import types, and automatically generates shared bundles based on a deduplication approach. Manual Bundles allow the user to specify their own custom bundles and their contents. +Atlaspack automatically code splits for certain import types, and automatically generates shared bundles based on a deduplication approach. Manual Bundles allow the user to specify their own custom bundles and their contents. -This document aims to explain the current implementation of Manual Bundling, for information on using the feature visit the Parcel Docs. +This document aims to explain the current implementation of Manual Bundling, for information on using the feature visit the Atlaspack Docs. ### Generate Asset Lookups @@ -12,7 +12,7 @@ First, we generate a look up, `manualAssetToConfig`, which contains an Asset Nod ```json { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "unstable_manualSharedBundles": [ { "name": "", @@ -152,4 +152,4 @@ The `manualSharedBundle` property and the `uniqueKey` property both store the na ### More Info -For config information visit the Parcel documentation's section on MSBs. For a more detailed example, check out the Manual Bundles Example in [Bundler Examples](BundlerExamples.md) +For config information visit the Atlaspack documentation's section on MSBs. For a more detailed example, check out the Manual Bundles Example in [Bundler Examples](BundlerExamples.md) diff --git a/docs/Scopehoisting Packager.md b/docs/Scopehoisting Packager.md index 2147ed432..bba5f6caa 100644 --- a/docs/Scopehoisting Packager.md +++ b/docs/Scopehoisting Packager.md @@ -13,25 +13,25 @@ 1. If the asset should be skipped: ignore the current asset, call `buildAsset()` for dependency assets and concatenate only them together. 2. Call `buildReplacements()`, generating the `Map`s used during the text replacement: - The dependency map which is used to resolve `import "...";` declarations inserted by the transformer: `${assetId}:${specifier}${specifiertype} -> Dependency` - - Import replacements: the local part of a dependency symbol (`$id$import$foo`) -> result of `getSymbolResolution` (e.g. `$id$export$bar` or `parcelRequire("id").bar`) + - Import replacements: the local part of a dependency symbol (`$id$import$foo`) -> result of `getSymbolResolution` (e.g. `$id$export$bar` or `atlaspackRequire("id").bar`) 3. Call `buildAssetPrelude()`: - - generates `$parcel$defineInteropFlag($id$exports)` call for this asset if needed. - - synthesizes the exports object if needed (including generation of the `$parcel$export` and `$parcel$exportWildcard` calls only for used re/exports) + - generates `$atlaspack$defineInteropFlag($id$exports)` call for this asset if needed. + - synthesizes the exports object if needed (including generation of the `$atlaspack$export` and `$atlaspack$exportWildcard` calls only for used re/exports) 4. Perform the replacements with `REPLACEMENT_RE` matching one of - `import "id";` - will be replaced with the source code of the asset (call `buildAsset()` recursively ). If the referenced asset is wrapped, don't inline but place it after the current asset (into `depContent`). - - calls `getHoistedParcelRequires` to read the `hoistedRequires` list from `getSymbolResolution` and prepend needed requires. + - calls `getHoistedAtlaspackRequires` to read the `hoistedRequires` list from `getSymbolResolution` and prepend needed requires. - `$id$exports` - `module.exports` inside the asset gets replaced with `$id$exports` in the transformer, but for wrapped assets, this has to be replaced back to `module.exports` - `$id$import|importAsync|require$foo` - will be looked up in the replacements and replaced with the resolved identifier -5. If necessary, wrap the result up until now with `parcelRequire.register("id", ...)`. +5. If necessary, wrap the result up until now with `atlaspackRequire.register("id", ...)`. ## `getSymbolResolution()`: This is a wrapper around `bundleGraph.getSymbolResolution()`. -The additional dependency argument is used to determine whether CJS interop has to be applied (if it's a ESM import), or whether it's a non-conditional import (and a hoisted `parcelRequire` call has to be generated). +The additional dependency argument is used to determine whether CJS interop has to be applied (if it's a ESM import), or whether it's a non-conditional import (and a hoisted `atlaspackRequire` call has to be generated). Compared to the bundle graph's method, the `parentAsset` is used to make wrapped assets using their own namespace object refer to `module.exports` instead of `$id$exports`. @@ -39,10 +39,10 @@ Compared to the bundle graph's method, the `parentAsset` is used to make wrapped - `$id$export$bar` (e.g. same-bundle ESM import), - `$id$exports` (e.g. same-bundle ESM import), - `id$exports.bar` (e.g. non statically analyzable exports) or - - `parcelRequire("id").bar` (wrapped/in another bundle) - - `$parcel$interopDefault` (if an ESM default import resolved to a non-statically analyzable CJS asset) + - `atlaspackRequire("id").bar` (wrapped/in another bundle) + - `$atlaspack$interopDefault` (if an ESM default import resolved to a non-statically analyzable CJS asset) - also handles interop (if the default symbol is imported and the resolved asset is CJS, use the namespace instead) -- tracks imports of wrapped assets (which will need `parcelRequire` call) by mutating the `hoistedRequires` list +- tracks imports of wrapped assets (which will need `atlaspackRequire` call) by mutating the `hoistedRequires` list ## `bundleGraph.getSymbolResolution()` @@ -50,7 +50,7 @@ This method transitively/recursively traverses the reexports of the asset to fin The result is an `asset`, the `exportSymbol` string, and `symbol`. The value can be accessed from `$asset.id$exports[exportSymbol]`, which is potentially also already (or only) available via the top-level variable `symbol`. So for the add/square example above, `getSymbolResolution(math.js, "add")` would return `{asset: "math.js", exportSymbol: "add", symbol: "$fa6943ce8a6b29$export$add"}`. -While this improves code size, an imperfection with this system is that it actually means that an asset A can use a value from asset B (which is usually modelled with a dependency from A to B) without there actually being a dependency between the two. Dependencies are also used to determine if an asset is required from another bundle and has to therefore be registered with `parcelRequiree`. This discrepancy can be handled inside of a single bundle, but not across multiple bundles, so the `boundary` parameter makes the resolution stop once the bundle is left. +While this improves code size, an imperfection with this system is that it actually means that an asset A can use a value from asset B (which is usually modelled with a dependency from A to B) without there actually being a dependency between the two. Dependencies are also used to determine if an asset is required from another bundle and has to therefore be registered with `atlaspackRequiree`. This discrepancy can be handled inside of a single bundle, but not across multiple bundles, so the `boundary` parameter makes the resolution stop once the bundle is left. There are three possible resolution results: diff --git a/docs/Scopehoisting Transformer.md b/docs/Scopehoisting Transformer.md index 5fb4a1625..2ad841adf 100644 --- a/docs/Scopehoisting Transformer.md +++ b/docs/Scopehoisting Transformer.md @@ -4,7 +4,7 @@ ("Non-static" refers to a variable being used in a way that cannot be optimized, such as `module.exports[someVariable] = 2`, or `import * as x from "..:"; console.log(x[someVariable]);`.) -The task of the hoist transformer is, in the simplest case, rewriting imports and exports, renaming the uses of the imports. The packager can then detect these `import "id:...";` statements to inline dependencies, replace `$id$import$foo` with the resolved expression, and generate necessary `$parcel$export(..., () => $id$export$b)` statements. +The task of the hoist transformer is, in the simplest case, rewriting imports and exports, renaming the uses of the imports. The packager can then detect these `import "id:...";` statements to inline dependencies, replace `$id$import$foo` with the resolved expression, and generate necessary `$atlaspack$export(..., () => $id$export$b)` statements.
@@ -39,7 +39,7 @@ In addition to the code, it sets the symbols and various meta properties on both - `asset.meta.id`: depending on which transformers run after the JS transformer, the value of `asset.id` will be different in packager from the id used for the various variables like `$id$export$foo`. The current asset id in the JS transformer is therefore stored. - `asset.meta.hasCJSExports`: true if there is at least one CJS export - `asset.meta.staticExports`: true if there is at least one CJS export that doesn't follow the pattern `module.exports.foo = ...` -- `asset.meta.shouldWrap`: Some constructs require this asset being wrapped in a `parcelRequire.register` block: top-level returns, non-static uses of `module`, eval, reassigning `module` or `exports` +- `asset.meta.shouldWrap`: Some constructs require this asset being wrapped in a `atlaspackRequire.register` block: top-level returns, non-static uses of `module`, eval, reassigning `module` or `exports` - `dep.meta.shouldWrap`: this is a conditional require - `dep.meta.promiseSymbol`: see the "Dynamic Imports" section @@ -59,7 +59,7 @@ So instead, reading `module.exports` is expressed just like it is in ESM: by add ## Identifier Names -There are names to uniquely identify an import, the actual format doesn't actually matter for the code, as long as its used consistently (Parcel never re-parses these names to retrieve the parts again): +There are names to uniquely identify an import, the actual format doesn't actually matter for the code, as long as its used consistently (Atlaspack never re-parses these names to retrieve the parts again): - `$x$import$y` = Asset with id `x` imported the namespace of the dependency with hashed source `y` - `$x$import$y$z` = Asset with id `x` imported the hashed export `z` of the dependency with hashed source `y` diff --git a/docs/Scopehoisting.md b/docs/Scopehoisting.md index 1fe9eaab7..c80dc4a44 100644 --- a/docs/Scopehoisting.md +++ b/docs/Scopehoisting.md @@ -4,16 +4,16 @@ ### Tree Shaking and Scope Hoisting -Tree shaking refers to the general principle of removing dead code. With a naive browserify-style bundling (= what Parcel does in development builds), exports that are never used in the project are still "used" in a syntactical sense (= not dead), but not in a runtime code coverage sense (= unused). +Tree shaking refers to the general principle of removing dead code. With a naive browserify-style bundling (= what Atlaspack does in development builds), exports that are never used in the project are still "used" in a syntactical sense (= not dead), but not in a runtime code coverage sense (= unused). Some ways to improve this are: -- Determine which exports are used, and drop the `export` statement during the build. Then the exported value becomes an unused variable and a minifier can remove it. This is what symbol propagation and the conditional generation of only used `$parcel$export()` calls achieves. +- Determine which exports are used, and drop the `export` statement during the build. Then the exported value becomes an unused variable and a minifier can remove it. This is what symbol propagation and the conditional generation of only used `$atlaspack$export()` calls achieves. This is also why `/*#__PURE__*/` comments are important: ```js function Button() {...} -$parcelRequire(exports, "Button"; () => Button); // was: export { Button }; +$atlaspackRequire(exports, "Button"; () => Button); // was: export { Button }; // The export was removed during the build, and the function will be dropped by the minifier: function Select() {...} @@ -27,7 +27,7 @@ const MyContext = /*#__PURE__*/ React.createContext(); - Determining used exports covers almost all tree shaking needs, but it would still leave the module registry ("prelude"). - By concatenating assets into a single scope, the function calls for `parcelRequire("id").foo` can be replaced with a regular variable access `$id$export$foo` (ESM import are live bindings, so accessing an imported value in a function would perform this function call every single time, though it's just an object lookup anyway). And these `parcelRequire.register(() => {...})` wrappers plus `parcelRequire` calls also have some bundle size overhead. + By concatenating assets into a single scope, the function calls for `atlaspackRequire("id").foo` can be replaced with a regular variable access `$id$export$foo` (ESM import are live bindings, so accessing an imported value in a function would perform this function call every single time, though it's just an object lookup anyway). And these `atlaspackRequire.register(() => {...})` wrappers plus `atlaspackRequire` calls also have some bundle size overhead. It can also improve the effectiveness of the minifier, especially regarding function inlining and constant evaluation, but this really depends on the actual code. @@ -103,7 +103,7 @@ Both assets and dependencies have attached symbol information. These are maps th Core (so symbol propagation and `getSymbolResolution`) rely on the following convention (plugins can store custom information in the per-symbol meta properties): -- `asset.symbols` is a map of export names (= what the export was called in the source) to the local names (whatever Parcel renamed the variable to, e.g. `$id$export$foo`). `*` represents the namespace object and is only set for CJS assets (which makes `getSymbolResolution` fall back to a property access). +- `asset.symbols` is a map of export names (= what the export was called in the source) to the local names (whatever Atlaspack renamed the variable to, e.g. `$id$export$foo`). `*` represents the namespace object and is only set for CJS assets (which makes `getSymbolResolution` fall back to a property access). - `dependency.symbols` is a map of import names (= which binding was imported) to the local name (= the identifier that the imported binding got replaced by, e.g. `$id$import$bar`). The whole namespace can be imported by using `*` as the import name. A dependency with a `* -> *` mapping corresponds to `export * from`. @@ -193,7 +193,7 @@ The used symbols are determined by symbol propagation, and have slightly differe - `getUsedSymbols(asset)` is the set of symbols that were resolved to this specific asset (so excluding eventual reexports). - `getUsedSymbols(dependency)` is the set of symbols that are imported through the dependency (so both including reexports). So for an `export {a, b} from "...";` it is a subset of `a,b` and for `export * from "...";` it is the set of symbols that are actually resolved through that reexport. -### Integrating ESM and CJS with parcelRequire: Circular Imports and Conditional Requires +### Integrating ESM and CJS with atlaspackRequire: Circular Imports and Conditional Requires #### ESM @@ -212,15 +212,15 @@ export function func() { } ``` -If `value` were instead a function, calling it would work correctly (functions are still hoisted). So circular imports are why `$parcel$export` calls also have to be hoisted to the top of the asset. +If `value` were instead a function, calling it would work correctly (functions are still hoisted). So circular imports are why `$atlaspack$export` calls also have to be hoisted to the top of the asset. #### Limitations -The reasons why the `parcelRequire` registry is needed are assets being accessed from other bundles (and potentially being duplicated), and conditional requires (which are impossible with pure ESM declarations). +The reasons why the `atlaspackRequire` registry is needed are assets being accessed from other bundles (and potentially being duplicated), and conditional requires (which are impossible with pure ESM declarations). -So assets that have at least one conditional incoming dependency or are used by some other bundle, are wrapped in a `parcelRequire.register`. `require("foo")` calls inside ifs or functions are replaced with the appropriate `parcelRequire("id")` call. +So assets that have at least one conditional incoming dependency or are used by some other bundle, are wrapped in a `atlaspackRequire.register`. `require("foo")` calls inside ifs or functions are replaced with the appropriate `atlaspackRequire("id")` call. -But since the whole subgraph is conditionally executed, all assets have to be wrapped and inside of that subgraph, imports cannot be replaced with the top level variables anymore, but instead get replaced with the CommonJS equivalent (so `var $id = parcelRequire("id");` and then `$id.foo`) which also runs the side effects. +But since the whole subgraph is conditionally executed, all assets have to be wrapped and inside of that subgraph, imports cannot be replaced with the top level variables anymore, but instead get replaced with the CommonJS equivalent (so `var $id = atlaspackRequire("id");` and then `$id.foo`) which also runs the side effects. ### Runtime Deduplication @@ -267,4 +267,4 @@ function interopRequireDefault(obj) { var _x = interopRequireDefault(require('./x')); ``` -With scope hoisting, Parcel can omit this call in many cases when the importee was determined to be ESM or ESM-transpiled-to-CommonJS via static analysis. +With scope hoisting, Atlaspack can omit this call in many cases when the importee was determined to be ESM or ESM-transpiled-to-CommonJS via static analysis. diff --git a/docs/swc Visitors.md b/docs/swc Visitors.md index 208b18a00..916147702 100644 --- a/docs/swc Visitors.md +++ b/docs/swc Visitors.md @@ -1,6 +1,6 @@ # swc Visitors -> If you're reading this and want to use swc for something other than the existing Parcel transformer, then you might find this template useful which contains all of the boilerplate to parse some input, give you the AST to work with, and finally also stringify it again: https://github.com/mischnic/swc-example +> If you're reading this and want to use swc for something other than the existing Atlaspack transformer, then you might find this template useful which contains all of the boilerplate to parse some input, give you the AST to work with, and finally also stringify it again: https://github.com/mischnic/swc-example An swc visitor is a Rust struct that implements the Visit/Fold/VisitMut trait. Then you can take some AST node (e.g. the top-level `module`) and call `visit_with`: @@ -35,7 +35,7 @@ If a function for some node type isn't declared, the default implementation uses Similarly, overriding such a function but not calling `visit_*` on some child nodes explicitly will then not visit the subtree at all (this really is a straight-forward recursive traversal). -These are all of the types of visitors (at least the ones used by Parcel): +These are all of the types of visitors (at least the ones used by Atlaspack): - `Visit` (and then `visit_with`/`visit_children_with`): diff --git a/flow-libs/less.js.flow b/flow-libs/less.js.flow index c574faa9e..cc391d20d 100644 --- a/flow-libs/less.js.flow +++ b/flow-libs/less.js.flow @@ -1,10 +1,10 @@ // @flow -// These types are much more than what Parcel is currently using, and much less +// These types are much more than what Atlaspack is currently using, and much less // than a complete typing of Less. The cutoff was pretty arbitrary; I tried to // err on the side of inclusion for class members and exclusion for everything // else, but ultimately there's no principle for what's in and what's out of the -// bits that Parcel doesn't need. +// bits that Atlaspack doesn't need. declare module 'less' { declare type FileInfo = {| @@ -69,7 +69,7 @@ declare module 'less' { isEvald: boolean; } - // This is very ad-hoc, based on current Parcel usage instead of the actual + // This is very ad-hoc, based on current Atlaspack usage instead of the actual // class in Less. declare class visitors$Visitor { constructor({ diff --git a/flow-libs/postcss.js.flow b/flow-libs/postcss.js.flow index e80f2bfff..51ba498dc 100644 --- a/flow-libs/postcss.js.flow +++ b/flow-libs/postcss.js.flow @@ -1,6 +1,6 @@ // @flow -// (Only covers the API that Parcel uses) +// (Only covers the API that Atlaspack uses) // Derived from the PostCSS docs available at // http://api.postcss.org/postcss.html. diff --git a/flow-libs/stylus.js.flow b/flow-libs/stylus.js.flow index e8a164d76..d82584a7e 100644 --- a/flow-libs/stylus.js.flow +++ b/flow-libs/stylus.js.flow @@ -1,7 +1,7 @@ // @flow // This doesn't cover most of the API; it only defines some node types that are -// useful for Parcel. +// useful for Atlaspack. declare module 'stylus' { // Derived manually from diff --git a/package.json b/package.json index f4860ee76..01a3eb0b9 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,25 @@ { - "name": "@parcel/monorepo", + "name": "@atlaspack/monorepo", "description": "Blazing fast, zero configuration web application bundler", "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "private": true, "workspaces": [ "packages/*/*" ], "scripts": { - "build": "yarn build-bundles && cross-env NODE_ENV=production PARCEL_BUILD_ENV=production gulp", - "build-bundles": "rimraf --glob packages/*/*/lib && lerna run dev:prepare && cross-env NODE_ENV=production PARCEL_BUILD_ENV=production PARCEL_SELF_BUILD=true parcel build --no-cache packages/core/{fs,codeframe,package-manager,utils} packages/reporters/{cli,dev-server} packages/utils/{parcel-lsp,parcel-lsp-protocol,parcel-watcher-watchman-js}", + "build": "yarn build-bundles && cross-env NODE_ENV=production ATLASPACK_BUILD_ENV=production gulp", + "build-bundles": "rimraf --glob packages/*/*/lib && lerna run dev:prepare && cross-env NODE_ENV=production ATLASPACK_BUILD_ENV=production ATLASPACK_SELF_BUILD=true atlaspack build --no-cache packages/core/{fs,codeframe,package-manager,utils} packages/reporters/{cli,dev-server} packages/utils/{atlaspack-lsp,atlaspack-lsp-protocol,atlaspack-watcher-watchman-js}", "build-ts": "lerna run build-ts && lerna run check-ts", "build-native": "node scripts/build-native.js", "build-native-release": "node scripts/build-native.js --release", "build-native-canary": "node scripts/build-native.js --canary", "build-native-wasm": "node scripts/build-native.js --release --wasm", - "build-repl": "yarn build-native-release && yarn build-native-wasm && yarn workspace @parcel/repl build", - "clean-test": "rimraf packages/core/integration-tests/.parcel-cache && rimraf packages/core/integration-tests/dist", + "build-repl": "yarn build-native-release && yarn build-native-wasm && yarn workspace @atlaspack/repl build", + "clean-test": "rimraf packages/core/integration-tests/.atlaspack-cache && rimraf packages/core/integration-tests/dist", "clean": "yarn clean-test && lerna clean --yes && lerna exec -- rimraf ./lib && yarn", "format": "prettier --write \"./packages/*/*/{src,bin,test}/**/*.{js,json,md}\" && cargo +nightly fmt --all", "link-all": "node scripts/link-all.js packages", @@ -28,8 +28,8 @@ "lint": "eslint . && prettier \"./packages/*/*/{src,bin,test}/**/*.{js,json,md}\" --list-different && cargo fmt --all -- --check", "prepublishOnly": "yarn adjust-versions && yarn build && yarn build-ts", "test:unit": "cross-env NODE_ENV=test mocha --timeout 5000 && cargo test", - "test:integration": "yarn workspace @parcel/integration-tests test", - "test:integration-ci": "yarn workspace @parcel/integration-tests test-ci", + "test:integration": "yarn workspace @atlaspack/integration-tests test", + "test:integration-ci": "yarn workspace @atlaspack/integration-tests test-ci", "test": "yarn test:unit && yarn test:integration", "dev:release": "SKIP_PLUGIN_COMPATIBILITY_CHECK=true lerna publish -y --canary --preid dev --dist-tag=dev --exact --force-publish=* --no-git-tag-version --no-push", "canary:release": "SKIP_PLUGIN_COMPATIBILITY_CHECK=true lerna publish -y --canary --preid canary --dist-tag=canary --exact --force-publish=* --no-git-tag-version --no-push", @@ -44,7 +44,7 @@ "@babel/core": "^7.22.11", "@khanacademy/flow-to-ts": "^0.5.2", "@napi-rs/cli": "^2.18.3", - "@parcel/babel-register": "*", + "@atlaspack/babel-register": "*", "@types/node": ">= 18", "buffer": "mischnic/buffer#b8a4fa94", "cross-env": "^7.0.0", @@ -72,10 +72,6 @@ "*.{js,json,md,ts}": "prettier --write", "*.rs": "rustfmt" }, - "collective": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "packageManager": "yarn@1.22.19", "browser": { "react-dom": "preact/compat", diff --git a/packages/bundlers/default/package.json b/packages/bundlers/default/package.json index 12141e02b..0f458512d 100644 --- a/packages/bundlers/default/package.json +++ b/packages/bundlers/default/package.json @@ -1,30 +1,26 @@ { - "name": "@parcel/bundler-default", + "name": "@atlaspack/bundler-default", "version": "2.12.0", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/DefaultBundler.js", "source": "src/DefaultBundler.js", "engines": { "node": ">= 16.0.0", - "parcel": "^2.12.0" + "atlaspack": "^2.12.0" }, "dependencies": { - "@parcel/diagnostic": "2.12.0", - "@parcel/graph": "3.2.0", - "@parcel/plugin": "2.12.0", - "@parcel/rust": "2.12.0", - "@parcel/utils": "2.12.0", + "@atlaspack/diagnostic": "2.12.0", + "@atlaspack/graph": "3.2.0", + "@atlaspack/plugin": "2.12.0", + "@atlaspack/rust": "2.12.0", + "@atlaspack/utils": "2.12.0", "nullthrows": "^1.1.1" } } diff --git a/packages/bundlers/default/src/DefaultBundler.js b/packages/bundlers/default/src/DefaultBundler.js index f5e0d4987..5d63c56cf 100644 --- a/packages/bundlers/default/src/DefaultBundler.js +++ b/packages/bundlers/default/src/DefaultBundler.js @@ -12,17 +12,17 @@ import type { Target, BuildMode, PluginLogger, -} from '@parcel/types'; -import type {NodeId} from '@parcel/graph'; -import type {SchemaEntity} from '@parcel/utils'; -import {ContentGraph, Graph, BitSet, ALL_EDGE_TYPES} from '@parcel/graph'; +} from '@atlaspack/types'; +import type {NodeId} from '@atlaspack/graph'; +import type {SchemaEntity} from '@atlaspack/utils'; +import {ContentGraph, Graph, BitSet, ALL_EDGE_TYPES} from '@atlaspack/graph'; import invariant from 'assert'; -import {Bundler} from '@parcel/plugin'; -import {validateSchema, DefaultMap, globToRegex} from '@parcel/utils'; +import {Bundler} from '@atlaspack/plugin'; +import {validateSchema, DefaultMap, globToRegex} from '@atlaspack/utils'; import nullthrows from 'nullthrows'; import path from 'path'; -import {encodeJSONKeyComponent} from '@parcel/diagnostic'; +import {encodeJSONKeyComponent} from '@atlaspack/diagnostic'; type Glob = string; @@ -128,7 +128,7 @@ type IdealGraph = {| * First, we enter `bundle({bundleGraph, config})`. Here, "bundleGraph" is actually just the * assetGraph turned into a type `MutableBundleGraph`, which will then be mutated in decorate, * and turned into what we expect the bundleGraph to be as per the old (default) bundler structure - * & what the rest of Parcel expects a BundleGraph to be. + * & what the rest of Atlaspack expects a BundleGraph to be. * * `bundle({bundleGraph, config})` First gets a Mapping of target to entries, In most cases there is * only one target, and one or more entries. (Targets are pertinent in monorepos or projects where you @@ -462,7 +462,7 @@ function createIdealGraph( for (let c of config.manualSharedBundles.reverse()) { if (c.root != null && !configToParentAsset.has(c)) { logger.warn({ - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: `Manual shared bundle "${c.name}" skipped, no root asset found`, }); continue; @@ -1726,7 +1726,7 @@ async function loadBundlerConfig( logger: PluginLogger, ): Promise { let conf = await config.getConfig([], { - packageKey: '@parcel/bundler-default', + packageKey: '@atlaspack/bundler-default', }); if (!conf) { @@ -1747,7 +1747,7 @@ async function loadBundlerConfig( modeConfig.disableSharedBundles === true ) { logger.warn({ - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: `The value of "${modeConfig.minBundles}" set for minBundles will not be used as shared bundles have been disabled`, }); } @@ -1758,7 +1758,7 @@ async function loadBundlerConfig( modeConfig.disableSharedBundles === true ) { logger.warn({ - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: `The value of "${modeConfig.minBundleSize}" set for minBundleSize will not be used as shared bundles have been disabled`, }); } @@ -1769,7 +1769,7 @@ async function loadBundlerConfig( modeConfig.disableSharedBundles === true ) { logger.warn({ - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: `The value of "${modeConfig.maxParallelRequests}" set for maxParallelRequests will not be used as shared bundles have been disabled`, }); } @@ -1789,10 +1789,10 @@ async function loadBundlerConfig( data: modeConfig, source: await options.inputFS.readFile(conf.filePath, 'utf8'), filePath: conf.filePath, - prependKey: `/${encodeJSONKeyComponent('@parcel/bundler-default')}`, + prependKey: `/${encodeJSONKeyComponent('@atlaspack/bundler-default')}`, }, - '@parcel/bundler-default', - 'Invalid config for @parcel/bundler-default', + '@atlaspack/bundler-default', + 'Invalid config for @atlaspack/bundler-default', ); let http = modeConfig.http ?? 2; diff --git a/packages/bundlers/library/package.json b/packages/bundlers/library/package.json index 3773ba449..f3ae46ea8 100644 --- a/packages/bundlers/library/package.json +++ b/packages/bundlers/library/package.json @@ -1,26 +1,22 @@ { - "name": "@parcel/bundler-library", + "name": "@atlaspack/bundler-library", "version": "2.11.0", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/LibraryBundler.js", "source": "src/LibraryBundler.js", "engines": { "node": ">= 16.0.0", - "parcel": "^2.12.0" + "atlaspack": "^2.12.0" }, "dependencies": { - "@parcel/plugin": "2.12.0", + "@atlaspack/plugin": "2.12.0", "nullthrows": "^1.1.1" } } diff --git a/packages/bundlers/library/src/LibraryBundler.js b/packages/bundlers/library/src/LibraryBundler.js index d6ee74177..4f8416f55 100644 --- a/packages/bundlers/library/src/LibraryBundler.js +++ b/packages/bundlers/library/src/LibraryBundler.js @@ -1,5 +1,5 @@ // @flow strict-local -import {Bundler} from '@parcel/plugin'; +import {Bundler} from '@atlaspack/plugin'; import nullthrows from 'nullthrows'; // This bundler plugin is designed specifically for library builds. It outputs a bundle for diff --git a/packages/compressors/brotli/package.json b/packages/compressors/brotli/package.json index 4012b5c49..104d793c2 100644 --- a/packages/compressors/brotli/package.json +++ b/packages/compressors/brotli/package.json @@ -1,25 +1,21 @@ { - "name": "@parcel/compressor-brotli", + "name": "@atlaspack/compressor-brotli", "version": "2.12.0", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/BrotliCompressor.js", "source": "src/BrotliCompressor.js", "engines": { "node": ">= 16.0.0", - "parcel": "^2.12.0" + "atlaspack": "^2.12.0" }, "dependencies": { - "@parcel/plugin": "2.12.0" + "@atlaspack/plugin": "2.12.0" } } diff --git a/packages/compressors/brotli/src/BrotliCompressor.js b/packages/compressors/brotli/src/BrotliCompressor.js index 320422ed5..0229faeb5 100644 --- a/packages/compressors/brotli/src/BrotliCompressor.js +++ b/packages/compressors/brotli/src/BrotliCompressor.js @@ -1,5 +1,5 @@ // @flow strict-local -import {Compressor} from '@parcel/plugin'; +import {Compressor} from '@atlaspack/plugin'; import zlib from 'zlib'; export default (new Compressor({ diff --git a/packages/compressors/gzip/package.json b/packages/compressors/gzip/package.json index 785caa441..0164d6485 100644 --- a/packages/compressors/gzip/package.json +++ b/packages/compressors/gzip/package.json @@ -1,25 +1,21 @@ { - "name": "@parcel/compressor-gzip", + "name": "@atlaspack/compressor-gzip", "version": "2.12.0", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/GzipCompressor.js", "source": "src/GzipCompressor.js", "engines": { "node": ">= 16.0.0", - "parcel": "^2.12.0" + "atlaspack": "^2.12.0" }, "dependencies": { - "@parcel/plugin": "2.12.0" + "@atlaspack/plugin": "2.12.0" } } diff --git a/packages/compressors/gzip/src/GzipCompressor.js b/packages/compressors/gzip/src/GzipCompressor.js index cfcfbcfbe..82621b6d6 100644 --- a/packages/compressors/gzip/src/GzipCompressor.js +++ b/packages/compressors/gzip/src/GzipCompressor.js @@ -1,5 +1,5 @@ // @flow strict-local -import {Compressor} from '@parcel/plugin'; +import {Compressor} from '@atlaspack/plugin'; import zlib from 'zlib'; export default (new Compressor({ diff --git a/packages/compressors/raw/package.json b/packages/compressors/raw/package.json index c0f4be42a..2afacf4c5 100644 --- a/packages/compressors/raw/package.json +++ b/packages/compressors/raw/package.json @@ -1,25 +1,21 @@ { - "name": "@parcel/compressor-raw", + "name": "@atlaspack/compressor-raw", "version": "2.12.0", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/RawCompressor.js", "source": "src/RawCompressor.js", "engines": { "node": ">= 16.0.0", - "parcel": "^2.12.0" + "atlaspack": "^2.12.0" }, "dependencies": { - "@parcel/plugin": "2.12.0" + "@atlaspack/plugin": "2.12.0" } } diff --git a/packages/compressors/raw/src/RawCompressor.js b/packages/compressors/raw/src/RawCompressor.js index 988b383cd..a5b87b82b 100644 --- a/packages/compressors/raw/src/RawCompressor.js +++ b/packages/compressors/raw/src/RawCompressor.js @@ -1,5 +1,5 @@ // @flow -import {Compressor} from '@parcel/plugin'; +import {Compressor} from '@atlaspack/plugin'; export default (new Compressor({ compress({stream}) { diff --git a/packages/configs/default/index.json b/packages/configs/default/index.json index 974ad645f..8fb9ef272 100644 --- a/packages/configs/default/index.json +++ b/packages/configs/default/index.json @@ -1,80 +1,83 @@ { - "bundler": "@parcel/bundler-default", + "bundler": "@atlaspack/bundler-default", "transformers": { - "types:*.{ts,tsx}": ["@parcel/transformer-typescript-types"], - "bundle-text:*": ["...", "@parcel/transformer-inline-string"], - "data-url:*": ["...", "@parcel/transformer-inline-string"], + "types:*.{ts,tsx}": ["@atlaspack/transformer-typescript-types"], + "bundle-text:*": ["...", "@atlaspack/transformer-inline-string"], + "data-url:*": ["...", "@atlaspack/transformer-inline-string"], "worklet:*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": [ - "@parcel/transformer-worklet", + "@atlaspack/transformer-worklet", "..." ], "*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": [ - "@parcel/transformer-babel", - "@parcel/transformer-js", - "@parcel/transformer-react-refresh-wrap" + "@atlaspack/transformer-babel", + "@atlaspack/transformer-js", + "@atlaspack/transformer-react-refresh-wrap" ], - "*.{json,json5}": ["@parcel/transformer-json"], - "*.jsonld": ["@parcel/transformer-jsonld"], - "*.toml": ["@parcel/transformer-toml"], - "*.webmanifest": ["@parcel/transformer-webmanifest"], - "webmanifest:*.{json,webmanifest}": ["@parcel/transformer-webmanifest"], - "*.{yaml,yml}": ["@parcel/transformer-yaml"], - "*.{glsl,vert,frag}": ["@parcel/transformer-glsl"], - "*.{gql,graphql}": ["@parcel/transformer-graphql"], - "*.{styl,stylus}": ["@parcel/transformer-stylus"], - "*.{sass,scss}": ["@parcel/transformer-sass"], - "*.less": ["@parcel/transformer-less"], - "*.{css,pcss}": ["@parcel/transformer-postcss", "@parcel/transformer-css"], - "*.sss": ["@parcel/transformer-sugarss"], + "*.{json,json5}": ["@atlaspack/transformer-json"], + "*.jsonld": ["@atlaspack/transformer-jsonld"], + "*.toml": ["@atlaspack/transformer-toml"], + "*.webmanifest": ["@atlaspack/transformer-webmanifest"], + "webmanifest:*.{json,webmanifest}": ["@atlaspack/transformer-webmanifest"], + "*.{yaml,yml}": ["@atlaspack/transformer-yaml"], + "*.{glsl,vert,frag}": ["@atlaspack/transformer-glsl"], + "*.{gql,graphql}": ["@atlaspack/transformer-graphql"], + "*.{styl,stylus}": ["@atlaspack/transformer-stylus"], + "*.{sass,scss}": ["@atlaspack/transformer-sass"], + "*.less": ["@atlaspack/transformer-less"], + "*.{css,pcss}": [ + "@atlaspack/transformer-postcss", + "@atlaspack/transformer-css" + ], + "*.sss": ["@atlaspack/transformer-sugarss"], "*.{htm,html,xhtml}": [ - "@parcel/transformer-posthtml", - "@parcel/transformer-html" + "@atlaspack/transformer-posthtml", + "@atlaspack/transformer-html" ], - "*.pug": ["@parcel/transformer-pug"], - "*.coffee": ["@parcel/transformer-coffeescript"], - "*.elm": ["@parcel/transformer-elm"], - "*.mdx": ["@parcel/transformer-mdx"], - "*.vue": ["@parcel/transformer-vue"], - "template:*.vue": ["@parcel/transformer-vue"], - "script:*.vue": ["@parcel/transformer-vue"], - "style:*.vue": ["@parcel/transformer-vue"], - "custom:*.vue": ["@parcel/transformer-vue"], + "*.pug": ["@atlaspack/transformer-pug"], + "*.coffee": ["@atlaspack/transformer-coffeescript"], + "*.elm": ["@atlaspack/transformer-elm"], + "*.mdx": ["@atlaspack/transformer-mdx"], + "*.vue": ["@atlaspack/transformer-vue"], + "template:*.vue": ["@atlaspack/transformer-vue"], + "script:*.vue": ["@atlaspack/transformer-vue"], + "style:*.vue": ["@atlaspack/transformer-vue"], + "custom:*.vue": ["@atlaspack/transformer-vue"], "*.{png,jpg,jpeg,webp,gif,tiff,avif,heic,heif}": [ - "@parcel/transformer-image" + "@atlaspack/transformer-image" ], - "*.svg": ["@parcel/transformer-svg"], - "*.{xml,rss,atom}": ["@parcel/transformer-xml"], - "url:*": ["...", "@parcel/transformer-raw"] + "*.svg": ["@atlaspack/transformer-svg"], + "*.{xml,rss,atom}": ["@atlaspack/transformer-xml"], + "url:*": ["...", "@atlaspack/transformer-raw"] }, - "namers": ["@parcel/namer-default"], + "namers": ["@atlaspack/namer-default"], "runtimes": [ - "@parcel/runtime-js", - "@parcel/runtime-browser-hmr", - "@parcel/runtime-react-refresh", - "@parcel/runtime-service-worker" + "@atlaspack/runtime-js", + "@atlaspack/runtime-browser-hmr", + "@atlaspack/runtime-react-refresh", + "@atlaspack/runtime-service-worker" ], "optimizers": { - "data-url:*": ["...", "@parcel/optimizer-data-url"], - "*.css": ["@parcel/optimizer-css"], - "*.{html,xhtml}": ["@parcel/optimizer-htmlnano"], - "*.{js,mjs,cjs}": ["@parcel/optimizer-swc"], - "*.svg": ["@parcel/optimizer-svgo"], - "*.{jpg,jpeg,png}": ["@parcel/optimizer-image"] + "data-url:*": ["...", "@atlaspack/optimizer-data-url"], + "*.css": ["@atlaspack/optimizer-css"], + "*.{html,xhtml}": ["@atlaspack/optimizer-htmlnano"], + "*.{js,mjs,cjs}": ["@atlaspack/optimizer-swc"], + "*.svg": ["@atlaspack/optimizer-svgo"], + "*.{jpg,jpeg,png}": ["@atlaspack/optimizer-image"] }, "packagers": { - "*.{html,xhtml}": "@parcel/packager-html", - "*.css": "@parcel/packager-css", - "*.{js,mjs,cjs}": "@parcel/packager-js", - "*.svg": "@parcel/packager-svg", - "*.{xml,rss,atom}": "@parcel/packager-xml", - "*.ts": "@parcel/packager-ts", - "*.wasm": "@parcel/packager-wasm", - "*.{jsonld,svg,webmanifest}": "@parcel/packager-raw-url", - "*": "@parcel/packager-raw" + "*.{html,xhtml}": "@atlaspack/packager-html", + "*.css": "@atlaspack/packager-css", + "*.{js,mjs,cjs}": "@atlaspack/packager-js", + "*.svg": "@atlaspack/packager-svg", + "*.{xml,rss,atom}": "@atlaspack/packager-xml", + "*.ts": "@atlaspack/packager-ts", + "*.wasm": "@atlaspack/packager-wasm", + "*.{jsonld,svg,webmanifest}": "@atlaspack/packager-raw-url", + "*": "@atlaspack/packager-raw" }, "compressors": { - "*": ["@parcel/compressor-raw"] + "*": ["@atlaspack/compressor-raw"] }, - "resolvers": ["@parcel/resolver-default"], - "reporters": ["@parcel/reporter-dev-server"] + "resolvers": ["@atlaspack/resolver-default"], + "reporters": ["@atlaspack/reporter-dev-server"] } diff --git a/packages/configs/default/package.json b/packages/configs/default/package.json index ff96d93f0..0136259e1 100644 --- a/packages/configs/default/package.json +++ b/packages/configs/default/package.json @@ -1,81 +1,77 @@ { - "name": "@parcel/config-default", + "name": "@atlaspack/config-default", "version": "2.12.0", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "index.json", "scripts": { "test-ci": "mocha" }, "dependencies": { - "@parcel/bundler-default": "2.12.0", - "@parcel/compressor-raw": "2.12.0", - "@parcel/namer-default": "2.12.0", - "@parcel/optimizer-css": "2.12.0", - "@parcel/optimizer-htmlnano": "2.12.0", - "@parcel/optimizer-image": "2.12.0", - "@parcel/optimizer-svgo": "2.12.0", - "@parcel/optimizer-swc": "2.12.0", - "@parcel/packager-css": "2.12.0", - "@parcel/packager-html": "2.12.0", - "@parcel/packager-js": "2.12.0", - "@parcel/packager-raw": "2.12.0", - "@parcel/packager-svg": "2.12.0", - "@parcel/packager-wasm": "2.12.0", - "@parcel/reporter-dev-server": "2.12.0", - "@parcel/resolver-default": "2.12.0", - "@parcel/runtime-browser-hmr": "2.12.0", - "@parcel/runtime-js": "2.12.0", - "@parcel/runtime-react-refresh": "2.12.0", - "@parcel/runtime-service-worker": "2.12.0", - "@parcel/transformer-babel": "2.12.0", - "@parcel/transformer-css": "2.12.0", - "@parcel/transformer-html": "2.12.0", - "@parcel/transformer-image": "2.12.0", - "@parcel/transformer-js": "2.12.0", - "@parcel/transformer-json": "2.12.0", - "@parcel/transformer-postcss": "2.12.0", - "@parcel/transformer-posthtml": "2.12.0", - "@parcel/transformer-raw": "2.12.0", - "@parcel/transformer-react-refresh-wrap": "2.12.0", - "@parcel/transformer-svg": "2.12.0" + "@atlaspack/bundler-default": "2.12.0", + "@atlaspack/compressor-raw": "2.12.0", + "@atlaspack/namer-default": "2.12.0", + "@atlaspack/optimizer-css": "2.12.0", + "@atlaspack/optimizer-htmlnano": "2.12.0", + "@atlaspack/optimizer-image": "2.12.0", + "@atlaspack/optimizer-svgo": "2.12.0", + "@atlaspack/optimizer-swc": "2.12.0", + "@atlaspack/packager-css": "2.12.0", + "@atlaspack/packager-html": "2.12.0", + "@atlaspack/packager-js": "2.12.0", + "@atlaspack/packager-raw": "2.12.0", + "@atlaspack/packager-svg": "2.12.0", + "@atlaspack/packager-wasm": "2.12.0", + "@atlaspack/reporter-dev-server": "2.12.0", + "@atlaspack/resolver-default": "2.12.0", + "@atlaspack/runtime-browser-hmr": "2.12.0", + "@atlaspack/runtime-js": "2.12.0", + "@atlaspack/runtime-react-refresh": "2.12.0", + "@atlaspack/runtime-service-worker": "2.12.0", + "@atlaspack/transformer-babel": "2.12.0", + "@atlaspack/transformer-css": "2.12.0", + "@atlaspack/transformer-html": "2.12.0", + "@atlaspack/transformer-image": "2.12.0", + "@atlaspack/transformer-js": "2.12.0", + "@atlaspack/transformer-json": "2.12.0", + "@atlaspack/transformer-postcss": "2.12.0", + "@atlaspack/transformer-posthtml": "2.12.0", + "@atlaspack/transformer-raw": "2.12.0", + "@atlaspack/transformer-react-refresh-wrap": "2.12.0", + "@atlaspack/transformer-svg": "2.12.0" }, - "parcelDependencies": { - "@parcel/optimizer-data-url": "2.12.0", - "@parcel/packager-raw-url": "2.12.0", - "@parcel/packager-ts": "2.12.0", - "@parcel/packager-xml": "2.12.0", - "@parcel/transformer-coffeescript": "2.12.0", - "@parcel/transformer-elm": "2.12.0", - "@parcel/transformer-glsl": "2.12.0", - "@parcel/transformer-graphql": "2.12.0", - "@parcel/transformer-inline-string": "2.12.0", - "@parcel/transformer-jsonld": "2.12.0", - "@parcel/transformer-less": "2.12.0", - "@parcel/transformer-mdx": "2.12.0", - "@parcel/transformer-pug": "2.12.0", - "@parcel/transformer-sass": "2.12.0", - "@parcel/transformer-stylus": "2.12.0", - "@parcel/transformer-sugarss": "2.12.0", - "@parcel/transformer-toml": "2.12.0", - "@parcel/transformer-typescript-types": "2.12.0", - "@parcel/transformer-vue": "2.12.0", - "@parcel/transformer-webmanifest": "2.12.0", - "@parcel/transformer-worklet": "2.12.0", - "@parcel/transformer-xml": "2.12.0", - "@parcel/transformer-yaml": "2.12.0" + "atlaspackDependencies": { + "@atlaspack/optimizer-data-url": "2.12.0", + "@atlaspack/packager-raw-url": "2.12.0", + "@atlaspack/packager-ts": "2.12.0", + "@atlaspack/packager-xml": "2.12.0", + "@atlaspack/transformer-coffeescript": "2.12.0", + "@atlaspack/transformer-elm": "2.12.0", + "@atlaspack/transformer-glsl": "2.12.0", + "@atlaspack/transformer-graphql": "2.12.0", + "@atlaspack/transformer-inline-string": "2.12.0", + "@atlaspack/transformer-jsonld": "2.12.0", + "@atlaspack/transformer-less": "2.12.0", + "@atlaspack/transformer-mdx": "2.12.0", + "@atlaspack/transformer-pug": "2.12.0", + "@atlaspack/transformer-sass": "2.12.0", + "@atlaspack/transformer-stylus": "2.12.0", + "@atlaspack/transformer-sugarss": "2.12.0", + "@atlaspack/transformer-toml": "2.12.0", + "@atlaspack/transformer-typescript-types": "2.12.0", + "@atlaspack/transformer-vue": "2.12.0", + "@atlaspack/transformer-webmanifest": "2.12.0", + "@atlaspack/transformer-worklet": "2.12.0", + "@atlaspack/transformer-xml": "2.12.0", + "@atlaspack/transformer-yaml": "2.12.0" }, "peerDependencies": { - "@parcel/core": "^2.12.0" + "@atlaspack/core": "^2.12.0" } } diff --git a/packages/configs/default/test/.babelrc b/packages/configs/default/test/.babelrc index be26495ef..bfabf3864 100644 --- a/packages/configs/default/test/.babelrc +++ b/packages/configs/default/test/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["@parcel/babel-preset"] + "presets": ["@atlaspack/babel-preset"] } diff --git a/packages/configs/default/test/config.test.js b/packages/configs/default/test/config.test.js index d3b5d6018..90b575aee 100644 --- a/packages/configs/default/test/config.test.js +++ b/packages/configs/default/test/config.test.js @@ -5,14 +5,14 @@ import assert from 'assert'; import config from '../'; import packageJson from '../package.json'; -describe('@parcel/config-default', () => { +describe('@atlaspack/config-default', () => { let packageJsonDependencyNames: Set; let configPackageReferences: Set; before(() => { packageJsonDependencyNames = new Set([ ...Object.keys(packageJson.dependencies || {}), - ...Object.keys(packageJson.parcelDependencies || {}), + ...Object.keys(packageJson.atlaspackDependencies || {}), ]); configPackageReferences = collectConfigPackageReferences(config); }); @@ -63,7 +63,7 @@ function collectConfigPackageReferences( collectConfigPackageReferences(value, references); } else { throw new Error( - 'Parcel configs must contain only strings, arrays, or objects in value positions', + 'Atlaspack configs must contain only strings, arrays, or objects in value positions', ); } } diff --git a/packages/configs/repl/index.json b/packages/configs/repl/index.json index 09b050094..229f05a92 100644 --- a/packages/configs/repl/index.json +++ b/packages/configs/repl/index.json @@ -1,39 +1,42 @@ { - "bundler": "@parcel/bundler-default", + "bundler": "@atlaspack/bundler-default", "transformers": { - "bundle-text:*": ["@parcel/transformer-inline-string", "..."], + "bundle-text:*": ["@atlaspack/transformer-inline-string", "..."], "*.{js,mjs,jsm,jsx,es6,ts,tsx}": [ - "@parcel/transformer-babel", - "@parcel/transformer-js", - "@parcel/transformer-react-refresh-wrap" + "@atlaspack/transformer-babel", + "@atlaspack/transformer-js", + "@atlaspack/transformer-react-refresh-wrap" ], - "*.{json,json5}": ["@parcel/transformer-json"], - "*.css": ["@parcel/transformer-postcss", "@parcel/transformer-css"], + "*.{json,json5}": ["@atlaspack/transformer-json"], + "*.css": ["@atlaspack/transformer-postcss", "@atlaspack/transformer-css"], "*.{htm,html}": [ - "@parcel/transformer-posthtml", - "@parcel/transformer-html" + "@atlaspack/transformer-posthtml", + "@atlaspack/transformer-html" ], - "url:*": ["@parcel/transformer-raw"] + "url:*": ["@atlaspack/transformer-raw"] }, - "namers": ["@parcel/namer-default"], + "namers": ["@atlaspack/namer-default"], "runtimes": [ - "@parcel/runtime-js", - "@parcel/runtime-browser-hmr", - "@parcel/runtime-react-refresh" + "@atlaspack/runtime-js", + "@atlaspack/runtime-browser-hmr", + "@atlaspack/runtime-react-refresh" ], "optimizers": { - "*.{js,mjs,cjs}": ["@parcel/optimizer-terser"], - "*.css": ["@parcel/optimizer-css"] + "*.{js,mjs,cjs}": ["@atlaspack/optimizer-terser"], + "*.css": ["@atlaspack/optimizer-css"] }, "packagers": { - "*.{html,xhtml}": "@parcel/packager-html", - "*.css": "@parcel/packager-css", - "*.{js,mjs,cjs}": "@parcel/packager-js", - "*": "@parcel/packager-raw" + "*.{html,xhtml}": "@atlaspack/packager-html", + "*.css": "@atlaspack/packager-css", + "*.{js,mjs,cjs}": "@atlaspack/packager-js", + "*": "@atlaspack/packager-raw" }, "compressors": { - "*": ["@parcel/compressor-raw"] + "*": ["@atlaspack/compressor-raw"] }, - "resolvers": ["@parcel/resolver-repl-runtimes", "@parcel/resolver-default"], - "reporters": ["@parcel/reporter-dev-server-sw"] + "resolvers": [ + "@atlaspack/resolver-repl-runtimes", + "@atlaspack/resolver-default" + ], + "reporters": ["@atlaspack/reporter-dev-server-sw"] } diff --git a/packages/configs/repl/package.json b/packages/configs/repl/package.json index d7fbda106..db3d2d3d9 100644 --- a/packages/configs/repl/package.json +++ b/packages/configs/repl/package.json @@ -1,41 +1,41 @@ { - "name": "@parcel/config-repl", + "name": "@atlaspack/config-repl", "version": "2.12.0", "license": "MIT", "private": true, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "index.json", "scripts": { "test-ci": "mocha" }, "dependencies": { - "@parcel/bundler-default": "2.12.0", - "@parcel/compressor-raw": "2.12.0", - "@parcel/namer-default": "2.12.0", - "@parcel/optimizer-terser": "2.12.0", - "@parcel/packager-css": "2.12.0", - "@parcel/packager-html": "2.12.0", - "@parcel/packager-js": "2.12.0", - "@parcel/packager-raw": "2.12.0", - "@parcel/reporter-dev-server-sw": "2.12.0", - "@parcel/reporter-json": "2.12.0", - "@parcel/resolver-default": "2.12.0", - "@parcel/resolver-repl-runtimes": "2.12.0", - "@parcel/runtime-browser-hmr": "2.12.0", - "@parcel/runtime-js": "2.12.0", - "@parcel/runtime-react-refresh": "2.12.0", - "@parcel/transformer-babel": "2.12.0", - "@parcel/transformer-css": "2.12.0", - "@parcel/transformer-html": "2.12.0", - "@parcel/transformer-inline-string": "2.12.0", - "@parcel/transformer-js": "2.12.0", - "@parcel/transformer-json": "2.12.0", - "@parcel/transformer-postcss": "2.12.0", - "@parcel/transformer-posthtml": "2.12.0", - "@parcel/transformer-raw": "2.12.0", - "@parcel/transformer-react-refresh-wrap": "2.12.0" + "@atlaspack/bundler-default": "2.12.0", + "@atlaspack/compressor-raw": "2.12.0", + "@atlaspack/namer-default": "2.12.0", + "@atlaspack/optimizer-terser": "2.12.0", + "@atlaspack/packager-css": "2.12.0", + "@atlaspack/packager-html": "2.12.0", + "@atlaspack/packager-js": "2.12.0", + "@atlaspack/packager-raw": "2.12.0", + "@atlaspack/reporter-dev-server-sw": "2.12.0", + "@atlaspack/reporter-json": "2.12.0", + "@atlaspack/resolver-default": "2.12.0", + "@atlaspack/resolver-repl-runtimes": "2.12.0", + "@atlaspack/runtime-browser-hmr": "2.12.0", + "@atlaspack/runtime-js": "2.12.0", + "@atlaspack/runtime-react-refresh": "2.12.0", + "@atlaspack/transformer-babel": "2.12.0", + "@atlaspack/transformer-css": "2.12.0", + "@atlaspack/transformer-html": "2.12.0", + "@atlaspack/transformer-inline-string": "2.12.0", + "@atlaspack/transformer-js": "2.12.0", + "@atlaspack/transformer-json": "2.12.0", + "@atlaspack/transformer-postcss": "2.12.0", + "@atlaspack/transformer-posthtml": "2.12.0", + "@atlaspack/transformer-raw": "2.12.0", + "@atlaspack/transformer-react-refresh-wrap": "2.12.0" } } diff --git a/packages/configs/webextension/index.json b/packages/configs/webextension/index.json index 575503f5b..24a445090 100644 --- a/packages/configs/webextension/index.json +++ b/packages/configs/webextension/index.json @@ -1,11 +1,11 @@ { - "extends": "@parcel/config-default", + "extends": "@atlaspack/config-default", "transformers": { - "manifest.json": ["@parcel/transformer-webextension"], - "raw:*": ["@parcel/transformer-raw"] + "manifest.json": ["@atlaspack/transformer-webextension"], + "raw:*": ["@atlaspack/transformer-raw"] }, - "runtimes": ["...", "@parcel/runtime-webextension"], + "runtimes": ["...", "@atlaspack/runtime-webextension"], "packagers": { - "manifest.json": "@parcel/packager-webextension" + "manifest.json": "@atlaspack/packager-webextension" } } diff --git a/packages/configs/webextension/package.json b/packages/configs/webextension/package.json index 14a159474..b2f3f3ce9 100644 --- a/packages/configs/webextension/package.json +++ b/packages/configs/webextension/package.json @@ -1,27 +1,23 @@ { - "name": "@parcel/config-webextension", + "name": "@atlaspack/config-webextension", "version": "2.12.0", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "index.json", "dependencies": { - "@parcel/config-default": "2.12.0", - "@parcel/packager-webextension": "2.12.0", - "@parcel/runtime-webextension": "2.12.0", - "@parcel/transformer-raw": "2.12.0", - "@parcel/transformer-webextension": "2.12.0" + "@atlaspack/config-default": "2.12.0", + "@atlaspack/packager-webextension": "2.12.0", + "@atlaspack/runtime-webextension": "2.12.0", + "@atlaspack/transformer-raw": "2.12.0", + "@atlaspack/transformer-webextension": "2.12.0" }, "peerDependencies": { - "@parcel/core": "^2.12.0" + "@atlaspack/core": "^2.12.0" } } diff --git a/packages/core/parcel/.npmignore b/packages/core/atlaspack/.npmignore similarity index 100% rename from packages/core/parcel/.npmignore rename to packages/core/atlaspack/.npmignore diff --git a/packages/core/parcel/README.md b/packages/core/atlaspack/README.md similarity index 94% rename from packages/core/parcel/README.md rename to packages/core/atlaspack/README.md index 6a6daeaa0..e48649a1d 100644 --- a/packages/core/parcel/README.md +++ b/packages/core/atlaspack/README.md @@ -1,6 +1,7 @@ # Atlaspack [![Atlassian license](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](LICENSE) + Atlaspack is the frontend bundler used to build Atlassian products, written in JavaScript and Rust by core contributors of [Parcel](https://github.com/parcel-bundler/parcel). It has been engineered to bundle exceptionally large applications and serve the needs of our products. While you are welcome to try out atlaspack, we do not plan to support use-cases outside of Atlassian at this time. Therefore, we advise against using atlaspack in production environments. @@ -31,11 +32,12 @@ atlaspack src/index.html --- src/index.html + ```html - + - + Atlaspack App @@ -48,6 +50,7 @@ src/index.html --- src/app.js + ```js console.log('Hello, World!'); ``` @@ -66,13 +69,13 @@ yarn test -Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details. +Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details. ## License Copyright (c) 2024 Atlassian US., Inc. Apache 2.0 licensed, see [LICENSE](LICENSE) file. -
+
[![With ❤️ from Atlassian](https://raw.githubusercontent.com/atlassian-internal/oss-assets/master/banner-cheers-light.png)](https://www.atlassian.com) diff --git a/packages/core/parcel/bin/parcel.js b/packages/core/atlaspack/bin/atlaspack.js similarity index 100% rename from packages/core/parcel/bin/parcel.js rename to packages/core/atlaspack/bin/atlaspack.js diff --git a/packages/core/parcel/bin/dev-bin.js b/packages/core/atlaspack/bin/dev-bin.js similarity index 100% rename from packages/core/parcel/bin/dev-bin.js rename to packages/core/atlaspack/bin/dev-bin.js diff --git a/packages/core/parcel/ensure-no-dev-lib.sh b/packages/core/atlaspack/ensure-no-dev-lib.sh similarity index 100% rename from packages/core/parcel/ensure-no-dev-lib.sh rename to packages/core/atlaspack/ensure-no-dev-lib.sh diff --git a/packages/core/atlaspack/package.json b/packages/core/atlaspack/package.json new file mode 100644 index 000000000..f4f46f1c1 --- /dev/null +++ b/packages/core/atlaspack/package.json @@ -0,0 +1,45 @@ +{ + "name": "atlaspack", + "version": "2.12.0", + "description": "Blazing fast, zero configuration web application bundler", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/atlassian-labs/atlaspack.git" + }, + "bin": "bin/atlaspack.js", + "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" + }, + "engines": { + "node": ">= 16.0.0" + }, + "dependencies": { + "@atlaspack/config-default": "2.12.0", + "@atlaspack/core": "2.12.0", + "@atlaspack/diagnostic": "2.12.0", + "@atlaspack/events": "2.12.0", + "@atlaspack/feature-flags": "2.12.0", + "@atlaspack/fs": "2.12.0", + "@atlaspack/logger": "2.12.0", + "@atlaspack/package-manager": "2.12.0", + "@atlaspack/reporter-cli": "2.12.0", + "@atlaspack/reporter-dev-server": "2.12.0", + "@atlaspack/reporter-tracer": "2.12.0", + "@atlaspack/utils": "2.12.0", + "chalk": "^4.1.0", + "commander": "^7.0.0", + "get-port": "^4.2.0" + }, + "devDependencies": { + "@babel/core": "^7.22.11", + "@atlaspack/babel-register": "2.12.0", + "rimraf": "^5.0.5" + } +} diff --git a/packages/core/parcel/src/.eslintrc.json b/packages/core/atlaspack/src/.eslintrc.json similarity index 52% rename from packages/core/parcel/src/.eslintrc.json rename to packages/core/atlaspack/src/.eslintrc.json index 3a889ad02..e569b7c12 100644 --- a/packages/core/parcel/src/.eslintrc.json +++ b/packages/core/atlaspack/src/.eslintrc.json @@ -1,5 +1,5 @@ { - "extends": "@parcel/eslint-config", + "extends": "@atlaspack/eslint-config", "rules": { "no-console": "off" } diff --git a/packages/core/atlaspack/src/bin.js b/packages/core/atlaspack/src/bin.js new file mode 100755 index 000000000..51f9a8616 --- /dev/null +++ b/packages/core/atlaspack/src/bin.js @@ -0,0 +1,12 @@ +#!/usr/bin/env node + +'use strict'; + +if ( + process.env.ATLASPACK_BUILD_ENV !== 'production' || + process.env.ATLASPACK_SELF_BUILD +) { + require('@atlaspack/babel-register'); +} + +require('./cli'); diff --git a/packages/core/parcel/src/cli.js b/packages/core/atlaspack/src/cli.js similarity index 89% rename from packages/core/parcel/src/cli.js rename to packages/core/atlaspack/src/cli.js index 5997f1ff2..5b7000aea 100755 --- a/packages/core/parcel/src/cli.js +++ b/packages/core/atlaspack/src/cli.js @@ -1,18 +1,18 @@ // @flow -import type {InitialParcelOptions} from '@parcel/types'; -import {BuildError} from '@parcel/core'; -import {NodeFS} from '@parcel/fs'; -import ThrowableDiagnostic from '@parcel/diagnostic'; -import {prettyDiagnostic, openInBrowser} from '@parcel/utils'; -import {Disposable} from '@parcel/events'; -import {INTERNAL_ORIGINAL_CONSOLE} from '@parcel/logger'; +import type {InitialAtlaspackOptions} from '@atlaspack/types'; +import {BuildError} from '@atlaspack/core'; +import {NodeFS} from '@atlaspack/fs'; +import ThrowableDiagnostic from '@atlaspack/diagnostic'; +import {prettyDiagnostic, openInBrowser} from '@atlaspack/utils'; +import {Disposable} from '@atlaspack/events'; +import {INTERNAL_ORIGINAL_CONSOLE} from '@atlaspack/logger'; import chalk from 'chalk'; import commander from 'commander'; import path from 'path'; import getPort from 'get-port'; import {version} from '../package.json'; -import {DEFAULT_FEATURE_FLAGS} from '@parcel/feature-flags'; +import {DEFAULT_FEATURE_FLAGS} from '@atlaspack/feature-flags'; const program = new commander.Command(); @@ -95,7 +95,8 @@ const commonOptions = { '--no-cache': 'disable the filesystem cache', '--config ': 'specify which config to use. can be a path or a package name', - '--cache-dir ': 'set the cache directory. defaults to ".parcel-cache"', + '--cache-dir ': + 'set the cache directory. defaults to ".atlaspack-cache"', '--watch-dir ': 'set the root watch directory. defaults to nearest lockfile or source control dir.', '--watch-ignore [path]': [ @@ -242,7 +243,7 @@ program.on('--help', function () { INTERNAL_ORIGINAL_CONSOLE.log(''); INTERNAL_ORIGINAL_CONSOLE.log( ' Run `' + - chalk.bold('parcel help ') + + chalk.bold('atlaspack help ') + '` for more information on specific commands', ); INTERNAL_ORIGINAL_CONSOLE.log(''); @@ -284,12 +285,12 @@ async function run( entries = entries.map(entry => path.resolve(entry)); - let Parcel = require('@parcel/core').default; + let Atlaspack = require('@atlaspack/core').default; let fs = new NodeFS(); let options = await normalizeOptions(command, fs); - let parcel = new Parcel({ + let atlaspack = new Atlaspack({ entries, - defaultConfig: require.resolve('@parcel/config-default', { + defaultConfig: require.resolve('@atlaspack/config-default', { paths: [fs.cwd(), __dirname], }), shouldPatchConsole: false, @@ -307,8 +308,8 @@ async function run( isExiting = true; if (unsubscribe != null) { await unsubscribe(); - } else if (parcel.isProfiling) { - await parcel.stopProfiling(); + } else if (atlaspack.isProfiling) { + await atlaspack.stopProfiling(); } if (process.stdin.isTTY && process.stdin.isRaw) { @@ -334,26 +335,26 @@ async function run( switch (key.name) { case 'c': // Detect the ctrl+c key, and gracefully exit after writing the asset graph to the cache. - // This is mostly for tools that wrap Parcel as a child process like yarn and npm. + // This is mostly for tools that wrap Atlaspack as a child process like yarn and npm. // // Setting raw mode prevents SIGINT from being sent in response to ctrl-c: // https://nodejs.org/api/tty.html#tty_readstream_setrawmode_mode // // We don't use the SIGINT event for this because when run inside yarn, the parent - // yarn process ends before Parcel and it appears that Parcel has ended while it may still + // yarn process ends before Atlaspack and it appears that Atlaspack has ended while it may still // be cleaning up. Handling events from stdin prevents this impression. // - // When watching, a 0 success code is acceptable when Parcel is interrupted with ctrl-c. + // When watching, a 0 success code is acceptable when Atlaspack is interrupted with ctrl-c. // When building, fail with a code as if we received a SIGINT. await exit(isWatching ? 0 : SIGINT_EXIT_CODE); break; case 'e': - await (parcel.isProfiling - ? parcel.stopProfiling() - : parcel.startProfiling()); + await (atlaspack.isProfiling + ? atlaspack.stopProfiling() + : atlaspack.startProfiling()); break; case 'y': - await parcel.takeHeapSnapshot(); + await atlaspack.takeHeapSnapshot(); break; } }); @@ -364,7 +365,7 @@ async function run( } if (isWatching) { - ({unsubscribe} = await parcel.watch(err => { + ({unsubscribe} = await atlaspack.watch(err => { if (err) { throw err; } @@ -394,9 +395,9 @@ async function run( process.on('SIGTERM', () => exit()); } else { try { - await parcel.run(); + await atlaspack.run(); } catch (err) { - // If an exception is thrown during Parcel.build, it is given to reporters in a + // If an exception is thrown during Atlaspack.build, it is given to reporters in a // buildFailure event, and has been shown to the user. if (!(err instanceof BuildError)) { await logUncaughtError(err); @@ -430,7 +431,7 @@ function parseOptionInt(value) { async function normalizeOptions( command, inputFS, -): Promise { +): Promise { let nodeEnv; if (command.name() === 'build') { nodeEnv = process.env.NODE_ENV || 'production'; @@ -465,7 +466,7 @@ async function normalizeOptions( throw new ThrowableDiagnostic({ diagnostic: { message: `Could not get available port: ${err.message}`, - origin: 'parcel', + origin: 'atlaspack', stack: err.stack, }, }); @@ -477,7 +478,7 @@ async function normalizeOptions( // Throw the error if the user defined a custom port throw new Error(errorMessage); } else { - // Parcel logger is not set up at this point, so just use native INTERNAL_ORIGINAL_CONSOLE + // Atlaspack logger is not set up at this point, so just use native INTERNAL_ORIGINAL_CONSOLE INTERNAL_ORIGINAL_CONSOLE.warn(errorMessage); } } @@ -510,7 +511,7 @@ async function normalizeOptions( } let additionalReporters = [ - {packageName: '@parcel/reporter-cli', resolveFrom: __filename}, + {packageName: '@atlaspack/reporter-cli', resolveFrom: __filename}, ...(command.reporter: Array).map(packageName => ({ packageName, resolveFrom: path.join(inputFS.cwd(), 'index'), @@ -519,7 +520,7 @@ async function normalizeOptions( if (command.trace) { additionalReporters.unshift({ - packageName: '@parcel/reporter-tracer', + packageName: '@atlaspack/reporter-tracer', resolveFrom: __filename, }); } @@ -551,7 +552,7 @@ async function normalizeOptions( lazyIncludes: normalizeIncludeExcludeList(command.lazy), lazyExcludes: normalizeIncludeExcludeList(command.lazyExclude), shouldBundleIncrementally: - process.env.PARCEL_INCREMENTAL_BUNDLING === 'false' ? false : true, + process.env.ATLASPACK_INCREMENTAL_BUNDLING === 'false' ? false : true, detailedReport: command.detailedReport != null ? { diff --git a/packages/core/cache/index.d.ts b/packages/core/cache/index.d.ts index bd738460e..de4f63da8 100644 --- a/packages/core/cache/index.d.ts +++ b/packages/core/cache/index.d.ts @@ -1,4 +1,4 @@ -import type {FilePath} from '@parcel/types'; +import type {FilePath} from '@atlaspack/types'; import type {Cache} from './lib/types'; export type {Cache} from './lib/types'; diff --git a/packages/core/cache/package.json b/packages/core/cache/package.json index fd00f8abe..2d64f47fb 100644 --- a/packages/core/cache/package.json +++ b/packages/core/cache/package.json @@ -1,18 +1,14 @@ { - "name": "@parcel/cache", + "name": "@atlaspack/cache", "description": "Interface for defining caches and file-system, IDB and LMDB implementations.", "version": "2.12.0", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/index.js", "source": "src/index.js", @@ -25,13 +21,13 @@ "check-ts": "tsc --noEmit index.d.ts" }, "dependencies": { - "@parcel/fs": "2.12.0", - "@parcel/logger": "2.12.0", - "@parcel/utils": "2.12.0", + "@atlaspack/fs": "2.12.0", + "@atlaspack/logger": "2.12.0", + "@atlaspack/utils": "2.12.0", "lmdb": "2.8.5" }, "peerDependencies": { - "@parcel/core": "^2.12.0" + "@atlaspack/core": "^2.12.0" }, "devDependencies": { "idb": "^5.0.8" diff --git a/packages/core/cache/src/FSCache.js b/packages/core/cache/src/FSCache.js index 54da08a76..b339e7423 100644 --- a/packages/core/cache/src/FSCache.js +++ b/packages/core/cache/src/FSCache.js @@ -1,15 +1,19 @@ // @flow strict-local import type {Readable, Writable} from 'stream'; -import type {FilePath} from '@parcel/types'; -import type {FileSystem} from '@parcel/fs'; +import type {FilePath} from '@atlaspack/types'; +import type {FileSystem} from '@atlaspack/fs'; import type {Cache} from './types'; import stream from 'stream'; import path from 'path'; import {promisify} from 'util'; -import logger from '@parcel/logger'; -import {serialize, deserialize, registerSerializableClass} from '@parcel/core'; +import logger from '@atlaspack/logger'; +import { + serialize, + deserialize, + registerSerializableClass, +} from '@atlaspack/core'; // flowlint-next-line untyped-import:off import packageJson from '../package.json'; import {WRITE_LIMIT_CHUNK} from './constants'; @@ -186,7 +190,7 @@ export class FSCache implements Cache { await this.fs.writeFile(blobPath, data); } catch (err) { - logger.error(err, '@parcel/cache'); + logger.error(err, '@atlaspack/cache'); } } diff --git a/packages/core/cache/src/IDBCache.browser.js b/packages/core/cache/src/IDBCache.browser.js index 3c8cd75d8..45995601c 100644 --- a/packages/core/cache/src/IDBCache.browser.js +++ b/packages/core/cache/src/IDBCache.browser.js @@ -2,8 +2,12 @@ import type {Cache} from './types'; import {Readable} from 'stream'; -import {serialize, deserialize, registerSerializableClass} from '@parcel/core'; -import {bufferStream} from '@parcel/utils'; +import { + serialize, + deserialize, + registerSerializableClass, +} from '@atlaspack/core'; +import {bufferStream} from '@atlaspack/utils'; // $FlowFixMe[untyped-import] import packageJson from '../package.json'; // $FlowFixMe[untyped-import] @@ -16,7 +20,7 @@ export class IDBCache implements Cache { store: any; constructor() { - this.store = openDB('REPL-parcel-cache', 1, { + this.store = openDB('REPL-atlaspack-cache', 1, { upgrade(db) { db.createObjectStore(STORE_NAME); }, diff --git a/packages/core/cache/src/LMDBCache.js b/packages/core/cache/src/LMDBCache.js index 644be76c1..e4b3bef52 100644 --- a/packages/core/cache/src/LMDBCache.js +++ b/packages/core/cache/src/LMDBCache.js @@ -1,13 +1,17 @@ // @flow strict-local -import type {FilePath} from '@parcel/types'; +import type {FilePath} from '@atlaspack/types'; import type {Cache} from './types'; import type {Readable, Writable} from 'stream'; import stream from 'stream'; import path from 'path'; import {promisify} from 'util'; -import {serialize, deserialize, registerSerializableClass} from '@parcel/core'; -import {NodeFS} from '@parcel/fs'; +import { + serialize, + deserialize, + registerSerializableClass, +} from '@atlaspack/core'; +import {NodeFS} from '@atlaspack/fs'; // flowlint-next-line untyped-import:off import packageJson from '../package.json'; // $FlowFixMe @@ -32,7 +36,7 @@ export class LMDBCache implements Cache { this.fsCache = new FSCache(this.fs, cacheDir); this.store = lmdb.open(cacheDir, { - name: 'parcel-cache', + name: 'atlaspack-cache', encoding: 'binary', compression: true, }); diff --git a/packages/core/cache/src/types.js b/packages/core/cache/src/types.js index 472be4c88..afecc1930 100644 --- a/packages/core/cache/src/types.js +++ b/packages/core/cache/src/types.js @@ -1,4 +1,4 @@ // @flow -import type {Cache} from '@parcel/types'; +import type {Cache} from '@atlaspack/types'; export type {Cache}; diff --git a/packages/core/codeframe/package.json b/packages/core/codeframe/package.json index 3a28b8a92..e90df2a23 100644 --- a/packages/core/codeframe/package.json +++ b/packages/core/codeframe/package.json @@ -1,18 +1,14 @@ { - "name": "@parcel/codeframe", + "name": "@atlaspack/codeframe", "version": "2.12.0", "description": "Blazing fast, zero configuration web application bundler", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/codeframe.js", "source": "src/codeframe.js", diff --git a/packages/core/codeframe/src/codeframe.js b/packages/core/codeframe/src/codeframe.js index 350bae85d..4caac17e8 100644 --- a/packages/core/codeframe/src/codeframe.js +++ b/packages/core/codeframe/src/codeframe.js @@ -1,5 +1,5 @@ // @flow -import type {DiagnosticCodeHighlight} from '@parcel/diagnostic'; +import type {DiagnosticCodeHighlight} from '@atlaspack/diagnostic'; import chalk from 'chalk'; import emphasize from 'emphasize'; diff --git a/packages/core/core/index.d.ts b/packages/core/core/index.d.ts index a1d56432a..d72763d96 100644 --- a/packages/core/core/index.d.ts +++ b/packages/core/core/index.d.ts @@ -1,14 +1,14 @@ import type { - InitialParcelOptions, + InitialAtlaspackOptions, BuildEvent, BuildSuccessEvent, AsyncSubscription, -} from '@parcel/types'; -import type {FarmOptions} from '@parcel/workers'; -import type WorkerFarm from '@parcel/workers'; +} from '@atlaspack/types'; +import type {FarmOptions} from '@atlaspack/workers'; +import type WorkerFarm from '@atlaspack/workers'; -export class Parcel { - constructor(options: InitialParcelOptions); +export class Atlaspack { + constructor(options: InitialAtlaspackOptions); run(): Promise; watch( cb?: (err: Error | null | undefined, buildEvent?: BuildEvent) => unknown, @@ -19,4 +19,4 @@ export declare function createWorkerFarm( options?: Partial, ): WorkerFarm; -export default Parcel; +export default Atlaspack; diff --git a/packages/core/core/package.json b/packages/core/core/package.json index 73970716f..6f12a130c 100644 --- a/packages/core/core/package.json +++ b/packages/core/core/package.json @@ -1,17 +1,13 @@ { - "name": "@parcel/core", + "name": "@atlaspack/core", "version": "2.12.0", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/index.js", "source": "src/index.js", @@ -25,21 +21,21 @@ }, "dependencies": { "@mischnic/json-sourcemap": "^0.1.0", - "@parcel/cache": "2.12.0", - "@parcel/diagnostic": "2.12.0", - "@parcel/events": "2.12.0", - "@parcel/feature-flags": "2.12.0", - "@parcel/fs": "2.12.0", - "@parcel/graph": "3.2.0", - "@parcel/logger": "2.12.0", - "@parcel/package-manager": "2.12.0", - "@parcel/plugin": "2.12.0", - "@parcel/profiler": "2.12.0", - "@parcel/rust": "2.12.0", + "@atlaspack/cache": "2.12.0", + "@atlaspack/diagnostic": "2.12.0", + "@atlaspack/events": "2.12.0", + "@atlaspack/feature-flags": "2.12.0", + "@atlaspack/fs": "2.12.0", + "@atlaspack/graph": "3.2.0", + "@atlaspack/logger": "2.12.0", + "@atlaspack/package-manager": "2.12.0", + "@atlaspack/plugin": "2.12.0", + "@atlaspack/profiler": "2.12.0", + "@atlaspack/rust": "2.12.0", "@parcel/source-map": "^2.1.1", - "@parcel/types": "2.12.0", - "@parcel/utils": "2.12.0", - "@parcel/workers": "2.12.0", + "@atlaspack/types": "2.12.0", + "@atlaspack/utils": "2.12.0", + "@atlaspack/workers": "2.12.0", "base-x": "^3.0.8", "browserslist": "^4.6.6", "clone": "^2.1.1", @@ -51,7 +47,7 @@ "semver": "^7.5.2" }, "devDependencies": { - "@parcel/babel-register": "2.12.0", + "@atlaspack/babel-register": "2.12.0", "@types/node": ">= 18", "graphviz": "^0.0.9", "tempy": "^0.2.1" diff --git a/packages/core/core/src/AssetGraph.js b/packages/core/core/src/AssetGraph.js index 2d674e866..1542aea35 100644 --- a/packages/core/core/src/AssetGraph.js +++ b/packages/core/core/src/AssetGraph.js @@ -1,12 +1,12 @@ // @flow strict-local -import type {GraphVisitor} from '@parcel/types'; +import type {GraphVisitor} from '@atlaspack/types'; import type { ContentGraphOpts, ContentKey, NodeId, SerializedContentGraph, -} from '@parcel/graph'; +} from '@atlaspack/graph'; import type { Asset, AssetGraphNode, @@ -23,10 +23,10 @@ import type { } from './types'; import invariant from 'assert'; -import {hashString, Hash} from '@parcel/rust'; -import {hashObject} from '@parcel/utils'; +import {hashString, Hash} from '@atlaspack/rust'; +import {hashObject} from '@atlaspack/utils'; import nullthrows from 'nullthrows'; -import {ContentGraph} from '@parcel/graph'; +import {ContentGraph} from '@atlaspack/graph'; import {createDependency} from './Dependency'; import {type ProjectPath, fromProjectPathRelative} from './projectPath'; diff --git a/packages/core/core/src/Parcel.js b/packages/core/core/src/Atlaspack.js similarity index 86% rename from packages/core/core/src/Parcel.js rename to packages/core/core/src/Atlaspack.js index da7da5901..38c271499 100644 --- a/packages/core/core/src/Parcel.js +++ b/packages/core/core/src/Atlaspack.js @@ -5,76 +5,76 @@ import type { AsyncSubscription, BuildEvent, BuildSuccessEvent, - InitialParcelOptions, + InitialAtlaspackOptions, PackagedBundle as IPackagedBundle, - ParcelTransformOptions, - ParcelResolveOptions, - ParcelResolveResult, -} from '@parcel/types'; + AtlaspackTransformOptions, + AtlaspackResolveOptions, + AtlaspackResolveResult, +} from '@atlaspack/types'; import path from 'path'; -import type {ParcelOptions} from './types'; +import type {AtlaspackOptions} from './types'; // eslint-disable-next-line no-unused-vars -import type {FarmOptions, SharedReference} from '@parcel/workers'; -import type {Diagnostic} from '@parcel/diagnostic'; +import type {FarmOptions, SharedReference} from '@atlaspack/workers'; +import type {Diagnostic} from '@atlaspack/diagnostic'; import invariant from 'assert'; -import ThrowableDiagnostic, {anyToDiagnostic} from '@parcel/diagnostic'; +import ThrowableDiagnostic, {anyToDiagnostic} from '@atlaspack/diagnostic'; import {assetFromValue} from './public/Asset'; import {PackagedBundle} from './public/Bundle'; import BundleGraph from './public/BundleGraph'; -import WorkerFarm from '@parcel/workers'; +import WorkerFarm from '@atlaspack/workers'; import nullthrows from 'nullthrows'; import {BuildAbortError} from './utils'; -import {loadParcelConfig} from './requests/ParcelConfigRequest'; +import {loadAtlaspackConfig} from './requests/AtlaspackConfigRequest'; import ReporterRunner from './ReporterRunner'; import dumpGraphToGraphViz from './dumpGraphToGraphViz'; import resolveOptions from './resolveOptions'; -import {ValueEmitter} from '@parcel/events'; +import {ValueEmitter} from '@atlaspack/events'; import {registerCoreWithSerializer} from './registerCoreWithSerializer'; -import {PromiseQueue} from '@parcel/utils'; -import ParcelConfig from './ParcelConfig'; -import logger from '@parcel/logger'; +import {PromiseQueue} from '@atlaspack/utils'; +import AtlaspackConfig from './AtlaspackConfig'; +import logger from '@atlaspack/logger'; import RequestTracker, { getWatcherOptions, requestGraphEdgeTypes, } from './RequestTracker'; import createValidationRequest from './requests/ValidationRequest'; -import createParcelBuildRequest from './requests/ParcelBuildRequest'; +import createAtlaspackBuildRequest from './requests/AtlaspackBuildRequest'; import createAssetRequest from './requests/AssetRequest'; import createPathRequest from './requests/PathRequest'; import {createEnvironment} from './Environment'; import {createDependency} from './Dependency'; -import {Disposable} from '@parcel/events'; +import {Disposable} from '@atlaspack/events'; import {init as initSourcemaps} from '@parcel/source-map'; import { init as initRust, initializeMonitoring, closeMonitoring, -} from '@parcel/rust'; +} from '@atlaspack/rust'; import { fromProjectPath, toProjectPath, fromProjectPathRelative, } from './projectPath'; -import {tracer} from '@parcel/profiler'; -import {setFeatureFlags} from '@parcel/feature-flags'; -import {ParcelV3, toFileSystemV3} from './parcel-v3'; +import {tracer} from '@atlaspack/profiler'; +import {setFeatureFlags} from '@atlaspack/feature-flags'; +import {AtlaspackV3, toFileSystemV3} from './atlaspack-v3'; registerCoreWithSerializer(); export const INTERNAL_TRANSFORM: symbol = Symbol('internal_transform'); export const INTERNAL_RESOLVE: symbol = Symbol('internal_resolve'); -export default class Parcel { +export default class Atlaspack { #requestTracker /*: RequestTracker*/; - #config /*: ParcelConfig*/; + #config /*: AtlaspackConfig*/; #farm /*: WorkerFarm*/; #initialized /*: boolean*/ = false; #disposable /*: Disposable */; - #initialOptions /*: InitialParcelOptions */; - #parcelV3: ParcelV3; + #initialOptions /*: InitialAtlaspackOptions */; + #atlaspackV3: AtlaspackV3; #reporterRunner /*: ReporterRunner*/; - #resolvedOptions /*: ?ParcelOptions*/ = null; + #resolvedOptions /*: ?AtlaspackOptions*/ = null; #optionsRef /*: SharedReference */; #watchAbortController /*: AbortController*/; #watchQueue /*: PromiseQueue*/ = new PromiseQueue({ @@ -96,7 +96,7 @@ export default class Parcel { isProfiling /*: boolean */; - constructor(options: InitialParcelOptions) { + constructor(options: InitialAtlaspackOptions) { this.#initialOptions = options; } @@ -117,17 +117,17 @@ export default class Parcel { logger.warn(e); } - let resolvedOptions: ParcelOptions = await resolveOptions( + let resolvedOptions: AtlaspackOptions = await resolveOptions( this.#initialOptions, ); this.#resolvedOptions = resolvedOptions; - let rustParcel: ParcelV3; - if (resolvedOptions.featureFlags.parcelV3) { + let rustAtlaspack: AtlaspackV3; + if (resolvedOptions.featureFlags.atlaspackV3) { // eslint-disable-next-line no-unused-vars let {entries, inputFS, outputFS, ...options} = this.#initialOptions; - rustParcel = new ParcelV3({ + rustAtlaspack = new AtlaspackV3({ ...options, corePath: path.join(__dirname, '..'), entries: Array.isArray(entries) @@ -139,8 +139,8 @@ export default class Parcel { }); } - let {config} = await loadParcelConfig(resolvedOptions); - this.#config = new ParcelConfig(config, resolvedOptions); + let {config} = await loadAtlaspackConfig(resolvedOptions); + this.#config = new AtlaspackConfig(config, resolvedOptions); setFeatureFlags(resolvedOptions.featureFlags); @@ -165,7 +165,7 @@ export default class Parcel { this.#disposable = new Disposable(); if (this.#initialOptions.workerFarm) { // If we don't own the farm, dispose of only these references when - // Parcel ends. + // Atlaspack ends. this.#disposable.add(disposeOptions); } else { // Otherwise, when shutting down, end the entire farm we created. @@ -183,14 +183,14 @@ export default class Parcel { this.#disposable.add(this.#reporterRunner); logger.verbose({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: 'Intializing request tracker...', }); this.#requestTracker = await RequestTracker.init({ farm: this.#farm, options: resolvedOptions, - rustParcel, + rustAtlaspack, }); this.#initialized = true; @@ -345,7 +345,7 @@ export default class Parcel { this.#requestTracker.graph.invalidateOnBuildNodes(); - let request = createParcelBuildRequest({ + let request = createAtlaspackBuildRequest({ optionsRef: this.#optionsRef, requestedAssetIds: this.#requestedAssetIds, signal, @@ -496,40 +496,43 @@ export default class Parcel { } // This is mainly for integration tests and it not public api! - _getResolvedParcelOptions(): ParcelOptions { + _getResolvedAtlaspackOptions(): AtlaspackOptions { return nullthrows( this.#resolvedOptions, - 'Resolved options is null, please let parcel initialize before accessing this.', + 'Resolved options is null, please let atlaspack initialize before accessing this.', ); } async startProfiling(): Promise { if (this.isProfiling) { - throw new Error('Parcel is already profiling'); + throw new Error('Atlaspack is already profiling'); } - logger.info({origin: '@parcel/core', message: 'Starting profiling...'}); + logger.info({origin: '@atlaspack/core', message: 'Starting profiling...'}); this.isProfiling = true; await this.#farm.startProfile(); } stopProfiling(): Promise { if (!this.isProfiling) { - throw new Error('Parcel is not profiling'); + throw new Error('Atlaspack is not profiling'); } - logger.info({origin: '@parcel/core', message: 'Stopping profiling...'}); + logger.info({origin: '@atlaspack/core', message: 'Stopping profiling...'}); this.isProfiling = false; return this.#farm.endProfile(); } takeHeapSnapshot(): Promise { - logger.info({origin: '@parcel/core', message: 'Taking heap snapshot...'}); + logger.info({ + origin: '@atlaspack/core', + message: 'Taking heap snapshot...', + }); return this.#farm.takeHeapSnapshot(); } async unstable_transform( - options: ParcelTransformOptions, + options: AtlaspackTransformOptions, ): Promise> { if (!this.#initialized) { await this._init(); @@ -561,8 +564,8 @@ export default class Parcel { } async unstable_resolve( - request: ParcelResolveOptions, - ): Promise { + request: AtlaspackResolveOptions, + ): Promise { if (!this.#initialized) { await this._init(); } @@ -623,7 +626,7 @@ export function createWorkerFarm( ...options, // $FlowFixMe workerPath: process.browser - ? '@parcel/core/src/worker.js' + ? '@atlaspack/core/src/worker.js' : require.resolve('./worker'), }); } diff --git a/packages/core/core/src/ParcelConfig.js b/packages/core/core/src/AtlaspackConfig.js similarity index 83% rename from packages/core/core/src/ParcelConfig.js rename to packages/core/core/src/AtlaspackConfig.js index 3895f0ce0..e25df3c7b 100644 --- a/packages/core/core/src/ParcelConfig.js +++ b/packages/core/core/src/AtlaspackConfig.js @@ -15,23 +15,23 @@ import type { SemverRange, Validator, FilePath, -} from '@parcel/types'; +} from '@atlaspack/types'; import type { - ProcessedParcelConfig, - ParcelPluginNode, - PureParcelConfigPipeline, - ExtendableParcelConfigPipeline, - ParcelOptions, + ProcessedAtlaspackConfig, + AtlaspackPluginNode, + PureAtlaspackConfigPipeline, + ExtendableAtlaspackConfigPipeline, + AtlaspackOptions, } from './types'; import ThrowableDiagnostic, { md, generateJSONCodeHighlights, -} from '@parcel/diagnostic'; +} from '@atlaspack/diagnostic'; import json5 from 'json5'; -import {globToRegex} from '@parcel/utils'; +import {globToRegex} from '@atlaspack/utils'; import {basename} from 'path'; -import loadPlugin from './loadParcelPlugin'; +import loadPlugin from './loadAtlaspackPlugin'; import { type ProjectPath, fromProjectPath, @@ -40,10 +40,10 @@ import { } from './projectPath'; type GlobMap = {[Glob]: T, ...}; -type SerializedParcelConfig = {| +type SerializedAtlaspackConfig = {| $$raw: boolean, - config: ProcessedParcelConfig, - options: ParcelOptions, + config: ProcessedAtlaspackConfig, + options: AtlaspackOptions, |}; export type LoadedPlugin = {| @@ -55,23 +55,23 @@ export type LoadedPlugin = {| range?: ?SemverRange, |}; -export default class ParcelConfig { - options: ParcelOptions; +export default class AtlaspackConfig { + options: AtlaspackOptions; filePath: ProjectPath; - resolvers: PureParcelConfigPipeline; - transformers: GlobMap; - bundler: ?ParcelPluginNode; - namers: PureParcelConfigPipeline; - runtimes: PureParcelConfigPipeline; - packagers: GlobMap; - validators: GlobMap; - optimizers: GlobMap; - compressors: GlobMap; - reporters: PureParcelConfigPipeline; + resolvers: PureAtlaspackConfigPipeline; + transformers: GlobMap; + bundler: ?AtlaspackPluginNode; + namers: PureAtlaspackConfigPipeline; + runtimes: PureAtlaspackConfigPipeline; + packagers: GlobMap; + validators: GlobMap; + optimizers: GlobMap; + compressors: GlobMap; + reporters: PureAtlaspackConfigPipeline; pluginCache: Map; regexCache: Map; - constructor(config: ProcessedParcelConfig, options: ParcelOptions) { + constructor(config: ProcessedAtlaspackConfig, options: AtlaspackOptions) { this.options = options; this.filePath = config.filePath; this.resolvers = config.resolvers || []; @@ -88,11 +88,11 @@ export default class ParcelConfig { this.regexCache = new Map(); } - static deserialize(serialized: SerializedParcelConfig): ParcelConfig { - return new ParcelConfig(serialized.config, serialized.options); + static deserialize(serialized: SerializedAtlaspackConfig): AtlaspackConfig { + return new AtlaspackConfig(serialized.config, serialized.options); } - getConfig(): ProcessedParcelConfig { + getConfig(): ProcessedAtlaspackConfig { return { filePath: this.filePath, resolvers: this.resolvers, @@ -108,7 +108,7 @@ export default class ParcelConfig { }; } - serialize(): SerializedParcelConfig { + serialize(): SerializedAtlaspackConfig { return { $$raw: false, config: this.getConfig(), @@ -116,7 +116,7 @@ export default class ParcelConfig { }; } - _loadPlugin(node: ParcelPluginNode): Promise<{| + _loadPlugin(node: AtlaspackPluginNode): Promise<{| plugin: T, version: Semver, resolveFrom: ProjectPath, @@ -138,7 +138,7 @@ export default class ParcelConfig { return plugin; } - async loadPlugin(node: ParcelPluginNode): Promise> { + async loadPlugin(node: AtlaspackPluginNode): Promise> { let plugin = await this._loadPlugin(node); return { ...plugin, @@ -152,7 +152,7 @@ export default class ParcelConfig { } loadPlugins( - plugins: PureParcelConfigPipeline, + plugins: PureAtlaspackConfigPipeline, ): Promise>> { return Promise.all(plugins.map(p => this.loadPlugin(p))); } @@ -161,7 +161,7 @@ export default class ParcelConfig { if (this.resolvers.length === 0) { throw await this.missingPluginError( this.resolvers, - 'No resolver plugins specified in .parcelrc config', + 'No resolver plugins specified in .atlaspackrc config', '/resolvers', ); } @@ -169,15 +169,17 @@ export default class ParcelConfig { return this.loadPlugins>(this.resolvers); } - _getValidatorNodes(filePath: ProjectPath): $ReadOnlyArray { - let validators: PureParcelConfigPipeline = + _getValidatorNodes( + filePath: ProjectPath, + ): $ReadOnlyArray { + let validators: PureAtlaspackConfigPipeline = this.matchGlobMapPipelines(filePath, this.validators) || []; return validators; } getValidatorNames(filePath: ProjectPath): Array { - let validators: PureParcelConfigPipeline = + let validators: PureAtlaspackConfigPipeline = this._getValidatorNodes(filePath); return validators.map(v => v.packageName); } @@ -200,7 +202,7 @@ export default class ParcelConfig { pipeline?: ?string, allowEmpty?: boolean, ): Promise>>> { - let transformers: PureParcelConfigPipeline | null = + let transformers: PureAtlaspackConfigPipeline | null = this.matchGlobMapPipelines(filePath, this.transformers, pipeline); if (!transformers || transformers.length === 0) { if (allowEmpty) { @@ -223,7 +225,7 @@ export default class ParcelConfig { if (!this.bundler) { throw await this.missingPluginError( [], - 'No bundler specified in .parcelrc config', + 'No bundler specified in .atlaspackrc config', '/bundler', ); } @@ -235,7 +237,7 @@ export default class ParcelConfig { if (this.namers.length === 0) { throw await this.missingPluginError( this.namers, - 'No namer plugins specified in .parcelrc config', + 'No namer plugins specified in .atlaspackrc config', '/namers', ); } @@ -271,7 +273,7 @@ export default class ParcelConfig { _getOptimizerNodes( filePath: FilePath, pipeline: ?string, - ): PureParcelConfigPipeline { + ): PureAtlaspackConfigPipeline { // If a pipeline is specified, but it doesn't exist in the optimizers config, ignore it. // Pipelines for bundles come from their entry assets, so the pipeline likely exists in transformers. if (pipeline) { @@ -369,9 +371,9 @@ export default class ParcelConfig { matchGlobMapPipelines( filePath: ProjectPath, - globMap: {|[Glob]: ExtendableParcelConfigPipeline|}, + globMap: {|[Glob]: ExtendableAtlaspackConfigPipeline|}, pipeline?: ?string, - ): PureParcelConfigPipeline { + ): PureAtlaspackConfigPipeline { let matches = []; if (pipeline) { // If a pipeline is requested, a the glob needs to match exactly @@ -422,9 +424,9 @@ export default class ParcelConfig { async missingPluginError( plugins: - | GlobMap - | GlobMap - | PureParcelConfigPipeline, + | GlobMap + | GlobMap + | PureAtlaspackConfigPipeline, message: string, key: string, ): Promise { @@ -469,9 +471,9 @@ export default class ParcelConfig { return new ThrowableDiagnostic({ diagnostic: { message, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames, - hints: !seenKey ? ['Try extending __@parcel/config-default__'] : [], + hints: !seenKey ? ['Try extending __@atlaspack/config-default__'] : [], }, }); } diff --git a/packages/core/core/src/ParcelConfig.schema.js b/packages/core/core/src/AtlaspackConfig.schema.js similarity index 75% rename from packages/core/core/src/ParcelConfig.schema.js rename to packages/core/core/src/AtlaspackConfig.schema.js index 05249ec2e..2e57532a0 100644 --- a/packages/core/core/src/ParcelConfig.schema.js +++ b/packages/core/core/src/AtlaspackConfig.schema.js @@ -1,6 +1,6 @@ // @flow strict-local -import type {PackageName} from '@parcel/types'; -import type {SchemaEntity} from '@parcel/utils'; +import type {PackageName} from '@atlaspack/types'; +import type {SchemaEntity} from '@atlaspack/utils'; import assert from 'assert'; // Reasoning behind this validation: @@ -17,22 +17,25 @@ export function validatePackageName( assert(typeof pkg === 'string', `"${key}" must be a string`); - if (pkg.startsWith('@parcel')) { + if (pkg.startsWith('@atlaspack')) { assert( - pkg.replace(/^@parcel\//, '').startsWith(`${pluginType}-`), - `Official parcel ${pluginType} packages must be named according to "@parcel/${pluginType}-{name}"`, + pkg.replace(/^@atlaspack\//, '').startsWith(`${pluginType}-`), + `Official atlaspack ${pluginType} packages must be named according to "@atlaspack/${pluginType}-{name}"`, ); } else if (pkg.startsWith('@')) { - let [scope, name] = pkg.split('/'); - assert( - name.startsWith(`parcel-${pluginType}-`) || - name === `parcel-${pluginType}`, - `Scoped parcel ${pluginType} packages must be named according to "${scope}/parcel-${pluginType}[-{name}]"`, - ); + // Disabling this validation to allow for migration to atlaspack + // let [scope, name] = pkg.split('/'); + // assert( + // name.startsWith(`atlaspack-${pluginType}-`) || + // name === `atlaspack-${pluginType}` || + // name.startsWith(`parcel-${pluginType}-`) || + // name === `parcel-${pluginType}`, + // `Scoped atlaspack ${pluginType} packages must be named according to "${scope}/atlaspack-${pluginType}[-{name}]"`, + // ); } else if (!pkg.startsWith('.')) { assert( - pkg.startsWith(`parcel-${pluginType}-`), - `Parcel ${pluginType} packages must be named according to "parcel-${pluginType}-{name}"`, + pkg.startsWith(`atlaspack-${pluginType}-`), + `Atlaspack ${pluginType} packages must be named according to "atlaspack-${pluginType}-{name}"`, ); } } diff --git a/packages/core/core/src/BundleGraph.js b/packages/core/core/src/BundleGraph.js index 5b9972083..cddd95423 100644 --- a/packages/core/core/src/BundleGraph.js +++ b/packages/core/core/src/BundleGraph.js @@ -6,13 +6,13 @@ import type { Symbol, TraversalActions, BundleBehavior as IBundleBehavior, -} from '@parcel/types'; +} from '@atlaspack/types'; import type { ContentKey, ContentGraphOpts, NodeId, SerializedContentGraph, -} from '@parcel/graph'; +} from '@atlaspack/graph'; import type { Asset, @@ -33,9 +33,13 @@ import type {ProjectPath} from './projectPath'; import assert from 'assert'; import invariant from 'assert'; import nullthrows from 'nullthrows'; -import {ContentGraph, ALL_EDGE_TYPES, mapVisitor} from '@parcel/graph'; -import {Hash, hashString} from '@parcel/rust'; -import {DefaultMap, objectSortedEntriesDeep, getRootDir} from '@parcel/utils'; +import {ContentGraph, ALL_EDGE_TYPES, mapVisitor} from '@atlaspack/graph'; +import {Hash, hashString} from '@atlaspack/rust'; +import { + DefaultMap, + objectSortedEntriesDeep, + getRootDir, +} from '@atlaspack/utils'; import {Priority, BundleBehavior, SpecifierType} from './types'; import {getBundleGroupId, getPublicId} from './utils'; @@ -242,11 +246,11 @@ export default class BundleGraph { // code being generated). !node.usedSymbolsUp.has('*') && // TODO We currently can't rename imports in async imports, e.g. from - // (parcelRequire("...")).then(({ a }) => a); + // (atlaspackRequire("...")).then(({ a }) => a); // to - // (parcelRequire("...")).then(({ a: b }) => a); + // (atlaspackRequire("...")).then(({ a: b }) => a); // or - // (parcelRequire("...")).then((a)=>a); + // (atlaspackRequire("...")).then((a)=>a); // if the reexporting asset did `export {a as b}` or `export * as a` node.value.priority === Priority.sync && // For every asset, no symbol is imported multiple times (with a different local name). diff --git a/packages/core/core/src/CommittedAsset.js b/packages/core/core/src/CommittedAsset.js index 8a9d7c420..69fd70af4 100644 --- a/packages/core/core/src/CommittedAsset.js +++ b/packages/core/core/src/CommittedAsset.js @@ -1,18 +1,18 @@ // @flow strict-local -import type {AST, Blob} from '@parcel/types'; -import type {Asset, Dependency, ParcelOptions} from './types'; +import type {AST, Blob} from '@atlaspack/types'; +import type {Asset, Dependency, AtlaspackOptions} from './types'; import {Readable} from 'stream'; import SourceMap from '@parcel/source-map'; -import {bufferStream, blobToStream, streamFromPromise} from '@parcel/utils'; +import {bufferStream, blobToStream, streamFromPromise} from '@atlaspack/utils'; import {generateFromAST} from './assetUtils'; import {deserializeRaw} from './serializer'; export default class CommittedAsset { key: ?string; value: Asset; - options: ParcelOptions; + options: AtlaspackOptions; content: ?Promise; mapBuffer: ?Promise; map: ?Promise; @@ -20,7 +20,7 @@ export default class CommittedAsset { idBase: ?string; generatingPromise: ?Promise; - constructor(value: Asset, options: ParcelOptions) { + constructor(value: Asset, options: AtlaspackOptions) { this.value = value; this.key = this.value.contentKey; this.options = options; diff --git a/packages/core/core/src/Dependency.js b/packages/core/core/src/Dependency.js index 588ccedda..0595bb311 100644 --- a/packages/core/core/src/Dependency.js +++ b/packages/core/core/src/Dependency.js @@ -7,9 +7,9 @@ import type { Symbol, BundleBehavior as IBundleBehavior, SemverRange, -} from '@parcel/types'; +} from '@atlaspack/types'; import type {Dependency, Environment, Target} from './types'; -import {hashString} from '@parcel/rust'; +import {hashString} from '@atlaspack/rust'; import { SpecifierType, Priority, diff --git a/packages/core/core/src/Environment.js b/packages/core/core/src/Environment.js index 2c471350d..edd6f6c9f 100644 --- a/packages/core/core/src/Environment.js +++ b/packages/core/core/src/Environment.js @@ -3,9 +3,9 @@ import type { EnvironmentOptions, Environment as IEnvironment, FilePath, -} from '@parcel/types'; +} from '@atlaspack/types'; import type {Environment, InternalSourceLocation} from './types'; -import {hashString} from '@parcel/rust'; +import {hashString} from '@atlaspack/rust'; import {toInternalSourceLocation} from './utils'; import PublicEnvironment from './public/Environment'; import {environmentToInternalEnvironment} from './public/Environment'; diff --git a/packages/core/core/src/InternalConfig.js b/packages/core/core/src/InternalConfig.js index 29bbfac4a..dbee76681 100644 --- a/packages/core/core/src/InternalConfig.js +++ b/packages/core/core/src/InternalConfig.js @@ -1,6 +1,6 @@ // @flow strict-local -import type {PackageName, ConfigResult} from '@parcel/types'; +import type {PackageName, ConfigResult} from '@atlaspack/types'; import type { Config, Environment, @@ -11,7 +11,7 @@ import type {ProjectPath} from './projectPath'; import {fromProjectPathRelative} from './projectPath'; import {createEnvironment} from './Environment'; -import {hashString} from '@parcel/rust'; +import {hashString} from '@atlaspack/rust'; type ConfigOpts = {| plugin: PackageName, diff --git a/packages/core/core/src/PackagerRunner.js b/packages/core/core/src/PackagerRunner.js index a7dc9ac27..65b6b43a0 100644 --- a/packages/core/core/src/PackagerRunner.js +++ b/packages/core/core/src/PackagerRunner.js @@ -8,30 +8,30 @@ import type { BundleGraph as BundleGraphType, NamedBundle as NamedBundleType, Async, -} from '@parcel/types'; +} from '@atlaspack/types'; import type SourceMap from '@parcel/source-map'; import type { Bundle as InternalBundle, Config, DevDepRequest, - ParcelOptions, + AtlaspackOptions, ReportFn, RequestInvalidation, } from './types'; -import type ParcelConfig, {LoadedPlugin} from './ParcelConfig'; +import type AtlaspackConfig, {LoadedPlugin} from './AtlaspackConfig'; import type InternalBundleGraph from './BundleGraph'; import type {ConfigRequest} from './requests/ConfigRequest'; import type {DevDepSpecifier} from './requests/DevDepRequest'; import invariant from 'assert'; -import {blobToStream, TapStream} from '@parcel/utils'; -import {PluginLogger} from '@parcel/logger'; -import ThrowableDiagnostic, {errorToDiagnostic} from '@parcel/diagnostic'; +import {blobToStream, TapStream} from '@atlaspack/utils'; +import {PluginLogger} from '@atlaspack/logger'; +import ThrowableDiagnostic, {errorToDiagnostic} from '@atlaspack/diagnostic'; import {Readable} from 'stream'; import nullthrows from 'nullthrows'; import path from 'path'; import url from 'url'; -import {hashString, hashBuffer, Hash} from '@parcel/rust'; +import {hashString, hashBuffer, Hash} from '@atlaspack/rust'; import {NamedBundle, bundleToInternalBundle} from './public/Bundle'; import BundleGraph, { @@ -39,7 +39,7 @@ import BundleGraph, { } from './public/BundleGraph'; import PluginOptions from './public/PluginOptions'; import PublicConfig from './public/Config'; -import {PARCEL_VERSION, HASH_REF_PREFIX, HASH_REF_REGEX} from './constants'; +import {ATLASPACK_VERSION, HASH_REF_PREFIX, HASH_REF_REGEX} from './constants'; import { fromProjectPath, toProjectPathUnsafe, @@ -61,11 +61,11 @@ import {createBuildCache} from './buildCache'; import {getInvalidationId, getInvalidationHash} from './assetUtils'; import {optionsProxy} from './utils'; import {invalidateDevDeps} from './requests/DevDepRequest'; -import {tracer, PluginTracer} from '@parcel/profiler'; +import {tracer, PluginTracer} from '@atlaspack/profiler'; type Opts = {| - config: ParcelConfig, - options: ParcelOptions, + config: AtlaspackConfig, + options: AtlaspackOptions, report: ReportFn, previousDevDeps: Map, previousInvalidations: Array, @@ -101,8 +101,8 @@ const BOUNDARY_LENGTH = HASH_REF_PREFIX.length + 32 - 1; const pluginConfigs = createBuildCache(); export default class PackagerRunner { - config: ParcelConfig; - options: ParcelOptions; + config: AtlaspackConfig; + options: AtlaspackOptions; pluginOptions: PluginOptions; distDir: FilePath; distExists: Set; @@ -586,7 +586,7 @@ export default class PackagerRunner { this.options.serveOptions && bundle.target.env.context === 'browser' ) { - sourceRoot = '/__parcel_source_root'; + sourceRoot = '/__atlaspack_source_root'; } if ( @@ -658,7 +658,7 @@ export default class PackagerRunner { ); return hashString( - PARCEL_VERSION + + ATLASPACK_VERSION + devDepHashes + invalidationHash + bundle.target.publicUrl + diff --git a/packages/core/core/src/ReporterRunner.js b/packages/core/core/src/ReporterRunner.js index 8adfc39bc..d33642790 100644 --- a/packages/core/core/src/ReporterRunner.js +++ b/packages/core/core/src/ReporterRunner.js @@ -1,9 +1,9 @@ // @flow strict-local -import type {ReporterEvent, Reporter} from '@parcel/types'; -import type {WorkerApi} from '@parcel/workers'; -import type {Bundle as InternalBundle, ParcelOptions} from './types'; -import type {LoadedPlugin} from './ParcelConfig'; +import type {ReporterEvent, Reporter} from '@atlaspack/types'; +import type {WorkerApi} from '@atlaspack/workers'; +import type {Bundle as InternalBundle, AtlaspackOptions} from './types'; +import type {LoadedPlugin} from './AtlaspackConfig'; import invariant from 'assert'; import { @@ -11,20 +11,20 @@ import { bundleToInternalBundleGraph, NamedBundle, } from './public/Bundle'; -import WorkerFarm, {bus} from '@parcel/workers'; +import WorkerFarm, {bus} from '@atlaspack/workers'; import logger, { patchConsole, unpatchConsole, PluginLogger, INTERNAL_ORIGINAL_CONSOLE, -} from '@parcel/logger'; +} from '@atlaspack/logger'; import PluginOptions from './public/PluginOptions'; import BundleGraph from './BundleGraph'; -import {tracer, PluginTracer} from '@parcel/profiler'; -import {anyToDiagnostic} from '@parcel/diagnostic'; +import {tracer, PluginTracer} from '@atlaspack/profiler'; +import {anyToDiagnostic} from '@atlaspack/diagnostic'; type Opts = {| - options: ParcelOptions, + options: AtlaspackOptions, reporters: Array>, workerFarm: WorkerFarm, |}; @@ -34,7 +34,7 @@ const instances: Set = new Set(); export default class ReporterRunner { workerFarm: WorkerFarm; errors: Error[]; - options: ParcelOptions; + options: AtlaspackOptions; pluginOptions: PluginOptions; reporters: Array>; diff --git a/packages/core/core/src/RequestTracker.js b/packages/core/core/src/RequestTracker.js index a60f6e8f6..5c9cb7169 100644 --- a/packages/core/core/src/RequestTracker.js +++ b/packages/core/core/src/RequestTracker.js @@ -3,30 +3,30 @@ import invariant, {AssertionError} from 'assert'; import path from 'path'; -import type {Cache} from '@parcel/cache'; -import {ContentGraph} from '@parcel/graph'; +import type {Cache} from '@atlaspack/cache'; +import {ContentGraph} from '@atlaspack/graph'; import type { ContentGraphOpts, ContentKey, NodeId, SerializedContentGraph, -} from '@parcel/graph'; -import logger from '@parcel/logger'; -import {hashString} from '@parcel/rust'; -import type {Async, EnvMap} from '@parcel/types'; +} from '@atlaspack/graph'; +import logger from '@atlaspack/logger'; +import {hashString} from '@atlaspack/rust'; +import type {Async, EnvMap} from '@atlaspack/types'; import { type Deferred, isGlobMatch, isDirectoryInside, makeDeferredWithPromise, PromiseQueue, -} from '@parcel/utils'; +} from '@atlaspack/utils'; import type {Options as WatcherOptions, Event} from '@parcel/watcher'; -import type WorkerFarm from '@parcel/workers'; +import type WorkerFarm from '@atlaspack/workers'; import nullthrows from 'nullthrows'; import { - PARCEL_VERSION, + ATLASPACK_VERSION, VALID, INITIAL_BUILD, FILE_CREATE, @@ -37,7 +37,7 @@ import { STARTUP, ERROR, } from './constants'; -import type {ParcelV3} from './parcel-v3/ParcelV3'; +import type {AtlaspackV3} from './atlaspack-v3/AtlaspackV3'; import { type ProjectPath, fromProjectPathRelative, @@ -54,14 +54,14 @@ import type {WriteBundlesRequestResult} from './requests/WriteBundlesRequest'; import type {WriteBundleRequestResult} from './requests/WriteBundleRequest'; import type {TargetRequestResult} from './requests/TargetRequest'; import type {PathRequestResult} from './requests/PathRequest'; -import type {ParcelConfigRequestResult} from './requests/ParcelConfigRequest'; -import type {ParcelBuildRequestResult} from './requests/ParcelBuildRequest'; +import type {AtlaspackConfigRequestResult} from './requests/AtlaspackConfigRequest'; +import type {AtlaspackBuildRequestResult} from './requests/AtlaspackBuildRequest'; import type {EntryRequestResult} from './requests/EntryRequest'; import type {BundleGraphResult} from './requests/BundleGraphRequest'; import {deserialize, serialize} from './serializer'; import type { AssetRequestResult, - ParcelOptions, + AtlaspackOptions, RequestInvalidation, InternalFileCreateInvalidation, InternalGlob, @@ -161,8 +161,8 @@ export type RequestResult = | WriteBundleRequestResult | TargetRequestResult | PathRequestResult - | ParcelConfigRequestResult - | ParcelBuildRequestResult + | AtlaspackConfigRequestResult + | AtlaspackBuildRequestResult | EntryRequestResult | BundleGraphResult | AssetRequestResult; @@ -179,12 +179,12 @@ type RequestNode = {| |}; export const requestTypes = { - parcel_build_request: 1, + atlaspack_build_request: 1, bundle_graph_request: 2, asset_graph_request: 3, entry_request: 4, target_request: 5, - parcel_config_request: 6, + atlaspack_config_request: 6, path_request: 7, dev_dep_request: 8, asset_request: 9, @@ -241,8 +241,8 @@ export type StaticRunOpts = {| api: RunAPI, farm: WorkerFarm, invalidateReason: InvalidateReason, - options: ParcelOptions, - rustParcel: ?ParcelV3, + options: AtlaspackOptions, + rustAtlaspack: ?AtlaspackV3, |}; const nodeFromFilePath = (filePath: ProjectPath): RequestGraphNode => ({ @@ -310,7 +310,7 @@ export class RequestGraph extends ContentGraph< envNodeIds: Set = new Set(); optionNodeIds: Set = new Set(); // Unpredictable nodes are requests that cannot be predicted whether they should rerun based on - // filesystem changes alone. They should rerun on each startup of Parcel. + // filesystem changes alone. They should rerun on each startup of Atlaspack. unpredicatableNodeIds: Set = new Set(); invalidateOnBuildNodeIds: Set = new Set(); cachedRequestChunks: Set = new Set(); @@ -476,7 +476,7 @@ export class RequestGraph extends ContentGraph< } } - invalidateOptionNodes(options: ParcelOptions) { + invalidateOptionNodes(options: AtlaspackOptions) { for (let nodeId of this.optionNodeIds) { let node = nullthrows(this.getNode(nodeId)); invariant(node.type === OPTION); @@ -871,7 +871,7 @@ export class RequestGraph extends ContentGraph< async respondToFSEvents( events: Array, - options: ParcelOptions, + options: AtlaspackOptions, threshold: number, ): Async { let didInvalidate = false; @@ -885,7 +885,7 @@ export class RequestGraph extends ContentGraph< predictedTime = duration * (events.length >> 8); if (predictedTime > threshold) { logger.warn({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: 'Building with clean cache. Cache invalidation took too long.', meta: { @@ -909,7 +909,7 @@ export class RequestGraph extends ContentGraph< // re-run all requests. if (type === 'create' && filePath === '') { logger.verbose({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: 'Watcher reported project root create event. Invalidate all nodes.', meta: { @@ -1044,7 +1044,7 @@ export class RequestGraph extends ContentGraph< let duration = Date.now() - startTime; logger.verbose({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: `RequestGraph.respondToFSEvents duration: ${duration}`, meta: { trackableEvent: 'fsevent_response_time', @@ -1072,8 +1072,8 @@ export class RequestGraph extends ContentGraph< export default class RequestTracker { graph: RequestGraph; farm: WorkerFarm; - options: ParcelOptions; - rustParcel: ?ParcelV3; + options: AtlaspackOptions; + rustAtlaspack: ?AtlaspackV3; signal: ?AbortSignal; stats: Map = new Map(); @@ -1081,17 +1081,17 @@ export default class RequestTracker { graph, farm, options, - rustParcel, + rustAtlaspack, }: {| graph?: RequestGraph, farm: WorkerFarm, - options: ParcelOptions, - rustParcel?: ParcelV3, + options: AtlaspackOptions, + rustAtlaspack?: AtlaspackV3, |}) { this.graph = graph || new RequestGraph(); this.farm = farm; this.options = options; - this.rustParcel = rustParcel; + this.rustAtlaspack = rustAtlaspack; } // TODO: refactor (abortcontroller should be created by RequestTracker) @@ -1267,7 +1267,7 @@ export default class RequestTracker { farm: this.farm, invalidateReason: node.invalidateReason, options: this.options, - rustParcel: this.rustParcel, + rustAtlaspack: this.rustAtlaspack, }); assertSignalNotAborted(this.signal); @@ -1281,7 +1281,7 @@ export default class RequestTracker { request.type === requestTypes.dev_dep_request ) { logger.verbose({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: `Failed DevDepRequest`, meta: { trackableEvent: 'failed_dev_dep_request', @@ -1526,14 +1526,14 @@ export default class RequestTracker { static async init({ farm, options, - rustParcel, + rustAtlaspack, }: {| farm: WorkerFarm, - options: ParcelOptions, - rustParcel?: ParcelV3, + options: AtlaspackOptions, + rustAtlaspack?: AtlaspackV3, |}): Async { let graph = await loadRequestGraph(options); - return new RequestTracker({farm, graph, options, rustParcel}); + return new RequestTracker({farm, graph, options, rustAtlaspack}); } } @@ -1542,7 +1542,7 @@ export function getWatcherOptions({ cacheDir, watchDir, watchBackend, -}: ParcelOptions): WatcherOptions { +}: AtlaspackOptions): WatcherOptions { const vcsDirs = ['.git', '.hg']; const uniqueDirs = [...new Set([...watchIgnore, ...vcsDirs, cacheDir])]; const ignore = uniqueDirs.map(dir => path.resolve(watchDir, dir)); @@ -1552,7 +1552,7 @@ export function getWatcherOptions({ function getCacheKey(options) { return hashString( - `${PARCEL_VERSION}:${JSON.stringify(options.entries)}:${options.mode}:${ + `${ATLASPACK_VERSION}:${JSON.stringify(options.entries)}:${options.mode}:${ options.shouldBuildLazily ? 'lazy' : 'eager' }:${options.watchBackend ?? ''}`, ); @@ -1593,7 +1593,7 @@ export async function readAndDeserializeRequestGraph( ...serializedRequestGraph, nodes: (await Promise.all(nodePromises)).flat(), }), - // This is used inside parcel query for `.inspectCache` + // This is used inside atlaspack query for `.inspectCache` bufferLength, }; } @@ -1620,7 +1620,7 @@ async function loadRequestGraph(options): Async { timeout = setTimeout(() => { logger.warn({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: `Retrieving file system events since last build...\nThis can take upto a minute after branch changes or npm/yarn installs.`, }); }, 5000); @@ -1633,7 +1633,7 @@ async function loadRequestGraph(options): Async { clearTimeout(timeout); logger.verbose({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: `File system event count: ${events.length}`, meta: { trackableEvent: 'watcher_events_count', @@ -1666,7 +1666,7 @@ async function loadRequestGraph(options): Async { return new RequestGraph(); } function logErrorOnBailout( - options: ParcelOptions, + options: AtlaspackOptions, snapshotPath: string, e: Error, ): void { @@ -1676,7 +1676,7 @@ function logErrorOnBailout( 'utf-8', ); logger.warn({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: `Error reading clockspec from snapshot, building with clean cache.`, meta: { snapshotContents: snapshotContents, @@ -1685,7 +1685,7 @@ function logErrorOnBailout( }); } else if (!(e instanceof FSBailoutError)) { logger.warn({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: `Unexpected error loading cache from disk, building with clean cache.`, meta: { errorMessage: e.message, diff --git a/packages/core/core/src/SymbolPropagation.js b/packages/core/core/src/SymbolPropagation.js index 7bac77187..aee870ff1 100644 --- a/packages/core/core/src/SymbolPropagation.js +++ b/packages/core/core/src/SymbolPropagation.js @@ -1,21 +1,21 @@ // @flow -import type {ContentKey, NodeId} from '@parcel/graph'; -import type {Meta, Symbol} from '@parcel/types'; -import type {Diagnostic} from '@parcel/diagnostic'; +import type {ContentKey, NodeId} from '@atlaspack/graph'; +import type {Meta, Symbol} from '@atlaspack/types'; +import type {Diagnostic} from '@atlaspack/diagnostic'; import type { AssetNode, DependencyNode, InternalSourceLocation, - ParcelOptions, + AtlaspackOptions, } from './types'; import {type default as AssetGraph} from './AssetGraph'; import invariant from 'assert'; import nullthrows from 'nullthrows'; -import {setEqual} from '@parcel/utils'; -import logger from '@parcel/logger'; -import {md, convertSourceLocationToHighlight} from '@parcel/diagnostic'; +import {setEqual} from '@atlaspack/utils'; +import logger from '@atlaspack/logger'; +import {md, convertSourceLocationToHighlight} from '@atlaspack/diagnostic'; import {BundleBehavior} from './types'; import {fromProjectPathRelative, fromProjectPath} from './projectPath'; @@ -26,7 +26,7 @@ export function propagateSymbols({ assetGroupsWithRemovedParents, previousErrors, }: {| - options: ParcelOptions, + options: AtlaspackOptions, assetGraph: AssetGraph, changedAssetsPropagation: Set, assetGroupsWithRemovedParents: Set, @@ -242,7 +242,7 @@ export function propagateSymbols({ }" or "${ depNode2.value.specifier }" at runtime. Adding a namespace object to fall back on.`, - origin: '@parcel/core', + origin: '@atlaspack/core', }); } }; @@ -436,7 +436,7 @@ export function propagateSymbols({ message: md`${fromProjectPathRelative( resolution.value.filePath, )} does not export '${s}'`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: loc ? [ { diff --git a/packages/core/core/src/TargetDescriptor.schema.js b/packages/core/core/src/TargetDescriptor.schema.js index 02d93b5ff..f12822dff 100644 --- a/packages/core/core/src/TargetDescriptor.schema.js +++ b/packages/core/core/src/TargetDescriptor.schema.js @@ -1,5 +1,5 @@ // @flow strict-local -import type {SchemaEntity, SchemaObject} from '@parcel/utils'; +import type {SchemaEntity, SchemaObject} from '@atlaspack/utils'; export const ENGINES_SCHEMA: SchemaEntity = { type: 'object', diff --git a/packages/core/core/src/Transformation.js b/packages/core/core/src/Transformation.js index ca25f703d..95c40f2e1 100644 --- a/packages/core/core/src/Transformation.js +++ b/packages/core/core/src/Transformation.js @@ -8,35 +8,35 @@ import type { PackageName, ResolveOptions, SemverRange, -} from '@parcel/types'; -import type {WorkerApi} from '@parcel/workers'; +} from '@atlaspack/types'; +import type {WorkerApi} from '@atlaspack/workers'; import type { Asset as AssetValue, TransformationRequest, Config, DevDepRequest, - ParcelOptions, + AtlaspackOptions, InternalDevDepOptions, Invalidations, } from './types'; -import type {LoadedPlugin} from './ParcelConfig'; +import type {LoadedPlugin} from './AtlaspackConfig'; import path from 'path'; import {Readable} from 'stream'; import nullthrows from 'nullthrows'; -import logger, {PluginLogger} from '@parcel/logger'; +import logger, {PluginLogger} from '@atlaspack/logger'; import ThrowableDiagnostic, { anyToDiagnostic, errorToDiagnostic, escapeMarkdown, md, type Diagnostic, -} from '@parcel/diagnostic'; -import {SOURCEMAP_EXTENSIONS} from '@parcel/utils'; -import {hashString} from '@parcel/rust'; +} from '@atlaspack/diagnostic'; +import {SOURCEMAP_EXTENSIONS} from '@atlaspack/utils'; +import {hashString} from '@atlaspack/rust'; import {createDependency} from './Dependency'; -import ParcelConfig from './ParcelConfig'; +import AtlaspackConfig from './AtlaspackConfig'; // TODO: eventually call path request as sub requests import {ResolverRunner} from './requests/PathRequest'; import { @@ -69,7 +69,7 @@ import { } from './projectPath'; import {invalidateOnFileCreateToInternal, createInvalidations} from './utils'; import invariant from 'assert'; -import {tracer, PluginTracer} from '@parcel/profiler'; +import {tracer, PluginTracer} from '@atlaspack/profiler'; type GenerateFunc = (input: UncommittedAsset) => Promise; @@ -78,8 +78,8 @@ type PostProcessFunc = ( ) => Promise | null>; export type TransformationOpts = {| - options: ParcelOptions, - config: ParcelConfig, + options: AtlaspackOptions, + config: AtlaspackConfig, request: TransformationRequest, workerApi: WorkerApi, |}; @@ -97,16 +97,16 @@ export default class Transformation { configs: Map; devDepRequests: Map; pluginDevDeps: Array; - options: ParcelOptions; + options: AtlaspackOptions; pluginOptions: PluginOptions; workerApi: WorkerApi; - parcelConfig: ParcelConfig; + atlaspackConfig: AtlaspackConfig; invalidations: Invalidations; resolverRunner: ResolverRunner; constructor({request, options, config, workerApi}: TransformationOpts) { this.configs = new Map(); - this.parcelConfig = config; + this.atlaspackConfig = config; this.options = options; this.request = request; this.workerApi = workerApi; @@ -143,13 +143,13 @@ export default class Transformation { } catch (err) { logger.verbose([ { - origin: '@parcel/core', + origin: '@atlaspack/core', message: md`Could not load existing source map for ${fromProjectPathRelative( asset.value.filePath, )}`, }, { - origin: '@parcel/core', + origin: '@atlaspack/core', message: escapeMarkdown(err.message), }, ]); @@ -171,7 +171,7 @@ export default class Transformation { invalidateDevDeps( this.request.invalidDevDeps, this.options, - this.parcelConfig, + this.atlaspackConfig, ); let pipeline = await this.loadPipeline( @@ -387,7 +387,7 @@ export default class Transformation { transformer.name, transformer.config, transformer.configKeyPath, - this.parcelConfig, + this.atlaspackConfig, ); measurement && measurement.end(); @@ -401,7 +401,7 @@ export default class Transformation { asset.createChildAsset( result, transformer.name, - this.parcelConfig.filePath, + this.atlaspackConfig.filePath, transformer.configKeyPath, ), ); @@ -475,7 +475,7 @@ export default class Transformation { isSource: boolean, pipeline: ?string, ): Promise { - let transformers = await this.parcelConfig.getTransformers( + let transformers = await this.atlaspackConfig.getTransformers( filePath, pipeline, this.request.isURL, @@ -567,7 +567,7 @@ export default class Transformation { transformerName: string, preloadedConfig: ?Config, configKeyPath?: string, - parcelConfig: ParcelConfig, + atlaspackConfig: AtlaspackConfig, ): Promise<$ReadOnlyArray> { const logger = new PluginLogger({origin: transformerName}); const tracer = new PluginTracer({ @@ -707,7 +707,7 @@ export default class Transformation { asset.createChildAsset( result, transformerName, - parcelConfig.filePath, + atlaspackConfig.filePath, // configKeyPath, ), ), @@ -722,7 +722,7 @@ export default class Transformation { type Pipeline = {| id: string, transformers: Array, - options: ParcelOptions, + options: AtlaspackOptions, pluginOptions: PluginOptions, workerApi: WorkerApi, postProcess?: PostProcessFunc, diff --git a/packages/core/core/src/UncommittedAsset.js b/packages/core/core/src/UncommittedAsset.js index 6ff5b13db..6f8af539f 100644 --- a/packages/core/core/src/UncommittedAsset.js +++ b/packages/core/core/src/UncommittedAsset.js @@ -8,8 +8,8 @@ import type { GenerateOutput, PackageName, TransformerResult, -} from '@parcel/types'; -import type {Asset, Dependency, ParcelOptions, Invalidations} from './types'; +} from '@atlaspack/types'; +import type {Asset, Dependency, AtlaspackOptions, Invalidations} from './types'; import invariant from 'assert'; import {Readable} from 'stream'; @@ -21,12 +21,12 @@ import { TapStream, loadSourceMap, SOURCEMAP_RE, -} from '@parcel/utils'; -import {hashString, hashBuffer, Hash} from '@parcel/rust'; +} from '@atlaspack/utils'; +import {hashString, hashBuffer, Hash} from '@atlaspack/rust'; import {serializeRaw} from './serializer'; import {createDependency, mergeDependencies} from './Dependency'; import {mergeEnvironments} from './Environment'; -import {PARCEL_VERSION} from './constants'; +import {ATLASPACK_VERSION} from './constants'; import {createAsset, createAssetIdFromOptions} from './assetUtils'; import {BundleBehaviorNames} from './types'; import {invalidateOnFileCreateToInternal, createInvalidations} from './utils'; @@ -34,7 +34,7 @@ import {type ProjectPath, fromProjectPath} from './projectPath'; type UncommittedAssetOptions = {| value: Asset, - options: ParcelOptions, + options: AtlaspackOptions, content?: ?Blob, mapBuffer?: ?Buffer, ast?: ?AST, @@ -45,7 +45,7 @@ type UncommittedAssetOptions = {| export default class UncommittedAsset { value: Asset; - options: ParcelOptions; + options: AtlaspackOptions; content: ?(Blob | Promise); mapBuffer: ?Buffer; sourceContent: ?string; @@ -296,7 +296,7 @@ export default class UncommittedAsset { } getCacheKey(key: string): string { - return hashString(PARCEL_VERSION + key + this.value.id); + return hashString(ATLASPACK_VERSION + key + this.value.id); } addDependency(opts: DependencyOptions): string { diff --git a/packages/core/core/src/Validation.js b/packages/core/core/src/Validation.js index ef26f077a..d2796d14a 100644 --- a/packages/core/core/src/Validation.js +++ b/packages/core/core/src/Validation.js @@ -1,32 +1,32 @@ // @flow strict-local -import type {WorkerApi} from '@parcel/workers'; -import type {AssetGroup, ParcelOptions, ReportFn} from './types'; -import type {Validator, ValidateResult} from '@parcel/types'; -import type {Diagnostic} from '@parcel/diagnostic'; +import type {WorkerApi} from '@atlaspack/workers'; +import type {AssetGroup, AtlaspackOptions, ReportFn} from './types'; +import type {Validator, ValidateResult} from '@atlaspack/types'; +import type {Diagnostic} from '@atlaspack/diagnostic'; import path from 'path'; -import {resolveConfig} from '@parcel/utils'; -import logger, {PluginLogger} from '@parcel/logger'; -import ThrowableDiagnostic, {errorToDiagnostic} from '@parcel/diagnostic'; -import ParcelConfig from './ParcelConfig'; +import {resolveConfig} from '@atlaspack/utils'; +import logger, {PluginLogger} from '@atlaspack/logger'; +import ThrowableDiagnostic, {errorToDiagnostic} from '@atlaspack/diagnostic'; +import AtlaspackConfig from './AtlaspackConfig'; import UncommittedAsset from './UncommittedAsset'; import {createAsset} from './assetUtils'; import {Asset} from './public/Asset'; import PluginOptions from './public/PluginOptions'; import summarizeRequest from './summarizeRequest'; import {fromProjectPath, fromProjectPathRelative} from './projectPath'; -import {PluginTracer} from '@parcel/profiler'; -import {hashString} from '@parcel/rust'; +import {PluginTracer} from '@atlaspack/profiler'; +import {hashString} from '@atlaspack/rust'; export type ValidationOpts = {| - config: ParcelConfig, + config: AtlaspackConfig, /** * If true, this Validation instance will run all validators that implement the single-threaded "validateAll" method. * If falsy, it will run validators that implement the one-asset-at-a-time "validate" method. */ dedicatedThread?: boolean, - options: ParcelOptions, + options: AtlaspackOptions, requests: AssetGroup[], report: ReportFn, workerApi?: WorkerApi, @@ -36,9 +36,9 @@ export default class Validation { allAssets: {[validatorName: string]: UncommittedAsset[], ...} = {}; allValidators: {[validatorName: string]: Validator, ...} = {}; dedicatedThread: boolean; - impactfulOptions: $Shape; - options: ParcelOptions; - parcelConfig: ParcelConfig; + impactfulOptions: $Shape; + options: AtlaspackOptions; + atlaspackConfig: AtlaspackConfig; report: ReportFn; requests: AssetGroup[]; workerApi: ?WorkerApi; @@ -53,7 +53,7 @@ export default class Validation { }: ValidationOpts) { this.dedicatedThread = dedicatedThread ?? false; this.options = options; - this.parcelConfig = config; + this.atlaspackConfig = config; this.report = report; this.requests = requests; this.workerApi = workerApi; @@ -151,7 +151,7 @@ export default class Validation { let asset = await this.loadAsset(request); - let validators = await this.parcelConfig.getValidators( + let validators = await this.atlaspackConfig.getValidators( request.filePath, ); diff --git a/packages/core/core/src/applyRuntimes.js b/packages/core/core/src/applyRuntimes.js index cc5540a24..094da3a7d 100644 --- a/packages/core/core/src/applyRuntimes.js +++ b/packages/core/core/src/applyRuntimes.js @@ -1,17 +1,17 @@ // @flow strict-local -import type {ContentKey} from '@parcel/graph'; -import type {Dependency, NamedBundle as INamedBundle} from '@parcel/types'; -import type {SharedReference} from '@parcel/workers'; +import type {ContentKey} from '@atlaspack/graph'; +import type {Dependency, NamedBundle as INamedBundle} from '@atlaspack/types'; +import type {SharedReference} from '@atlaspack/workers'; import type { Asset, AssetGroup, Bundle as InternalBundle, Config, DevDepRequest, - ParcelOptions, + AtlaspackOptions, } from './types'; -import type ParcelConfig from './ParcelConfig'; +import type AtlaspackConfig from './AtlaspackConfig'; import type PluginOptions from './public/PluginOptions'; import type {RequestResult, RunAPI} from './RequestTracker'; @@ -23,15 +23,15 @@ import {nodeFromAssetGroup} from './AssetGraph'; import BundleGraph from './public/BundleGraph'; import InternalBundleGraph, {bundleGraphEdgeTypes} from './BundleGraph'; import {NamedBundle} from './public/Bundle'; -import {PluginLogger} from '@parcel/logger'; -import {hashString} from '@parcel/rust'; -import ThrowableDiagnostic, {errorToDiagnostic} from '@parcel/diagnostic'; +import {PluginLogger} from '@atlaspack/logger'; +import {hashString} from '@atlaspack/rust'; +import ThrowableDiagnostic, {errorToDiagnostic} from '@atlaspack/diagnostic'; import {dependencyToInternalDependency} from './public/Dependency'; import {mergeEnvironments} from './Environment'; import createAssetGraphRequest from './requests/AssetGraphRequest'; import {createDevDependency, runDevDepRequest} from './requests/DevDepRequest'; import {toProjectPath, fromProjectPathRelative} from './projectPath'; -import {tracer, PluginTracer} from '@parcel/profiler'; +import {tracer, PluginTracer} from '@atlaspack/profiler'; type RuntimeConnection = {| bundle: InternalBundle, @@ -72,8 +72,8 @@ export default async function applyRuntimes({ configs, }: {| bundleGraph: InternalBundleGraph, - config: ParcelConfig, - options: ParcelOptions, + config: AtlaspackConfig, + options: AtlaspackOptions, optionsRef: SharedReference, pluginOptions: PluginOptions, api: RunAPI, diff --git a/packages/core/core/src/assetUtils.js b/packages/core/core/src/assetUtils.js index b55f39937..36b5c83ea 100644 --- a/packages/core/core/src/assetUtils.js +++ b/packages/core/core/src/assetUtils.js @@ -11,24 +11,24 @@ import type { Symbol, SourceLocation, Transformer, -} from '@parcel/types'; +} from '@atlaspack/types'; import type { Asset, RequestInvalidation, Dependency, Environment, - ParcelOptions, + AtlaspackOptions, } from './types'; import {Readable} from 'stream'; -import {PluginLogger} from '@parcel/logger'; +import {PluginLogger} from '@atlaspack/logger'; import nullthrows from 'nullthrows'; import CommittedAsset from './CommittedAsset'; import UncommittedAsset from './UncommittedAsset'; -import loadPlugin from './loadParcelPlugin'; +import loadPlugin from './loadAtlaspackPlugin'; import {Asset as PublicAsset} from './public/Asset'; import PluginOptions from './public/PluginOptions'; -import {blobToStream, hashFile} from '@parcel/utils'; +import {blobToStream, hashFile} from '@atlaspack/utils'; import {hashFromOption, toInternalSourceLocation} from './utils'; import {createBuildCache} from './buildCache'; import { @@ -36,9 +36,9 @@ import { fromProjectPath, fromProjectPathRelative, } from './projectPath'; -import {hashString} from '@parcel/rust'; +import {hashString} from '@atlaspack/rust'; import {BundleBehavior as BundleBehaviorMap} from './types'; -import {PluginTracer} from '@parcel/profiler'; +import {PluginTracer} from '@atlaspack/profiler'; type AssetOptions = {| id?: string, @@ -211,7 +211,7 @@ const hashCache = createBuildCache(); export async function getInvalidationHash( invalidations: Array, - options: ParcelOptions, + options: AtlaspackOptions, ): Promise { if (invalidations.length === 0) { return ''; diff --git a/packages/core/core/src/parcel-v3/ParcelV3.js b/packages/core/core/src/atlaspack-v3/AtlaspackV3.js similarity index 76% rename from packages/core/core/src/parcel-v3/ParcelV3.js rename to packages/core/core/src/atlaspack-v3/AtlaspackV3.js index 472d6e189..bba7a880d 100644 --- a/packages/core/core/src/parcel-v3/ParcelV3.js +++ b/packages/core/core/src/atlaspack-v3/AtlaspackV3.js @@ -2,20 +2,20 @@ import path from 'path'; import {Worker} from 'worker_threads'; -import {ParcelNapi, type ParcelNapiOptions} from '@parcel/rust'; +import {AtlaspackNapi, type AtlaspackNapiOptions} from '@atlaspack/rust'; const WORKER_PATH = path.join(__dirname, 'worker', 'index.js'); -export type ParcelV3Options = {| - fs?: ParcelNapiOptions['fs'], +export type AtlaspackV3Options = {| + fs?: AtlaspackNapiOptions['fs'], nodeWorkers?: number, - packageManager?: ParcelNapiOptions['packageManager'], + packageManager?: AtlaspackNapiOptions['packageManager'], threads?: number, - ...ParcelNapiOptions['options'], + ...AtlaspackNapiOptions['options'], |}; -export class ParcelV3 { - _internal: ParcelNapi; +export class AtlaspackV3 { + _internal: AtlaspackNapi; constructor({ fs, @@ -23,8 +23,8 @@ export class ParcelV3 { packageManager, threads, ...options - }: ParcelV3Options) { - this._internal = new ParcelNapi({ + }: AtlaspackV3Options) { + this._internal = new AtlaspackNapi({ fs, nodeWorkers, packageManager, diff --git a/packages/core/core/src/parcel-v3/fs.js b/packages/core/core/src/atlaspack-v3/fs.js similarity index 83% rename from packages/core/core/src/parcel-v3/fs.js rename to packages/core/core/src/atlaspack-v3/fs.js index 53e7a8ce1..1535ded3f 100644 --- a/packages/core/core/src/parcel-v3/fs.js +++ b/packages/core/core/src/atlaspack-v3/fs.js @@ -1,15 +1,15 @@ // @flow strict-local -import type {FileSystem} from '@parcel/rust'; +import type {FileSystem} from '@atlaspack/rust'; import type { Encoding, FilePath, FileSystem as ClassicFileSystem, -} from '@parcel/types-internal'; +} from '@atlaspack/types-internal'; import {jsCallable} from './jsCallable'; -// Move to @parcel/utils or a dedicated v3 / migration package later +// Move to @atlaspack/utils or a dedicated v3 / migration package later export function toFileSystemV3(fs: ClassicFileSystem): FileSystem { return { canonicalize: jsCallable((path: FilePath) => fs.realpathSync(path)), diff --git a/packages/core/core/src/atlaspack-v3/index.js b/packages/core/core/src/atlaspack-v3/index.js new file mode 100644 index 000000000..44a7ade6b --- /dev/null +++ b/packages/core/core/src/atlaspack-v3/index.js @@ -0,0 +1,5 @@ +// @flow + +export {toFileSystemV3} from './fs'; +export {AtlaspackV3} from './AtlaspackV3'; +export type * from './AtlaspackV3'; diff --git a/packages/core/core/src/parcel-v3/jsCallable.js b/packages/core/core/src/atlaspack-v3/jsCallable.js similarity index 100% rename from packages/core/core/src/parcel-v3/jsCallable.js rename to packages/core/core/src/atlaspack-v3/jsCallable.js diff --git a/packages/core/core/src/parcel-v3/plugins/Resolver.js b/packages/core/core/src/atlaspack-v3/plugins/Resolver.js similarity index 100% rename from packages/core/core/src/parcel-v3/plugins/Resolver.js rename to packages/core/core/src/atlaspack-v3/plugins/Resolver.js diff --git a/packages/core/core/src/parcel-v3/plugins/index.js b/packages/core/core/src/atlaspack-v3/plugins/index.js similarity index 100% rename from packages/core/core/src/parcel-v3/plugins/index.js rename to packages/core/core/src/atlaspack-v3/plugins/index.js diff --git a/packages/core/core/src/atlaspack-v3/worker/index.js b/packages/core/core/src/atlaspack-v3/worker/index.js new file mode 100644 index 000000000..c79047238 --- /dev/null +++ b/packages/core/core/src/atlaspack-v3/worker/index.js @@ -0,0 +1,8 @@ +if ( + process.env.ATLASPACK_BUILD_ENV !== 'production' || + process.env.ATLASPACK_SELF_BUILD +) { + require('@atlaspack/babel-register'); +} + +require('./worker'); diff --git a/packages/core/core/src/parcel-v3/worker/worker.js b/packages/core/core/src/atlaspack-v3/worker/worker.js similarity index 58% rename from packages/core/core/src/parcel-v3/worker/worker.js rename to packages/core/core/src/atlaspack-v3/worker/worker.js index 40a1031ac..9bb658e28 100644 --- a/packages/core/core/src/parcel-v3/worker/worker.js +++ b/packages/core/core/src/atlaspack-v3/worker/worker.js @@ -1,9 +1,9 @@ // @flow -import * as napi from '@parcel/rust'; +import * as napi from '@atlaspack/rust'; import {workerData} from 'worker_threads'; import type {ResolverNapi} from '../plugins/Resolver'; -export class ParcelWorker { +export class AtlaspackWorker { #resolvers: Map; ping() { @@ -11,4 +11,4 @@ export class ParcelWorker { } } -napi.registerWorker(workerData.tx_worker, new ParcelWorker()); +napi.registerWorker(workerData.tx_worker, new AtlaspackWorker()); diff --git a/packages/core/core/src/constants.js b/packages/core/core/src/constants.js index 88a0a8e32..0b05d93cb 100644 --- a/packages/core/core/src/constants.js +++ b/packages/core/core/src/constants.js @@ -3,7 +3,7 @@ // $FlowFixMe import {version} from '../package.json'; -export const PARCEL_VERSION = version; +export const ATLASPACK_VERSION = version; export const HASH_REF_PREFIX = 'HASH_REF_'; export const HASH_REF_HASH_LEN = 16; export const HASH_REF_REGEX: RegExp = new RegExp( diff --git a/packages/core/core/src/dumpGraphToGraphViz.js b/packages/core/core/src/dumpGraphToGraphViz.js index 073ad38a4..b80029c21 100644 --- a/packages/core/core/src/dumpGraphToGraphViz.js +++ b/packages/core/core/src/dumpGraphToGraphViz.js @@ -1,13 +1,13 @@ // @flow -import type {Asset, BundleBehavior} from '@parcel/types'; -import type {Graph} from '@parcel/graph'; +import type {Asset, BundleBehavior} from '@atlaspack/types'; +import type {Graph} from '@atlaspack/graph'; import type {AssetGraphNode, BundleGraphNode, Environment} from './types'; import {bundleGraphEdgeTypes} from './BundleGraph'; import {requestGraphEdgeTypes} from './RequestTracker'; import path from 'path'; -import {fromNodeId} from '@parcel/graph'; +import {fromNodeId} from '@atlaspack/graph'; import {fromProjectPathRelative} from './projectPath'; import {SpecifierType, Priority} from './types'; @@ -48,16 +48,16 @@ export default async function dumpGraphToGraphViz( edgeTypes?: typeof bundleGraphEdgeTypes | typeof requestGraphEdgeTypes, ): Promise { if ( - process.env.PARCEL_BUILD_ENV === 'production' && - !process.env.PARCEL_BUILD_REPL + process.env.ATLASPACK_BUILD_ENV === 'production' && + !process.env.ATLASPACK_BUILD_REPL ) { return; } - let mode: ?string = process.env.PARCEL_BUILD_REPL + let mode: ?string = process.env.ATLASPACK_BUILD_REPL ? // $FlowFixMe - globalThis.PARCEL_DUMP_GRAPHVIZ?.mode - : process.env.PARCEL_DUMP_GRAPHVIZ; + globalThis.ATLASPACK_DUMP_GRAPHVIZ?.mode + : process.env.ATLASPACK_DUMP_GRAPHVIZ; // $FlowFixMe[invalid-compare] if (mode == null || mode == false) { @@ -211,12 +211,12 @@ export default async function dumpGraphToGraphViz( } } - if (process.env.PARCEL_BUILD_REPL) { + if (process.env.ATLASPACK_BUILD_REPL) { // $FlowFixMe - globalThis.PARCEL_DUMP_GRAPHVIZ?.(name, g.to_dot()); + globalThis.ATLASPACK_DUMP_GRAPHVIZ?.(name, g.to_dot()); } else { const tempy = require('tempy'); - let tmp = tempy.file({name: `parcel-${name}.png`}); + let tmp = tempy.file({name: `atlaspack-${name}.png`}); await g.output('png', tmp); // eslint-disable-next-line no-console console.log('Dumped', tmp); diff --git a/packages/core/core/src/index.js b/packages/core/core/src/index.js index e7f6cb3bc..30d0d8cea 100644 --- a/packages/core/core/src/index.js +++ b/packages/core/core/src/index.js @@ -12,11 +12,11 @@ export { export { default, - default as Parcel, + default as Atlaspack, BuildError, createWorkerFarm, INTERNAL_RESOLVE, INTERNAL_TRANSFORM, -} from './Parcel'; +} from './Atlaspack'; -export * from './parcel-v3'; +export * from './atlaspack-v3'; diff --git a/packages/core/core/src/loadParcelPlugin.js b/packages/core/core/src/loadAtlaspackPlugin.js similarity index 75% rename from packages/core/core/src/loadParcelPlugin.js rename to packages/core/core/src/loadAtlaspackPlugin.js index c703d26e2..9b27d28b4 100644 --- a/packages/core/core/src/loadParcelPlugin.js +++ b/packages/core/core/src/loadAtlaspackPlugin.js @@ -1,31 +1,36 @@ // @flow -import type {FilePath, PackageName, Semver, SemverRange} from '@parcel/types'; -import type {ParcelOptions} from './types'; +import type { + FilePath, + PackageName, + Semver, + SemverRange, +} from '@atlaspack/types'; +import type {AtlaspackOptions} from './types'; import path from 'path'; import semver from 'semver'; -import logger from '@parcel/logger'; +import logger from '@atlaspack/logger'; import nullthrows from 'nullthrows'; import ThrowableDiagnostic, { generateJSONCodeHighlights, md, -} from '@parcel/diagnostic'; +} from '@atlaspack/diagnostic'; import { findAlternativeNodeModules, loadConfig, resolveConfig, -} from '@parcel/utils'; +} from '@atlaspack/utils'; import {type ProjectPath, toProjectPath} from './projectPath'; -import {version as PARCEL_VERSION} from '../package.json'; +import {version as ATLASPACK_VERSION} from '../package.json'; const NODE_MODULES = `${path.sep}node_modules${path.sep}`; -const CONFIG = Symbol.for('parcel-plugin-config'); +const CONFIG = Symbol.for('atlaspack-plugin-config'); export default async function loadPlugin( pluginName: PackageName, configPath: FilePath, keyPath?: string, - options: ParcelOptions, + options: AtlaspackOptions, ): Promise<{| plugin: T, version: Semver, @@ -41,8 +46,8 @@ export default async function loadPlugin( let configContents = await options.inputFS.readFile(configPath, 'utf8'); throw new ThrowableDiagnostic({ diagnostic: { - message: md`Local plugins are not supported in Parcel config packages. Please publish "${pluginName}" as a separate npm package.`, - origin: '@parcel/core', + message: md`Local plugins are not supported in Atlaspack config packages. Please publish "${pluginName}" as a separate npm package.`, + origin: '@atlaspack/core', codeFrames: keyPath ? [ { @@ -73,8 +78,8 @@ export default async function loadPlugin( configPkg.config.dependencies?.[pluginName] == null ) { // If not in the config's dependencies, the plugin will be auto installed with - // the version declared in "parcelDependencies". - range = configPkg.config.parcelDependencies?.[pluginName]; + // the version declared in "atlaspackDependencies". + range = configPkg.config.atlaspackDependencies?.[pluginName]; if (range == null) { let contents = await options.inputFS.readFile( @@ -86,11 +91,11 @@ export default async function loadPlugin( message: md`Could not determine version of ${pluginName} in ${path.relative( process.cwd(), resolveFrom, - )}. Either include it in "dependencies" or "parcelDependencies".`, - origin: '@parcel/core', + )}. Either include it in "dependencies" or "atlaspackDependencies".`, + origin: '@atlaspack/core', codeFrames: configPkg.config.dependencies || - configPkg.config.parcelDependencies + configPkg.config.atlaspackDependencies ? [ { filePath: configPkg.files[0].filePath, @@ -98,8 +103,8 @@ export default async function loadPlugin( code: contents, codeHighlights: generateJSONCodeHighlights(contents, [ { - key: configPkg.config.parcelDependencies - ? '/parcelDependencies' + key: configPkg.config.atlaspackDependencies + ? '/atlaspackDependencies' : '/dependencies', type: 'key', }, @@ -139,8 +144,8 @@ export default async function loadPlugin( ); throw new ThrowableDiagnostic({ diagnostic: { - message: md`Cannot find Parcel plugin "${pluginName}"`, - origin: '@parcel/core', + message: md`Cannot find Atlaspack plugin "${pluginName}"`, + origin: '@atlaspack/core', codeFrames: keyPath ? [ { @@ -168,18 +173,18 @@ export default async function loadPlugin( // Remove plugin version compatiblility validation in canary builds as they don't use semver if (!process.env.SKIP_PLUGIN_COMPATIBILITY_CHECK) { if (!pluginName.startsWith('.')) { - // Validate the engines.parcel field in the plugin's package.json - let parcelVersionRange = pkg && pkg.engines && pkg.engines.parcel; - if (!parcelVersionRange) { + // Validate the engines.atlaspack field in the plugin's package.json + let atlaspackVersionRange = pkg && pkg.engines && pkg.engines.atlaspack; + if (!atlaspackVersionRange) { logger.warn({ - origin: '@parcel/core', - message: `The plugin "${pluginName}" needs to specify a \`package.json#engines.parcel\` field with the supported Parcel version range.`, + origin: '@atlaspack/core', + message: `The plugin "${pluginName}" needs to specify a \`package.json#engines.atlaspack\` field with the supported Atlaspack version range.`, }); } if ( - parcelVersionRange && - !semver.satisfies(PARCEL_VERSION, parcelVersionRange) + atlaspackVersionRange && + !semver.satisfies(ATLASPACK_VERSION, atlaspackVersionRange) ) { let pkgFile = nullthrows( await resolveConfig( @@ -192,8 +197,8 @@ export default async function loadPlugin( let pkgContents = await options.inputFS.readFile(pkgFile, 'utf8'); throw new ThrowableDiagnostic({ diagnostic: { - message: md`The plugin "${pluginName}" is not compatible with the current version of Parcel. Requires "${parcelVersionRange}" but the current version is "${PARCEL_VERSION}".`, - origin: '@parcel/core', + message: md`The plugin "${pluginName}" is not compatible with the current version of Atlaspack. Requires "${atlaspackVersionRange}" but the current version is "${ATLASPACK_VERSION}".`, + origin: '@atlaspack/core', codeFrames: [ { filePath: pkgFile, @@ -201,7 +206,7 @@ export default async function loadPlugin( code: pkgContents, codeHighlights: generateJSONCodeHighlights(pkgContents, [ { - key: '/engines/parcel', + key: '/engines/atlaspack', }, ]), }, @@ -222,7 +227,7 @@ export default async function loadPlugin( plugin = plugin[CONFIG]; if (!plugin) { throw new Error( - `Plugin ${pluginName} is not a valid Parcel plugin, should export an instance of a Parcel plugin ex. "export default new Reporter({ ... })".`, + `Plugin ${pluginName} is not a valid Atlaspack plugin, should export an instance of a Atlaspack plugin ex. "export default new Reporter({ ... })".`, ); } return { diff --git a/packages/core/core/src/loadDotEnv.js b/packages/core/core/src/loadDotEnv.js index 2bc1609e2..5f846f1fb 100644 --- a/packages/core/core/src/loadDotEnv.js +++ b/packages/core/core/src/loadDotEnv.js @@ -1,9 +1,9 @@ // @flow strict-local -import type {FileSystem} from '@parcel/fs'; -import type {EnvMap, FilePath} from '@parcel/types'; +import type {FileSystem} from '@atlaspack/fs'; +import type {EnvMap, FilePath} from '@atlaspack/types'; -import {resolveConfig} from '@parcel/utils'; +import {resolveConfig} from '@atlaspack/utils'; import dotenv from 'dotenv'; import variableExpansion from 'dotenv-expand'; diff --git a/packages/core/core/src/parcel-v3/index.js b/packages/core/core/src/parcel-v3/index.js deleted file mode 100644 index ad49916b6..000000000 --- a/packages/core/core/src/parcel-v3/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// @flow - -export {toFileSystemV3} from './fs'; -export {ParcelV3} from './ParcelV3'; -export type * from './ParcelV3'; diff --git a/packages/core/core/src/parcel-v3/worker/index.js b/packages/core/core/src/parcel-v3/worker/index.js deleted file mode 100644 index 6cee3949e..000000000 --- a/packages/core/core/src/parcel-v3/worker/index.js +++ /dev/null @@ -1,8 +0,0 @@ -if ( - process.env.PARCEL_BUILD_ENV !== 'production' || - process.env.PARCEL_SELF_BUILD -) { - require('@parcel/babel-register'); -} - -require('./worker'); diff --git a/packages/core/core/src/projectPath.js b/packages/core/core/src/projectPath.js index a8744234d..933a7e95e 100644 --- a/packages/core/core/src/projectPath.js +++ b/packages/core/core/src/projectPath.js @@ -1,7 +1,7 @@ // @flow strict-local -import type {FilePath} from '@parcel/types'; +import type {FilePath} from '@atlaspack/types'; import path from 'path'; -import {relativePath, normalizeSeparators} from '@parcel/utils'; +import {relativePath, normalizeSeparators} from '@atlaspack/utils'; /** * A path that's relative to the project root. diff --git a/packages/core/core/src/public/Asset.js b/packages/core/core/src/public/Asset.js index 8f1599252..c7423c5c9 100644 --- a/packages/core/core/src/public/Asset.js +++ b/packages/core/core/src/public/Asset.js @@ -2,7 +2,7 @@ import type SourceMap from '@parcel/source-map'; import type {Readable} from 'stream'; -import type {FileSystem} from '@parcel/fs'; +import type {FileSystem} from '@atlaspack/fs'; import type { Asset as IAsset, @@ -20,8 +20,8 @@ import type { MutableAssetSymbols as IMutableAssetSymbols, AssetSymbols as IAssetSymbols, BundleBehavior, -} from '@parcel/types'; -import type {Asset as AssetValue, ParcelOptions} from '../types'; +} from '@atlaspack/types'; +import type {Asset as AssetValue, AtlaspackOptions} from '../types'; import nullthrows from 'nullthrows'; import Environment from './Environment'; @@ -66,7 +66,7 @@ export function mutableAssetToUncommittedAsset( export function assetFromValue( value: AssetValue, - options: ParcelOptions, + options: AtlaspackOptions, ): Asset { return new Asset( value.committed diff --git a/packages/core/core/src/public/Bundle.js b/packages/core/core/src/public/Bundle.js index 9e9b29dac..a7c62a7b6 100644 --- a/packages/core/core/src/public/Bundle.js +++ b/packages/core/core/src/public/Bundle.js @@ -2,7 +2,7 @@ import type { Bundle as InternalBundle, - ParcelOptions, + AtlaspackOptions, PackagedBundleInfo, } from '../types'; import type { @@ -17,15 +17,15 @@ import type { Stats, Target as ITarget, BundleBehavior, -} from '@parcel/types'; +} from '@atlaspack/types'; import type BundleGraph from '../BundleGraph'; import invariant from 'assert'; import nullthrows from 'nullthrows'; -import {DefaultWeakMap} from '@parcel/utils'; +import {DefaultWeakMap} from '@atlaspack/utils'; import {assetToAssetValue, assetFromValue} from './Asset'; -import {mapVisitor} from '@parcel/graph'; +import {mapVisitor} from '@atlaspack/graph'; import Environment from './Environment'; import { dependencyToInternalDependency, @@ -36,15 +36,15 @@ import {BundleBehaviorNames} from '../types'; import {fromProjectPath} from '../projectPath'; const internalBundleToBundle: DefaultWeakMap< - ParcelOptions, + AtlaspackOptions, DefaultWeakMap>, > = new DefaultWeakMap(() => new DefaultWeakMap(() => new WeakMap())); const internalBundleToNamedBundle: DefaultWeakMap< - ParcelOptions, + AtlaspackOptions, DefaultWeakMap>, > = new DefaultWeakMap(() => new DefaultWeakMap(() => new WeakMap())); const internalBundleToPackagedBundle: DefaultWeakMap< - ParcelOptions, + AtlaspackOptions, DefaultWeakMap>, > = new DefaultWeakMap(() => new DefaultWeakMap(() => new WeakMap())); @@ -67,13 +67,13 @@ let _private = {}; export class Bundle implements IBundle { #bundle /*: InternalBundle */; #bundleGraph /*: BundleGraph */; - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; constructor( sentinel: mixed, bundle: InternalBundle, bundleGraph: BundleGraph, - options: ParcelOptions, + options: AtlaspackOptions, ) { if (sentinel !== _private) { throw new Error('Unexpected public usage'); @@ -87,7 +87,7 @@ export class Bundle implements IBundle { static get( internalBundle: InternalBundle, bundleGraph: BundleGraph, - options: ParcelOptions, + options: AtlaspackOptions, ): Bundle { let existingMap = internalBundleToBundle.get(options).get(bundleGraph); let existing = existingMap.get(internalBundle); @@ -208,13 +208,13 @@ export class Bundle implements IBundle { export class NamedBundle extends Bundle implements INamedBundle { #bundle /*: InternalBundle */; #bundleGraph /*: BundleGraph */; - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; constructor( sentinel: mixed, bundle: InternalBundle, bundleGraph: BundleGraph, - options: ParcelOptions, + options: AtlaspackOptions, ) { super(sentinel, bundle, bundleGraph, options); this.#bundle = bundle; // Repeating for flow @@ -225,7 +225,7 @@ export class NamedBundle extends Bundle implements INamedBundle { static get( internalBundle: InternalBundle, bundleGraph: BundleGraph, - options: ParcelOptions, + options: AtlaspackOptions, ): NamedBundle { let existingMap = internalBundleToNamedBundle.get(options).get(bundleGraph); let existing = existingMap.get(internalBundle); @@ -262,14 +262,14 @@ export class NamedBundle extends Bundle implements INamedBundle { export class PackagedBundle extends NamedBundle implements IPackagedBundle { #bundle /*: InternalBundle */; #bundleGraph /*: BundleGraph */; - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; #bundleInfo /*: ?PackagedBundleInfo */; constructor( sentinel: mixed, bundle: InternalBundle, bundleGraph: BundleGraph, - options: ParcelOptions, + options: AtlaspackOptions, ) { super(sentinel, bundle, bundleGraph, options); this.#bundle = bundle; // Repeating for flow @@ -280,7 +280,7 @@ export class PackagedBundle extends NamedBundle implements IPackagedBundle { static get( internalBundle: InternalBundle, bundleGraph: BundleGraph, - options: ParcelOptions, + options: AtlaspackOptions, ): PackagedBundle { let existingMap = internalBundleToPackagedBundle .get(options) @@ -306,7 +306,7 @@ export class PackagedBundle extends NamedBundle implements IPackagedBundle { static getWithInfo( internalBundle: InternalBundle, bundleGraph: BundleGraph, - options: ParcelOptions, + options: AtlaspackOptions, bundleInfo: ?PackagedBundleInfo, ): PackagedBundle { let packagedBundle = PackagedBundle.get( diff --git a/packages/core/core/src/public/BundleGraph.js b/packages/core/core/src/public/BundleGraph.js index 6b6aeb132..46cccc752 100644 --- a/packages/core/core/src/public/BundleGraph.js +++ b/packages/core/core/src/public/BundleGraph.js @@ -13,14 +13,14 @@ import type { Symbol, SymbolResolution, Target, -} from '@parcel/types'; -import type {Bundle as InternalBundle, ParcelOptions} from '../types'; +} from '@atlaspack/types'; +import type {Bundle as InternalBundle, AtlaspackOptions} from '../types'; import type InternalBundleGraph from '../BundleGraph'; import invariant from 'assert'; import nullthrows from 'nullthrows'; -import {mapVisitor} from '@parcel/graph'; +import {mapVisitor} from '@atlaspack/graph'; import {assetFromValue, assetToAssetValue, Asset} from './Asset'; import {bundleToInternalBundle} from './Bundle'; import Dependency, { @@ -46,20 +46,20 @@ export function bundleGraphToInternalBundleGraph( type BundleFactory = ( InternalBundle, InternalBundleGraph, - ParcelOptions, + AtlaspackOptions, ) => TBundle; export default class BundleGraph implements IBundleGraph { #graph: InternalBundleGraph; - #options: ParcelOptions; + #options: AtlaspackOptions; #createBundle: BundleFactory; constructor( graph: InternalBundleGraph, createBundle: BundleFactory, - options: ParcelOptions, + options: AtlaspackOptions, ) { this.#graph = graph; this.#options = options; diff --git a/packages/core/core/src/public/BundleGroup.js b/packages/core/core/src/public/BundleGroup.js index 1d7e28b87..ab466a76f 100644 --- a/packages/core/core/src/public/BundleGroup.js +++ b/packages/core/core/src/public/BundleGroup.js @@ -2,8 +2,11 @@ import type { BundleGroup as IBundleGroup, Target as ITarget, -} from '@parcel/types'; -import type {BundleGroup as InternalBundleGroup, ParcelOptions} from '../types'; +} from '@atlaspack/types'; +import type { + BundleGroup as InternalBundleGroup, + AtlaspackOptions, +} from '../types'; import nullthrows from 'nullthrows'; import Target from './Target'; @@ -24,11 +27,11 @@ export function bundleGroupToInternalBundleGroup( export default class BundleGroup implements IBundleGroup { #bundleGroup /*: InternalBundleGroup */; - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; constructor( bundleGroup: InternalBundleGroup, - options: ParcelOptions, + options: AtlaspackOptions, ): BundleGroup { let existing = internalBundleGroupToBundleGroup.get(bundleGroup); if (existing != null) { diff --git a/packages/core/core/src/public/Config.js b/packages/core/core/src/public/Config.js index 13fa68b76..e3c1dd090 100644 --- a/packages/core/core/src/public/Config.js +++ b/packages/core/core/src/public/Config.js @@ -7,8 +7,8 @@ import type { PackageJSON, ConfigResultWithFilePath, DevDepOptions, -} from '@parcel/types'; -import type {Config, ParcelOptions} from '../types'; +} from '@atlaspack/types'; +import type {Config, AtlaspackOptions} from '../types'; import invariant from 'assert'; import path from 'path'; @@ -17,12 +17,12 @@ import { resolveConfig, readConfig, relativePath, -} from '@parcel/utils'; +} from '@atlaspack/utils'; import Environment from './Environment'; import {fromProjectPath, toProjectPath} from '../projectPath'; const internalConfigToConfig: DefaultWeakMap< - ParcelOptions, + AtlaspackOptions, WeakMap, > = new DefaultWeakMap(() => new WeakMap()); @@ -30,9 +30,9 @@ export default class PublicConfig implements IConfig { #config /*: Config */; #pkg /*: ?PackageJSON */; #pkgFilePath /*: ?FilePath */; - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; - constructor(config: Config, options: ParcelOptions): PublicConfig { + constructor(config: Config, options: AtlaspackOptions): PublicConfig { let existing = internalConfigToConfig.get(options).get(config); if (existing != null) { return existing; diff --git a/packages/core/core/src/public/Dependency.js b/packages/core/core/src/public/Dependency.js index bc060fbec..66709578b 100644 --- a/packages/core/core/src/public/Dependency.js +++ b/packages/core/core/src/public/Dependency.js @@ -9,8 +9,11 @@ import type { SpecifierType, DependencyPriority, BundleBehavior, -} from '@parcel/types'; -import type {Dependency as InternalDependency, ParcelOptions} from '../types'; +} from '@atlaspack/types'; +import type { + Dependency as InternalDependency, + AtlaspackOptions, +} from '../types'; import {BundleBehaviorNames} from '../types'; import nullthrows from 'nullthrows'; @@ -44,7 +47,7 @@ export function dependencyToInternalDependency( export function getPublicDependency( dep: InternalDependency, - options: ParcelOptions, + options: AtlaspackOptions, ): Dependency { let existing = internalDependencyToDependency.get(dep); if (existing != null) { @@ -56,9 +59,9 @@ export function getPublicDependency( export default class Dependency implements IDependency { #dep /*: InternalDependency */; - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; - constructor(dep: InternalDependency, options: ParcelOptions): Dependency { + constructor(dep: InternalDependency, options: AtlaspackOptions): Dependency { this.#dep = dep; this.#options = options; _dependencyToInternalDependency.set(this, dep); diff --git a/packages/core/core/src/public/Environment.js b/packages/core/core/src/public/Environment.js index 812328044..a943ce674 100644 --- a/packages/core/core/src/public/Environment.js +++ b/packages/core/core/src/public/Environment.js @@ -10,8 +10,11 @@ import type { SourceLocation, SourceType, TargetSourceMapOptions, -} from '@parcel/types'; -import type {Environment as InternalEnvironment, ParcelOptions} from '../types'; +} from '@atlaspack/types'; +import type { + Environment as InternalEnvironment, + AtlaspackOptions, +} from '../types'; import nullthrows from 'nullthrows'; import browserslist from 'browserslist'; import semver from 'semver'; @@ -154,9 +157,12 @@ export function environmentToInternalEnvironment( export default class Environment implements IEnvironment { #environment /*: InternalEnvironment */; - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; - constructor(env: InternalEnvironment, options: ParcelOptions): Environment { + constructor( + env: InternalEnvironment, + options: AtlaspackOptions, + ): Environment { let existing = internalEnvironmentToEnvironment.get(env); if (existing != null) { return existing; diff --git a/packages/core/core/src/public/MutableBundleGraph.js b/packages/core/core/src/public/MutableBundleGraph.js index 7144aad77..f699cf6b6 100644 --- a/packages/core/core/src/public/MutableBundleGraph.js +++ b/packages/core/core/src/public/MutableBundleGraph.js @@ -8,16 +8,16 @@ import type { Dependency as IDependency, MutableBundleGraph as IMutableBundleGraph, Target, -} from '@parcel/types'; +} from '@atlaspack/types'; import type { - ParcelOptions, + AtlaspackOptions, BundleGroup as InternalBundleGroup, BundleNode, } from '../types'; import invariant from 'assert'; import nullthrows from 'nullthrows'; -import {hashString} from '@parcel/rust'; +import {hashString} from '@atlaspack/rust'; import BundleGraph from './BundleGraph'; import InternalBundleGraph, {bundleGraphEdgeTypes} from '../BundleGraph'; import {Bundle, bundleToInternalBundle} from './Bundle'; @@ -36,10 +36,10 @@ export default class MutableBundleGraph implements IMutableBundleGraph { #graph /*: InternalBundleGraph */; - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; #bundlePublicIds /*: Set */ = new Set(); - constructor(graph: InternalBundleGraph, options: ParcelOptions) { + constructor(graph: InternalBundleGraph, options: AtlaspackOptions) { super(graph, Bundle.get.bind(Bundle), options); this.#graph = graph; this.#options = options; diff --git a/packages/core/core/src/public/PluginOptions.js b/packages/core/core/src/public/PluginOptions.js index aa7bea656..9e32b265d 100644 --- a/packages/core/core/src/public/PluginOptions.js +++ b/packages/core/core/src/public/PluginOptions.js @@ -8,26 +8,26 @@ import type { ServerOptions, HMROptions, DetailedReportOptions, -} from '@parcel/types'; -import type {FileSystem} from '@parcel/fs'; -import type {PackageManager} from '@parcel/package-manager'; -import type {ParcelOptions} from '../types'; -import {type FeatureFlags} from '@parcel/feature-flags'; +} from '@atlaspack/types'; +import type {FileSystem} from '@atlaspack/fs'; +import type {PackageManager} from '@atlaspack/package-manager'; +import type {AtlaspackOptions} from '../types'; +import {type FeatureFlags} from '@atlaspack/feature-flags'; -let parcelOptionsToPluginOptions: WeakMap = +let atlaspackOptionsToPluginOptions: WeakMap = new WeakMap(); export default class PluginOptions implements IPluginOptions { - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; - constructor(options: ParcelOptions): PluginOptions { - let existing = parcelOptionsToPluginOptions.get(options); + constructor(options: AtlaspackOptions): PluginOptions { + let existing = atlaspackOptionsToPluginOptions.get(options); if (existing != null) { return existing; } this.#options = options; - parcelOptionsToPluginOptions.set(options, this); + atlaspackOptionsToPluginOptions.set(options, this); return this; } @@ -43,8 +43,8 @@ export default class PluginOptions implements IPluginOptions { return this.#options.env; } - get parcelVersion(): string { - return this.#options.parcelVersion; + get atlaspackVersion(): string { + return this.#options.atlaspackVersion; } get hmrOptions(): ?HMROptions { diff --git a/packages/core/core/src/public/Symbols.js b/packages/core/core/src/public/Symbols.js index 9d9860154..1038ae15c 100644 --- a/packages/core/core/src/public/Symbols.js +++ b/packages/core/core/src/public/Symbols.js @@ -6,8 +6,8 @@ import type { MutableDependencySymbols as IMutableDependencySymbols, SourceLocation, Meta, -} from '@parcel/types'; -import type {Asset, Dependency, ParcelOptions} from '../types'; +} from '@atlaspack/types'; +import type {Asset, Dependency, AtlaspackOptions} from '../types'; import nullthrows from 'nullthrows'; import {fromInternalSourceLocation, toInternalSourceLocation} from '../utils'; @@ -32,9 +32,9 @@ export class AssetSymbols implements IAssetSymbols { @@iterator(): Iterator<[ISymbol, {|local: ISymbol, loc: ?SourceLocation, meta?: ?Meta|}]> { return ({}: any); } */ #value: Asset; - #options: ParcelOptions; + #options: AtlaspackOptions; - constructor(options: ParcelOptions, asset: Asset): AssetSymbols { + constructor(options: AtlaspackOptions, asset: Asset): AssetSymbols { let existing = valueToSymbols.get(asset); if (existing != null) { return existing; @@ -102,9 +102,9 @@ export class MutableAssetSymbols implements IMutableAssetSymbols { @@iterator(): Iterator<[ISymbol, {|local: ISymbol, loc: ?SourceLocation, meta?: ?Meta|}]> { return ({}: any); } */ #value: Asset; - #options: ParcelOptions; + #options: AtlaspackOptions; - constructor(options: ParcelOptions, asset: Asset): MutableAssetSymbols { + constructor(options: AtlaspackOptions, asset: Asset): MutableAssetSymbols { let existing = valueToMutableAssetSymbols.get(asset); if (existing != null) { return existing; @@ -200,10 +200,10 @@ export class MutableDependencySymbols implements IMutableDependencySymbols { @@iterator(): Iterator<[ISymbol, {|local: ISymbol, loc: ?SourceLocation, isWeak: boolean, meta?: ?Meta|}]> { return ({}: any); } */ #value: Dependency; - #options: ParcelOptions; + #options: AtlaspackOptions; constructor( - options: ParcelOptions, + options: AtlaspackOptions, dep: Dependency, ): MutableDependencySymbols { let existing = valueToMutableDependencySymbols.get(dep); diff --git a/packages/core/core/src/public/Target.js b/packages/core/core/src/public/Target.js index 396b054a0..835769aad 100644 --- a/packages/core/core/src/public/Target.js +++ b/packages/core/core/src/public/Target.js @@ -4,8 +4,8 @@ import type { Target as ITarget, Environment as IEnvironment, SourceLocation, -} from '@parcel/types'; -import type {Target as TargetValue, ParcelOptions} from '../types'; +} from '@atlaspack/types'; +import type {Target as TargetValue, AtlaspackOptions} from '../types'; import nullthrows from 'nullthrows'; import Environment from './Environment'; @@ -22,9 +22,9 @@ export function targetToInternalTarget(target: ITarget): TargetValue { export default class Target implements ITarget { #target /*: TargetValue */; - #options /*: ParcelOptions */; + #options /*: AtlaspackOptions */; - constructor(target: TargetValue, options: ParcelOptions): Target { + constructor(target: TargetValue, options: AtlaspackOptions): Target { let existing = internalTargetToTarget.get(target); if (existing != null) { return existing; diff --git a/packages/core/core/src/registerCoreWithSerializer.js b/packages/core/core/src/registerCoreWithSerializer.js index 17690b852..f5168f7fa 100644 --- a/packages/core/core/src/registerCoreWithSerializer.js +++ b/packages/core/core/src/registerCoreWithSerializer.js @@ -1,9 +1,9 @@ // @flow -import {Graph} from '@parcel/graph'; +import {Graph} from '@atlaspack/graph'; import {registerSerializableClass} from './serializer'; import AssetGraph from './AssetGraph'; import BundleGraph from './BundleGraph'; -import ParcelConfig from './ParcelConfig'; +import AtlaspackConfig from './AtlaspackConfig'; import {RequestGraph} from './RequestTracker'; import Config from './public/Config'; import packageJson from '../package.json'; @@ -24,7 +24,7 @@ export function registerCoreWithSerializer() { Config, BundleGraph, Graph, - ParcelConfig, + AtlaspackConfig, RequestGraph, // $FlowFixMe[unclear-type] }): Array<[string, Class]>)) { diff --git a/packages/core/core/src/requests/AssetGraphRequest.js b/packages/core/core/src/requests/AssetGraphRequest.js index e1b3df55a..109ce8154 100644 --- a/packages/core/core/src/requests/AssetGraphRequest.js +++ b/packages/core/core/src/requests/AssetGraphRequest.js @@ -1,31 +1,31 @@ // @flow strict-local -import type {NodeId} from '@parcel/graph'; -import type {Async} from '@parcel/types'; -import type {SharedReference} from '@parcel/workers'; +import type {NodeId} from '@atlaspack/graph'; +import type {Async} from '@atlaspack/types'; +import type {SharedReference} from '@atlaspack/workers'; import type { Asset, AssetGroup, AssetRequestInput, Dependency, Entry, - ParcelOptions, + AtlaspackOptions, Target, } from '../types'; import type {StaticRunOpts, RunAPI} from '../RequestTracker'; import type {EntryRequestResult} from './EntryRequest'; import type {PathRequestInput} from './PathRequest'; -import type {Diagnostic} from '@parcel/diagnostic'; -import logger from '@parcel/logger'; +import type {Diagnostic} from '@atlaspack/diagnostic'; +import logger from '@atlaspack/logger'; import invariant from 'assert'; import nullthrows from 'nullthrows'; -import {PromiseQueue, setEqual} from '@parcel/utils'; -import {hashString} from '@parcel/rust'; -import ThrowableDiagnostic from '@parcel/diagnostic'; +import {PromiseQueue, setEqual} from '@atlaspack/utils'; +import {hashString} from '@atlaspack/rust'; +import ThrowableDiagnostic from '@atlaspack/diagnostic'; import {Priority} from '../types'; import AssetGraph from '../AssetGraph'; -import {PARCEL_VERSION} from '../constants'; +import {ATLASPACK_VERSION} from '../constants'; import createEntryRequest from './EntryRequest'; import createTargetRequest from './TargetRequest'; import createAssetRequest from './AssetRequest'; @@ -111,7 +111,7 @@ export class AssetGraphBuilder { changedAssetsPropagation: Set; prevChangedAssetsPropagation: ?Set; optionsRef: SharedReference; - options: ParcelOptions; + options: AtlaspackOptions; api: RunAPI; name: string; cacheKey: string; @@ -163,7 +163,7 @@ export class AssetGraphBuilder { this.lazyExcludes = lazyExcludes ?? []; this.cacheKey = hashString( - `${PARCEL_VERSION}${name}${JSON.stringify(entries) ?? ''}${ + `${ATLASPACK_VERSION}${name}${JSON.stringify(entries) ?? ''}${ options.mode }${options.shouldBuildLazily ? 'lazy' : 'eager'}`, ) + '-AssetGraph'; @@ -241,7 +241,7 @@ export class AssetGraphBuilder { await this.queue.run(); logger.verbose({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: 'Asset graph walked', meta: { visitedAssetGroupsCount: visitedAssetGroups.size, diff --git a/packages/core/core/src/requests/AssetGraphRequestRust.js b/packages/core/core/src/requests/AssetGraphRequestRust.js index 5b0b0664b..c80a9fabf 100644 --- a/packages/core/core/src/requests/AssetGraphRequestRust.js +++ b/packages/core/core/src/requests/AssetGraphRequestRust.js @@ -2,11 +2,11 @@ import invariant from 'assert'; -import ThrowableDiagnostic from '@parcel/diagnostic'; -import type {Async} from '@parcel/types'; +import ThrowableDiagnostic from '@atlaspack/diagnostic'; +import type {Async} from '@atlaspack/types'; import AssetGraph, {nodeFromAssetGroup} from '../AssetGraph'; -import type {ParcelV3} from '../parcel-v3'; +import type {AtlaspackV3} from '../atlaspack-v3'; import {toProjectPath} from '../projectPath'; import {requestTypes, type StaticRunOpts} from '../RequestTracker'; import {propagateSymbols} from '../SymbolPropagation'; @@ -29,7 +29,7 @@ type AssetGraphRequest = {| |}; export function createAssetGraphRequestRust( - rustParcel: ParcelV3, + rustAtlaspack: AtlaspackV3, ): (input: AssetGraphRequestInput) => AssetGraphRequest { return input => ({ type: requestTypes.asset_graph_request, @@ -38,7 +38,7 @@ export function createAssetGraphRequestRust( let options = input.options; let serializedAssetGraph; try { - serializedAssetGraph = await rustParcel.buildAssetGraph(); + serializedAssetGraph = await rustAtlaspack.buildAssetGraph(); } catch (err) { throw new ThrowableDiagnostic({ diagnostic: err, diff --git a/packages/core/core/src/requests/AssetRequest.js b/packages/core/core/src/requests/AssetRequest.js index ebd752c58..a9048071b 100644 --- a/packages/core/core/src/requests/AssetRequest.js +++ b/packages/core/core/src/requests/AssetRequest.js @@ -1,20 +1,20 @@ // @flow strict-local -import type {ContentKey} from '@parcel/graph'; -import type {Async} from '@parcel/types'; +import type {ContentKey} from '@atlaspack/graph'; +import type {Async} from '@atlaspack/types'; import type {StaticRunOpts} from '../RequestTracker'; import type { AssetRequestInput, AssetRequestResult, TransformationRequest, } from '../types'; -import type {ConfigAndCachePath} from './ParcelConfigRequest'; +import type {ConfigAndCachePath} from './AtlaspackConfigRequest'; import type {TransformationResult} from '../Transformation'; import nullthrows from 'nullthrows'; -import ThrowableDiagnostic from '@parcel/diagnostic'; -import {hashString} from '@parcel/rust'; -import createParcelConfigRequest from './ParcelConfigRequest'; +import ThrowableDiagnostic from '@atlaspack/diagnostic'; +import {hashString} from '@atlaspack/rust'; +import createAtlaspackConfigRequest from './AtlaspackConfigRequest'; import {runDevDepRequest} from './DevDepRequest'; import {runConfigRequest} from './ConfigRequest'; import {fromProjectPath, fromProjectPathRelative} from '../projectPath'; @@ -75,7 +75,9 @@ async function run({input, api, farm, invalidateReason, options}) { let start = Date.now(); let {optionsRef, ...rest} = input; let {cachePath} = nullthrows( - await api.runRequest(createParcelConfigRequest()), + await api.runRequest( + createAtlaspackConfigRequest(), + ), ); let previousDevDepRequests: Map = new Map( diff --git a/packages/core/core/src/requests/ParcelBuildRequest.js b/packages/core/core/src/requests/AtlaspackBuildRequest.js similarity index 76% rename from packages/core/core/src/requests/ParcelBuildRequest.js rename to packages/core/core/src/requests/AtlaspackBuildRequest.js index a3bb384c9..097f8c390 100644 --- a/packages/core/core/src/requests/ParcelBuildRequest.js +++ b/packages/core/core/src/requests/AtlaspackBuildRequest.js @@ -1,8 +1,8 @@ // @flow strict-local -import type {ContentKey} from '@parcel/graph'; -import type {Async} from '@parcel/types'; -import type {SharedReference} from '@parcel/workers'; +import type {ContentKey} from '@atlaspack/graph'; +import type {Async} from '@atlaspack/types'; +import type {SharedReference} from '@atlaspack/workers'; import type {StaticRunOpts} from '../RequestTracker'; import type {Asset, AssetGroup, PackagedBundleInfo} from '../types'; @@ -20,16 +20,16 @@ import IBundleGraph from '../public/BundleGraph'; import {NamedBundle} from '../public/Bundle'; import {assetFromValue} from '../public/Asset'; -import {tracer} from '@parcel/profiler'; +import {tracer} from '@atlaspack/profiler'; import {requestTypes} from '../RequestTracker'; -type ParcelBuildRequestInput = {| +type AtlaspackBuildRequestInput = {| optionsRef: SharedReference, requestedAssetIds: Set, signal?: AbortSignal, |}; -export type ParcelBuildRequestResult = {| +export type AtlaspackBuildRequestResult = {| bundleGraph: BundleGraph, bundleInfo: Map, changedAssets: Map, @@ -37,23 +37,25 @@ export type ParcelBuildRequestResult = {| |}; type RunInput = {| - input: ParcelBuildRequestInput, + input: AtlaspackBuildRequestInput, ...StaticRunOpts, |}; -export type ParcelBuildRequest = {| +export type AtlaspackBuildRequest = {| id: ContentKey, - +type: typeof requestTypes.parcel_build_request, - run: (RunInput) => Async, - input: ParcelBuildRequestInput, + +type: typeof requestTypes.atlaspack_build_request, + run: ( + RunInput, + ) => Async, + input: AtlaspackBuildRequestInput, |}; -export default function createParcelBuildRequest( - input: ParcelBuildRequestInput, -): ParcelBuildRequest { +export default function createAtlaspackBuildRequest( + input: AtlaspackBuildRequestInput, +): AtlaspackBuildRequest { return { - type: requestTypes.parcel_build_request, - id: 'parcel_build_request', + type: requestTypes.atlaspack_build_request, + id: 'atlaspack_build_request', run, input, }; diff --git a/packages/core/core/src/requests/ParcelConfigRequest.js b/packages/core/core/src/requests/AtlaspackConfigRequest.js similarity index 81% rename from packages/core/core/src/requests/ParcelConfigRequest.js rename to packages/core/core/src/requests/AtlaspackConfigRequest.js index 3e0ce8261..8b680d990 100644 --- a/packages/core/core/src/requests/ParcelConfigRequest.js +++ b/packages/core/core/src/requests/AtlaspackConfigRequest.js @@ -3,16 +3,16 @@ import type { Async, FilePath, PackageName, - RawParcelConfig, - ResolvedParcelConfigFile, -} from '@parcel/types'; -import type {FileSystem} from '@parcel/fs'; + RawAtlaspackConfig, + ResolvedAtlaspackConfigFile, +} from '@atlaspack/types'; +import type {FileSystem} from '@atlaspack/fs'; import type {StaticRunOpts} from '../RequestTracker'; import type { - ExtendableParcelConfigPipeline, - PureParcelConfigPipeline, - ParcelOptions, - ProcessedParcelConfig, + ExtendableAtlaspackConfigPipeline, + PureAtlaspackConfigPipeline, + AtlaspackOptions, + ProcessedAtlaspackConfig, } from '../types'; import { @@ -22,20 +22,20 @@ import { validateSchema, findAlternativeNodeModules, findAlternativeFiles, -} from '@parcel/utils'; +} from '@atlaspack/utils'; import ThrowableDiagnostic, { generateJSONCodeHighlights, escapeMarkdown, md, errorToDiagnostic, -} from '@parcel/diagnostic'; +} from '@atlaspack/diagnostic'; import {parse} from 'json5'; import path from 'path'; import invariant from 'assert'; -import ParcelConfigSchema from '../ParcelConfig.schema'; +import AtlaspackConfigSchema from '../AtlaspackConfig.schema'; import {optionsProxy} from '../utils'; -import ParcelConfig from '../ParcelConfig'; +import AtlaspackConfig from '../AtlaspackConfig'; import {createBuildCache} from '../buildCache'; import {toProjectPath} from '../projectPath'; import {requestTypes} from '../RequestTracker'; @@ -43,7 +43,7 @@ import {requestTypes} from '../RequestTracker'; type ConfigMap = {[K]: V, ...}; export type ConfigAndCachePath = {| - config: ProcessedParcelConfig, + config: ProcessedAtlaspackConfig, cachePath: string, |}; @@ -52,23 +52,25 @@ type RunOpts = {| ...StaticRunOpts, |}; -export type ParcelConfigRequest = {| +export type AtlaspackConfigRequest = {| id: string, - type: typeof requestTypes.parcel_config_request, + type: typeof requestTypes.atlaspack_config_request, input: null, - run: (RunOpts) => Async, + run: ( + RunOpts, + ) => Async, |}; -export type ParcelConfigRequestResult = ConfigAndCachePath; +export type AtlaspackConfigRequestResult = ConfigAndCachePath; -type ParcelConfigChain = {| - config: ProcessedParcelConfig, +type AtlaspackConfigChain = {| + config: ProcessedAtlaspackConfig, extendedFiles: Array, |}; -const type = 'parcel_config_request'; +const type = 'atlaspack_config_request'; -export default function createParcelConfigRequest(): ParcelConfigRequest { +export default function createAtlaspackConfigRequest(): AtlaspackConfigRequest { return { id: type, type: requestTypes[type], @@ -78,9 +80,9 @@ export default function createParcelConfigRequest(): ParcelConfigRequest { extendedFiles, usedDefault, }: {| - ...ParcelConfigChain, + ...AtlaspackConfigChain, usedDefault: boolean, - |} = await loadParcelConfig( + |} = await loadAtlaspackConfig( optionsProxy(options, api.invalidateOnOptionChange), ); @@ -96,7 +98,7 @@ export default function createParcelConfigRequest(): ParcelConfigRequest { if (usedDefault) { let resolveFrom = getResolveFrom(options.inputFS, options.projectRoot); api.invalidateOnFileCreate({ - fileName: '.parcelrc', + fileName: '.atlaspackrc', aboveFilePath: toProjectPath(options.projectRoot, resolveFrom), }); } @@ -112,38 +114,38 @@ export default function createParcelConfigRequest(): ParcelConfigRequest { }; } -const parcelConfigCache = createBuildCache(); -export function getCachedParcelConfig( +const atlaspackConfigCache = createBuildCache(); +export function getCachedAtlaspackConfig( result: ConfigAndCachePath, - options: ParcelOptions, -): ParcelConfig { + options: AtlaspackOptions, +): AtlaspackConfig { let {config: processedConfig, cachePath} = result; - let config = parcelConfigCache.get(cachePath); + let config = atlaspackConfigCache.get(cachePath); if (config) { return config; } - config = new ParcelConfig(processedConfig, options); + config = new AtlaspackConfig(processedConfig, options); - parcelConfigCache.set(cachePath, config); + atlaspackConfigCache.set(cachePath, config); return config; } -export async function loadParcelConfig( - options: ParcelOptions, -): Promise<{|...ParcelConfigChain, usedDefault: boolean|}> { - let parcelConfig = await resolveParcelConfig(options); +export async function loadAtlaspackConfig( + options: AtlaspackOptions, +): Promise<{|...AtlaspackConfigChain, usedDefault: boolean|}> { + let atlaspackConfig = await resolveAtlaspackConfig(options); - if (!parcelConfig) { - throw new Error('Could not find a .parcelrc'); + if (!atlaspackConfig) { + throw new Error('Could not find a .atlaspackrc'); } - return parcelConfig; + return atlaspackConfig; } -export async function resolveParcelConfig( - options: ParcelOptions, -): Promise { +export async function resolveAtlaspackConfig( + options: AtlaspackOptions, +): Promise { let resolveFrom = getResolveFrom(options.inputFS, options.projectRoot); let configPath = options.config != null @@ -152,7 +154,7 @@ export async function resolveParcelConfig( : await resolveConfig( options.inputFS, resolveFrom, - ['.parcelrc'], + ['.atlaspackrc'], options.projectRoot, ); @@ -174,20 +176,17 @@ export async function resolveParcelConfig( } catch (e) { throw new ThrowableDiagnostic({ diagnostic: { - message: md`Could not find parcel config at ${path.relative( + message: md`Could not find atlaspack config at ${path.relative( options.projectRoot, configPath, )}`, - origin: '@parcel/core', + origin: '@atlaspack/core', }, }); } - let {config, extendedFiles}: ParcelConfigChain = await parseAndProcessConfig( - configPath, - contents, - options, - ); + let {config, extendedFiles}: AtlaspackConfigChain = + await parseAndProcessConfig(configPath, contents, options); if (options.additionalReporters.length > 0) { config.reporters = [ @@ -203,9 +202,9 @@ export async function resolveParcelConfig( } export function create( - config: ResolvedParcelConfigFile, - options: ParcelOptions, -): Promise { + config: ResolvedAtlaspackConfigFile, + options: AtlaspackOptions, +): Promise { return processConfigChain(config, config.filePath, options); } @@ -213,9 +212,9 @@ export function create( export async function parseAndProcessConfig( configPath: FilePath, contents: string, - options: ParcelOptions, -): Promise { - let config: RawParcelConfig; + options: AtlaspackOptions, +): Promise { + let config: RawAtlaspackConfig; try { config = parse(contents); } catch (e) { @@ -225,8 +224,8 @@ export async function parseAndProcessConfig( }; throw new ThrowableDiagnostic({ diagnostic: { - message: `Failed to parse .parcelrc`, - origin: '@parcel/core', + message: `Failed to parse .atlaspackrc`, + origin: '@atlaspack/core', codeFrames: [ { @@ -249,7 +248,7 @@ export async function parseAndProcessConfig( } function processPipeline( - options: ParcelOptions, + options: AtlaspackOptions, pipeline: ?Array, keyPath: string, filePath: FilePath, @@ -283,7 +282,7 @@ async function processMap( map: ?ConfigMap, keyPath: string, filePath: FilePath, - options: ParcelOptions, + options: AtlaspackOptions, // $FlowFixMe ): Promise | typeof undefined> { if (!map) return undefined; @@ -297,7 +296,7 @@ async function processMap( throw new ThrowableDiagnostic({ diagnostic: { message: `Named pipeline '${k.slice(0, i + 1)}' is reserved.`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: filePath, @@ -332,9 +331,9 @@ async function processMap( } export async function processConfig( - configFile: ResolvedParcelConfigFile, - options: ParcelOptions, -): Promise { + configFile: ResolvedAtlaspackConfigFile, + options: AtlaspackOptions, +): Promise { return { filePath: toProjectPath(options.projectRoot, configFile.filePath), ...(configFile.resolveFrom != null @@ -416,16 +415,16 @@ export async function processConfig( } export async function processConfigChain( - configFile: RawParcelConfig | ResolvedParcelConfigFile, + configFile: RawAtlaspackConfig | ResolvedAtlaspackConfigFile, filePath: FilePath, - options: ParcelOptions, -): Promise { + options: AtlaspackOptions, +): Promise { // Validate config... let relativePath = path.relative(options.inputFS.cwd(), filePath); validateConfigFile(configFile, relativePath); // Process config... - let config: ProcessedParcelConfig = await processConfig( + let config: ProcessedAtlaspackConfig = await processConfig( { filePath, ...configFile, @@ -482,7 +481,7 @@ export async function resolveExtends( ext: string, configPath: FilePath, extendsKey: string, - options: ParcelOptions, + options: AtlaspackOptions, ): Promise { if (ext.startsWith('.')) { return path.resolve(path.dirname(configPath), ext); @@ -499,8 +498,8 @@ export async function resolveExtends( ); throw new ThrowableDiagnostic({ diagnostic: { - message: `Cannot find extended parcel config`, - origin: '@parcel/core', + message: `Cannot find extended atlaspack config`, + origin: '@atlaspack/core', codeFrames: [ { filePath: configPath, @@ -530,8 +529,8 @@ async function processExtendedConfig( extendsKey: string, extendsSpecifier: string, resolvedExtendedConfigPath: FilePath, - options: ParcelOptions, -): Promise { + options: AtlaspackOptions, +): Promise { let contents; try { contents = await options.inputFS.readFile( @@ -548,8 +547,8 @@ async function processExtendedConfig( ); throw new ThrowableDiagnostic({ diagnostic: { - message: 'Cannot find extended parcel config', - origin: '@parcel/core', + message: 'Cannot find extended atlaspack config', + origin: '@atlaspack/core', codeFrames: [ { filePath: configPath, @@ -574,7 +573,7 @@ async function processExtendedConfig( } export function validateConfigFile( - config: RawParcelConfig | ResolvedParcelConfigFile, + config: RawAtlaspackConfig | ResolvedAtlaspackConfigFile, relativePath: FilePath, ) { try { @@ -583,30 +582,30 @@ export function validateConfigFile( throw new ThrowableDiagnostic({ diagnostic: { message: e.message, - origin: '@parcel/core', + origin: '@atlaspack/core', }, }); } validateSchema.diagnostic( - ParcelConfigSchema, + AtlaspackConfigSchema, {data: config, filePath: relativePath}, - '@parcel/core', - 'Invalid Parcel Config', + '@atlaspack/core', + 'Invalid Atlaspack Config', ); } export function validateNotEmpty( - config: RawParcelConfig | ResolvedParcelConfigFile, + config: RawAtlaspackConfig | ResolvedAtlaspackConfigFile, relativePath: FilePath, ) { invariant.notDeepStrictEqual(config, {}, `${relativePath} can't be empty`); } export function mergeConfigs( - base: ProcessedParcelConfig, - ext: ProcessedParcelConfig, -): ProcessedParcelConfig { + base: ProcessedAtlaspackConfig, + ext: ProcessedAtlaspackConfig, +): ProcessedAtlaspackConfig { return { filePath: ext.filePath, resolvers: assertPurePipeline( @@ -640,8 +639,8 @@ export function getResolveFrom( } function assertPurePipeline( - pipeline: ExtendableParcelConfigPipeline, -): PureParcelConfigPipeline { + pipeline: ExtendableAtlaspackConfigPipeline, +): PureAtlaspackConfigPipeline { return pipeline.map(s => { invariant(typeof s !== 'string'); return s; @@ -649,9 +648,9 @@ function assertPurePipeline( } export function mergePipelines( - base: ?ExtendableParcelConfigPipeline, - ext: ?ExtendableParcelConfigPipeline, -): ExtendableParcelConfigPipeline { + base: ?ExtendableAtlaspackConfigPipeline, + ext: ?ExtendableAtlaspackConfigPipeline, +): ExtendableAtlaspackConfigPipeline { if (ext == null) { return base ?? []; } diff --git a/packages/core/core/src/requests/BundleGraphRequest.js b/packages/core/core/src/requests/BundleGraphRequest.js index 096c66cec..bb9130d44 100644 --- a/packages/core/core/src/requests/BundleGraphRequest.js +++ b/packages/core/core/src/requests/BundleGraphRequest.js @@ -1,8 +1,8 @@ // @flow strict-local -import type {Async, Bundle as IBundle, Namer} from '@parcel/types'; -import type {SharedReference} from '@parcel/workers'; -import type ParcelConfig, {LoadedPlugin} from '../ParcelConfig'; +import type {Async, Bundle as IBundle, Namer} from '@atlaspack/types'; +import type {SharedReference} from '@atlaspack/workers'; +import type AtlaspackConfig, {LoadedPlugin} from '../AtlaspackConfig'; import type {StaticRunOpts, RunAPI} from '../RequestTracker'; import type { Asset, @@ -10,15 +10,15 @@ import type { Bundle as InternalBundle, Config, DevDepRequest, - ParcelOptions, + AtlaspackOptions, } from '../types'; -import type {ConfigAndCachePath} from './ParcelConfigRequest'; +import type {ConfigAndCachePath} from './AtlaspackConfigRequest'; import invariant from 'assert'; import assert from 'assert'; import nullthrows from 'nullthrows'; -import {PluginLogger} from '@parcel/logger'; -import ThrowableDiagnostic, {errorToDiagnostic} from '@parcel/diagnostic'; +import {PluginLogger} from '@atlaspack/logger'; +import ThrowableDiagnostic, {errorToDiagnostic} from '@atlaspack/diagnostic'; import AssetGraph from '../AssetGraph'; import BundleGraph from '../public/BundleGraph'; import InternalBundleGraph, {bundleGraphEdgeTypes} from '../BundleGraph'; @@ -26,15 +26,15 @@ import MutableBundleGraph from '../public/MutableBundleGraph'; import {Bundle, NamedBundle} from '../public/Bundle'; import {report} from '../ReporterRunner'; import dumpGraphToGraphViz from '../dumpGraphToGraphViz'; -import {unique, setDifference} from '@parcel/utils'; -import {hashString} from '@parcel/rust'; +import {unique, setDifference} from '@atlaspack/utils'; +import {hashString} from '@atlaspack/rust'; import PluginOptions from '../public/PluginOptions'; import applyRuntimes from '../applyRuntimes'; -import {PARCEL_VERSION, OPTION_CHANGE} from '../constants'; +import {ATLASPACK_VERSION, OPTION_CHANGE} from '../constants'; import {assertSignalNotAborted, optionsProxy} from '../utils'; -import createParcelConfigRequest, { - getCachedParcelConfig, -} from './ParcelConfigRequest'; +import createAtlaspackConfigRequest, { + getCachedAtlaspackConfig, +} from './AtlaspackConfigRequest'; import { createDevDependency, getDevDepRequests, @@ -54,7 +54,7 @@ import { } from '../projectPath'; import createAssetGraphRequestJS from './AssetGraphRequest'; import {createAssetGraphRequestRust} from './AssetGraphRequestRust'; -import {tracer, PluginTracer} from '@parcel/profiler'; +import {tracer, PluginTracer} from '@atlaspack/profiler'; import {requestTypes} from '../RequestTracker'; type BundleGraphRequestInput = {| @@ -97,8 +97,8 @@ export default function createBundleGraphRequest( let {optionsRef, requestedAssetIds, signal} = input.input; let measurement = tracer.createMeasurement('building'); - let createAssetGraphRequest = input.rustParcel - ? createAssetGraphRequestRust(input.rustParcel) + let createAssetGraphRequest = input.rustAtlaspack + ? createAssetGraphRequestRust(input.rustAtlaspack) : createAssetGraphRequestJS; let request = createAssetGraphRequest({ @@ -136,18 +136,21 @@ export default function createBundleGraphRequest( let configResult = nullthrows( await input.api.runRequest( - createParcelConfigRequest(), + createAtlaspackConfigRequest(), ), ); assertSignalNotAborted(signal); - let parcelConfig = getCachedParcelConfig(configResult, input.options); + let atlaspackConfig = getCachedAtlaspackConfig( + configResult, + input.options, + ); let {devDeps, invalidDevDeps} = await getDevDepRequests(input.api); - invalidateDevDeps(invalidDevDeps, input.options, parcelConfig); + invalidateDevDeps(invalidDevDeps, input.options, atlaspackConfig); let bundlingMeasurement = tracer.createMeasurement('bundling'); - let builder = new BundlerRunner(input, parcelConfig, devDeps); + let builder = new BundlerRunner(input, atlaspackConfig, devDeps); let res: BundleGraphResult = await builder.bundle({ graph: assetGraph, changedAssets: changedAssets, @@ -172,9 +175,9 @@ export default function createBundleGraphRequest( } class BundlerRunner { - options: ParcelOptions; + options: AtlaspackOptions; optionsRef: SharedReference; - config: ParcelConfig; + config: AtlaspackConfig; pluginOptions: PluginOptions; api: RunAPI; previousDevDeps: Map; @@ -184,7 +187,7 @@ class BundlerRunner { constructor( {input, api, options}: RunInput, - config: ParcelConfig, + config: AtlaspackConfig, previousDevDeps: Map, ) { this.options = options; @@ -199,7 +202,7 @@ class BundlerRunner { ); this.cacheKey = hashString( - `${PARCEL_VERSION}:BundleGraph:${ + `${ATLASPACK_VERSION}:BundleGraph:${ JSON.stringify(options.entries) ?? '' }${options.mode}${options.shouldBuildLazily ? 'lazy' : 'eager'}`, ) + '-BundleGraph'; diff --git a/packages/core/core/src/requests/ConfigRequest.js b/packages/core/core/src/requests/ConfigRequest.js index 32f4d8189..c46899389 100644 --- a/packages/core/core/src/requests/ConfigRequest.js +++ b/packages/core/core/src/requests/ConfigRequest.js @@ -7,26 +7,26 @@ import type { PluginTracer as IPluginTracer, NamedBundle as INamedBundle, BundleGraph as IBundleGraph, -} from '@parcel/types'; -import {readConfig, hashObject} from '@parcel/utils'; +} from '@atlaspack/types'; +import {readConfig, hashObject} from '@atlaspack/utils'; import type { Config, - ParcelOptions, + AtlaspackOptions, InternalFileCreateInvalidation, } from '../types'; -import type {LoadedPlugin} from '../ParcelConfig'; +import type {LoadedPlugin} from '../AtlaspackConfig'; import type {RequestResult, RunAPI} from '../RequestTracker'; import type {ProjectPath} from '../projectPath'; import {serializeRaw} from '../serializer.js'; -import {PluginLogger} from '@parcel/logger'; +import {PluginLogger} from '@atlaspack/logger'; import PluginOptions from '../public/PluginOptions'; -import ThrowableDiagnostic, {errorToDiagnostic} from '@parcel/diagnostic'; +import ThrowableDiagnostic, {errorToDiagnostic} from '@atlaspack/diagnostic'; import PublicConfig from '../public/Config'; import {optionsProxy} from '../utils'; import {getInvalidationHash} from '../assetUtils'; -import {hashString, Hash} from '@parcel/rust'; -import {PluginTracer} from '@parcel/profiler'; +import {hashString, Hash} from '@atlaspack/rust'; +import {PluginTracer} from '@atlaspack/profiler'; import {requestTypes} from '../RequestTracker'; import {fromProjectPath, fromProjectPathRelative} from '../projectPath'; import {createBuildCache} from '../buildCache'; @@ -79,7 +79,7 @@ export type ConfigRequestResult = void; export async function loadPluginConfig( loadedPlugin: LoadedPlugin, config: Config, - options: ParcelOptions, + options: AtlaspackOptions, ): Promise { let loadConfig = loadedPlugin.plugin.loadConfig; if (!loadConfig) { @@ -114,7 +114,7 @@ const configKeyCache = createBuildCache(); export async function getConfigKeyContentHash( filePath: ProjectPath, configKey: string, - options: ParcelOptions, + options: AtlaspackOptions, ): Async { let cacheKey = `${fromProjectPathRelative(filePath)}:${configKey}`; let cachedValue = configKeyCache.get(cacheKey); @@ -216,7 +216,7 @@ export async function runConfigRequest( export async function getConfigHash( config: Config, pluginName: string, - options: ParcelOptions, + options: AtlaspackOptions, ): Promise { if (config.result == null) { return ''; diff --git a/packages/core/core/src/requests/DevDepRequest.js b/packages/core/core/src/requests/DevDepRequest.js index da37b4d54..e7e2a9723 100644 --- a/packages/core/core/src/requests/DevDepRequest.js +++ b/packages/core/core/src/requests/DevDepRequest.js @@ -3,11 +3,11 @@ import type { DependencySpecifier, SemverRange, Invalidations, -} from '@parcel/types'; -import type ParcelConfig from '../ParcelConfig'; +} from '@atlaspack/types'; +import type AtlaspackConfig from '../AtlaspackConfig'; import type { DevDepRequest, - ParcelOptions, + AtlaspackOptions, InternalDevDepOptions, } from '../types'; import type {RequestResult, RunAPI} from '../RequestTracker'; @@ -33,7 +33,7 @@ const devDepRequestCache: WeakMap = new WeakMap(); export async function createDevDependency( opts: InternalDevDepOptions, requestDevDeps: Map, - options: ParcelOptions, + options: AtlaspackOptions, ): Promise { let {specifier, resolveFrom, additionalInvalidations} = opts; let key = `${specifier}:${fromProjectPathRelative(resolveFrom)}`; @@ -160,8 +160,8 @@ const invalidatedDevDeps = createBuildCache(); export function invalidateDevDeps( invalidDevDeps: Array, - options: ParcelOptions, - config: ParcelConfig, + options: AtlaspackOptions, + config: AtlaspackConfig, ) { for (let {specifier, resolveFrom} of invalidDevDeps) { let key = `${specifier}:${fromProjectPathRelative(resolveFrom)}`; diff --git a/packages/core/core/src/requests/EntryRequest.js b/packages/core/core/src/requests/EntryRequest.js index d8f97eb39..59ed3694a 100644 --- a/packages/core/core/src/requests/EntryRequest.js +++ b/packages/core/core/src/requests/EntryRequest.js @@ -1,21 +1,21 @@ // @flow strict-local -import type {Async, FilePath, PackageJSON, Glob} from '@parcel/types'; +import type {Async, FilePath, PackageJSON, Glob} from '@atlaspack/types'; import type {StaticRunOpts} from '../RequestTracker'; -import type {Entry, InternalFile, ParcelOptions} from '../types'; -import type {FileSystem} from '@parcel/fs'; +import type {Entry, InternalFile, AtlaspackOptions} from '../types'; +import type {FileSystem} from '@atlaspack/fs'; import { isDirectoryInside, isGlob, glob, findAlternativeFiles, -} from '@parcel/utils'; +} from '@atlaspack/utils'; import ThrowableDiagnostic, { md, generateJSONCodeHighlights, getJSONSourceLocation, -} from '@parcel/diagnostic'; +} from '@atlaspack/diagnostic'; import path from 'path'; import {parse, type Mapping} from '@mischnic/json-sourcemap'; import {requestTypes} from '../RequestTracker'; @@ -91,7 +91,7 @@ async function assertFile( relativeSource: FilePath, pkgFilePath: FilePath, keyPath: string, - options: ParcelOptions, + options: AtlaspackOptions, ) { let source = path.join(entry, relativeSource); let stat; @@ -108,7 +108,7 @@ async function assertFile( ); throw new ThrowableDiagnostic({ diagnostic: { - origin: '@parcel/core', + origin: '@atlaspack/core', message: md`${path.relative(process.cwd(), source)} does not exist.`, codeFrames: [ { @@ -132,7 +132,7 @@ async function assertFile( let contents = await fs.readFile(pkgFilePath, 'utf8'); throw new ThrowableDiagnostic({ diagnostic: { - origin: '@parcel/core', + origin: '@atlaspack/core', message: md`${path.relative(process.cwd(), source)} is not a file.`, codeFrames: [ { @@ -151,9 +151,9 @@ async function assertFile( } export class EntryResolver { - options: ParcelOptions; + options: AtlaspackOptions; - constructor(options: ParcelOptions) { + constructor(options: AtlaspackOptions) { this.options = options; } diff --git a/packages/core/core/src/requests/PackageRequest.js b/packages/core/core/src/requests/PackageRequest.js index 666298cb7..147d7ccc3 100644 --- a/packages/core/core/src/requests/PackageRequest.js +++ b/packages/core/core/src/requests/PackageRequest.js @@ -1,20 +1,20 @@ // @flow strict-local -import type {ContentKey} from '@parcel/graph'; -import type {Async} from '@parcel/types'; -import type {SharedReference} from '@parcel/workers'; +import type {ContentKey} from '@atlaspack/graph'; +import type {Async} from '@atlaspack/types'; +import type {SharedReference} from '@atlaspack/workers'; import type {StaticRunOpts} from '../RequestTracker'; import {requestTypes} from '../RequestTracker'; import type {Bundle} from '../types'; import type BundleGraph from '../BundleGraph'; import type {BundleInfo, RunPackagerRunnerResult} from '../PackagerRunner'; -import type {ConfigAndCachePath} from './ParcelConfigRequest'; +import type {ConfigAndCachePath} from './AtlaspackConfigRequest'; import nullthrows from 'nullthrows'; import {runConfigRequest} from './ConfigRequest'; import {getDevDepRequests, runDevDepRequest} from './DevDepRequest'; -import createParcelConfigRequest from './ParcelConfigRequest'; +import createAtlaspackConfigRequest from './AtlaspackConfigRequest'; type PackageRequestInput = {| bundleGraph: BundleGraph, @@ -56,7 +56,9 @@ async function run({input, api, farm}) { let start = Date.now(); let {devDeps, invalidDevDeps} = await getDevDepRequests(api); let {cachePath} = nullthrows( - await api.runRequest(createParcelConfigRequest()), + await api.runRequest( + createAtlaspackConfigRequest(), + ), ); let {devDepRequests, configRequests, bundleInfo, invalidations} = diff --git a/packages/core/core/src/requests/PathRequest.js b/packages/core/core/src/requests/PathRequest.js index f0dca3d9f..07a76a32f 100644 --- a/packages/core/core/src/requests/PathRequest.js +++ b/packages/core/core/src/requests/PathRequest.js @@ -1,37 +1,37 @@ // @flow strict-local -import type {Diagnostic} from '@parcel/diagnostic'; +import type {Diagnostic} from '@atlaspack/diagnostic'; import type { Async, FileCreateInvalidation, FilePath, Resolver, -} from '@parcel/types'; +} from '@atlaspack/types'; import type {StaticRunOpts} from '../RequestTracker'; import type { AssetGroup, Config, Dependency, DevDepRequest, - ParcelOptions, + AtlaspackOptions, } from '../types'; -import type {ConfigAndCachePath} from './ParcelConfigRequest'; +import type {ConfigAndCachePath} from './AtlaspackConfigRequest'; import ThrowableDiagnostic, { convertSourceLocationToHighlight, errorToDiagnostic, md, -} from '@parcel/diagnostic'; -import {PluginLogger} from '@parcel/logger'; +} from '@atlaspack/diagnostic'; +import {PluginLogger} from '@atlaspack/logger'; import nullthrows from 'nullthrows'; import path from 'path'; -import {normalizePath} from '@parcel/utils'; +import {normalizePath} from '@atlaspack/utils'; import {report} from '../ReporterRunner'; import {getPublicDependency} from '../public/Dependency'; import PluginOptions from '../public/PluginOptions'; -import ParcelConfig from '../ParcelConfig'; -import createParcelConfigRequest, { - getCachedParcelConfig, -} from './ParcelConfigRequest'; +import AtlaspackConfig from '../AtlaspackConfig'; +import createAtlaspackConfigRequest, { + getCachedAtlaspackConfig, +} from './AtlaspackConfigRequest'; import {invalidateOnFileCreateToInternal} from '../utils'; import { fromProjectPath, @@ -41,7 +41,7 @@ import { } from '../projectPath'; import {Priority} from '../types'; import {createBuildCache} from '../buildCache'; -import type {LoadedPlugin} from '../ParcelConfig'; +import type {LoadedPlugin} from '../AtlaspackConfig'; import {createConfig} from '../InternalConfig'; import {loadPluginConfig, runConfigRequest} from './ConfigRequest'; import { @@ -50,7 +50,7 @@ import { invalidateDevDeps, runDevDepRequest, } from './DevDepRequest'; -import {tracer, PluginTracer} from '@parcel/profiler'; +import {tracer, PluginTracer} from '@atlaspack/profiler'; import {requestTypes} from '../RequestTracker'; export type PathRequest = {| @@ -87,9 +87,11 @@ export default function createPathRequest( async function run({input, api, options}): Promise { let configResult = nullthrows( - await api.runRequest(createParcelConfigRequest()), + await api.runRequest( + createAtlaspackConfigRequest(), + ), ); - let config = getCachedParcelConfig(configResult, options); + let config = getCachedAtlaspackConfig(configResult, options); let {devDeps, invalidDevDeps} = await getDevDepRequests(api); invalidateDevDeps(invalidDevDeps, options, config); let resolverRunner = new ResolverRunner({ @@ -143,8 +145,8 @@ async function run({input, api, options}): Promise { } type ResolverRunnerOpts = {| - config: ParcelConfig, - options: ParcelOptions, + config: AtlaspackConfig, + options: AtlaspackOptions, previousDevDeps: Map, |}; @@ -159,8 +161,8 @@ type ResolverResult = {| const configCache = createBuildCache(); export class ResolverRunner { - config: ParcelConfig; - options: ParcelOptions; + config: AtlaspackConfig; + options: AtlaspackOptions; pluginOptions: PluginOptions; previousDevDeps: Map; devDepRequests: Map; @@ -181,7 +183,7 @@ export class ResolverRunner { ): Async { let diagnostic: Diagnostic = { message, - origin: '@parcel/core', + origin: '@atlaspack/core', }; if (dependency.loc && dependency.sourcePath != null) { diff --git a/packages/core/core/src/requests/TargetRequest.js b/packages/core/core/src/requests/TargetRequest.js index f7e583ac5..fbc0a1c00 100644 --- a/packages/core/core/src/requests/TargetRequest.js +++ b/packages/core/core/src/requests/TargetRequest.js @@ -1,7 +1,7 @@ // @flow strict-local -import type {Diagnostic} from '@parcel/diagnostic'; -import type {FileSystem} from '@parcel/fs'; +import type {Diagnostic} from '@atlaspack/diagnostic'; +import type {FileSystem} from '@atlaspack/fs'; import type { Async, Engines, @@ -10,10 +10,10 @@ import type { PackageTargetDescriptor, TargetDescriptor, OutputFormat, -} from '@parcel/types'; +} from '@atlaspack/types'; import type {StaticRunOpts, RunAPI} from '../RequestTracker'; -import type {Entry, ParcelOptions, Target} from '../types'; -import type {ConfigAndCachePath} from './ParcelConfigRequest'; +import type {Entry, AtlaspackOptions, Target} from '../types'; +import type {ConfigAndCachePath} from './AtlaspackConfigRequest'; import ThrowableDiagnostic, { convertSourceLocationToHighlight, @@ -21,19 +21,19 @@ import ThrowableDiagnostic, { getJSONSourceLocation, encodeJSONKeyComponent, md, -} from '@parcel/diagnostic'; +} from '@atlaspack/diagnostic'; import path from 'path'; import { loadConfig, resolveConfig, hashObject, validateSchema, -} from '@parcel/utils'; -import logger from '@parcel/logger'; +} from '@atlaspack/utils'; +import logger from '@atlaspack/logger'; import {createEnvironment} from '../Environment'; -import createParcelConfigRequest, { - getCachedParcelConfig, -} from './ParcelConfigRequest'; +import createAtlaspackConfigRequest, { + getCachedAtlaspackConfig, +} from './AtlaspackConfigRequest'; // $FlowFixMe import browserslist from 'browserslist'; import {parse} from '@mischnic/json-sourcemap'; @@ -135,12 +135,14 @@ async function run({input, api, options}) { assertTargetsAreNotEntries(targets, input, options); let configResult = nullthrows( - await api.runRequest(createParcelConfigRequest()), + await api.runRequest( + createAtlaspackConfigRequest(), + ), ); - let parcelConfig = getCachedParcelConfig(configResult, options); + let atlaspackConfig = getCachedAtlaspackConfig(configResult, options); // Find named pipelines for each target. - let pipelineNames = new Set(parcelConfig.getNamedPipelines()); + let pipelineNames = new Set(atlaspackConfig.getNamedPipelines()); for (let target of targets) { if (pipelineNames.has(target.name)) { target.pipeline = target.name; @@ -187,10 +189,10 @@ type TargetKeyInfo = export class TargetResolver { fs: FileSystem; api: RunAPI>; - options: ParcelOptions; + options: AtlaspackOptions; targetInfo: Map; - constructor(api: RunAPI>, options: ParcelOptions) { + constructor(api: RunAPI>, options: AtlaspackOptions) { this.api = api; this.fs = options.inputFS; this.options = options; @@ -215,7 +217,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: `Targets option is an empty array`, - origin: '@parcel/core', + origin: '@atlaspack/core', }, }); } @@ -236,7 +238,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: md`Could not find target with name "${target}"`, - origin: '@parcel/core', + origin: '@atlaspack/core', }, }); } @@ -263,7 +265,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: md`Missing distDir for target "${name}"`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { code: optionTargetsString, @@ -336,7 +338,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: `More than one target is not supported in serve mode`, - origin: '@parcel/core', + origin: '@atlaspack/core', }, }); } @@ -344,7 +346,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: `Only browser targets are supported in serve mode`, - origin: '@parcel/core', + origin: '@atlaspack/core', }, }); } @@ -429,7 +431,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: md`Expected package.json file in ${rootDir}`, - origin: '@parcel/core', + origin: '@atlaspack/core', }, }); } @@ -701,7 +703,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: md`Unexpected output file type ${ext} in target "${targetName}"`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { language: 'json', @@ -734,7 +736,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: md`The "global" output format is not supported in the "${targetName}" target.`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { language: 'json', @@ -788,7 +790,7 @@ export class TargetResolver { diagnostic: { // prettier-ignore message: md`Output format "esmodule" cannot be used in the "main" target without a .mjs extension or "type": "module" field.`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { language: 'json', @@ -826,7 +828,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: 'Scope hoisting cannot be disabled for library targets.', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { language: 'json', @@ -956,7 +958,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: md`Invalid distPath for target "${targetName}"`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { language: 'json', @@ -1018,7 +1020,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: 'Scope hoisting cannot be disabled for library targets.', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { language: 'json', @@ -1214,7 +1216,7 @@ export class TargetResolver { throw new ThrowableDiagnostic({ diagnostic: { message: md`Declared output format "${descriptor.outputFormat}" does not match expected output format "${inferredOutputFormat}".`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { language: 'json', @@ -1264,7 +1266,7 @@ function parseEngines( validateSchema.diagnostic( ENGINES_SCHEMA, {data: engines, source: pkgContents, filePath: pkgPath, prependKey}, - '@parcel/core', + '@atlaspack/core', message, ); // $FlowFixMe we just verified this @@ -1286,7 +1288,7 @@ function parseDescriptor( filePath: pkgPath, prependKey: `/targets/${targetName}`, }, - '@parcel/core', + '@atlaspack/core', `Invalid target descriptor for target "${targetName}"`, ); @@ -1308,7 +1310,7 @@ function parsePackageDescriptor( filePath: pkgPath, prependKey: `/targets/${targetName}`, }, - '@parcel/core', + '@atlaspack/core', `Invalid target descriptor for target "${targetName}"`, ); // $FlowFixMe we just verified this @@ -1329,7 +1331,7 @@ function parseCommonTargetDescriptor( filePath: pkgPath, prependKey: `/targets/${targetName}`, }, - '@parcel/core', + '@atlaspack/core', `Invalid target descriptor for target "${targetName}"`, ); @@ -1367,7 +1369,7 @@ function assertNoDuplicateTargets(options, targets, pkgFilePath, pkgContents) { path.dirname(pkgFilePath), targetPath, )}"`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { language: 'json', @@ -1398,7 +1400,7 @@ function assertNoDuplicateTargets(options, targets, pkgFilePath, pkgContents) { } } -function normalizeSourceMap(options: ParcelOptions, sourceMap) { +function normalizeSourceMap(options: AtlaspackOptions, sourceMap) { if (options.defaultTargetOptions.sourceMaps) { if (typeof sourceMap === 'boolean') { return sourceMap ? {} : undefined; @@ -1413,7 +1415,7 @@ function normalizeSourceMap(options: ParcelOptions, sourceMap) { function assertTargetsAreNotEntries( targets: Array, input: Entry, - options: ParcelOptions, + options: AtlaspackOptions, ) { for (const target of targets) { if ( @@ -1454,7 +1456,7 @@ function assertTargetsAreNotEntries( throw new ThrowableDiagnostic({ diagnostic: { - origin: '@parcel/core', + origin: '@atlaspack/core', message: `Target "${target.name}" is configured to overwrite entry "${relativeEntry}".`, codeFrames, hints: [ @@ -1595,7 +1597,7 @@ async function debugResolvedTargets(input, targets, targetInfo, options) { let format = v => (v.message != null ? md.italic(v.message) : ''); logger.verbose({ - origin: '@parcel/core', + origin: '@atlaspack/core', message: md`**Target** "${target.name}" **Entry**: ${path.relative( diff --git a/packages/core/core/src/requests/ValidationRequest.js b/packages/core/core/src/requests/ValidationRequest.js index 307306caa..6ace75c1b 100644 --- a/packages/core/core/src/requests/ValidationRequest.js +++ b/packages/core/core/src/requests/ValidationRequest.js @@ -1,15 +1,15 @@ // @flow strict-local -import type {Async} from '@parcel/types'; -import type {SharedReference} from '@parcel/workers'; +import type {Async} from '@atlaspack/types'; +import type {SharedReference} from '@atlaspack/workers'; import type {StaticRunOpts} from '../RequestTracker'; import type {AssetGroup} from '../types'; -import type {ConfigAndCachePath} from './ParcelConfigRequest'; +import type {ConfigAndCachePath} from './AtlaspackConfigRequest'; import nullthrows from 'nullthrows'; -import ParcelConfig from '../ParcelConfig'; +import AtlaspackConfig from '../AtlaspackConfig'; import {report} from '../ReporterRunner'; import Validation from '../Validation'; -import createParcelConfigRequest from './ParcelConfigRequest'; +import createAtlaspackConfigRequest from './AtlaspackConfigRequest'; import {requestTypes} from '../RequestTracker'; type ValidationRequest = {| @@ -38,11 +38,11 @@ export default function createValidationRequest( run: async ({input: {assetRequests, optionsRef}, api, options, farm}) => { let {config: processedConfig, cachePath} = nullthrows( await api.runRequest( - createParcelConfigRequest(), + createAtlaspackConfigRequest(), ), ); - let config = new ParcelConfig(processedConfig, options); + let config = new AtlaspackConfig(processedConfig, options); let trackedRequestsDesc = assetRequests.filter(request => { return config.getValidatorNames(request.filePath).length > 0; }); diff --git a/packages/core/core/src/requests/WriteBundleRequest.js b/packages/core/core/src/requests/WriteBundleRequest.js index d6c7fe1d7..ac9cccd89 100644 --- a/packages/core/core/src/requests/WriteBundleRequest.js +++ b/packages/core/core/src/requests/WriteBundleRequest.js @@ -1,22 +1,22 @@ // @flow strict-local -import type {FileSystem, FileOptions} from '@parcel/fs'; -import type {ContentKey} from '@parcel/graph'; -import type {Async, FilePath, Compressor} from '@parcel/types'; +import type {FileSystem, FileOptions} from '@atlaspack/fs'; +import type {ContentKey} from '@atlaspack/graph'; +import type {Async, FilePath, Compressor} from '@atlaspack/types'; import type {RunAPI, StaticRunOpts} from '../RequestTracker'; -import type {Bundle, PackagedBundleInfo, ParcelOptions} from '../types'; +import type {Bundle, PackagedBundleInfo, AtlaspackOptions} from '../types'; import type BundleGraph from '../BundleGraph'; import type {BundleInfo} from '../PackagerRunner'; -import type {ConfigAndCachePath} from './ParcelConfigRequest'; -import type {LoadedPlugin} from '../ParcelConfig'; +import type {ConfigAndCachePath} from './AtlaspackConfigRequest'; +import type {LoadedPlugin} from '../AtlaspackConfig'; import type {ProjectPath} from '../projectPath'; import {HASH_REF_HASH_LEN, HASH_REF_PREFIX} from '../constants'; import nullthrows from 'nullthrows'; import path from 'path'; import {NamedBundle} from '../public/Bundle'; -import {blobToStream, TapStream} from '@parcel/utils'; +import {blobToStream, TapStream} from '@atlaspack/utils'; import {Readable, Transform, pipeline} from 'stream'; import { fromProjectPath, @@ -25,20 +25,20 @@ import { joinProjectPath, toProjectPathUnsafe, } from '../projectPath'; -import createParcelConfigRequest, { - getCachedParcelConfig, -} from './ParcelConfigRequest'; +import createAtlaspackConfigRequest, { + getCachedAtlaspackConfig, +} from './AtlaspackConfigRequest'; import PluginOptions from '../public/PluginOptions'; -import {PluginLogger} from '@parcel/logger'; +import {PluginLogger} from '@atlaspack/logger'; import { getDevDepRequests, invalidateDevDeps, createDevDependency, runDevDepRequest, } from './DevDepRequest'; -import ParcelConfig from '../ParcelConfig'; -import ThrowableDiagnostic, {errorToDiagnostic} from '@parcel/diagnostic'; -import {PluginTracer, tracer} from '@parcel/profiler'; +import AtlaspackConfig from '../AtlaspackConfig'; +import ThrowableDiagnostic, {errorToDiagnostic} from '@atlaspack/diagnostic'; +import {PluginTracer, tracer} from '@atlaspack/profiler'; import {requestTypes} from '../RequestTracker'; const HASH_REF_PREFIX_LEN = HASH_REF_PREFIX.length; @@ -145,9 +145,11 @@ async function run({input, options, api}) { ); let configResult = nullthrows( - await api.runRequest(createParcelConfigRequest()), + await api.runRequest( + createAtlaspackConfigRequest(), + ), ); - let config = getCachedParcelConfig(configResult, options); + let config = getCachedAtlaspackConfig(configResult, options); let {devDeps, invalidDevDeps} = await getDevDepRequests(api); invalidateDevDeps(invalidDevDeps, options, config); @@ -202,8 +204,8 @@ async function writeFiles( inputStream: stream$Readable, info: BundleInfo, hashRefToNameHash: Map, - options: ParcelOptions, - config: ParcelConfig, + options: AtlaspackOptions, + config: AtlaspackConfig, outputFS: FileSystem, filePath: ProjectPath, writeOptions: ?FileOptions, @@ -241,7 +243,7 @@ async function writeFiles( async function runCompressor( compressor: LoadedPlugin, stream: stream$Readable, - options: ParcelOptions, + options: AtlaspackOptions, outputFS: FileSystem, filePath: FilePath, writeOptions: ?FileOptions, diff --git a/packages/core/core/src/requests/WriteBundlesRequest.js b/packages/core/core/src/requests/WriteBundlesRequest.js index 8a50b04e3..80df90480 100644 --- a/packages/core/core/src/requests/WriteBundlesRequest.js +++ b/packages/core/core/src/requests/WriteBundlesRequest.js @@ -1,8 +1,8 @@ // @flow strict-local -import type {ContentKey} from '@parcel/graph'; -import type {Async} from '@parcel/types'; -import type {SharedReference} from '@parcel/workers'; +import type {ContentKey} from '@atlaspack/graph'; +import type {Async} from '@atlaspack/types'; +import type {SharedReference} from '@atlaspack/workers'; import type {StaticRunOpts} from '../RequestTracker'; import {requestTypes} from '../RequestTracker'; import type {PackagedBundleInfo} from '../types'; @@ -12,7 +12,7 @@ import type {BundleInfo} from '../PackagerRunner'; import {HASH_REF_PREFIX} from '../constants'; import {joinProjectPath} from '../projectPath'; import nullthrows from 'nullthrows'; -import {hashString} from '@parcel/rust'; +import {hashString} from '@atlaspack/rust'; import {createPackageRequest} from './PackageRequest'; import createWriteBundleRequest from './WriteBundleRequest'; diff --git a/packages/core/core/src/resolveOptions.js b/packages/core/core/src/resolveOptions.js index 8bbe30cc1..a9de3bea0 100644 --- a/packages/core/core/src/resolveOptions.js +++ b/packages/core/core/src/resolveOptions.js @@ -2,37 +2,37 @@ import type { FilePath, - InitialParcelOptions, + InitialAtlaspackOptions, DependencySpecifier, InitialServerOptions, -} from '@parcel/types'; -import type {FileSystem} from '@parcel/fs'; -import type {ParcelOptions} from './types'; +} from '@atlaspack/types'; +import type {FileSystem} from '@atlaspack/fs'; +import type {AtlaspackOptions} from './types'; import path from 'path'; -import {hashString} from '@parcel/rust'; -import {NodeFS} from '@parcel/fs'; -import {LMDBCache, FSCache} from '@parcel/cache'; -import {NodePackageManager} from '@parcel/package-manager'; +import {hashString} from '@atlaspack/rust'; +import {NodeFS} from '@atlaspack/fs'; +import {LMDBCache, FSCache} from '@atlaspack/cache'; +import {NodePackageManager} from '@atlaspack/package-manager'; import { getRootDir, relativePath, resolveConfig, isGlob, globToRegex, -} from '@parcel/utils'; +} from '@atlaspack/utils'; import loadDotEnv from './loadDotEnv'; import {toProjectPath} from './projectPath'; -import {getResolveFrom} from './requests/ParcelConfigRequest'; +import {getResolveFrom} from './requests/AtlaspackConfigRequest'; -import {DEFAULT_FEATURE_FLAGS} from '@parcel/feature-flags'; -import {PARCEL_VERSION} from './constants'; +import {DEFAULT_FEATURE_FLAGS} from '@atlaspack/feature-flags'; +import {ATLASPACK_VERSION} from './constants'; // Default cache directory name -const DEFAULT_CACHE_DIRNAME = '.parcel-cache'; +const DEFAULT_CACHE_DIRNAME = '.atlaspack-cache'; const LOCK_FILE_NAMES = ['yarn.lock', 'package-lock.json', 'pnpm-lock.yaml']; -// Generate a unique instanceId, will change on every run of parcel +// Generate a unique instanceId, will change on every run of atlaspack function generateInstanceId(entries: Array): string { return hashString( `${entries.join(',')}-${Date.now()}-${Math.round(Math.random() * 100)}`, @@ -45,8 +45,8 @@ function compileGlobs(globs: string[]): RegExp[] { } export default async function resolveOptions( - initialOptions: InitialParcelOptions, -): Promise { + initialOptions: InitialAtlaspackOptions, +): Promise { let inputFS = initialOptions.inputFS || new NodeFS(); let outputFS = initialOptions.outputFS || new NodeFS(); @@ -224,7 +224,7 @@ export default async function resolveOptions( isLibrary: initialOptions?.defaultTargetOptions?.isLibrary, }, featureFlags: {...DEFAULT_FEATURE_FLAGS, ...initialOptions?.featureFlags}, - parcelVersion: PARCEL_VERSION, + atlaspackVersion: ATLASPACK_VERSION, }; } diff --git a/packages/core/core/src/summarizeRequest.js b/packages/core/core/src/summarizeRequest.js index b34a53260..d5b51f7bf 100644 --- a/packages/core/core/src/summarizeRequest.js +++ b/packages/core/core/src/summarizeRequest.js @@ -1,6 +1,6 @@ // @flow strict-local -import type {Blob, FilePath} from '@parcel/types'; -import type {FileSystem} from '@parcel/fs'; +import type {Blob, FilePath} from '@atlaspack/types'; +import type {FileSystem} from '@atlaspack/fs'; import path from 'path'; diff --git a/packages/core/core/src/types.js b/packages/core/core/src/types.js index e165e24c5..8b13a0a36 100644 --- a/packages/core/core/src/types.js +++ b/packages/core/core/src/types.js @@ -1,6 +1,6 @@ // @flow strict-local -import type {ContentKey} from '@parcel/graph'; +import type {ContentKey} from '@atlaspack/graph'; import type { ASTGenerator, BuildMode, @@ -25,38 +25,38 @@ import type { TargetDescriptor, HMROptions, DetailedReportOptions, -} from '@parcel/types'; -import type {SharedReference} from '@parcel/workers'; -import type {FileSystem} from '@parcel/fs'; -import type {Cache} from '@parcel/cache'; -import type {PackageManager} from '@parcel/package-manager'; +} from '@atlaspack/types'; +import type {SharedReference} from '@atlaspack/workers'; +import type {FileSystem} from '@atlaspack/fs'; +import type {Cache} from '@atlaspack/cache'; +import type {PackageManager} from '@atlaspack/package-manager'; import type {ProjectPath} from './projectPath'; import type {Event} from '@parcel/watcher'; -import type {FeatureFlags} from '@parcel/feature-flags'; +import type {FeatureFlags} from '@atlaspack/feature-flags'; import type {BackendType} from '@parcel/watcher'; -export type ParcelPluginNode = {| +export type AtlaspackPluginNode = {| packageName: PackageName, resolveFrom: ProjectPath, keyPath?: string, |}; -export type PureParcelConfigPipeline = $ReadOnlyArray; -export type ExtendableParcelConfigPipeline = $ReadOnlyArray< - ParcelPluginNode | '...', +export type PureAtlaspackConfigPipeline = $ReadOnlyArray; +export type ExtendableAtlaspackConfigPipeline = $ReadOnlyArray< + AtlaspackPluginNode | '...', >; -export type ProcessedParcelConfig = {| - resolvers?: PureParcelConfigPipeline, - transformers?: {[Glob]: ExtendableParcelConfigPipeline, ...}, - bundler: ?ParcelPluginNode, - namers?: PureParcelConfigPipeline, - runtimes?: PureParcelConfigPipeline, - packagers?: {[Glob]: ParcelPluginNode, ...}, - optimizers?: {[Glob]: ExtendableParcelConfigPipeline, ...}, - compressors?: {[Glob]: ExtendableParcelConfigPipeline, ...}, - reporters?: PureParcelConfigPipeline, - validators?: {[Glob]: ExtendableParcelConfigPipeline, ...}, +export type ProcessedAtlaspackConfig = {| + resolvers?: PureAtlaspackConfigPipeline, + transformers?: {[Glob]: ExtendableAtlaspackConfigPipeline, ...}, + bundler: ?AtlaspackPluginNode, + namers?: PureAtlaspackConfigPipeline, + runtimes?: PureAtlaspackConfigPipeline, + packagers?: {[Glob]: AtlaspackPluginNode, ...}, + optimizers?: {[Glob]: ExtendableAtlaspackConfigPipeline, ...}, + compressors?: {[Glob]: ExtendableAtlaspackConfigPipeline, ...}, + reporters?: PureAtlaspackConfigPipeline, + validators?: {[Glob]: ExtendableAtlaspackConfigPipeline, ...}, filePath: ProjectPath, resolveFrom?: ProjectPath, |}; @@ -269,12 +269,12 @@ export type DevDepRequest = {| declare type GlobPattern = string; -export type ParcelOptions = {| +export type AtlaspackOptions = {| entries: Array, config?: DependencySpecifier, defaultConfig?: DependencySpecifier, env: EnvMap, - parcelVersion: string, + atlaspackVersion: string, targets: ?(Array | {+[string]: TargetDescriptor, ...}), shouldDisableCache: boolean, cacheDir: FilePath, diff --git a/packages/core/core/src/utils.js b/packages/core/core/src/utils.js index c43c06741..cc3dd308f 100644 --- a/packages/core/core/src/utils.js +++ b/packages/core/core/src/utils.js @@ -4,20 +4,20 @@ import type { FilePath, FileCreateInvalidation, SourceLocation, -} from '@parcel/types'; +} from '@atlaspack/types'; import type { BundleGroup, - ParcelOptions, + AtlaspackOptions, InternalFileCreateInvalidation, InternalSourceLocation, InternalDevDepOptions, Invalidations, } from './types'; -import type {PackageManager} from '@parcel/package-manager'; +import type {PackageManager} from '@atlaspack/package-manager'; import invariant from 'assert'; import baseX from 'base-x'; -import {hashObject} from '@parcel/utils'; +import {hashObject} from '@atlaspack/utils'; import {fromProjectPath, toProjectPath} from './projectPath'; const base62 = baseX( @@ -73,10 +73,10 @@ const ignoreOptions = new Set([ ]); export function optionsProxy( - options: ParcelOptions, + options: AtlaspackOptions, invalidateOnOptionChange: string => void, addDevDependency?: (devDep: InternalDevDepOptions) => void, -): ParcelOptions { +): AtlaspackOptions { let packageManager = addDevDependency ? proxyPackageManager( options.projectRoot, diff --git a/packages/core/core/src/worker.js b/packages/core/core/src/worker.js index 8d0f2e34d..4e04f5d1d 100644 --- a/packages/core/core/src/worker.js +++ b/packages/core/core/src/worker.js @@ -2,12 +2,12 @@ import type { Bundle, - ParcelOptions, - ProcessedParcelConfig, + AtlaspackOptions, + ProcessedAtlaspackConfig, RequestInvalidation, } from './types'; -import type {SharedReference, WorkerApi} from '@parcel/workers'; -import {loadConfig as configCache} from '@parcel/utils'; +import type {SharedReference, WorkerApi} from '@atlaspack/workers'; +import {loadConfig as configCache} from '@atlaspack/utils'; import type {DevDepSpecifier} from './requests/DevDepRequest'; import invariant from 'assert'; @@ -20,24 +20,24 @@ import Transformation, { import {reportWorker, report} from './ReporterRunner'; import PackagerRunner, {type RunPackagerRunnerResult} from './PackagerRunner'; import Validation, {type ValidationOpts} from './Validation'; -import ParcelConfig from './ParcelConfig'; +import AtlaspackConfig from './AtlaspackConfig'; import {registerCoreWithSerializer} from './registerCoreWithSerializer'; import {clearBuildCaches} from './buildCache'; import {init as initSourcemaps} from '@parcel/source-map'; -import {init as initRust} from '@parcel/rust'; -import WorkerFarm from '@parcel/workers'; -import {setFeatureFlags} from '@parcel/feature-flags'; +import {init as initRust} from '@atlaspack/rust'; +import WorkerFarm from '@atlaspack/workers'; +import {setFeatureFlags} from '@atlaspack/feature-flags'; -import '@parcel/cache'; // register with serializer -import '@parcel/package-manager'; -import '@parcel/fs'; +import '@atlaspack/cache'; // register with serializer +import '@atlaspack/package-manager'; +import '@atlaspack/fs'; // $FlowFixMe -if (process.env.PARCEL_BUILD_REPL && process.browser) { +if (process.env.ATLASPACK_BUILD_REPL && process.browser) { /* eslint-disable import/no-extraneous-dependencies, monorepo/no-internal-import */ - require('@parcel/repl/src/parcel/BrowserPackageManager.js'); + require('@atlaspack/repl/src/atlaspack/BrowserPackageManager.js'); // $FlowFixMe - require('@parcel/repl/src/parcel/ExtendedMemoryFS.js'); + require('@atlaspack/repl/src/atlaspack/ExtendedMemoryFS.js'); /* eslint-enable import/no-extraneous-dependencies, monorepo/no-internal-import */ } @@ -46,39 +46,39 @@ registerCoreWithSerializer(); // Remove the workerApi type from the TransformationOpts and ValidationOpts types: // https://github.com/facebook/flow/issues/2835 type WorkerTransformationOpts = {| - ...$Diff, + ...$Diff, optionsRef: SharedReference, configCachePath: string, |}; type WorkerValidationOpts = {| - ...$Diff, + ...$Diff, optionsRef: SharedReference, configCachePath: string, |}; // TODO: this should eventually be replaced by an in memory cache layer -let parcelConfigCache = new Map(); +let atlaspackConfigCache = new Map(); function loadOptions(ref, workerApi) { return nullthrows( ((workerApi.getSharedReference( ref, // $FlowFixMe - ): any): ParcelOptions), + ): any): AtlaspackOptions), ); } async function loadConfig(cachePath, options) { - let config = parcelConfigCache.get(cachePath); + let config = atlaspackConfigCache.get(cachePath); if (config && config.options === options) { return config; } let processedConfig = nullthrows( - await options.cache.get(cachePath), + await options.cache.get(cachePath), ); - config = new ParcelConfig(processedConfig, options); - parcelConfigCache.set(cachePath, config); + config = new AtlaspackConfig(processedConfig, options); + atlaspackConfigCache.set(cachePath, config); setFeatureFlags(options.featureFlags); @@ -146,10 +146,10 @@ export async function runPackage( let bundleGraph = workerApi.getSharedReference(bundleGraphReference); invariant(bundleGraph instanceof BundleGraph); let options = loadOptions(optionsRef, workerApi); - let parcelConfig = await loadConfig(configCachePath, options); + let atlaspackConfig = await loadConfig(configCachePath, options); let runner = new PackagerRunner({ - config: parcelConfig, + config: atlaspackConfig, options, report: WorkerFarm.isWorker() ? reportWorker.bind(null, workerApi) : report, previousDevDeps, @@ -167,7 +167,7 @@ export async function childInit() { const PKG_RE = /node_modules[/\\]((?:@[^/\\]+[/\\][^/\\]+)|[^/\\]+)(?!.*[/\\]node_modules[/\\])/; export function invalidateRequireCache(workerApi: WorkerApi, file: string) { - if (process.env.PARCEL_BUILD_ENV === 'test') { + if (process.env.ATLASPACK_BUILD_ENV === 'test') { // Delete this module and all children in the same node_modules folder let module = require.cache[file]; if (module) { @@ -181,7 +181,7 @@ export function invalidateRequireCache(workerApi: WorkerApi, file: string) { } } - parcelConfigCache.clear(); + atlaspackConfigCache.clear(); return; } diff --git a/packages/core/core/test/Parcel.test.js b/packages/core/core/test/Atlaspack.test.js similarity index 58% rename from packages/core/core/test/Parcel.test.js rename to packages/core/core/test/Atlaspack.test.js index fec67bc03..cea158cb9 100644 --- a/packages/core/core/test/Parcel.test.js +++ b/packages/core/core/test/Atlaspack.test.js @@ -1,14 +1,14 @@ // @flow strict-local -import type {InitialParcelOptions} from '@parcel/types'; -import WorkerFarm from '@parcel/workers'; +import type {InitialAtlaspackOptions} from '@atlaspack/types'; +import WorkerFarm from '@atlaspack/workers'; // flowlint-next-line untyped-import:off import sinon from 'sinon'; import assert from 'assert'; import path from 'path'; -import Parcel, {createWorkerFarm} from '../src/Parcel'; +import Atlaspack, {createWorkerFarm} from '../src/Atlaspack'; -describe('Parcel', function () { +describe('Atlaspack', function () { this.timeout(75000); let workerFarm; @@ -20,10 +20,10 @@ describe('Parcel', function () { it('does not initialize when passed an ending farm', async () => { workerFarm.ending = true; - let parcel = createParcel({workerFarm}); + let atlaspack = createAtlaspack({workerFarm}); // $FlowFixMe - await assert.rejects(() => parcel.run(), { + await assert.rejects(() => atlaspack.run(), { name: 'Error', message: 'Supplied WorkerFarm is ending', }); @@ -31,7 +31,7 @@ describe('Parcel', function () { workerFarm.ending = false; }); - describe('parcel.end()', () => { + describe('atlaspack.end()', () => { let endSpy; beforeEach(() => { endSpy = sinon.spy(WorkerFarm.prototype, 'end'); @@ -42,31 +42,31 @@ describe('Parcel', function () { }); it('ends any WorkerFarm it creates', async () => { - let parcel = createParcel(); - await parcel.run(); + let atlaspack = createAtlaspack(); + await atlaspack.run(); assert.equal(endSpy.callCount, 1); }); it('runs and constructs another farm for subsequent builds', async () => { - let parcel = createParcel(); + let atlaspack = createAtlaspack(); - await parcel.run(); - await parcel.run(); + await atlaspack.run(); + await atlaspack.run(); assert.equal(endSpy.callCount, 2); }); it('does not end passed WorkerFarms', async () => { - let parcel = createParcel({workerFarm}); - await parcel.run(); + let atlaspack = createAtlaspack({workerFarm}); + await atlaspack.run(); assert.equal(endSpy.callCount, 0); await workerFarm.end(); }); it('removes shared references it creates', async () => { - let parcel = createParcel({workerFarm}); - await parcel.run(); + let atlaspack = createAtlaspack({workerFarm}); + await atlaspack.run(); assert.equal(workerFarm.sharedReferences.size, 0); assert.equal(workerFarm.sharedReferencesByValue.size, 0); @@ -75,7 +75,7 @@ describe('Parcel', function () { }); }); -describe('ParcelAPI', function () { +describe('AtlaspackAPI', function () { this.timeout(75000); let workerFarm; @@ -85,20 +85,20 @@ describe('ParcelAPI', function () { afterEach(() => workerFarm.end()); - describe('parcel.unstable_transform()', () => { + describe('atlaspack.unstable_transform()', () => { it('should transform simple file', async () => { - let parcel = createParcel({workerFarm}); - let res = await parcel.unstable_transform({ - filePath: path.join(__dirname, 'fixtures/parcel/index.js'), + let atlaspack = createAtlaspack({workerFarm}); + let res = await atlaspack.unstable_transform({ + filePath: path.join(__dirname, 'fixtures/atlaspack/index.js'), }); let code = await res[0].getCode(); assert(code.includes(`exports.default = 'test'`)); }); it('should transform with standalone mode', async () => { - let parcel = createParcel({workerFarm}); - let res = await parcel.unstable_transform({ - filePath: path.join(__dirname, 'fixtures/parcel/other.js'), + let atlaspack = createAtlaspack({workerFarm}); + let res = await atlaspack.unstable_transform({ + filePath: path.join(__dirname, 'fixtures/atlaspack/other.js'), query: 'standalone=true', }); let code = await res[0].getCode(); @@ -109,17 +109,17 @@ describe('ParcelAPI', function () { }); }); - describe('parcel.resolve()', () => { + describe('atlaspack.resolve()', () => { it('should resolve dependencies', async () => { - let parcel = createParcel({workerFarm}); - let res = await parcel.unstable_resolve({ + let atlaspack = createAtlaspack({workerFarm}); + let res = await atlaspack.unstable_resolve({ specifier: './other', specifierType: 'esm', - resolveFrom: path.join(__dirname, 'fixtures/parcel/index.js'), + resolveFrom: path.join(__dirname, 'fixtures/atlaspack/index.js'), }); assert.deepEqual(res, { - filePath: path.join(__dirname, 'fixtures/parcel/other.js'), + filePath: path.join(__dirname, 'fixtures/atlaspack/other.js'), code: undefined, query: undefined, sideEffects: true, @@ -128,13 +128,13 @@ describe('ParcelAPI', function () { }); }); -function createParcel(opts?: InitialParcelOptions) { - return new Parcel({ - entries: [path.join(__dirname, 'fixtures/parcel/index.js')], +function createAtlaspack(opts?: InitialAtlaspackOptions) { + return new Atlaspack({ + entries: [path.join(__dirname, 'fixtures/atlaspack/index.js')], logLevel: 'info', defaultConfig: path.join( - path.dirname(require.resolve('@parcel/test-utils')), - '.parcelrc-no-reporters', + path.dirname(require.resolve('@atlaspack/test-utils')), + '.atlaspackrc-no-reporters', ), shouldDisableCache: true, ...opts, diff --git a/packages/core/core/test/ParcelConfig.test.js b/packages/core/core/test/AtlaspackConfig.test.js similarity index 71% rename from packages/core/core/test/ParcelConfig.test.js rename to packages/core/core/test/AtlaspackConfig.test.js index fa10031ff..604e6d348 100644 --- a/packages/core/core/test/ParcelConfig.test.js +++ b/packages/core/core/test/AtlaspackConfig.test.js @@ -1,32 +1,32 @@ // @flow strict-local -import ParcelConfig from '../src/ParcelConfig'; +import AtlaspackConfig from '../src/AtlaspackConfig'; import assert from 'assert'; import path from 'path'; import sinon from 'sinon'; -import logger from '@parcel/logger'; -import {inputFS} from '@parcel/test-utils'; -import {parseAndProcessConfig} from '../src/requests/ParcelConfigRequest'; +import logger from '@atlaspack/logger'; +import {inputFS} from '@atlaspack/test-utils'; +import {parseAndProcessConfig} from '../src/requests/AtlaspackConfigRequest'; import {DEFAULT_OPTIONS} from './test-utils'; import {toProjectPath} from '../src/projectPath'; -const PARCELRC_PATH = toProjectPath('/', '/.parcelrc'); +const ATLASPACKRC_PATH = toProjectPath('/', '/.atlaspackrc'); -describe('ParcelConfig', () => { +describe('AtlaspackConfig', () => { describe('matchGlobMap', () => { - let config = new ParcelConfig( + let config = new AtlaspackConfig( { - filePath: PARCELRC_PATH, + filePath: ATLASPACKRC_PATH, bundler: undefined, packagers: { '*.css': { - packageName: 'parcel-packager-css', - resolveFrom: PARCELRC_PATH, + packageName: 'atlaspack-packager-css', + resolveFrom: ATLASPACKRC_PATH, keyPath: '/packagers/*.css', }, '*.js': { - packageName: 'parcel-packager-js', - resolveFrom: PARCELRC_PATH, + packageName: 'atlaspack-packager-js', + resolveFrom: ATLASPACKRC_PATH, keyPath: '/packagers/*.js', }, }, @@ -48,31 +48,31 @@ describe('ParcelConfig', () => { config.packagers, ); assert.deepEqual(result, { - packageName: 'parcel-packager-js', - resolveFrom: PARCELRC_PATH, + packageName: 'atlaspack-packager-js', + resolveFrom: ATLASPACKRC_PATH, keyPath: '/packagers/*.js', }); }); }); describe('matchGlobMapPipelines', () => { - let config = new ParcelConfig( + let config = new AtlaspackConfig( { - filePath: PARCELRC_PATH, + filePath: ATLASPACKRC_PATH, bundler: undefined, transformers: { '*.jsx': [ { - packageName: 'parcel-transform-jsx', - resolveFrom: PARCELRC_PATH, + packageName: 'atlaspack-transform-jsx', + resolveFrom: ATLASPACKRC_PATH, keyPath: '/transformers/*.jsx/0', }, '...', ], '*.{js,jsx}': [ { - packageName: 'parcel-transform-js', - resolveFrom: PARCELRC_PATH, + packageName: 'atlaspack-transform-js', + resolveFrom: ATLASPACKRC_PATH, keyPath: '/transformers/*.{js,jsx}/0', }, ], @@ -96,8 +96,8 @@ describe('ParcelConfig', () => { ); assert.deepEqual(pipeline, [ { - packageName: 'parcel-transform-js', - resolveFrom: PARCELRC_PATH, + packageName: 'atlaspack-transform-js', + resolveFrom: ATLASPACKRC_PATH, keyPath: '/transformers/*.{js,jsx}/0', }, ]); @@ -110,13 +110,13 @@ describe('ParcelConfig', () => { ); assert.deepEqual(pipeline, [ { - packageName: 'parcel-transform-jsx', - resolveFrom: PARCELRC_PATH, + packageName: 'atlaspack-transform-jsx', + resolveFrom: ATLASPACKRC_PATH, keyPath: '/transformers/*.jsx/0', }, { - packageName: 'parcel-transform-js', - resolveFrom: PARCELRC_PATH, + packageName: 'atlaspack-transform-js', + resolveFrom: ATLASPACKRC_PATH, keyPath: '/transformers/*.{js,jsx}/0', }, ]); @@ -124,20 +124,20 @@ describe('ParcelConfig', () => { }); describe('loadPlugin', () => { - it('should warn if a plugin needs to specify an engines.parcel field in package.json', async () => { + it('should warn if a plugin needs to specify an engines.atlaspack field in package.json', async () => { let projectRoot = path.join(__dirname, 'fixtures', 'plugins'); let configFilePath = toProjectPath( projectRoot, - path.join(__dirname, 'fixtures', 'plugins', '.parcelrc'), + path.join(__dirname, 'fixtures', 'plugins', '.atlaspackrc'), ); - let config = new ParcelConfig( + let config = new AtlaspackConfig( { filePath: configFilePath, bundler: undefined, transformers: { '*.js': [ { - packageName: 'parcel-transformer-no-engines', + packageName: 'atlaspack-transformer-no-engines', resolveFrom: configFilePath, keyPath: '/transformers/*.js/0', }, @@ -149,7 +149,7 @@ describe('ParcelConfig', () => { let warnStub = sinon.stub(logger, 'warn'); let {plugin} = await config.loadPlugin({ - packageName: 'parcel-transformer-no-engines', + packageName: 'atlaspack-transformer-no-engines', resolveFrom: configFilePath, keyPath: '/transformers/*.js/0', }); @@ -157,27 +157,27 @@ describe('ParcelConfig', () => { assert.equal(typeof plugin.transform, 'function'); assert(warnStub.calledOnce); assert.deepEqual(warnStub.getCall(0).args[0], { - origin: '@parcel/core', + origin: '@atlaspack/core', message: - 'The plugin "parcel-transformer-no-engines" needs to specify a `package.json#engines.parcel` field with the supported Parcel version range.', + 'The plugin "atlaspack-transformer-no-engines" needs to specify a `package.json#engines.atlaspack` field with the supported Atlaspack version range.', }); warnStub.restore(); }); - it('should error if a plugin specifies an invalid engines.parcel field in package.json', async () => { + it('should error if a plugin specifies an invalid engines.atlaspack field in package.json', async () => { let projectRoot = path.join(__dirname, 'fixtures', 'plugins'); let configFilePath = toProjectPath( projectRoot, - path.join(__dirname, 'fixtures', 'plugins', '.parcelrc'), + path.join(__dirname, 'fixtures', 'plugins', '.atlaspackrc'), ); - let config = new ParcelConfig( + let config = new AtlaspackConfig( { filePath: configFilePath, bundler: undefined, transformers: { '*.js': [ { - packageName: 'parcel-transformer-not-found', + packageName: 'atlaspack-transformer-not-found', resolveFrom: configFilePath, keyPath: '/transformers/*.js/0', }, @@ -187,13 +187,13 @@ describe('ParcelConfig', () => { {...DEFAULT_OPTIONS, projectRoot}, ); // $FlowFixMe[untyped-import] - let parcelVersion = require('../package.json').version; + let atlaspackVersion = require('../package.json').version; let pkgJSON = path.join( __dirname, 'fixtures', 'plugins', 'node_modules', - 'parcel-transformer-bad-engines', + 'atlaspack-transformer-bad-engines', 'package.json', ); let code = inputFS.readFileSync(pkgJSON, 'utf8'); @@ -202,7 +202,7 @@ describe('ParcelConfig', () => { await assert.rejects( () => config.loadPlugin({ - packageName: 'parcel-transformer-bad-engines', + packageName: 'atlaspack-transformer-bad-engines', resolveFrom: configFilePath, keyPath: '/transformers/*.js/0', }), @@ -210,8 +210,8 @@ describe('ParcelConfig', () => { name: 'Error', diagnostics: [ { - message: `The plugin "parcel-transformer-bad-engines" is not compatible with the current version of Parcel. Requires "5.x" but the current version is "${parcelVersion}".`, - origin: '@parcel/core', + message: `The plugin "atlaspack-transformer-bad-engines" is not compatible with the current version of Atlaspack. Requires "5.x" but the current version is "${atlaspackVersion}".`, + origin: '@atlaspack/core', codeFrames: [ { filePath: pkgJSON, @@ -220,7 +220,7 @@ describe('ParcelConfig', () => { codeHighlights: [ { start: {line: 5, column: 5}, - end: {line: 5, column: 19}, + end: {line: 5, column: 22}, message: undefined, }, ], @@ -237,7 +237,7 @@ describe('ParcelConfig', () => { __dirname, 'fixtures', 'config-plugin-not-found', - '.parcelrc', + '.atlaspackrc', ); let code = await DEFAULT_OPTIONS.inputFS.readFile(configFilePath, 'utf8'); let {config} = await parseAndProcessConfig( @@ -245,15 +245,15 @@ describe('ParcelConfig', () => { code, DEFAULT_OPTIONS, ); - let parcelConfig = new ParcelConfig(config, DEFAULT_OPTIONS); + let atlaspackConfig = new AtlaspackConfig(config, DEFAULT_OPTIONS); // $FlowFixMe - await assert.rejects(() => parcelConfig.getTransformers('test.js'), { + await assert.rejects(() => atlaspackConfig.getTransformers('test.js'), { name: 'Error', diagnostics: [ { - message: 'Cannot find Parcel plugin "@parcel/transformer-jj"', - origin: '@parcel/core', + message: 'Cannot find Atlaspack plugin "@atlaspack/transformer-jj"', + origin: '@atlaspack/core', codeFrames: [ { filePath: configFilePath, @@ -262,8 +262,8 @@ describe('ParcelConfig', () => { codeHighlights: [ { start: {line: 4, column: 14}, - end: {line: 4, column: 37}, - message: `Cannot find module "@parcel/transformer-jj", did you mean "@parcel/transformer-js"?`, + end: {line: 4, column: 40}, + message: `Cannot find module "@atlaspack/transformer-jj", did you mean "@atlaspack/transformer-js"?`, }, ], }, @@ -278,7 +278,7 @@ describe('ParcelConfig', () => { __dirname, 'fixtures', 'config-node-pipeline', - '.parcelrc', + '.atlaspackrc', ); let code = await DEFAULT_OPTIONS.inputFS.readFile(configFilePath, 'utf8'); @@ -290,7 +290,7 @@ describe('ParcelConfig', () => { diagnostics: [ { message: "Named pipeline 'node:' is reserved.", - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: configFilePath, @@ -323,9 +323,9 @@ describe('ParcelConfig', () => { let projectRoot = path.join(__dirname, 'fixtures', 'plugins'); let configFilePath = toProjectPath( projectRoot, - path.join(__dirname, 'fixtures', 'plugins', '.parcelrc'), + path.join(__dirname, 'fixtures', 'plugins', '.atlaspackrc'), ); - let config = new ParcelConfig( + let config = new AtlaspackConfig( { filePath: configFilePath, bundler: undefined, @@ -354,7 +354,7 @@ describe('ParcelConfig', () => { __dirname, 'fixtures', 'local-plugin-config-pkg', - '.parcelrc', + '.atlaspackrc', ); let code = await DEFAULT_OPTIONS.inputFS.readFile(configFilePath, 'utf8'); let {config} = await parseAndProcessConfig( @@ -362,24 +362,24 @@ describe('ParcelConfig', () => { code, DEFAULT_OPTIONS, ); - let parcelConfig = new ParcelConfig(config, DEFAULT_OPTIONS); + let atlaspackConfig = new AtlaspackConfig(config, DEFAULT_OPTIONS); let extendedConfigPath = path.join( __dirname, 'fixtures', 'local-plugin-config-pkg', 'node_modules', - 'parcel-config-local', + 'atlaspack-config-local', 'index.json', ); // $FlowFixMe - await assert.rejects(() => parcelConfig.getTransformers('test.js'), { + await assert.rejects(() => atlaspackConfig.getTransformers('test.js'), { name: 'Error', diagnostics: [ { message: - 'Local plugins are not supported in Parcel config packages. Please publish "./local-plugin" as a separate npm package.', - origin: '@parcel/core', + 'Local plugins are not supported in Atlaspack config packages. Please publish "./local-plugin" as a separate npm package.', + origin: '@atlaspack/core', codeFrames: [ { filePath: extendedConfigPath, diff --git a/packages/core/core/test/ParcelConfigRequest.test.js b/packages/core/core/test/AtlaspackConfigRequest.test.js similarity index 64% rename from packages/core/core/test/ParcelConfigRequest.test.js rename to packages/core/core/test/AtlaspackConfigRequest.test.js index b1ad8e7eb..cb5865db1 100644 --- a/packages/core/core/test/ParcelConfigRequest.test.js +++ b/packages/core/core/test/AtlaspackConfigRequest.test.js @@ -2,7 +2,7 @@ import assert from 'assert'; import nullthrows from 'nullthrows'; import path from 'path'; -import ParcelConfig from '../src/ParcelConfig'; +import AtlaspackConfig from '../src/AtlaspackConfig'; import { validateConfigFile, mergePipelines, @@ -10,70 +10,83 @@ import { mergeConfigs, resolveExtends, parseAndProcessConfig, - resolveParcelConfig, + resolveAtlaspackConfig, processConfig, -} from '../src/requests/ParcelConfigRequest'; -import {validatePackageName} from '../src/ParcelConfig.schema'; +} from '../src/requests/AtlaspackConfigRequest'; +import {validatePackageName} from '../src/AtlaspackConfig.schema'; import {DEFAULT_OPTIONS, relative} from './test-utils'; import {toProjectPath} from '../src/projectPath'; -describe('ParcelConfigRequest', () => { +describe('AtlaspackConfigRequest', () => { describe('validatePackageName', () => { it('should error on an invalid official package', () => { assert.throws(() => { - validatePackageName('@parcel/foo-bar', 'transform', 'transformers'); - }, /Official parcel transform packages must be named according to "@parcel\/transform-{name}"/); + validatePackageName('@atlaspack/foo-bar', 'transform', 'transformers'); + }, /Official atlaspack transform packages must be named according to "@atlaspack\/transform-{name}"/); assert.throws(() => { - validatePackageName('@parcel/transformer', 'transform', 'transformers'); - }, /Official parcel transform packages must be named according to "@parcel\/transform-{name}"/); + validatePackageName( + '@atlaspack/transformer', + 'transform', + 'transformers', + ); + }, /Official atlaspack transform packages must be named according to "@atlaspack\/transform-{name}"/); }); it('should succeed on a valid official package', () => { - validatePackageName('@parcel/transform-bar', 'transform', 'transformers'); + validatePackageName( + '@atlaspack/transform-bar', + 'transform', + 'transformers', + ); }); it('should error on an invalid community package', () => { assert.throws(() => { validatePackageName('foo-bar', 'transform', 'transformers'); - }, /Parcel transform packages must be named according to "parcel-transform-{name}"/); + }, /Atlaspack transform packages must be named according to "atlaspack-transform-{name}"/); assert.throws(() => { - validatePackageName('parcel-foo-bar', 'transform', 'transformers'); - }, /Parcel transform packages must be named according to "parcel-transform-{name}"/); + validatePackageName('atlaspack-foo-bar', 'transform', 'transformers'); + }, /Atlaspack transform packages must be named according to "atlaspack-transform-{name}"/); assert.throws(() => { - validatePackageName('parcel-transform', 'transform', 'transformers'); - }, /Parcel transform packages must be named according to "parcel-transform-{name}"/); + validatePackageName('atlaspack-transform', 'transform', 'transformers'); + }, /Atlaspack transform packages must be named according to "atlaspack-transform-{name}"/); }); it('should succeed on a valid community package', () => { - validatePackageName('parcel-transform-bar', 'transform', 'transformers'); + validatePackageName( + 'atlaspack-transform-bar', + 'transform', + 'transformers', + ); }); - it('should error on an invalid scoped package', () => { + // Skipping this while the migration to atlaspack occurs + it.skip('should error on an invalid scoped package', () => { assert.throws(() => { validatePackageName('@test/foo-bar', 'transform', 'transformers'); - }, /Scoped parcel transform packages must be named according to "@test\/parcel-transform\[-{name}\]"/); + }, /Scoped atlaspack transform packages must be named according to "@test\/atlaspack-transform\[-{name}\]"/); assert.throws(() => { validatePackageName( - '@test/parcel-foo-bar', + '@test/atlaspack-foo-bar', 'transform', 'transformers', ); - }, /Scoped parcel transform packages must be named according to "@test\/parcel-transform\[-{name}\]"/); + }, /Scoped atlaspack transform packages must be named according to "@test\/atlaspack-transform\[-{name}\]"/); }); it('should succeed on a valid scoped package', () => { validatePackageName( - '@test/parcel-transform-bar', + '@test/atlaspack-transform-bar', 'transform', 'transformers', ); validatePackageName( - '@test/parcel-transform', + '@test/atlaspack-transform', 'transform', 'transformers', ); @@ -81,7 +94,7 @@ describe('ParcelConfigRequest', () => { it('should succeed on a local package', () => { validatePackageName( - './parcel-transform-bar', + './atlaspack-transform-bar', 'transform', 'transformers', ); @@ -94,13 +107,13 @@ describe('ParcelConfigRequest', () => { assert.throws(() => { validateConfigFile( { - filePath: '.parcelrc', - extends: 'parcel-config-foo', + filePath: '.atlaspackrc', + extends: 'atlaspack-config-foo', transformers: { - '*.js': ['parcel-invalid-plugin'], + '*.js': ['atlaspack-invalid-plugin'], }, }, - '.parcelrc', + '.atlaspackrc', ); }); }); @@ -110,10 +123,10 @@ describe('ParcelConfigRequest', () => { validateConfigFile( // $FlowExpectedError[incompatible-call] { - filePath: '.parcelrc', + filePath: '.atlaspackrc', resolvers: '123', }, - '.parcelrc', + '.atlaspackrc', ); }); }); @@ -122,11 +135,11 @@ describe('ParcelConfigRequest', () => { assert.throws(() => { validateConfigFile( { - filePath: '.parcelrc', + filePath: '.atlaspackrc', // $FlowExpectedError[incompatible-call] resolvers: [1, '123', 5], }, - '.parcelrc', + '.atlaspackrc', ); }); }); @@ -135,10 +148,10 @@ describe('ParcelConfigRequest', () => { assert.throws(() => { validateConfigFile( { - filePath: '.parcelrc', - resolvers: ['parcel-foo-bar'], + filePath: '.atlaspackrc', + resolvers: ['atlaspack-foo-bar'], }, - '.parcelrc', + '.atlaspackrc', ); }); }); @@ -146,20 +159,20 @@ describe('ParcelConfigRequest', () => { it('should succeed with an array of valid package names', () => { validateConfigFile( { - filePath: '.parcelrc', - resolvers: ['parcel-resolver-test'], + filePath: '.atlaspackrc', + resolvers: ['atlaspack-resolver-test'], }, - '.parcelrc', + '.atlaspackrc', ); }); it('should support spread elements', () => { validateConfigFile( { - filePath: '.parcelrc', - resolvers: ['parcel-resolver-test', '...'], + filePath: '.atlaspackrc', + resolvers: ['atlaspack-resolver-test', '...'], }, - '.parcelrc', + '.atlaspackrc', ); }); @@ -167,11 +180,11 @@ describe('ParcelConfigRequest', () => { assert.throws(() => { validateConfigFile( { - filePath: '.parcelrc', + filePath: '.atlaspackrc', // $FlowExpectedError[incompatible-call] - transformers: ['parcel-transformer-test', '...'], + transformers: ['atlaspack-transformer-test', '...'], }, - '.parcelrc', + '.atlaspackrc', ); }); }); @@ -180,13 +193,13 @@ describe('ParcelConfigRequest', () => { assert.throws(() => { validateConfigFile( { - filePath: '.parcelrc', + filePath: '.atlaspackrc', transformers: { - 'types:*.{ts,tsx}': ['@parcel/transformer-typescript-types'], + 'types:*.{ts,tsx}': ['@atlaspack/transformer-typescript-types'], 'bundle-text:*': ['-inline-string', '...'], }, }, - '.parcelrc', + '.atlaspackrc', ); }); }); @@ -196,21 +209,21 @@ describe('ParcelConfigRequest', () => { validateConfigFile( // $FlowExpectedError[incompatible-call] { - filePath: '.parcelrc', + filePath: '.atlaspackrc', extends: 2, }, - '.parcelrc', + '.atlaspackrc', ); }); assert.throws(() => { validateConfigFile( { - filePath: '.parcelrc', + filePath: '.atlaspackrc', // $FlowExpectedError[incompatible-call] extends: [2, 7], }, - '.parcelrc', + '.atlaspackrc', ); }); }); @@ -218,18 +231,18 @@ describe('ParcelConfigRequest', () => { it('should support relative paths', () => { validateConfigFile( { - filePath: '.parcelrc', + filePath: '.atlaspackrc', extends: './foo', }, - '.parcelrc', + '.atlaspackrc', ); validateConfigFile( { - filePath: '.parcelrc', + filePath: '.atlaspackrc', extends: ['./foo', './bar'], }, - '.parcelrc', + '.atlaspackrc', ); }); @@ -237,37 +250,37 @@ describe('ParcelConfigRequest', () => { assert.throws(() => { validateConfigFile( { - filePath: '.parcelrc', + filePath: '.atlaspackrc', extends: 'foo', }, - '.parcelrc', + '.atlaspackrc', ); }); assert.throws(() => { validateConfigFile( { - filePath: '.parcelrc', + filePath: '.atlaspackrc', extends: ['foo', 'bar'], }, - '.parcelrc', + '.atlaspackrc', ); }); validateConfigFile( { - filePath: '.parcelrc', - extends: 'parcel-config-foo', + filePath: '.atlaspackrc', + extends: 'atlaspack-config-foo', }, - '.parcelrc', + '.atlaspackrc', ); validateConfigFile( { - filePath: '.parcelrc', - extends: ['parcel-config-foo', 'parcel-config-bar'], + filePath: '.atlaspackrc', + extends: ['atlaspack-config-foo', 'atlaspack-config-bar'], }, - '.parcelrc', + '.atlaspackrc', ); }); @@ -277,18 +290,18 @@ describe('ParcelConfigRequest', () => { validateConfigFile( // $FlowExpectedError { - extends: '@parcel/config-default', - '@parcel/transformer-js': { + extends: '@atlaspack/config-default', + '@atlaspack/transformer-js': { inlineEnvironment: false, }, }, - '.parcelrc', + '.atlaspackrc', ); }, e => { assert.strictEqual( e.diagnostics[0].codeFrames[0].codeHighlights[0].message, - `Did you mean "transformers"?`, + `Possible values: "$schema", "bundler", "resolvers", "transformers", "validators", "namers", "packagers", "optimizers", "compressors", "reporters", "runtimes", "filePath", "resolveFrom"`, ); return true; }, @@ -298,22 +311,22 @@ describe('ParcelConfigRequest', () => { it('should succeed on valid config', () => { validateConfigFile( { - filePath: '.parcelrc', - extends: 'parcel-config-foo', + filePath: '.atlaspackrc', + extends: 'atlaspack-config-foo', transformers: { - '*.js': ['parcel-transformer-foo'], + '*.js': ['atlaspack-transformer-foo'], }, }, - '.parcelrc', + '.atlaspackrc', ); }); it('should throw error on empty config file', () => { assert.throws( () => { - validateConfigFile({}, '.parcelrc'); + validateConfigFile({}, '.atlaspackrc'); }, - {name: 'Error', message: ".parcelrc can't be empty"}, + {name: 'Error', message: ".atlaspackrc can't be empty"}, ); }); }); @@ -328,8 +341,8 @@ describe('ParcelConfigRequest', () => { mergePipelines( [ { - packageName: 'parcel-transform-foo', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-foo', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, ], @@ -337,8 +350,8 @@ describe('ParcelConfigRequest', () => { ), [ { - packageName: 'parcel-transform-foo', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-foo', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/0', }, ], @@ -349,15 +362,15 @@ describe('ParcelConfigRequest', () => { assert.deepEqual( mergePipelines(null, [ { - packageName: 'parcel-transform-bar', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-bar', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, ]), [ { - packageName: 'parcel-transform-bar', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-bar', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/0', }, ], @@ -369,23 +382,23 @@ describe('ParcelConfigRequest', () => { mergePipelines( [ { - packageName: 'parcel-transform-foo', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-foo', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, ], [ { - packageName: 'parcel-transform-bar', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-bar', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, ], ), [ { - packageName: 'parcel-transform-bar', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-bar', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/0', }, ], @@ -397,39 +410,39 @@ describe('ParcelConfigRequest', () => { mergePipelines( [ { - packageName: 'parcel-transform-foo', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-foo', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, ], [ { - packageName: 'parcel-transform-bar', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-bar', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, '...', { - packageName: 'parcel-transform-baz', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-baz', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/2', }, ], ), [ { - packageName: 'parcel-transform-bar', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-bar', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/0', }, { - packageName: 'parcel-transform-foo', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-foo', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/0', }, { - packageName: 'parcel-transform-baz', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-baz', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/2', }, ], @@ -441,21 +454,21 @@ describe('ParcelConfigRequest', () => { mergePipelines( [ { - packageName: 'parcel-transform-foo', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-foo', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, ], [ { - packageName: 'parcel-transform-bar', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-bar', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, '...', { - packageName: 'parcel-transform-baz', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-baz', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/2', }, '...', @@ -468,26 +481,26 @@ describe('ParcelConfigRequest', () => { assert.deepEqual( mergePipelines(null, [ { - packageName: 'parcel-transform-bar', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-bar', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, '...', { - packageName: 'parcel-transform-baz', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-baz', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/2', }, ]), [ { - packageName: 'parcel-transform-bar', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-bar', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/0', }, { - packageName: 'parcel-transform-baz', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-baz', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/2', }, ], @@ -498,14 +511,14 @@ describe('ParcelConfigRequest', () => { assert.throws(() => { mergePipelines(null, [ { - packageName: 'parcel-transform-bar', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-bar', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, '...', { - packageName: 'parcel-transform-baz', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-baz', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/2', }, '...', @@ -555,35 +568,35 @@ describe('ParcelConfigRequest', () => { describe('mergeConfigs', () => { it('should merge configs', () => { - let base = new ParcelConfig( + let base = new AtlaspackConfig( { - filePath: toProjectPath('/', '/.parcelrc'), + filePath: toProjectPath('/', '/.atlaspackrc'), resolvers: [ { - packageName: 'parcel-resolver-base', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-resolver-base', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/resolvers/0', }, ], transformers: { '*.js': [ { - packageName: 'parcel-transform-base', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-base', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.js/0', }, ], '*.css': [ { - packageName: 'parcel-transform-css', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-transform-css', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/transformers/*.css/0', }, ], }, bundler: { - packageName: 'parcel-bundler-base', - resolveFrom: toProjectPath('/', '/.parcelrc'), + packageName: 'atlaspack-bundler-base', + resolveFrom: toProjectPath('/', '/.atlaspackrc'), keyPath: '/bundler', }, }, @@ -591,11 +604,11 @@ describe('ParcelConfigRequest', () => { ); let ext = { - filePath: '.parcelrc', + filePath: '.atlaspackrc', resolvers: [ { - packageName: 'parcel-resolver-ext', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-resolver-ext', + resolveFrom: '.atlaspackrc', keyPath: '/resolvers/0', }, '...', @@ -603,8 +616,8 @@ describe('ParcelConfigRequest', () => { transformers: { '*.js': [ { - packageName: 'parcel-transform-ext', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-ext', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/0', }, '...', @@ -613,43 +626,43 @@ describe('ParcelConfigRequest', () => { }; let merged = { - filePath: '.parcelrc', + filePath: '.atlaspackrc', resolvers: [ { - packageName: 'parcel-resolver-ext', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-resolver-ext', + resolveFrom: '.atlaspackrc', keyPath: '/resolvers/0', }, { - packageName: 'parcel-resolver-base', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-resolver-base', + resolveFrom: '.atlaspackrc', keyPath: '/resolvers/0', }, ], transformers: { '*.js': [ { - packageName: 'parcel-transform-ext', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-ext', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/0', }, { - packageName: 'parcel-transform-base', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-base', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.js/0', }, ], '*.css': [ { - packageName: 'parcel-transform-css', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-transform-css', + resolveFrom: '.atlaspackrc', keyPath: '/transformers/*.css/0', }, ], }, bundler: { - packageName: 'parcel-bundler-base', - resolveFrom: '.parcelrc', + packageName: 'atlaspack-bundler-base', + resolveFrom: '.atlaspackrc', keyPath: '/bundler', }, runtimes: [], @@ -669,34 +682,34 @@ describe('ParcelConfigRequest', () => { describe('resolveExtends', () => { it('should resolve a relative path', async () => { let resolved = await resolveExtends( - '../.parcelrc', - path.join(__dirname, 'fixtures', 'config', 'subfolder', '.parcelrc'), + '../.atlaspackrc', + path.join(__dirname, 'fixtures', 'config', 'subfolder', '.atlaspackrc'), '/extends', DEFAULT_OPTIONS, ); assert.equal( resolved, - path.join(__dirname, 'fixtures', 'config', '.parcelrc'), + path.join(__dirname, 'fixtures', 'config', '.atlaspackrc'), ); }); it('should resolve a package name', async () => { let resolved = await resolveExtends( - '@parcel/config-default', - path.join(__dirname, 'fixtures', 'config', 'subfolder', '.parcelrc'), + '@atlaspack/config-default', + path.join(__dirname, 'fixtures', 'config', 'subfolder', '.atlaspackrc'), '/extends', DEFAULT_OPTIONS, ); - assert.equal(resolved, require.resolve('@parcel/config-default')); + assert.equal(resolved, require.resolve('@atlaspack/config-default')); }); }); describe('parseAndProcessConfig', () => { it('should load and merge configs', async () => { - let defaultConfigPath = require.resolve('@parcel/config-default'); + let defaultConfigPath = require.resolve('@atlaspack/config-default'); let defaultConfig = await processConfig( { - ...require('@parcel/config-default'), + ...require('@atlaspack/config-default'), filePath: defaultConfigPath, }, DEFAULT_OPTIONS, @@ -705,14 +718,14 @@ describe('ParcelConfigRequest', () => { __dirname, 'fixtures', 'config', - '.parcelrc', + '.atlaspackrc', ); let subConfigFilePath = path.join( __dirname, 'fixtures', 'config', 'subfolder', - '.parcelrc', + '.atlaspackrc', ); let {config} = await parseAndProcessConfig( subConfigFilePath, @@ -723,12 +736,12 @@ describe('ParcelConfigRequest', () => { let transformers = nullthrows(config.transformers); assert.deepEqual(transformers['*.js'], [ { - packageName: 'parcel-transformer-sub', + packageName: 'atlaspack-transformer-sub', resolveFrom: relative(subConfigFilePath), keyPath: '/transformers/*.js/0', }, { - packageName: 'parcel-transformer-base', + packageName: 'atlaspack-transformer-base', resolveFrom: relative(configFilePath), keyPath: '/transformers/*.js/0', }, @@ -743,12 +756,12 @@ describe('ParcelConfigRequest', () => { assert.deepEqual(config.reporters, defaultConfig.reporters || []); }); - it('should emit a codeframe.codeHighlights when a malformed .parcelrc was found', async () => { + it('should emit a codeframe.codeHighlights when a malformed .atlaspackrc was found', async () => { let configFilePath = path.join( __dirname, 'fixtures', 'config-malformed', - '.parcelrc', + '.atlaspackrc', ); let code = await DEFAULT_OPTIONS.inputFS.readFile(configFilePath, 'utf8'); @@ -764,8 +777,8 @@ describe('ParcelConfigRequest', () => { name: 'Error', diagnostics: [ { - message: 'Failed to parse .parcelrc', - origin: '@parcel/core', + message: 'Failed to parse .atlaspackrc', + origin: '@atlaspack/core', codeFrames: [ { filePath: configFilePath, @@ -786,12 +799,12 @@ describe('ParcelConfigRequest', () => { ); }); - it('should emit a codeframe when an extended parcel config file is not found', async () => { + it('should emit a codeframe when an extended atlaspack config file is not found', async () => { let configFilePath = path.join( __dirname, 'fixtures', 'config-extends-not-found', - '.parcelrc', + '.atlaspackrc', ); let code = await DEFAULT_OPTIONS.inputFS.readFile(configFilePath, 'utf8'); @@ -802,8 +815,8 @@ describe('ParcelConfigRequest', () => { name: 'Error', diagnostics: [ { - message: 'Cannot find extended parcel config', - origin: '@parcel/core', + message: 'Cannot find extended atlaspack config', + origin: '@atlaspack/core', codeFrames: [ { filePath: configFilePath, @@ -812,9 +825,9 @@ describe('ParcelConfigRequest', () => { codeHighlights: [ { message: - '"./.parclrc-node-modules" does not exist, did you mean "./.parcelrc-node-modules"?', + '"./.atlaspckrc-node-modules" does not exist, did you mean "./.atlaspackrc-node-modules"?', start: {line: 2, column: 14}, - end: {line: 2, column: 38}, + end: {line: 2, column: 41}, }, ], }, @@ -825,12 +838,12 @@ describe('ParcelConfigRequest', () => { ); }); - it('should emit a codeframe when an extended parcel config file is not found in JSON5', async () => { + it('should emit a codeframe when an extended atlaspack config file is not found in JSON5', async () => { let configFilePath = path.join( __dirname, 'fixtures', 'config-extends-not-found', - '.parcelrc-json5', + '.atlaspackrc-json5', ); let code = await DEFAULT_OPTIONS.inputFS.readFile(configFilePath, 'utf8'); @@ -841,8 +854,8 @@ describe('ParcelConfigRequest', () => { name: 'Error', diagnostics: [ { - message: 'Cannot find extended parcel config', - origin: '@parcel/core', + message: 'Cannot find extended atlaspack config', + origin: '@atlaspack/core', codeFrames: [ { filePath: configFilePath, @@ -851,9 +864,9 @@ describe('ParcelConfigRequest', () => { codeHighlights: [ { message: - '"./.parclrc-node-modules" does not exist, did you mean "./.parcelrc-node-modules"?', + '"./.atlaspckrc-node-modules" does not exist, did you mean "./.atlaspackrc-node-modules"?', start: {line: 2, column: 12}, - end: {line: 2, column: 36}, + end: {line: 2, column: 39}, }, ], }, @@ -864,12 +877,12 @@ describe('ParcelConfigRequest', () => { ); }); - it('should emit a codeframe when an extended parcel config node module is not found', async () => { + it('should emit a codeframe when an extended atlaspack config node module is not found', async () => { let configFilePath = path.join( __dirname, 'fixtures', 'config-extends-not-found', - '.parcelrc-node-modules', + '.atlaspackrc-node-modules', ); let code = await DEFAULT_OPTIONS.inputFS.readFile(configFilePath, 'utf8'); @@ -880,8 +893,8 @@ describe('ParcelConfigRequest', () => { name: 'Error', diagnostics: [ { - message: 'Cannot find extended parcel config', - origin: '@parcel/core', + message: 'Cannot find extended atlaspack config', + origin: '@atlaspack/core', codeFrames: [ { filePath: configFilePath, @@ -890,9 +903,9 @@ describe('ParcelConfigRequest', () => { codeHighlights: [ { message: - 'Cannot find module "@parcel/config-deflt", did you mean "@parcel/config-default"?', + 'Cannot find module "@atlaspack/config-deflt", did you mean "@atlaspack/config-default"?', start: {line: 2, column: 14}, - end: {line: 2, column: 35}, + end: {line: 2, column: 38}, }, ], }, @@ -908,7 +921,7 @@ describe('ParcelConfigRequest', () => { __dirname, 'fixtures', 'config-extends-not-found', - '.parcelrc-multiple', + '.atlaspackrc-multiple', ); let code = await DEFAULT_OPTIONS.inputFS.readFile(configFilePath, 'utf8'); @@ -919,8 +932,8 @@ describe('ParcelConfigRequest', () => { name: 'Error', diagnostics: [ { - message: 'Cannot find extended parcel config', - origin: '@parcel/core', + message: 'Cannot find extended atlaspack config', + origin: '@atlaspack/core', codeFrames: [ { filePath: configFilePath, @@ -929,17 +942,17 @@ describe('ParcelConfigRequest', () => { codeHighlights: [ { message: - 'Cannot find module "@parcel/config-deflt", did you mean "@parcel/config-default"?', + 'Cannot find module "@atlaspack/config-deflt", did you mean "@atlaspack/config-default"?', start: {line: 2, column: 15}, - end: {line: 2, column: 36}, + end: {line: 2, column: 39}, }, ], }, ], }, { - message: 'Cannot find extended parcel config', - origin: '@parcel/core', + message: 'Cannot find extended atlaspack config', + origin: '@atlaspack/core', codeFrames: [ { filePath: configFilePath, @@ -948,9 +961,9 @@ describe('ParcelConfigRequest', () => { codeHighlights: [ { message: - '"./.parclrc" does not exist, did you mean "./.parcelrc"?', - start: {line: 2, column: 39}, - end: {line: 2, column: 50}, + '"./.atlaspckrc" does not exist, did you mean "./.atlaspackrc"?', + start: {line: 2, column: 42}, + end: {line: 2, column: 56}, }, ], }, @@ -963,13 +976,13 @@ describe('ParcelConfigRequest', () => { }); describe('resolve', () => { - it('should return null if there is no .parcelrc file found', async () => { - let resolved = await resolveParcelConfig(DEFAULT_OPTIONS); + it('should return null if there is no .atlaspackrc file found', async () => { + let resolved = await resolveAtlaspackConfig(DEFAULT_OPTIONS); assert.equal(resolved, null); }); - it('should resolve a config if a .parcelrc file is found', async () => { - let resolved = await resolveParcelConfig({ + it('should resolve a config if a .atlaspackrc file is found', async () => { + let resolved = await resolveAtlaspackConfig({ ...DEFAULT_OPTIONS, projectRoot: path.join(__dirname, 'fixtures', 'config', 'subfolder'), }); diff --git a/packages/core/core/test/EntryRequest.test.js b/packages/core/core/test/EntryRequest.test.js index ce2875b00..2d4d7143d 100644 --- a/packages/core/core/test/EntryRequest.test.js +++ b/packages/core/core/test/EntryRequest.test.js @@ -1,8 +1,8 @@ // @flow strict-local import assert from 'assert'; import path from 'path'; -import {md} from '@parcel/diagnostic'; -import {inputFS as fs} from '@parcel/test-utils'; +import {md} from '@atlaspack/diagnostic'; +import {inputFS as fs} from '@atlaspack/test-utils'; import {EntryResolver} from '../src/requests/EntryRequest'; import {DEFAULT_OPTIONS as _DEFAULT_OPTIONS} from './test-utils'; @@ -50,7 +50,7 @@ describe('EntryResolver', function () { { diagnostics: [ { - origin: '@parcel/core', + origin: '@atlaspack/core', message: md`${path.join( path.relative(fs.cwd(), INVALID_SOURCE_MISSING_FIXTURE_PATH), 'missing.js', @@ -90,7 +90,7 @@ describe('EntryResolver', function () { { diagnostics: [ { - origin: '@parcel/core', + origin: '@atlaspack/core', message: md`${path.join( path.relative(fs.cwd(), INVALID_SOURCE_NOT_FILE_FIXTURE_PATH), 'src', @@ -130,7 +130,7 @@ describe('EntryResolver', function () { { diagnostics: [ { - origin: '@parcel/core', + origin: '@atlaspack/core', message: md`${path.join( path.relative( fs.cwd(), @@ -174,7 +174,7 @@ describe('EntryResolver', function () { { diagnostics: [ { - origin: '@parcel/core', + origin: '@atlaspack/core', message: md`${path.join( path.relative( fs.cwd(), diff --git a/packages/core/core/test/PackagerRunner.test.js b/packages/core/core/test/PackagerRunner.test.js index fcf52f902..26c4c5f17 100644 --- a/packages/core/core/test/PackagerRunner.test.js +++ b/packages/core/core/test/PackagerRunner.test.js @@ -5,7 +5,7 @@ // const assert = require('assert'); // const path = require('path'); -// const config = require('@parcel/config-default'); +// const config = require('@atlaspack/config-default'); // describe('PackagerRunner', () => { // it('works', async () => { @@ -18,7 +18,7 @@ // }; // let packagerRunner = new PackagerRunner({ -// parcelConfig: config, +// atlaspackConfig: config, // options: {} // }); diff --git a/packages/core/core/test/PublicBundle.test.js b/packages/core/core/test/PublicBundle.test.js index 39fe7baf6..7e7b8e454 100644 --- a/packages/core/core/test/PublicBundle.test.js +++ b/packages/core/core/test/PublicBundle.test.js @@ -2,7 +2,7 @@ import type {Bundle as InternalBundle} from '../src/types'; import assert from 'assert'; -import {ContentGraph} from '@parcel/graph'; +import {ContentGraph} from '@atlaspack/graph'; import {Bundle, NamedBundle, PackagedBundle} from '../src/public/Bundle'; import BundleGraph from '../src/BundleGraph'; diff --git a/packages/core/core/test/PublicMutableBundleGraph.test.js b/packages/core/core/test/PublicMutableBundleGraph.test.js index 3d3ccccb7..21f2e6884 100644 --- a/packages/core/core/test/PublicMutableBundleGraph.test.js +++ b/packages/core/core/test/PublicMutableBundleGraph.test.js @@ -1,6 +1,6 @@ // @flow strict-local -import type {Dependency} from '@parcel/types'; +import type {Dependency} from '@atlaspack/types'; import assert from 'assert'; import invariant from 'assert'; diff --git a/packages/core/core/test/RequestTracker.test.js b/packages/core/core/test/RequestTracker.test.js index 0cb8b8304..490bf3cd8 100644 --- a/packages/core/core/test/RequestTracker.test.js +++ b/packages/core/core/test/RequestTracker.test.js @@ -3,10 +3,10 @@ import assert from 'assert'; import nullthrows from 'nullthrows'; import RequestTracker, {type RunAPI} from '../src/RequestTracker'; -import WorkerFarm from '@parcel/workers'; +import WorkerFarm from '@atlaspack/workers'; import {DEFAULT_OPTIONS} from './test-utils'; import {INITIAL_BUILD} from '../src/constants'; -import {makeDeferredWithPromise} from '@parcel/utils'; +import {makeDeferredWithPromise} from '@atlaspack/utils'; const options = DEFAULT_OPTIONS; const farm = new WorkerFarm({workerPath: require.resolve('../src/worker.js')}); diff --git a/packages/core/core/test/SymbolPropagation.test.js b/packages/core/core/test/SymbolPropagation.test.js index 09a013743..b6451c4bb 100644 --- a/packages/core/core/test/SymbolPropagation.test.js +++ b/packages/core/core/test/SymbolPropagation.test.js @@ -2,11 +2,11 @@ import assert from 'assert'; import invariant from 'assert'; import nullthrows from 'nullthrows'; -import type {FilePath, SourceLocation, Meta, Symbol} from '@parcel/types'; -import type {ContentKey, NodeId} from '@parcel/graph'; -import type {Diagnostic} from '@parcel/diagnostic'; -import ThrowableDiagnostic from '@parcel/diagnostic'; -import {setEqual} from '@parcel/utils'; +import type {FilePath, SourceLocation, Meta, Symbol} from '@atlaspack/types'; +import type {ContentKey, NodeId} from '@atlaspack/graph'; +import type {Diagnostic} from '@atlaspack/diagnostic'; +import ThrowableDiagnostic from '@atlaspack/diagnostic'; +import {setEqual} from '@atlaspack/utils'; import AssetGraph, { nodeFromAssetGroup, nodeFromDep, @@ -405,8 +405,8 @@ function changeAsset( return [[node.id, node.value]]; } -// process.env.PARCEL_DUMP_GRAPHVIZ = ''; -// process.env.PARCEL_DUMP_GRAPHVIZ = 'symbols'; +// process.env.ATLASPACK_DUMP_GRAPHVIZ = ''; +// process.env.ATLASPACK_DUMP_GRAPHVIZ = 'symbols'; describe('SymbolPropagation', () => { it('basic tree', async () => { @@ -501,7 +501,7 @@ describe('SymbolPropagation', () => { [ { message: "lib.js does not export 'f2'", - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: undefined, }, ], @@ -544,7 +544,7 @@ describe('SymbolPropagation', () => { [ { message: "lib.js does not export 'f'", - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: undefined, }, ], diff --git a/packages/core/core/test/TargetRequest.test.js b/packages/core/core/test/TargetRequest.test.js index caeb37b1d..b74d4ad19 100644 --- a/packages/core/core/test/TargetRequest.test.js +++ b/packages/core/core/test/TargetRequest.test.js @@ -3,9 +3,9 @@ import assert from 'assert'; import path from 'path'; import tempy from 'tempy'; -import {inputFS as fs} from '@parcel/test-utils'; -import {md} from '@parcel/diagnostic'; -import {normalizeSeparators} from '@parcel/utils'; +import {inputFS as fs} from '@atlaspack/test-utils'; +import {md} from '@atlaspack/diagnostic'; +import {normalizeSeparators} from '@atlaspack/utils'; import {TargetResolver} from '../src/requests/TargetRequest'; import {DEFAULT_OPTIONS as _DEFAULT_OPTIONS, relative} from './test-utils'; @@ -736,7 +736,7 @@ describe('TargetResolver', () => { diagnostics: [ { message: 'Unexpected output file type .html in target "main"', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join(fixture, 'package.json'), @@ -778,7 +778,7 @@ describe('TargetResolver', () => { { message: 'The "global" output format is not supported in the "main" target.', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join(fixture, 'package.json'), @@ -820,7 +820,7 @@ describe('TargetResolver', () => { { message: 'Output format "esmodule" cannot be used in the "main" target without a .mjs extension or "type": "module" field.', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join(fixture, 'package.json'), @@ -873,7 +873,7 @@ describe('TargetResolver', () => { { message: 'Declared output format "esmodule" does not match expected output format "commonjs".', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join(fixture, 'package.json'), @@ -926,7 +926,7 @@ describe('TargetResolver', () => { { message: 'Declared output format "commonjs" does not match expected output format "esmodule".', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join(fixture, 'package.json'), @@ -978,7 +978,7 @@ describe('TargetResolver', () => { diagnostics: [ { message: 'Scope hoisting cannot be disabled for library targets.', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join(fixture, 'package.json'), @@ -1019,7 +1019,7 @@ describe('TargetResolver', () => { diagnostics: [ { message: 'Scope hoisting cannot be disabled for library targets.', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join(fixture, 'package.json'), @@ -1243,7 +1243,7 @@ describe('TargetResolver', () => { [ { name: 'default', - distDir: '.parcel-cache/dist', + distDir: '.atlaspack-cache/dist', publicUrl: '/', env: { id: 'd6ea1d42532a7575', @@ -1474,7 +1474,7 @@ describe('TargetResolver', () => { diagnostics: [ { message: 'Invalid target descriptor for target "main"', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: undefined, @@ -1533,7 +1533,7 @@ describe('TargetResolver', () => { diagnostics: [ { message: 'Invalid target descriptor for target "module"', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join( @@ -1575,7 +1575,7 @@ describe('TargetResolver', () => { diagnostics: [ { message: 'Invalid engines in package.json', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join( @@ -1629,7 +1629,7 @@ describe('TargetResolver', () => { diagnostics: [ { message: 'Invalid distPath for target "legacy"', - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join( @@ -1673,7 +1673,7 @@ describe('TargetResolver', () => { message: md`Multiple targets have the same destination path "${path.normalize( 'dist/index.js', )}"`, - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: path.join(fixture, 'package.json'), diff --git a/packages/core/core/test/fixtures/parcel/index.js b/packages/core/core/test/fixtures/atlaspack/index.js similarity index 100% rename from packages/core/core/test/fixtures/parcel/index.js rename to packages/core/core/test/fixtures/atlaspack/index.js diff --git a/packages/core/core/test/fixtures/parcel/other.js b/packages/core/core/test/fixtures/atlaspack/other.js similarity index 100% rename from packages/core/core/test/fixtures/parcel/other.js rename to packages/core/core/test/fixtures/atlaspack/other.js diff --git a/packages/core/core/test/fixtures/parcel/package.json b/packages/core/core/test/fixtures/atlaspack/package.json similarity index 100% rename from packages/core/core/test/fixtures/parcel/package.json rename to packages/core/core/test/fixtures/atlaspack/package.json diff --git a/packages/core/core/test/fixtures/parcel/yarn.lock b/packages/core/core/test/fixtures/atlaspack/yarn.lock similarity index 100% rename from packages/core/core/test/fixtures/parcel/yarn.lock rename to packages/core/core/test/fixtures/atlaspack/yarn.lock diff --git a/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc b/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc new file mode 100644 index 000000000..d7cc609e5 --- /dev/null +++ b/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc @@ -0,0 +1,3 @@ +{ + "extends": "./.atlaspckrc-node-modules" +} diff --git a/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-json5 b/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-json5 new file mode 100644 index 000000000..64d422f3f --- /dev/null +++ b/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-json5 @@ -0,0 +1,3 @@ +{ + extends: "./.atlaspckrc-node-modules" +} diff --git a/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-multiple b/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-multiple new file mode 100644 index 000000000..b191f510e --- /dev/null +++ b/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-multiple @@ -0,0 +1,3 @@ +{ + "extends": ["@atlaspack/config-deflt", "./.atlaspckrc"] +} diff --git a/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-node-modules b/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-node-modules new file mode 100644 index 000000000..86a3fa6bf --- /dev/null +++ b/packages/core/core/test/fixtures/config-extends-not-found/.atlaspackrc-node-modules @@ -0,0 +1,3 @@ +{ + "extends": "@atlaspack/config-deflt" +} diff --git a/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc b/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc deleted file mode 100644 index 71c5256f4..000000000 --- a/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./.parclrc-node-modules" -} diff --git a/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-json5 b/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-json5 deleted file mode 100644 index 03464dc7f..000000000 --- a/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - extends: "./.parclrc-node-modules" -} diff --git a/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-multiple b/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-multiple deleted file mode 100644 index 6ba762f43..000000000 --- a/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-multiple +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@parcel/config-deflt", "./.parclrc"] -} diff --git a/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-node-modules b/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-node-modules deleted file mode 100644 index 7bc6ecdf6..000000000 --- a/packages/core/core/test/fixtures/config-extends-not-found/.parcelrc-node-modules +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@parcel/config-deflt" -} diff --git a/packages/core/core/test/fixtures/config-malformed/.parcelrc b/packages/core/core/test/fixtures/config-malformed/.atlaspackrc similarity index 100% rename from packages/core/core/test/fixtures/config-malformed/.parcelrc rename to packages/core/core/test/fixtures/config-malformed/.atlaspackrc diff --git a/packages/core/core/test/fixtures/config-node-pipeline/.atlaspackrc b/packages/core/core/test/fixtures/config-node-pipeline/.atlaspackrc new file mode 100644 index 000000000..cfdf60ad6 --- /dev/null +++ b/packages/core/core/test/fixtures/config-node-pipeline/.atlaspackrc @@ -0,0 +1,6 @@ +{ + "extends": "@atlaspack/config-default", + "transformers": { + "node:*.js": ["@atlaspack/transformer-js"] + } +} diff --git a/packages/core/core/test/fixtures/config-node-pipeline/.parcelrc b/packages/core/core/test/fixtures/config-node-pipeline/.parcelrc deleted file mode 100644 index b8397a0af..000000000 --- a/packages/core/core/test/fixtures/config-node-pipeline/.parcelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "@parcel/config-default", - "transformers": { - "node:*.js": ["@parcel/transformer-js"] - } -} diff --git a/packages/core/core/test/fixtures/config-plugin-not-found/.atlaspackrc b/packages/core/core/test/fixtures/config-plugin-not-found/.atlaspackrc new file mode 100644 index 000000000..26cb418b8 --- /dev/null +++ b/packages/core/core/test/fixtures/config-plugin-not-found/.atlaspackrc @@ -0,0 +1,6 @@ +{ + "extends": "@atlaspack/config-default", + "transformers": { + "*.js": ["@atlaspack/transformer-jj"] + } +} diff --git a/packages/core/core/test/fixtures/config-plugin-not-found/.parcelrc b/packages/core/core/test/fixtures/config-plugin-not-found/.parcelrc deleted file mode 100644 index 4a063b9d7..000000000 --- a/packages/core/core/test/fixtures/config-plugin-not-found/.parcelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "@parcel/config-default", - "transformers": { - "*.js": ["@parcel/transformer-jj"] - } -} diff --git a/packages/core/core/test/fixtures/config/.atlaspackrc b/packages/core/core/test/fixtures/config/.atlaspackrc new file mode 100644 index 000000000..1af70b99f --- /dev/null +++ b/packages/core/core/test/fixtures/config/.atlaspackrc @@ -0,0 +1,6 @@ +{ + "extends": "@atlaspack/config-default", + "transformers": { + "*.js": ["atlaspack-transformer-base", "..."] + } +} diff --git a/packages/core/core/test/fixtures/config/.parcelrc b/packages/core/core/test/fixtures/config/.parcelrc deleted file mode 100644 index 5eea9502f..000000000 --- a/packages/core/core/test/fixtures/config/.parcelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "@parcel/config-default", - "transformers": { - "*.js": ["parcel-transformer-base", "..."] - } -} diff --git a/packages/core/core/test/fixtures/config/subfolder/.atlaspackrc b/packages/core/core/test/fixtures/config/subfolder/.atlaspackrc new file mode 100644 index 000000000..a7f92ecdd --- /dev/null +++ b/packages/core/core/test/fixtures/config/subfolder/.atlaspackrc @@ -0,0 +1,6 @@ +{ + "extends": "../.atlaspackrc", + "transformers": { + "*.js": ["atlaspack-transformer-sub", "..."] + } +} diff --git a/packages/core/core/test/fixtures/config/subfolder/.parcelrc b/packages/core/core/test/fixtures/config/subfolder/.parcelrc deleted file mode 100644 index 26b3ef54a..000000000 --- a/packages/core/core/test/fixtures/config/subfolder/.parcelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../.parcelrc", - "transformers": { - "*.js": ["parcel-transformer-sub", "..."] - } -} diff --git a/packages/core/core/test/fixtures/local-plugin-config-pkg/.atlaspackrc b/packages/core/core/test/fixtures/local-plugin-config-pkg/.atlaspackrc new file mode 100644 index 000000000..5aca5c976 --- /dev/null +++ b/packages/core/core/test/fixtures/local-plugin-config-pkg/.atlaspackrc @@ -0,0 +1,3 @@ +{ + "extends": "atlaspack-config-local" +} diff --git a/packages/core/core/test/fixtures/local-plugin-config-pkg/.parcelrc b/packages/core/core/test/fixtures/local-plugin-config-pkg/.parcelrc deleted file mode 100644 index a8e751bf4..000000000 --- a/packages/core/core/test/fixtures/local-plugin-config-pkg/.parcelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "parcel-config-local" -} diff --git a/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/index.json b/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/index.json similarity index 61% rename from packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/index.json rename to packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/index.json index 9476924b1..6c568f91e 100644 --- a/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/index.json +++ b/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/index.json @@ -1,8 +1,8 @@ { - "extends": "@parcel/config-default", + "extends": "@atlaspack/config-default", "transformers": { "*.js": [ "./local-plugin" ] } -} \ No newline at end of file +} diff --git a/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/local-plugin.js b/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/local-plugin.js similarity index 62% rename from packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/local-plugin.js rename to packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/local-plugin.js index c2d4496d3..46d73aea5 100644 --- a/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/local-plugin.js +++ b/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/local-plugin.js @@ -1,4 +1,4 @@ -const {Transformer} = require('@parcel/plugin'); +const {Transformer} = require('@atlaspack/plugin'); module.exports = new Transformer({ transform(asset) { diff --git a/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/package.json b/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/package.json new file mode 100644 index 000000000..a3b0415dc --- /dev/null +++ b/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/atlaspack-config-local/package.json @@ -0,0 +1,7 @@ +{ + "name": "atlaspack-config-local", + "version": "1.0.0", + "engines": { + "atlaspack": "2.x" + } +} diff --git a/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/package.json b/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/package.json deleted file mode 100644 index 01aba7d7a..000000000 --- a/packages/core/core/test/fixtures/local-plugin-config-pkg/node_modules/parcel-config-local/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "parcel-config-local", - "version": "1.0.0", - "engines": { - "parcel": "2.x" - } -} \ No newline at end of file diff --git a/packages/core/core/test/fixtures/plugins/local-plugin.js b/packages/core/core/test/fixtures/plugins/local-plugin.js index c2d4496d3..46d73aea5 100644 --- a/packages/core/core/test/fixtures/plugins/local-plugin.js +++ b/packages/core/core/test/fixtures/plugins/local-plugin.js @@ -1,4 +1,4 @@ -const {Transformer} = require('@parcel/plugin'); +const {Transformer} = require('@atlaspack/plugin'); module.exports = new Transformer({ transform(asset) { diff --git a/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-bad-engines/index.js b/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-bad-engines/index.js similarity index 62% rename from packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-bad-engines/index.js rename to packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-bad-engines/index.js index c2d4496d3..46d73aea5 100644 --- a/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-bad-engines/index.js +++ b/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-bad-engines/index.js @@ -1,4 +1,4 @@ -const {Transformer} = require('@parcel/plugin'); +const {Transformer} = require('@atlaspack/plugin'); module.exports = new Transformer({ transform(asset) { diff --git a/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-bad-engines/package.json b/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-bad-engines/package.json new file mode 100644 index 000000000..7dfa159db --- /dev/null +++ b/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-bad-engines/package.json @@ -0,0 +1,7 @@ +{ + "name": "atlaspack-transformer-bad-engines", + "version": "1.0.0", + "engines": { + "atlaspack": "5.x" + } +} diff --git a/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-no-engines/index.js b/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-no-engines/index.js similarity index 62% rename from packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-no-engines/index.js rename to packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-no-engines/index.js index c2d4496d3..46d73aea5 100644 --- a/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-no-engines/index.js +++ b/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-no-engines/index.js @@ -1,4 +1,4 @@ -const {Transformer} = require('@parcel/plugin'); +const {Transformer} = require('@atlaspack/plugin'); module.exports = new Transformer({ transform(asset) { diff --git a/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-no-engines/package.json b/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-no-engines/package.json new file mode 100644 index 000000000..cd1b185b0 --- /dev/null +++ b/packages/core/core/test/fixtures/plugins/node_modules/atlaspack-transformer-no-engines/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-transformer-no-engines", + "version": "1.0.0" +} diff --git a/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-bad-engines/package.json b/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-bad-engines/package.json deleted file mode 100644 index a08d9f9c0..000000000 --- a/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-bad-engines/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "parcel-transformer-bad-engines", - "version": "1.0.0", - "engines": { - "parcel": "5.x" - } -} diff --git a/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-no-engines/package.json b/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-no-engines/package.json deleted file mode 100644 index e1676ae58..000000000 --- a/packages/core/core/test/fixtures/plugins/node_modules/parcel-transformer-no-engines/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "parcel-transformer-no-engines", - "version": "1.0.0" -} diff --git a/packages/core/core/test/requests/ConfigRequest.test.js b/packages/core/core/test/requests/ConfigRequest.test.js index d2e5b48b3..d134b9ff0 100644 --- a/packages/core/core/test/requests/ConfigRequest.test.js +++ b/packages/core/core/test/requests/ConfigRequest.test.js @@ -1,11 +1,11 @@ // @flow strict-local -import WorkerFarm from '@parcel/workers'; +import WorkerFarm from '@atlaspack/workers'; import path from 'path'; import assert from 'assert'; import sinon from 'sinon'; -import {MemoryFS} from '@parcel/fs'; -import {hashString} from '@parcel/rust'; +import {MemoryFS} from '@atlaspack/fs'; +import {hashString} from '@atlaspack/rust'; import type { ConfigRequest, diff --git a/packages/core/core/test/test-utils.js b/packages/core/core/test/test-utils.js index d51cfc9b3..a9e42973e 100644 --- a/packages/core/core/test/test-utils.js +++ b/packages/core/core/test/test-utils.js @@ -1,14 +1,14 @@ // @flow strict-local -import type {Environment, ParcelOptions, Target} from '../src/types'; +import type {Environment, AtlaspackOptions, Target} from '../src/types'; -import {DEFAULT_FEATURE_FLAGS} from '@parcel/feature-flags'; -import {FSCache} from '@parcel/cache'; +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 '@parcel/test-utils'; -import {relativePath} from '@parcel/utils'; -import {NodePackageManager} from '@parcel/package-manager'; +import {inputFS, outputFS} from '@atlaspack/test-utils'; +import {relativePath} from '@atlaspack/utils'; +import {NodePackageManager} from '@atlaspack/package-manager'; import {createEnvironment} from '../src/Environment'; import {toProjectPath} from '../src/projectPath'; @@ -16,9 +16,9 @@ let cacheDir = tempy.directory(); export let cache: FSCache = new FSCache(outputFS, cacheDir); cache.ensure(); -export const DEFAULT_OPTIONS: ParcelOptions = { - cacheDir: path.join(__dirname, '.parcel-cache'), - parcelVersion: '', +export const DEFAULT_OPTIONS: AtlaspackOptions = { + cacheDir: path.join(__dirname, '.atlaspack-cache'), + atlaspackVersion: '', watchDir: __dirname, watchIgnore: undefined, watchBackend: undefined, diff --git a/packages/core/diagnostic/package.json b/packages/core/diagnostic/package.json index 25738e43b..501b613a0 100644 --- a/packages/core/diagnostic/package.json +++ b/packages/core/diagnostic/package.json @@ -1,18 +1,14 @@ { - "name": "@parcel/diagnostic", + "name": "@atlaspack/diagnostic", "version": "2.12.0", "description": "Types and utilities for printing source-code located errors, warning and information messages.", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/diagnostic.js", "source": "src/diagnostic.js", diff --git a/packages/core/diagnostic/src/diagnostic.js b/packages/core/diagnostic/src/diagnostic.js index 5cf80bbb9..bc368db72 100644 --- a/packages/core/diagnostic/src/diagnostic.js +++ b/packages/core/diagnostic/src/diagnostic.js @@ -83,7 +83,7 @@ export type Diagnostic = {| meta?: JSONObject, |}; -// This type should represent all error formats Parcel can encounter... +// This type should represent all error formats Atlaspack can encounter... export interface PrintableError extends Error { fileName?: string; filePath?: string; diff --git a/packages/core/feature-flags/package.json b/packages/core/feature-flags/package.json index 374309818..9a074c9af 100644 --- a/packages/core/feature-flags/package.json +++ b/packages/core/feature-flags/package.json @@ -1,18 +1,14 @@ { - "name": "@parcel/feature-flags", + "name": "@atlaspack/feature-flags", "version": "2.12.0", - "description": "Provides internal feature-flags for the parcel codebase.", + "description": "Provides internal feature-flags for the atlaspack codebase.", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/index.js", "source": "src/index.js", diff --git a/packages/core/feature-flags/src/index.js b/packages/core/feature-flags/src/index.js index f5cd6dc1a..01298121b 100644 --- a/packages/core/feature-flags/src/index.js +++ b/packages/core/feature-flags/src/index.js @@ -7,7 +7,7 @@ export type FeatureFlags = _FeatureFlags; export const DEFAULT_FEATURE_FLAGS: FeatureFlags = { exampleFeature: false, - parcelV3: false, + atlaspackV3: false, useWatchmanWatcher: false, importRetry: false, ownedResolverStructures: false, diff --git a/packages/core/feature-flags/src/types.js b/packages/core/feature-flags/src/types.js index 4a1cbf4fb..72c8a85c4 100644 --- a/packages/core/feature-flags/src/types.js +++ b/packages/core/feature-flags/src/types.js @@ -6,7 +6,7 @@ export type FeatureFlags = {| /** * Rust backed requests */ - +parcelV3: boolean, + +atlaspackV3: boolean, /** * Use node.js implementation of @parcel/watcher watchman backend */ diff --git a/packages/core/fs/index.d.ts b/packages/core/fs/index.d.ts index ea5c725cb..7152dcc2d 100644 --- a/packages/core/fs/index.d.ts +++ b/packages/core/fs/index.d.ts @@ -1,5 +1,5 @@ -import type {FileSystem} from '@parcel/types-internal'; -import type WorkerFarm from '@parcel/workers'; +import type {FileSystem} from '@atlaspack/types-internal'; +import type WorkerFarm from '@atlaspack/workers'; export type { FileSystem, @@ -8,7 +8,7 @@ export type { Stats, Encoding, Dirent, -} from '@parcel/types-internal'; +} from '@atlaspack/types-internal'; export const NodeFS: { new (): FileSystem; diff --git a/packages/core/fs/package.json b/packages/core/fs/package.json index 72fa46317..7e2ecc4d7 100644 --- a/packages/core/fs/package.json +++ b/packages/core/fs/package.json @@ -1,18 +1,14 @@ { - "name": "@parcel/fs", + "name": "@atlaspack/fs", "version": "2.12.0", "description": "Blazing fast, zero configuration web application bundler", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/index.js", "source": "src/index.js", @@ -24,26 +20,26 @@ "types": false, "main": { "includeNodeModules": { - "@parcel/core": false, - "@parcel/feature-flags": false, - "@parcel/rust": false, - "@parcel/types-internal": false, - "@parcel/utils": false, + "@atlaspack/core": false, + "@atlaspack/feature-flags": false, + "@atlaspack/rust": false, + "@atlaspack/types-internal": false, + "@atlaspack/utils": false, + "@atlaspack/watcher-watchman-js": false, "@parcel/watcher": false, - "@parcel/watcher-watchman-js": false, - "@parcel/workers": false + "@atlaspack/workers": false } }, "browser": { "includeNodeModules": { - "@parcel/core": false, - "@parcel/feature-flags": false, - "@parcel/rust": false, - "@parcel/types-internal": false, - "@parcel/utils": false, + "@atlaspack/core": false, + "@atlaspack/feature-flags": false, + "@atlaspack/rust": false, + "@atlaspack/types-internal": false, + "@atlaspack/utils": false, + "@atlaspack/watcher-watchman-js": false, "@parcel/watcher": false, - "@parcel/watcher-watchman-js": false, - "@parcel/workers": false + "@atlaspack/workers": false } } }, @@ -52,25 +48,25 @@ "check-ts": "tsc --noEmit index.d.ts" }, "dependencies": { - "@parcel/feature-flags": "2.12.0", - "@parcel/rust": "2.12.0", - "@parcel/types-internal": "2.12.0", - "@parcel/utils": "2.12.0", + "@atlaspack/feature-flags": "2.12.0", + "@atlaspack/rust": "2.12.0", + "@atlaspack/types-internal": "2.12.0", + "@atlaspack/utils": "2.12.0", "@parcel/watcher": "^2.0.7", - "@parcel/workers": "2.12.0" + "@atlaspack/workers": "2.12.0" }, "devDependencies": { - "@parcel/watcher-watchman-js": "2.12.0", + "@atlaspack/watcher-watchman-js": "2.12.0", "graceful-fs": "^4.2.4", "ncp": "^2.0.0", "nullthrows": "^1.1.1", "utility-types": "^3.10.0" }, "peerDependencies": { - "@parcel/core": "^2.12.0" + "@atlaspack/core": "^2.12.0" }, "browser": { - "@parcel/fs": "./lib/browser.js", + "@atlaspack/fs": "./lib/browser.js", "./src/NodeFS.js": "./src/NodeFS.browser.js" } } diff --git a/packages/core/fs/src/MemoryFS.js b/packages/core/fs/src/MemoryFS.js index 7a77bdc4c..f1a7e9c8d 100644 --- a/packages/core/fs/src/MemoryFS.js +++ b/packages/core/fs/src/MemoryFS.js @@ -6,7 +6,7 @@ import type { FileOptions, ReaddirOptions, Encoding, -} from '@parcel/types-internal'; +} from '@atlaspack/types-internal'; import type { Event, Options as WatcherOptions, @@ -15,10 +15,10 @@ import type { import path from 'path'; import {Readable, Writable} from 'stream'; -import {registerSerializableClass} from '@parcel/core'; -import {SharedBuffer} from '@parcel/utils'; +import {registerSerializableClass} from '@atlaspack/core'; +import {SharedBuffer} from '@atlaspack/utils'; import packageJSON from '../package.json'; -import WorkerFarm, {Handle} from '@parcel/workers'; +import WorkerFarm, {Handle} from '@atlaspack/workers'; import nullthrows from 'nullthrows'; import EventEmitter from 'events'; import {findAncestorFile, findNodeModule, findFirstFile} from './find'; diff --git a/packages/core/fs/src/NodeFS.browser.js b/packages/core/fs/src/NodeFS.browser.js index 850eb8548..8690258d5 100644 --- a/packages/core/fs/src/NodeFS.browser.js +++ b/packages/core/fs/src/NodeFS.browser.js @@ -1,5 +1,5 @@ // @flow -import type {FileSystem} from '@parcel/types-internal'; +import type {FileSystem} from '@atlaspack/types-internal'; // $FlowFixMe[prop-missing] handled by the throwing constructor export class NodeFS implements FileSystem { diff --git a/packages/core/fs/src/NodeFS.js b/packages/core/fs/src/NodeFS.js index f3f1047d5..5c39e72c1 100644 --- a/packages/core/fs/src/NodeFS.js +++ b/packages/core/fs/src/NodeFS.js @@ -6,7 +6,7 @@ import type { Encoding, FileOptions, FileSystem, -} from '@parcel/types-internal'; +} from '@atlaspack/types-internal'; import type { Event, Options as WatcherOptions, @@ -19,13 +19,13 @@ import ncp from 'ncp'; import path from 'path'; import {tmpdir} from 'os'; import {promisify} from 'util'; -import {registerSerializableClass} from '@parcel/core'; -import {hashFile} from '@parcel/utils'; -import {getFeatureFlag} from '@parcel/feature-flags'; +import {registerSerializableClass} from '@atlaspack/core'; +import {hashFile} from '@atlaspack/utils'; +import {getFeatureFlag} from '@atlaspack/feature-flags'; import watcher from '@parcel/watcher'; import packageJSON from '../package.json'; -import * as searchNative from '@parcel/rust'; +import * as searchNative from '@atlaspack/rust'; import * as searchJS from './find'; // Most of this can go away once we only support Node 10+, which includes @@ -37,8 +37,8 @@ const realpath = promisify( const isPnP = process.versions.pnp != null; function getWatchmanWatcher(): typeof watcher { - // This is here to trick parcel into ignoring this require... - const packageName = ['@parcel', 'watcher-watchman-js'].join('/'); + // This is here to trick atlaspack into ignoring this require... + const packageName = ['@atlaspack', 'watcher-watchman-js'].join('/'); // $FlowFixMe return require(packageName); diff --git a/packages/core/fs/src/OverlayFS.js b/packages/core/fs/src/OverlayFS.js index 073d02a9d..b340aa194 100644 --- a/packages/core/fs/src/OverlayFS.js +++ b/packages/core/fs/src/OverlayFS.js @@ -8,15 +8,15 @@ import type { FileSystem, ReaddirOptions, FileStats, -} from '@parcel/types-internal'; +} from '@atlaspack/types-internal'; import type { Event, Options as WatcherOptions, AsyncSubscription, } from '@parcel/watcher'; -import {registerSerializableClass} from '@parcel/core'; -import WorkerFarm from '@parcel/workers'; +import {registerSerializableClass} from '@atlaspack/core'; +import WorkerFarm from '@atlaspack/workers'; import packageJSON from '../package.json'; import {findAncestorFile, findNodeModule, findFirstFile} from './find'; import {MemoryFS} from './MemoryFS'; @@ -92,7 +92,7 @@ export class OverlayFS implements FileSystem { ) { return true; } else { - // HACK: Parcel fs does not provide `lstatSync`, + // HACK: Atlaspack fs does not provide `lstatSync`, // so we use `readdirSync` to check if the path is a symlink. let parent = path.resolve(filePath, '..'); if (parent === filePath) { diff --git a/packages/core/fs/src/find.js b/packages/core/fs/src/find.js index f086eb413..298c045cc 100644 --- a/packages/core/fs/src/find.js +++ b/packages/core/fs/src/find.js @@ -1,5 +1,5 @@ // @flow -import type {FilePath, FileSystem} from '@parcel/types-internal'; +import type {FilePath, FileSystem} from '@atlaspack/types-internal'; import path from 'path'; export function findNodeModule( diff --git a/packages/core/fs/src/index.js b/packages/core/fs/src/index.js index 0279b9c3f..5368f84b2 100644 --- a/packages/core/fs/src/index.js +++ b/packages/core/fs/src/index.js @@ -1,5 +1,9 @@ // @flow strict-local -import type {FilePath, FileSystem, FileOptions} from '@parcel/types-internal'; +import type { + FilePath, + FileSystem, + FileOptions, +} from '@atlaspack/types-internal'; import type {Readable, Writable} from 'stream'; import path from 'path'; diff --git a/packages/core/fs/test/OverlayFS.test.js b/packages/core/fs/test/OverlayFS.test.js index 786c848d2..3f5e35506 100644 --- a/packages/core/fs/test/OverlayFS.test.js +++ b/packages/core/fs/test/OverlayFS.test.js @@ -1,9 +1,9 @@ // @flow import {OverlayFS} from '../src/OverlayFS'; -import {fsFixture} from '@parcel/test-utils/src/fsFixture'; +import {fsFixture} from '@atlaspack/test-utils/src/fsFixture'; import {MemoryFS} from '../src/MemoryFS'; -import WorkerFarm from '@parcel/workers'; +import WorkerFarm from '@atlaspack/workers'; import assert from 'assert'; import path from 'path'; @@ -15,7 +15,7 @@ describe('OverlayFS', () => { beforeEach(() => { workerFarm = new WorkerFarm({ - workerPath: require.resolve('@parcel/core/src/worker.js'), + workerPath: require.resolve('@atlaspack/core/src/worker.js'), }); underlayFS = new MemoryFS(workerFarm); fs = new OverlayFS(workerFarm, underlayFS); diff --git a/packages/core/graph/package.json b/packages/core/graph/package.json index 98a321076..f672251b7 100644 --- a/packages/core/graph/package.json +++ b/packages/core/graph/package.json @@ -1,18 +1,14 @@ { - "name": "@parcel/graph", + "name": "@atlaspack/graph", "version": "3.2.0", "description": "Blazing fast, zero configuration web application bundler", "license": "MIT", "publishConfig": { "access": "public" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "main": "lib/index.js", "source": "src/index.js", @@ -20,7 +16,7 @@ "node": ">= 16.0.0" }, "dependencies": { - "@parcel/feature-flags": "2.12.0", + "@atlaspack/feature-flags": "2.12.0", "nullthrows": "^1.1.1" } } diff --git a/packages/core/graph/src/Graph.js b/packages/core/graph/src/Graph.js index e6cf1205a..a32f2f852 100644 --- a/packages/core/graph/src/Graph.js +++ b/packages/core/graph/src/Graph.js @@ -7,7 +7,7 @@ import type { TraversalActions, GraphVisitor, GraphTraversalCallback, -} from '@parcel/types'; +} from '@atlaspack/types'; import {BitSet} from './BitSet'; import nullthrows from 'nullthrows'; diff --git a/packages/core/graph/src/shared-buffer.js b/packages/core/graph/src/shared-buffer.js index f8bb57512..96183cda8 100644 --- a/packages/core/graph/src/shared-buffer.js +++ b/packages/core/graph/src/shared-buffer.js @@ -1,5 +1,5 @@ // @flow -// Copy from @parcel/utils to fix: https://github.com/stackblitz/core/issues/1855 +// Copy from @atlaspack/utils to fix: https://github.com/stackblitz/core/issues/1855 export let SharedBuffer: Class | Class; // $FlowFixMe[prop-missing] diff --git a/packages/core/graph/test/Graph.test.js b/packages/core/graph/test/Graph.test.js index b967012d2..0da87df90 100644 --- a/packages/core/graph/test/Graph.test.js +++ b/packages/core/graph/test/Graph.test.js @@ -2,7 +2,7 @@ import assert from 'assert'; import sinon from 'sinon'; -import type {TraversalActions} from '@parcel/types-internal'; +import type {TraversalActions} from '@atlaspack/types-internal'; import Graph from '../src/Graph'; import {toNodeId, type NodeId} from '../src/types'; diff --git a/packages/core/graph/test/integration/adjacency-list-shared-array.js b/packages/core/graph/test/integration/adjacency-list-shared-array.js index 174e74732..f75c53e5b 100644 --- a/packages/core/graph/test/integration/adjacency-list-shared-array.js +++ b/packages/core/graph/test/integration/adjacency-list-shared-array.js @@ -1,4 +1,4 @@ -require('@parcel/babel-register'); +require('@atlaspack/babel-register'); const {parentPort} = require('worker_threads'); const { default: AdjacencyList, diff --git a/packages/core/integration-tests/.mocharc.json b/packages/core/integration-tests/.mocharc.json index d4e99c150..8be89c01d 100644 --- a/packages/core/integration-tests/.mocharc.json +++ b/packages/core/integration-tests/.mocharc.json @@ -1,5 +1,8 @@ { - "require": ["@parcel/babel-register", "@parcel/test-utils/src/mochaSetup.js"], + "require": [ + "@atlaspack/babel-register", + "@atlaspack/test-utils/src/mochaSetup.js" + ], "timeout": 50000, // TODO: Remove this when https://github.com/nodejs/node/pull/28788 is resolved "exit": true, diff --git a/packages/core/integration-tests/data/lastTestRun.json b/packages/core/integration-tests/data/lastTestRun.json index 25f10a444..623013ee2 100644 --- a/packages/core/integration-tests/data/lastTestRun.json +++ b/packages/core/integration-tests/data/lastTestRun.json @@ -123,19 +123,19 @@ { "fileName": "babel", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/babel.js", - "title": "should support multitarget builds using a custom babel config with @parcel/babel-preset-env", + "title": "should support multitarget builds using a custom babel config with @atlaspack/babel-preset-env", "status": "passing" }, { "fileName": "babel", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/babel.js", - "title": "should support building with default babel config when running parcel globally", + "title": "should support building with default babel config when running atlaspack globally", "status": "passing" }, { "fileName": "babel", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/babel.js", - "title": "should support building with custom babel config when running parcel globally", + "title": "should support building with custom babel config when running atlaspack globally", "status": "passing" }, { @@ -831,7 +831,7 @@ { "fileName": "javascript", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/javascript.js", - "title": "Should not run parcel over external modules", + "title": "Should not run atlaspack over external modules", "status": "passing" }, { @@ -1269,7 +1269,7 @@ { "fileName": "metrics-reporter", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/metrics-reporter.js", - "title": "Should dump bundle metrics to parcel-metrics.json", + "title": "Should dump bundle metrics to atlaspack-metrics.json", "status": "passing" }, { @@ -1507,31 +1507,31 @@ "status": "passing" }, { - "fileName": "parcel-register", + "fileName": "atlaspack-register", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/parcel-register.js", "title": "can be required at an entry script and transform following requires", "status": "pending" }, { - "fileName": "parcel-register", + "fileName": "atlaspack-register", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/parcel-register.js", "title": "can transform with --r and --require", "status": "pending" }, { - "fileName": "parcel-register", + "fileName": "atlaspack-register", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/parcel-register.js", - "title": "enables Parcel's resolver in node", + "title": "enables Atlaspack's resolver in node", "status": "pending" }, { - "fileName": "parcel-register", + "fileName": "atlaspack-register", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/parcel-register.js", "title": "can be disposed of, which reverts resolving", "status": "pending" }, { - "fileName": "parcel-register", + "fileName": "atlaspack-register", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/parcel-register.js", "title": "can be disposed of, which reverts transforming", "status": "pending" @@ -2211,7 +2211,7 @@ { "fileName": "scope-hoisting", "link": "https://github.com/parcel-bundler/parcel/tree/v2/packages/core/integration-tests/test/scope-hoisting.js", - "title": "doesn't insert parcelRequire for missing non-js assets", + "title": "doesn't insert atlaspackRequire for missing non-js assets", "status": "passing" }, { diff --git a/packages/core/integration-tests/package.json b/packages/core/integration-tests/package.json index d2d4cc647..807d072f1 100644 --- a/packages/core/integration-tests/package.json +++ b/packages/core/integration-tests/package.json @@ -1,14 +1,14 @@ { - "name": "@parcel/integration-tests", + "name": "@atlaspack/integration-tests", "version": "2.12.0", "private": true, "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/parcel.git" + "url": "https://github.com/atlassian-labs/atlaspack.git" }, "scripts": { - "test": "cross-env NODE_ENV=test PARCEL_BUILD_ENV=test mocha --experimental-vm-modules", + "test": "cross-env NODE_ENV=test ATLASPACK_BUILD_ENV=test mocha --experimental-vm-modules", "test-ci": "yarn test --reporter mocha-multi-reporters --reporter-options configFile=./test/mochareporters.json" }, "devDependencies": { @@ -42,7 +42,7 @@ "ncp": "^2.0.0", "nib": "^1.1.2", "node-elm-compiler": "^5.0.5", - "parcel": "2.12.0", + "atlaspack": "2.12.0", "postcss": "^8.4.5", "postcss-custom-properties": "^12.1.2", "postcss-import": "^14.0.2", diff --git a/packages/core/integration-tests/test/BundleGraph.js b/packages/core/integration-tests/test/BundleGraph.js index ec80a4651..474f624f8 100644 --- a/packages/core/integration-tests/test/BundleGraph.js +++ b/packages/core/integration-tests/test/BundleGraph.js @@ -2,8 +2,14 @@ import assert from 'assert'; import path from 'path'; -import {bundle, describe, fsFixture, it, overlayFS} from '@parcel/test-utils'; -import type {BundleGraph, BundleGroup, PackagedBundle} from '@parcel/types'; +import { + bundle, + describe, + fsFixture, + it, + overlayFS, +} from '@atlaspack/test-utils'; +import type {BundleGraph, BundleGroup, PackagedBundle} from '@atlaspack/types'; describe.v2('BundleGraph', () => { it('can traverse assets across bundles and contexts', async () => { diff --git a/packages/core/integration-tests/test/api.js b/packages/core/integration-tests/test/api.js index 6a05ef3fe..28a18851b 100644 --- a/packages/core/integration-tests/test/api.js +++ b/packages/core/integration-tests/test/api.js @@ -10,9 +10,9 @@ import { it, outputFS, overlayFS, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; -import {PARCEL_VERSION} from '../../core/src/constants'; +import {ATLASPACK_VERSION} from '../../core/src/constants'; describe.v2('JS API', function () { it('should respect distEntry', async function () { @@ -44,7 +44,7 @@ describe.v2('JS API', function () { { additionalReporters: [ { - packageName: '@parcel/reporter-bundle-buddy', + packageName: '@atlaspack/reporter-bundle-buddy', resolveFrom: __dirname, }, ], @@ -62,8 +62,8 @@ describe.v2('JS API', function () { }); describe('Reporter API', () => { - it('should pass the parcel version to plugins', async () => { - const dir = path.join(__dirname, 'plugin-parcel-version'); + it('should pass the atlaspack version to plugins', async () => { + const dir = path.join(__dirname, 'plugin-atlaspack-version'); overlayFS.mkdirp(dir); @@ -71,9 +71,9 @@ describe.v2('JS API', function () { index.js: export default 'Hi'; - .parcelrc: + .atlaspackrc: { - extends: "@parcel/config-default", + extends: "@atlaspack/config-default", reporters: ["./reporter-plugin.js", "..."], } @@ -85,13 +85,13 @@ describe.v2('JS API', function () { yarn.lock: reporter-plugin.js: - import {Reporter} from '@parcel/plugin'; + import {Reporter} from '@atlaspack/plugin'; import path from 'node:path'; export default new Reporter({ async report({event, options}) { if (event.type === 'buildSuccess') { - await options.outputFS.writeFile(path.join(options.projectRoot, 'parcel-version.txt'), options.parcelVersion); + await options.outputFS.writeFile(path.join(options.projectRoot, 'atlaspack-version.txt'), options.atlaspackVersion); } } }) @@ -103,8 +103,8 @@ describe.v2('JS API', function () { }); assert.equal( - await overlayFS.readFile(path.join(dir, 'parcel-version.txt')), - PARCEL_VERSION, + await overlayFS.readFile(path.join(dir, 'atlaspack-version.txt')), + ATLASPACK_VERSION, ); }); }); diff --git a/packages/core/integration-tests/test/parcel-link.js b/packages/core/integration-tests/test/atlaspack-link.js similarity index 51% rename from packages/core/integration-tests/test/parcel-link.js rename to packages/core/integration-tests/test/atlaspack-link.js index 6ad3df934..6ce23b27a 100644 --- a/packages/core/integration-tests/test/parcel-link.js +++ b/packages/core/integration-tests/test/atlaspack-link.js @@ -1,9 +1,9 @@ // @flow strict-local -import type {ProgramOptions} from '@parcel/link'; +import type {ProgramOptions} from '@atlaspack/link'; -import {createProgram as _createProgram} from '@parcel/link'; -import {describe, fsFixture, it, overlayFS} from '@parcel/test-utils'; +import {createProgram as _createProgram} from '@atlaspack/link'; +import {describe, fsFixture, it, overlayFS} from '@atlaspack/test-utils'; import assert from 'assert'; import path from 'path'; @@ -19,7 +19,9 @@ function createProgram(opts: ProgramOptions) { return cli; } -describe.v2('@parcel/link', () => { +// This test suite has been broken since the rename but it's not obvious why. +// Parking for later. +describe.v2('@atlaspack/link', () => { let _cwd; let _stdout; @@ -84,27 +86,27 @@ describe.v2('@parcel/link', () => { await fsFixture(overlayFS)` yarn.lock: node_modules - parcel - @parcel/core`; + atlaspack + @atlaspack/core`; let cli = createProgram({fs: overlayFS}); await cli('link'); - assert(overlayFS.existsSync('.parcel-link')); + assert(overlayFS.existsSync('.atlaspack-link')); assert.equal( - overlayFS.realpathSync('node_modules/@parcel/core'), + overlayFS.realpathSync('node_modules/@atlaspack/core'), path.resolve(__dirname, '../../core'), ); assert.equal( - overlayFS.realpathSync('node_modules/parcel'), - path.resolve(__dirname, '../../parcel'), + overlayFS.realpathSync('node_modules/atlaspack'), + path.resolve(__dirname, '../../atlaspack'), ); assert.equal( - overlayFS.realpathSync('node_modules/.bin/parcel'), - path.resolve(__dirname, '../../parcel/src/bin.js'), + overlayFS.realpathSync('node_modules/.bin/atlaspack'), + path.resolve(__dirname, '../../atlaspack/src/bin.js'), ); }); @@ -113,13 +115,13 @@ describe.v2('@parcel/link', () => { app yarn.lock: node_modules - parcel - @parcel/core + atlaspack + @atlaspack/core package-root core - core/package.json: ${{name: '@parcel/core'}} - parcel - package.json: ${{name: 'parcel'}} + core/package.json: ${{name: '@atlaspack/core'}} + atlaspack + package.json: ${{name: 'atlaspack'}} src/bin.js:`; overlayFS.chdir('/app'); @@ -127,21 +129,24 @@ describe.v2('@parcel/link', () => { let cli = createProgram({fs: overlayFS}); await cli(`link ../package-root`); - assert(overlayFS.existsSync('.parcel-link')); + assert(overlayFS.existsSync('.atlaspack-link')); assert.equal( - overlayFS.realpathSync('node_modules/@parcel/core'), + overlayFS.realpathSync('node_modules/@atlaspack/core'), path.resolve(overlayFS.cwd(), '../package-root/core/core'), ); assert.equal( - overlayFS.realpathSync('node_modules/parcel'), - path.resolve(overlayFS.cwd(), '../package-root/core/parcel'), + overlayFS.realpathSync('node_modules/atlaspack'), + path.resolve(overlayFS.cwd(), '../package-root/core/atlaspack'), ); assert.equal( - overlayFS.realpathSync('node_modules/.bin/parcel'), - path.resolve(overlayFS.cwd(), '../package-root/core/parcel/src/bin.js'), + overlayFS.realpathSync('node_modules/.bin/atlaspack'), + path.resolve( + overlayFS.cwd(), + '../package-root/core/atlaspack/src/bin.js', + ), ); }); @@ -149,44 +154,44 @@ describe.v2('@parcel/link', () => { await fsFixture(overlayFS)` yarn.lock: node_modules - .bin/parcel: + .bin/atlaspack: @namespace - parcel - parcel-core`; + atlaspack + atlaspack-core`; let cli = createProgram({fs: overlayFS}); await cli('link --namespace @namespace'); - assert(overlayFS.existsSync('.parcel-link')); + assert(overlayFS.existsSync('.atlaspack-link')); assert.equal( - overlayFS.realpathSync('node_modules/.bin/parcel'), - path.resolve(__dirname, '../../parcel/src/bin.js'), + overlayFS.realpathSync('node_modules/.bin/atlaspack'), + path.resolve(__dirname, '../../atlaspack/src/bin.js'), ); assert.equal( - overlayFS.realpathSync('node_modules/@namespace/parcel-core'), + overlayFS.realpathSync('node_modules/@namespace/atlaspack-core'), path.resolve(__dirname, '../../core'), ); assert.equal( - overlayFS.realpathSync('node_modules/@parcel/core'), + overlayFS.realpathSync('node_modules/@atlaspack/core'), path.resolve(__dirname, '../../core'), ); assert.equal( - overlayFS.realpathSync('node_modules/@namespace/parcel'), - path.resolve(__dirname, '../../parcel'), + overlayFS.realpathSync('node_modules/@namespace/atlaspack'), + path.resolve(__dirname, '../../atlaspack'), ); assert.equal( - overlayFS.realpathSync('node_modules/parcel'), - path.resolve(__dirname, '../../parcel'), + overlayFS.realpathSync('node_modules/atlaspack'), + path.resolve(__dirname, '../../atlaspack'), ); assert.equal( - overlayFS.realpathSync('node_modules/.bin/parcel'), - path.resolve(__dirname, '../../parcel/src/bin.js'), + overlayFS.realpathSync('node_modules/.bin/atlaspack'), + path.resolve(__dirname, '../../atlaspack/src/bin.js'), ); }); @@ -196,22 +201,22 @@ describe.v2('@parcel/link', () => { ${path.resolve( path.join(__dirname, '../../../configs/namespace/package.json'), )}: ${{ - name: '@parcel/config-namespace', + name: '@atlaspack/config-namespace', }} app yarn.lock: - .parcelrc: ${{ - extends: '@namespace/parcel-config-namespace', + .atlaspackrc: ${{ + extends: '@namespace/atlaspack-config-namespace', transformers: { '*': [ - '@namespace/parcel-transformer-js', - '@namespace/parcel-transformer-local', + '@namespace/atlaspack-transformer-js', + '@namespace/atlaspack-transformer-local', ], }, }} package.json: ${{ - ['@namespace/parcel-transformer-js']: {}, - ['@namespace/parcel-transformer-local']: {}, + ['@namespace/atlaspack-transformer-js']: {}, + ['@namespace/atlaspack-transformer-local']: {}, }}`; overlayFS.chdir('/app'); @@ -219,16 +224,16 @@ describe.v2('@parcel/link', () => { let cli = createProgram({fs: overlayFS}); await cli('link --namespace @namespace'); - assert(overlayFS.existsSync('.parcel-link')); + assert(overlayFS.existsSync('.atlaspack-link')); assert.equal( - overlayFS.readFileSync('.parcelrc', 'utf8'), + overlayFS.readFileSync('.atlaspackrc', 'utf8'), JSON.stringify({ - extends: '@parcel/config-namespace', + extends: '@atlaspack/config-namespace', transformers: { '*': [ - '@parcel/transformer-js', - '@namespace/parcel-transformer-local', + '@atlaspack/transformer-js', + '@namespace/atlaspack-transformer-local', ], }, }), @@ -237,8 +242,8 @@ describe.v2('@parcel/link', () => { assert.equal( overlayFS.readFileSync('package.json', 'utf8'), JSON.stringify({ - ['@parcel/transformer-js']: {}, - ['@namespace/parcel-transformer-local']: {}, + ['@atlaspack/transformer-js']: {}, + ['@namespace/atlaspack-transformer-local']: {}, }), ); }); @@ -247,32 +252,32 @@ describe.v2('@parcel/link', () => { await fsFixture(overlayFS)` yarn.lock: tools - test/node_modules/parcel - test2/node_modules/@parcel/core`; + test/node_modules/atlaspack + test2/node_modules/@atlaspack/core`; let cli = createProgram({fs: overlayFS}); await cli('link --node-modules-glob "tools/*/node_modules"'); - assert(overlayFS.existsSync('.parcel-link')); + assert(overlayFS.existsSync('.atlaspack-link')); assert(overlayFS.existsSync('tools/test/node_modules')); - assert(!overlayFS.existsSync('tools/test/node_modules/parcel')); + assert(!overlayFS.existsSync('tools/test/node_modules/atlaspack')); assert(overlayFS.existsSync('tools/test2/node_modules')); - assert(!overlayFS.existsSync('tools/test2/node_modules/@parcel/core')); + assert(!overlayFS.existsSync('tools/test2/node_modules/@atlaspack/core')); assert.equal( - overlayFS.realpathSync('node_modules/parcel'), - path.resolve(__dirname, '../../parcel'), + overlayFS.realpathSync('node_modules/atlaspack'), + path.resolve(__dirname, '../../atlaspack'), ); assert.equal( - overlayFS.realpathSync('node_modules/.bin/parcel'), - path.resolve(__dirname, '../../parcel/src/bin.js'), + overlayFS.realpathSync('node_modules/.bin/atlaspack'), + path.resolve(__dirname, '../../atlaspack/src/bin.js'), ); assert.equal( - overlayFS.realpathSync('node_modules/@parcel/core'), + overlayFS.realpathSync('node_modules/@atlaspack/core'), path.resolve(__dirname, '../../core'), ); }); @@ -281,25 +286,25 @@ describe.v2('@parcel/link', () => { await fsFixture(overlayFS)` yarn.lock: node_modules - parcel - @parcel/core`; + atlaspack + @atlaspack/core`; let cli = createProgram({fs: overlayFS}); await cli('link --dry-run'); - assert(!overlayFS.existsSync('.parcel-link')); + assert(!overlayFS.existsSync('.atlaspack-link')); assert.equal( - overlayFS.realpathSync('node_modules/@parcel/core'), - path.resolve('/app/node_modules/@parcel/core'), + overlayFS.realpathSync('node_modules/@atlaspack/core'), + path.resolve('/app/node_modules/@atlaspack/core'), ); assert.equal( - overlayFS.realpathSync('node_modules/parcel'), - path.resolve('/app/node_modules/parcel'), + overlayFS.realpathSync('node_modules/atlaspack'), + path.resolve('/app/node_modules/atlaspack'), ); - assert(!overlayFS.existsSync('node_modules/.bin/parcel')); + assert(!overlayFS.existsSync('node_modules/.bin/atlaspack')); }); }); @@ -316,11 +321,11 @@ describe.v2('@parcel/link', () => { it('errors for invalid app root', async () => { await fsFixture(overlayFS)` yarn.lock: - .parcel-link: ${{ + .atlaspack-link: ${{ appRoot: '/app2', packageRoot: path.resolve(__dirname, '../../..'), nodeModulesGlobs: ['node_modules'], - namespace: '@parcel', + namespace: '@atlaspack', }}`; let cli = createProgram({fs: overlayFS}); @@ -332,11 +337,11 @@ describe.v2('@parcel/link', () => { it('errors for invalid package root', async () => { await fsFixture(overlayFS)` yarn.lock: - .parcel-link: ${{ + .atlaspack-link: ${{ appRoot: '/app', packageRoot: path.resolve(__dirname, '../../..') + '2', nodeModulesGlobs: ['node_modules'], - namespace: '@parcel', + namespace: '@atlaspack', }}`; let cli = createProgram({fs: overlayFS}); @@ -349,102 +354,111 @@ describe.v2('@parcel/link', () => { await fsFixture(overlayFS)` yarn.lock: node_modules - .bin/parcel -> ${path.resolve(__dirname, '../../parcel/src/bin.js')} - parcel -> ${path.resolve(__dirname, '../../parcel')} - @parcel/core -> ${path.resolve(__dirname, '../../core')} - .parcel-link: ${{ + .bin/atlaspack -> ${path.resolve( + __dirname, + '../../atlaspack/src/bin.js', + )} + atlaspack -> ${path.resolve(__dirname, '../../atlaspack')} + @atlaspack/core -> ${path.resolve(__dirname, '../../core')} + .atlaspack-link: ${{ appRoot: '/app', packageRoot: path.resolve(__dirname, '../../..'), nodeModulesGlobs: ['node_modules'], - namespace: '@parcel', + namespace: '@atlaspack', }}`; - assert(overlayFS.existsSync('.parcel-link')); - assert(overlayFS.existsSync('node_modules/@parcel/core')); - assert(overlayFS.existsSync('node_modules/parcel')); - assert(overlayFS.existsSync('node_modules/.bin/parcel')); + assert(overlayFS.existsSync('.atlaspack-link')); + assert(overlayFS.existsSync('node_modules/@atlaspack/core')); + assert(overlayFS.existsSync('node_modules/atlaspack')); + assert(overlayFS.existsSync('node_modules/.bin/atlaspack')); let cli = createProgram({fs: overlayFS}); await cli('unlink'); - assert(!overlayFS.existsSync('.parcel-link')); - assert(!overlayFS.existsSync('node_modules/@parcel/core')); - assert(!overlayFS.existsSync('node_modules/parcel')); - assert(!overlayFS.existsSync('node_modules/.bin/parcel')); + assert(!overlayFS.existsSync('.atlaspack-link')); + assert(!overlayFS.existsSync('node_modules/@atlaspack/core')); + assert(!overlayFS.existsSync('node_modules/atlaspack')); + assert(!overlayFS.existsSync('node_modules/.bin/atlaspack')); }); it('unlinks from a custom package root', async () => { await fsFixture(overlayFS)` yarn.lock: - .parcel-link: ${{ + .atlaspack-link: ${{ appRoot: '/app', packageRoot: '/package-root', nodeModulesGlobs: ['node_modules'], - namespace: '@parcel', + namespace: '@atlaspack', }} - node_modules/parcel -> package-root/core/parcel - node_modules/@parcel/core -> package-root/core/core - node_modules/.bin/parcel -> package-root/core/parcel/src/bin.js`; + node_modules/atlaspack -> package-root/core/atlaspack + node_modules/@atlaspack/core -> package-root/core/core + node_modules/.bin/atlaspack -> package-root/core/atlaspack/src/bin.js`; await fsFixture(overlayFS, '/')` - package-root/core/core/package.json: ${{name: '@parcel/core'}} - package-root/core/parcel/package.json: ${{name: 'parcel'}} - package-root/core/parcel/src/bin.js:`; + package-root/core/core/package.json: ${{name: '@atlaspack/core'}} + package-root/core/atlaspack/package.json: ${{name: 'atlaspack'}} + package-root/core/atlaspack/src/bin.js:`; let cli = createProgram({fs: overlayFS}); await cli('unlink'); - assert(!overlayFS.existsSync('.parcel-link')); - assert(!overlayFS.existsSync('node_modules/@parcel/core')); - assert(!overlayFS.existsSync('node_modules/parcel')); - assert(!overlayFS.existsSync('node_modules/.bin/parcel')); + assert(!overlayFS.existsSync('.atlaspack-link')); + assert(!overlayFS.existsSync('node_modules/@atlaspack/core')); + assert(!overlayFS.existsSync('node_modules/atlaspack')); + assert(!overlayFS.existsSync('node_modules/.bin/atlaspack')); }); it('unlinks with a custom namespace', async () => { await fsFixture(overlayFS)` yarn.lock: - .parcel-link: ${{ + .atlaspack-link: ${{ appRoot: '/app', packageRoot: path.resolve(__dirname, '../../..'), nodeModulesGlobs: ['node_modules'], namespace: '@namespace', }} node_modules - .bin/parcel -> ${path.resolve(__dirname, '../../parcel/src/bin.js')} - parcel -> ${path.resolve(__dirname, '../../parcel')} - @namespace/parcel -> ${path.resolve(__dirname, '../../parcel')} - parcel/core -> ${path.resolve(__dirname, '../../core')} - @namespace/parcel-core -> ${path.resolve(__dirname, '../../core')}`; + .bin/atlaspack -> ${path.resolve( + __dirname, + '../../atlaspack/src/bin.js', + )} + atlaspack -> ${path.resolve(__dirname, '../../atlaspack')} + @namespace/atlaspack -> ${path.resolve(__dirname, '../../atlaspack')} + atlaspack/core -> ${path.resolve(__dirname, '../../core')} + @namespace/atlaspack-core -> ${path.resolve( + __dirname, + '../../core', + )}`; let cli = createProgram({fs: overlayFS}); await cli('unlink'); - assert(!overlayFS.existsSync('.parcel-link')); - assert(!overlayFS.existsSync('node_modules/@parcel/core')); - assert(!overlayFS.existsSync('node_modules/parcel')); - assert(!overlayFS.existsSync('node_modules/.bin/parcel')); - assert(!overlayFS.existsSync('node_modules/@namespace/parcel-core')); - assert(!overlayFS.existsSync('node_modules/@namespace/parcel')); + assert(!overlayFS.existsSync('.atlaspack-link')); + assert(!overlayFS.existsSync('node_modules/@atlaspack/core')); + assert(!overlayFS.existsSync('node_modules/atlaspack')); + assert(!overlayFS.existsSync('node_modules/.bin/atlaspack')); + assert(!overlayFS.existsSync('node_modules/@namespace/atlaspack-core')); + assert(!overlayFS.existsSync('node_modules/@namespace/atlaspack')); }); // FIXME: this test fails on windows it.skip('updates config for custom namespace', async () => { await fsFixture(overlayFS)` yarn.lock: - .parcelrc: ${{ - extends: '@parcel/config-namespace', + .atlaspackrc: ${{ + extends: '@atlaspack/config-namespace', transformers: { '*': [ - '@parcel/transformer-js', - '@namespace/parcel-transformer-local', + '@atlaspack/transformer-js', + '@namespace/atlaspack-transformer-local', ], }, }} package.json: ${{ - ['@parcel/transformer-js']: {}, - ['@namespace/parcel-transformer-local']: {}, + ['@atlaspack/transformer-js']: {}, + ['@namespace/atlaspack-transformer-local']: {}, }} - .parcel-link: ${{ + .atlaspack-link: ${{ appRoot: '/app', packageRoot: path.resolve(__dirname, '../../..'), nodeModulesGlobs: ['node_modules'], @@ -455,22 +469,22 @@ describe.v2('@parcel/link', () => { ${path.resolve( path.join(__dirname, '../../../configs/namespace/package.json'), )}: ${{ - name: '@parcel/config-namespace', + name: '@atlaspack/config-namespace', }}`; let cli = createProgram({fs: overlayFS}); await cli('unlink'); - assert(!overlayFS.existsSync('.parcel-link')); + assert(!overlayFS.existsSync('.atlaspack-link')); assert.equal( - overlayFS.readFileSync('.parcelrc', 'utf8'), + overlayFS.readFileSync('.atlaspackrc', 'utf8'), JSON.stringify({ - extends: '@namespace/parcel-config-namespace', + extends: '@namespace/atlaspack-config-namespace', transformers: { '*': [ - '@namespace/parcel-transformer-js', - '@namespace/parcel-transformer-local', + '@namespace/atlaspack-transformer-js', + '@namespace/atlaspack-transformer-local', ], }, }), @@ -479,8 +493,8 @@ describe.v2('@parcel/link', () => { assert.equal( overlayFS.readFileSync('package.json', 'utf8'), JSON.stringify({ - ['@namespace/parcel-transformer-js']: {}, - ['@namespace/parcel-transformer-local']: {}, + ['@namespace/atlaspack-transformer-js']: {}, + ['@namespace/atlaspack-transformer-local']: {}, }), ); }); @@ -488,19 +502,25 @@ describe.v2('@parcel/link', () => { it('unlinks with custom node modules glob', async () => { await fsFixture(overlayFS)` yarn.lock: - .parcel-link: ${{ + .atlaspack-link: ${{ appRoot: '/app', packageRoot: path.resolve(__dirname, '../../..'), nodeModulesGlobs: ['node_modules', 'tools/*/node_modules'], - namespace: '@parcel', + namespace: '@atlaspack', }} node_modules - parcel -> ${path.resolve(__dirname, '../../parcel')} - @parcel/core -> ${path.resolve(__dirname, '../../core')} - .bin/parcel -> ${path.resolve(__dirname, '../../parcel/src/bin.js')} + atlaspack -> ${path.resolve(__dirname, '../../atlaspack')} + @atlaspack/core -> ${path.resolve(__dirname, '../../core')} + .bin/atlaspack -> ${path.resolve( + __dirname, + '../../atlaspack/src/bin.js', + )} tools - test/node_modules/parcel -> ${path.resolve(__dirname, '../../parcel')} - test2/node_modules/@parcel/core -> ${path.resolve( + test/node_modules/atlaspack -> ${path.resolve( + __dirname, + '../../atlaspack', + )} + test2/node_modules/@atlaspack/core -> ${path.resolve( __dirname, '../../core', )}`; @@ -508,47 +528,50 @@ describe.v2('@parcel/link', () => { let cli = createProgram({fs: overlayFS}); await cli('unlink'); - assert(!overlayFS.existsSync('.parcel-link')); - assert(!overlayFS.existsSync('node_modules/@parcel/core')); - assert(!overlayFS.existsSync('node_modules/parcel')); - assert(!overlayFS.existsSync('node_modules/.bin/parcel')); - assert(!overlayFS.existsSync('tools/test/node_modules/parcel')); - assert(!overlayFS.existsSync('tools/test2/node_modules/@parcel/core')); + assert(!overlayFS.existsSync('.atlaspack-link')); + assert(!overlayFS.existsSync('node_modules/@atlaspack/core')); + assert(!overlayFS.existsSync('node_modules/atlaspack')); + assert(!overlayFS.existsSync('node_modules/.bin/atlaspack')); + assert(!overlayFS.existsSync('tools/test/node_modules/atlaspack')); + assert(!overlayFS.existsSync('tools/test2/node_modules/@atlaspack/core')); }); it('does not do anything with dry run', async () => { await fsFixture(overlayFS)` yarn.lock: node_modules - .bin/parcel -> ${path.resolve(__dirname, '../../parcel/src/bin.js')} - parcel -> ${path.resolve(__dirname, '../../parcel')} - @parcel/core -> ${path.resolve(__dirname, '../../core')} - .parcel-link: ${{ + .bin/atlaspack -> ${path.resolve( + __dirname, + '../../atlaspack/src/bin.js', + )} + atlaspack -> ${path.resolve(__dirname, '../../atlaspack')} + @atlaspack/core -> ${path.resolve(__dirname, '../../core')} + .atlaspack-link: ${{ appRoot: '/app', packageRoot: path.resolve(__dirname, '../../..'), nodeModulesGlobs: ['node_modules'], - namespace: '@parcel', + namespace: '@atlaspack', }} `; let cli = createProgram({fs: overlayFS}); await cli('unlink --dry-run'); - assert(overlayFS.existsSync('.parcel-link')); + assert(overlayFS.existsSync('.atlaspack-link')); assert.equal( - overlayFS.realpathSync('node_modules/@parcel/core'), + overlayFS.realpathSync('node_modules/@atlaspack/core'), path.resolve(__dirname, '../../core'), ); assert.equal( - overlayFS.realpathSync('node_modules/parcel'), - path.resolve(__dirname, '../../parcel'), + overlayFS.realpathSync('node_modules/atlaspack'), + path.resolve(__dirname, '../../atlaspack'), ); assert.equal( - overlayFS.realpathSync('node_modules/.bin/parcel'), - path.resolve(__dirname, '../../parcel/src/bin.js'), + overlayFS.realpathSync('node_modules/.bin/atlaspack'), + path.resolve(__dirname, '../../atlaspack/src/bin.js'), ); }); }); diff --git a/packages/core/integration-tests/test/parcel-query.js b/packages/core/integration-tests/test/atlaspack-query.js similarity index 82% rename from packages/core/integration-tests/test/parcel-query.js rename to packages/core/integration-tests/test/atlaspack-query.js index 3f78611a3..1338f52c1 100644 --- a/packages/core/integration-tests/test/parcel-query.js +++ b/packages/core/integration-tests/test/atlaspack-query.js @@ -1,10 +1,10 @@ // @flow import assert from 'assert'; import path from 'path'; -import {bundle, describe, fsFixture, overlayFS} from '@parcel/test-utils'; +import {bundle, describe, fsFixture, overlayFS} from '@atlaspack/test-utils'; import {loadGraphs} from '../../../dev/query/src'; -describe.v2('parcel-query', () => { +describe.v2('atlaspack-query', () => { it('loadGraphs', async function () { let entries = 'index.js'; let options = { @@ -14,7 +14,7 @@ describe.v2('parcel-query', () => { }, shouldDisableCache: false, inputFS: overlayFS, - cacheDir: path.join(__dirname, '.parcel-cache'), + cacheDir: path.join(__dirname, '.atlaspack-cache'), }; await fsFixture(overlayFS)` diff --git a/packages/core/integration-tests/test/parcel-register.js b/packages/core/integration-tests/test/atlaspack-register.js similarity index 71% rename from packages/core/integration-tests/test/parcel-register.js rename to packages/core/integration-tests/test/atlaspack-register.js index 5930247b7..dcda8e223 100644 --- a/packages/core/integration-tests/test/parcel-register.js +++ b/packages/core/integration-tests/test/atlaspack-register.js @@ -4,14 +4,14 @@ import {execSync} from 'child_process'; import assert from 'assert'; import path from 'path'; -describe.skip('@parcel/register', () => { +describe.skip('@atlaspack/register', () => { it('can be required at an entry script and transform following requires', () => { assert.equal( execSync( `node ${path.join( __dirname, 'integration', - 'parcel-register', + 'atlaspack-register', 'entry.js', )}`, ), @@ -22,10 +22,10 @@ describe.skip('@parcel/register', () => { it('can transform with --r and --require', () => { assert.equal( execSync( - `node -r @parcel/register ${path.join( + `node -r @atlaspack/register ${path.join( __dirname, 'integration', - 'parcel-register', + 'atlaspack-register', 'index.js', )}`, ), @@ -33,22 +33,22 @@ describe.skip('@parcel/register', () => { ); }); - it("enables Parcel's resolver in node", () => { + it("enables Atlaspack's resolver in node", () => { let [foo, resolved] = execSync( - `node -r @parcel/register ${path.join( + `node -r @atlaspack/register ${path.join( __dirname, 'integration', - 'parcel-register', + 'atlaspack-register', 'resolver.js', )}`, - {cwd: path.join(__dirname, 'integration', 'parcel-register')}, + {cwd: path.join(__dirname, 'integration', 'atlaspack-register')}, ) .toString() .split('\n'); assert.equal(foo, 'foo'); assert.equal( resolved, - path.join(__dirname, 'integration', 'parcel-register', 'foo.js'), + path.join(__dirname, 'integration', 'atlaspack-register', 'foo.js'), ); }); @@ -58,11 +58,11 @@ describe.skip('@parcel/register', () => { `node ${path.join( __dirname, 'integration', - 'parcel-register', + 'atlaspack-register', 'dispose-resolve.js', )}`, { - cwd: path.join(__dirname, 'integration', 'parcel-register'), + cwd: path.join(__dirname, 'integration', 'atlaspack-register'), stdio: 'pipe', }, ) @@ -71,7 +71,7 @@ describe.skip('@parcel/register', () => { } catch (e) { assert.equal( e.stdout.toString().trim(), - path.join(__dirname, 'integration', 'parcel-register', 'foo.js'), + path.join(__dirname, 'integration', 'atlaspack-register', 'foo.js'), ); assert(e.stderr.includes("Error: Cannot find module '~foo.js'")); return; @@ -87,11 +87,11 @@ describe.skip('@parcel/register', () => { `node ${path.join( __dirname, 'integration', - 'parcel-register', + 'atlaspack-register', 'dispose-transform.js', )}`, { - cwd: path.join(__dirname, 'integration', 'parcel-register'), + cwd: path.join(__dirname, 'integration', 'atlaspack-register'), stdio: 'pipe', }, ) diff --git a/packages/core/integration-tests/test/atlaspack-v3.js b/packages/core/integration-tests/test/atlaspack-v3.js new file mode 100644 index 000000000..9df7d6ee7 --- /dev/null +++ b/packages/core/integration-tests/test/atlaspack-v3.js @@ -0,0 +1,42 @@ +// @flow + +import {join} from 'path'; + +import {AtlaspackV3, toFileSystemV3} from '@atlaspack/core'; +import {NodePackageManager} from '@atlaspack/package-manager'; +import { + describe, + fsFixture, + inputFS, + it, + overlayFS, +} from '@atlaspack/test-utils'; + +describe('AtlaspackV3', function () { + it('builds', async () => { + await fsFixture(overlayFS, __dirname)` + index.js: + console.log('hello world'); + + .atlaspackrc: + { + "extends": "@atlaspack/config-default", + "transformers": { + "*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": ["@atlaspack/transformer-js"] + } + } + + yarn.lock: {} + `; + + let atlaspack = new AtlaspackV3({ + corePath: '', + entries: [join(__dirname, 'index.js')], + fs: toFileSystemV3(overlayFS), + nodeWorkers: 1, + packageManager: new NodePackageManager(inputFS, __dirname), + }); + + await atlaspack.build(); + }); +}); diff --git a/packages/core/integration-tests/test/babel.js b/packages/core/integration-tests/test/babel.js index 333bdbf85..3beb0dbdc 100644 --- a/packages/core/integration-tests/test/babel.js +++ b/packages/core/integration-tests/test/babel.js @@ -14,14 +14,14 @@ import { removeDistDirectory, run, sleep, -} from '@parcel/test-utils'; -import Logger from '@parcel/logger'; +} from '@atlaspack/test-utils'; +import Logger from '@atlaspack/logger'; import os from 'os'; import {spawnSync} from 'child_process'; import tempy from 'tempy'; -import {md} from '@parcel/diagnostic'; +import {md} from '@atlaspack/diagnostic'; -const parcelCli = require.resolve('parcel/src/bin.js'); +const atlaspackCli = require.resolve('atlaspack/src/bin.js'); const inputDir = path.join(__dirname, '/input'); describe.v2('babel', function () { @@ -197,7 +197,7 @@ describe.v2('babel', function () { assert(file.match(/return \d+;/)); }); - it('should support multitarget builds using a custom babel config with @parcel/babel-preset-env', async function () { + it('should support multitarget builds using a custom babel config with @atlaspack/babel-preset-env', async function () { let fixtureDir = path.join( __dirname, '/integration/babel-config-js-multitarget', @@ -219,7 +219,7 @@ describe.v2('babel', function () { await outputFS.rimraf(path.join(fixtureDir, 'dist')); }); - it('should support multitarget builds using a custom babel config with @parcel/babel-plugin-transform-runtime', async function () { + it('should support multitarget builds using a custom babel config with @atlaspack/babel-plugin-transform-runtime', async function () { let fixtureDir = path.join( __dirname, '/integration/babel-config-js-multitarget-transform-runtime', @@ -244,7 +244,7 @@ describe.v2('babel', function () { await outputFS.rimraf(path.join(fixtureDir, 'dist')); }); - it('should support building with custom babel config when running parcel globally', async function () { + it('should support building with custom babel config when running atlaspack globally', async function () { let tmpDir = tempy.directory(); let distDir = path.join(tmpDir, 'dist'); await fs.ncp( @@ -349,7 +349,7 @@ describe.v2('babel', function () { assert(file.includes('class Foo')); }); - it('should be "production" if Parcel is run in production mode', async () => { + it('should be "production" if Atlaspack is run in production mode', async () => { await bundle( path.join(__dirname, '/integration/babel-env-name/index.js'), { @@ -461,7 +461,7 @@ describe.v2('babel', function () { let fixtureDir = path.join(__dirname, '/integration/babel-config-js'); let distDir = path.resolve(fixtureDir, './dist'); - let cacheDir = path.resolve(fixtureDir, '.parcel-cache'); + let cacheDir = path.resolve(fixtureDir, '.atlaspack-cache'); await fs.rimraf(distDir); await fs.rimraf(cacheDir); await fs.rimraf(path.resolve(fixtureDir, './node_modules/.cache')); @@ -470,7 +470,7 @@ describe.v2('babel', function () { spawnSync( 'node', [ - parcelCli, + atlaspackCli, 'build', 'src/index.js', '--no-optimize', @@ -480,7 +480,7 @@ describe.v2('babel', function () { cwd: fixtureDir, env: { ...process.env, - PARCEL_WORKERS: '0', + ATLASPACK_WORKERS: '0', }, }, ); @@ -507,17 +507,23 @@ describe.v2('babel', function () { '/integration/babel-plugin-upgrade', ); await fs.ncp(path.join(fixtureDir), inputDir); - await fs.rimraf(path.join(__dirname, '.parcel-cache')); + await fs.rimraf(path.join(__dirname, '.atlaspack-cache')); let build = () => spawnSync( 'node', - [parcelCli, 'build', 'index.js', '--no-optimize', '--no-scope-hoist'], + [ + atlaspackCli, + 'build', + 'index.js', + '--no-optimize', + '--no-scope-hoist', + ], { cwd: inputDir, env: { ...process.env, - PARCEL_WORKERS: '0', + ATLASPACK_WORKERS: '0', }, }, ); @@ -551,7 +557,7 @@ describe.v2('babel', function () { }); }); - it('should enable shippedProposals with @parcel/babel-preset-env in custom babelrc', async function () { + it('should enable shippedProposals with @atlaspack/babel-preset-env in custom babelrc', async function () { let b = await bundle( path.join( __dirname, @@ -637,8 +643,8 @@ describe.v2('babel', function () { level: 'warn', diagnostics: [ { - origin: '@parcel/transformer-babel', - message: md`Parcel includes transpilation by default. Babel config __${path.relative( + origin: '@atlaspack/transformer-babel', + message: md`Atlaspack includes transpilation by default. Babel config __${path.relative( process.cwd(), babelrcPath, )}__ contains only redundant presets. Deleting it may significantly improve build performance.`, @@ -667,9 +673,9 @@ describe.v2('babel', function () { 'https://parceljs.org/languages/javascript/#default-presets', }, { - origin: '@parcel/transformer-babel', + origin: '@atlaspack/transformer-babel', message: - "@babel/preset-env does not support Parcel's targets, which will likely result in unnecessary transpilation and larger bundle sizes.", + "@babel/preset-env does not support Atlaspack's targets, which will likely result in unnecessary transpilation and larger bundle sizes.", codeFrames: [ { filePath: path.resolve(path.dirname(filePath), '.babelrc'), @@ -689,7 +695,7 @@ describe.v2('babel', function () { }, ], hints: [ - "Either remove __@babel/preset-env__ to use Parcel's builtin transpilation, or replace with __@parcel/babel-preset-env__", + "Either remove __@babel/preset-env__ to use Atlaspack's builtin transpilation, or replace with __@atlaspack/babel-preset-env__", ], documentationURL: 'https://parceljs.org/languages/javascript/#custom-plugins', @@ -720,11 +726,11 @@ describe.v2('babel', function () { level: 'warn', diagnostics: [ { - origin: '@parcel/transformer-babel', - message: md`Parcel includes transpilation by default. Babel config __${path.relative( + origin: '@atlaspack/transformer-babel', + message: md`Atlaspack includes transpilation by default. Babel config __${path.relative( process.cwd(), babelrcPath, - )}__ includes the following redundant presets: __@parcel/babel-preset-env__. Removing these may improve build performance.`, + )}__ includes the following redundant presets: __@atlaspack/babel-preset-env__. Removing these may improve build performance.`, codeFrames: [ { filePath: babelrcPath, @@ -737,7 +743,7 @@ describe.v2('babel', function () { }, end: { line: 2, - column: 40, + column: 43, }, }, ], @@ -778,11 +784,11 @@ describe.v2('babel', function () { level: 'warn', diagnostics: [ { - origin: '@parcel/transformer-babel', - message: md`Parcel includes transpilation by default. Babel config __${path.relative( + origin: '@atlaspack/transformer-babel', + message: md`Atlaspack includes transpilation by default. Babel config __${path.relative( process.cwd(), babelrcPath, - )}__ includes the following redundant presets: __@parcel/babel-preset-env__. Removing these may improve build performance.`, + )}__ includes the following redundant presets: __@atlaspack/babel-preset-env__. Removing these may improve build performance.`, codeFrames: [ { filePath: babelrcPath, @@ -795,7 +801,7 @@ describe.v2('babel', function () { }, end: { line: 2, - column: 38, + column: 41, }, }, ], diff --git a/packages/core/integration-tests/test/blob-url.js b/packages/core/integration-tests/test/blob-url.js index cf15ff453..cd9f751e3 100644 --- a/packages/core/integration-tests/test/blob-url.js +++ b/packages/core/integration-tests/test/blob-url.js @@ -2,7 +2,14 @@ import assert from 'assert'; import path from 'path'; -import {bundle, describe, distDir, it, outputFS, run} from '@parcel/test-utils'; +import { + bundle, + describe, + distDir, + it, + outputFS, + run, +} from '@atlaspack/test-utils'; class Blob { data; diff --git a/packages/core/integration-tests/test/bundler.js b/packages/core/integration-tests/test/bundler.js index 88b5e305d..bb51f8521 100644 --- a/packages/core/integration-tests/test/bundler.js +++ b/packages/core/integration-tests/test/bundler.js @@ -1,6 +1,6 @@ import path from 'path'; import assert from 'assert'; -import Logger from '@parcel/logger'; +import Logger from '@atlaspack/logger'; import { assertBundles, bundle, @@ -10,9 +10,9 @@ import { overlayFS, fsFixture, run, -} from '@parcel/test-utils'; -import {hashString} from '@parcel/rust'; -import {normalizePath} from '@parcel/utils'; +} from '@atlaspack/test-utils'; +import {hashString} from '@atlaspack/rust'; +import {normalizePath} from '@atlaspack/utils'; describe.v2('bundler', function () { it('should not create shared bundles when a bundle is being reused and disableSharedBundles is enabled', async function () { @@ -42,7 +42,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundles": 0, "minBundleSize": 200, "maxParallelRequests": 100, @@ -109,7 +109,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "maxParallelRequests": 100, "disableSharedBundles": true } @@ -141,7 +141,7 @@ describe.v2('bundler', function () { level: 'warn', diagnostics: [ { - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: 'The value of "100" set for maxParallelRequests will not be used as shared bundles have been disabled', }, @@ -194,7 +194,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 200, "disableSharedBundles": true } @@ -229,7 +229,7 @@ describe.v2('bundler', function () { level: 'warn', diagnostics: [ { - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: 'The value of "200" set for minBundleSize will not be used as shared bundles have been disabled', }, @@ -282,7 +282,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundles": 0, "disableSharedBundles": true } @@ -314,7 +314,7 @@ describe.v2('bundler', function () { level: 'warn', diagnostics: [ { - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: 'The value of "0" set for minBundles will not be used as shared bundles have been disabled', }, @@ -367,7 +367,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundles": 0, "minBundleSize": 200, "maxParallelRequests": 100, @@ -404,7 +404,7 @@ describe.v2('bundler', function () { level: 'warn', diagnostics: [ { - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: 'The value of "0" set for minBundles will not be used as shared bundles have been disabled', }, @@ -415,7 +415,7 @@ describe.v2('bundler', function () { level: 'warn', diagnostics: [ { - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: 'The value of "200" set for minBundleSize will not be used as shared bundles have been disabled', }, @@ -426,7 +426,7 @@ describe.v2('bundler', function () { level: 'warn', diagnostics: [ { - origin: '@parcel/bundler-default', + origin: '@atlaspack/bundler-default', message: 'The value of "100" set for maxParallelRequests will not be used as shared bundles have been disabled', }, @@ -479,7 +479,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundles": 0, "minBundleSize": 200, "maxParallelRequests": 100, @@ -553,7 +553,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundles": 1, "minBundleSize": 200, "maxParallelRequests": 2 @@ -975,7 +975,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundles": 0, "minBundleSize": 200, "production": { @@ -1050,10 +1050,10 @@ describe.v2('bundler', function () { package.json: { - "@parcel/transformer-js": { + "@atlaspack/transformer-js": { "unstable_inlineConstants": true }, - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0, "minBundles": 3 } @@ -1124,10 +1124,10 @@ describe.v2('bundler', function () { package.json: { - "@parcel/transformer-js": { + "@atlaspack/transformer-js": { "unstable_inlineConstants": true }, - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0 } } @@ -1189,7 +1189,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/transformer-js": { + "@atlaspack/transformer-js": { "unstable_inlineConstants": true } } @@ -1227,7 +1227,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/transformer-js": { + "@atlaspack/transformer-js": { "unstable_inlineConstants": true } } @@ -1275,7 +1275,7 @@ describe.v2('bundler', function () { // Required for config loading package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0, "manualSharedBundles": [{ "name": "vendor", @@ -1358,7 +1358,7 @@ describe.v2('bundler', function () { // Required for config loading package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "manualSharedBundles": [{ "name": "manual-inline", "assets": ["shared.js"] @@ -1366,16 +1366,16 @@ describe.v2('bundler', function () { } } - .parcelrc: + .atlaspackrc: { - "extends": "@parcel/config-default", + "extends": "@atlaspack/config-default", "transformers": { "*.js": ["./transformer.js", "..."], } } transformer.js: - import { Transformer } from '@parcel/plugin'; + import { Transformer } from '@atlaspack/plugin'; export default new Transformer({ transform({asset}) { @@ -1438,7 +1438,7 @@ describe.v2('bundler', function () { // Required for config loading package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0, "manualSharedBundles": [{ "name": "vendor", @@ -1523,7 +1523,7 @@ describe.v2('bundler', function () { // Required for config loading package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0, "manualSharedBundles": [{ "name": "vendor", @@ -1591,10 +1591,10 @@ describe.v2('bundler', function () { // Required for config loading package.json: { - "@parcel/transformer-js" : { + "@atlaspack/transformer-js" : { "unstable_inlineConstants": true }, - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0, "manualSharedBundles": [{ "name": "vendor", @@ -1663,10 +1663,10 @@ describe.v2('bundler', function () { // Required for config loading package.json: { - "@parcel/transformer-js" : { + "@atlaspack/transformer-js" : { "unstable_inlineConstants": true }, - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0, "manualSharedBundles": [{ "name": "vendor", @@ -1734,7 +1734,7 @@ describe.v2('bundler', function () { // Required for config loading package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0, "manualSharedBundles": [{ "name": "vendor", @@ -1823,7 +1823,7 @@ describe.v2('bundler', function () { package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0, "manualSharedBundles": [{ "name": "vendor", diff --git a/packages/core/integration-tests/test/cache.js b/packages/core/integration-tests/test/cache.js index e3fd55a7e..54ff59202 100644 --- a/packages/core/integration-tests/test/cache.js +++ b/packages/core/integration-tests/test/cache.js @@ -1,5 +1,8 @@ // @flow -import type {InitialParcelOptions, BuildSuccessEvent} from '@parcel/types'; +import type { + InitialAtlaspackOptions, + BuildSuccessEvent, +} from '@atlaspack/types'; import assert from 'assert'; import invariant from 'assert'; import nullthrows from 'nullthrows'; @@ -16,26 +19,26 @@ import { inputFS, ncp, workerFarm, - mergeParcelOptions, + mergeAtlaspackOptions, sleep, getNextBuild, distDir, - getParcelOptions, + getAtlaspackOptions, assertNoFilePathInCache, findAsset, bundle, fsFixture, -} from '@parcel/test-utils'; -import {md} from '@parcel/diagnostic'; +} from '@atlaspack/test-utils'; +import {md} from '@atlaspack/diagnostic'; import fs from 'fs'; -import {NodePackageManager} from '@parcel/package-manager'; -import {createWorkerFarm} from '@parcel/core'; -import resolveOptions from '@parcel/core/src/resolveOptions'; -import logger from '@parcel/logger'; +import {NodePackageManager} from '@atlaspack/package-manager'; +import {createWorkerFarm} from '@atlaspack/core'; +import resolveOptions from '@atlaspack/core/src/resolveOptions'; +import logger from '@atlaspack/logger'; import sinon from 'sinon'; -import {version} from '@parcel/core/package.json'; -import {deserialize} from '@parcel/core/src/serializer'; -import {hashString} from '@parcel/rust'; +import {version} from '@atlaspack/core/package.json'; +import {deserialize} from '@atlaspack/core/src/serializer'; +import {hashString} from '@atlaspack/rust'; let inputDir: string; let packageManager = new NodePackageManager(inputFS, '/'); @@ -47,7 +50,7 @@ function getEntries(entries = 'src/index.js') { } function getOptions(opts) { - return mergeParcelOptions( + return mergeAtlaspackOptions( { inputFS: overlayFS, shouldDisableCache: false, @@ -61,10 +64,10 @@ function runBundle(entries = 'src/index.js', opts) { } type UpdateFn = BuildSuccessEvent => - | ?InitialParcelOptions - | Promise; + | ?InitialAtlaspackOptions + | Promise; type TestConfig = {| - ...InitialParcelOptions, + ...InitialAtlaspackOptions, entries?: Array, setup?: () => void | Promise, update: UpdateFn, @@ -78,7 +81,7 @@ async function testCache(update: UpdateFn | TestConfig, integration) { ); let entries; - let options: ?InitialParcelOptions; + let options: ?InitialAtlaspackOptions; if (typeof update === 'object') { let setup; ({entries, setup, update, ...options} = update); @@ -89,7 +92,7 @@ async function testCache(update: UpdateFn | TestConfig, integration) { } let resolvedOptions = await resolveOptions( - getParcelOptions(getEntries(entries), getOptions(options)), + getAtlaspackOptions(getEntries(entries), getOptions(options)), ); let b = await runBundle(entries, options); @@ -102,13 +105,13 @@ async function testCache(update: UpdateFn | TestConfig, integration) { // update let newOptions = await update(b); - options = mergeParcelOptions(options || {}, newOptions); + options = mergeAtlaspackOptions(options || {}, newOptions); // Run cached build b = await runBundle(entries, options); resolvedOptions = await resolveOptions( - getParcelOptions(getEntries(entries), getOptions(options)), + getAtlaspackOptions(getEntries(entries), getOptions(options)), ); await assertNoFilePathInCache( resolvedOptions.outputFS, @@ -209,7 +212,7 @@ describe.v2('cache', function () { ); }); - it('should error when starting parcel from a broken state with no changes', async function () { + it('should error when starting atlaspack from a broken state with no changes', async function () { // $FlowFixMe await assert.rejects(async () => { await testCache(async () => { @@ -1001,8 +1004,8 @@ describe.v2('cache', function () { }); }); - describe('parcel config', function () { - it('should support adding a .parcelrc', async function () { + describe('atlaspack config', function () { + it('should support adding a .atlaspackrc', async function () { let b = await testCache(async b => { assert.equal(await run(b.bundleGraph), 4); @@ -1013,11 +1016,11 @@ describe.v2('cache', function () { assert(!contents.includes('TRANSFORMED CODE')); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); @@ -1030,15 +1033,15 @@ describe.v2('cache', function () { assert(contents.includes('TRANSFORMED CODE')); }); - it('should support updating a .parcelrc', async function () { + it('should support updating a .atlaspackrc', async function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); @@ -1051,9 +1054,9 @@ describe.v2('cache', function () { assert(contents.includes('TRANSFORMED CODE')); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', }), ); }, @@ -1068,23 +1071,23 @@ describe.v2('cache', function () { assert.equal(await run(b.bundleGraph), 4); }); - it('should support updating an extended .parcelrc', async function () { + it('should support updating an extended .atlaspackrc', async function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc-extended'), + path.join(inputDir, '.atlaspackrc-extended'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: './.parcelrc-extended', + extends: './.atlaspackrc-extended', }), ); }, @@ -1096,9 +1099,9 @@ describe.v2('cache', function () { assert(contents.includes('TRANSFORMED CODE')); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc-extended'), + path.join(inputDir, '.atlaspackrc-extended'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', }), ); }, @@ -1113,26 +1116,26 @@ describe.v2('cache', function () { assert.equal(await run(b.bundleGraph), 4); }); - it('should error when deleting an extended parcelrc', async function () { + it('should error when deleting an extended.atlaspackrc', async function () { // $FlowFixMe await assert.rejects( async () => { await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc-extended'), + path.join(inputDir, '.atlaspackrc-extended'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: './.parcelrc-extended', + extends: './.atlaspackrc-extended', }), ); }, @@ -1143,23 +1146,25 @@ describe.v2('cache', function () { ); assert(contents.includes('TRANSFORMED CODE')); - await overlayFS.unlink(path.join(inputDir, '.parcelrc-extended')); + await overlayFS.unlink( + path.join(inputDir, '.atlaspackrc-extended'), + ); }, }); }, - {message: 'Cannot find extended parcel config'}, + {message: 'Cannot find extended atlaspack config'}, ); }); - it('should support deleting a .parcelrc', async function () { + it('should support deleting a .atlaspackrc', async function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); @@ -1171,7 +1176,7 @@ describe.v2('cache', function () { ); assert(contents.includes('TRANSFORMED CODE')); - await overlayFS.unlink(path.join(inputDir, '.parcelrc')); + await overlayFS.unlink(path.join(inputDir, '.atlaspackrc')); }, }); @@ -1320,7 +1325,7 @@ describe.v2('cache', function () { let b = await testCache({ featureFlags: { exampleFeature: false, - parcelV3: false, + atlaspackV3: false, }, async setup() { let pkgFile = path.join(inputDir, 'package.json'); @@ -1329,7 +1334,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/transformer-js': { + '@atlaspack/transformer-js': { inlineEnvironment: false, inlineFS: false, }, @@ -1337,12 +1342,12 @@ describe.v2('cache', function () { ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { // Remove react-refresh transformer and babel so we don't get extra config deps - '*.js': ['@parcel/transformer-js'], + '*.js': ['@atlaspack/transformer-js'], }, }), ); @@ -1380,7 +1385,7 @@ describe.v2('cache', function () { let b = await testCache({ featureFlags: { exampleFeature: false, - parcelV3: false, + atlaspackV3: false, }, async setup() { let pkgFile = path.join(inputDir, 'package.json'); @@ -1389,19 +1394,19 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/transformer-js': { + '@atlaspack/transformer-js': { inlineEnvironment: false, }, }), ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { // Remove react-refresh transformer and babel so we don't get extra config deps - '*.js': ['@parcel/transformer-js'], + '*.js': ['@atlaspack/transformer-js'], }, }), ); @@ -1424,7 +1429,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/transformer-js': { + '@atlaspack/transformer-js': { inlineEnvironment: ['TEST'], }, }), @@ -1440,7 +1445,7 @@ describe.v2('cache', function () { let b = await testCache({ featureFlags: { exampleFeature: false, - parcelV3: false, + atlaspackV3: false, }, async setup() { let pkgFile = path.join(inputDir, 'package.json'); @@ -1449,19 +1454,19 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/transformer-js': { + '@atlaspack/transformer-js': { inlineEnvironment: false, }, }), ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { // Remove react-refresh transformer and babel so we don't get extra config deps - '*.js': ['@parcel/transformer-js'], + '*.js': ['@atlaspack/transformer-js'], }, }), ); @@ -1480,7 +1485,7 @@ describe.v2('cache', function () { async update() { let pkgFile = path.join(inputDir, 'package.json'); let pkg = JSON.parse(await overlayFS.readFile(pkgFile)); - delete pkg['@parcel/transformer-js']; + delete pkg['@atlaspack/transformer-js']; await overlayFS.writeFile( pkgFile, JSON.stringify({ @@ -2473,8 +2478,8 @@ describe.v2('cache', function () { 'utf8', ); assert( - contents.includes('parcelRequire'), - 'should include parcelRequire', + contents.includes('atlaspackRequire'), + 'should include atlaspackRequire', ); return { @@ -2489,7 +2494,7 @@ describe.v2('cache', function () { b.bundleGraph.getBundles()[0].filePath, 'utf8', ); - assert(!contents.includes('parcelRequire'), 'should not include Test'); + assert(!contents.includes('atlaspackRequire'), 'should not include Test'); }); it('should update when sourceMaps changes', async function () { @@ -2688,12 +2693,12 @@ describe.v2('cache', function () { }, async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { // Remove react-refresh transformer so we test whether the runtime updates - '*.js': ['@parcel/transformer-js'], + '*.js': ['@atlaspack/transformer-js'], }, }), ); @@ -2800,9 +2805,9 @@ describe.v2('cache', function () { await overlayFS.writeFile( path.join(inputDir, 'some-config'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); @@ -2832,9 +2837,9 @@ describe.v2('cache', function () { await overlayFS.writeFile( path.join(inputDir, 'some-config'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); @@ -3300,10 +3305,10 @@ describe.v2('cache', function () { assert(!res.includes('FOO')); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - resolvers: ['parcel-resolver-test'], + extends: '@atlaspack/config-default', + resolvers: ['atlaspack-resolver-test'], }), ); }, @@ -3335,10 +3340,10 @@ describe.v2('cache', function () { `export default "BAR";`, ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - resolvers: ['parcel-resolver-test'], + extends: '@atlaspack/config-default', + resolvers: ['atlaspack-resolver-test'], }), ); }, @@ -3353,7 +3358,7 @@ describe.v2('cache', function () { let resolver = path.join( inputDir, 'node_modules', - 'parcel-resolver-test', + 'atlaspack-resolver-test', 'index.js', ); await overlayFS.writeFile( @@ -3392,10 +3397,10 @@ describe.v2('cache', function () { `export default "BAR";`, ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - resolvers: ['parcel-resolver-test'], + extends: '@atlaspack/config-default', + resolvers: ['atlaspack-resolver-test'], }), ); }, @@ -3441,10 +3446,10 @@ describe.v2('cache', function () { `export default "BAR";`, ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - resolvers: ['parcel-resolver-test'], + extends: '@atlaspack/config-default', + resolvers: ['atlaspack-resolver-test'], }), ); @@ -3495,10 +3500,10 @@ describe.v2('cache', function () { `export default "BAR";`, ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - resolvers: ['parcel-resolver-test'], + extends: '@atlaspack/config-default', + resolvers: ['atlaspack-resolver-test'], }), ); @@ -4069,15 +4074,15 @@ describe.v2('cache', function () { }); describe('dev deps', function () { - it('should invalidate when updating a parcel transformer plugin', async function () { + it('should invalidate when updating a atlaspack transformer plugin', async function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); @@ -4092,7 +4097,7 @@ describe.v2('cache', function () { let transformerDir = path.join( inputDir, 'node_modules', - 'parcel-transformer-mock', + 'atlaspack-transformer-mock', ); await overlayFS.writeFile( path.join(transformerDir, 'constants.js'), @@ -4112,18 +4117,18 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); let transformer = path.join( inputDir, 'node_modules', - 'parcel-transformer-mock', + 'atlaspack-transformer-mock', 'index.js', ); let contents = await overlayFS.readFile(transformer, 'utf8'); @@ -4165,11 +4170,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); @@ -4184,12 +4189,12 @@ describe.v2('cache', function () { let transformerDir = path.join( inputDir, 'node_modules', - 'parcel-transformer-mock', + 'atlaspack-transformer-mock', ); await overlayFS.writeFile( path.join(transformerDir, 'MockTransformer.js'), ` - const Transformer = require('@parcel/plugin').Transformer; + const Transformer = require('@atlaspack/plugin').Transformer; module.exports = new Transformer({ transform({asset}) { return [ @@ -4221,16 +4226,16 @@ describe.v2('cache', function () { let transformerDir = path.join( inputDir, 'node_modules', - 'parcel-transformer-mock', + 'atlaspack-transformer-mock', ); let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); @@ -4304,9 +4309,14 @@ describe.v2('cache', function () { ); await inputFS.writeFile( - path.join(inputDir, 'pnp', 'parcel-transformer-mock', 'index.js'), + path.join( + inputDir, + 'pnp', + 'atlaspack-transformer-mock', + 'index.js', + ), ` - const Transformer = require('@parcel/plugin').Transformer; + const Transformer = require('@atlaspack/plugin').Transformer; module.exports = new Transformer({ transform({asset}) { return [ @@ -4324,11 +4334,11 @@ describe.v2('cache', function () { path.join( inputDir, 'pnp2', - 'parcel-transformer-mock', + 'atlaspack-transformer-mock', 'index.js', ), ` - const Transformer = require('@parcel/plugin').Transformer; + const Transformer = require('@atlaspack/plugin').Transformer; module.exports = new Transformer({ transform({asset}) { return [ @@ -4347,12 +4357,12 @@ describe.v2('cache', function () { ` const path = require('path'); const resolve = request => { - if (request === 'parcel-transformer-mock/' || request === 'foo/') { + if (request === 'atlaspack-transformer-mock/' || request === 'foo/') { return path.join(__dirname, 'pnp', request); } else if (request === 'pnpapi') { return __filename; - } else if (request.startsWith('@parcel/')) { - // Use node_modules path for parcel packages so source field is used. + } else if (request.startsWith('@atlaspack/')) { + // Use node_modules path for atlaspack packages so source field is used. return path.join(__dirname, '../../../../../../node_modules/', request); } else if (/^((@[^/]+\\/[^/]+)|[^/]+)\\/?$/.test(request)) { return path.dirname(require.resolve(path.join(request, 'package.json'))); @@ -4371,11 +4381,11 @@ describe.v2('cache', function () { require(path.join(inputDir, '.pnp.js')); await inputFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-mock'], + '*.js': ['atlaspack-transformer-mock'], }, }), ); @@ -4392,12 +4402,12 @@ describe.v2('cache', function () { ` const path = require('path'); const resolve = request => { - if (request === 'parcel-transformer-mock/' || request === 'foo/') { + if (request === 'atlaspack-transformer-mock/' || request === 'foo/') { return path.join(__dirname, 'pnp2', request); } else if (request === 'pnpapi') { return __filename; - } else if (request.startsWith('@parcel/')) { - // Use node_modules path for parcel packages so source field is used. + } else if (request.startsWith('@atlaspack/')) { + // Use node_modules path for atlaspack packages so source field is used. return path.join(__dirname, '../../../../../../node_modules/', request); } else if (/^((@[^/]+\\/[^/]+)|[^/]+)\\/?$/.test(request)) { return path.dirname(require.resolve(path.join(request, 'package.json'))); @@ -4433,17 +4443,17 @@ describe.v2('cache', function () { await inputFS.mkdirp(inputDir); await inputFS.ncp(path.join(__dirname, '/integration/cache'), inputDir); await inputFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', transformers: { - '*.js': ['parcel-transformer-esm'], + '*.js': ['atlaspack-transformer-esm'], }, }), ); } - it('should invalidate when updating an ESM parcel transformer plugin', async function () { + it('should invalidate when updating an ESM atlaspack transformer plugin', async function () { // We cannot invalidate an ESM module in node, so for the test, create a separate worker farm. let workerFarm = createWorkerFarm({ maxConcurrentWorkers: 1, @@ -4468,7 +4478,7 @@ describe.v2('cache', function () { let transformerDir = path.join( inputDir, 'node_modules', - 'parcel-transformer-esm', + 'atlaspack-transformer-esm', ); await inputFS.writeFile( path.join(transformerDir, 'constants.js'), @@ -4558,7 +4568,7 @@ describe.v2('cache', function () { let dir = path.join( inputDir, 'node_modules', - 'parcel-transformer-esm', + 'atlaspack-transformer-esm', ); await inputFS.writeFile( path.join(dir, 'data/a.js'), @@ -4599,7 +4609,7 @@ describe.v2('cache', function () { path.join( inputDir, 'node_modules', - 'parcel-transformer-esm', + 'atlaspack-transformer-esm', 'dep.cjs', ), 'var dep = "foo";exports.value = require(dep);', @@ -4615,9 +4625,9 @@ describe.v2('cache', function () { spy.calledWith([ { message: md`${path.normalize( - 'node_modules/parcel-transformer-esm/index.js', - )} contains non-statically analyzable dependencies in its module graph. This causes Parcel to invalidate the cache on startup.`, - origin: '@parcel/package-manager', + 'node_modules/atlaspack-transformer-esm/index.js', + )} contains non-statically analyzable dependencies in its module graph. This causes Atlaspack to invalidate the cache on startup.`, + origin: '@atlaspack/package-manager', }, ]), ); @@ -5013,10 +5023,10 @@ describe.v2('cache', function () { assert.equal(b.bundleGraph.getBundles().length, 1); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - bundler: 'parcel-bundler-test', + extends: '@atlaspack/config-default', + bundler: 'atlaspack-bundler-test', }), ); }, @@ -5029,10 +5039,10 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - bundler: 'parcel-bundler-test', + extends: '@atlaspack/config-default', + bundler: 'atlaspack-bundler-test', }), ); }, @@ -5043,7 +5053,7 @@ describe.v2('cache', function () { let bundler = path.join( inputDir, 'node_modules', - 'parcel-bundler-test', + 'atlaspack-bundler-test', 'index.js', ); await overlayFS.writeFile( @@ -5066,10 +5076,10 @@ describe.v2('cache', function () { assert.deepEqual(bundles, ['index.js']); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - namers: ['parcel-namer-test'], + extends: '@atlaspack/config-default', + namers: ['atlaspack-namer-test'], }), ); }, @@ -5086,10 +5096,10 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - namers: ['parcel-namer-test'], + extends: '@atlaspack/config-default', + namers: ['atlaspack-namer-test'], }), ); }, @@ -5103,7 +5113,7 @@ describe.v2('cache', function () { let namer = path.join( inputDir, 'node_modules', - 'parcel-namer-test', + 'atlaspack-namer-test', 'index.js', ); await overlayFS.writeFile( @@ -5129,10 +5139,10 @@ describe.v2('cache', function () { assert.equal(res.runtime_test, undefined); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - runtimes: ['parcel-runtime-test'], + extends: '@atlaspack/config-default', + runtimes: ['atlaspack-runtime-test'], }), ); }, @@ -5146,10 +5156,10 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - runtimes: ['parcel-runtime-test'], + extends: '@atlaspack/config-default', + runtimes: ['atlaspack-runtime-test'], }), ); }, @@ -5161,7 +5171,7 @@ describe.v2('cache', function () { let namer = path.join( inputDir, 'node_modules', - 'parcel-runtime-test', + 'atlaspack-runtime-test', 'index.js', ); await overlayFS.writeFile( @@ -5191,7 +5201,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/bundler-default': undefined, + '@atlaspack/bundler-default': undefined, }), ); }, @@ -5224,7 +5234,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/bundler-default': { + '@atlaspack/bundler-default': { minBundleSize: 9000000, }, }), @@ -5267,7 +5277,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/bundler-default': undefined, + '@atlaspack/bundler-default': undefined, }), ); }, @@ -5279,7 +5289,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/bundler-default': { + '@atlaspack/bundler-default': { maxParallelRequests: 0, }, }), @@ -5303,7 +5313,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/bundler-default': { + '@atlaspack/bundler-default': { minBundleSize: 8000, }, }), @@ -5338,7 +5348,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/bundler-default': { + '@atlaspack/bundler-default': { minBundleSize: 9000000, }, }), @@ -5381,7 +5391,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/bundler-default': { + '@atlaspack/bundler-default': { minBundleSize: 9000000, }, }), @@ -5413,7 +5423,7 @@ describe.v2('cache', function () { pkgFile, JSON.stringify({ ...pkg, - '@parcel/bundler-default': undefined, + '@atlaspack/bundler-default': undefined, }), ); }, @@ -5457,11 +5467,11 @@ describe.v2('cache', function () { assert.notEqual(res, 'packaged'); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.js': 'parcel-packager-test', + '*.js': 'atlaspack-packager-test', }, }), ); @@ -5479,11 +5489,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.js': 'parcel-packager-test', + '*.js': 'atlaspack-packager-test', }, }), ); @@ -5498,7 +5508,7 @@ describe.v2('cache', function () { let packager = path.join( inputDir, 'node_modules', - 'parcel-packager-test', + 'atlaspack-packager-test', 'index.js', ); await overlayFS.writeFile( @@ -5521,11 +5531,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.js': 'parcel-packager-test', + '*.js': 'atlaspack-packager-test', }, }), ); @@ -5555,11 +5565,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.js': 'parcel-packager-test', + '*.js': 'atlaspack-packager-test', }, }), ); @@ -5594,11 +5604,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.js': 'parcel-packager-test', + '*.js': 'atlaspack-packager-test', }, }), ); @@ -5636,11 +5646,11 @@ describe.v2('cache', function () { assert.notEqual(res, 'optimized'); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.js': ['parcel-optimizer-test'], + '*.js': ['atlaspack-optimizer-test'], }, }), ); @@ -5658,11 +5668,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.js': ['parcel-optimizer-test'], + '*.js': ['atlaspack-optimizer-test'], }, }), ); @@ -5675,9 +5685,9 @@ describe.v2('cache', function () { assert.equal(res, 'optimized'); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { '*.js': [], }, @@ -5697,11 +5707,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.js': ['parcel-optimizer-test'], + '*.js': ['atlaspack-optimizer-test'], }, }), ); @@ -5716,7 +5726,7 @@ describe.v2('cache', function () { let optimizer = path.join( inputDir, 'node_modules', - 'parcel-optimizer-test', + 'atlaspack-optimizer-test', 'index.js', ); await overlayFS.writeFile( @@ -5739,11 +5749,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.js': ['parcel-optimizer-test'], + '*.js': ['atlaspack-optimizer-test'], }, }), ); @@ -5773,11 +5783,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.js': ['parcel-optimizer-test'], + '*.js': ['atlaspack-optimizer-test'], }, }), ); @@ -5812,11 +5822,11 @@ describe.v2('cache', function () { let b = await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.js': ['parcel-optimizer-test'], + '*.js': ['atlaspack-optimizer-test'], }, }), ); @@ -5902,11 +5912,11 @@ describe.v2('cache', function () { assert.notEqual(res, 'packaged'); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.txt': 'parcel-packager-test', + '*.txt': 'atlaspack-packager-test', }, }), ); @@ -5931,11 +5941,11 @@ describe.v2('cache', function () { ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.txt': 'parcel-packager-test', + '*.txt': 'atlaspack-packager-test', }, }), ); @@ -5947,7 +5957,7 @@ describe.v2('cache', function () { let packager = path.join( inputDir, 'node_modules', - 'parcel-packager-test', + 'atlaspack-packager-test', 'index.js', ); await overlayFS.writeFile( @@ -5977,11 +5987,11 @@ describe.v2('cache', function () { ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.txt': 'parcel-packager-test', + '*.txt': 'atlaspack-packager-test', }, }), ); @@ -6015,11 +6025,11 @@ describe.v2('cache', function () { ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.txt': 'parcel-packager-test', + '*.txt': 'atlaspack-packager-test', }, }), ); @@ -6058,11 +6068,11 @@ describe.v2('cache', function () { ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', packagers: { - '*.txt': 'parcel-packager-test', + '*.txt': 'atlaspack-packager-test', }, }), ); @@ -6102,11 +6112,11 @@ describe.v2('cache', function () { assert.notEqual(res, 'packaged'); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.txt': ['parcel-optimizer-test'], + '*.txt': ['atlaspack-optimizer-test'], }, }), ); @@ -6131,11 +6141,11 @@ describe.v2('cache', function () { ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.txt': ['parcel-optimizer-test'], + '*.txt': ['atlaspack-optimizer-test'], }, }), ); @@ -6147,7 +6157,7 @@ describe.v2('cache', function () { let optimizer = path.join( inputDir, 'node_modules', - 'parcel-optimizer-test', + 'atlaspack-optimizer-test', 'index.js', ); await overlayFS.writeFile( @@ -6177,11 +6187,11 @@ describe.v2('cache', function () { ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.txt': ['parcel-optimizer-test'], + '*.txt': ['atlaspack-optimizer-test'], }, }), ); @@ -6215,11 +6225,11 @@ describe.v2('cache', function () { ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.txt': ['parcel-optimizer-test'], + '*.txt': ['atlaspack-optimizer-test'], }, }), ); @@ -6258,11 +6268,11 @@ describe.v2('cache', function () { ); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', optimizers: { - '*.txt': ['parcel-optimizer-test'], + '*.txt': ['atlaspack-optimizer-test'], }, }), ); @@ -6355,7 +6365,7 @@ describe.v2('cache', function () { packageManager: overlayFSPackageManager, shouldDisableCache: false, inputFS: overlayFS, - cacheDir: path.join(__dirname, '.parcel-cache'), + cacheDir: path.join(__dirname, '.atlaspack-cache'), }; await fsFixture(overlayFS)` @@ -6367,16 +6377,16 @@ describe.v2('cache', function () { import('./foo'); export default 1; - .parcelrc: + .atlaspackrc: { - "extends": "@parcel/config-default", + "extends": "@atlaspack/config-default", "bundler": "./test-bundler.js" } test-bundler.js: - import {Bundler} from '@parcel/plugin' - import DefaultBundler from '@parcel/bundler-default' + import {Bundler} from '@atlaspack/plugin' + import DefaultBundler from '@atlaspack/bundler-default' - const CONFIG = Symbol.for('parcel-plugin-config'); + const CONFIG = Symbol.for('atlaspack-plugin-config'); export default new Bundler({ loadConfig({config, options}) { @@ -6393,7 +6403,7 @@ describe.v2('cache', function () { await assert.rejects(() => bundle(entries, options)); let resolvedOptions = await resolveOptions( - getParcelOptions(entries, options), + getAtlaspackOptions(entries, options), ); let bundleGraphCacheKey = @@ -6428,7 +6438,7 @@ describe.v2('cache', function () { b.bundleGraph.getBundles()[0].filePath, 'utf8', ); - assert(contents.includes('$parcel$interopDefault')); + assert(contents.includes('$atlaspack$interopDefault')); await overlayFS.writeFile( path.join(inputDir, '.terserrc'), @@ -6443,7 +6453,7 @@ describe.v2('cache', function () { b.bundleGraph.getBundles()[0].filePath, 'utf8', ); - assert(!contents.includes('$parcel$interopDefault')); + assert(!contents.includes('$atlaspack$interopDefault')); }); it('should invalidate when an htmlnano config is modified', async function () { @@ -6490,11 +6500,11 @@ describe.v2('cache', function () { assert.deepEqual(files.sort(), ['index.js', 'index.js.map']); await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', compressors: { - '*.js': ['...', '@parcel/compressor-gzip'], + '*.js': ['...', '@atlaspack/compressor-gzip'], }, }), ); @@ -6514,11 +6524,11 @@ describe.v2('cache', function () { await testCache({ async setup() { await overlayFS.writeFile( - path.join(inputDir, '.parcelrc'), + path.join(inputDir, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', + extends: '@atlaspack/config-default', compressors: { - '*.js': ['...', 'parcel-compressor-test'], + '*.js': ['...', 'atlaspack-compressor-test'], }, }), ); @@ -6534,7 +6544,7 @@ describe.v2('cache', function () { let compressor = path.join( inputDir, 'node_modules', - 'parcel-compressor-test', + 'atlaspack-compressor-test', 'index.js', ); await overlayFS.writeFile( @@ -6985,7 +6995,7 @@ describe.v2('cache', function () { shouldContentHash: false, shouldDisableCache: false, inputFS: overlayFS, - cacheDir: path.join(__dirname, '.parcel-cache'), + cacheDir: path.join(__dirname, '.atlaspack-cache'), }; await fsFixture(overlayFS)` diff --git a/packages/core/integration-tests/test/compressors.js b/packages/core/integration-tests/test/compressors.js index 45308abb0..5198cad4d 100644 --- a/packages/core/integration-tests/test/compressors.js +++ b/packages/core/integration-tests/test/compressors.js @@ -1,7 +1,7 @@ import assert from 'assert'; import path from 'path'; import zlib from 'zlib'; -import {bundle, describe, it, outputFS, distDir} from '@parcel/test-utils'; +import {bundle, describe, it, outputFS, distDir} from '@atlaspack/test-utils'; describe.v2('compressors', function () { it('should not compress output with gzip and brotli in development', async function () { diff --git a/packages/core/integration-tests/test/config-merging.js b/packages/core/integration-tests/test/config-merging.js index cf3ee0f72..628df1fe7 100644 --- a/packages/core/integration-tests/test/config-merging.js +++ b/packages/core/integration-tests/test/config-merging.js @@ -1,4 +1,4 @@ -import {bundle, describe, it, run, outputFS} from '@parcel/test-utils'; +import {bundle, describe, it, run, outputFS} from '@atlaspack/test-utils'; import assert from 'assert'; import path from 'path'; diff --git a/packages/core/integration-tests/test/contentHashing.js b/packages/core/integration-tests/test/contentHashing.js index 0817d2831..d97dcafa0 100644 --- a/packages/core/integration-tests/test/contentHashing.js +++ b/packages/core/integration-tests/test/contentHashing.js @@ -7,7 +7,7 @@ import { overlayFS, outputFS, ncp, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; const distDir = path.join(__dirname, './dist'); diff --git a/packages/core/integration-tests/test/css-modules.js b/packages/core/integration-tests/test/css-modules.js index ce1152de2..79af5b9cb 100644 --- a/packages/core/integration-tests/test/css-modules.js +++ b/packages/core/integration-tests/test/css-modules.js @@ -11,7 +11,7 @@ import { outputFS, overlayFS, fsFixture, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; import postcss from 'postcss'; describe.v2('css modules', () => { @@ -429,7 +429,7 @@ describe.v2('css modules', () => { ], message: "integration/no-export-error-with-correct-filetype/src/app.module.css does not export 'notExisting'", - origin: '@parcel/core', + origin: '@atlaspack/core', }, ], }, @@ -796,7 +796,7 @@ describe.v2('css modules', () => { package.json: { - "@parcel/transformer-css": { + "@atlaspack/transformer-css": { "cssModules": { "include": "modules/*.css", "exclude": "modules/_*.css" diff --git a/packages/core/integration-tests/test/css.js b/packages/core/integration-tests/test/css.js index 8e40b74d4..75138c9cb 100644 --- a/packages/core/integration-tests/test/css.js +++ b/packages/core/integration-tests/test/css.js @@ -11,7 +11,7 @@ import { removeDistDirectory, inputFS, outputFS, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; describe.v2('css', () => { afterEach(async () => { @@ -346,7 +346,7 @@ describe.v2('css', () => { { message: "Ambiguous url('foo.png') in custom property. Relative paths are resolved from the location the var() is used, not where the custom property is defined. Use an absolute URL instead", - origin: '@parcel/transformer-css', + origin: '@atlaspack/transformer-css', name: 'SyntaxError', stack: undefined, codeFrames: [ @@ -465,7 +465,7 @@ describe.v2('css', () => { diagnostics: [ { message: "Failed to resolve 'x.png' from './index.scss'", - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath: fixture, @@ -488,7 +488,7 @@ describe.v2('css', () => { }, { message: "Cannot load file './x.png' in './'.", - origin: '@parcel/resolver-default', + origin: '@atlaspack/resolver-default', hints: [], }, ], diff --git a/packages/core/integration-tests/test/elm.js b/packages/core/integration-tests/test/elm.js index 21da66000..25aad296d 100644 --- a/packages/core/integration-tests/test/elm.js +++ b/packages/core/integration-tests/test/elm.js @@ -8,7 +8,7 @@ import { it, run, outputFS, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; describe.v2('elm', function () { it('should produce a basic Elm bundle', async function () { @@ -58,9 +58,9 @@ describe.v2('elm', function () { assert(!js.includes('elm$browser$Debugger')); }); - it('should remove debugger when environment variable `PARCEL_ELM_NO_DEBUG` is set to true', async function () { + it('should remove debugger when environment variable `ATLASPACK_ELM_NO_DEBUG` is set to true', async function () { let b = await bundle(path.join(__dirname, '/integration/elm/index.js'), { - env: {PARCEL_ELM_NO_DEBUG: true}, + env: {ATLASPACK_ELM_NO_DEBUG: true}, }); await run(b); @@ -115,7 +115,7 @@ describe.v2('elm', function () { ' **String**\n' + '\n' + '__Hint__: Try using **String.fromInt** to convert it to a string?', - origin: '@parcel/elm-transformer', + origin: '@atlaspack/elm-transformer', stack: '', }, { @@ -128,7 +128,7 @@ describe.v2('elm', function () { '7| Html.text 5 "Hello, world!"\n' + ' **^^^^^^^^^**\n' + 'Are there any missing commas? Or missing parentheses?', - origin: '@parcel/elm-transformer', + origin: '@atlaspack/elm-transformer', stack: '', }, ], diff --git a/packages/core/integration-tests/test/encodedURI.js b/packages/core/integration-tests/test/encodedURI.js index 06a623968..9eb849f2d 100644 --- a/packages/core/integration-tests/test/encodedURI.js +++ b/packages/core/integration-tests/test/encodedURI.js @@ -1,6 +1,6 @@ import assert from 'assert'; import path from 'path'; -import {bundle, describe, it, outputFS, distDir} from '@parcel/test-utils'; +import {bundle, describe, it, outputFS, distDir} from '@atlaspack/test-utils'; describe.v2('encodedURI', function () { it('should support bundling files which names in encoded URI', async function () { diff --git a/packages/core/integration-tests/test/eslint-validation.js b/packages/core/integration-tests/test/eslint-validation.js index 8f0895b0d..71dc3e135 100644 --- a/packages/core/integration-tests/test/eslint-validation.js +++ b/packages/core/integration-tests/test/eslint-validation.js @@ -1,11 +1,11 @@ // @flow import assert from 'assert'; import path from 'path'; -import {bundle, describe, it} from '@parcel/test-utils'; +import {bundle, describe, it} from '@atlaspack/test-utils'; const config = path.join( __dirname, - './integration/custom-configs/.parcelrc-eslint', + './integration/custom-configs/.atlaspackrc-eslint', ); describe.v2('eslint-validator', function () { @@ -20,7 +20,7 @@ describe.v2('eslint-validator', function () { assert.equal(e.name, 'BuildError'); assert(Array.isArray(e.diagnostics)); assert(e.diagnostics[0].codeFrames); - assert.equal(e.diagnostics[0].origin, '@parcel/validator-eslint'); + assert.equal(e.diagnostics[0].origin, '@atlaspack/validator-eslint'); assert.equal( e.diagnostics[0].message, 'ESLint found **1** __errors__ and **1** __warnings__.', @@ -60,7 +60,7 @@ describe.v2('eslint-validator', function () { } catch (e) { assert.equal(e.name, 'BuildError'); assert(Array.isArray(e.diagnostics)); - assert.equal(e.diagnostics[0].origin, '@parcel/validator-eslint'); + assert.equal(e.diagnostics[0].origin, '@atlaspack/validator-eslint'); assert.equal( e.diagnostics[0].message, 'ESLint found **1** __errors__ and **0** __warnings__.', diff --git a/packages/core/integration-tests/test/feature-flags.js b/packages/core/integration-tests/test/feature-flags.js index 9219aa67b..bea59393c 100644 --- a/packages/core/integration-tests/test/feature-flags.js +++ b/packages/core/integration-tests/test/feature-flags.js @@ -8,7 +8,7 @@ import { run, overlayFS, fsFixture, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; describe.v2('feature flags', () => { let dir = path.join(__dirname, 'feature-flags-fixture'); @@ -17,7 +17,7 @@ describe.v2('feature flags', () => { await overlayFS.mkdirp(dir); await fsFixture(overlayFS, dir)` yarn.lock: - // required for .parcelrc to work + // required for .atlaspackrc to work package.json: { @@ -28,24 +28,24 @@ describe.v2('feature flags', () => { index.js: module.exports = "MARKER"; - .parcelrc: + .atlaspackrc: { - extends: "@parcel/config-default", + extends: "@atlaspack/config-default", transformers: { '*.js': ['./transformer.js', '...'] }, } - .parcelrc-2: + .atlaspackrc-2: { - extends: "@parcel/config-default", + extends: "@atlaspack/config-default", transformers: { '*.js': ['./transformer-client.js', '...'] }, } transformer.js: - const {Transformer} = require('@parcel/plugin'); + const {Transformer} = require('@atlaspack/plugin'); module.exports = new Transformer({ async transform({asset, options}) { const code = await asset.getCode(); @@ -57,8 +57,8 @@ describe.v2('feature flags', () => { }); transformer-client.js: - const {Transformer} = require('@parcel/plugin'); - const {getFeatureFlag} = require('@parcel/feature-flags'); + const {Transformer} = require('@atlaspack/plugin'); + const {getFeatureFlag} = require('@atlaspack/feature-flags'); module.exports = new Transformer({ async transform({asset, options}) { const code = await asset.getCode(); @@ -133,7 +133,7 @@ describe.v2('feature flags', () => { const b = await bundle(path.join(dir, 'index.js'), { inputFS: overlayFS, featureFlags: {exampleFeature: true}, - config: path.join(dir, '.parcelrc-2'), + config: path.join(dir, '.atlaspackrc-2'), }); const output = await run(b); diff --git a/packages/core/integration-tests/test/fs.js b/packages/core/integration-tests/test/fs.js index 17b2f211f..dc74291e5 100644 --- a/packages/core/integration-tests/test/fs.js +++ b/packages/core/integration-tests/test/fs.js @@ -13,7 +13,7 @@ import { overlayFS, outputFS, distDir, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; describe.v2('fs', function () { beforeEach(async () => { diff --git a/packages/core/integration-tests/test/glob.js b/packages/core/integration-tests/test/glob.js index e5bd5dc8c..23ec28f9e 100644 --- a/packages/core/integration-tests/test/glob.js +++ b/packages/core/integration-tests/test/glob.js @@ -9,7 +9,7 @@ import { assertBundles, outputFS, inputFS, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; import nullthrows from 'nullthrows'; describe.v2('glob', function () { @@ -143,11 +143,11 @@ describe.v2('glob', function () { diagnostics: [ { message: "Failed to resolve 'foo/\\*.js' from './index.html'", - origin: '@parcel/core', + origin: '@atlaspack/core', }, { message: 'Glob imports are not supported in html files.', - origin: '@parcel/resolver-glob', + origin: '@atlaspack/resolver-glob', codeFrames: undefined, }, ], @@ -162,7 +162,7 @@ describe.v2('glob', function () { diagnostics: [ { message: "Failed to resolve 'images/\\*.jpg' from './index.css'", - origin: '@parcel/core', + origin: '@atlaspack/core', codeFrames: [ { filePath, @@ -185,7 +185,7 @@ describe.v2('glob', function () { }, { message: 'Glob imports are not supported in URL dependencies.', - origin: '@parcel/resolver-glob', + origin: '@atlaspack/resolver-glob', codeFrames: [ { codeHighlights: [ diff --git a/packages/core/integration-tests/test/globals.js b/packages/core/integration-tests/test/globals.js index 5cc71fc71..fda9c234d 100644 --- a/packages/core/integration-tests/test/globals.js +++ b/packages/core/integration-tests/test/globals.js @@ -8,7 +8,7 @@ import { it, overlayFS, run, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; import sinon from 'sinon'; describe.v2('globals', function () { @@ -75,7 +75,7 @@ describe.v2('globals', function () { assert(bundles.some(b => b.includes('var global = arguments[3]'))); assert( - bundles.every(b => !b.includes('var $parcel$global = globalThis')), + bundles.every(b => !b.includes('var $atlaspack$global = globalThis')), ); assert.equal(onGlobal.callCount, 1); assert.deepEqual(onGlobal.firstCall.args, ['global']); @@ -99,7 +99,9 @@ describe.v2('globals', function () { let onGlobal = sinon.spy(); await run(bundleGraph, {globalThis: 'global', onGlobal}); - assert(bundles.some(b => b.includes('var $parcel$global = globalThis'))); + assert( + bundles.some(b => b.includes('var $atlaspack$global = globalThis')), + ); assert(bundles.every(b => !b.includes('var global = arguments[3]'))); assert.equal(onGlobal.callCount, 1); assert.deepEqual(onGlobal.firstCall.args, ['global']); diff --git a/packages/core/integration-tests/test/glsl.js b/packages/core/integration-tests/test/glsl.js index 290e0b234..e86eb9d4f 100644 --- a/packages/core/integration-tests/test/glsl.js +++ b/packages/core/integration-tests/test/glsl.js @@ -1,7 +1,13 @@ import assert from 'assert'; import path from 'path'; import fs from 'fs'; -import {bundle, describe, it, run, normaliseNewlines} from '@parcel/test-utils'; +import { + bundle, + describe, + it, + run, + normaliseNewlines, +} from '@atlaspack/test-utils'; describe.v2('glsl', function () { it('should support requiring GLSL files via glslify', async function () { diff --git a/packages/core/integration-tests/test/graphql.js b/packages/core/integration-tests/test/graphql.js index cced8fca7..803d6048a 100644 --- a/packages/core/integration-tests/test/graphql.js +++ b/packages/core/integration-tests/test/graphql.js @@ -1,6 +1,6 @@ import assert from 'assert'; import path from 'path'; -import {bundle, describe, it, run} from '@parcel/test-utils'; +import {bundle, describe, it, run} from '@atlaspack/test-utils'; import {parse, print} from 'graphql/language'; describe.v2('graphql', function () { diff --git a/packages/core/integration-tests/test/hmr.js b/packages/core/integration-tests/test/hmr.js index 42d320470..f688cc23b 100644 --- a/packages/core/integration-tests/test/hmr.js +++ b/packages/core/integration-tests/test/hmr.js @@ -13,7 +13,7 @@ import { sleep, run, request, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; import WebSocket from 'ws'; import json5 from 'json5'; import getPort from 'get-port'; @@ -23,7 +23,7 @@ import nullthrows from 'nullthrows'; const config = path.join( __dirname, - './integration/custom-configs/.parcelrc-dev-server', + './integration/custom-configs/.atlaspackrc-dev-server', ); async function closeSocket(ws: WebSocket) { @@ -352,11 +352,11 @@ describe.v2('hmr', function () { let bundleGraph = nullthrows(event.bundleGraph); let asset = nullthrows(bundleGraph.getBundles()[0].getMainEntry()); - let contents = await request('/__parcel_hmr/' + asset.id, port); + let contents = await request('/__atlaspack_hmr/' + asset.id, port); let publicId = nullthrows(bundleGraph).getAssetPublicId(asset); assert( contents.startsWith( - `parcelHotUpdate['${publicId}'] = function (require, module, exports) {`, + `atlaspackHotUpdate['${publicId}'] = function (require, module, exports) {`, ), ); assert(contents.includes('//# sourceMappingURL')); @@ -599,7 +599,7 @@ module.hot.dispose((data) => { }); let stack = outputs.pop(); - assert(stack.includes('/__parcel_hmr/' + nullthrows(asset).id)); + assert(stack.includes('/__atlaspack_hmr/' + nullthrows(asset).id)); }); /* @@ -785,7 +785,7 @@ module.hot.dispose((data) => { await sleep(50); assert.equal(logs.length, 1); - assert(logs[0].trim().startsWith('[parcel] 🚨')); + assert(logs[0].trim().startsWith('[atlaspack] 🚨')); assert(spy.calledOnce); }); @@ -853,8 +853,8 @@ module.hot.dispose((data) => { assert(removeSpy.called); // assert.equal(logs.length, 2); - assert(logs[0].trim().startsWith('[parcel] 🚨')); - assert(logs[1].trim().startsWith('[parcel] ✨')); + assert(logs[0].trim().startsWith('[atlaspack] 🚨')); + assert(logs[1].trim().startsWith('[atlaspack] ✨')); });*/ it('should update CSS link tags when a CSS asset is changed', async () => { diff --git a/packages/core/integration-tests/test/html.js b/packages/core/integration-tests/test/html.js index 77e82850b..ba5c88ff6 100644 --- a/packages/core/integration-tests/test/html.js +++ b/packages/core/integration-tests/test/html.js @@ -13,7 +13,7 @@ import { outputFS, overlayFS, ncp, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; import path from 'path'; describe.v2('html', function () { @@ -1433,7 +1433,7 @@ describe.v2('html', function () { assert.deepEqual(err.diagnostics, [ { message: 'Browser scripts cannot have imports or exports.', - origin: '@parcel/transformer-js', + origin: '@atlaspack/transformer-js', codeFrames: [ { filePath: path.join( @@ -1725,7 +1725,7 @@ describe.v2('html', function () { assert.deepEqual(err.diagnostics, [ { message: 'Browser scripts cannot have imports or exports.', - origin: '@parcel/transformer-js', + origin: '@atlaspack/transformer-js', codeFrames: [ { filePath: path.join(__dirname, '/integration/html-js/index.js'), @@ -2770,8 +2770,8 @@ describe.v2('html', function () { name: 'BuildError', diagnostics: [ { - message: 'Invalid config for @parcel/bundler-default', - origin: '@parcel/bundler-default', + message: 'Invalid config for @atlaspack/bundler-default', + origin: '@atlaspack/bundler-default', codeFrames: [ { filePath: pkg, @@ -2781,11 +2781,11 @@ describe.v2('html', function () { { message: 'Did you mean "minBundleSize", "minBundles"?', start: { - column: 30, + column: 33, line: 3, }, end: { - column: 45, + column: 48, line: 3, }, }, @@ -2948,7 +2948,7 @@ describe.v2('html', function () { diagnostics: [ { message: "'src' should not be empty string", - origin: '@parcel/transformer-html', + origin: '@atlaspack/transformer-html', codeFrames: [ { filePath: path.join( @@ -2974,7 +2974,7 @@ describe.v2('html', function () { { message: "'src' should not be empty string", - origin: '@parcel/transformer-html', + origin: '@atlaspack/transformer-html', codeFrames: [ { filePath: path.join( @@ -3000,7 +3000,7 @@ describe.v2('html', function () { { message: "'href' should not be empty string", - origin: '@parcel/transformer-html', + origin: '@atlaspack/transformer-html', codeFrames: [ { filePath: path.join( diff --git a/packages/core/integration-tests/test/image.js b/packages/core/integration-tests/test/image.js index e54db7e67..da84b7162 100644 --- a/packages/core/integration-tests/test/image.js +++ b/packages/core/integration-tests/test/image.js @@ -6,7 +6,7 @@ import { inputFS, it, outputFS, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; import exifReader from 'exif-reader'; import path from 'path'; import sharp from 'sharp'; diff --git a/packages/core/integration-tests/test/incremental-bundling.js b/packages/core/integration-tests/test/incremental-bundling.js index 1a328cf63..4b0b1dcba 100644 --- a/packages/core/integration-tests/test/incremental-bundling.js +++ b/packages/core/integration-tests/test/incremental-bundling.js @@ -8,15 +8,15 @@ import { overlayFS, run, fsFixture, -} from '@parcel/test-utils'; +} from '@atlaspack/test-utils'; import assert from 'assert'; import path from 'path'; import sinon from 'sinon'; -import {NodePackageManager} from '@parcel/package-manager'; +import {NodePackageManager} from '@atlaspack/package-manager'; -import {type Asset} from '@parcel/types'; +import {type Asset} from '@atlaspack/types'; -const CONFIG = Symbol.for('parcel-plugin-config'); +const CONFIG = Symbol.for('atlaspack-plugin-config'); let packageManager = new NodePackageManager(inputFS, '/'); describe.v2('incremental bundling', function () { @@ -42,10 +42,10 @@ describe.v2('incremental bundling', function () { }; beforeEach(async () => { let Bundler = ( - await packageManager.require('@parcel/bundler-default', __filename) + await packageManager.require('@atlaspack/bundler-default', __filename) ).default; let CustomBundler = await packageManager.require( - './integration/incremental-bundling/node_modules/parcel-bundler-test', + './integration/incremental-bundling/node_modules/atlaspack-bundler-test', __filename, ); @@ -272,7 +272,7 @@ console.log(a);`, } }); - // this case is similar to applying a patch or restarting parcel with changes + // this case is similar to applying a patch or restarting atlaspack with changes it('adds multiple non-dependency related changes', async () => { let subscription; let fixture = path.join(__dirname, '/integration/incremental-bundling'); @@ -614,7 +614,7 @@ console.log(a, b); 'utf8', ); assert( - dynamicContent.includes(`parcelHelpers.export(exports, "b", ()=>b); + dynamicContent.includes(`atlaspackHelpers.export(exports, "b", ()=>b); const b = 'b';`), ); } finally { @@ -666,7 +666,7 @@ console.log('index.js');`, }); describe('other changes that would for a re-bundle', () => { - it('changing the bundler in parcel configs', async () => { + it('changing the bundler in atlaspack configs', async () => { let subscription; let fixture = path.join(__dirname, '/integration/incremental-bundling'); try { @@ -684,10 +684,10 @@ console.log('index.js');`, assertTimesBundled(customBundlerSpy.callCount, 0); await overlayFS.writeFile( - path.join(fixture, '.parcelrc'), + path.join(fixture, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - bundler: 'parcel-bundler-test', + extends: '@atlaspack/config-default', + bundler: 'atlaspack-bundler-test', }), ); @@ -722,7 +722,7 @@ console.log('index.js');`, package.json: { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "http": 2 } } @@ -747,7 +747,7 @@ console.log('index.js');`, pkgFile, JSON.stringify({ ...pkg, - '@parcel/bundler-default': { + '@atlaspack/bundler-default': { http: 1, }, }), @@ -784,10 +784,10 @@ console.log('index.js');`, assertTimesBundled(defaultBundlerSpy.callCount, 1); await overlayFS.writeFile( - path.join(fixture, '.parcelrc'), + path.join(fixture, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - namers: ['parcel-namer-test'], + extends: '@atlaspack/config-default', + namers: ['atlaspack-namer-test'], }), ); @@ -828,10 +828,10 @@ console.log('index.js');`, assertTimesBundled(defaultBundlerSpy.callCount, 1); await overlayFS.writeFile( - path.join(fixture, '.parcelrc'), + path.join(fixture, '.atlaspackrc'), JSON.stringify({ - extends: '@parcel/config-default', - runtimes: ['parcel-runtime-test'], + extends: '@atlaspack/config-default', + runtimes: ['atlaspack-runtime-test'], }), ); diff --git a/packages/core/integration-tests/test/integration/atlaspack-register/.babelrc b/packages/core/integration-tests/test/integration/atlaspack-register/.babelrc new file mode 100644 index 000000000..bfabf3864 --- /dev/null +++ b/packages/core/integration-tests/test/integration/atlaspack-register/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["@atlaspack/babel-preset"] +} diff --git a/packages/core/integration-tests/test/integration/parcel-register/dispose-resolve.js b/packages/core/integration-tests/test/integration/atlaspack-register/dispose-resolve.js similarity index 65% rename from packages/core/integration-tests/test/integration/parcel-register/dispose-resolve.js rename to packages/core/integration-tests/test/integration/atlaspack-register/dispose-resolve.js index 59a565248..802c52320 100644 --- a/packages/core/integration-tests/test/integration/parcel-register/dispose-resolve.js +++ b/packages/core/integration-tests/test/integration/atlaspack-register/dispose-resolve.js @@ -1,4 +1,4 @@ -let {dispose} = require('@parcel/register'); +let {dispose} = require('@atlaspack/register'); console.log(require.resolve('~foo.js')); dispose(); console.log(require.resolve('~foo.js')); diff --git a/packages/core/integration-tests/test/integration/parcel-register/dispose-transform.js b/packages/core/integration-tests/test/integration/atlaspack-register/dispose-transform.js similarity index 72% rename from packages/core/integration-tests/test/integration/parcel-register/dispose-transform.js rename to packages/core/integration-tests/test/integration/atlaspack-register/dispose-transform.js index e82327495..5404b77e1 100644 --- a/packages/core/integration-tests/test/integration/parcel-register/dispose-transform.js +++ b/packages/core/integration-tests/test/integration/atlaspack-register/dispose-transform.js @@ -1,4 +1,4 @@ -let {dispose} = require('@parcel/register'); +let {dispose} = require('@atlaspack/register'); let indexPath = require.resolve('./index'); require('./index'); dispose(); diff --git a/packages/core/integration-tests/test/integration/atlaspack-register/entry.js b/packages/core/integration-tests/test/integration/atlaspack-register/entry.js new file mode 100644 index 000000000..7697ce975 --- /dev/null +++ b/packages/core/integration-tests/test/integration/atlaspack-register/entry.js @@ -0,0 +1,2 @@ +require('@atlaspack/register'); +require('./index'); diff --git a/packages/core/integration-tests/test/integration/parcel-register/foo.js b/packages/core/integration-tests/test/integration/atlaspack-register/foo.js similarity index 100% rename from packages/core/integration-tests/test/integration/parcel-register/foo.js rename to packages/core/integration-tests/test/integration/atlaspack-register/foo.js diff --git a/packages/core/integration-tests/test/integration/parcel-register/index.js b/packages/core/integration-tests/test/integration/atlaspack-register/index.js similarity index 100% rename from packages/core/integration-tests/test/integration/parcel-register/index.js rename to packages/core/integration-tests/test/integration/atlaspack-register/index.js diff --git a/packages/core/integration-tests/test/integration/parcel-register/resolver.js b/packages/core/integration-tests/test/integration/atlaspack-register/resolver.js similarity index 100% rename from packages/core/integration-tests/test/integration/parcel-register/resolver.js rename to packages/core/integration-tests/test/integration/atlaspack-register/resolver.js diff --git a/packages/core/integration-tests/test/integration/atlaspackrc-custom/.atlaspackrc b/packages/core/integration-tests/test/integration/atlaspackrc-custom/.atlaspackrc new file mode 100644 index 000000000..691382602 --- /dev/null +++ b/packages/core/integration-tests/test/integration/atlaspackrc-custom/.atlaspackrc @@ -0,0 +1,6 @@ +{ + "extends": "@atlaspack/config-default", + "transformers": { + "*.js": ["atlaspack-transformer-do-nothing"] + } +} diff --git a/packages/core/integration-tests/test/integration/atlaspackrc-custom/configCopy b/packages/core/integration-tests/test/integration/atlaspackrc-custom/configCopy new file mode 100644 index 000000000..5d55cc960 --- /dev/null +++ b/packages/core/integration-tests/test/integration/atlaspackrc-custom/configCopy @@ -0,0 +1,6 @@ +{ + "extends": "@atlaspack/config-default", + "transformers": { + "*.js": ["atlaspack-transformer-mock"] + } +} diff --git a/packages/core/integration-tests/test/integration/parcelrc-custom/index.js b/packages/core/integration-tests/test/integration/atlaspackrc-custom/index.js similarity index 100% rename from packages/core/integration-tests/test/integration/parcelrc-custom/index.js rename to packages/core/integration-tests/test/integration/atlaspackrc-custom/index.js diff --git a/packages/core/integration-tests/test/integration/parcelrc-custom/node_modules/parcel-transformer-do-nothing/index.js b/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-do-nothing/index.js similarity index 58% rename from packages/core/integration-tests/test/integration/parcelrc-custom/node_modules/parcel-transformer-do-nothing/index.js rename to packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-do-nothing/index.js index 701f5f5a5..4f40b68d8 100644 --- a/packages/core/integration-tests/test/integration/parcelrc-custom/node_modules/parcel-transformer-do-nothing/index.js +++ b/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-do-nothing/index.js @@ -1,4 +1,4 @@ -const Transformer = require('@parcel/plugin').Transformer; +const Transformer = require('@atlaspack/plugin').Transformer; module.exports = new Transformer({ transform({asset}) { diff --git a/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-do-nothing/package.json b/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-do-nothing/package.json new file mode 100644 index 000000000..66ecbcde5 --- /dev/null +++ b/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-do-nothing/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-transformer-do-nothing", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/parcelrc-custom/node_modules/parcel-transformer-mock/index.js b/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-mock/index.js similarity index 72% rename from packages/core/integration-tests/test/integration/parcelrc-custom/node_modules/parcel-transformer-mock/index.js rename to packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-mock/index.js index defa1db13..a3ccaa9be 100644 --- a/packages/core/integration-tests/test/integration/parcelrc-custom/node_modules/parcel-transformer-mock/index.js +++ b/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-mock/index.js @@ -1,4 +1,4 @@ -const Transformer = require('@parcel/plugin').Transformer; +const Transformer = require('@atlaspack/plugin').Transformer; module.exports = new Transformer({ transform() { diff --git a/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-mock/package.json b/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-mock/package.json new file mode 100644 index 000000000..2849f5a3b --- /dev/null +++ b/packages/core/integration-tests/test/integration/atlaspackrc-custom/node_modules/atlaspack-transformer-mock/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-transformer-mock", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/atlaspackrc-custom/package.json b/packages/core/integration-tests/test/integration/atlaspackrc-custom/package.json new file mode 100644 index 000000000..6f7f6ea23 --- /dev/null +++ b/packages/core/integration-tests/test/integration/atlaspackrc-custom/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-integration.atlaspackrc-custom", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/parcelrc-custom/yarn.lock b/packages/core/integration-tests/test/integration/atlaspackrc-custom/yarn.lock similarity index 100% rename from packages/core/integration-tests/test/integration/parcelrc-custom/yarn.lock rename to packages/core/integration-tests/test/integration/atlaspackrc-custom/yarn.lock diff --git a/packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/.atlaspackrc b/packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/.atlaspackrc new file mode 100644 index 000000000..77d4c7806 --- /dev/null +++ b/packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/.atlaspackrc @@ -0,0 +1,6 @@ +{ + "extends": ["@atlaspack/config-default"], + "transformers": { + "*.svg": ["@atlaspack/transformer-inline-string"] + } +} diff --git a/packages/core/integration-tests/test/integration/parcelrc-monorepo/app/icon.svg b/packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/icon.svg similarity index 100% rename from packages/core/integration-tests/test/integration/parcelrc-monorepo/app/icon.svg rename to packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/icon.svg diff --git a/packages/core/integration-tests/test/integration/parcelrc-monorepo/app/index.js b/packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/index.js similarity index 100% rename from packages/core/integration-tests/test/integration/parcelrc-monorepo/app/index.js rename to packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/index.js diff --git a/packages/core/integration-tests/test/integration/parcelrc-monorepo/app/package.json b/packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/package.json similarity index 100% rename from packages/core/integration-tests/test/integration/parcelrc-monorepo/app/package.json rename to packages/core/integration-tests/test/integration/atlaspackrc-monorepo/app/package.json diff --git a/packages/core/integration-tests/test/integration/parcelrc-monorepo/package.json b/packages/core/integration-tests/test/integration/atlaspackrc-monorepo/package.json similarity index 100% rename from packages/core/integration-tests/test/integration/parcelrc-monorepo/package.json rename to packages/core/integration-tests/test/integration/atlaspackrc-monorepo/package.json diff --git a/packages/core/integration-tests/test/integration/parcelrc-monorepo/yarn.lock b/packages/core/integration-tests/test/integration/atlaspackrc-monorepo/yarn.lock similarity index 100% rename from packages/core/integration-tests/test/integration/parcelrc-monorepo/yarn.lock rename to packages/core/integration-tests/test/integration/atlaspackrc-monorepo/yarn.lock diff --git a/packages/core/integration-tests/test/integration/babel-browserslist-multiple-env-as-string/package.json b/packages/core/integration-tests/test/integration/babel-browserslist-multiple-env-as-string/package.json index d886e6f30..0ef22eb19 100644 --- a/packages/core/integration-tests/test/integration/babel-browserslist-multiple-env-as-string/package.json +++ b/packages/core/integration-tests/test/integration/babel-browserslist-multiple-env-as-string/package.json @@ -1,5 +1,5 @@ { - "name": "parcel-test-browser-browserslist", + "name": "atlaspack-test-browser-browserslist", "browserslist": { "test": "chrome 68", "production": "last 2 Chrome versions, IE >= 11" diff --git a/packages/core/integration-tests/test/integration/babel-browserslist-multiple-env/package.json b/packages/core/integration-tests/test/integration/babel-browserslist-multiple-env/package.json index 90d27e801..3ba597f9b 100644 --- a/packages/core/integration-tests/test/integration/babel-browserslist-multiple-env/package.json +++ b/packages/core/integration-tests/test/integration/babel-browserslist-multiple-env/package.json @@ -1,5 +1,5 @@ { - "name": "parcel-test-browser-browserslist", + "name": "atlaspack-test-browser-browserslist", "browserslist": { "test": ["chrome 68"], "production": ["last 2 Chrome versions", "IE >= 11"] diff --git a/packages/core/integration-tests/test/integration/babel-browserslist/package.json b/packages/core/integration-tests/test/integration/babel-browserslist/package.json index 64d9b8d7f..9688338ef 100644 --- a/packages/core/integration-tests/test/integration/babel-browserslist/package.json +++ b/packages/core/integration-tests/test/integration/babel-browserslist/package.json @@ -1,4 +1,4 @@ { - "name": "parcel-test-browser-browserslist", + "name": "atlaspack-test-browser-browserslist", "browserslist": ["last 2 Chrome versions", "IE >= 11"] } diff --git a/packages/core/integration-tests/test/integration/babel-config-js-multitarget-transform-runtime/babel.config.js b/packages/core/integration-tests/test/integration/babel-config-js-multitarget-transform-runtime/babel.config.js index 0309dca28..470128b16 100644 --- a/packages/core/integration-tests/test/integration/babel-config-js-multitarget-transform-runtime/babel.config.js +++ b/packages/core/integration-tests/test/integration/babel-config-js-multitarget-transform-runtime/babel.config.js @@ -1,4 +1,4 @@ module.exports = { - "presets": ["@parcel/babel-preset-env"], - "plugins": ["@babel/plugin-transform-object-rest-spread", ["@parcel/babel-plugin-transform-runtime", {"version": "^7.7.4"}]] + "presets": ["@atlaspack/babel-preset-env"], + "plugins": ["@babel/plugin-transform-object-rest-spread", ["@atlaspack/babel-plugin-transform-runtime", {"version": "^7.7.4"}]] } diff --git a/packages/core/integration-tests/test/integration/babel-config-js-multitarget-transform-runtime/package.json b/packages/core/integration-tests/test/integration/babel-config-js-multitarget-transform-runtime/package.json index 97ff49292..41cb3dede 100644 --- a/packages/core/integration-tests/test/integration/babel-config-js-multitarget-transform-runtime/package.json +++ b/packages/core/integration-tests/test/integration/babel-config-js-multitarget-transform-runtime/package.json @@ -4,7 +4,7 @@ "main": "dist/main.js", "module": "dist/module.js", "dependencies": { - "@parcel/babel-plugin-tranform-runtime": "^2.0.0", + "@atlaspack/babel-plugin-tranform-runtime": "^2.0.0", "@babel/plugin-transform-object-rest-spread": "^7.22.11", "@babel/plugin-transform-runtime": "^7.22.10", "@babel/runtime": "^7.22.11" diff --git a/packages/core/integration-tests/test/integration/babel-config-js-multitarget/babel.config.js b/packages/core/integration-tests/test/integration/babel-config-js-multitarget/babel.config.js index 78da55845..d6b3b03e0 100644 --- a/packages/core/integration-tests/test/integration/babel-config-js-multitarget/babel.config.js +++ b/packages/core/integration-tests/test/integration/babel-config-js-multitarget/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - "presets": ["@parcel/babel-preset-env"] + "presets": ["@atlaspack/babel-preset-env"] } diff --git a/packages/core/integration-tests/test/integration/babel-config-js-require/yarn.lock b/packages/core/integration-tests/test/integration/babel-config-js-require/yarn.lock index 4085eb124..1ea67660f 100644 --- a/packages/core/integration-tests/test/integration/babel-config-js-require/yarn.lock +++ b/packages/core/integration-tests/test/integration/babel-config-js-require/yarn.lock @@ -1 +1 @@ -# Adding this lockfile here so Parcel finds a project root +# Adding this lockfile here so Atlaspack finds a project root diff --git a/packages/core/integration-tests/test/integration/babel-config-js/yarn.lock b/packages/core/integration-tests/test/integration/babel-config-js/yarn.lock index 4085eb124..1ea67660f 100644 --- a/packages/core/integration-tests/test/integration/babel-config-js/yarn.lock +++ b/packages/core/integration-tests/test/integration/babel-config-js/yarn.lock @@ -1 +1 @@ -# Adding this lockfile here so Parcel finds a project root +# Adding this lockfile here so Atlaspack finds a project root diff --git a/packages/core/integration-tests/test/integration/babel-config-json-custom/yarn.lock b/packages/core/integration-tests/test/integration/babel-config-json-custom/yarn.lock index 4085eb124..1ea67660f 100644 --- a/packages/core/integration-tests/test/integration/babel-config-json-custom/yarn.lock +++ b/packages/core/integration-tests/test/integration/babel-config-json-custom/yarn.lock @@ -1 +1 @@ -# Adding this lockfile here so Parcel finds a project root +# Adding this lockfile here so Atlaspack finds a project root diff --git a/packages/core/integration-tests/test/integration/babel-core-js/package.json b/packages/core/integration-tests/test/integration/babel-core-js/package.json index 6762e7b71..91c40653a 100644 --- a/packages/core/integration-tests/test/integration/babel-core-js/package.json +++ b/packages/core/integration-tests/test/integration/babel-core-js/package.json @@ -1,5 +1,5 @@ { - "name": "parcel-test-babel-polyfill-browserslist", + "name": "atlaspack-test-babel-polyfill-browserslist", "private": true, "browserslist": [ "Chrome 70" diff --git a/packages/core/integration-tests/test/integration/babel-default/package.json b/packages/core/integration-tests/test/integration/babel-default/package.json index c8b2dd667..1ee884a33 100644 --- a/packages/core/integration-tests/test/integration/babel-default/package.json +++ b/packages/core/integration-tests/test/integration/babel-default/package.json @@ -1,4 +1,4 @@ { - "name": "parcel-test-browser-browserslist", + "name": "atlaspack-test-browser-browserslist", "private": true } diff --git a/packages/core/integration-tests/test/integration/babel-node-modules-browserslist/package.json b/packages/core/integration-tests/test/integration/babel-node-modules-browserslist/package.json index 64d9b8d7f..9688338ef 100644 --- a/packages/core/integration-tests/test/integration/babel-node-modules-browserslist/package.json +++ b/packages/core/integration-tests/test/integration/babel-node-modules-browserslist/package.json @@ -1,4 +1,4 @@ { - "name": "parcel-test-browser-browserslist", + "name": "atlaspack-test-browser-browserslist", "browserslist": ["last 2 Chrome versions", "IE >= 11"] } diff --git a/packages/core/integration-tests/test/integration/babel-node-modules-jsx/package.json b/packages/core/integration-tests/test/integration/babel-node-modules-jsx/package.json index 8e8616ee3..c5063a247 100644 --- a/packages/core/integration-tests/test/integration/babel-node-modules-jsx/package.json +++ b/packages/core/integration-tests/test/integration/babel-node-modules-jsx/package.json @@ -1,5 +1,5 @@ { - "name": "parcel-test-browser-browserslist", + "name": "atlaspack-test-browser-browserslist", "private": true, "browserslist": ["last 2 Chrome versions", "IE >= 11"] } diff --git a/packages/core/integration-tests/test/integration/babel-node-modules-source-unlinked/package.json b/packages/core/integration-tests/test/integration/babel-node-modules-source-unlinked/package.json index 64d9b8d7f..9688338ef 100644 --- a/packages/core/integration-tests/test/integration/babel-node-modules-source-unlinked/package.json +++ b/packages/core/integration-tests/test/integration/babel-node-modules-source-unlinked/package.json @@ -1,4 +1,4 @@ { - "name": "parcel-test-browser-browserslist", + "name": "atlaspack-test-browser-browserslist", "browserslist": ["last 2 Chrome versions", "IE >= 11"] } diff --git a/packages/core/integration-tests/test/integration/babel-node-modules-source/package.json b/packages/core/integration-tests/test/integration/babel-node-modules-source/package.json index 64d9b8d7f..9688338ef 100644 --- a/packages/core/integration-tests/test/integration/babel-node-modules-source/package.json +++ b/packages/core/integration-tests/test/integration/babel-node-modules-source/package.json @@ -1,4 +1,4 @@ { - "name": "parcel-test-browser-browserslist", + "name": "atlaspack-test-browser-browserslist", "browserslist": ["last 2 Chrome versions", "IE >= 11"] } diff --git a/packages/core/integration-tests/test/integration/babel-node-modules/package.json b/packages/core/integration-tests/test/integration/babel-node-modules/package.json index 8e8616ee3..c5063a247 100644 --- a/packages/core/integration-tests/test/integration/babel-node-modules/package.json +++ b/packages/core/integration-tests/test/integration/babel-node-modules/package.json @@ -1,5 +1,5 @@ { - "name": "parcel-test-browser-browserslist", + "name": "atlaspack-test-browser-browserslist", "private": true, "browserslist": ["last 2 Chrome versions", "IE >= 11"] } diff --git a/packages/core/integration-tests/test/integration/babel-preset-env-shippedProposals/.babelrc b/packages/core/integration-tests/test/integration/babel-preset-env-shippedProposals/.babelrc index 0b07fd19d..c6ed054fe 100644 --- a/packages/core/integration-tests/test/integration/babel-preset-env-shippedProposals/.babelrc +++ b/packages/core/integration-tests/test/integration/babel-preset-env-shippedProposals/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["@parcel/babel-preset-env"] + "presets": ["@atlaspack/babel-preset-env"] } diff --git a/packages/core/integration-tests/test/integration/babel-warn-some-json5/.babelrc b/packages/core/integration-tests/test/integration/babel-warn-some-json5/.babelrc index 3da8adeca..ef0de048d 100644 --- a/packages/core/integration-tests/test/integration/babel-warn-some-json5/.babelrc +++ b/packages/core/integration-tests/test/integration/babel-warn-some-json5/.babelrc @@ -1,4 +1,4 @@ { - presets: ["@parcel/babel-preset-env"], + presets: ["@atlaspack/babel-preset-env"], "plugins": ["../babelrc-custom/babel-plugin-dummy"] } diff --git a/packages/core/integration-tests/test/integration/babel-warn-some/.babelrc b/packages/core/integration-tests/test/integration/babel-warn-some/.babelrc index 875d30d46..a706dfe98 100644 --- a/packages/core/integration-tests/test/integration/babel-warn-some/.babelrc +++ b/packages/core/integration-tests/test/integration/babel-warn-some/.babelrc @@ -1,4 +1,4 @@ { - "presets": ["@parcel/babel-preset-env"], + "presets": ["@atlaspack/babel-preset-env"], "plugins": ["../babelrc-custom/babel-plugin-dummy"] } diff --git a/packages/core/integration-tests/test/integration/babelrc-custom/yarn.lock b/packages/core/integration-tests/test/integration/babelrc-custom/yarn.lock index 4085eb124..1ea67660f 100644 --- a/packages/core/integration-tests/test/integration/babelrc-custom/yarn.lock +++ b/packages/core/integration-tests/test/integration/babelrc-custom/yarn.lock @@ -1 +1 @@ -# Adding this lockfile here so Parcel finds a project root +# Adding this lockfile here so Atlaspack finds a project root diff --git a/packages/core/integration-tests/test/integration/blob-url/.atlaspackrc b/packages/core/integration-tests/test/integration/blob-url/.atlaspackrc new file mode 100644 index 000000000..1bd52224a --- /dev/null +++ b/packages/core/integration-tests/test/integration/blob-url/.atlaspackrc @@ -0,0 +1,10 @@ + +{ + "extends": "@atlaspack/config-default", + "transformers": { + "blob-url:*": ["@atlaspack/transformer-inline", "..."] + }, + "optimizers": { + "blob-url:*": ["...", "@atlaspack/optimizer-blob-url"] + } +} diff --git a/packages/core/integration-tests/test/integration/blob-url/.parcelrc b/packages/core/integration-tests/test/integration/blob-url/.parcelrc deleted file mode 100644 index f3c4210f9..000000000 --- a/packages/core/integration-tests/test/integration/blob-url/.parcelrc +++ /dev/null @@ -1,10 +0,0 @@ - -{ - "extends": "@parcel/config-default", - "transformers": { - "blob-url:*": ["@parcel/transformer-inline", "..."] - }, - "optimizers": { - "blob-url:*": ["...", "@parcel/optimizer-blob-url"] - } -} diff --git a/packages/core/integration-tests/test/integration/cache-add-dep-referenced/package.json b/packages/core/integration-tests/test/integration/cache-add-dep-referenced/package.json index c5f216e03..2c7ad8df5 100644 --- a/packages/core/integration-tests/test/integration/cache-add-dep-referenced/package.json +++ b/packages/core/integration-tests/test/integration/cache-add-dep-referenced/package.json @@ -1,5 +1,5 @@ { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0 } } diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-bundler-test/index.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-bundler-test/index.js similarity index 95% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-bundler-test/index.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-bundler-test/index.js index 3e286b91b..3b78d7fe6 100644 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-bundler-test/index.js +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-bundler-test/index.js @@ -1,4 +1,4 @@ -const {Bundler} = require('@parcel/plugin'); +const {Bundler} = require('@atlaspack/plugin'); // A very dumb bundler just for tests... (probably doesn't produce working code) module.exports = new Bundler({ diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-bundler-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-bundler-test/package.json new file mode 100644 index 000000000..ba91734f8 --- /dev/null +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-bundler-test/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-bundler-test", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-compressor-test/index.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-compressor-test/index.js similarity index 66% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-compressor-test/index.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-compressor-test/index.js index a19e12ab2..af2aff5c1 100644 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-compressor-test/index.js +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-compressor-test/index.js @@ -1,4 +1,4 @@ -const {Compressor} = require('@parcel/plugin'); +const {Compressor} = require('@atlaspack/plugin'); module.exports = new Compressor({ compress({stream}) { diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-compressor-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-compressor-test/package.json new file mode 100644 index 000000000..c6e9b3921 --- /dev/null +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-compressor-test/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-compressor-test", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/incremental-bundling/node_modules/parcel-namer-test/index.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-namer-test/index.js similarity index 68% rename from packages/core/integration-tests/test/integration/incremental-bundling/node_modules/parcel-namer-test/index.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-namer-test/index.js index b0195e3f8..d16472271 100644 --- a/packages/core/integration-tests/test/integration/incremental-bundling/node_modules/parcel-namer-test/index.js +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-namer-test/index.js @@ -1,4 +1,4 @@ -const {Namer} = require('@parcel/plugin'); +const {Namer} = require('@atlaspack/plugin'); module.exports = new Namer({ name({bundle}) { diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-namer-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-namer-test/package.json new file mode 100644 index 000000000..2cc759ee5 --- /dev/null +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-namer-test/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-namer-test", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-optimizer-test/index.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-optimizer-test/index.js similarity index 84% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-optimizer-test/index.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-optimizer-test/index.js index 375b6a09a..1b7e41ebe 100644 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-optimizer-test/index.js +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-optimizer-test/index.js @@ -1,4 +1,4 @@ -const {Optimizer} = require('@parcel/plugin'); +const {Optimizer} = require('@atlaspack/plugin'); module.exports = new Optimizer({ async loadConfig({config}) { diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-optimizer-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-optimizer-test/package.json new file mode 100644 index 000000000..d65baed74 --- /dev/null +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-optimizer-test/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-optimizer-test", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-packager-test/index.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-packager-test/index.js similarity index 84% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-packager-test/index.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-packager-test/index.js index 9de249b13..e3c667f49 100644 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-packager-test/index.js +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-packager-test/index.js @@ -1,4 +1,4 @@ -const {Packager} = require('@parcel/plugin'); +const {Packager} = require('@atlaspack/plugin'); module.exports = new Packager({ async loadConfig({config}) { diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-packager-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-packager-test/package.json new file mode 100644 index 000000000..ca779a741 --- /dev/null +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-packager-test/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-packager-test", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-resolver-test/index.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-resolver-test/index.js similarity index 91% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-resolver-test/index.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-resolver-test/index.js index cb6b7bd21..84fbab200 100644 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-resolver-test/index.js +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-resolver-test/index.js @@ -1,4 +1,4 @@ -const {Resolver} = require('@parcel/plugin'); +const {Resolver} = require('@atlaspack/plugin'); const path = require('path'); module.exports = new Resolver({ diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-resolver-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-resolver-test/package.json new file mode 100644 index 000000000..2a52e36ee --- /dev/null +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-resolver-test/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-resolver-test", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/incremental-bundling/node_modules/parcel-runtime-test/index.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-runtime-test/index.js similarity index 81% rename from packages/core/integration-tests/test/integration/incremental-bundling/node_modules/parcel-runtime-test/index.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-runtime-test/index.js index 3a2a34e6f..72bd9241f 100644 --- a/packages/core/integration-tests/test/integration/incremental-bundling/node_modules/parcel-runtime-test/index.js +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-runtime-test/index.js @@ -1,4 +1,4 @@ -const {Runtime} = require('@parcel/plugin'); +const {Runtime} = require('@atlaspack/plugin'); module.exports = new Runtime({ apply({bundle, options}) { diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-runtime-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-runtime-test/package.json new file mode 100644 index 000000000..a08ac18f0 --- /dev/null +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-runtime-test/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-runtime-test", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/constants.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/constants.js similarity index 100% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/constants.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/constants.js diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/data/a.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/data/a.js similarity index 100% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/data/a.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/data/a.js diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/data/b.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/data/b.js similarity index 100% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/data/b.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/data/b.js diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/dep.cjs b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/dep.cjs similarity index 100% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/dep.cjs rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/dep.cjs diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/index.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/index.js similarity index 92% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/index.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/index.js index ee3d987c5..b7230bf33 100644 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/index.js +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/index.js @@ -1,4 +1,4 @@ -import {Transformer} from '@parcel/plugin'; +import {Transformer} from '@atlaspack/plugin'; import {message} from './constants.js'; import {value} from './dep.cjs'; import path from 'path'; diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/package.json similarity index 61% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/package.json rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/package.json index 385aa5373..587560d6c 100644 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-esm/package.json +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-esm/package.json @@ -1,6 +1,6 @@ { - "name": "parcel-transformer-esm", + "name": "atlaspack-transformer-esm", "version": "1.2.3", "main": "index.js", "type": "module" -} \ No newline at end of file +} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-mock/constants.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-mock/constants.js similarity index 100% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-mock/constants.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-mock/constants.js diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-mock/index.js b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-mock/index.js similarity index 84% rename from packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-mock/index.js rename to packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-mock/index.js index 476deaef2..7f7ff85e0 100644 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-mock/index.js +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-mock/index.js @@ -1,4 +1,4 @@ -const Transformer = require('@parcel/plugin').Transformer; +const Transformer = require('@atlaspack/plugin').Transformer; module.exports = new Transformer({ transform({asset}) { diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-mock/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-mock/package.json new file mode 100644 index 000000000..2849f5a3b --- /dev/null +++ b/packages/core/integration-tests/test/integration/cache/node_modules/atlaspack-transformer-mock/package.json @@ -0,0 +1,4 @@ +{ + "name": "atlaspack-transformer-mock", + "version": "1.2.3" +} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-bundler-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/parcel-bundler-test/package.json deleted file mode 100644 index ee742e8db..000000000 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-bundler-test/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "parcel-bundler-test", - "version": "1.2.3" -} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-compressor-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/parcel-compressor-test/package.json deleted file mode 100644 index e29b5c008..000000000 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-compressor-test/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "parcel-compressor-test", - "version": "1.2.3" -} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-namer-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/parcel-namer-test/package.json deleted file mode 100644 index afb7cef75..000000000 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-namer-test/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "parcel-namer-test", - "version": "1.2.3" -} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-optimizer-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/parcel-optimizer-test/package.json deleted file mode 100644 index cd4f873c0..000000000 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-optimizer-test/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "parcel-optimizer-test", - "version": "1.2.3" -} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-packager-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/parcel-packager-test/package.json deleted file mode 100644 index a545af596..000000000 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-packager-test/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "parcel-packager-test", - "version": "1.2.3" -} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-resolver-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/parcel-resolver-test/package.json deleted file mode 100644 index 337715c36..000000000 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-resolver-test/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "parcel-resolver-test", - "version": "1.2.3" -} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-runtime-test/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/parcel-runtime-test/package.json deleted file mode 100644 index 484cf226f..000000000 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-runtime-test/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "parcel-runtime-test", - "version": "1.2.3" -} diff --git a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-mock/package.json b/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-mock/package.json deleted file mode 100644 index f7faa7367..000000000 --- a/packages/core/integration-tests/test/integration/cache/node_modules/parcel-transformer-mock/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "parcel-transformer-mock", - "version": "1.2.3" -} diff --git a/packages/core/integration-tests/test/integration/cache/package.json b/packages/core/integration-tests/test/integration/cache/package.json index b89e653ab..34db0f476 100644 --- a/packages/core/integration-tests/test/integration/cache/package.json +++ b/packages/core/integration-tests/test/integration/cache/package.json @@ -1,5 +1,5 @@ { - "name": "parcel-cache-tests", + "name": "atlaspack-cache-tests", "version": "1.0.0", "private": true } diff --git a/packages/core/integration-tests/test/integration/compressors-disable-default/.atlaspackrc b/packages/core/integration-tests/test/integration/compressors-disable-default/.atlaspackrc new file mode 100644 index 000000000..4fa26b058 --- /dev/null +++ b/packages/core/integration-tests/test/integration/compressors-disable-default/.atlaspackrc @@ -0,0 +1,6 @@ +{ + "extends": ["@atlaspack/config-default"], + "compressors": { + "*": ["@atlaspack/compressor-brotli"] + } +} diff --git a/packages/core/integration-tests/test/integration/compressors-disable-default/.parcelrc b/packages/core/integration-tests/test/integration/compressors-disable-default/.parcelrc deleted file mode 100644 index 02595abc2..000000000 --- a/packages/core/integration-tests/test/integration/compressors-disable-default/.parcelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["@parcel/config-default"], - "compressors": { - "*": ["@parcel/compressor-brotli"] - } -} diff --git a/packages/core/integration-tests/test/integration/compressors/.atlaspackrc b/packages/core/integration-tests/test/integration/compressors/.atlaspackrc new file mode 100644 index 000000000..5360e320e --- /dev/null +++ b/packages/core/integration-tests/test/integration/compressors/.atlaspackrc @@ -0,0 +1,6 @@ +{ + "extends": ["@atlaspack/config-default"], + "compressors": { + "*": ["...", "@atlaspack/compressor-gzip", "@atlaspack/compressor-brotli"] + } +} diff --git a/packages/core/integration-tests/test/integration/compressors/.parcelrc b/packages/core/integration-tests/test/integration/compressors/.parcelrc deleted file mode 100644 index f0d5d113c..000000000 --- a/packages/core/integration-tests/test/integration/compressors/.parcelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["@parcel/config-default"], - "compressors": { - "*": ["...", "@parcel/compressor-gzip", "@parcel/compressor-brotli"] - } -} diff --git a/packages/core/integration-tests/test/integration/config-merging/.atlaspackrc b/packages/core/integration-tests/test/integration/config-merging/.atlaspackrc new file mode 100644 index 000000000..2eaf9a59f --- /dev/null +++ b/packages/core/integration-tests/test/integration/config-merging/.atlaspackrc @@ -0,0 +1,3 @@ +{ + "extends": ["@atlaspack/config-default", "atlaspack-config-test1", "atlaspack-config-test2"] +} diff --git a/packages/core/integration-tests/test/integration/config-merging/.parcelrc b/packages/core/integration-tests/test/integration/config-merging/.parcelrc deleted file mode 100644 index 117112a27..000000000 --- a/packages/core/integration-tests/test/integration/config-merging/.parcelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@parcel/config-default", "parcel-config-test1", "parcel-config-test2"] -} \ No newline at end of file diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test1/index.json b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test1/index.json new file mode 100644 index 000000000..44a85fec1 --- /dev/null +++ b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test1/index.json @@ -0,0 +1,3 @@ +{ + "runtimes": ["atlaspack-runtime-nothing"] +} diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test1/package.json b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test1/package.json similarity index 56% rename from packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test1/package.json rename to packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test1/package.json index 9fabffcd2..2f0332ac2 100644 --- a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test1/package.json +++ b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test1/package.json @@ -1,6 +1,6 @@ { "main": "index.json", "dependencies": { - "parcel-runtime-nothing": "*" + "atlaspack-runtime-nothing": "*" } -} \ No newline at end of file +} diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test2/index.json b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test2/index.json new file mode 100644 index 000000000..68b405d59 --- /dev/null +++ b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test2/index.json @@ -0,0 +1,5 @@ +{ + "transformers": { + "*.custom-ext": ["atlaspack-transformer-string"] + } +} diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test2/package.json b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test2/package.json similarity index 54% rename from packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test2/package.json rename to packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test2/package.json index f991dfa23..68302513d 100644 --- a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test2/package.json +++ b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-config-test2/package.json @@ -1,6 +1,6 @@ { "main": "index.json", "dependencies": { - "parcel-transformer-string": "*" + "atlaspack-transformer-string": "*" } -} \ No newline at end of file +} diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-runtime-nothing/index.js b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-runtime-nothing/index.js similarity index 77% rename from packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-runtime-nothing/index.js rename to packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-runtime-nothing/index.js index d6e445aca..f3a85abb4 100644 --- a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-runtime-nothing/index.js +++ b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-runtime-nothing/index.js @@ -1,4 +1,4 @@ -const {Runtime} = require('@parcel/plugin'); +const {Runtime} = require('@atlaspack/plugin'); exports.default = new Runtime({ async apply({options}) { @@ -8,4 +8,4 @@ exports.default = new Runtime({ isEntry: true } } -}) \ No newline at end of file +}) diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-runtime-nothing/package.json b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-runtime-nothing/package.json similarity index 100% rename from packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-runtime-nothing/package.json rename to packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-runtime-nothing/package.json diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-transformer-string/index.js b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-transformer-string/index.js similarity index 75% rename from packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-transformer-string/index.js rename to packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-transformer-string/index.js index 7c0215084..d86a08ee9 100644 --- a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-transformer-string/index.js +++ b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-transformer-string/index.js @@ -1,4 +1,4 @@ -const {Transformer} = require('@parcel/plugin'); +const {Transformer} = require('@atlaspack/plugin'); exports.default = new Transformer({ async transform({asset}) { @@ -7,4 +7,4 @@ exports.default = new Transformer({ content: `export default \`${await asset.getCode()}\`` }]; } -}); \ No newline at end of file +}); diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-transformer-string/package.json b/packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-transformer-string/package.json similarity index 100% rename from packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-transformer-string/package.json rename to packages/core/integration-tests/test/integration/config-merging/node_modules/atlaspack-transformer-string/package.json diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test1/index.json b/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test1/index.json deleted file mode 100644 index 371a37003..000000000 --- a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test1/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "runtimes": ["parcel-runtime-nothing"] -} \ No newline at end of file diff --git a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test2/index.json b/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test2/index.json deleted file mode 100644 index c7bc81ec4..000000000 --- a/packages/core/integration-tests/test/integration/config-merging/node_modules/parcel-config-test2/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "transformers": { - "*.custom-ext": ["parcel-transformer-string"] - } -} \ No newline at end of file diff --git a/packages/core/integration-tests/test/integration/config-merging/package.json b/packages/core/integration-tests/test/integration/config-merging/package.json index e3fbbe4a0..c94d24e9f 100644 --- a/packages/core/integration-tests/test/integration/config-merging/package.json +++ b/packages/core/integration-tests/test/integration/config-merging/package.json @@ -6,6 +6,6 @@ "node": "8" }, "dependencies": { - "parcel-transformer-string": "*" + "atlaspack-transformer-string": "*" } } diff --git a/packages/core/integration-tests/test/integration/css-exports/package.json b/packages/core/integration-tests/test/integration/css-exports/package.json index fb3f316ab..4033de901 100644 --- a/packages/core/integration-tests/test/integration/css-exports/package.json +++ b/packages/core/integration-tests/test/integration/css-exports/package.json @@ -1,5 +1,5 @@ { - "@parcel/resolver-default": { + "@atlaspack/resolver-default": { "packageExports": true } } diff --git a/packages/core/integration-tests/test/integration/css-modules-global/a/package.json b/packages/core/integration-tests/test/integration/css-modules-global/a/package.json index c12320b6d..4be809284 100644 --- a/packages/core/integration-tests/test/integration/css-modules-global/a/package.json +++ b/packages/core/integration-tests/test/integration/css-modules-global/a/package.json @@ -1,5 +1,5 @@ { - "@parcel/transformer-css": { + "@atlaspack/transformer-css": { "cssModules": true } -} \ No newline at end of file +} diff --git a/packages/core/integration-tests/test/integration/css-modules-global/b/package.json b/packages/core/integration-tests/test/integration/css-modules-global/b/package.json index ab90e8d5c..f19ee6c9f 100644 --- a/packages/core/integration-tests/test/integration/css-modules-global/b/package.json +++ b/packages/core/integration-tests/test/integration/css-modules-global/b/package.json @@ -1,7 +1,7 @@ { - "@parcel/transformer-css": { + "@atlaspack/transformer-css": { "cssModules": { "global": true } } -} \ No newline at end of file +} diff --git a/packages/core/integration-tests/test/integration/css-modules-import/package.json b/packages/core/integration-tests/test/integration/css-modules-import/package.json index 27fa31fc8..2c7ad8df5 100644 --- a/packages/core/integration-tests/test/integration/css-modules-import/package.json +++ b/packages/core/integration-tests/test/integration/css-modules-import/package.json @@ -1,5 +1,5 @@ { - "@parcel/bundler-default": { + "@atlaspack/bundler-default": { "minBundleSize": 0 } -} \ No newline at end of file +} diff --git a/packages/core/integration-tests/test/integration/css-modules-style/package.json b/packages/core/integration-tests/test/integration/css-modules-style/package.json index b75c1c251..6ef325ee3 100644 --- a/packages/core/integration-tests/test/integration/css-modules-style/package.json +++ b/packages/core/integration-tests/test/integration/css-modules-style/package.json @@ -1,6 +1,6 @@ { "private": true, - "@parcel/transformer-css": { + "@atlaspack/transformer-css": { "cssModules": true } } diff --git a/packages/core/integration-tests/test/integration/css-modules-vars/package.json b/packages/core/integration-tests/test/integration/css-modules-vars/package.json index 0f8b6aff7..6e86f90a6 100644 --- a/packages/core/integration-tests/test/integration/css-modules-vars/package.json +++ b/packages/core/integration-tests/test/integration/css-modules-vars/package.json @@ -1,7 +1,7 @@ { - "@parcel/transformer-css": { + "@atlaspack/transformer-css": { "cssModules": { "dashedIdents": true } } -} \ No newline at end of file +} diff --git a/packages/core/integration-tests/test/integration/css-nesting/package.json b/packages/core/integration-tests/test/integration/css-nesting/package.json index 142881045..6e5257096 100644 --- a/packages/core/integration-tests/test/integration/css-nesting/package.json +++ b/packages/core/integration-tests/test/integration/css-nesting/package.json @@ -1,5 +1,5 @@ { - "@parcel/transformer-css": { + "@atlaspack/transformer-css": { "drafts": { "nesting": true } diff --git a/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-build-metrics b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-build-metrics new file mode 100644 index 000000000..c981a0199 --- /dev/null +++ b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-build-metrics @@ -0,0 +1,6 @@ +{ + "extends": ["@atlaspack/config-default"], + "reporters": [ + "@atlaspack/reporter-build-metrics" + ] +} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-dev-server b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-dev-server new file mode 100644 index 000000000..46d5a7e4a --- /dev/null +++ b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-dev-server @@ -0,0 +1,6 @@ +{ + "extends": ["@atlaspack/config-default"], + "reporters": [ + '@atlaspack/reporter-dev-server' + ] +} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-eslint b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-eslint new file mode 100644 index 000000000..e28763bbf --- /dev/null +++ b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-eslint @@ -0,0 +1,7 @@ +{ + "extends": "@atlaspack/config-default", + "validators": { + "*.{js,jsx,ts,tsx}": ["@atlaspack/validator-eslint"] + }, + "reporters": [] +} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-json-reporter b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-json-reporter new file mode 100644 index 000000000..db4b9de6c --- /dev/null +++ b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-json-reporter @@ -0,0 +1,6 @@ +{ + "extends": ["@atlaspack/config-default"], + "reporters": [ + "@atlaspack/reporter-json" + ] +} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-svg-react b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-svg-react new file mode 100644 index 000000000..d24b7da65 --- /dev/null +++ b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-svg-react @@ -0,0 +1,7 @@ +{ + "extends": "@atlaspack/config-default", + "transformers": { + "*.svg": ["...", "@atlaspack/transformer-svg-react"] + }, + "reporters": [] +} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-typescript-validation b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-typescript-validation new file mode 100644 index 000000000..a9dd023e9 --- /dev/null +++ b/packages/core/integration-tests/test/integration/custom-configs/.atlaspackrc-typescript-validation @@ -0,0 +1,6 @@ +{ + "extends": "@atlaspack/config-default", + "validators": { + "*.{ts,tsx}": ["@atlaspack/validator-typescript"] + } +} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-build-metrics b/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-build-metrics deleted file mode 100644 index 8a099d6bc..000000000 --- a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-build-metrics +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["@parcel/config-default"], - "reporters": [ - "@parcel/reporter-build-metrics" - ] -} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-dev-server b/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-dev-server deleted file mode 100644 index a414859c0..000000000 --- a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-dev-server +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["@parcel/config-default"], - "reporters": [ - '@parcel/reporter-dev-server' - ] -} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-eslint b/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-eslint deleted file mode 100644 index 5e5104e7e..000000000 --- a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-eslint +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "@parcel/config-default", - "validators": { - "*.{js,jsx,ts,tsx}": ["@parcel/validator-eslint"] - }, - "reporters": [] -} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-json-reporter b/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-json-reporter deleted file mode 100644 index abbb5bfae..000000000 --- a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-json-reporter +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["@parcel/config-default"], - "reporters": [ - "@parcel/reporter-json" - ] -} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-svg-react b/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-svg-react deleted file mode 100644 index c11e89a36..000000000 --- a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-svg-react +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "@parcel/config-default", - "transformers": { - "*.svg": ["...", "@parcel/transformer-svg-react"] - }, - "reporters": [] -} diff --git a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-typescript-validation b/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-typescript-validation deleted file mode 100644 index 4aab08764..000000000 --- a/packages/core/integration-tests/test/integration/custom-configs/.parcelrc-typescript-validation +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "@parcel/config-default", - "validators": { - "*.{ts,tsx}": ["@parcel/validator-typescript"] - } -} diff --git a/packages/core/integration-tests/test/integration/data-url/parcel.webp b/packages/core/integration-tests/test/integration/data-url/atlaspack.webp similarity index 100% rename from packages/core/integration-tests/test/integration/data-url/parcel.webp rename to packages/core/integration-tests/test/integration/data-url/atlaspack.webp diff --git a/packages/core/integration-tests/test/integration/data-url/binary.css b/packages/core/integration-tests/test/integration/data-url/binary.css index 41ed6d91e..c110af144 100644 --- a/packages/core/integration-tests/test/integration/data-url/binary.css +++ b/packages/core/integration-tests/test/integration/data-url/binary.css @@ -1,3 +1,3 @@ .webp-img { - background-image: url('data-url:parcel.webp') + background-image: url('data-url:atlaspack.webp') } diff --git a/packages/core/integration-tests/test/integration/data-url/binary.js b/packages/core/integration-tests/test/integration/data-url/binary.js index 13e99bb68..3ac938442 100644 --- a/packages/core/integration-tests/test/integration/data-url/binary.js +++ b/packages/core/integration-tests/test/integration/data-url/binary.js @@ -1,2 +1,2 @@ -import webp from 'data-url:./parcel.webp'; +import webp from 'data-url:./atlaspack.webp'; export default webp; diff --git a/packages/core/integration-tests/test/integration/dont-autoinstall-if-env-var-is-false/.env b/packages/core/integration-tests/test/integration/dont-autoinstall-if-env-var-is-false/.env index ae52a6180..209a34698 100644 --- a/packages/core/integration-tests/test/integration/dont-autoinstall-if-env-var-is-false/.env +++ b/packages/core/integration-tests/test/integration/dont-autoinstall-if-env-var-is-false/.env @@ -1 +1 @@ -PARCEL_AUTOINSTALL=false +ATLASPACK_AUTOINSTALL=false diff --git a/packages/core/integration-tests/test/integration/elm-multiple-apps/package.json b/packages/core/integration-tests/test/integration/elm-multiple-apps/package.json index 2142bc875..eb546d25c 100644 --- a/packages/core/integration-tests/test/integration/elm-multiple-apps/package.json +++ b/packages/core/integration-tests/test/integration/elm-multiple-apps/package.json @@ -1,5 +1,5 @@ { - "@parcel/transformer-elm": { + "@atlaspack/transformer-elm": { "extraSources": { "./src/Main.elm": [ "./src/MainB.elm", diff --git a/packages/core/integration-tests/test/integration/encodedURI/index.html b/packages/core/integration-tests/test/integration/encodedURI/index.html index 1b9cbca09..d68496302 100644 --- a/packages/core/integration-tests/test/integration/encodedURI/index.html +++ b/packages/core/integration-tests/test/integration/encodedURI/index.html @@ -2,10 +2,10 @@ - Parcel encoded-URI testing + Atlaspack encoded-URI testing -

Parcel encoded-URI testing

+

Atlaspack encoded-URI testing

日本語 diff --git a/packages/core/integration-tests/test/integration/env-disabled-glob/package.json b/packages/core/integration-tests/test/integration/env-disabled-glob/package.json index 8d99190f9..22d68b6b7 100644 --- a/packages/core/integration-tests/test/integration/env-disabled-glob/package.json +++ b/packages/core/integration-tests/test/integration/env-disabled-glob/package.json @@ -1,5 +1,5 @@ { - "@parcel/transformer-js": { + "@atlaspack/transformer-js": { "inlineEnvironment": ["B_*"] } } diff --git a/packages/core/integration-tests/test/integration/env-disabled/package.json b/packages/core/integration-tests/test/integration/env-disabled/package.json index 889ecc8dd..0647b4afc 100644 --- a/packages/core/integration-tests/test/integration/env-disabled/package.json +++ b/packages/core/integration-tests/test/integration/env-disabled/package.json @@ -1,5 +1,5 @@ { - "@parcel/transformer-js": { + "@atlaspack/transformer-js": { "inlineEnvironment": false } } diff --git a/packages/core/integration-tests/test/integration/env-nodeenv/package.json b/packages/core/integration-tests/test/integration/env-nodeenv/package.json index 889ecc8dd..0647b4afc 100644 --- a/packages/core/integration-tests/test/integration/env-nodeenv/package.json +++ b/packages/core/integration-tests/test/integration/env-nodeenv/package.json @@ -1,5 +1,5 @@ { - "@parcel/transformer-js": { + "@atlaspack/transformer-js": { "inlineEnvironment": false } } diff --git a/packages/core/integration-tests/test/integration/fs-disabled/package.json b/packages/core/integration-tests/test/integration/fs-disabled/package.json index 8357e4adc..a35998d34 100644 --- a/packages/core/integration-tests/test/integration/fs-disabled/package.json +++ b/packages/core/integration-tests/test/integration/fs-disabled/package.json @@ -1,5 +1,5 @@ { - "@parcel/transformer-js": { + "@atlaspack/transformer-js": { "inlineFS": false } } diff --git a/packages/core/integration-tests/test/integration/glob-absolute/.atlaspackrc b/packages/core/integration-tests/test/integration/glob-absolute/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob-absolute/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob-absolute/.parcelrc b/packages/core/integration-tests/test/integration/glob-absolute/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob-absolute/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/glob-async/.atlaspackrc b/packages/core/integration-tests/test/integration/glob-async/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob-async/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob-async/.parcelrc b/packages/core/integration-tests/test/integration/glob-async/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob-async/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/glob-css/.atlaspackrc b/packages/core/integration-tests/test/integration/glob-css/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob-css/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob-css/.parcelrc b/packages/core/integration-tests/test/integration/glob-css/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob-css/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/glob-deep/.atlaspackrc b/packages/core/integration-tests/test/integration/glob-deep/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob-deep/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob-deep/.parcelrc b/packages/core/integration-tests/test/integration/glob-deep/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob-deep/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/glob-error/.atlaspackrc b/packages/core/integration-tests/test/integration/glob-error/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob-error/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob-error/.parcelrc b/packages/core/integration-tests/test/integration/glob-error/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob-error/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/glob-package-async/.atlaspackrc b/packages/core/integration-tests/test/integration/glob-package-async/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob-package-async/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob-package-async/.parcelrc b/packages/core/integration-tests/test/integration/glob-package-async/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob-package-async/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/glob-package/.atlaspackrc b/packages/core/integration-tests/test/integration/glob-package/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob-package/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob-package/.parcelrc b/packages/core/integration-tests/test/integration/glob-package/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob-package/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/glob-pipeline/.atlaspackrc b/packages/core/integration-tests/test/integration/glob-pipeline/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob-pipeline/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob-pipeline/.parcelrc b/packages/core/integration-tests/test/integration/glob-pipeline/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob-pipeline/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/glob-tilde/.atlaspackrc b/packages/core/integration-tests/test/integration/glob-tilde/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob-tilde/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob-tilde/.parcelrc b/packages/core/integration-tests/test/integration/glob-tilde/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob-tilde/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/glob/.atlaspackrc b/packages/core/integration-tests/test/integration/glob/.atlaspackrc new file mode 100644 index 000000000..ca509ec33 --- /dev/null +++ b/packages/core/integration-tests/test/integration/glob/.atlaspackrc @@ -0,0 +1,4 @@ +{ + "extends": "@atlaspack/config-default", + "resolvers": ["@atlaspack/resolver-glob", "..."] +} diff --git a/packages/core/integration-tests/test/integration/glob/.parcelrc b/packages/core/integration-tests/test/integration/glob/.parcelrc deleted file mode 100644 index 44d567b5c..000000000 --- a/packages/core/integration-tests/test/integration/glob/.parcelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "@parcel/config-default", - "resolvers": ["@parcel/resolver-glob", "..."] -} diff --git a/packages/core/integration-tests/test/integration/global-redeclare/package.json b/packages/core/integration-tests/test/integration/global-redeclare/package.json index 56c6a6dd6..d8c3d7142 100644 --- a/packages/core/integration-tests/test/integration/global-redeclare/package.json +++ b/packages/core/integration-tests/test/integration/global-redeclare/package.json @@ -1,5 +1,5 @@ { - "name": "parcel-test-global-redeclare", + "name": "atlaspack-test-global-redeclare", "private": true, "browserslist": ["last 2 Chrome versions"] } diff --git a/packages/core/integration-tests/test/integration/html-inline-coffeescript/index.html b/packages/core/integration-tests/test/integration/html-inline-coffeescript/index.html index 2f6cc931d..b42ca830b 100644 --- a/packages/core/integration-tests/test/integration/html-inline-coffeescript/index.html +++ b/packages/core/integration-tests/test/integration/html-inline-coffeescript/index.html @@ -1,11 +1,11 @@ - Inline JavaScript Parcel + Inline JavaScript Atlaspack - \ No newline at end of file + diff --git a/packages/core/integration-tests/test/integration/html-inline-js-module/index.html b/packages/core/integration-tests/test/integration/html-inline-js-module/index.html index 3561bc294..85ec701c5 100644 --- a/packages/core/integration-tests/test/integration/html-inline-js-module/index.html +++ b/packages/core/integration-tests/test/integration/html-inline-js-module/index.html @@ -1,7 +1,7 @@ - Inline JavaScript Parcel + Inline JavaScript Atlaspack - \ No newline at end of file + diff --git a/packages/core/integration-tests/test/integration/html-inline-sass/index.html b/packages/core/integration-tests/test/integration/html-inline-sass/index.html index fb48ea8d9..37a0f6bcb 100644 --- a/packages/core/integration-tests/test/integration/html-inline-sass/index.html +++ b/packages/core/integration-tests/test/integration/html-inline-sass/index.html @@ -1,7 +1,7 @@ - Inline JavaScript Parcel + Inline JavaScript Atlaspack -

🚨 Parcel encountered errors

+

🚨 Atlaspack encountered errors

<% errors.forEach(function(error){ %>

<%- error.message %>

-
<% if (error.frames?.length) { %><% error.frames.forEach(function(frame){ %><%- frame.location %> +
<% if (error.frames?.length) { %><% error.frames.forEach(function(frame){ %><%- frame.location %> <%- frame.code %><% }); %><% } else { %><%- error.stack %><% } %>