-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy integration files to a new test-bin directory in preparation for…
… postHTML transformation (#28864) * move buildNewServer to its own file * temp * temp * temp * normalize all script paths to cdn * fix cupcake file * temp * add new test-bin directory for transformed fixtures * temp * revert all test files * minor clean up * fix lint issues * revert changes to transformer sequence * move call to buildTransformedHtml after `shouldNotRun` call * get all tests green by switching the "served" path back to the original * fix lint issues * move typescript compile to server folder * apply recs
- Loading branch information
1 parent
8653336
commit 42ffc69
Showing
8 changed files
with
89 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ c | |
/dist | ||
dist.3p | ||
dist.tools | ||
test-bin | ||
examples.min | ||
node_modules | ||
npm-debug.log | ||
|
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,47 @@ | ||
/** | ||
* Copyright 2020 The AMP HTML Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS-IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
const log = require('fancy-log'); | ||
const {cyan, green} = require('ansi-colors'); | ||
const {exec} = require('../common/exec'); | ||
|
||
const SERVER_TRANSFORM_PATH = 'build-system/server/new-server/transforms'; | ||
|
||
// Used by new server implementation | ||
const typescriptBinary = './node_modules/typescript/bin/tsc'; | ||
|
||
/** | ||
* Builds the new server by converting typescript transforms to JS | ||
*/ | ||
function buildNewServer() { | ||
const buildCmd = `${typescriptBinary} -p ${SERVER_TRANSFORM_PATH}/tsconfig.json`; | ||
log( | ||
green('Building'), | ||
cyan('AMP Dev Server'), | ||
green('at'), | ||
cyan(`${SERVER_TRANSFORM_PATH}/dist`) + green('...') | ||
); | ||
const result = exec(buildCmd, {'stdio': ['inherit', 'inherit', 'pipe']}); | ||
if (result.status != 0) { | ||
const err = new Error('Could not build AMP Dev Server'); | ||
err.showStack = false; | ||
throw err; | ||
} | ||
} | ||
|
||
module.exports = { | ||
buildNewServer, | ||
SERVER_TRANSFORM_PATH, | ||
}; |
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