Skip to content

Commit

Permalink
Merge pull request #9 from tc39/initial-spec
Browse files Browse the repository at this point in the history
Initial Spec
  • Loading branch information
guybedford authored May 13, 2024
2 parents c8aee67 + 4f06ce1 commit 65d30b8
Show file tree
Hide file tree
Showing 5 changed files with 5,786 additions and 56 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Build spec
name: Deploy spec

on: [pull_request, push]
on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: lts/*
node-version: '12.x'
- run: npm install
- run: npm run build
- name: commit changes
uses: elstudio/actions-js-build/commit@v3
with:
commitMessage: "fixup: [spec] `npm run build`"
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,3 @@ yarn.lock
package-lock.json
npm-shrinkwrap.json
pnpm-lock.yaml

# Build directory
build
30 changes: 8 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,42 +123,28 @@ These helper methods are designed to allow for determining the static public exp
imports of a module, but do not give information about the internal module identifiers or dynamic
import.
### `ModuleSource.prototype.imports()`
### `AbstractModuleSource.prototype.imports()`
Returns the ordered list of the dependencies `Import[]`, defined by:
Returns a list of the imports of the module of the form `Import[]` defined by:
```ts
interface Import {
specifier: string,
attributes: null | {
[key: string]: string
},
phase: null | 'source'
}
```
Note that all `export` statements with a `from` clause are reflected as imports as well as
being reflected on exports.
### `AbstractModuleSource.prototype.hasDynamicImport`
### `ModuleSource.prototype.exports()`
A boolean getter property indicating if the module may call dynamic import.
Returns the list of public exports `(Export | StarReexport)[]`, defined by:
### `AbstractModuleSource.prototype.hasImportMeta`
```ts
interface Export {
type: 'export',
name: string,
}
A boolean getter property indicating if the module accesses the module `import.meta`.
interface StarReexport {
type: 'star-reexport',
from: Import
}
```
### `AbstractModuleSource.prototype.hasTopLevelAwait`
`Export` is provided for both re-exports and local exports. For example,
`export * as X from './x.js'` would be reflected as the export `{ type: 'export', name: 'x' }`,
and then also appear in the `Import` dependency list separately.
A boolean getter property indicating if the module contains use of top-level await.
### Dynamic Import
Expand Down
Loading

0 comments on commit 65d30b8

Please sign in to comment.