Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Package Importer] Add types and specs #3728

Merged
merged 55 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
08b9e9e
Add Package Importer draft types and specs
jamesnw Oct 23, 2023
870dde6
Export NodePackageImporter, set brand to unknown type
jamesnw Oct 24, 2023
3bf5798
Sync api
jamesnw Oct 24, 2023
6823427
Add Node Package Importer to embedded protocol
jamesnw Oct 24, 2023
c432a49
Move node_package_importer to tag 5
jamesnw Oct 24, 2023
078d063
Merge branch 'sass:main' into feature.package-importer
jamesnw Oct 26, 2023
4fc382d
Merge branch 'sass:main' into feature.package-importer
jamesnw Nov 8, 2023
9d1d3d2
Review responses
jamesnw Nov 16, 2023
3fde52a
Switch to Vuetify as pkg example
jamesnw Nov 16, 2023
06e5f4b
Change NodePackageImporter to Symbol
jamesnw Nov 17, 2023
2b46fe4
Update symbol type
jamesnw Nov 17, 2023
7a75284
Address review
jamesnw Nov 20, 2023
62f28c7
Rearrange examples
jamesnw Nov 20, 2023
f90be17
Fix export order
jamesnw Nov 20, 2023
940779f
Lint
jamesnw Nov 20, 2023
7361603
Apply entrypoint url changes
jamesnw Nov 22, 2023
c0ec953
Merge branch 'main' of https://github.com/sass/sass into feature.pack…
jamesnw Dec 11, 2023
d78c4a5
Move usage info up
jamesnw Dec 11, 2023
39e7f47
Merge branch 'main' into feature.package-importer
jgerigmeyer Dec 15, 2023
6798051
Apply 1.4 changes
jamesnw Dec 18, 2023
daf4241
Update sass protocol
jamesnw Dec 18, 2023
68c031c
Change NodePackageImporter to class
jamesnw Dec 19, 2023
b9db927
Remove unneeded nevers
jamesnw Dec 19, 2023
a939dc3
Expose entryPointPath
jamesnw Dec 19, 2023
c1d1d26
Merge branch 'main' of https://github.com/sass/sass into feature.pack…
jamesnw Dec 21, 2023
ac23514
Review responses
jamesnw Dec 21, 2023
dbf2e85
Update legacy
jamesnw Dec 21, 2023
de0e911
Merge branch 'main' of https://github.com/sass/sass into feature.pack…
jamesnw Jan 3, 2024
ec40399
Apply draft changes
jamesnw Jan 3, 2024
5fa733d
Merge branch 'main' of https://github.com/sass/sass into feature.pack…
jamesnw Jan 4, 2024
41fc313
Put exports in code font
jamesnw Jan 4, 2024
6f7bf99
Note that the entryPointPath must be absolute in proto.
jamesnw Jan 4, 2024
63c4508
Set Proto version to 2.4.0
jamesnw Jan 5, 2024
dcc5214
Update protocol version and legacy example
jgerigmeyer Jan 5, 2024
52d5073
Move proposal to `accepted/` dir
jgerigmeyer Jan 5, 2024
1c36ec5
Merge branch 'main' of https://github.com/sass/sass into feature.pack…
jamesnw Jan 17, 2024
7ec5cb7
Update proto version
jamesnw Jan 17, 2024
a480af2
Merge branch 'main' of https://github.com/sass/sass into feature.pack…
jamesnw Jan 18, 2024
2d9adc4
Apply draft 1.5
jamesnw Jan 19, 2024
06889c3
Apply 1.5 updates
jamesnw Jan 19, 2024
400ad5e
Apply 1.5 changes
jamesnw Jan 20, 2024
31abf9a
Fix whitespace
jamesnw Jan 20, 2024
60acecf
Merge branch 'main' into feature.package-importer
jgerigmeyer Jan 24, 2024
d0dc35d
whitespace
jgerigmeyer Jan 24, 2024
fec2256
Merge branch 'main' of https://github.com/sass/sass into feature.pack…
jamesnw Feb 1, 2024
0c37548
Draft 1.6, move from entry point path to entry point directory
jamesnw Feb 1, 2024
d811e12
wrap text
jgerigmeyer Feb 1, 2024
a309e64
Update embedded for entry point dir
jamesnw Feb 1, 2024
e5ecfcd
Merge branch 'feature.package-importer' of github.com:oddbird/sass in…
jamesnw Feb 1, 2024
b9ed745
Update types and docs
jamesnw Feb 1, 2024
04a975b
Add private, readonly symbol key to NodePackageImporter type.
jgerigmeyer Feb 6, 2024
bcca129
typo
jgerigmeyer Feb 6, 2024
b09caef
Use canonical NodePackageImporter in legacy type def
jgerigmeyer Feb 6, 2024
4b29c77
Fix typo
jamesnw Feb 6, 2024
e2517ca
Ensure directory passed into Node algorithm for PACKAGE_RESOLVE
jamesnw Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions accepted/package-importer.changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

* Change from an entry point path to entry point directory.

* Add a private readonly symbol key to `NodePackageImporter` type to
distinguish it from arbitrary objects.

## Draft 1.5

* Specify that Package Importers must not reject URL patterns that other Package
Expand Down
9 changes: 8 additions & 1 deletion accepted/package-importer.d.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,12 @@ import {FileImporter, Importer} from '../spec/js-api/importer';
### `NodePackageImporter`

```ts
declare const nodePackageImporterKey: unique symbol;

export class NodePackageImporter {
/** Used to distinguish this type from any arbitrary object. */
private readonly [nodePackageImporterKey]: true;

constructor(entryPointDirectory?: string);
}
```
Expand Down Expand Up @@ -302,9 +307,11 @@ resolution algorithm. If not set, the default value is the parent directory of
Defaults to undefined.

```ts
import {NodePackageImporter as BaseNodePackageImporter} from '../spec/js-api/importer';

declare module '../spec/js-api/legacy/options' {
export interface LegacySharedOptions<sync extends 'sync' | 'async'> {
pkgImporter?: NodePackageImporter;
pkgImporter?: BaseNodePackageImporter;
nex3 marked this conversation as resolved.
Show resolved Hide resolved
}
}
```
Expand Down
5 changes: 5 additions & 0 deletions js-api-doc/importer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
nonCanonicalScheme?: string | string[];
}

declare const nodePackageImporterKey: unique symbol;

/**
* The built-in Node.js package importer. This loads pkg: URLs from node_modules
* according to the standard Node.js resolution algorithm.
Expand Down Expand Up @@ -417,6 +419,9 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
* @category Importer
*/
export class NodePackageImporter {
/** Used to distinguish this type from any arbitrary object. */
private readonly [nodePackageImporterKey]: true;

/**
* The NodePackageImporter has an optional `entryPointDirectory` option, which
* is the directory where the Node Package Importer should start when
Expand Down
5 changes: 5 additions & 0 deletions spec/js-api/importer.d.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ nonCanonicalScheme?: string | string[];
### `NodePackageImporter`

```ts
declare const nodePackageImporterKey: unique symbol;

export class NodePackageImporter {
/** Used to distinguish this type from any arbitrary object. */
private readonly [nodePackageImporterKey]: true;

constructor(entryPointDirectory?: string);
}
```
Expand Down
Loading