-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/issue 1268 import map and attribute polyfill configuration (#…
…1269) * import map polyfill config flag * import attributes polyfill config option * import attributes demo * develop test cases for import maps and attributes for development * import attributes polyfill config serve test cases * polyfills configuration error test cases * bundle polyfilled import attributes for the browser * polyfills configuration docs and import attributes call outs * misc refactoring * add acorn-import-attributes as a CLI dependency * refine pre-intercepting logic to include all JS resource types * remove demo code * more robust bundling and serve test case
- Loading branch information
1 parent
90a3a21
commit 88548ac
Showing
42 changed files
with
1,017 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ig.error-polyfill-import-attributes/build.config.error-polyfill-import-attributes.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Use Case | ||
* Run Greenwood build command with a bad value for polyfill.importAttributes in a custom config. | ||
* | ||
* User Result | ||
* Should throw an error. | ||
* | ||
* User Command | ||
* greenwood build | ||
* | ||
* User Config | ||
* { | ||
* polyfills: { | ||
* importAttributes: {} | ||
* } | ||
* } | ||
* | ||
* User Workspace | ||
* Greenwood default | ||
*/ | ||
import chai from 'chai'; | ||
import path from 'path'; | ||
import { Runner } from 'gallinago'; | ||
import { fileURLToPath, URL } from 'url'; | ||
|
||
const expect = chai.expect; | ||
|
||
describe('Build Greenwood With: ', function() { | ||
const cliPath = path.join(process.cwd(), 'packages/cli/src/index.js'); | ||
const outputPath = fileURLToPath(new URL('.', import.meta.url)); | ||
let runner; | ||
|
||
before(function() { | ||
this.context = { | ||
publicDir: path.join(outputPath, 'public') | ||
}; | ||
runner = new Runner(); | ||
}); | ||
|
||
describe('Custom Configuration with a bad value for Polyfills w/ Import Attributes', function() { | ||
it('should throw an error that polyfills.importAttributes must be an array of types; [\'css\', \'json\']', function() { | ||
try { | ||
runner.setup(outputPath); | ||
runner.runCommand(cliPath, 'build'); | ||
} catch (err) { | ||
expect(err).to.contain('Error: greenwood.config.js polyfill.importAttributes must be a an array of types; [\'css\', \'json\']. Passed value was typeof: object'); | ||
} | ||
}); | ||
}); | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
packages/cli/test/cases/build.config.error-polyfill-import-attributes/greenwood.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
polyfills: { | ||
importAttributes: null | ||
} | ||
}; |
Oops, something went wrong.