From d8de8d4e0b04670a9ab9fb80b3acf848ac8bb3e2 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Tue, 22 Feb 2022 16:32:24 +0100 Subject: [PATCH 01/23] feat(cf-worker): handle multiple env with CF Service Worker --- packages/actions/src/Deployer.ts | 32 +++-- packages/actions/src/Packager.ts | 2 +- packages/cli/src/commands/deploy.ts | 1 + packages/core/src/types.ts | 8 +- .../deployer-aws-lambda/src/createPackage.ts | 4 +- packages/deployer-aws-lambda/src/deploy.ts | 2 +- .../deployer-cf-workers/src/createPackage.ts | 7 +- packages/deployer-cf-workers/src/deploy.ts | 136 +++++++++++++----- .../src/templateInjections.ts | 6 +- .../deployer-cf-workers/templates/index.js | 8 +- 10 files changed, 145 insertions(+), 61 deletions(-) diff --git a/packages/actions/src/Deployer.ts b/packages/actions/src/Deployer.ts index decbf67cd..0360b4d93 100644 --- a/packages/actions/src/Deployer.ts +++ b/packages/actions/src/Deployer.ts @@ -27,7 +27,7 @@ export default class Deployer { package_dir: string, server_host: DeployProviders | undefined, assets_host: DeployProviders | undefined, - env: string | undefined, + envs: string[] | undefined, assets_only: boolean, assets_already_deployed_at: string | undefined, auto_install: boolean @@ -44,7 +44,7 @@ export default class Deployer { ` ) } - const env_overrides = await this.getSettingsOverrides(config, env) + const env_overrides = await this.getSettingsOverrides(config, envs) const { server_provider, assets_provider } = this.getProviders( deploy, @@ -92,22 +92,32 @@ export default class Deployer { } // TODO: this should be common somewhere - private static async getSettingsOverrides(config: JSON5Config, env?: string) { - if (!env) { - return {} + private static async getSettingsOverrides( + config: JSON5Config, + envs?: string[] + ): Promise> { + const env_overrides = new Map() + + if (!envs) { + return new Map([['production', {}]]) } - const overrides = config.data.settings?.[env] - if (!overrides) { - throw new InvalidConfigError(`No environment '${env}' found in ${config}!`) + + for (const env of envs) { + const overrides = config.data.settings?.[env] + if (!overrides) { + throw new InvalidConfigError(`No environment '${env}' found in ${config}!`) + } + env_overrides.set(env, overrides) } - return overrides + + return env_overrides } private static async deployAssetsAndServer( file_path: string, package_dir: string, deploy: DeployConfig, - env_overrides: FabSettings, + env_overrides: Map, assets_provider: DeployProviders, server_provider: DeployProviders, assets_only: boolean @@ -191,7 +201,7 @@ export default class Deployer { file_path: string, package_dir: string, config: FabSettings, - env_overrides: FabSettings, + env_overrides: Map, assets_url: string ) { return await server_deployer.deployServer!( diff --git a/packages/actions/src/Packager.ts b/packages/actions/src/Packager.ts index 87eb4f114..22dc2042d 100644 --- a/packages/actions/src/Packager.ts +++ b/packages/actions/src/Packager.ts @@ -48,7 +48,7 @@ export default class Packager { } if (env) throw new Error('Not implemented ENV support yet') - const env_overrides = {} + const env_overrides = new Map() const deploy_config = config.deploy![target] as ConfigTypes.Union await packager.createPackage( diff --git a/packages/cli/src/commands/deploy.ts b/packages/cli/src/commands/deploy.ts index 241eb01c7..60f750385 100644 --- a/packages/cli/src/commands/deploy.ts +++ b/packages/cli/src/commands/deploy.ts @@ -36,6 +36,7 @@ export default class Deploy extends Command { env: flags.string({ description: 'Override production settings with a different environment defined in your FAB config file.', + multiple: true, }), 'assets-already-deployed-at': flags.string({ description: diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 045a33aab..0b8767ff2 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -175,7 +175,7 @@ export type FabServerDeployer = ( fab_path: string, working_dir: string, config: T, - env_overrides: FabSettings, + env_overrides: Map, assets_url: string ) => Promise @@ -189,7 +189,7 @@ export type FabDeployer = ( fab_path: string, working_dir: string, config: T, - env_overrides: FabSettings + env_overrides: Map ) => Promise export type FabDeployerExports = { @@ -202,7 +202,7 @@ export type FabPackager = ( fab_path: string, package_path: string, config: T, - env_overrides: FabSettings, + env_overrides: Map, assets_url: string ) => Promise @@ -231,7 +231,7 @@ export type DeployFn = ( package_dir: string, server_host: DeployProviders | undefined, assets_host: DeployProviders | undefined, - env: string | undefined, + env: string[] | undefined, assets_only: boolean, assets_already_deployed_at: string | undefined, auto_install: boolean diff --git a/packages/deployer-aws-lambda/src/createPackage.ts b/packages/deployer-aws-lambda/src/createPackage.ts index 811d6b2f8..4f8127a09 100644 --- a/packages/deployer-aws-lambda/src/createPackage.ts +++ b/packages/deployer-aws-lambda/src/createPackage.ts @@ -10,7 +10,7 @@ export const createPackage: FabPackager = async ( fab_path: string, package_path: string, config: ConfigTypes.AwsLambda, - env_overrides: FabSettings, + env_overrides: Map, assets_url: string ) => { log.time(`Compiling package to: ๐Ÿ’›${package_path}๐Ÿ’›:`) @@ -28,7 +28,7 @@ export const createPackage: FabPackager = async ( const parsed = new URL(assets_url) const packaged_config = { - env_overrides, + env_overrides: {}, // Not implemented ENV support yet assets_url: stripTrailingSlash(assets_url), assets_domain: parsed.hostname, assets_path_prefix: stripTrailingSlash(parsed.pathname), diff --git a/packages/deployer-aws-lambda/src/deploy.ts b/packages/deployer-aws-lambda/src/deploy.ts index c7831906b..a55d0a9a2 100644 --- a/packages/deployer-aws-lambda/src/deploy.ts +++ b/packages/deployer-aws-lambda/src/deploy.ts @@ -9,7 +9,7 @@ export const deployServer: FabServerDeployer = async ( fab_path: string, working_dir: string, config: ConfigTypes.AwsLambda, - env_overrides: FabSettings, + env_overrides: Map, assets_url: string ) => { // TODO, hash the FAB, figure out if we actually need to do this diff --git a/packages/deployer-cf-workers/src/createPackage.ts b/packages/deployer-cf-workers/src/createPackage.ts index 8f603c9ca..8735772c4 100644 --- a/packages/deployer-cf-workers/src/createPackage.ts +++ b/packages/deployer-cf-workers/src/createPackage.ts @@ -13,7 +13,7 @@ export const createPackage: FabPackager = async ( fab_path: string, package_path: string, config: ConfigTypes.CFWorkers, - env_overrides: FabSettings, + env_overrides: Map, assets_url: string ) => { if (!assets_url) @@ -32,7 +32,10 @@ export const createPackage: FabPackager = async ( const bundle_id = (await pathToSHA512(fab_path)).slice(0, 32) const fab_server_src = await fs.readFile(path.join(work_dir, 'server.js'), 'utf8') - const injections = templateInjections(fab_server_src, assets_url, { bundle_id }) + const injections = templateInjections(fab_server_src, assets_url, env_overrides, { + bundle_id, + }) + const template = await fs.readFile( path.join(__dirname, '../templates/index.js'), 'utf8' diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index d636a9686..eac11a8d2 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -21,7 +21,7 @@ export const deployBoth: FabDeployer = async ( fab_path: string, package_dir: string, config: ConfigTypes.CFWorkers, - env_overrides: FabSettings + env_overrides: Map ) => { const assets_url = await deployAssets(fab_path, package_dir, config) return await deployServer(fab_path, package_dir, config, env_overrides, assets_url) @@ -87,10 +87,10 @@ export const deployAssets: FabAssetsDeployer = async ( log.continue(`๐Ÿ–ค ${file} (${pretty(body_stream.bytesRead)})๐Ÿ–ค`) }) - log.tick(`Done.`) - await Promise.all(uploads) + log.tick(`Done.`) + return `kv://${namespace.id}` } @@ -98,7 +98,7 @@ export const deployServer: FabServerDeployer = async ( fab_path: string, package_dir: string, config: ConfigTypes.CFWorkers, - env_overrides: FabSettings, + env_overrides: Map, assets_url: string ) => { const package_path = path.join(package_dir, 'cf-workers.js') @@ -124,7 +124,7 @@ export const deployServer: FabServerDeployer = async ( if (workers_dev) { checkValidityForWorkersDev(config) } else { - checkValidityForZoneRoutes(config) + checkValidityForZoneRoutes(config, env_overrides) } const api = await getCloudflareApi(api_token, account_id) @@ -140,7 +140,7 @@ export const deployServer: FabServerDeployer = async ( ) if (workers_dev) { - return await publishOnWorkersDev(api, account_id, script_name) + return await publishOnWorkersDev(api, account_id, script_name, env_overrides) } else { if ('routes' in config) { let promises = routes.map((r) => publishOnZoneRoute(api, zone_id, r, script_name)) @@ -171,7 +171,10 @@ function checkValidityForWorkersDev(config: ConfigTypes.CFWorkers) { log.tick(`Config valid.`) } -function checkValidityForZoneRoutes(config: ConfigTypes.CFWorkers) { +function checkValidityForZoneRoutes( + config: ConfigTypes.CFWorkers, + env_overrides: Map +) { const required_keys: Array = [ 'account_id', 'api_token', @@ -210,6 +213,9 @@ function checkValidityForZoneRoutes(config: ConfigTypes.CFWorkers) { ) } } + if (Array.from(env_overrides.keys()).length > 1) { + throw new InvalidConfigError(`Deploy with multiple env on route not supported yet`) + } log.tick(`Config valid.`) } @@ -217,7 +223,7 @@ async function packageAndUpload( fab_path: string, package_path: string, config: ConfigTypes.CFWorkers, - env_overrides: FabSettings, + env_overrides: Map, assets_url: string, api: CloudflareApi, account_id: string, @@ -252,36 +258,89 @@ async function packageAndUpload( }) } - const metadata = { - body_part: 'script', - bindings, - } + let service_response = await api.get( + `/accounts/${account_id}/workers/services/${script_name}` + ) - const body = new Multipart() - body.append('metadata', JSON.stringify(metadata)) - body.append('script', await fs.readFile(package_path, 'utf8'), { - contentType: 'application/javascript', - }) + if (!service_response.success) { + const body = new Multipart() + body.append('metadata', JSON.stringify({ body_part: 'script', bindings })) + body.append('script', await fs.readFile(package_path, 'utf8'), { + contentType: 'application/javascript', + }) - const upload_response = await api.put( - `/accounts/${account_id}/workers/scripts/${script_name}`, - { - body: (body as unknown) as FormData, - headers: body.getHeaders(), + const upload_response = await api.put( + `/accounts/${account_id}/workers/scripts/${script_name}`, + { + body: (body as unknown) as FormData, + headers: body.getHeaders(), + } + ) + + if (!upload_response.success) { + throw new FabDeployError(`Error uploading the script, got response: + โค๏ธ${JSON.stringify(upload_response)}โค๏ธ`) } + + service_response = await api.get( + `/accounts/${account_id}/workers/services/${script_name}` + ) + + if (!service_response.success) { + throw new FabDeployError(`Error getting the service, got response: + โค๏ธ${JSON.stringify(upload_response)}โค๏ธ`) + } + } + + const environments = service_response.result.environments.map( + ({ environment }: any) => environment ) + for (const [env] of env_overrides) { + if (!environments.includes(env)) { + const create_environement_response = await api.post( + `/accounts/${account_id}/workers/services/${script_name}/environments/production/copy/${env}` + ) + + if (!create_environement_response.success) { + throw new FabDeployError(`Error creating the environment, got response: + โค๏ธ${JSON.stringify(create_environement_response)}โค๏ธ`) + } + } + + const body = new Multipart() + body.append( + 'metadata', + JSON.stringify({ + body_part: 'script', + bindings: [...bindings, { type: 'plain_text', name: 'ENVIRONMENT', text: env }], + }) + ) + body.append('script', await fs.readFile(package_path, 'utf8'), { + contentType: 'application/javascript', + }) + + const upload_response = await api.put( + `/accounts/${account_id}/workers/services/${script_name}/environments/${env}`, + { + body: (body as unknown) as FormData, + headers: body.getHeaders(), + } + ) - if (!upload_response.success) { - throw new FabDeployError(`Error uploading the script, got response: - โค๏ธ${JSON.stringify(upload_response)}โค๏ธ`) + if (!upload_response) { + throw new FabDeployError(`Error uploading the service, got response: + โค๏ธ${JSON.stringify(upload_response)}โค๏ธ`) + } } + log.tick(`Uploaded, publishing...`) } async function publishOnWorkersDev( api: CloudflareApi, account_id: string, - script_name: string + script_name: string, + env_overrides: Map ) { const subdomain_response = await api.get(`/accounts/${account_id}/workers/subdomain`) if (!subdomain_response.success) { @@ -290,20 +349,27 @@ async function publishOnWorkersDev( } const { subdomain } = subdomain_response.result - const publish_response = await api.post( - `/accounts/${account_id}/workers/scripts/${script_name}/subdomain`, - { - body: JSON.stringify({ enabled: true }), + const urls = [] + + for (const [env] of env_overrides) { + const publish_response = await api.post( + `/accounts/${account_id}/workers/services/${script_name}/environments/${env}/subdomain`, + { + body: JSON.stringify({ enabled: true }), + } + ) + if (!publish_response.success) { + throw new FabDeployError(`Error publishing the script on a workers.dev subdomain, got response: + โค๏ธ${JSON.stringify(publish_response)}โค๏ธ`) } - ) - if (!publish_response.success) { - throw new FabDeployError(`Error publishing the script on a workers.dev subdomain, got response: - โค๏ธ${JSON.stringify(publish_response)}โค๏ธ`) + + urls.push(`https://${env}.${script_name}.${subdomain}.workers.dev`) } + log.tick(`Done.`) log.time((d) => `Deployed in ${d}.`) - return `https://${script_name}.${subdomain}.workers.dev` + return urls } async function publishOnZoneRoute( diff --git a/packages/deployer-cf-workers/src/templateInjections.ts b/packages/deployer-cf-workers/src/templateInjections.ts index 3446f2ad5..f0509a9aa 100644 --- a/packages/deployer-cf-workers/src/templateInjections.ts +++ b/packages/deployer-cf-workers/src/templateInjections.ts @@ -1,12 +1,14 @@ -import { FABServerContext } from '@fab/core' +import { FABServerContext, FabSettings } from '@fab/core' // language=JavaScript export default ( fab_src: string, assets_url: string, + env_overrides: Map, server_context: FABServerContext ) => ` ${fab_src}; // makes globalThis.__fab globalThis.__assets_url = ${JSON.stringify(assets_url)}; - __server_context = ${JSON.stringify(server_context)} + globalThis.__server_context = ${JSON.stringify(server_context)}; + globalThis.__env_overrides = ${JSON.stringify(Object.fromEntries(env_overrides))} ` diff --git a/packages/deployer-cf-workers/templates/index.js b/packages/deployer-cf-workers/templates/index.js index 8b69336be..0387fd154 100644 --- a/packages/deployer-cf-workers/templates/index.js +++ b/packages/deployer-cf-workers/templates/index.js @@ -1,6 +1,7 @@ const FAB = globalThis.__fab // injected by UMD const ASSETS_URL = globalThis.__assets_url // inlined in packager const cache = caches.default +const env_overrides = globalThis.__env_overrides[globalThis.ENVIRONMENT] // inlined in packager const server_context = globalThis.__server_context // inlined in packager const USES_KV_STORE = ASSETS_URL.startsWith('kv://') @@ -102,10 +103,11 @@ const handleRequest = async (request, within_loop = false) => { if (url.pathname.startsWith('/_assets/')) { return await assetFetch(url.pathname) } else { - let settings = FAB.getProdSettings ? FAB.getProdSettings() : {} - if (settings.then && typeof settings.then == 'function') { - settings = await settings + let prodSettings = FAB.getProdSettings ? FAB.getProdSettings() : {} + if (prodSettings.then && typeof prodSettings.then == 'function') { + prodSettings = await prodSettings } + const settings = Object.assign({}, prodSettings, env_overrides) const result = await FAB.render(request, settings) if (result instanceof Request) { From abc61f638e396cd563c8c192a188b3ef33405ef8 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Tue, 22 Feb 2022 21:41:39 +0100 Subject: [PATCH 02/23] Edit package refs --- package.json | 8 ++++---- packages/_fab/package.json | 6 +++--- packages/actions/package.json | 4 ++-- packages/cli/package.json | 6 +++--- packages/core/package.json | 4 ++-- packages/deployer-aws-lambda/package.json | 6 +++--- packages/deployer-aws-s3/package.json | 6 +++--- packages/deployer-cf-workers/package.json | 6 +++--- packages/input-nextjs/package.json | 6 +++--- packages/input-static/package.json | 6 +++--- packages/plugin-precompile/package.json | 8 ++++---- packages/plugin-render-html/package.json | 6 +++--- packages/plugin-rewire-assets/package.json | 6 +++--- packages/sandbox-node-vm/package.json | 6 +++--- packages/server/package.json | 8 ++++---- 15 files changed, 46 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 2e5b09cf3..622d91853 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "fab-spec", + "name": "spendesk", "version": "1.0.0-rc1", "private": true, - "homepage": "https://github.com/fab-spec/fab", - "bugs": "https://github.com/fab-spec/fab/issues", - "repository": "fab-spec/fab", + "homepage": "https://github.com/spendesk/fab", + "bugs": "https://github.com/spendesk/fab/issues", + "repository": "spendesk/fab", "workspaces": [ "packages/*" ], diff --git a/packages/_fab/package.json b/packages/_fab/package.json index e58fc2cf8..933d07e9b 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -5,13 +5,13 @@ "keywords": [ "fab" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/fab-spec/fab.git" + "url": "git+https://github.com/spendesk/fab.git" }, "license": "MIT", "author": "Glen Maddern", diff --git a/packages/actions/package.json b/packages/actions/package.json index 5a275b9ee..3b10ec801 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -10,8 +10,8 @@ "deploy", "fab" ], - "homepage": "https://github.com/fab-spec/fab", - "repository": "fab-spec/fab", + "homepage": "https://github.com/spendesk/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/cli/package.json b/packages/cli/package.json index a8377ed38..6bad865bf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -6,9 +6,9 @@ "fab", "oclif" ], - "homepage": "https://github.com/fab-spec/fab", - "bugs": "https://github.com/fab-spec/fab/issues", - "repository": "fab-spec/fab", + "homepage": "https://github.com/spendesk/fab", + "bugs": "https://github.com/spendesk/fab/issues", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern @geelen", "files": [ diff --git a/packages/core/package.json b/packages/core/package.json index 948398673..e4a52c1bf 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -7,8 +7,8 @@ "fab", "types" ], - "homepage": "https://github.com/fab-spec/fab", - "repository": "fab-spec/fab", + "homepage": "https://github.com/spendesk/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/deployer-aws-lambda/package.json b/packages/deployer-aws-lambda/package.json index c747a7c56..242c76278 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -8,11 +8,11 @@ "fab", "lambda" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/deployer-aws-s3/package.json b/packages/deployer-aws-s3/package.json index b7642721c..23d4f1027 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -8,11 +8,11 @@ "fab", "s3" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/deployer-cf-workers/package.json b/packages/deployer-cf-workers/package.json index 5ce194356..299fbf6ea 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -8,11 +8,11 @@ "fab", "workers" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/input-nextjs/package.json b/packages/input-nextjs/package.json index 9f439e330..6e6f5bea7 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -8,11 +8,11 @@ "fab", "s3" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/input-static/package.json b/packages/input-static/package.json index 7ad6aef43..9085db554 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -7,11 +7,11 @@ "fab-input", "plugin" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/plugin-precompile/package.json b/packages/plugin-precompile/package.json index 17edab4b0..4ad2df045 100644 --- a/packages/plugin-precompile/package.json +++ b/packages/plugin-precompile/package.json @@ -1,15 +1,15 @@ { "name": "@fab/plugin-precompile", - "version": "1.0.0-rc.9.p1", + "version": "1.0.0-rc.9", "description": "Module to render static HTML files with FAB injections", "keywords": [ "fab" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/plugin-render-html/package.json b/packages/plugin-render-html/package.json index 8db8d6b95..bf951515e 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -5,11 +5,11 @@ "keywords": [ "fab" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/plugin-rewire-assets/package.json b/packages/plugin-rewire-assets/package.json index 3c65cc377..74cceb05a 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -7,11 +7,11 @@ "fab", "plugin" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/sandbox-node-vm/package.json b/packages/sandbox-node-vm/package.json index 3911e52dc..2a0fd5c26 100644 --- a/packages/sandbox-node-vm/package.json +++ b/packages/sandbox-node-vm/package.json @@ -6,11 +6,11 @@ "fab", "server" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ diff --git a/packages/server/package.json b/packages/server/package.json index 5ce30d2b7..888f15d44 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,16 +1,16 @@ { "name": "@fab/server", - "version": "1.0.0-rc.9.p1", + "version": "1.0.0-rc.9", "description": "NodeJS FAB Server", "keywords": [ "fab", "server" ], - "homepage": "https://github.com/fab-spec/fab#readme", + "homepage": "https://github.com/spendesk/fab#readme", "bugs": { - "url": "https://github.com/fab-spec/fab/issues" + "url": "https://github.com/spendesk/fab/issues" }, - "repository": "fab-spec/fab", + "repository": "spendesk/fab", "license": "MIT", "author": "Glen Maddern", "files": [ From cbc760588d514aa85c270bf24770be4f0aae5f98 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Wed, 23 Feb 2022 11:37:40 +0100 Subject: [PATCH 03/23] Edit package refs --- lint-staged.config.js | 8 ++++---- packages/_fab/fab.js | 4 ++-- packages/_fab/package.json | 4 ++-- packages/actions/package.json | 6 +++--- packages/actions/src/Builder.ts | 4 ++-- packages/actions/src/Compiler.ts | 6 +++--- packages/actions/src/Deployer.ts | 4 ++-- packages/actions/src/Generator.ts | 6 +++--- packages/actions/src/Packager.ts | 4 ++-- packages/actions/src/Typecheck.ts | 4 ++-- packages/actions/src/index.ts | 2 +- packages/actions/src/rollup.ts | 2 +- .../actions/src/runtime/final_responder.ts | 2 +- packages/actions/src/runtime/index.ts | 2 +- packages/actions/test/actions/Builder.test.ts | 2 +- packages/actions/test/actions/Compiler.test.ts | 4 ++-- .../plugins/typescript-example/build.ts | 2 +- .../plugins/typescript-example/runtime.ts | 2 +- .../plugins/typescript-example/types.ts | 2 +- packages/actions/tsconfig.json | 2 +- packages/cli/package.json | 4 ++-- packages/cli/src/Initializer/constants.ts | 18 +++++++++++------- packages/cli/src/Initializer/frameworks.ts | 14 +++++++------- packages/cli/src/Initializer/index.ts | 8 ++++---- packages/cli/src/commands/build.ts | 4 ++-- packages/cli/src/commands/deploy.ts | 6 +++--- packages/cli/src/commands/init.ts | 9 +++++---- packages/cli/src/commands/package.ts | 4 ++-- packages/cli/src/commands/serve.ts | 6 +++--- packages/cli/src/errors/MissingConfig.ts | 2 +- packages/cli/src/helpers/JSON5Config.ts | 8 +++++++- packages/cli/test/commands/build.test.ts | 2 +- .../cli/test/fixtures/fab.unknown-module.json5 | 2 +- packages/cli/tsconfig.json | 2 +- packages/core/package.json | 2 +- packages/core/src/constants.ts | 6 +++--- packages/core/src/index.ts | 4 ++-- packages/core/src/runtime.ts | 2 +- packages/core/src/types.ts | 4 ++-- packages/core/test/ProtoFab.test.ts | 2 +- packages/core/tsconfig.json | 2 +- packages/deployer-aws-lambda/package.json | 6 +++--- .../deployer-aws-lambda/src/createPackage.ts | 7 ++++++- packages/deployer-aws-lambda/src/deploy.ts | 6 +++--- packages/deployer-aws-lambda/src/utils.ts | 4 ++-- .../deployer-aws-lambda/templates/index.js | 4 ++-- packages/deployer-aws-lambda/tsconfig.json | 2 +- packages/deployer-aws-s3/package.json | 6 +++--- packages/deployer-aws-s3/src/aws.ts | 2 +- packages/deployer-aws-s3/src/index.ts | 2 +- packages/deployer-aws-s3/src/utils.ts | 4 ++-- packages/deployer-aws-s3/tsconfig.json | 2 +- packages/deployer-cf-workers/package.json | 6 +++--- .../deployer-cf-workers/src/createPackage.ts | 4 ++-- packages/deployer-cf-workers/src/deploy.ts | 14 +++++++------- .../src/templateInjections.ts | 2 +- packages/deployer-cf-workers/src/utils.ts | 4 ++-- packages/deployer-cf-workers/tsconfig.json | 2 +- packages/input-nextjs/package.json | 6 +++--- packages/input-nextjs/src/build.ts | 8 ++++---- packages/input-nextjs/src/generateRenderer.ts | 2 +- packages/input-nextjs/src/mergeWebpacks.ts | 2 +- packages/input-nextjs/src/preflightChecks.ts | 2 +- packages/input-nextjs/src/runtime.ts | 2 +- packages/input-nextjs/src/types.ts | 2 +- packages/input-nextjs/tsconfig.json | 2 +- packages/input-static/package.json | 6 +++--- packages/input-static/src/build.ts | 16 +++++++++------- packages/input-static/src/types.ts | 2 +- packages/input-static/test/build.test.ts | 4 ++-- packages/input-static/test/errors.test.ts | 12 ++++++------ packages/input-static/tsconfig.json | 2 +- packages/plugin-precompile/package.json | 6 +++--- packages/plugin-precompile/src/build.ts | 8 ++++---- packages/plugin-precompile/src/types.ts | 2 +- packages/plugin-precompile/tsconfig.json | 2 +- packages/plugin-render-html/package.json | 6 +++--- packages/plugin-render-html/src/build.ts | 10 +++++----- .../plugin-render-html/src/injections/env.ts | 2 +- packages/plugin-render-html/src/runtime.ts | 2 +- packages/plugin-render-html/src/types.ts | 2 +- packages/plugin-render-html/test/build.test.ts | 2 +- .../plugin-render-html/test/runtime.test.ts | 2 +- packages/plugin-render-html/tsconfig.json | 2 +- packages/plugin-rewire-assets/package.json | 6 +++--- packages/plugin-rewire-assets/src/build.ts | 6 +++--- packages/plugin-rewire-assets/src/runtime.ts | 2 +- packages/plugin-rewire-assets/src/types.ts | 2 +- .../plugin-rewire-assets/test/build.test.ts | 2 +- packages/plugin-rewire-assets/tsconfig.json | 2 +- packages/sandbox-node-vm/package.json | 4 ++-- packages/sandbox-node-vm/src/index.ts | 2 +- packages/sandbox-node-vm/tsconfig.json | 2 +- packages/server/package.json | 8 ++++---- packages/server/src/cache.ts | 4 ++-- packages/server/src/index.ts | 14 ++++++++------ packages/server/src/sandboxes/v8-isolate.ts | 2 +- packages/server/tsconfig.json | 2 +- tests/e2e/cli-errors.test.ts | 6 +++--- tests/e2e/create-react-app.test.ts | 6 +++--- .../fab-plugins/add-bundle-id/runtime.ts | 2 +- .../server-side-logic/fab-plugins/cache.ts | 2 +- .../fab-plugins/check-cookie.ts | 2 +- .../server-side-logic/fab-plugins/geolocate.ts | 2 +- .../fab-plugins/hello-world.ts | 2 +- .../server-side-logic/fab-plugins/slowly.ts | 2 +- .../server-side-logic/fab.config.json5 | 8 ++++---- .../server-side-logic/modify-plugin-config.js | 2 +- .../fixtures/server-side-logic/package.json | 14 +++++++------- .../fixtures/static/fab.missing-rewire.json5 | 4 ++-- .../fixtures/static/fab.unknown-module.json5 | 4 ++-- tests/e2e/helpers/index.ts | 2 +- tsconfig.json | 2 +- 113 files changed, 256 insertions(+), 236 deletions(-) diff --git a/lint-staged.config.js b/lint-staged.config.js index 6362c5758..9270453cc 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,12 +1,12 @@ module.exports = { '*.{js,css,json,md,ts}': ['prettier --write', 'git add'], '*.ts': [ - // For some reason, some IDE's auto-import feature will import '@fab/core/src' - // instead of '@fab/core'. This causes really weird TypeScript output. + // For some reason, some IDE's auto-import feature will import '@dev-spendesk/core/src' + // instead of '@dev-spendesk/core'. This causes really weird TypeScript output. (files) => `bash -c "${[ - "echo '=== Change @fab/core/src to @fab/core in the following files: ==='", - `grep -l @fab/core/src ${files.join(' ')}; test $? -eq 1`, + "echo '=== Change @dev-spendesk/core/src to @dev-spendesk/core in the following files: ==='", + `grep -l @dev-spendesk/core/src ${files.join(' ')}; test $? -eq 1`, ].join(' && ')}"`, ], } diff --git a/packages/_fab/fab.js b/packages/_fab/fab.js index f0ab29710..98bcf58ab 100755 --- a/packages/_fab/fab.js +++ b/packages/_fab/fab.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -// This module defers to @fab/cli for all its work, we just use this namespace +// This module defers to @dev-spendesk/cli for all its work, we just use this namespace // so that `npx fab` does what we expect. -require('@fab/cli/bin/run') +require('@dev-spendesk/cli/bin/run') diff --git a/packages/_fab/package.json b/packages/_fab/package.json index 933d07e9b..0b101b16d 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -1,7 +1,7 @@ { "name": "fab", "version": "1.0.0-rc.9", - "description": "An alias for @fab/cli", + "description": "An alias for @dev-spendesk/cli", "keywords": [ "fab" ], @@ -27,7 +27,7 @@ "prepack": "cat PREAMBLE.md > README.md && cat ../cli/README.md >> README.md" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9" + "@dev-spendesk/cli": "1.0.0-rc.9" }, "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" } diff --git a/packages/actions/package.json b/packages/actions/package.json index 3b10ec801..2536e852d 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/actions", + "name": "@dev-spendesk/actions", "version": "1.0.0-rc.9", "private": false, "description": "The guts of the FAB cli code, keeping the 'fab' package lean", @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@rollup/plugin-alias": "^2.2.0", "@rollup/plugin-commonjs": "^11.0.2", "@rollup/plugin-inject": "^4.0.1", diff --git a/packages/actions/src/Builder.ts b/packages/actions/src/Builder.ts index cae94e041..f36be933d 100644 --- a/packages/actions/src/Builder.ts +++ b/packages/actions/src/Builder.ts @@ -1,4 +1,4 @@ -import { LoadedPlugin, RuntimePlugin, FabConfig, ProtoFab } from '@fab/core' +import { LoadedPlugin, RuntimePlugin, FabConfig, ProtoFab } from '@dev-spendesk/core' import { Compiler } from './Compiler' import { Generator } from './Generator' import { Typecheck } from './Typecheck' @@ -8,7 +8,7 @@ import { InvalidConfigError, isRelative, relativeToConfig, -} from '@fab/cli' +} from '@dev-spendesk/cli' import * as path from 'path' const log = _log('Builder') diff --git a/packages/actions/src/Compiler.ts b/packages/actions/src/Compiler.ts index ccf080b4e..ba91e41df 100644 --- a/packages/actions/src/Compiler.ts +++ b/packages/actions/src/Compiler.ts @@ -1,5 +1,5 @@ -import { FabConfig, ProtoFab, RuntimePlugin } from '@fab/core' -import { _log, BuildFailedError } from '@fab/cli' +import { FabConfig, ProtoFab, RuntimePlugin } from '@dev-spendesk/core' +import { _log, BuildFailedError } from '@dev-spendesk/cli' import { rollupCompile } from './rollup' const log = _log(`Compiler`) @@ -16,7 +16,7 @@ export class Compiler { const warnings: string[] = [] const { output: [output, ...chunks], - } = await rollupCompile(require.resolve('@fab/actions/esm/runtime'), { + } = await rollupCompile(require.resolve('@dev-spendesk/actions/esm/runtime'), { minify, output: { format: 'umd', exports: 'named', name: '__fab' }, hypotheticals: { diff --git a/packages/actions/src/Deployer.ts b/packages/actions/src/Deployer.ts index 0360b4d93..8771e80a8 100644 --- a/packages/actions/src/Deployer.ts +++ b/packages/actions/src/Deployer.ts @@ -6,7 +6,7 @@ import { FabDeployerExports, FabSettings, HOSTING_PROVIDERS, -} from '@fab/core' +} from '@dev-spendesk/core' import { _log, FabDeployError, @@ -14,7 +14,7 @@ import { JSON5Config, loadOrInstallModule, loadOrInstallModules, -} from '@fab/cli' +} from '@dev-spendesk/cli' const log = _log('Deployer') diff --git a/packages/actions/src/Generator.ts b/packages/actions/src/Generator.ts index 242c25851..4bea0d6ac 100644 --- a/packages/actions/src/Generator.ts +++ b/packages/actions/src/Generator.ts @@ -1,10 +1,10 @@ -import { ProtoFab } from '@fab/core' +import { ProtoFab } from '@dev-spendesk/core' import fs from 'fs-extra' import path from 'path' import util from 'util' // @ts-ignore import _zip from 'deterministic-zip' -import { _log, BuildFailedError } from '@fab/cli' +import { _log, BuildFailedError } from '@dev-spendesk/cli' import pretty from 'pretty-bytes' const zip = util.promisify(_zip) @@ -17,7 +17,7 @@ export class Generator { if (invalid_reason) { throw new BuildFailedError(`FAB is not ready for compilation. ${invalid_reason} - You might need to add @fab/plugin-rewire-assets to your 'build' config. See https://fab.dev/packages/rewire-assets for more information about what this module is and why it's needed. + You might need to add @dev-spendesk/plugin-rewire-assets to your 'build' config. See https://fab.dev/packages/rewire-assets for more information about what this module is and why it's needed. `) } diff --git a/packages/actions/src/Packager.ts b/packages/actions/src/Packager.ts index 22dc2042d..59ab37d3a 100644 --- a/packages/actions/src/Packager.ts +++ b/packages/actions/src/Packager.ts @@ -5,8 +5,8 @@ import { FabPackagerExports, HOSTING_PROVIDERS, PackageFn, -} from '@fab/core' -import { _log, FabPackageError, loadModule } from '@fab/cli' +} from '@dev-spendesk/core' +import { _log, FabPackageError, loadModule } from '@dev-spendesk/cli' const log = _log(`Packager`) diff --git a/packages/actions/src/Typecheck.ts b/packages/actions/src/Typecheck.ts index cc4325d99..c2ad56e14 100644 --- a/packages/actions/src/Typecheck.ts +++ b/packages/actions/src/Typecheck.ts @@ -1,9 +1,9 @@ -import { _log } from '@fab/cli' +import { _log } from '@dev-spendesk/cli' import execa from 'execa' import path from 'path' import tmp from 'tmp-promise' import fs from 'fs-extra' -import { RuntimePlugin } from '@fab/core' +import { RuntimePlugin } from '@dev-spendesk/core' const log = _log('Typecheck') diff --git a/packages/actions/src/index.ts b/packages/actions/src/index.ts index 60aaa6f15..2d8941fa5 100644 --- a/packages/actions/src/index.ts +++ b/packages/actions/src/index.ts @@ -1,4 +1,4 @@ -import { FabActionsExports } from '@fab/core' +import { FabActionsExports } from '@dev-spendesk/core' import Packager from './Packager' import Deployer from './Deployer' import Builder from './Builder' diff --git a/packages/actions/src/rollup.ts b/packages/actions/src/rollup.ts index 5e9a8af6b..990eaa87d 100644 --- a/packages/actions/src/rollup.ts +++ b/packages/actions/src/rollup.ts @@ -10,7 +10,7 @@ import alias from '@rollup/plugin-alias' // @ts-ignore import hypothetical from 'rollup-plugin-hypothetical' -import { _log } from '@fab/cli' +import { _log } from '@dev-spendesk/cli' const log = _log(`rollup`) export async function rollupCompile( diff --git a/packages/actions/src/runtime/final_responder.ts b/packages/actions/src/runtime/final_responder.ts index 21908b405..720141cd3 100644 --- a/packages/actions/src/runtime/final_responder.ts +++ b/packages/actions/src/runtime/final_responder.ts @@ -3,7 +3,7 @@ import { FabPluginRuntime, NO_RESPONSE_STATUS_CODE, Priority, -} from '@fab/core' +} from '@dev-spendesk/core' const FinalResponder: FabPluginRuntime = ({ Router }: FABRuntime) => { Router.onAll(async ({ url }) => { diff --git a/packages/actions/src/runtime/index.ts b/packages/actions/src/runtime/index.ts index e547037ba..c4e38fa33 100644 --- a/packages/actions/src/runtime/index.ts +++ b/packages/actions/src/runtime/index.ts @@ -12,7 +12,7 @@ import { NO_RESPONSE_STATUS_CODE, ResponseInterceptor, RuntimeImports, -} from '@fab/core' +} from '@dev-spendesk/core' import final_responder from './final_responder' // @ts-ignore diff --git a/packages/actions/test/actions/Builder.test.ts b/packages/actions/test/actions/Builder.test.ts index 81091c568..de1cf2252 100644 --- a/packages/actions/test/actions/Builder.test.ts +++ b/packages/actions/test/actions/Builder.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai' import Builder from '../../src/Builder' -import { JSON5Config } from '@fab/cli' +import { JSON5Config } from '@dev-spendesk/cli' import path from 'path' import { captureStdout } from '../helpers' diff --git a/packages/actions/test/actions/Compiler.test.ts b/packages/actions/test/actions/Compiler.test.ts index 7b0e862a0..808f42cb5 100644 --- a/packages/actions/test/actions/Compiler.test.ts +++ b/packages/actions/test/actions/Compiler.test.ts @@ -1,8 +1,8 @@ import { expect } from 'chai' import { Compiler } from '../../src/Compiler' -import { JSON5Config } from '@fab/cli' +import { JSON5Config } from '@dev-spendesk/cli' import { captureStdout } from '../helpers' -import { ProtoFab } from '@fab/core' +import { ProtoFab } from '@dev-spendesk/core' describe('Compiler', function() { this.timeout(10000) diff --git a/packages/actions/test/fixtures/plugins/typescript-example/build.ts b/packages/actions/test/fixtures/plugins/typescript-example/build.ts index 95fc5717d..c70aba19e 100644 --- a/packages/actions/test/fixtures/plugins/typescript-example/build.ts +++ b/packages/actions/test/fixtures/plugins/typescript-example/build.ts @@ -1,4 +1,4 @@ -import { FabBuildStep } from '@fab/core' +import { FabBuildStep } from '@dev-spendesk/core' import { TsExampleMetadata, TsExampleArgs } from './types' export const build: FabBuildStep = async ( diff --git a/packages/actions/test/fixtures/plugins/typescript-example/runtime.ts b/packages/actions/test/fixtures/plugins/typescript-example/runtime.ts index 87ddafbbf..660b2e2aa 100644 --- a/packages/actions/test/fixtures/plugins/typescript-example/runtime.ts +++ b/packages/actions/test/fixtures/plugins/typescript-example/runtime.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@fab/core' +import { FABRuntime } from '@dev-spendesk/core' import { TsExampleArgs, TsExampleMetadata } from './types' export default function TypescriptExampleRuntime( diff --git a/packages/actions/test/fixtures/plugins/typescript-example/types.ts b/packages/actions/test/fixtures/plugins/typescript-example/types.ts index 675a0bd03..c5f6762e7 100644 --- a/packages/actions/test/fixtures/plugins/typescript-example/types.ts +++ b/packages/actions/test/fixtures/plugins/typescript-example/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@fab/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' export interface TsExampleArgs extends PluginArgs { the_time_is: string diff --git a/packages/actions/tsconfig.json b/packages/actions/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/actions/tsconfig.json +++ b/packages/actions/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/cli/package.json b/packages/cli/package.json index 6bad865bf..b4d90fab8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/cli", + "name": "@dev-spendesk/cli", "version": "1.0.0-rc.9", "description": "The CLI entry-point for the FAB ecosystem", "keywords": [ @@ -35,7 +35,7 @@ "version": "oclif-dev readme && git add README.md" }, "dependencies": { - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/errors": "^1", diff --git a/packages/cli/src/Initializer/constants.ts b/packages/cli/src/Initializer/constants.ts index fd9744dc2..b6f8cd88a 100644 --- a/packages/cli/src/Initializer/constants.ts +++ b/packages/cli/src/Initializer/constants.ts @@ -1,11 +1,15 @@ -export const DEFAULT_DEPS = ['@fab/cli', '@fab/server', '@fab/actions'] +export const DEFAULT_DEPS = [ + '@dev-spendesk/cli', + '@dev-spendesk/server', + '@dev-spendesk/actions', +] export const DEPRECATED_PACKAGES = [ - '@fab/static', - '@fab/compile', - '@fab/nextjs', - '@fab/serve', - '@fab/serve-html', - '@fab/rewire-assets', + '@dev-spendesk/static', + '@dev-spendesk/compile', + '@dev-spendesk/nextjs', + '@dev-spendesk/serve', + '@dev-spendesk/serve-html', + '@dev-spendesk/rewire-assets', ] export const GITIGNORE_LINES = ['/.fab', '/fab.zip'] diff --git a/packages/cli/src/Initializer/frameworks.ts b/packages/cli/src/Initializer/frameworks.ts index b2e1bb3b5..275d19793 100644 --- a/packages/cli/src/Initializer/frameworks.ts +++ b/packages/cli/src/Initializer/frameworks.ts @@ -1,4 +1,4 @@ -import { BuildConfig } from '@fab/core' +import { BuildConfig } from '@dev-spendesk/core' import path from 'path' import fs from 'fs-extra' import { log } from './utils' @@ -9,13 +9,13 @@ const static_plugin_chain = ( dir: string, fallback: string | boolean = '/index.html' ) => ({ - '@fab/input-static': { + '@dev-spendesk/input-static': { dir, }, - '@fab/plugin-render-html': { + '@dev-spendesk/plugin-render-html': { fallback, }, - '@fab/plugin-rewire-assets': {}, + '@dev-spendesk/plugin-rewire-assets': {}, }) export type FrameworkInfo = { @@ -90,13 +90,13 @@ export const Frameworks = { plugins: export_build ? static_plugin_chain('out') : { - '@fab/input-nextjs': { + '@dev-spendesk/input-nextjs': { dir: '.next', }, - '@fab/plugin-render-html': { + '@dev-spendesk/plugin-render-html': { fallback: false, }, - '@fab/plugin-rewire-assets': {}, + '@dev-spendesk/plugin-rewire-assets': {}, }, async customConfig(root_dir: string) { if (export_build) return [] diff --git a/packages/cli/src/Initializer/index.ts b/packages/cli/src/Initializer/index.ts index 6400b7bb6..565200c8c 100644 --- a/packages/cli/src/Initializer/index.ts +++ b/packages/cli/src/Initializer/index.ts @@ -16,7 +16,7 @@ import { } from './constants' import { FRAMEWORK_NAMES, FrameworkInfo, Frameworks, GenericStatic } from './frameworks' import { log, mergeScriptsAfterBuild } from './utils' -import { BuildConfig } from '@fab/core' +import { BuildConfig } from '@dev-spendesk/core' import execa from 'execa' import fetch from 'cross-fetch' @@ -39,7 +39,7 @@ const promptWithDefault = async ( } const getLatestFabCli = async () => { - const response = await fetch('https://registry.npmjs.org/@fab/cli/latest') + const response = await fetch('https://registry.npmjs.org/@dev-spendesk/cli/latest') const data = await response.json() if (data && data.version) { const installed = JSON.parse( @@ -47,7 +47,7 @@ const getLatestFabCli = async () => { ) if (installed.version !== data.version) { log( - `๐Ÿ’šNOTE๐Ÿ’š: You have ๐Ÿ–ค@fab/cli๐Ÿ–ค ๐Ÿ’›${installed.version}๐Ÿ’›, latest available on NPM is ๐Ÿ’›${data.version}๐Ÿ’›.` + `๐Ÿ’šNOTE๐Ÿ’š: You have ๐Ÿ–ค@dev-spendesk/cli๐Ÿ–ค ๐Ÿ’›${installed.version}๐Ÿ’›, latest available on NPM is ๐Ÿ’›${data.version}๐Ÿ’›.` ) } } @@ -149,7 +149,7 @@ export default class Initializer { โ€ข Generate a ๐Ÿ’›fab.config.json5๐Ÿ’› file for your project โ€ข Add ๐Ÿ’›build:fab๐Ÿ’› and related scripts to your ๐Ÿ’›package.json๐Ÿ’› โ€ข Add ๐Ÿ’›.fab๐Ÿ’› and ๐Ÿ’›fab.zip๐Ÿ’› to your ๐Ÿ’›.gitignore๐Ÿ’› - โ€ข Install ๐Ÿ’›@fab/cli๐Ÿ’› and related dependencies using ๐Ÿ’›${ + โ€ข Install ๐Ÿ’›@dev-spendesk/cli๐Ÿ’› and related dependencies using ๐Ÿ’›${ use_yarn ? 'yarn' : 'npm' }๐Ÿ’›`) const confirmed = await log.confirmAndRespond(`Good to go? [y/N]`) diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts index 13106a0fa..bad82fc8c 100644 --- a/packages/cli/src/commands/build.ts +++ b/packages/cli/src/commands/build.ts @@ -1,5 +1,5 @@ import { Command, flags } from '@oclif/command' -import { DEFAULT_CONFIG_FILENAME, FabActionsExports } from '@fab/core' +import { DEFAULT_CONFIG_FILENAME, FabActionsExports } from '@dev-spendesk/core' import { JSON5Config } from '../' import { watcher } from '../helpers/watcher' @@ -40,7 +40,7 @@ export default class Build extends Command { async run() { const { args, flags } = this.parse(Build) - const { Builder } = require('@fab/actions').default as FabActionsExports + const { Builder } = require('@dev-spendesk/actions').default as FabActionsExports await watcher(flags.watch, async () => { const config = await JSON5Config.readFrom(flags.config!) diff --git a/packages/cli/src/commands/deploy.ts b/packages/cli/src/commands/deploy.ts index 60f750385..1ec85f486 100644 --- a/packages/cli/src/commands/deploy.ts +++ b/packages/cli/src/commands/deploy.ts @@ -4,7 +4,7 @@ import { DeployProviders, FabActionsExports, HOSTING_PROVIDERS, -} from '@fab/core' +} from '@dev-spendesk/core' import { JSON5Config } from '../' import fs from 'fs-extra' @@ -47,7 +47,7 @@ export default class Deploy extends Command { }), 'auto-install': flags.boolean({ description: - 'If you need dependent packages (e.g. @fab/deploy-*), install them without prompting', + 'If you need dependent packages (e.g. @dev-spendesk/deploy-*), install them without prompting', }), } @@ -74,7 +74,7 @@ export default class Deploy extends Command { const file = specified_file || default_file const config = await JSON5Config.readFrom(flags.config!) - const { Deployer } = require('@fab/actions').default as FabActionsExports + const { Deployer } = require('@dev-spendesk/actions').default as FabActionsExports await Deployer.deploy( config, file, diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 9e6ef03ec..97d5c1649 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -1,5 +1,5 @@ import { Command, flags } from '@oclif/command' -import { DEFAULT_CONFIG_FILENAME } from '@fab/core' +import { DEFAULT_CONFIG_FILENAME } from '@dev-spendesk/core' import Initializer from '../Initializer' export default class Init extends Command { @@ -28,9 +28,10 @@ export default class Init extends Command { 'skip-framework-detection': flags.boolean({ description: "Don't try to auto-detect framework, set up manually.", }), - 'empty': flags.boolean({ - description: "Install the packages and create an empty fab.config.json5 (implies -y)" - }) + empty: flags.boolean({ + description: + 'Install the packages and create an empty fab.config.json5 (implies -y)', + }), } static args = [] diff --git a/packages/cli/src/commands/package.ts b/packages/cli/src/commands/package.ts index 6d45d6dfe..27fabf7d7 100644 --- a/packages/cli/src/commands/package.ts +++ b/packages/cli/src/commands/package.ts @@ -3,7 +3,7 @@ import { DeployProviders, FabActionsExports, HOSTING_PROVIDERS, -} from '@fab/core' +} from '@dev-spendesk/core' import { Command, flags } from '@oclif/command' import { JSON5Config } from '../' @@ -50,7 +50,7 @@ export default class Deploy extends Command { this.error(`You must provide a target. Available options: ${hosts.join(', ')}`) } const config = await JSON5Config.readFrom(flags.config!) - const { Packager } = require('@fab/actions').default as FabActionsExports + const { Packager } = require('@dev-spendesk/actions').default as FabActionsExports await Packager.package( file, config.data, diff --git a/packages/cli/src/commands/serve.ts b/packages/cli/src/commands/serve.ts index b6666901c..dff013262 100644 --- a/packages/cli/src/commands/serve.ts +++ b/packages/cli/src/commands/serve.ts @@ -4,7 +4,7 @@ import { SandboxType, ServerArgs, FabServerExports, -} from '@fab/core' +} from '@dev-spendesk/core' import { loadOrInstallModule, _log } from '../helpers' import fs from 'fs-extra' const log = _log(`Server`) @@ -49,7 +49,7 @@ export default class Serve extends Command { }), 'auto-install': flags.boolean({ description: - 'If you need dependent packages (e.g. @fab/serve), install them without prompting', + 'If you need dependent packages (e.g. @dev-spendesk/serve), install them without prompting', }), watch: flags.boolean({ description: @@ -84,7 +84,7 @@ export default class Serve extends Command { log.announce(`fab serve`) const server_pkg = ( - await loadOrInstallModule(log, '@fab/server', flags['auto-install']) + await loadOrInstallModule(log, '@dev-spendesk/server', flags['auto-install']) ).default as FabServerExports const server = server_pkg.createServer(file, flags as ServerArgs) await server.serve( diff --git a/packages/cli/src/errors/MissingConfig.ts b/packages/cli/src/errors/MissingConfig.ts index acb23c122..bdbff421e 100644 --- a/packages/cli/src/errors/MissingConfig.ts +++ b/packages/cli/src/errors/MissingConfig.ts @@ -1,5 +1,5 @@ import * as path from 'path' -import { DEFAULT_CONFIG_FILENAME } from '@fab/core' +import { DEFAULT_CONFIG_FILENAME } from '@dev-spendesk/core' import { log } from '../helpers' export class MissingConfig extends Error { diff --git a/packages/cli/src/helpers/JSON5Config.ts b/packages/cli/src/helpers/JSON5Config.ts index a55c1212e..5f486156a 100644 --- a/packages/cli/src/helpers/JSON5Config.ts +++ b/packages/cli/src/helpers/JSON5Config.ts @@ -1,5 +1,11 @@ import fs from 'fs-extra' -import { a_sume, FabConfig, REGEXP_VALUE_PATTERN, s_sume, JSON5ConfigI } from '@fab/core' +import { + a_sume, + FabConfig, + REGEXP_VALUE_PATTERN, + s_sume, + JSON5ConfigI, +} from '@dev-spendesk/core' import jju from 'jju' import regexParser from 'regex-parser' import { InvalidConfigError, MissingConfig } from '../errors' diff --git a/packages/cli/test/commands/build.test.ts b/packages/cli/test/commands/build.test.ts index 6486076a7..420ab0a00 100644 --- a/packages/cli/test/commands/build.test.ts +++ b/packages/cli/test/commands/build.test.ts @@ -64,7 +64,7 @@ describe('build', () => { expect(err.message).to.contain('Config file contains errors!') }) .it('should report that the module cannot be found', (ctx) => { - expect(ctx.stdout).to.contain(`Cannot find module '@fab/no-existo'`) + expect(ctx.stdout).to.contain(`Cannot find module '@dev-spendesk/no-existo'`) expect(ctx.stdout).to.contain(`Are you sure it's installed?`) }) diff --git a/packages/cli/test/fixtures/fab.unknown-module.json5 b/packages/cli/test/fixtures/fab.unknown-module.json5 index ab52b3daf..d5ddefb07 100644 --- a/packages/cli/test/fixtures/fab.unknown-module.json5 +++ b/packages/cli/test/fixtures/fab.unknown-module.json5 @@ -1,6 +1,6 @@ { plugins: { - '@fab/no-existo': { + '@dev-spendesk/no-existo': { other: 'ag', }, }, diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/core/package.json b/packages/core/package.json index e4a52c1bf..3249ce9a4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/core", + "name": "@dev-spendesk/core", "version": "1.0.0-rc.9", "private": false, "description": "Common code for all FAB projects", diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 034ad240c..1a574a69d 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -54,7 +54,7 @@ export const HOSTING_PROVIDERS: { [key: string]: HostingProvider } = { 'cf-workers': { - package_name: '@fab/deployer-cf-workers', + package_name: '@dev-spendesk/deployer-cf-workers', capabilities: { server: true, assets: true, @@ -63,7 +63,7 @@ export const HOSTING_PROVIDERS: { extension: 'js', }, 'aws-lambda-edge': { - package_name: '@fab/deployer-aws-lambda', + package_name: '@dev-spendesk/deployer-aws-lambda', capabilities: { server: true, assets: false, @@ -72,7 +72,7 @@ export const HOSTING_PROVIDERS: { extension: 'zip', }, 'aws-s3': { - package_name: '@fab/deployer-aws-s3', + package_name: '@dev-spendesk/deployer-aws-s3', capabilities: { server: false, assets: true, diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index ad29c331a..ab9c93117 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,10 +1,10 @@ /* - * @fab/core: Type definitions and helper methods + * @dev-spendesk/core: Type definitions and helper methods * * Be careful what you import in this project, everything needs to be Rollup-compatible * and runnable inside a FAB, since FAB runtime components will import this. * - * For build-time-specific code, use @fab/cli + * For build-time-specific code, use @dev-spendesk/cli * * */ diff --git a/packages/core/src/runtime.ts b/packages/core/src/runtime.ts index b118732dd..e9faa19ac 100644 --- a/packages/core/src/runtime.ts +++ b/packages/core/src/runtime.ts @@ -10,7 +10,7 @@ import { FABServerContext, PluginArgs, ResponseInterceptor, -} from '@fab/core' +} from '@dev-spendesk/core' import { Key, pathToRegexp } from 'path-to-regexp' export enum Priority { diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 0b8767ff2..70af395cc 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -151,8 +151,8 @@ export enum SandboxType { /* * The outermost FAB exported functions, that cross the boundary - * between the platform-specific runtimes (@fab/server, - * @fab/cf-workers-wrapper, Linc.sh etc) and the FAB itself. + * between the platform-specific runtimes (@dev-spendesk/server, + * @dev-spendesk/cf-workers-wrapper, Linc.sh etc) and the FAB itself. * */ export type FabSpecRender = ( request: Request, diff --git a/packages/core/test/ProtoFab.test.ts b/packages/core/test/ProtoFab.test.ts index 9ce02470e..c4cedb567 100644 --- a/packages/core/test/ProtoFab.test.ts +++ b/packages/core/test/ProtoFab.test.ts @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { ProtoFab } from '@fab/core' +import { ProtoFab } from '@dev-spendesk/core' describe('ProtoFab', () => { it('should be able to be created with no args', () => { diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/deployer-aws-lambda/package.json b/packages/deployer-aws-lambda/package.json index 242c76278..ab80e38a3 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/deployer-aws-lambda", + "name": "@dev-spendesk/deployer-aws-lambda", "version": "1.0.0-rc.9", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@types/nanoid": "^2.1.0", "@types/node": "^12.12.14", "deterministic-zip": "^1.1.0", diff --git a/packages/deployer-aws-lambda/src/createPackage.ts b/packages/deployer-aws-lambda/src/createPackage.ts index 4f8127a09..e39188b9c 100644 --- a/packages/deployer-aws-lambda/src/createPackage.ts +++ b/packages/deployer-aws-lambda/src/createPackage.ts @@ -1,4 +1,9 @@ -import { ConfigTypes, FabPackager, FabSettings, stripTrailingSlash } from '@fab/core' +import { + ConfigTypes, + FabPackager, + FabSettings, + stripTrailingSlash, +} from '@dev-spendesk/core' import fs from 'fs-extra' import path from 'path' import nanoid from 'nanoid' diff --git a/packages/deployer-aws-lambda/src/deploy.ts b/packages/deployer-aws-lambda/src/deploy.ts index a55d0a9a2..b99be1030 100644 --- a/packages/deployer-aws-lambda/src/deploy.ts +++ b/packages/deployer-aws-lambda/src/deploy.ts @@ -1,7 +1,7 @@ -import { ConfigTypes, FabServerDeployer, FabSettings } from '@fab/core' +import { ConfigTypes, FabServerDeployer, FabSettings } from '@dev-spendesk/core' import { createPackage } from './createPackage' import path from 'path' -import { InvalidConfigError } from '@fab/cli' +import { InvalidConfigError } from '@dev-spendesk/cli' import { updateCloudFront, updateLambda } from './aws' import { log } from './utils' @@ -32,7 +32,7 @@ export const deployServer: FabServerDeployer = async ( ] const missing_config = required_keys.filter((k) => !config[k]) if (missing_config.length > 0) { - throw new InvalidConfigError(`Missing required keys for @fab/deploy-aws-lambda: + throw new InvalidConfigError(`Missing required keys for @dev-spendesk/deploy-aws-lambda: ${missing_config.map((k) => `๐Ÿ’›โ€ข ${k}๐Ÿ’›`).join('\n')}`) } diff --git a/packages/deployer-aws-lambda/src/utils.ts b/packages/deployer-aws-lambda/src/utils.ts index 1f3057a89..2747e9b4f 100644 --- a/packages/deployer-aws-lambda/src/utils.ts +++ b/packages/deployer-aws-lambda/src/utils.ts @@ -1,3 +1,3 @@ -import { _log } from '@fab/cli' +import { _log } from '@dev-spendesk/cli' -export const log = _log(`@fab/deployer-aws-lambda`) +export const log = _log(`@dev-spendesk/deployer-aws-lambda`) diff --git a/packages/deployer-aws-lambda/templates/index.js b/packages/deployer-aws-lambda/templates/index.js index 0ee677ceb..f175638e7 100644 --- a/packages/deployer-aws-lambda/templates/index.js +++ b/packages/deployer-aws-lambda/templates/index.js @@ -23,9 +23,9 @@ const enhanced_fetch = (url, init) => { return node_fetch(url, init) } -// Currently copied from @fab/server. In the future, if the caching layer becomes +// Currently copied from @dev-spendesk/server. In the future, if the caching layer becomes // configurable for a deploy (e.g. ElastiCache), then this should be moved to a -// @fab/cache-node-inmemory package alongside a @fab/cache-aws-elasticache one. +// @dev-spendesk/cache-node-inmemory package alongside a @dev-spendesk/cache-aws-elasticache one. class Cache { constructor() { diff --git a/packages/deployer-aws-lambda/tsconfig.json b/packages/deployer-aws-lambda/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/deployer-aws-lambda/tsconfig.json +++ b/packages/deployer-aws-lambda/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/deployer-aws-s3/package.json b/packages/deployer-aws-s3/package.json index 23d4f1027..50b5e515d 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/deployer-aws-s3", + "name": "@dev-spendesk/deployer-aws-s3", "version": "1.0.0-rc.9", "description": "Uploads FAB assets to AWS S3", "keywords": [ @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@types/node": "^12.12.14", "aws-sdk": "^2.655.0", "fs-extra": "^9.0.0", diff --git a/packages/deployer-aws-s3/src/aws.ts b/packages/deployer-aws-s3/src/aws.ts index a6a51bb5d..44fca79dc 100644 --- a/packages/deployer-aws-s3/src/aws.ts +++ b/packages/deployer-aws-s3/src/aws.ts @@ -1,6 +1,6 @@ import aws from 'aws-sdk' import { ReadStream } from 'fs' -import { IMMUTABLE_HEADERS } from '@fab/core' +import { IMMUTABLE_HEADERS } from '@dev-spendesk/core' export function authenticate( region: string, diff --git a/packages/deployer-aws-s3/src/index.ts b/packages/deployer-aws-s3/src/index.ts index 08f65550c..5bdabb93c 100644 --- a/packages/deployer-aws-s3/src/index.ts +++ b/packages/deployer-aws-s3/src/index.ts @@ -1,4 +1,4 @@ -import { ConfigTypes, FabAssetsDeployer, getContentType } from '@fab/core' +import { ConfigTypes, FabAssetsDeployer, getContentType } from '@dev-spendesk/core' import { nanoid } from 'nanoid' import path from 'path' import fs from 'fs-extra' diff --git a/packages/deployer-aws-s3/src/utils.ts b/packages/deployer-aws-s3/src/utils.ts index 7aac13d4d..96b65567f 100644 --- a/packages/deployer-aws-s3/src/utils.ts +++ b/packages/deployer-aws-s3/src/utils.ts @@ -1,3 +1,3 @@ -import { _log } from '@fab/cli' +import { _log } from '@dev-spendesk/cli' -export const log = _log('@fab/deployer-aws-s3') +export const log = _log('@dev-spendesk/deployer-aws-s3') diff --git a/packages/deployer-aws-s3/tsconfig.json b/packages/deployer-aws-s3/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/deployer-aws-s3/tsconfig.json +++ b/packages/deployer-aws-s3/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/deployer-cf-workers/package.json b/packages/deployer-cf-workers/package.json index 299fbf6ea..16cd5c73d 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/deployer-cf-workers", + "name": "@dev-spendesk/deployer-cf-workers", "version": "1.0.0-rc.9", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@types/node": "^12.12.14", "cross-fetch": "^3.0.6", "file-to-sha512": "^0.0.1", diff --git a/packages/deployer-cf-workers/src/createPackage.ts b/packages/deployer-cf-workers/src/createPackage.ts index 8735772c4..19d87a9d5 100644 --- a/packages/deployer-cf-workers/src/createPackage.ts +++ b/packages/deployer-cf-workers/src/createPackage.ts @@ -1,5 +1,5 @@ -import { ConfigTypes, FabPackager, FabSettings } from '@fab/core' -import { FabPackageError } from '@fab/cli' +import { ConfigTypes, FabPackager, FabSettings } from '@dev-spendesk/core' +import { FabPackageError } from '@dev-spendesk/cli' import { log } from './utils' import path from 'path' diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index eac11a8d2..8bd0b69f6 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -5,9 +5,9 @@ import { FabServerDeployer, FabSettings, getContentType, -} from '@fab/core' +} from '@dev-spendesk/core' import { CloudflareApi, getCloudflareApi, log } from './utils' -import { FabDeployError, InvalidConfigError } from '@fab/cli' +import { FabDeployError, InvalidConfigError } from '@dev-spendesk/cli' import { createPackage } from './createPackage' import path from 'path' import fs from 'fs-extra' @@ -159,7 +159,7 @@ function checkValidityForWorkersDev(config: ConfigTypes.CFWorkers) { ] const missing_config = required_keys.filter((k) => !config[k]) if (missing_config.length > 0) { - throw new InvalidConfigError(`Missing required keys for @fab/deploy-cf-workers (with ๐Ÿ’›workers_dev: true๐Ÿ’›): + throw new InvalidConfigError(`Missing required keys for @dev-spendesk/deploy-cf-workers (with ๐Ÿ’›workers_dev: true๐Ÿ’›): ${missing_config.map((k) => `๐Ÿ’›โ€ข ${k}๐Ÿ’›`).join('\n')}`) } const ignored_keys: Array = ['zone_id', 'route'] @@ -191,25 +191,25 @@ function checkValidityForZoneRoutes( (missing_config[0] === 'route' || missing_config[0] === 'routes') ) ) { - throw new InvalidConfigError(`Missing required keys for @fab/deploy-cf-workers (with ๐Ÿ’›workers_dev: false๐Ÿ’›): + throw new InvalidConfigError(`Missing required keys for @dev-spendesk/deploy-cf-workers (with ๐Ÿ’›workers_dev: false๐Ÿ’›): ${missing_config.map((k) => `๐Ÿ’›โ€ข ${k}๐Ÿ’›`).join('\n')}`) } } if ('routes' in config && 'route' in config) { throw new InvalidConfigError( - 'You can have either `routes` or `route` in config for @fab/deploy-cf-workers' + 'You can have either `routes` or `route` in config for @dev-spendesk/deploy-cf-workers' ) } if ('routes' in config) { let routes: string[] = config['routes'] if (!Array.isArray(routes)) { throw new InvalidConfigError( - 'value for `routes` key of @fab/deploy-cf-workers config should be an Array' + 'value for `routes` key of @dev-spendesk/deploy-cf-workers config should be an Array' ) } if ([...new Set(routes)].length !== routes.length) { throw new InvalidConfigError( - 'Duplicate item in value for `routes` key of @fab/deploy-cf-workers config' + 'Duplicate item in value for `routes` key of @dev-spendesk/deploy-cf-workers config' ) } } diff --git a/packages/deployer-cf-workers/src/templateInjections.ts b/packages/deployer-cf-workers/src/templateInjections.ts index f0509a9aa..1805046af 100644 --- a/packages/deployer-cf-workers/src/templateInjections.ts +++ b/packages/deployer-cf-workers/src/templateInjections.ts @@ -1,4 +1,4 @@ -import { FABServerContext, FabSettings } from '@fab/core' +import { FABServerContext, FabSettings } from '@dev-spendesk/core' // language=JavaScript export default ( diff --git a/packages/deployer-cf-workers/src/utils.ts b/packages/deployer-cf-workers/src/utils.ts index dc6ead00f..c31dc0a19 100644 --- a/packages/deployer-cf-workers/src/utils.ts +++ b/packages/deployer-cf-workers/src/utils.ts @@ -1,5 +1,5 @@ -import { _log, InvalidConfigError, FabDeployError } from '@fab/cli' -export const log = _log(`@fab/deployer-cf-workers`) +import { _log, InvalidConfigError, FabDeployError } from '@dev-spendesk/cli' +export const log = _log(`@dev-spendesk/deployer-cf-workers`) import fetch from 'cross-fetch' diff --git a/packages/deployer-cf-workers/tsconfig.json b/packages/deployer-cf-workers/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/deployer-cf-workers/tsconfig.json +++ b/packages/deployer-cf-workers/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/input-nextjs/package.json b/packages/input-nextjs/package.json index 6e6f5bea7..4cc03e879 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/input-nextjs", + "name": "@dev-spendesk/input-nextjs", "version": "1.0.0-rc.9", "description": "Module to kick off a FAB build from a NextJS project", "keywords": [ @@ -34,8 +34,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@types/node": "^12.12.14", "@types/path-to-regexp": "^1.7.0", "acorn": "^7.1.0", diff --git a/packages/input-nextjs/src/build.ts b/packages/input-nextjs/src/build.ts index 6769104a1..0bce0faf4 100644 --- a/packages/input-nextjs/src/build.ts +++ b/packages/input-nextjs/src/build.ts @@ -1,14 +1,14 @@ import { InputNextJSArgs, InputNextJSMetadata } from './types' -import { FabBuildStep } from '@fab/core' +import { FabBuildStep } from '@dev-spendesk/core' import path from 'path' -import { InvalidConfigError, _log } from '@fab/cli' +import { InvalidConfigError, _log } from '@dev-spendesk/cli' import { preflightChecks } from './preflightChecks' import globby from 'globby' import fs from 'fs-extra' import generateRenderer from './generateRenderer' import webpack from 'webpack' -const log = _log(`@fab/input-nextjs`) +const log = _log(`@dev-spendesk/input-nextjs`) // @ts-ignore import md5dir from 'md5-dir/promise' @@ -25,7 +25,7 @@ export const build: FabBuildStep = async ( // const { dir } = args if (proto_fab.files!.size > 0) { throw new InvalidConfigError( - `@fab/input-nextjs must be the first 'input' plugin in the chain.` + `@dev-spendesk/input-nextjs must be the first 'input' plugin in the chain.` ) } diff --git a/packages/input-nextjs/src/generateRenderer.ts b/packages/input-nextjs/src/generateRenderer.ts index f51deccaa..14d6c59f5 100644 --- a/packages/input-nextjs/src/generateRenderer.ts +++ b/packages/input-nextjs/src/generateRenderer.ts @@ -1,7 +1,7 @@ import { mergeWebpacks } from './mergeWebpacks' import path from 'path' import fs from 'fs-extra' -import { FabFilesObject } from '@fab/core' +import { FabFilesObject } from '@dev-spendesk/core' export default async function generateRenderer( js_renderers: string[], diff --git a/packages/input-nextjs/src/mergeWebpacks.ts b/packages/input-nextjs/src/mergeWebpacks.ts index 68ab03248..d794fb31e 100644 --- a/packages/input-nextjs/src/mergeWebpacks.ts +++ b/packages/input-nextjs/src/mergeWebpacks.ts @@ -9,7 +9,7 @@ * where 'Cq4J' and 'C7Cc' are the default exports of those two files respectively. * */ -import { FabFilesObject } from '@fab/core' +import { FabFilesObject } from '@dev-spendesk/core' import * as acorn from 'acorn' import assert from 'assert' // @ts-ignore diff --git a/packages/input-nextjs/src/preflightChecks.ts b/packages/input-nextjs/src/preflightChecks.ts index 66f78f92a..1bfb67bb0 100644 --- a/packages/input-nextjs/src/preflightChecks.ts +++ b/packages/input-nextjs/src/preflightChecks.ts @@ -1,7 +1,7 @@ import fs from 'fs-extra' import chalk from 'chalk' import path from 'path' -import { BuildFailedError } from '@fab/cli' +import { BuildFailedError } from '@dev-spendesk/cli' export async function preflightChecks( dir: string diff --git a/packages/input-nextjs/src/runtime.ts b/packages/input-nextjs/src/runtime.ts index 3a9d46e74..40e8777fc 100644 --- a/packages/input-nextjs/src/runtime.ts +++ b/packages/input-nextjs/src/runtime.ts @@ -1,7 +1,7 @@ // @ts-ignore import __generated from 'generated-nextjs-renderers.js' import { pathToRegexp } from 'path-to-regexp' -import { FABRuntime, NO_RESPONSE_STATUS_CODE, Priority } from '@fab/core' +import { FABRuntime, NO_RESPONSE_STATUS_CODE, Priority } from '@dev-spendesk/core' const { renderers, MockExpressResponse, MockReq } = __generated diff --git a/packages/input-nextjs/src/types.ts b/packages/input-nextjs/src/types.ts index 2d7b6a8fa..3dd0b2f9f 100644 --- a/packages/input-nextjs/src/types.ts +++ b/packages/input-nextjs/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@fab/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' export interface InputNextJSArgs extends PluginArgs {} diff --git a/packages/input-nextjs/tsconfig.json b/packages/input-nextjs/tsconfig.json index 674bd7ec1..586158eab 100644 --- a/packages/input-nextjs/tsconfig.json +++ b/packages/input-nextjs/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] }, "allowJs": true }, diff --git a/packages/input-static/package.json b/packages/input-static/package.json index 9085db554..bc1350b49 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/input-static", + "name": "@dev-spendesk/input-static", "version": "1.0.0-rc.9", "description": "Module to handle a directory of HTML & assets", "keywords": [ @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@types/node": "^12.12.14", "fs-extra": "^8.1.0", "globby": "^10" diff --git a/packages/input-static/src/build.ts b/packages/input-static/src/build.ts index aaa3da37c..28c980526 100644 --- a/packages/input-static/src/build.ts +++ b/packages/input-static/src/build.ts @@ -1,11 +1,11 @@ import { InputStaticArgs, InputStaticMetadata } from './types' -import { FabBuildStep } from '@fab/core' +import { FabBuildStep } from '@dev-spendesk/core' import fs from 'fs-extra' import globby from 'globby' import path from 'path' -import { InvalidConfigError, relativeToConfig } from '@fab/cli' -import { _log } from '@fab/cli' -const log = _log(`@fab/input-static`) +import { InvalidConfigError, relativeToConfig } from '@dev-spendesk/cli' +import { _log } from '@dev-spendesk/cli' +const log = _log(`@dev-spendesk/input-static`) export const build: FabBuildStep = async ( args, @@ -16,19 +16,21 @@ export const build: FabBuildStep = async ( const { dir } = args if (!dir) { - throw new InvalidConfigError(`@fab/input-static requires an argument of 'dir'.`) + throw new InvalidConfigError( + `@dev-spendesk/input-static requires an argument of 'dir'.` + ) } const abs_dir = relativeToConfig(config_path, dir, false) if (!(await fs.pathExists(abs_dir))) { throw new InvalidConfigError( - `@fab/input-static specifies a 'dir' of '${dir}', which doesn't exist.` + `@dev-spendesk/input-static specifies a 'dir' of '${dir}', which doesn't exist.` ) } if (proto_fab.files!.size > 0) { throw new InvalidConfigError( - `@fab/input-static must be the first 'input' plugin in the chain.` + `@dev-spendesk/input-static must be the first 'input' plugin in the chain.` ) } diff --git a/packages/input-static/src/types.ts b/packages/input-static/src/types.ts index 1020f039e..21ab90cdd 100644 --- a/packages/input-static/src/types.ts +++ b/packages/input-static/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@fab/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' export interface InputStaticArgs extends PluginArgs { dir: string diff --git a/packages/input-static/test/build.test.ts b/packages/input-static/test/build.test.ts index 98a6ae476..d3efcbe1c 100644 --- a/packages/input-static/test/build.test.ts +++ b/packages/input-static/test/build.test.ts @@ -1,8 +1,8 @@ import { expect } from 'chai' -import { PluginMetadata, ProtoFab } from '@fab/core' +import { PluginMetadata, ProtoFab } from '@dev-spendesk/core' import { build } from '../src/build' -describe('@fab/input-static', () => { +describe('@dev-spendesk/input-static', () => { it('should be a function', () => { expect(build).to.be.a('function') }) diff --git a/packages/input-static/test/errors.test.ts b/packages/input-static/test/errors.test.ts index b668ca173..01ec137ec 100644 --- a/packages/input-static/test/errors.test.ts +++ b/packages/input-static/test/errors.test.ts @@ -1,14 +1,14 @@ -import { PluginMetadata, ProtoFab } from '@fab/core' +import { PluginMetadata, ProtoFab } from '@dev-spendesk/core' import { build } from '../src/build' -import { shouldThrow } from '@fab/core/test/helpers' +import { shouldThrow } from '@dev-spendesk/core/test/helpers' const dir = __dirname + '/fixtures' -describe('@fab/input-static', () => { +describe('@dev-spendesk/input-static', () => { it('should require a dir argument', async () => { await shouldThrow( // @ts-ignore () => build({}, new ProtoFab()), - `@fab/input-static requires an argument of 'dir'.` + `@dev-spendesk/input-static requires an argument of 'dir'.` ) }) @@ -22,7 +22,7 @@ describe('@fab/input-static', () => { new ProtoFab(), dir ), - `@fab/input-static specifies a 'dir' of './no-existo', which doesn't exist.` + `@dev-spendesk/input-static specifies a 'dir' of './no-existo', which doesn't exist.` ) }) @@ -38,7 +38,7 @@ describe('@fab/input-static', () => { proto_fab, dir ), - `@fab/input-static must be the first 'input' plugin in the chain.` + `@dev-spendesk/input-static must be the first 'input' plugin in the chain.` ) }) }) diff --git a/packages/input-static/tsconfig.json b/packages/input-static/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/input-static/tsconfig.json +++ b/packages/input-static/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/plugin-precompile/package.json b/packages/plugin-precompile/package.json index 4ad2df045..0f8f42efe 100644 --- a/packages/plugin-precompile/package.json +++ b/packages/plugin-precompile/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/plugin-precompile", + "name": "@dev-spendesk/plugin-precompile", "version": "1.0.0-rc.9", "description": "Module to render static HTML files with FAB injections", "keywords": [ @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@sucrase/webpack-loader": "^2.0.0", "@types/node": "^12.12.14", "@types/webpack-merge": "^4.1.5", diff --git a/packages/plugin-precompile/src/build.ts b/packages/plugin-precompile/src/build.ts index 14bedb0de..4873af1af 100644 --- a/packages/plugin-precompile/src/build.ts +++ b/packages/plugin-precompile/src/build.ts @@ -1,17 +1,17 @@ -import { FabBuildStep, ProtoFab, RuntimePlugin } from '@fab/core' +import { FabBuildStep, ProtoFab, RuntimePlugin } from '@dev-spendesk/core' import { PrecompileArgs, PrecompileMetadata, ConfigOverrides, PluginOverrides, } from './types' -import { _log } from '@fab/cli' +import { _log } from '@dev-spendesk/cli' import webpack from 'webpack' import fs from 'fs-extra' import path from 'path' import filenamify from 'filenamify' -const log = _log('@fab/plugin-precompile') +const log = _log('@dev-spendesk/plugin-precompile') export const build: FabBuildStep = async ( args: PrecompileArgs, @@ -22,7 +22,7 @@ export const build: FabBuildStep = async ( /* * TODO * - * Port the @fab/input-nextjs stuff across, shimming out pieces as needed. + * Port the @dev-spendesk/input-nextjs stuff across, shimming out pieces as needed. * Make each file a new "runtime", that's compiled using webpack, with a bunch * of good defaults but the args for each section are all the overrides. * diff --git a/packages/plugin-precompile/src/types.ts b/packages/plugin-precompile/src/types.ts index f706656a2..f51b4c9ce 100644 --- a/packages/plugin-precompile/src/types.ts +++ b/packages/plugin-precompile/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@fab/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' import webpack from 'webpack' export interface PrecompileArgs extends PluginArgs { diff --git a/packages/plugin-precompile/tsconfig.json b/packages/plugin-precompile/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/plugin-precompile/tsconfig.json +++ b/packages/plugin-precompile/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/plugin-render-html/package.json b/packages/plugin-render-html/package.json index bf951515e..cc44144c1 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/plugin-render-html", + "name": "@dev-spendesk/plugin-render-html", "version": "1.0.0-rc.9", "description": "Module to render static HTML files with FAB injections", "keywords": [ @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@types/cheerio": "^0.22.15", "@types/node": "^12.12.14", "cheerio": "^1.0.0-rc.3", diff --git a/packages/plugin-render-html/src/build.ts b/packages/plugin-render-html/src/build.ts index 2206d900b..3caa72915 100644 --- a/packages/plugin-render-html/src/build.ts +++ b/packages/plugin-render-html/src/build.ts @@ -1,10 +1,10 @@ -import { ProtoFab } from '@fab/core' +import { ProtoFab } from '@dev-spendesk/core' import { RenderHtmlArgs, RenderHtmlMetadata, CompiledHTMLs, AssetHTMLs } from './types' import cheerio from 'cheerio' import { tokenize } from 'micromustache' import { DEFAULT_INJECTIONS } from './constants' import { addInjectionPoint } from './injections/env' -import { InvalidConfigError, _log } from '@fab/cli' +import { InvalidConfigError, _log } from '@dev-spendesk/cli' import hasha from 'hasha' import path from 'path' @@ -16,7 +16,7 @@ const getFingerprintedName = (contents: Buffer, filename: string) => { : `${filename}_${hash}` } -const log = _log('@fab/plugin-render-html') +const log = _log('@dev-spendesk/plugin-render-html') export async function build( args: RenderHtmlArgs, @@ -73,11 +73,11 @@ export async function build( if (!htmls[resolved_fallback]) { if (typeof fallback === 'string') { throw new InvalidConfigError( - `@fab/plugin-render-html specifies a fallback of '${fallback}', which doesn't exist.` + `@dev-spendesk/plugin-render-html specifies a fallback of '${fallback}', which doesn't exist.` ) } else { log.warn( - `@fab/plugin-render-html has 'fallback: true', but '${resolved_fallback}' doesn't exist! Skipping.` + `@dev-spendesk/plugin-render-html has 'fallback: true', but '${resolved_fallback}' doesn't exist! Skipping.` ) } } diff --git a/packages/plugin-render-html/src/injections/env.ts b/packages/plugin-render-html/src/injections/env.ts index b5ee29951..df6a5bc8a 100644 --- a/packages/plugin-render-html/src/injections/env.ts +++ b/packages/plugin-render-html/src/injections/env.ts @@ -1,4 +1,4 @@ -import { FabSettings } from '@fab/core' +import { FabSettings } from '@dev-spendesk/core' import { DEFAULT_INJECTIONS } from '../constants' import { EnvInjectionConfig } from '../types' diff --git a/packages/plugin-render-html/src/runtime.ts b/packages/plugin-render-html/src/runtime.ts index c71076c6c..be6df0d9d 100644 --- a/packages/plugin-render-html/src/runtime.ts +++ b/packages/plugin-render-html/src/runtime.ts @@ -5,7 +5,7 @@ import { matchPath, NO_RESPONSE_STATUS_CODE, Priority, -} from '@fab/core' +} from '@dev-spendesk/core' import { DEFAULT_INJECTIONS } from './constants' import { generateReplacements } from './injections/env' import { ITokens } from 'micromustache' diff --git a/packages/plugin-render-html/src/types.ts b/packages/plugin-render-html/src/types.ts index 531480270..21f418c0c 100644 --- a/packages/plugin-render-html/src/types.ts +++ b/packages/plugin-render-html/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@fab/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' import { ITokens } from 'micromustache' export type EnvInjectionConfig = { diff --git a/packages/plugin-render-html/test/build.test.ts b/packages/plugin-render-html/test/build.test.ts index 7be19fb40..e3a9ad4d1 100644 --- a/packages/plugin-render-html/test/build.test.ts +++ b/packages/plugin-render-html/test/build.test.ts @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { ProtoFab } from '@fab/core' +import { ProtoFab } from '@dev-spendesk/core' import { build } from '../src/build' import { RenderHtmlMetadata } from '../src/types' diff --git a/packages/plugin-render-html/test/runtime.test.ts b/packages/plugin-render-html/test/runtime.test.ts index 02c5c4040..a9c7d3e0a 100644 --- a/packages/plugin-render-html/test/runtime.test.ts +++ b/packages/plugin-render-html/test/runtime.test.ts @@ -5,7 +5,7 @@ import { FABRuntime, FabSettings, ProtoFab, -} from '@fab/core' +} from '@dev-spendesk/core' import { build } from '../src/build' import { RenderHtmlArgs, RenderHtmlMetadata } from '../src/types' diff --git a/packages/plugin-render-html/tsconfig.json b/packages/plugin-render-html/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/plugin-render-html/tsconfig.json +++ b/packages/plugin-render-html/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/plugin-rewire-assets/package.json b/packages/plugin-rewire-assets/package.json index 74cceb05a..e56b5c774 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/plugin-rewire-assets", + "name": "@dev-spendesk/plugin-rewire-assets", "version": "1.0.0-rc.9", "description": "Module to handle files outside _assets", "keywords": [ @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "@types/istextorbinary": "^2.3.0", "@types/mime-types": "^2.1.0", "@types/node": "^12.12.14", diff --git a/packages/plugin-rewire-assets/src/build.ts b/packages/plugin-rewire-assets/src/build.ts index 7b01daf35..8358a4680 100644 --- a/packages/plugin-rewire-assets/src/build.ts +++ b/packages/plugin-rewire-assets/src/build.ts @@ -1,4 +1,4 @@ -import { ProtoFab, filenameOutsideFabLocations, getContentType } from '@fab/core' +import { ProtoFab, filenameOutsideFabLocations, getContentType } from '@dev-spendesk/core' import { InlineAssets, RenamedAssets, @@ -7,11 +7,11 @@ import { } from './types' import hasha from 'hasha' import path from 'path' -import { InvalidConfigError, _log } from '@fab/cli' +import { InvalidConfigError, _log } from '@dev-spendesk/cli' // @ts-ignore import { isBinaryPromise } from 'istextorbinary' import { DEFAULT_IMMUTABILITY_CHECK } from './constants' -const log = _log('@fab/plugin-rewire-assets') +const log = _log('@dev-spendesk/plugin-rewire-assets') export async function build( args: RewireAssetsArgs, diff --git a/packages/plugin-rewire-assets/src/runtime.ts b/packages/plugin-rewire-assets/src/runtime.ts index b8f753dd0..891283e4f 100644 --- a/packages/plugin-rewire-assets/src/runtime.ts +++ b/packages/plugin-rewire-assets/src/runtime.ts @@ -5,7 +5,7 @@ import { matchPath, NON_IMMUTABLE_HEADERS, Priority, -} from '@fab/core' +} from '@dev-spendesk/core' export default function RewireAssetsRuntime({ Router, diff --git a/packages/plugin-rewire-assets/src/types.ts b/packages/plugin-rewire-assets/src/types.ts index dbc7b05eb..c19629c89 100644 --- a/packages/plugin-rewire-assets/src/types.ts +++ b/packages/plugin-rewire-assets/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@fab/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' export interface RewireAssetsArgs extends PluginArgs { 'inline-threshold'?: number diff --git a/packages/plugin-rewire-assets/test/build.test.ts b/packages/plugin-rewire-assets/test/build.test.ts index 2092cc6ce..1040548dd 100644 --- a/packages/plugin-rewire-assets/test/build.test.ts +++ b/packages/plugin-rewire-assets/test/build.test.ts @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { ProtoFab } from '@fab/core' +import { ProtoFab } from '@dev-spendesk/core' import hasha from 'hasha' import { RewireAssetsMetadata } from '../src/types' import { build } from '../src/build' diff --git a/packages/plugin-rewire-assets/tsconfig.json b/packages/plugin-rewire-assets/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/plugin-rewire-assets/tsconfig.json +++ b/packages/plugin-rewire-assets/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/sandbox-node-vm/package.json b/packages/sandbox-node-vm/package.json index 2a0fd5c26..0b11319df 100644 --- a/packages/sandbox-node-vm/package.json +++ b/packages/sandbox-node-vm/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/sandbox-node-vm", + "name": "@dev-spendesk/sandbox-node-vm", "version": "1.0.0-rc.9", "description": "FAB runtime sandbox using Node's 'vm'", "keywords": [ @@ -29,7 +29,7 @@ "prepack": "npm run clean && npm run build" }, "dependencies": { - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", "cross-fetch": "^3.0.6", "web-streams-polyfill": "^2.1.1" }, diff --git a/packages/sandbox-node-vm/src/index.ts b/packages/sandbox-node-vm/src/index.ts index 442347a38..574b8a33c 100644 --- a/packages/sandbox-node-vm/src/index.ts +++ b/packages/sandbox-node-vm/src/index.ts @@ -1,6 +1,6 @@ import vm from 'vm' import * as fetch from 'cross-fetch' -import { FabSpecExports } from '@fab/core' +import { FabSpecExports } from '@dev-spendesk/core' import Stream from 'stream' import { ReadableStream as WebReadableStream } from 'web-streams-polyfill/ponyfill/es2018' diff --git a/packages/sandbox-node-vm/tsconfig.json b/packages/sandbox-node-vm/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/sandbox-node-vm/tsconfig.json +++ b/packages/sandbox-node-vm/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/packages/server/package.json b/packages/server/package.json index 888f15d44..4b2ef9e07 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,5 +1,5 @@ { - "name": "@fab/server", + "name": "@dev-spendesk/server", "version": "1.0.0-rc.9", "description": "NodeJS FAB Server", "keywords": [ @@ -30,9 +30,9 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9", - "@fab/core": "1.0.0-rc.9", - "@fab/sandbox-node-vm": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/sandbox-node-vm": "1.0.0-rc.9", "@fly/v8env": "^0.54.0", "@types/concat-stream": "^1.6.0", "@types/express": "^4.17.2", diff --git a/packages/server/src/cache.ts b/packages/server/src/cache.ts index b972bc74d..2c4ba3469 100644 --- a/packages/server/src/cache.ts +++ b/packages/server/src/cache.ts @@ -1,8 +1,8 @@ -import { FabCache, FabCacheValue } from '@fab/core' +import { FabCache, FabCacheValue } from '@dev-spendesk/core' import NodeCache from 'node-cache' import Stream from 'stream' /* We need something that node-fetch Response treats as a stream */ -import { HybridReadableStream as _HRS } from '@fab/sandbox-node-vm' +import { HybridReadableStream as _HRS } from '@dev-spendesk/sandbox-node-vm' // @ts-ignore const HybridReadableStream: typeof ReadableStream = _HRS diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 6d87f9f97..a707f8790 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -9,12 +9,12 @@ import { ServerArgs, ServerConstructor, ServerType, -} from '@fab/core' -import { _log, InvalidConfigError, FabServerError, JSON5Config } from '@fab/cli' +} from '@dev-spendesk/core' +import { _log, InvalidConfigError, FabServerError, JSON5Config } from '@dev-spendesk/cli' import { readFilesFromZip } from './utils' import v8_sandbox from './sandboxes/v8-isolate' import { Cache } from './cache' -import node_vm_sandbox from '@fab/sandbox-node-vm' +import node_vm_sandbox from '@dev-spendesk/sandbox-node-vm' import url from 'url' import http from 'http' import express, { @@ -26,7 +26,7 @@ import concat from 'concat-stream' import fetch, { Request as NodeFetchRequest } from 'cross-fetch' import { pathToSHA512 } from 'file-to-sha512' import Stream from 'stream' -import { watcher } from '@fab/cli' +import { watcher } from '@dev-spendesk/cli' import httpProxy from 'http-proxy' // @ts-ignore import nodeToWebStream from 'readable-stream-node-to-web' @@ -41,7 +41,7 @@ const log = _log(`Server`) async function streamResponse(fetch_res: Response, res: ExpressResponse) { res.status(fetch_res.status) // This is a NodeFetch response, which has this method, but - // the @fab/core types are from dom.ts, which doesn't. This + // the @dev-spendesk/core types are from dom.ts, which doesn't. This // was the easiest workaround for now. // @ts-ignore const response_headers = fetch_res.headers.raw() @@ -167,7 +167,9 @@ class Server implements ServerType { const fetch_req = new NodeFetchRequest(url, { method, headers, - ...((method === 'POST' || method === 'PUT' || method === 'PATCH') ? { body: req.body } : {}), + ...(method === 'POST' || method === 'PUT' || method === 'PATCH' + ? { body: req.body } + : {}), }) const production_settings = renderer.metadata?.production_settings diff --git a/packages/server/src/sandboxes/v8-isolate.ts b/packages/server/src/sandboxes/v8-isolate.ts index 1d5fb6596..c8e440bee 100644 --- a/packages/server/src/sandboxes/v8-isolate.ts +++ b/packages/server/src/sandboxes/v8-isolate.ts @@ -1,5 +1,5 @@ import fs from 'fs-extra' -import { FabSpecExports, FabSettings } from '@fab/core' +import { FabSpecExports, FabSettings } from '@dev-spendesk/core' import { Response as NodeFetchResponse } from 'cross-fetch' export default async (src: string): Promise => { diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json index feed7333d..cc143f5fd 100644 --- a/packages/server/tsconfig.json +++ b/packages/server/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "paths": { - "@fab/*": ["node_modules/@fab/*/src"] + "@dev-spendesk/*": ["node_modules/@dev-spendesk/*/src"] } }, "include": ["src"] diff --git a/tests/e2e/cli-errors.test.ts b/tests/e2e/cli-errors.test.ts index f1cc3e212..89118007c 100644 --- a/tests/e2e/cli-errors.test.ts +++ b/tests/e2e/cli-errors.test.ts @@ -40,12 +40,12 @@ describe('dir of static assets', () => { stderr, stdout, } = await expectError(`fab build -c fab.unknown-module.json5`, { cwd }) - expect(stdout).toContain(`Cannot find module '@fab/no-existo'`) + expect(stdout).toContain(`Cannot find module '@dev-spendesk/no-existo'`) expect(stdout).toContain(`Are you sure it's installed?`) expect(stderr).toContain(`Config file contains errors!`) }) - it(`should tell you you've forgotten @fab/plugin-rewire-assets`, async () => { + it(`should tell you you've forgotten @dev-spendesk/plugin-rewire-assets`, async () => { const { stderr, stdout, @@ -54,7 +54,7 @@ describe('dir of static assets', () => { expect(stdout).toContain( `Build config leaves files outside of _assets dir: /index.html` ) - expect(stdout).toContain(`You might need to add @fab/plugin-rewire-assets`) + expect(stdout).toContain(`You might need to add @dev-spendesk/plugin-rewire-assets`) expect(stdout).toContain(`See https://fab.dev/packages/rewire-assets`) expect(stderr).toContain(`Build failed!`) }) diff --git a/tests/e2e/create-react-app.test.ts b/tests/e2e/create-react-app.test.ts index af54f0e97..0cf561b03 100644 --- a/tests/e2e/create-react-app.test.ts +++ b/tests/e2e/create-react-app.test.ts @@ -279,9 +279,9 @@ describe('Create React App E2E Test', () => { await fs.writeFile(`${cwd}/build/bigfile.a1b2c3d4e5.immutable`, big_file) const config = jju.parse(await fs.readFile(`${cwd}/fab.config.json5`, 'utf8')) - config.plugins['@fab/plugin-rewire-assets']['chunk-threshold'] = Math.floor( - big_file.length / 2.5 - ) + config.plugins['@dev-spendesk/plugin-rewire-assets'][ + 'chunk-threshold' + ] = Math.floor(big_file.length / 2.5) await fs.writeFile(`${cwd}/fab.config.json5`, jju.stringify(config)) await buildFab(cwd) diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/add-bundle-id/runtime.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/add-bundle-id/runtime.ts index f64392886..d9c158476 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/add-bundle-id/runtime.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/add-bundle-id/runtime.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@fab/core' +import { FABRuntime } from '@dev-spendesk/core' export default ({ Router, ServerContext }: FABRuntime) => { Router.interceptResponse(async (response) => { diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/cache.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/cache.ts index 39e0e8b24..6f02f4132 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/cache.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/cache.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@fab/core' +import { FABRuntime } from '@dev-spendesk/core' const sleep = (ms: number) => new Promise((res) => setTimeout(res, ms)) diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/check-cookie.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/check-cookie.ts index c4bd71e82..a5b4e70a9 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/check-cookie.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/check-cookie.ts @@ -1,4 +1,4 @@ -import { FABRuntime, Priority } from '@fab/core' +import { FABRuntime, Priority } from '@dev-spendesk/core' // import { checkValidity } from 'somewhere' const checkValidity = (str: string) => str.startsWith('AUTHED') diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/geolocate.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/geolocate.ts index a7d20232e..c97d933f6 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/geolocate.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/geolocate.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@fab/core' +import { FABRuntime } from '@dev-spendesk/core' export default ({ Router }: FABRuntime) => { Router.on('/geolocate', async () => { diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/hello-world.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/hello-world.ts index 8839a63d4..4fad2a64f 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/hello-world.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/hello-world.ts @@ -1,4 +1,4 @@ -import { FABRuntime, Priority } from '@fab/core' +import { FABRuntime, Priority } from '@dev-spendesk/core' export default ({ Router }: FABRuntime) => { Router.on('/hello/:whom?', async ({ params }) => { diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/slowly.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/slowly.ts index 111b0f7fb..5da8f67a2 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/slowly.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/slowly.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@fab/core' +import { FABRuntime } from '@dev-spendesk/core' const sleep = (ms: number) => new Promise((res) => setTimeout(res, ms)) diff --git a/tests/e2e/fixtures/server-side-logic/fab.config.json5 b/tests/e2e/fixtures/server-side-logic/fab.config.json5 index 6a110c830..6249d4a9a 100644 --- a/tests/e2e/fixtures/server-side-logic/fab.config.json5 +++ b/tests/e2e/fixtures/server-side-logic/fab.config.json5 @@ -1,13 +1,13 @@ { plugins: { - '@fab/input-static': { dir: 'public' }, - '@fab/plugin-render-html': { fallback: '/index.html' }, - '@fab/plugin-rewire-assets': {}, + '@dev-spendesk/input-static': { dir: 'public' }, + '@dev-spendesk/plugin-render-html': { fallback: '/index.html' }, + '@dev-spendesk/plugin-rewire-assets': {}, './fab-plugins/hello-world': {}, './fab-plugins/add-bundle-id': {}, './fab-plugins/slowly': {}, './fab-plugins/cache': {}, - '@fab/plugin-precompile': { + '@dev-spendesk/plugin-precompile': { './fab-plugins/needs-webpack.js': { _config: './modify-plugin-config.js', other_data: 'passed through as normal', diff --git a/tests/e2e/fixtures/server-side-logic/modify-plugin-config.js b/tests/e2e/fixtures/server-side-logic/modify-plugin-config.js index 471a32b8a..1a9565ee7 100644 --- a/tests/e2e/fixtures/server-side-logic/modify-plugin-config.js +++ b/tests/e2e/fixtures/server-side-logic/modify-plugin-config.js @@ -11,6 +11,6 @@ module.exports = { }, alias: (alias) => ({ ...alias, - 'no-existo': require.resolve('@fab/plugin-precompile/shims/empty-object'), + 'no-existo': require.resolve('@dev-spendesk/plugin-precompile/shims/empty-object'), }), } diff --git a/tests/e2e/fixtures/server-side-logic/package.json b/tests/e2e/fixtures/server-side-logic/package.json index d95f11221..67f1ced4d 100644 --- a/tests/e2e/fixtures/server-side-logic/package.json +++ b/tests/e2e/fixtures/server-side-logic/package.json @@ -6,12 +6,12 @@ "fab:serve": "fab serve fab.zip" }, "dependencies": { - "@fab/actions": "latest", - "@fab/cli": "latest", - "@fab/input-static": "latest", - "@fab/plugin-render-html": "latest", - "@fab/plugin-rewire-assets": "latest", - "@fab/plugin-precompile": "latest", - "@fab/server": "latest" + "@dev-spendesk/actions": "latest", + "@dev-spendesk/cli": "latest", + "@dev-spendesk/input-static": "latest", + "@dev-spendesk/plugin-render-html": "latest", + "@dev-spendesk/plugin-rewire-assets": "latest", + "@dev-spendesk/plugin-precompile": "latest", + "@dev-spendesk/server": "latest" } } diff --git a/tests/e2e/fixtures/static/fab.missing-rewire.json5 b/tests/e2e/fixtures/static/fab.missing-rewire.json5 index dbd4771cf..2306f4752 100644 --- a/tests/e2e/fixtures/static/fab.missing-rewire.json5 +++ b/tests/e2e/fixtures/static/fab.missing-rewire.json5 @@ -1,7 +1,7 @@ { plugins: { - '@fab/input-static': { + '@dev-spendesk/input-static': { dir: 'src', }, - } + }, } diff --git a/tests/e2e/fixtures/static/fab.unknown-module.json5 b/tests/e2e/fixtures/static/fab.unknown-module.json5 index 2de187555..ecce25a1d 100644 --- a/tests/e2e/fixtures/static/fab.unknown-module.json5 +++ b/tests/e2e/fixtures/static/fab.unknown-module.json5 @@ -1,9 +1,9 @@ { plugins: { - '@fab/input-static': { + '@dev-spendesk/input-static': { dir: 'src', }, - '@fab/no-existo': { + '@dev-spendesk/no-existo': { other: 'ag', }, }, diff --git a/tests/e2e/helpers/index.ts b/tests/e2e/helpers/index.ts index 2fa1dd7cd..1d7b4e955 100644 --- a/tests/e2e/helpers/index.ts +++ b/tests/e2e/helpers/index.ts @@ -93,4 +93,4 @@ export async function getCurrentCommitInfo() { export const FAB_PACKAGE_NAMES = globby(['*', '!_fab'], { cwd: path.resolve(__dirname, '../../../packages'), onlyFiles: false, -}).then((files) => files.map((x) => `@fab/${x}`).join(' ')) +}).then((files) => files.map((x) => `@dev-spendesk/${x}`).join(' ')) diff --git a/tsconfig.json b/tsconfig.json index 7aa3a38ff..27526abda 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "moduleResolution": "node", "baseUrl": "./", "paths": { - "@fab/*": ["packages/*/src"] + "@dev-spendesk/*": ["packages/*/src"] }, "esModuleInterop": true, "forceConsistentCasingInFileNames": true From 1688f988a3c5d8b24d9a9a22c75c12b3639ccd14 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Wed, 23 Feb 2022 11:42:08 +0100 Subject: [PATCH 04/23] Edit package refs --- packages/_fab/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/_fab/package.json b/packages/_fab/package.json index 0b101b16d..74dcf141d 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -1,5 +1,5 @@ { - "name": "fab", + "name": "@dev-spendesk/fab", "version": "1.0.0-rc.9", "description": "An alias for @dev-spendesk/cli", "keywords": [ From 2a663d7ec6e8b59dde020992605de09074b930c9 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Wed, 23 Feb 2022 11:53:13 +0100 Subject: [PATCH 05/23] remove gitHead --- packages/_fab/package.json | 3 +-- packages/actions/package.json | 3 +-- packages/cli/package.json | 1 - packages/core/package.json | 3 +-- packages/deployer-aws-lambda/package.json | 3 +-- packages/deployer-aws-s3/package.json | 3 +-- packages/deployer-cf-workers/package.json | 3 +-- packages/input-nextjs/package.json | 3 +-- packages/input-static/package.json | 3 +-- packages/plugin-precompile/package.json | 3 +-- packages/plugin-render-html/package.json | 3 +-- packages/plugin-rewire-assets/package.json | 3 +-- packages/sandbox-node-vm/package.json | 3 +-- packages/server/package.json | 3 +-- 14 files changed, 13 insertions(+), 27 deletions(-) diff --git a/packages/_fab/package.json b/packages/_fab/package.json index 74dcf141d..cb2194dcc 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -28,6 +28,5 @@ }, "dependencies": { "@dev-spendesk/cli": "1.0.0-rc.9" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/actions/package.json b/packages/actions/package.json index 2536e852d..8ade78ae0 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -58,6 +58,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/cli/package.json b/packages/cli/package.json index b4d90fab8..b63fdd491 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -75,7 +75,6 @@ "publishConfig": { "access": "public" }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de", "oclif": { "commands": "./lib/commands", "bin": "fab", diff --git a/packages/core/package.json b/packages/core/package.json index 3249ce9a4..fd7d83cc1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -34,6 +34,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/deployer-aws-lambda/package.json b/packages/deployer-aws-lambda/package.json index ab80e38a3..fabc29ae2 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -45,6 +45,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/deployer-aws-s3/package.json b/packages/deployer-aws-s3/package.json index 50b5e515d..647ddfd09 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -44,6 +44,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/deployer-cf-workers/package.json b/packages/deployer-cf-workers/package.json index 16cd5c73d..d3b90d080 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -47,6 +47,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/input-nextjs/package.json b/packages/input-nextjs/package.json index 4cc03e879..c5e0bfb8e 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -52,6 +52,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/input-static/package.json b/packages/input-static/package.json index bc1350b49..7a671ce14 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -39,6 +39,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/plugin-precompile/package.json b/packages/plugin-precompile/package.json index 0f8f42efe..429057b5b 100644 --- a/packages/plugin-precompile/package.json +++ b/packages/plugin-precompile/package.json @@ -43,6 +43,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/plugin-render-html/package.json b/packages/plugin-render-html/package.json index cc44144c1..0bd6d4359 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -40,6 +40,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/plugin-rewire-assets/package.json b/packages/plugin-rewire-assets/package.json index e56b5c774..879ce5d72 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -42,6 +42,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/sandbox-node-vm/package.json b/packages/sandbox-node-vm/package.json index 0b11319df..d770eab13 100644 --- a/packages/sandbox-node-vm/package.json +++ b/packages/sandbox-node-vm/package.json @@ -35,6 +35,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/server/package.json b/packages/server/package.json index 4b2ef9e07..e955791dd 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -52,6 +52,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } From deefe633a225962cb12c389d785af8b7a9f5e134 Mon Sep 17 00:00:00 2001 From: Victor Demonchy Date: Wed, 23 Feb 2022 12:26:42 +0100 Subject: [PATCH 06/23] v1.0.0-rc.10 --- lerna.json | 2 +- packages/_fab/package.json | 4 +- packages/actions/package.json | 6 +- packages/cli/README.md | 164 +-------------------- packages/cli/package.json | 4 +- packages/core/package.json | 2 +- packages/deployer-aws-lambda/package.json | 6 +- packages/deployer-aws-s3/package.json | 6 +- packages/deployer-cf-workers/package.json | 6 +- packages/input-nextjs/package.json | 6 +- packages/input-static/package.json | 6 +- packages/plugin-precompile/package.json | 6 +- packages/plugin-render-html/package.json | 6 +- packages/plugin-rewire-assets/package.json | 6 +- packages/sandbox-node-vm/package.json | 4 +- packages/server/package.json | 8 +- 16 files changed, 41 insertions(+), 201 deletions(-) diff --git a/lerna.json b/lerna.json index 3f9513383..105d3ab94 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": ["packages/*"], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.0.0-rc.9" + "version": "1.0.0-rc.10" } diff --git a/packages/_fab/package.json b/packages/_fab/package.json index cb2194dcc..8015959b9 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "An alias for @dev-spendesk/cli", "keywords": [ "fab" @@ -27,6 +27,6 @@ "prepack": "cat PREAMBLE.md > README.md && cat ../cli/README.md >> README.md" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9" + "@dev-spendesk/cli": "1.0.0-rc.10" } } diff --git a/packages/actions/package.json b/packages/actions/package.json index 8ade78ae0..69c3a0c0d 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/actions", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "private": false, "description": "The guts of the FAB cli code, keeping the 'fab' package lean", "keywords": [ @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", "@rollup/plugin-alias": "^2.2.0", "@rollup/plugin-commonjs": "^11.0.2", "@rollup/plugin-inject": "^4.0.1", diff --git a/packages/cli/README.md b/packages/cli/README.md index 22f10f71d..7d29fa64b 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -17,11 +17,11 @@ ```sh-session -$ npm install -g @fab/cli +$ npm install -g @dev-spendesk/cli $ fab COMMAND running command... $ fab (-v|--version|version) -@fab/cli/1.0.0-rc.9 darwin-x64 node-v15.5.1 +@dev-spendesk/cli/1.0.0-rc.10 linux-x64 node-v14.18.1 $ fab --help [COMMAND] USAGE $ fab COMMAND @@ -34,75 +34,7 @@ USAGE -- [`fab build`](#fab-build) -- [`fab deploy [FILE]`](#fab-deploy-file) - [`fab help [COMMAND]`](#fab-help-command) -- [`fab init`](#fab-init) -- [`fab package [FILE]`](#fab-package-file) -- [`fab serve [FILE]`](#fab-serve-file) - -## `fab build` - -Generate a FAB given the config (usually in fab.config.json5) - -``` -USAGE - $ fab build - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file - -h, --help show CLI help - --minify Minify the generated server.js file. - --skip-cache Skip any caching of intermediate build artifacts - --skip-typecheck Skip the background typechecking of your FAB plugins if it's slow or flaky. - - --watch=watch Re-run the builder if any of the listed files change. Pass this argument multiple times to watch - multiple files/directories. - -EXAMPLES - $ fab build - $ fab build --config=fab.config.json5 - $ fab build --watch dist --watch fab.config.json5 -``` - -_See code: [lib/commands/build.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/build.js)_ - -## `fab deploy [FILE]` - -Deploy a FAB to a hosting provider - -``` -USAGE - $ fab deploy [FILE] - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file - -h, --help show CLI help - - --assets-already-deployed-at=assets-already-deployed-at Skip asset deploys and only deploy the server component - pointing at this URL for assets - - --assets-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the assets defined - in your fab.config.json5, which one to deploy to. - - --assets-only Skip server deploy, just upload assets - - --auto-install If you need dependent packages (e.g. @fab/deploy-*), install - them without prompting - - --env=env Override production settings with a different environment - defined in your FAB config file. - - --package-dir=package-dir Where to save the packaged FAB files (default .fab/deploy) - - --server-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the server defined - in your fab.config.json5, which one to deploy to. - -EXAMPLE - $ fab deploy fab.zip -``` - -_See code: [lib/commands/deploy.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/deploy.js)_ ## `fab help [COMMAND]` @@ -121,96 +53,4 @@ OPTIONS _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.1/src/commands/help.ts)_ -## `fab init` - -Auto-configure a repo for generating FABs - -``` -USAGE - $ fab init - -OPTIONS - -c, --config=config [default: fab.config.json5] Config filename - -h, --help show CLI help - -y, --yes Assume yes to all prompts (must be in the root directory of a project) - --empty Install the packages and create an empty fab.config.json5 (implies -y) - --skip-framework-detection Don't try to auto-detect framework, set up manually. - --skip-install Do not attempt to npm install anything - --version=version What NPM version or dist-tag to use for installing FAB packages - -EXAMPLES - $ fab init - $ fab init --config=fab.config.json5 -``` - -_See code: [lib/commands/init.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/init.js)_ - -## `fab package [FILE]` - -Package a FAB to be uploaded to a hosting provider manually - -``` -USAGE - $ fab package [FILE] - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file - -h, --help show CLI help - - -t, --target=(cf-workers|aws-lambda-edge|aws-s3) Hosting provider (must be one of: cf-workers, aws-lambda-edge, - aws-s3) - - --assets-url=assets-url A URL for where the assets can be accessed, for server deployers - that need it - - --env=env Override production settings with a different environment defined in - your FAB config file. - - --output-path=output-path Where to save the packaged FAB (default .fab/deploy/[target].zip) - -EXAMPLE - $ fab package --target=aws-lambda-edge fab.zip -``` - -_See code: [lib/commands/package.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/package.js)_ - -## `fab serve [FILE]` - -fab serve: Serve a FAB in a local NodeJS Express server - -``` -USAGE - $ fab serve [FILE] - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file. Only used for SETTINGS in conjunction with - --env. - - -h, --help show CLI help - - --auto-install If you need dependent packages (e.g. @fab/serve), install them without prompting - - --cert=cert SSL certificate to use - - --env=env Override production settings with a different environment defined in your FAB config file. - - --experimental-v8-sandbox Enable experimental V8::Isolate Runtime (in development, currently non-functional) - - --key=key Key for the SSL Certificate - - --port=port (required) [default: 3000] Port to use - - --proxy-ws=proxy-ws EXPERIMENTAL: Proxy websocket requests to a different port - - --watch EXPERIMENTAL: Watches fab.zip and restarts the server when it changes. - -EXAMPLES - $ fab serve fab.zip - $ fab serve --port=3001 fab.zip - $ fab serve --cert=local-ssl.cert --key=local-ssl.key fab.zip - $ fab serve --env=staging fab.zip -``` - -_See code: [lib/commands/serve.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/serve.js)_ - diff --git a/packages/cli/package.json b/packages/cli/package.json index b63fdd491..f83cad2d6 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/cli", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "The CLI entry-point for the FAB ecosystem", "keywords": [ "fab", @@ -35,7 +35,7 @@ "version": "oclif-dev readme && git add README.md" }, "dependencies": { - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.10", "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/errors": "^1", diff --git a/packages/core/package.json b/packages/core/package.json index fd7d83cc1..760be236e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/core", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "private": false, "description": "Common code for all FAB projects", "keywords": [ diff --git a/packages/deployer-aws-lambda/package.json b/packages/deployer-aws-lambda/package.json index fabc29ae2..313cadc18 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/deployer-aws-lambda", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "aws", @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", "@types/nanoid": "^2.1.0", "@types/node": "^12.12.14", "deterministic-zip": "^1.1.0", diff --git a/packages/deployer-aws-s3/package.json b/packages/deployer-aws-s3/package.json index 647ddfd09..60e5d2596 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/deployer-aws-s3", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "Uploads FAB assets to AWS S3", "keywords": [ "aws", @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", "@types/node": "^12.12.14", "aws-sdk": "^2.655.0", "fs-extra": "^9.0.0", diff --git a/packages/deployer-cf-workers/package.json b/packages/deployer-cf-workers/package.json index d3b90d080..424a51c55 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/deployer-cf-workers", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "cloudflare", @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", "@types/node": "^12.12.14", "cross-fetch": "^3.0.6", "file-to-sha512": "^0.0.1", diff --git a/packages/input-nextjs/package.json b/packages/input-nextjs/package.json index c5e0bfb8e..dd6ecd834 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/input-nextjs", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "Module to kick off a FAB build from a NextJS project", "keywords": [ "aws", @@ -34,8 +34,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", "@types/node": "^12.12.14", "@types/path-to-regexp": "^1.7.0", "acorn": "^7.1.0", diff --git a/packages/input-static/package.json b/packages/input-static/package.json index 7a671ce14..567cc1488 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/input-static", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "Module to handle a directory of HTML & assets", "keywords": [ "fab", @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", "@types/node": "^12.12.14", "fs-extra": "^8.1.0", "globby": "^10" diff --git a/packages/plugin-precompile/package.json b/packages/plugin-precompile/package.json index 429057b5b..d4eaffe31 100644 --- a/packages/plugin-precompile/package.json +++ b/packages/plugin-precompile/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/plugin-precompile", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "Module to render static HTML files with FAB injections", "keywords": [ "fab" @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", "@sucrase/webpack-loader": "^2.0.0", "@types/node": "^12.12.14", "@types/webpack-merge": "^4.1.5", diff --git a/packages/plugin-render-html/package.json b/packages/plugin-render-html/package.json index 0bd6d4359..168bcaf3f 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/plugin-render-html", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "Module to render static HTML files with FAB injections", "keywords": [ "fab" @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", "@types/cheerio": "^0.22.15", "@types/node": "^12.12.14", "cheerio": "^1.0.0-rc.3", diff --git a/packages/plugin-rewire-assets/package.json b/packages/plugin-rewire-assets/package.json index 879ce5d72..783a58665 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/plugin-rewire-assets", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "Module to handle files outside _assets", "keywords": [ "assets", @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", "@types/istextorbinary": "^2.3.0", "@types/mime-types": "^2.1.0", "@types/node": "^12.12.14", diff --git a/packages/sandbox-node-vm/package.json b/packages/sandbox-node-vm/package.json index d770eab13..6fd6e9da1 100644 --- a/packages/sandbox-node-vm/package.json +++ b/packages/sandbox-node-vm/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/sandbox-node-vm", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "FAB runtime sandbox using Node's 'vm'", "keywords": [ "fab", @@ -29,7 +29,7 @@ "prepack": "npm run clean && npm run build" }, "dependencies": { - "@dev-spendesk/core": "1.0.0-rc.9", + "@dev-spendesk/core": "1.0.0-rc.10", "cross-fetch": "^3.0.6", "web-streams-polyfill": "^2.1.1" }, diff --git a/packages/server/package.json b/packages/server/package.json index e955791dd..5640ba4c8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/server", - "version": "1.0.0-rc.9", + "version": "1.0.0-rc.10", "description": "NodeJS FAB Server", "keywords": [ "fab", @@ -30,9 +30,9 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.9", - "@dev-spendesk/core": "1.0.0-rc.9", - "@dev-spendesk/sandbox-node-vm": "1.0.0-rc.9", + "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/sandbox-node-vm": "1.0.0-rc.10", "@fly/v8env": "^0.54.0", "@types/concat-stream": "^1.6.0", "@types/express": "^4.17.2", From 71adc01f498de15f82deadcf15c7e2c6ed6571be Mon Sep 17 00:00:00 2001 From: Victor Demonchy Date: Wed, 23 Feb 2022 12:39:26 +0100 Subject: [PATCH 07/23] Update READMEs after publish --- packages/_fab/README.md | 20 ++--- packages/cli/README.md | 160 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+), 10 deletions(-) diff --git a/packages/_fab/README.md b/packages/_fab/README.md index 057296d5c..075d10509 100644 --- a/packages/_fab/README.md +++ b/packages/_fab/README.md @@ -27,11 +27,11 @@ https://www.npmjs.com/package/fab/v/0.5.3-original. ```sh-session -$ npm install -g @fab/cli +$ npm install -g @dev-spendesk/cli $ fab COMMAND running command... $ fab (-v|--version|version) -@fab/cli/1.0.0-rc.9 darwin-x64 node-v15.5.1 +@dev-spendesk/cli/1.0.0-rc.10 linux-x64 node-v14.18.1 $ fab --help [COMMAND] USAGE $ fab COMMAND @@ -75,7 +75,7 @@ EXAMPLES $ fab build --watch dist --watch fab.config.json5 ``` -_See code: [lib/commands/build.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/build.js)_ +_See code: [lib/commands/build.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/build.js)_ ## `fab deploy [FILE]` @@ -97,8 +97,8 @@ OPTIONS --assets-only Skip server deploy, just upload assets - --auto-install If you need dependent packages (e.g. @fab/deploy-*), install - them without prompting + --auto-install If you need dependent packages (e.g. @dev-spendesk/deploy-*), + install them without prompting --env=env Override production settings with a different environment defined in your FAB config file. @@ -112,7 +112,7 @@ EXAMPLE $ fab deploy fab.zip ``` -_See code: [lib/commands/deploy.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/deploy.js)_ +_See code: [lib/commands/deploy.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/deploy.js)_ ## `fab help [COMMAND]` @@ -153,7 +153,7 @@ EXAMPLES $ fab init --config=fab.config.json5 ``` -_See code: [lib/commands/init.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/init.js)_ +_See code: [lib/commands/init.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/init.js)_ ## `fab package [FILE]` @@ -182,7 +182,7 @@ EXAMPLE $ fab package --target=aws-lambda-edge fab.zip ``` -_See code: [lib/commands/package.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/package.js)_ +_See code: [lib/commands/package.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/package.js)_ ## `fab serve [FILE]` @@ -198,7 +198,7 @@ OPTIONS -h, --help show CLI help - --auto-install If you need dependent packages (e.g. @fab/serve), install them without prompting + --auto-install If you need dependent packages (e.g. @dev-spendesk/serve), install them without prompting --cert=cert SSL certificate to use @@ -221,6 +221,6 @@ EXAMPLES $ fab serve --env=staging fab.zip ``` -_See code: [lib/commands/serve.js](https://github.com/fab-spec/fab/blob/v1.0.0-rc.9/lib/commands/serve.js)_ +_See code: [lib/commands/serve.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/serve.js)_ diff --git a/packages/cli/README.md b/packages/cli/README.md index 7d29fa64b..b9e37fccb 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -34,7 +34,75 @@ USAGE +- [`fab build`](#fab-build) +- [`fab deploy [FILE]`](#fab-deploy-file) - [`fab help [COMMAND]`](#fab-help-command) +- [`fab init`](#fab-init) +- [`fab package [FILE]`](#fab-package-file) +- [`fab serve [FILE]`](#fab-serve-file) + +## `fab build` + +Generate a FAB given the config (usually in fab.config.json5) + +``` +USAGE + $ fab build + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file + -h, --help show CLI help + --minify Minify the generated server.js file. + --skip-cache Skip any caching of intermediate build artifacts + --skip-typecheck Skip the background typechecking of your FAB plugins if it's slow or flaky. + + --watch=watch Re-run the builder if any of the listed files change. Pass this argument multiple times to watch + multiple files/directories. + +EXAMPLES + $ fab build + $ fab build --config=fab.config.json5 + $ fab build --watch dist --watch fab.config.json5 +``` + +_See code: [lib/commands/build.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/build.js)_ + +## `fab deploy [FILE]` + +Deploy a FAB to a hosting provider + +``` +USAGE + $ fab deploy [FILE] + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file + -h, --help show CLI help + + --assets-already-deployed-at=assets-already-deployed-at Skip asset deploys and only deploy the server component + pointing at this URL for assets + + --assets-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the assets defined + in your fab.config.json5, which one to deploy to. + + --assets-only Skip server deploy, just upload assets + + --auto-install If you need dependent packages (e.g. @dev-spendesk/deploy-*), + install them without prompting + + --env=env Override production settings with a different environment + defined in your FAB config file. + + --package-dir=package-dir Where to save the packaged FAB files (default .fab/deploy) + + --server-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the server defined + in your fab.config.json5, which one to deploy to. + +EXAMPLE + $ fab deploy fab.zip +``` + +_See code: [lib/commands/deploy.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/deploy.js)_ ## `fab help [COMMAND]` @@ -53,4 +121,96 @@ OPTIONS _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.1/src/commands/help.ts)_ +## `fab init` + +Auto-configure a repo for generating FABs + +``` +USAGE + $ fab init + +OPTIONS + -c, --config=config [default: fab.config.json5] Config filename + -h, --help show CLI help + -y, --yes Assume yes to all prompts (must be in the root directory of a project) + --empty Install the packages and create an empty fab.config.json5 (implies -y) + --skip-framework-detection Don't try to auto-detect framework, set up manually. + --skip-install Do not attempt to npm install anything + --version=version What NPM version or dist-tag to use for installing FAB packages + +EXAMPLES + $ fab init + $ fab init --config=fab.config.json5 +``` + +_See code: [lib/commands/init.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/init.js)_ + +## `fab package [FILE]` + +Package a FAB to be uploaded to a hosting provider manually + +``` +USAGE + $ fab package [FILE] + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file + -h, --help show CLI help + + -t, --target=(cf-workers|aws-lambda-edge|aws-s3) Hosting provider (must be one of: cf-workers, aws-lambda-edge, + aws-s3) + + --assets-url=assets-url A URL for where the assets can be accessed, for server deployers + that need it + + --env=env Override production settings with a different environment defined in + your FAB config file. + + --output-path=output-path Where to save the packaged FAB (default .fab/deploy/[target].zip) + +EXAMPLE + $ fab package --target=aws-lambda-edge fab.zip +``` + +_See code: [lib/commands/package.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/package.js)_ + +## `fab serve [FILE]` + +fab serve: Serve a FAB in a local NodeJS Express server + +``` +USAGE + $ fab serve [FILE] + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file. Only used for SETTINGS in conjunction with + --env. + + -h, --help show CLI help + + --auto-install If you need dependent packages (e.g. @dev-spendesk/serve), install them without prompting + + --cert=cert SSL certificate to use + + --env=env Override production settings with a different environment defined in your FAB config file. + + --experimental-v8-sandbox Enable experimental V8::Isolate Runtime (in development, currently non-functional) + + --key=key Key for the SSL Certificate + + --port=port (required) [default: 3000] Port to use + + --proxy-ws=proxy-ws EXPERIMENTAL: Proxy websocket requests to a different port + + --watch EXPERIMENTAL: Watches fab.zip and restarts the server when it changes. + +EXAMPLES + $ fab serve fab.zip + $ fab serve --port=3001 fab.zip + $ fab serve --cert=local-ssl.cert --key=local-ssl.key fab.zip + $ fab serve --env=staging fab.zip +``` + +_See code: [lib/commands/serve.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/serve.js)_ + From 7b518d18a2c578c4db6d9091d037236646f074bd Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Wed, 23 Feb 2022 18:27:19 +0100 Subject: [PATCH 08/23] Rename packages --- packages/_fab/fab.js | 4 ++-- packages/_fab/package.json | 4 ++-- packages/actions/package.json | 4 ++-- packages/actions/src/Builder.ts | 2 +- packages/actions/src/Compiler.ts | 4 ++-- packages/actions/src/Deployer.ts | 2 +- packages/actions/src/Generator.ts | 2 +- packages/actions/src/Packager.ts | 2 +- packages/actions/src/Typecheck.ts | 2 +- packages/actions/src/rollup.ts | 2 +- packages/actions/test/actions/Builder.test.ts | 2 +- packages/actions/test/actions/Compiler.test.ts | 2 +- packages/cli/package.json | 2 +- packages/cli/src/Initializer/constants.ts | 6 +++--- packages/cli/src/Initializer/index.ts | 6 +++--- packages/cli/src/commands/build.ts | 2 +- packages/cli/src/commands/deploy.ts | 2 +- packages/cli/src/commands/package.ts | 2 +- packages/cli/src/commands/serve.ts | 2 +- packages/core/src/index.ts | 2 +- packages/core/src/types.ts | 2 +- packages/deployer-aws-lambda/package.json | 2 +- packages/deployer-aws-lambda/src/deploy.ts | 2 +- packages/deployer-aws-lambda/src/utils.ts | 2 +- packages/deployer-aws-lambda/templates/index.js | 2 +- packages/deployer-aws-s3/package.json | 2 +- packages/deployer-aws-s3/src/utils.ts | 2 +- packages/deployer-cf-workers/package.json | 2 +- packages/deployer-cf-workers/src/createPackage.ts | 2 +- packages/deployer-cf-workers/src/deploy.ts | 2 +- packages/deployer-cf-workers/src/utils.ts | 2 +- packages/input-nextjs/package.json | 2 +- packages/input-nextjs/src/build.ts | 2 +- packages/input-nextjs/src/preflightChecks.ts | 2 +- packages/input-static/package.json | 2 +- packages/input-static/src/build.ts | 4 ++-- packages/plugin-precompile/package.json | 2 +- packages/plugin-precompile/src/build.ts | 2 +- packages/plugin-render-html/package.json | 2 +- packages/plugin-render-html/src/build.ts | 2 +- packages/plugin-rewire-assets/package.json | 2 +- packages/plugin-rewire-assets/src/build.ts | 2 +- packages/server/package.json | 4 ++-- packages/server/src/index.ts | 9 +++++++-- tests/e2e/fixtures/server-side-logic/package.json | 6 +++--- 45 files changed, 63 insertions(+), 58 deletions(-) diff --git a/packages/_fab/fab.js b/packages/_fab/fab.js index 98bcf58ab..37b59bce8 100755 --- a/packages/_fab/fab.js +++ b/packages/_fab/fab.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -// This module defers to @dev-spendesk/cli for all its work, we just use this namespace +// This module defers to @dev-spendesk/fab-cli for all its work, we just use this namespace // so that `npx fab` does what we expect. -require('@dev-spendesk/cli/bin/run') +require('@dev-spendesk/fab-cli/bin/run') diff --git a/packages/_fab/package.json b/packages/_fab/package.json index 8015959b9..152969056 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -1,7 +1,7 @@ { "name": "@dev-spendesk/fab", "version": "1.0.0-rc.10", - "description": "An alias for @dev-spendesk/cli", + "description": "An alias for @dev-spendesk/fab-cli", "keywords": [ "fab" ], @@ -27,6 +27,6 @@ "prepack": "cat PREAMBLE.md > README.md && cat ../cli/README.md >> README.md" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10" + "@dev-spendesk/fab-cli": "1.0.0-rc.10" } } diff --git a/packages/actions/package.json b/packages/actions/package.json index 69c3a0c0d..d096c7186 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/actions", + "name": "@dev-spendesk/fab-actions", "version": "1.0.0-rc.10", "private": false, "description": "The guts of the FAB cli code, keeping the 'fab' package lean", @@ -31,7 +31,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@rollup/plugin-alias": "^2.2.0", "@rollup/plugin-commonjs": "^11.0.2", diff --git a/packages/actions/src/Builder.ts b/packages/actions/src/Builder.ts index f36be933d..5be3032bc 100644 --- a/packages/actions/src/Builder.ts +++ b/packages/actions/src/Builder.ts @@ -8,7 +8,7 @@ import { InvalidConfigError, isRelative, relativeToConfig, -} from '@dev-spendesk/cli' +} from '@dev-spendesk/fab-cli' import * as path from 'path' const log = _log('Builder') diff --git a/packages/actions/src/Compiler.ts b/packages/actions/src/Compiler.ts index ba91e41df..25a7a6f31 100644 --- a/packages/actions/src/Compiler.ts +++ b/packages/actions/src/Compiler.ts @@ -1,5 +1,5 @@ import { FabConfig, ProtoFab, RuntimePlugin } from '@dev-spendesk/core' -import { _log, BuildFailedError } from '@dev-spendesk/cli' +import { _log, BuildFailedError } from '@dev-spendesk/fab-cli' import { rollupCompile } from './rollup' const log = _log(`Compiler`) @@ -16,7 +16,7 @@ export class Compiler { const warnings: string[] = [] const { output: [output, ...chunks], - } = await rollupCompile(require.resolve('@dev-spendesk/actions/esm/runtime'), { + } = await rollupCompile(require.resolve('@dev-spendesk/fab-actions/esm/runtime'), { minify, output: { format: 'umd', exports: 'named', name: '__fab' }, hypotheticals: { diff --git a/packages/actions/src/Deployer.ts b/packages/actions/src/Deployer.ts index 8771e80a8..5b0b66061 100644 --- a/packages/actions/src/Deployer.ts +++ b/packages/actions/src/Deployer.ts @@ -14,7 +14,7 @@ import { JSON5Config, loadOrInstallModule, loadOrInstallModules, -} from '@dev-spendesk/cli' +} from '@dev-spendesk/fab-cli' const log = _log('Deployer') diff --git a/packages/actions/src/Generator.ts b/packages/actions/src/Generator.ts index 4bea0d6ac..b033f5b0f 100644 --- a/packages/actions/src/Generator.ts +++ b/packages/actions/src/Generator.ts @@ -4,7 +4,7 @@ import path from 'path' import util from 'util' // @ts-ignore import _zip from 'deterministic-zip' -import { _log, BuildFailedError } from '@dev-spendesk/cli' +import { _log, BuildFailedError } from '@dev-spendesk/fab-cli' import pretty from 'pretty-bytes' const zip = util.promisify(_zip) diff --git a/packages/actions/src/Packager.ts b/packages/actions/src/Packager.ts index 59ab37d3a..7756e544c 100644 --- a/packages/actions/src/Packager.ts +++ b/packages/actions/src/Packager.ts @@ -6,7 +6,7 @@ import { HOSTING_PROVIDERS, PackageFn, } from '@dev-spendesk/core' -import { _log, FabPackageError, loadModule } from '@dev-spendesk/cli' +import { _log, FabPackageError, loadModule } from '@dev-spendesk/fab-cli' const log = _log(`Packager`) diff --git a/packages/actions/src/Typecheck.ts b/packages/actions/src/Typecheck.ts index c2ad56e14..5e7fa2aca 100644 --- a/packages/actions/src/Typecheck.ts +++ b/packages/actions/src/Typecheck.ts @@ -1,4 +1,4 @@ -import { _log } from '@dev-spendesk/cli' +import { _log } from '@dev-spendesk/fab-cli' import execa from 'execa' import path from 'path' import tmp from 'tmp-promise' diff --git a/packages/actions/src/rollup.ts b/packages/actions/src/rollup.ts index 990eaa87d..1266d164c 100644 --- a/packages/actions/src/rollup.ts +++ b/packages/actions/src/rollup.ts @@ -10,7 +10,7 @@ import alias from '@rollup/plugin-alias' // @ts-ignore import hypothetical from 'rollup-plugin-hypothetical' -import { _log } from '@dev-spendesk/cli' +import { _log } from '@dev-spendesk/fab-cli' const log = _log(`rollup`) export async function rollupCompile( diff --git a/packages/actions/test/actions/Builder.test.ts b/packages/actions/test/actions/Builder.test.ts index de1cf2252..64d9a6910 100644 --- a/packages/actions/test/actions/Builder.test.ts +++ b/packages/actions/test/actions/Builder.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai' import Builder from '../../src/Builder' -import { JSON5Config } from '@dev-spendesk/cli' +import { JSON5Config } from '@dev-spendesk/fab-cli' import path from 'path' import { captureStdout } from '../helpers' diff --git a/packages/actions/test/actions/Compiler.test.ts b/packages/actions/test/actions/Compiler.test.ts index 808f42cb5..3e9045f4e 100644 --- a/packages/actions/test/actions/Compiler.test.ts +++ b/packages/actions/test/actions/Compiler.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai' import { Compiler } from '../../src/Compiler' -import { JSON5Config } from '@dev-spendesk/cli' +import { JSON5Config } from '@dev-spendesk/fab-cli' import { captureStdout } from '../helpers' import { ProtoFab } from '@dev-spendesk/core' diff --git a/packages/cli/package.json b/packages/cli/package.json index f83cad2d6..e77ca2dcf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/cli", + "name": "@dev-spendesk/fab-cli", "version": "1.0.0-rc.10", "description": "The CLI entry-point for the FAB ecosystem", "keywords": [ diff --git a/packages/cli/src/Initializer/constants.ts b/packages/cli/src/Initializer/constants.ts index b6f8cd88a..418ed2cf2 100644 --- a/packages/cli/src/Initializer/constants.ts +++ b/packages/cli/src/Initializer/constants.ts @@ -1,7 +1,7 @@ export const DEFAULT_DEPS = [ - '@dev-spendesk/cli', - '@dev-spendesk/server', - '@dev-spendesk/actions', + '@dev-spendesk/fab-cli', + '@dev-spendesk/fab-server', + '@dev-spendesk/fab-actions', ] export const DEPRECATED_PACKAGES = [ '@dev-spendesk/static', diff --git a/packages/cli/src/Initializer/index.ts b/packages/cli/src/Initializer/index.ts index 565200c8c..e87e9ddf0 100644 --- a/packages/cli/src/Initializer/index.ts +++ b/packages/cli/src/Initializer/index.ts @@ -39,7 +39,7 @@ const promptWithDefault = async ( } const getLatestFabCli = async () => { - const response = await fetch('https://registry.npmjs.org/@dev-spendesk/cli/latest') + const response = await fetch('https://registry.npmjs.org/@dev-spendesk/fab-cli/latest') const data = await response.json() if (data && data.version) { const installed = JSON.parse( @@ -47,7 +47,7 @@ const getLatestFabCli = async () => { ) if (installed.version !== data.version) { log( - `๐Ÿ’šNOTE๐Ÿ’š: You have ๐Ÿ–ค@dev-spendesk/cli๐Ÿ–ค ๐Ÿ’›${installed.version}๐Ÿ’›, latest available on NPM is ๐Ÿ’›${data.version}๐Ÿ’›.` + `๐Ÿ’šNOTE๐Ÿ’š: You have ๐Ÿ–ค@dev-spendesk/fab-cli๐Ÿ–ค ๐Ÿ’›${installed.version}๐Ÿ’›, latest available on NPM is ๐Ÿ’›${data.version}๐Ÿ’›.` ) } } @@ -149,7 +149,7 @@ export default class Initializer { โ€ข Generate a ๐Ÿ’›fab.config.json5๐Ÿ’› file for your project โ€ข Add ๐Ÿ’›build:fab๐Ÿ’› and related scripts to your ๐Ÿ’›package.json๐Ÿ’› โ€ข Add ๐Ÿ’›.fab๐Ÿ’› and ๐Ÿ’›fab.zip๐Ÿ’› to your ๐Ÿ’›.gitignore๐Ÿ’› - โ€ข Install ๐Ÿ’›@dev-spendesk/cli๐Ÿ’› and related dependencies using ๐Ÿ’›${ + โ€ข Install ๐Ÿ’›@dev-spendesk/fab-cli๐Ÿ’› and related dependencies using ๐Ÿ’›${ use_yarn ? 'yarn' : 'npm' }๐Ÿ’›`) const confirmed = await log.confirmAndRespond(`Good to go? [y/N]`) diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts index bad82fc8c..252c47417 100644 --- a/packages/cli/src/commands/build.ts +++ b/packages/cli/src/commands/build.ts @@ -40,7 +40,7 @@ export default class Build extends Command { async run() { const { args, flags } = this.parse(Build) - const { Builder } = require('@dev-spendesk/actions').default as FabActionsExports + const { Builder } = require('@dev-spendesk/fab-actions').default as FabActionsExports await watcher(flags.watch, async () => { const config = await JSON5Config.readFrom(flags.config!) diff --git a/packages/cli/src/commands/deploy.ts b/packages/cli/src/commands/deploy.ts index 1ec85f486..b56ac5c60 100644 --- a/packages/cli/src/commands/deploy.ts +++ b/packages/cli/src/commands/deploy.ts @@ -74,7 +74,7 @@ export default class Deploy extends Command { const file = specified_file || default_file const config = await JSON5Config.readFrom(flags.config!) - const { Deployer } = require('@dev-spendesk/actions').default as FabActionsExports + const { Deployer } = require('@dev-spendesk/fab-actions').default as FabActionsExports await Deployer.deploy( config, file, diff --git a/packages/cli/src/commands/package.ts b/packages/cli/src/commands/package.ts index 27fabf7d7..e3ac1648b 100644 --- a/packages/cli/src/commands/package.ts +++ b/packages/cli/src/commands/package.ts @@ -50,7 +50,7 @@ export default class Deploy extends Command { this.error(`You must provide a target. Available options: ${hosts.join(', ')}`) } const config = await JSON5Config.readFrom(flags.config!) - const { Packager } = require('@dev-spendesk/actions').default as FabActionsExports + const { Packager } = require('@dev-spendesk/fab-actions').default as FabActionsExports await Packager.package( file, config.data, diff --git a/packages/cli/src/commands/serve.ts b/packages/cli/src/commands/serve.ts index dff013262..233f007ea 100644 --- a/packages/cli/src/commands/serve.ts +++ b/packages/cli/src/commands/serve.ts @@ -84,7 +84,7 @@ export default class Serve extends Command { log.announce(`fab serve`) const server_pkg = ( - await loadOrInstallModule(log, '@dev-spendesk/server', flags['auto-install']) + await loadOrInstallModule(log, '@dev-spendesk/fab-server', flags['auto-install']) ).default as FabServerExports const server = server_pkg.createServer(file, flags as ServerArgs) await server.serve( diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index ab9c93117..1a1659086 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -4,7 +4,7 @@ * Be careful what you import in this project, everything needs to be Rollup-compatible * and runnable inside a FAB, since FAB runtime components will import this. * - * For build-time-specific code, use @dev-spendesk/cli + * For build-time-specific code, use @dev-spendesk/fab-cli * * */ diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 70af395cc..a32474ace 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -151,7 +151,7 @@ export enum SandboxType { /* * The outermost FAB exported functions, that cross the boundary - * between the platform-specific runtimes (@dev-spendesk/server, + * between the platform-specific runtimes (@dev-spendesk/fab-server, * @dev-spendesk/cf-workers-wrapper, Linc.sh etc) and the FAB itself. * */ export type FabSpecRender = ( diff --git a/packages/deployer-aws-lambda/package.json b/packages/deployer-aws-lambda/package.json index 313cadc18..87e0be24e 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -33,7 +33,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@types/nanoid": "^2.1.0", "@types/node": "^12.12.14", diff --git a/packages/deployer-aws-lambda/src/deploy.ts b/packages/deployer-aws-lambda/src/deploy.ts index b99be1030..0d56d2427 100644 --- a/packages/deployer-aws-lambda/src/deploy.ts +++ b/packages/deployer-aws-lambda/src/deploy.ts @@ -1,7 +1,7 @@ import { ConfigTypes, FabServerDeployer, FabSettings } from '@dev-spendesk/core' import { createPackage } from './createPackage' import path from 'path' -import { InvalidConfigError } from '@dev-spendesk/cli' +import { InvalidConfigError } from '@dev-spendesk/fab-cli' import { updateCloudFront, updateLambda } from './aws' import { log } from './utils' diff --git a/packages/deployer-aws-lambda/src/utils.ts b/packages/deployer-aws-lambda/src/utils.ts index 2747e9b4f..473c4619c 100644 --- a/packages/deployer-aws-lambda/src/utils.ts +++ b/packages/deployer-aws-lambda/src/utils.ts @@ -1,3 +1,3 @@ -import { _log } from '@dev-spendesk/cli' +import { _log } from '@dev-spendesk/fab-cli' export const log = _log(`@dev-spendesk/deployer-aws-lambda`) diff --git a/packages/deployer-aws-lambda/templates/index.js b/packages/deployer-aws-lambda/templates/index.js index f175638e7..ddc428171 100644 --- a/packages/deployer-aws-lambda/templates/index.js +++ b/packages/deployer-aws-lambda/templates/index.js @@ -23,7 +23,7 @@ const enhanced_fetch = (url, init) => { return node_fetch(url, init) } -// Currently copied from @dev-spendesk/server. In the future, if the caching layer becomes +// Currently copied from @dev-spendesk/fab-server. In the future, if the caching layer becomes // configurable for a deploy (e.g. ElastiCache), then this should be moved to a // @dev-spendesk/cache-node-inmemory package alongside a @dev-spendesk/cache-aws-elasticache one. diff --git a/packages/deployer-aws-s3/package.json b/packages/deployer-aws-s3/package.json index 60e5d2596..5466db8b5 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -32,7 +32,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@types/node": "^12.12.14", "aws-sdk": "^2.655.0", diff --git a/packages/deployer-aws-s3/src/utils.ts b/packages/deployer-aws-s3/src/utils.ts index 96b65567f..c416d28f0 100644 --- a/packages/deployer-aws-s3/src/utils.ts +++ b/packages/deployer-aws-s3/src/utils.ts @@ -1,3 +1,3 @@ -import { _log } from '@dev-spendesk/cli' +import { _log } from '@dev-spendesk/fab-cli' export const log = _log('@dev-spendesk/deployer-aws-s3') diff --git a/packages/deployer-cf-workers/package.json b/packages/deployer-cf-workers/package.json index 424a51c55..60e49a690 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -33,7 +33,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@types/node": "^12.12.14", "cross-fetch": "^3.0.6", diff --git a/packages/deployer-cf-workers/src/createPackage.ts b/packages/deployer-cf-workers/src/createPackage.ts index 19d87a9d5..f902c3ebe 100644 --- a/packages/deployer-cf-workers/src/createPackage.ts +++ b/packages/deployer-cf-workers/src/createPackage.ts @@ -1,5 +1,5 @@ import { ConfigTypes, FabPackager, FabSettings } from '@dev-spendesk/core' -import { FabPackageError } from '@dev-spendesk/cli' +import { FabPackageError } from '@dev-spendesk/fab-cli' import { log } from './utils' import path from 'path' diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index 8bd0b69f6..6b9cf77dc 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -7,7 +7,7 @@ import { getContentType, } from '@dev-spendesk/core' import { CloudflareApi, getCloudflareApi, log } from './utils' -import { FabDeployError, InvalidConfigError } from '@dev-spendesk/cli' +import { FabDeployError, InvalidConfigError } from '@dev-spendesk/fab-cli' import { createPackage } from './createPackage' import path from 'path' import fs from 'fs-extra' diff --git a/packages/deployer-cf-workers/src/utils.ts b/packages/deployer-cf-workers/src/utils.ts index c31dc0a19..42ef9b1c2 100644 --- a/packages/deployer-cf-workers/src/utils.ts +++ b/packages/deployer-cf-workers/src/utils.ts @@ -1,4 +1,4 @@ -import { _log, InvalidConfigError, FabDeployError } from '@dev-spendesk/cli' +import { _log, InvalidConfigError, FabDeployError } from '@dev-spendesk/fab-cli' export const log = _log(`@dev-spendesk/deployer-cf-workers`) import fetch from 'cross-fetch' diff --git a/packages/input-nextjs/package.json b/packages/input-nextjs/package.json index dd6ecd834..e59debb1a 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -34,7 +34,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@types/node": "^12.12.14", "@types/path-to-regexp": "^1.7.0", diff --git a/packages/input-nextjs/src/build.ts b/packages/input-nextjs/src/build.ts index 0bce0faf4..be6acbb4a 100644 --- a/packages/input-nextjs/src/build.ts +++ b/packages/input-nextjs/src/build.ts @@ -1,7 +1,7 @@ import { InputNextJSArgs, InputNextJSMetadata } from './types' import { FabBuildStep } from '@dev-spendesk/core' import path from 'path' -import { InvalidConfigError, _log } from '@dev-spendesk/cli' +import { InvalidConfigError, _log } from '@dev-spendesk/fab-cli' import { preflightChecks } from './preflightChecks' import globby from 'globby' import fs from 'fs-extra' diff --git a/packages/input-nextjs/src/preflightChecks.ts b/packages/input-nextjs/src/preflightChecks.ts index 1bfb67bb0..0df7538f4 100644 --- a/packages/input-nextjs/src/preflightChecks.ts +++ b/packages/input-nextjs/src/preflightChecks.ts @@ -1,7 +1,7 @@ import fs from 'fs-extra' import chalk from 'chalk' import path from 'path' -import { BuildFailedError } from '@dev-spendesk/cli' +import { BuildFailedError } from '@dev-spendesk/fab-cli' export async function preflightChecks( dir: string diff --git a/packages/input-static/package.json b/packages/input-static/package.json index 567cc1488..b98a9ac89 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -31,7 +31,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@types/node": "^12.12.14", "fs-extra": "^8.1.0", diff --git a/packages/input-static/src/build.ts b/packages/input-static/src/build.ts index 28c980526..17b39bfff 100644 --- a/packages/input-static/src/build.ts +++ b/packages/input-static/src/build.ts @@ -3,8 +3,8 @@ import { FabBuildStep } from '@dev-spendesk/core' import fs from 'fs-extra' import globby from 'globby' import path from 'path' -import { InvalidConfigError, relativeToConfig } from '@dev-spendesk/cli' -import { _log } from '@dev-spendesk/cli' +import { InvalidConfigError, relativeToConfig } from '@dev-spendesk/fab-cli' +import { _log } from '@dev-spendesk/fab-cli' const log = _log(`@dev-spendesk/input-static`) export const build: FabBuildStep = async ( diff --git a/packages/plugin-precompile/package.json b/packages/plugin-precompile/package.json index d4eaffe31..388b3b9f1 100644 --- a/packages/plugin-precompile/package.json +++ b/packages/plugin-precompile/package.json @@ -30,7 +30,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@sucrase/webpack-loader": "^2.0.0", "@types/node": "^12.12.14", diff --git a/packages/plugin-precompile/src/build.ts b/packages/plugin-precompile/src/build.ts index 4873af1af..0112d61a5 100644 --- a/packages/plugin-precompile/src/build.ts +++ b/packages/plugin-precompile/src/build.ts @@ -5,7 +5,7 @@ import { ConfigOverrides, PluginOverrides, } from './types' -import { _log } from '@dev-spendesk/cli' +import { _log } from '@dev-spendesk/fab-cli' import webpack from 'webpack' import fs from 'fs-extra' import path from 'path' diff --git a/packages/plugin-render-html/package.json b/packages/plugin-render-html/package.json index 168bcaf3f..fb88d903a 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -30,7 +30,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@types/cheerio": "^0.22.15", "@types/node": "^12.12.14", diff --git a/packages/plugin-render-html/src/build.ts b/packages/plugin-render-html/src/build.ts index 3caa72915..242308fb8 100644 --- a/packages/plugin-render-html/src/build.ts +++ b/packages/plugin-render-html/src/build.ts @@ -4,7 +4,7 @@ import cheerio from 'cheerio' import { tokenize } from 'micromustache' import { DEFAULT_INJECTIONS } from './constants' import { addInjectionPoint } from './injections/env' -import { InvalidConfigError, _log } from '@dev-spendesk/cli' +import { InvalidConfigError, _log } from '@dev-spendesk/fab-cli' import hasha from 'hasha' import path from 'path' diff --git a/packages/plugin-rewire-assets/package.json b/packages/plugin-rewire-assets/package.json index 783a58665..25b50ec82 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -32,7 +32,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@types/istextorbinary": "^2.3.0", "@types/mime-types": "^2.1.0", diff --git a/packages/plugin-rewire-assets/src/build.ts b/packages/plugin-rewire-assets/src/build.ts index 8358a4680..be8eec810 100644 --- a/packages/plugin-rewire-assets/src/build.ts +++ b/packages/plugin-rewire-assets/src/build.ts @@ -7,7 +7,7 @@ import { } from './types' import hasha from 'hasha' import path from 'path' -import { InvalidConfigError, _log } from '@dev-spendesk/cli' +import { InvalidConfigError, _log } from '@dev-spendesk/fab-cli' // @ts-ignore import { isBinaryPromise } from 'istextorbinary' import { DEFAULT_IMMUTABILITY_CHECK } from './constants' diff --git a/packages/server/package.json b/packages/server/package.json index 5640ba4c8..276bf7559 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/server", + "name": "@dev-spendesk/fab-server", "version": "1.0.0-rc.10", "description": "NodeJS FAB Server", "keywords": [ @@ -30,7 +30,7 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/cli": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.10", "@dev-spendesk/core": "1.0.0-rc.10", "@dev-spendesk/sandbox-node-vm": "1.0.0-rc.10", "@fly/v8env": "^0.54.0", diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index a707f8790..14385f3c9 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -10,7 +10,12 @@ import { ServerConstructor, ServerType, } from '@dev-spendesk/core' -import { _log, InvalidConfigError, FabServerError, JSON5Config } from '@dev-spendesk/cli' +import { + _log, + InvalidConfigError, + FabServerError, + JSON5Config, +} from '@dev-spendesk/fab-cli' import { readFilesFromZip } from './utils' import v8_sandbox from './sandboxes/v8-isolate' import { Cache } from './cache' @@ -26,7 +31,7 @@ import concat from 'concat-stream' import fetch, { Request as NodeFetchRequest } from 'cross-fetch' import { pathToSHA512 } from 'file-to-sha512' import Stream from 'stream' -import { watcher } from '@dev-spendesk/cli' +import { watcher } from '@dev-spendesk/fab-cli' import httpProxy from 'http-proxy' // @ts-ignore import nodeToWebStream from 'readable-stream-node-to-web' diff --git a/tests/e2e/fixtures/server-side-logic/package.json b/tests/e2e/fixtures/server-side-logic/package.json index 67f1ced4d..1a6b15d4e 100644 --- a/tests/e2e/fixtures/server-side-logic/package.json +++ b/tests/e2e/fixtures/server-side-logic/package.json @@ -6,12 +6,12 @@ "fab:serve": "fab serve fab.zip" }, "dependencies": { - "@dev-spendesk/actions": "latest", - "@dev-spendesk/cli": "latest", + "@dev-spendesk/fab-actions": "latest", + "@dev-spendesk/fab-cli": "latest", "@dev-spendesk/input-static": "latest", "@dev-spendesk/plugin-render-html": "latest", "@dev-spendesk/plugin-rewire-assets": "latest", "@dev-spendesk/plugin-precompile": "latest", - "@dev-spendesk/server": "latest" + "@dev-spendesk/fab-server": "latest" } } From 42dc0672a3fa0c23d94cacce02fe828cb8868ddd Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Wed, 23 Feb 2022 18:36:20 +0100 Subject: [PATCH 09/23] Edit package refs --- docs/redirects.ts | 2 +- docs/wip/blog-aliases.ts | 2 +- docs/wip/redirect-old-blog-urls.js | 2 +- lint-staged.config.js | 8 ++++---- packages/actions/package.json | 2 +- packages/actions/src/Builder.ts | 2 +- packages/actions/src/Compiler.ts | 2 +- packages/actions/src/Deployer.ts | 2 +- packages/actions/src/Generator.ts | 4 ++-- packages/actions/src/Packager.ts | 2 +- packages/actions/src/Typecheck.ts | 2 +- packages/actions/src/index.ts | 2 +- packages/actions/src/runtime/final_responder.ts | 2 +- packages/actions/src/runtime/index.ts | 2 +- packages/actions/test/actions/Compiler.test.ts | 2 +- .../fixtures/plugins/typescript-example/build.ts | 2 +- .../fixtures/plugins/typescript-example/runtime.ts | 2 +- .../fixtures/plugins/typescript-example/types.ts | 2 +- packages/cli/package.json | 2 +- packages/cli/src/Initializer/frameworks.ts | 14 +++++++------- packages/cli/src/Initializer/index.ts | 2 +- packages/cli/src/commands/build.ts | 2 +- packages/cli/src/commands/deploy.ts | 2 +- packages/cli/src/commands/init.ts | 2 +- packages/cli/src/commands/package.ts | 2 +- packages/cli/src/commands/serve.ts | 2 +- packages/cli/src/errors/MissingConfig.ts | 2 +- packages/cli/src/helpers/JSON5Config.ts | 2 +- packages/core/package.json | 2 +- packages/core/src/constants.ts | 4 ++-- packages/core/src/index.ts | 2 +- packages/core/src/runtime.ts | 2 +- packages/core/test/ProtoFab.test.ts | 2 +- packages/deployer-aws-lambda/package.json | 2 +- packages/deployer-aws-lambda/src/createPackage.ts | 2 +- packages/deployer-aws-lambda/src/deploy.ts | 2 +- packages/deployer-aws-s3/package.json | 4 ++-- packages/deployer-aws-s3/src/aws.ts | 2 +- packages/deployer-aws-s3/src/index.ts | 2 +- packages/deployer-aws-s3/src/utils.ts | 2 +- packages/deployer-cf-workers/package.json | 4 ++-- packages/deployer-cf-workers/src/createPackage.ts | 2 +- packages/deployer-cf-workers/src/deploy.ts | 2 +- .../deployer-cf-workers/src/templateInjections.ts | 2 +- packages/deployer-cf-workers/src/utils.ts | 2 +- packages/input-nextjs/package.json | 4 ++-- packages/input-nextjs/src/build.ts | 6 +++--- packages/input-nextjs/src/generateRenderer.ts | 2 +- packages/input-nextjs/src/mergeWebpacks.ts | 2 +- packages/input-nextjs/src/runtime.ts | 2 +- packages/input-nextjs/src/types.ts | 2 +- packages/input-static/package.json | 4 ++-- packages/input-static/src/build.ts | 10 +++++----- packages/input-static/src/types.ts | 2 +- packages/input-static/test/build.test.ts | 4 ++-- packages/input-static/test/errors.test.ts | 12 ++++++------ packages/plugin-precompile/package.json | 4 ++-- packages/plugin-precompile/src/build.ts | 6 +++--- packages/plugin-precompile/src/types.ts | 2 +- packages/plugin-render-html/package.json | 4 ++-- packages/plugin-render-html/src/build.ts | 8 ++++---- packages/plugin-render-html/src/injections/env.ts | 2 +- packages/plugin-render-html/src/runtime.ts | 2 +- packages/plugin-render-html/src/types.ts | 2 +- packages/plugin-render-html/test/build.test.ts | 2 +- packages/plugin-render-html/test/runtime.test.ts | 2 +- packages/plugin-rewire-assets/package.json | 4 ++-- packages/plugin-rewire-assets/src/build.ts | 8 ++++++-- packages/plugin-rewire-assets/src/runtime.ts | 2 +- packages/plugin-rewire-assets/src/types.ts | 2 +- packages/plugin-rewire-assets/test/build.test.ts | 2 +- packages/sandbox-node-vm/package.json | 4 ++-- packages/sandbox-node-vm/src/index.ts | 2 +- packages/server/package.json | 4 ++-- packages/server/src/cache.ts | 4 ++-- packages/server/src/index.ts | 6 +++--- packages/server/src/sandboxes/v8-isolate.ts | 2 +- tests/e2e/cli-errors.test.ts | 6 ++++-- tests/e2e/create-react-app.test.ts | 2 +- .../fab-plugins/add-bundle-id/runtime.ts | 2 +- .../server-side-logic/fab-plugins/cache.ts | 2 +- .../server-side-logic/fab-plugins/check-cookie.ts | 2 +- .../server-side-logic/fab-plugins/geolocate.ts | 2 +- .../server-side-logic/fab-plugins/hello-world.ts | 2 +- .../server-side-logic/fab-plugins/slowly.ts | 2 +- .../server-side-logic/modify-plugin-config.js | 4 +++- tests/e2e/fixtures/server-side-logic/package.json | 8 ++++---- 87 files changed, 140 insertions(+), 132 deletions(-) diff --git a/docs/redirects.ts b/docs/redirects.ts index bdb13fcb4..08876547c 100644 --- a/docs/redirects.ts +++ b/docs/redirects.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@fab/core' +import { FABRuntime } from '@dev-spendesk/fab-core' const redirects = { '/kb/plugins': '/plugins/introduction', diff --git a/docs/wip/blog-aliases.ts b/docs/wip/blog-aliases.ts index e7739547a..030a24ef9 100644 --- a/docs/wip/blog-aliases.ts +++ b/docs/wip/blog-aliases.ts @@ -6,7 +6,7 @@ import { FabPluginRuntime, PluginMetadata, FabSettings, -} from '@fab/core' +} from '@dev-spendesk/fab-core' export const build: FabBuildStep = async (args: PluginArgs, proto_fab: ProtoFab) => { const plugin_metadata: PluginMetadataContent = {} diff --git a/docs/wip/redirect-old-blog-urls.js b/docs/wip/redirect-old-blog-urls.js index 0764a859e..567b61eae 100644 --- a/docs/wip/redirect-old-blog-urls.js +++ b/docs/wip/redirect-old-blog-urls.js @@ -1,6 +1,6 @@ // server/redirect-old-blog-urls/runtime.js -import { Runtime } from '@fab/core/runtime' +import { Runtime } from '@dev-spendesk/fab-core/runtime' // We register a handler to match the old posts Runtime.on('/posts/:id', async (matches, { request, settings, url }) => { diff --git a/lint-staged.config.js b/lint-staged.config.js index 9270453cc..f2c9d15af 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,12 +1,12 @@ module.exports = { '*.{js,css,json,md,ts}': ['prettier --write', 'git add'], '*.ts': [ - // For some reason, some IDE's auto-import feature will import '@dev-spendesk/core/src' - // instead of '@dev-spendesk/core'. This causes really weird TypeScript output. + // For some reason, some IDE's auto-import feature will import '@dev-spendesk/fab-core/src' + // instead of '@dev-spendesk/fab-core'. This causes really weird TypeScript output. (files) => `bash -c "${[ - "echo '=== Change @dev-spendesk/core/src to @dev-spendesk/core in the following files: ==='", - `grep -l @dev-spendesk/core/src ${files.join(' ')}; test $? -eq 1`, + "echo '=== Change @dev-spendesk/fab-core/src to @dev-spendesk/fab-core in the following files: ==='", + `grep -l @dev-spendesk/fab-core/src ${files.join(' ')}; test $? -eq 1`, ].join(' && ')}"`, ], } diff --git a/packages/actions/package.json b/packages/actions/package.json index d096c7186..6fbfc06c1 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -32,7 +32,7 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@rollup/plugin-alias": "^2.2.0", "@rollup/plugin-commonjs": "^11.0.2", "@rollup/plugin-inject": "^4.0.1", diff --git a/packages/actions/src/Builder.ts b/packages/actions/src/Builder.ts index 5be3032bc..5ad1ef6b8 100644 --- a/packages/actions/src/Builder.ts +++ b/packages/actions/src/Builder.ts @@ -1,4 +1,4 @@ -import { LoadedPlugin, RuntimePlugin, FabConfig, ProtoFab } from '@dev-spendesk/core' +import { LoadedPlugin, RuntimePlugin, FabConfig, ProtoFab } from '@dev-spendesk/fab-core' import { Compiler } from './Compiler' import { Generator } from './Generator' import { Typecheck } from './Typecheck' diff --git a/packages/actions/src/Compiler.ts b/packages/actions/src/Compiler.ts index 25a7a6f31..3913b4f69 100644 --- a/packages/actions/src/Compiler.ts +++ b/packages/actions/src/Compiler.ts @@ -1,4 +1,4 @@ -import { FabConfig, ProtoFab, RuntimePlugin } from '@dev-spendesk/core' +import { FabConfig, ProtoFab, RuntimePlugin } from '@dev-spendesk/fab-core' import { _log, BuildFailedError } from '@dev-spendesk/fab-cli' import { rollupCompile } from './rollup' diff --git a/packages/actions/src/Deployer.ts b/packages/actions/src/Deployer.ts index 5b0b66061..b2f6049b7 100644 --- a/packages/actions/src/Deployer.ts +++ b/packages/actions/src/Deployer.ts @@ -6,7 +6,7 @@ import { FabDeployerExports, FabSettings, HOSTING_PROVIDERS, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { _log, FabDeployError, diff --git a/packages/actions/src/Generator.ts b/packages/actions/src/Generator.ts index b033f5b0f..88f63f51b 100644 --- a/packages/actions/src/Generator.ts +++ b/packages/actions/src/Generator.ts @@ -1,4 +1,4 @@ -import { ProtoFab } from '@dev-spendesk/core' +import { ProtoFab } from '@dev-spendesk/fab-core' import fs from 'fs-extra' import path from 'path' import util from 'util' @@ -17,7 +17,7 @@ export class Generator { if (invalid_reason) { throw new BuildFailedError(`FAB is not ready for compilation. ${invalid_reason} - You might need to add @dev-spendesk/plugin-rewire-assets to your 'build' config. See https://fab.dev/packages/rewire-assets for more information about what this module is and why it's needed. + You might need to add @dev-spendesk/fab-plugin-rewire-assets to your 'build' config. See https://fab.dev/packages/rewire-assets for more information about what this module is and why it's needed. `) } diff --git a/packages/actions/src/Packager.ts b/packages/actions/src/Packager.ts index 7756e544c..4f35f8554 100644 --- a/packages/actions/src/Packager.ts +++ b/packages/actions/src/Packager.ts @@ -5,7 +5,7 @@ import { FabPackagerExports, HOSTING_PROVIDERS, PackageFn, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { _log, FabPackageError, loadModule } from '@dev-spendesk/fab-cli' const log = _log(`Packager`) diff --git a/packages/actions/src/Typecheck.ts b/packages/actions/src/Typecheck.ts index 5e7fa2aca..766b677a8 100644 --- a/packages/actions/src/Typecheck.ts +++ b/packages/actions/src/Typecheck.ts @@ -3,7 +3,7 @@ import execa from 'execa' import path from 'path' import tmp from 'tmp-promise' import fs from 'fs-extra' -import { RuntimePlugin } from '@dev-spendesk/core' +import { RuntimePlugin } from '@dev-spendesk/fab-core' const log = _log('Typecheck') diff --git a/packages/actions/src/index.ts b/packages/actions/src/index.ts index 2d8941fa5..ecac9348d 100644 --- a/packages/actions/src/index.ts +++ b/packages/actions/src/index.ts @@ -1,4 +1,4 @@ -import { FabActionsExports } from '@dev-spendesk/core' +import { FabActionsExports } from '@dev-spendesk/fab-core' import Packager from './Packager' import Deployer from './Deployer' import Builder from './Builder' diff --git a/packages/actions/src/runtime/final_responder.ts b/packages/actions/src/runtime/final_responder.ts index 720141cd3..2fb9854a3 100644 --- a/packages/actions/src/runtime/final_responder.ts +++ b/packages/actions/src/runtime/final_responder.ts @@ -3,7 +3,7 @@ import { FabPluginRuntime, NO_RESPONSE_STATUS_CODE, Priority, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' const FinalResponder: FabPluginRuntime = ({ Router }: FABRuntime) => { Router.onAll(async ({ url }) => { diff --git a/packages/actions/src/runtime/index.ts b/packages/actions/src/runtime/index.ts index c4e38fa33..7e8ae42a4 100644 --- a/packages/actions/src/runtime/index.ts +++ b/packages/actions/src/runtime/index.ts @@ -12,7 +12,7 @@ import { NO_RESPONSE_STATUS_CODE, ResponseInterceptor, RuntimeImports, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import final_responder from './final_responder' // @ts-ignore diff --git a/packages/actions/test/actions/Compiler.test.ts b/packages/actions/test/actions/Compiler.test.ts index 3e9045f4e..04f10bd44 100644 --- a/packages/actions/test/actions/Compiler.test.ts +++ b/packages/actions/test/actions/Compiler.test.ts @@ -2,7 +2,7 @@ import { expect } from 'chai' import { Compiler } from '../../src/Compiler' import { JSON5Config } from '@dev-spendesk/fab-cli' import { captureStdout } from '../helpers' -import { ProtoFab } from '@dev-spendesk/core' +import { ProtoFab } from '@dev-spendesk/fab-core' describe('Compiler', function() { this.timeout(10000) diff --git a/packages/actions/test/fixtures/plugins/typescript-example/build.ts b/packages/actions/test/fixtures/plugins/typescript-example/build.ts index c70aba19e..ba3926074 100644 --- a/packages/actions/test/fixtures/plugins/typescript-example/build.ts +++ b/packages/actions/test/fixtures/plugins/typescript-example/build.ts @@ -1,4 +1,4 @@ -import { FabBuildStep } from '@dev-spendesk/core' +import { FabBuildStep } from '@dev-spendesk/fab-core' import { TsExampleMetadata, TsExampleArgs } from './types' export const build: FabBuildStep = async ( diff --git a/packages/actions/test/fixtures/plugins/typescript-example/runtime.ts b/packages/actions/test/fixtures/plugins/typescript-example/runtime.ts index 660b2e2aa..2f63bb8b6 100644 --- a/packages/actions/test/fixtures/plugins/typescript-example/runtime.ts +++ b/packages/actions/test/fixtures/plugins/typescript-example/runtime.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@dev-spendesk/core' +import { FABRuntime } from '@dev-spendesk/fab-core' import { TsExampleArgs, TsExampleMetadata } from './types' export default function TypescriptExampleRuntime( diff --git a/packages/actions/test/fixtures/plugins/typescript-example/types.ts b/packages/actions/test/fixtures/plugins/typescript-example/types.ts index c5f6762e7..5ee04621d 100644 --- a/packages/actions/test/fixtures/plugins/typescript-example/types.ts +++ b/packages/actions/test/fixtures/plugins/typescript-example/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/fab-core' export interface TsExampleArgs extends PluginArgs { the_time_is: string diff --git a/packages/cli/package.json b/packages/cli/package.json index e77ca2dcf..cf82b4422 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -35,7 +35,7 @@ "version": "oclif-dev readme && git add README.md" }, "dependencies": { - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/errors": "^1", diff --git a/packages/cli/src/Initializer/frameworks.ts b/packages/cli/src/Initializer/frameworks.ts index 275d19793..8ad453437 100644 --- a/packages/cli/src/Initializer/frameworks.ts +++ b/packages/cli/src/Initializer/frameworks.ts @@ -1,4 +1,4 @@ -import { BuildConfig } from '@dev-spendesk/core' +import { BuildConfig } from '@dev-spendesk/fab-core' import path from 'path' import fs from 'fs-extra' import { log } from './utils' @@ -9,13 +9,13 @@ const static_plugin_chain = ( dir: string, fallback: string | boolean = '/index.html' ) => ({ - '@dev-spendesk/input-static': { + '@dev-spendesk/fab-input-static': { dir, }, - '@dev-spendesk/plugin-render-html': { + '@dev-spendesk/fab-plugin-render-html': { fallback, }, - '@dev-spendesk/plugin-rewire-assets': {}, + '@dev-spendesk/fab-plugin-rewire-assets': {}, }) export type FrameworkInfo = { @@ -90,13 +90,13 @@ export const Frameworks = { plugins: export_build ? static_plugin_chain('out') : { - '@dev-spendesk/input-nextjs': { + '@dev-spendesk/fab-input-nextjs': { dir: '.next', }, - '@dev-spendesk/plugin-render-html': { + '@dev-spendesk/fab-plugin-render-html': { fallback: false, }, - '@dev-spendesk/plugin-rewire-assets': {}, + '@dev-spendesk/fab-plugin-rewire-assets': {}, }, async customConfig(root_dir: string) { if (export_build) return [] diff --git a/packages/cli/src/Initializer/index.ts b/packages/cli/src/Initializer/index.ts index e87e9ddf0..f5e6dc46c 100644 --- a/packages/cli/src/Initializer/index.ts +++ b/packages/cli/src/Initializer/index.ts @@ -16,7 +16,7 @@ import { } from './constants' import { FRAMEWORK_NAMES, FrameworkInfo, Frameworks, GenericStatic } from './frameworks' import { log, mergeScriptsAfterBuild } from './utils' -import { BuildConfig } from '@dev-spendesk/core' +import { BuildConfig } from '@dev-spendesk/fab-core' import execa from 'execa' import fetch from 'cross-fetch' diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts index 252c47417..46a7a976e 100644 --- a/packages/cli/src/commands/build.ts +++ b/packages/cli/src/commands/build.ts @@ -1,5 +1,5 @@ import { Command, flags } from '@oclif/command' -import { DEFAULT_CONFIG_FILENAME, FabActionsExports } from '@dev-spendesk/core' +import { DEFAULT_CONFIG_FILENAME, FabActionsExports } from '@dev-spendesk/fab-core' import { JSON5Config } from '../' import { watcher } from '../helpers/watcher' diff --git a/packages/cli/src/commands/deploy.ts b/packages/cli/src/commands/deploy.ts index b56ac5c60..867e08341 100644 --- a/packages/cli/src/commands/deploy.ts +++ b/packages/cli/src/commands/deploy.ts @@ -4,7 +4,7 @@ import { DeployProviders, FabActionsExports, HOSTING_PROVIDERS, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { JSON5Config } from '../' import fs from 'fs-extra' diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 97d5c1649..fdfcadf09 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -1,5 +1,5 @@ import { Command, flags } from '@oclif/command' -import { DEFAULT_CONFIG_FILENAME } from '@dev-spendesk/core' +import { DEFAULT_CONFIG_FILENAME } from '@dev-spendesk/fab-core' import Initializer from '../Initializer' export default class Init extends Command { diff --git a/packages/cli/src/commands/package.ts b/packages/cli/src/commands/package.ts index e3ac1648b..b3c7539df 100644 --- a/packages/cli/src/commands/package.ts +++ b/packages/cli/src/commands/package.ts @@ -3,7 +3,7 @@ import { DeployProviders, FabActionsExports, HOSTING_PROVIDERS, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { Command, flags } from '@oclif/command' import { JSON5Config } from '../' diff --git a/packages/cli/src/commands/serve.ts b/packages/cli/src/commands/serve.ts index 233f007ea..b814754dd 100644 --- a/packages/cli/src/commands/serve.ts +++ b/packages/cli/src/commands/serve.ts @@ -4,7 +4,7 @@ import { SandboxType, ServerArgs, FabServerExports, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { loadOrInstallModule, _log } from '../helpers' import fs from 'fs-extra' const log = _log(`Server`) diff --git a/packages/cli/src/errors/MissingConfig.ts b/packages/cli/src/errors/MissingConfig.ts index bdbff421e..d6b492488 100644 --- a/packages/cli/src/errors/MissingConfig.ts +++ b/packages/cli/src/errors/MissingConfig.ts @@ -1,5 +1,5 @@ import * as path from 'path' -import { DEFAULT_CONFIG_FILENAME } from '@dev-spendesk/core' +import { DEFAULT_CONFIG_FILENAME } from '@dev-spendesk/fab-core' import { log } from '../helpers' export class MissingConfig extends Error { diff --git a/packages/cli/src/helpers/JSON5Config.ts b/packages/cli/src/helpers/JSON5Config.ts index 5f486156a..e87f46184 100644 --- a/packages/cli/src/helpers/JSON5Config.ts +++ b/packages/cli/src/helpers/JSON5Config.ts @@ -5,7 +5,7 @@ import { REGEXP_VALUE_PATTERN, s_sume, JSON5ConfigI, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import jju from 'jju' import regexParser from 'regex-parser' import { InvalidConfigError, MissingConfig } from '../errors' diff --git a/packages/core/package.json b/packages/core/package.json index 760be236e..c19b32f86 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/core", + "name": "@dev-spendesk/fab-core", "version": "1.0.0-rc.10", "private": false, "description": "Common code for all FAB projects", diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 1a574a69d..96f638e33 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -54,7 +54,7 @@ export const HOSTING_PROVIDERS: { [key: string]: HostingProvider } = { 'cf-workers': { - package_name: '@dev-spendesk/deployer-cf-workers', + package_name: '@dev-spendesk/fab-deployer-cf-workers', capabilities: { server: true, assets: true, @@ -72,7 +72,7 @@ export const HOSTING_PROVIDERS: { extension: 'zip', }, 'aws-s3': { - package_name: '@dev-spendesk/deployer-aws-s3', + package_name: '@dev-spendesk/fab-deployer-aws-s3', capabilities: { server: false, assets: true, diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 1a1659086..ea123cb03 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,5 +1,5 @@ /* - * @dev-spendesk/core: Type definitions and helper methods + * @dev-spendesk/fab-core: Type definitions and helper methods * * Be careful what you import in this project, everything needs to be Rollup-compatible * and runnable inside a FAB, since FAB runtime components will import this. diff --git a/packages/core/src/runtime.ts b/packages/core/src/runtime.ts index e9faa19ac..f3a43e453 100644 --- a/packages/core/src/runtime.ts +++ b/packages/core/src/runtime.ts @@ -10,7 +10,7 @@ import { FABServerContext, PluginArgs, ResponseInterceptor, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { Key, pathToRegexp } from 'path-to-regexp' export enum Priority { diff --git a/packages/core/test/ProtoFab.test.ts b/packages/core/test/ProtoFab.test.ts index c4cedb567..31357e0bf 100644 --- a/packages/core/test/ProtoFab.test.ts +++ b/packages/core/test/ProtoFab.test.ts @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { ProtoFab } from '@dev-spendesk/core' +import { ProtoFab } from '@dev-spendesk/fab-core' describe('ProtoFab', () => { it('should be able to be created with no args', () => { diff --git a/packages/deployer-aws-lambda/package.json b/packages/deployer-aws-lambda/package.json index 87e0be24e..1961a9c46 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -34,7 +34,7 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@types/nanoid": "^2.1.0", "@types/node": "^12.12.14", "deterministic-zip": "^1.1.0", diff --git a/packages/deployer-aws-lambda/src/createPackage.ts b/packages/deployer-aws-lambda/src/createPackage.ts index e39188b9c..9cb5b876b 100644 --- a/packages/deployer-aws-lambda/src/createPackage.ts +++ b/packages/deployer-aws-lambda/src/createPackage.ts @@ -3,7 +3,7 @@ import { FabPackager, FabSettings, stripTrailingSlash, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import fs from 'fs-extra' import path from 'path' import nanoid from 'nanoid' diff --git a/packages/deployer-aws-lambda/src/deploy.ts b/packages/deployer-aws-lambda/src/deploy.ts index 0d56d2427..b20d8d746 100644 --- a/packages/deployer-aws-lambda/src/deploy.ts +++ b/packages/deployer-aws-lambda/src/deploy.ts @@ -1,4 +1,4 @@ -import { ConfigTypes, FabServerDeployer, FabSettings } from '@dev-spendesk/core' +import { ConfigTypes, FabServerDeployer, FabSettings } from '@dev-spendesk/fab-core' import { createPackage } from './createPackage' import path from 'path' import { InvalidConfigError } from '@dev-spendesk/fab-cli' diff --git a/packages/deployer-aws-s3/package.json b/packages/deployer-aws-s3/package.json index 5466db8b5..0e20c9f9a 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/deployer-aws-s3", + "name": "@dev-spendesk/fab-deployer-aws-s3", "version": "1.0.0-rc.10", "description": "Uploads FAB assets to AWS S3", "keywords": [ @@ -33,7 +33,7 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@types/node": "^12.12.14", "aws-sdk": "^2.655.0", "fs-extra": "^9.0.0", diff --git a/packages/deployer-aws-s3/src/aws.ts b/packages/deployer-aws-s3/src/aws.ts index 44fca79dc..1af3e36a8 100644 --- a/packages/deployer-aws-s3/src/aws.ts +++ b/packages/deployer-aws-s3/src/aws.ts @@ -1,6 +1,6 @@ import aws from 'aws-sdk' import { ReadStream } from 'fs' -import { IMMUTABLE_HEADERS } from '@dev-spendesk/core' +import { IMMUTABLE_HEADERS } from '@dev-spendesk/fab-core' export function authenticate( region: string, diff --git a/packages/deployer-aws-s3/src/index.ts b/packages/deployer-aws-s3/src/index.ts index 5bdabb93c..5e5fed147 100644 --- a/packages/deployer-aws-s3/src/index.ts +++ b/packages/deployer-aws-s3/src/index.ts @@ -1,4 +1,4 @@ -import { ConfigTypes, FabAssetsDeployer, getContentType } from '@dev-spendesk/core' +import { ConfigTypes, FabAssetsDeployer, getContentType } from '@dev-spendesk/fab-core' import { nanoid } from 'nanoid' import path from 'path' import fs from 'fs-extra' diff --git a/packages/deployer-aws-s3/src/utils.ts b/packages/deployer-aws-s3/src/utils.ts index c416d28f0..56885a725 100644 --- a/packages/deployer-aws-s3/src/utils.ts +++ b/packages/deployer-aws-s3/src/utils.ts @@ -1,3 +1,3 @@ import { _log } from '@dev-spendesk/fab-cli' -export const log = _log('@dev-spendesk/deployer-aws-s3') +export const log = _log('@dev-spendesk/fab-deployer-aws-s3') diff --git a/packages/deployer-cf-workers/package.json b/packages/deployer-cf-workers/package.json index 60e49a690..c7b6d1368 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/deployer-cf-workers", + "name": "@dev-spendesk/fab-deployer-cf-workers", "version": "1.0.0-rc.10", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ @@ -34,7 +34,7 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@types/node": "^12.12.14", "cross-fetch": "^3.0.6", "file-to-sha512": "^0.0.1", diff --git a/packages/deployer-cf-workers/src/createPackage.ts b/packages/deployer-cf-workers/src/createPackage.ts index f902c3ebe..b6effaefd 100644 --- a/packages/deployer-cf-workers/src/createPackage.ts +++ b/packages/deployer-cf-workers/src/createPackage.ts @@ -1,4 +1,4 @@ -import { ConfigTypes, FabPackager, FabSettings } from '@dev-spendesk/core' +import { ConfigTypes, FabPackager, FabSettings } from '@dev-spendesk/fab-core' import { FabPackageError } from '@dev-spendesk/fab-cli' import { log } from './utils' diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index 6b9cf77dc..7687b3bf5 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -5,7 +5,7 @@ import { FabServerDeployer, FabSettings, getContentType, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { CloudflareApi, getCloudflareApi, log } from './utils' import { FabDeployError, InvalidConfigError } from '@dev-spendesk/fab-cli' import { createPackage } from './createPackage' diff --git a/packages/deployer-cf-workers/src/templateInjections.ts b/packages/deployer-cf-workers/src/templateInjections.ts index 1805046af..d1ae755cf 100644 --- a/packages/deployer-cf-workers/src/templateInjections.ts +++ b/packages/deployer-cf-workers/src/templateInjections.ts @@ -1,4 +1,4 @@ -import { FABServerContext, FabSettings } from '@dev-spendesk/core' +import { FABServerContext, FabSettings } from '@dev-spendesk/fab-core' // language=JavaScript export default ( diff --git a/packages/deployer-cf-workers/src/utils.ts b/packages/deployer-cf-workers/src/utils.ts index 42ef9b1c2..209540171 100644 --- a/packages/deployer-cf-workers/src/utils.ts +++ b/packages/deployer-cf-workers/src/utils.ts @@ -1,5 +1,5 @@ import { _log, InvalidConfigError, FabDeployError } from '@dev-spendesk/fab-cli' -export const log = _log(`@dev-spendesk/deployer-cf-workers`) +export const log = _log(`@dev-spendesk/fab-deployer-cf-workers`) import fetch from 'cross-fetch' diff --git a/packages/input-nextjs/package.json b/packages/input-nextjs/package.json index e59debb1a..7274ddad0 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/input-nextjs", + "name": "@dev-spendesk/fab-input-nextjs", "version": "1.0.0-rc.10", "description": "Module to kick off a FAB build from a NextJS project", "keywords": [ @@ -35,7 +35,7 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@types/node": "^12.12.14", "@types/path-to-regexp": "^1.7.0", "acorn": "^7.1.0", diff --git a/packages/input-nextjs/src/build.ts b/packages/input-nextjs/src/build.ts index be6acbb4a..742cef522 100644 --- a/packages/input-nextjs/src/build.ts +++ b/packages/input-nextjs/src/build.ts @@ -1,5 +1,5 @@ import { InputNextJSArgs, InputNextJSMetadata } from './types' -import { FabBuildStep } from '@dev-spendesk/core' +import { FabBuildStep } from '@dev-spendesk/fab-core' import path from 'path' import { InvalidConfigError, _log } from '@dev-spendesk/fab-cli' import { preflightChecks } from './preflightChecks' @@ -8,7 +8,7 @@ import fs from 'fs-extra' import generateRenderer from './generateRenderer' import webpack from 'webpack' -const log = _log(`@dev-spendesk/input-nextjs`) +const log = _log(`@dev-spendesk/fab-input-nextjs`) // @ts-ignore import md5dir from 'md5-dir/promise' @@ -25,7 +25,7 @@ export const build: FabBuildStep = async ( // const { dir } = args if (proto_fab.files!.size > 0) { throw new InvalidConfigError( - `@dev-spendesk/input-nextjs must be the first 'input' plugin in the chain.` + `@dev-spendesk/fab-input-nextjs must be the first 'input' plugin in the chain.` ) } diff --git a/packages/input-nextjs/src/generateRenderer.ts b/packages/input-nextjs/src/generateRenderer.ts index 14d6c59f5..7f7065952 100644 --- a/packages/input-nextjs/src/generateRenderer.ts +++ b/packages/input-nextjs/src/generateRenderer.ts @@ -1,7 +1,7 @@ import { mergeWebpacks } from './mergeWebpacks' import path from 'path' import fs from 'fs-extra' -import { FabFilesObject } from '@dev-spendesk/core' +import { FabFilesObject } from '@dev-spendesk/fab-core' export default async function generateRenderer( js_renderers: string[], diff --git a/packages/input-nextjs/src/mergeWebpacks.ts b/packages/input-nextjs/src/mergeWebpacks.ts index d794fb31e..b84471896 100644 --- a/packages/input-nextjs/src/mergeWebpacks.ts +++ b/packages/input-nextjs/src/mergeWebpacks.ts @@ -9,7 +9,7 @@ * where 'Cq4J' and 'C7Cc' are the default exports of those two files respectively. * */ -import { FabFilesObject } from '@dev-spendesk/core' +import { FabFilesObject } from '@dev-spendesk/fab-core' import * as acorn from 'acorn' import assert from 'assert' // @ts-ignore diff --git a/packages/input-nextjs/src/runtime.ts b/packages/input-nextjs/src/runtime.ts index 40e8777fc..c94a1ab6f 100644 --- a/packages/input-nextjs/src/runtime.ts +++ b/packages/input-nextjs/src/runtime.ts @@ -1,7 +1,7 @@ // @ts-ignore import __generated from 'generated-nextjs-renderers.js' import { pathToRegexp } from 'path-to-regexp' -import { FABRuntime, NO_RESPONSE_STATUS_CODE, Priority } from '@dev-spendesk/core' +import { FABRuntime, NO_RESPONSE_STATUS_CODE, Priority } from '@dev-spendesk/fab-core' const { renderers, MockExpressResponse, MockReq } = __generated diff --git a/packages/input-nextjs/src/types.ts b/packages/input-nextjs/src/types.ts index 3dd0b2f9f..ac4c8fc4e 100644 --- a/packages/input-nextjs/src/types.ts +++ b/packages/input-nextjs/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/fab-core' export interface InputNextJSArgs extends PluginArgs {} diff --git a/packages/input-static/package.json b/packages/input-static/package.json index b98a9ac89..1304b628e 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/input-static", + "name": "@dev-spendesk/fab-input-static", "version": "1.0.0-rc.10", "description": "Module to handle a directory of HTML & assets", "keywords": [ @@ -32,7 +32,7 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@types/node": "^12.12.14", "fs-extra": "^8.1.0", "globby": "^10" diff --git a/packages/input-static/src/build.ts b/packages/input-static/src/build.ts index 17b39bfff..845646ced 100644 --- a/packages/input-static/src/build.ts +++ b/packages/input-static/src/build.ts @@ -1,11 +1,11 @@ import { InputStaticArgs, InputStaticMetadata } from './types' -import { FabBuildStep } from '@dev-spendesk/core' +import { FabBuildStep } from '@dev-spendesk/fab-core' import fs from 'fs-extra' import globby from 'globby' import path from 'path' import { InvalidConfigError, relativeToConfig } from '@dev-spendesk/fab-cli' import { _log } from '@dev-spendesk/fab-cli' -const log = _log(`@dev-spendesk/input-static`) +const log = _log(`@dev-spendesk/fab-input-static`) export const build: FabBuildStep = async ( args, @@ -17,7 +17,7 @@ export const build: FabBuildStep = async ( if (!dir) { throw new InvalidConfigError( - `@dev-spendesk/input-static requires an argument of 'dir'.` + `@dev-spendesk/fab-input-static requires an argument of 'dir'.` ) } @@ -25,12 +25,12 @@ export const build: FabBuildStep = async ( if (!(await fs.pathExists(abs_dir))) { throw new InvalidConfigError( - `@dev-spendesk/input-static specifies a 'dir' of '${dir}', which doesn't exist.` + `@dev-spendesk/fab-input-static specifies a 'dir' of '${dir}', which doesn't exist.` ) } if (proto_fab.files!.size > 0) { throw new InvalidConfigError( - `@dev-spendesk/input-static must be the first 'input' plugin in the chain.` + `@dev-spendesk/fab-input-static must be the first 'input' plugin in the chain.` ) } diff --git a/packages/input-static/src/types.ts b/packages/input-static/src/types.ts index 21ab90cdd..441e6a1a0 100644 --- a/packages/input-static/src/types.ts +++ b/packages/input-static/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/fab-core' export interface InputStaticArgs extends PluginArgs { dir: string diff --git a/packages/input-static/test/build.test.ts b/packages/input-static/test/build.test.ts index d3efcbe1c..5f10481a7 100644 --- a/packages/input-static/test/build.test.ts +++ b/packages/input-static/test/build.test.ts @@ -1,8 +1,8 @@ import { expect } from 'chai' -import { PluginMetadata, ProtoFab } from '@dev-spendesk/core' +import { PluginMetadata, ProtoFab } from '@dev-spendesk/fab-core' import { build } from '../src/build' -describe('@dev-spendesk/input-static', () => { +describe('@dev-spendesk/fab-input-static', () => { it('should be a function', () => { expect(build).to.be.a('function') }) diff --git a/packages/input-static/test/errors.test.ts b/packages/input-static/test/errors.test.ts index 01ec137ec..b5d6161fd 100644 --- a/packages/input-static/test/errors.test.ts +++ b/packages/input-static/test/errors.test.ts @@ -1,14 +1,14 @@ -import { PluginMetadata, ProtoFab } from '@dev-spendesk/core' +import { PluginMetadata, ProtoFab } from '@dev-spendesk/fab-core' import { build } from '../src/build' -import { shouldThrow } from '@dev-spendesk/core/test/helpers' +import { shouldThrow } from '@dev-spendesk/fab-core/test/helpers' const dir = __dirname + '/fixtures' -describe('@dev-spendesk/input-static', () => { +describe('@dev-spendesk/fab-input-static', () => { it('should require a dir argument', async () => { await shouldThrow( // @ts-ignore () => build({}, new ProtoFab()), - `@dev-spendesk/input-static requires an argument of 'dir'.` + `@dev-spendesk/fab-input-static requires an argument of 'dir'.` ) }) @@ -22,7 +22,7 @@ describe('@dev-spendesk/input-static', () => { new ProtoFab(), dir ), - `@dev-spendesk/input-static specifies a 'dir' of './no-existo', which doesn't exist.` + `@dev-spendesk/fab-input-static specifies a 'dir' of './no-existo', which doesn't exist.` ) }) @@ -38,7 +38,7 @@ describe('@dev-spendesk/input-static', () => { proto_fab, dir ), - `@dev-spendesk/input-static must be the first 'input' plugin in the chain.` + `@dev-spendesk/fab-input-static must be the first 'input' plugin in the chain.` ) }) }) diff --git a/packages/plugin-precompile/package.json b/packages/plugin-precompile/package.json index 388b3b9f1..702cee03b 100644 --- a/packages/plugin-precompile/package.json +++ b/packages/plugin-precompile/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/plugin-precompile", + "name": "@dev-spendesk/fab-plugin-precompile", "version": "1.0.0-rc.10", "description": "Module to render static HTML files with FAB injections", "keywords": [ @@ -31,7 +31,7 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@sucrase/webpack-loader": "^2.0.0", "@types/node": "^12.12.14", "@types/webpack-merge": "^4.1.5", diff --git a/packages/plugin-precompile/src/build.ts b/packages/plugin-precompile/src/build.ts index 0112d61a5..23ae581e9 100644 --- a/packages/plugin-precompile/src/build.ts +++ b/packages/plugin-precompile/src/build.ts @@ -1,4 +1,4 @@ -import { FabBuildStep, ProtoFab, RuntimePlugin } from '@dev-spendesk/core' +import { FabBuildStep, ProtoFab, RuntimePlugin } from '@dev-spendesk/fab-core' import { PrecompileArgs, PrecompileMetadata, @@ -11,7 +11,7 @@ import fs from 'fs-extra' import path from 'path' import filenamify from 'filenamify' -const log = _log('@dev-spendesk/plugin-precompile') +const log = _log('@dev-spendesk/fab-plugin-precompile') export const build: FabBuildStep = async ( args: PrecompileArgs, @@ -22,7 +22,7 @@ export const build: FabBuildStep = async ( /* * TODO * - * Port the @dev-spendesk/input-nextjs stuff across, shimming out pieces as needed. + * Port the @dev-spendesk/fab-input-nextjs stuff across, shimming out pieces as needed. * Make each file a new "runtime", that's compiled using webpack, with a bunch * of good defaults but the args for each section are all the overrides. * diff --git a/packages/plugin-precompile/src/types.ts b/packages/plugin-precompile/src/types.ts index f51b4c9ce..320ef89eb 100644 --- a/packages/plugin-precompile/src/types.ts +++ b/packages/plugin-precompile/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/fab-core' import webpack from 'webpack' export interface PrecompileArgs extends PluginArgs { diff --git a/packages/plugin-render-html/package.json b/packages/plugin-render-html/package.json index fb88d903a..5b44fc220 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/plugin-render-html", + "name": "@dev-spendesk/fab-plugin-render-html", "version": "1.0.0-rc.10", "description": "Module to render static HTML files with FAB injections", "keywords": [ @@ -31,7 +31,7 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@types/cheerio": "^0.22.15", "@types/node": "^12.12.14", "cheerio": "^1.0.0-rc.3", diff --git a/packages/plugin-render-html/src/build.ts b/packages/plugin-render-html/src/build.ts index 242308fb8..13dbfa41a 100644 --- a/packages/plugin-render-html/src/build.ts +++ b/packages/plugin-render-html/src/build.ts @@ -1,4 +1,4 @@ -import { ProtoFab } from '@dev-spendesk/core' +import { ProtoFab } from '@dev-spendesk/fab-core' import { RenderHtmlArgs, RenderHtmlMetadata, CompiledHTMLs, AssetHTMLs } from './types' import cheerio from 'cheerio' import { tokenize } from 'micromustache' @@ -16,7 +16,7 @@ const getFingerprintedName = (contents: Buffer, filename: string) => { : `${filename}_${hash}` } -const log = _log('@dev-spendesk/plugin-render-html') +const log = _log('@dev-spendesk/fab-plugin-render-html') export async function build( args: RenderHtmlArgs, @@ -73,11 +73,11 @@ export async function build( if (!htmls[resolved_fallback]) { if (typeof fallback === 'string') { throw new InvalidConfigError( - `@dev-spendesk/plugin-render-html specifies a fallback of '${fallback}', which doesn't exist.` + `@dev-spendesk/fab-plugin-render-html specifies a fallback of '${fallback}', which doesn't exist.` ) } else { log.warn( - `@dev-spendesk/plugin-render-html has 'fallback: true', but '${resolved_fallback}' doesn't exist! Skipping.` + `@dev-spendesk/fab-plugin-render-html has 'fallback: true', but '${resolved_fallback}' doesn't exist! Skipping.` ) } } diff --git a/packages/plugin-render-html/src/injections/env.ts b/packages/plugin-render-html/src/injections/env.ts index df6a5bc8a..d33022653 100644 --- a/packages/plugin-render-html/src/injections/env.ts +++ b/packages/plugin-render-html/src/injections/env.ts @@ -1,4 +1,4 @@ -import { FabSettings } from '@dev-spendesk/core' +import { FabSettings } from '@dev-spendesk/fab-core' import { DEFAULT_INJECTIONS } from '../constants' import { EnvInjectionConfig } from '../types' diff --git a/packages/plugin-render-html/src/runtime.ts b/packages/plugin-render-html/src/runtime.ts index be6df0d9d..b36408ead 100644 --- a/packages/plugin-render-html/src/runtime.ts +++ b/packages/plugin-render-html/src/runtime.ts @@ -5,7 +5,7 @@ import { matchPath, NO_RESPONSE_STATUS_CODE, Priority, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { DEFAULT_INJECTIONS } from './constants' import { generateReplacements } from './injections/env' import { ITokens } from 'micromustache' diff --git a/packages/plugin-render-html/src/types.ts b/packages/plugin-render-html/src/types.ts index 21f418c0c..6f50e9f1a 100644 --- a/packages/plugin-render-html/src/types.ts +++ b/packages/plugin-render-html/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/fab-core' import { ITokens } from 'micromustache' export type EnvInjectionConfig = { diff --git a/packages/plugin-render-html/test/build.test.ts b/packages/plugin-render-html/test/build.test.ts index e3a9ad4d1..f3b412d1f 100644 --- a/packages/plugin-render-html/test/build.test.ts +++ b/packages/plugin-render-html/test/build.test.ts @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { ProtoFab } from '@dev-spendesk/core' +import { ProtoFab } from '@dev-spendesk/fab-core' import { build } from '../src/build' import { RenderHtmlMetadata } from '../src/types' diff --git a/packages/plugin-render-html/test/runtime.test.ts b/packages/plugin-render-html/test/runtime.test.ts index a9c7d3e0a..41e0c7ed6 100644 --- a/packages/plugin-render-html/test/runtime.test.ts +++ b/packages/plugin-render-html/test/runtime.test.ts @@ -5,7 +5,7 @@ import { FABRuntime, FabSettings, ProtoFab, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { build } from '../src/build' import { RenderHtmlArgs, RenderHtmlMetadata } from '../src/types' diff --git a/packages/plugin-rewire-assets/package.json b/packages/plugin-rewire-assets/package.json index 25b50ec82..4fc16c79c 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/plugin-rewire-assets", + "name": "@dev-spendesk/fab-plugin-rewire-assets", "version": "1.0.0-rc.10", "description": "Module to handle files outside _assets", "keywords": [ @@ -33,7 +33,7 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "@types/istextorbinary": "^2.3.0", "@types/mime-types": "^2.1.0", "@types/node": "^12.12.14", diff --git a/packages/plugin-rewire-assets/src/build.ts b/packages/plugin-rewire-assets/src/build.ts index be8eec810..6ebbbf26e 100644 --- a/packages/plugin-rewire-assets/src/build.ts +++ b/packages/plugin-rewire-assets/src/build.ts @@ -1,4 +1,8 @@ -import { ProtoFab, filenameOutsideFabLocations, getContentType } from '@dev-spendesk/core' +import { + ProtoFab, + filenameOutsideFabLocations, + getContentType, +} from '@dev-spendesk/fab-core' import { InlineAssets, RenamedAssets, @@ -11,7 +15,7 @@ import { InvalidConfigError, _log } from '@dev-spendesk/fab-cli' // @ts-ignore import { isBinaryPromise } from 'istextorbinary' import { DEFAULT_IMMUTABILITY_CHECK } from './constants' -const log = _log('@dev-spendesk/plugin-rewire-assets') +const log = _log('@dev-spendesk/fab-plugin-rewire-assets') export async function build( args: RewireAssetsArgs, diff --git a/packages/plugin-rewire-assets/src/runtime.ts b/packages/plugin-rewire-assets/src/runtime.ts index 891283e4f..344d47b9f 100644 --- a/packages/plugin-rewire-assets/src/runtime.ts +++ b/packages/plugin-rewire-assets/src/runtime.ts @@ -5,7 +5,7 @@ import { matchPath, NON_IMMUTABLE_HEADERS, Priority, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' export default function RewireAssetsRuntime({ Router, diff --git a/packages/plugin-rewire-assets/src/types.ts b/packages/plugin-rewire-assets/src/types.ts index c19629c89..85a24105b 100644 --- a/packages/plugin-rewire-assets/src/types.ts +++ b/packages/plugin-rewire-assets/src/types.ts @@ -1,4 +1,4 @@ -import { PluginArgs, PluginMetadata } from '@dev-spendesk/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/fab-core' export interface RewireAssetsArgs extends PluginArgs { 'inline-threshold'?: number diff --git a/packages/plugin-rewire-assets/test/build.test.ts b/packages/plugin-rewire-assets/test/build.test.ts index 1040548dd..847036bdc 100644 --- a/packages/plugin-rewire-assets/test/build.test.ts +++ b/packages/plugin-rewire-assets/test/build.test.ts @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { ProtoFab } from '@dev-spendesk/core' +import { ProtoFab } from '@dev-spendesk/fab-core' import hasha from 'hasha' import { RewireAssetsMetadata } from '../src/types' import { build } from '../src/build' diff --git a/packages/sandbox-node-vm/package.json b/packages/sandbox-node-vm/package.json index 6fd6e9da1..0e121348a 100644 --- a/packages/sandbox-node-vm/package.json +++ b/packages/sandbox-node-vm/package.json @@ -1,5 +1,5 @@ { - "name": "@dev-spendesk/sandbox-node-vm", + "name": "@dev-spendesk/fab-sandbox-node-vm", "version": "1.0.0-rc.10", "description": "FAB runtime sandbox using Node's 'vm'", "keywords": [ @@ -29,7 +29,7 @@ "prepack": "npm run clean && npm run build" }, "dependencies": { - "@dev-spendesk/core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", "cross-fetch": "^3.0.6", "web-streams-polyfill": "^2.1.1" }, diff --git a/packages/sandbox-node-vm/src/index.ts b/packages/sandbox-node-vm/src/index.ts index 574b8a33c..d88fcf172 100644 --- a/packages/sandbox-node-vm/src/index.ts +++ b/packages/sandbox-node-vm/src/index.ts @@ -1,6 +1,6 @@ import vm from 'vm' import * as fetch from 'cross-fetch' -import { FabSpecExports } from '@dev-spendesk/core' +import { FabSpecExports } from '@dev-spendesk/fab-core' import Stream from 'stream' import { ReadableStream as WebReadableStream } from 'web-streams-polyfill/ponyfill/es2018' diff --git a/packages/server/package.json b/packages/server/package.json index 276bf7559..2bc2807e5 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -31,8 +31,8 @@ }, "dependencies": { "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/core": "1.0.0-rc.10", - "@dev-spendesk/sandbox-node-vm": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-sandbox-node-vm": "1.0.0-rc.10", "@fly/v8env": "^0.54.0", "@types/concat-stream": "^1.6.0", "@types/express": "^4.17.2", diff --git a/packages/server/src/cache.ts b/packages/server/src/cache.ts index 2c4ba3469..72435c4d8 100644 --- a/packages/server/src/cache.ts +++ b/packages/server/src/cache.ts @@ -1,8 +1,8 @@ -import { FabCache, FabCacheValue } from '@dev-spendesk/core' +import { FabCache, FabCacheValue } from '@dev-spendesk/fab-core' import NodeCache from 'node-cache' import Stream from 'stream' /* We need something that node-fetch Response treats as a stream */ -import { HybridReadableStream as _HRS } from '@dev-spendesk/sandbox-node-vm' +import { HybridReadableStream as _HRS } from '@dev-spendesk/fab-sandbox-node-vm' // @ts-ignore const HybridReadableStream: typeof ReadableStream = _HRS diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 14385f3c9..716b4cd7a 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -9,7 +9,7 @@ import { ServerArgs, ServerConstructor, ServerType, -} from '@dev-spendesk/core' +} from '@dev-spendesk/fab-core' import { _log, InvalidConfigError, @@ -19,7 +19,7 @@ import { import { readFilesFromZip } from './utils' import v8_sandbox from './sandboxes/v8-isolate' import { Cache } from './cache' -import node_vm_sandbox from '@dev-spendesk/sandbox-node-vm' +import node_vm_sandbox from '@dev-spendesk/fab-sandbox-node-vm' import url from 'url' import http from 'http' import express, { @@ -46,7 +46,7 @@ const log = _log(`Server`) async function streamResponse(fetch_res: Response, res: ExpressResponse) { res.status(fetch_res.status) // This is a NodeFetch response, which has this method, but - // the @dev-spendesk/core types are from dom.ts, which doesn't. This + // the @dev-spendesk/fab-core types are from dom.ts, which doesn't. This // was the easiest workaround for now. // @ts-ignore const response_headers = fetch_res.headers.raw() diff --git a/packages/server/src/sandboxes/v8-isolate.ts b/packages/server/src/sandboxes/v8-isolate.ts index c8e440bee..9f4b4b049 100644 --- a/packages/server/src/sandboxes/v8-isolate.ts +++ b/packages/server/src/sandboxes/v8-isolate.ts @@ -1,5 +1,5 @@ import fs from 'fs-extra' -import { FabSpecExports, FabSettings } from '@dev-spendesk/core' +import { FabSpecExports, FabSettings } from '@dev-spendesk/fab-core' import { Response as NodeFetchResponse } from 'cross-fetch' export default async (src: string): Promise => { diff --git a/tests/e2e/cli-errors.test.ts b/tests/e2e/cli-errors.test.ts index 89118007c..785ae1705 100644 --- a/tests/e2e/cli-errors.test.ts +++ b/tests/e2e/cli-errors.test.ts @@ -45,7 +45,7 @@ describe('dir of static assets', () => { expect(stderr).toContain(`Config file contains errors!`) }) - it(`should tell you you've forgotten @dev-spendesk/plugin-rewire-assets`, async () => { + it(`should tell you you've forgotten @dev-spendesk/fab-plugin-rewire-assets`, async () => { const { stderr, stdout, @@ -54,7 +54,9 @@ describe('dir of static assets', () => { expect(stdout).toContain( `Build config leaves files outside of _assets dir: /index.html` ) - expect(stdout).toContain(`You might need to add @dev-spendesk/plugin-rewire-assets`) + expect(stdout).toContain( + `You might need to add @dev-spendesk/fab-plugin-rewire-assets` + ) expect(stdout).toContain(`See https://fab.dev/packages/rewire-assets`) expect(stderr).toContain(`Build failed!`) }) diff --git a/tests/e2e/create-react-app.test.ts b/tests/e2e/create-react-app.test.ts index 0cf561b03..4b016eb68 100644 --- a/tests/e2e/create-react-app.test.ts +++ b/tests/e2e/create-react-app.test.ts @@ -279,7 +279,7 @@ describe('Create React App E2E Test', () => { await fs.writeFile(`${cwd}/build/bigfile.a1b2c3d4e5.immutable`, big_file) const config = jju.parse(await fs.readFile(`${cwd}/fab.config.json5`, 'utf8')) - config.plugins['@dev-spendesk/plugin-rewire-assets'][ + config.plugins['@dev-spendesk/fab-plugin-rewire-assets'][ 'chunk-threshold' ] = Math.floor(big_file.length / 2.5) await fs.writeFile(`${cwd}/fab.config.json5`, jju.stringify(config)) diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/add-bundle-id/runtime.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/add-bundle-id/runtime.ts index d9c158476..ec5328ad6 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/add-bundle-id/runtime.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/add-bundle-id/runtime.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@dev-spendesk/core' +import { FABRuntime } from '@dev-spendesk/fab-core' export default ({ Router, ServerContext }: FABRuntime) => { Router.interceptResponse(async (response) => { diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/cache.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/cache.ts index 6f02f4132..c024ec00b 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/cache.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/cache.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@dev-spendesk/core' +import { FABRuntime } from '@dev-spendesk/fab-core' const sleep = (ms: number) => new Promise((res) => setTimeout(res, ms)) diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/check-cookie.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/check-cookie.ts index a5b4e70a9..201cd54a2 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/check-cookie.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/check-cookie.ts @@ -1,4 +1,4 @@ -import { FABRuntime, Priority } from '@dev-spendesk/core' +import { FABRuntime, Priority } from '@dev-spendesk/fab-core' // import { checkValidity } from 'somewhere' const checkValidity = (str: string) => str.startsWith('AUTHED') diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/geolocate.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/geolocate.ts index c97d933f6..d2d09de82 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/geolocate.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/geolocate.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@dev-spendesk/core' +import { FABRuntime } from '@dev-spendesk/fab-core' export default ({ Router }: FABRuntime) => { Router.on('/geolocate', async () => { diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/hello-world.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/hello-world.ts index 4fad2a64f..961299637 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/hello-world.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/hello-world.ts @@ -1,4 +1,4 @@ -import { FABRuntime, Priority } from '@dev-spendesk/core' +import { FABRuntime, Priority } from '@dev-spendesk/fab-core' export default ({ Router }: FABRuntime) => { Router.on('/hello/:whom?', async ({ params }) => { diff --git a/tests/e2e/fixtures/server-side-logic/fab-plugins/slowly.ts b/tests/e2e/fixtures/server-side-logic/fab-plugins/slowly.ts index 5da8f67a2..56fdc5f50 100644 --- a/tests/e2e/fixtures/server-side-logic/fab-plugins/slowly.ts +++ b/tests/e2e/fixtures/server-side-logic/fab-plugins/slowly.ts @@ -1,4 +1,4 @@ -import { FABRuntime } from '@dev-spendesk/core' +import { FABRuntime } from '@dev-spendesk/fab-core' const sleep = (ms: number) => new Promise((res) => setTimeout(res, ms)) diff --git a/tests/e2e/fixtures/server-side-logic/modify-plugin-config.js b/tests/e2e/fixtures/server-side-logic/modify-plugin-config.js index 1a9565ee7..7741596db 100644 --- a/tests/e2e/fixtures/server-side-logic/modify-plugin-config.js +++ b/tests/e2e/fixtures/server-side-logic/modify-plugin-config.js @@ -11,6 +11,8 @@ module.exports = { }, alias: (alias) => ({ ...alias, - 'no-existo': require.resolve('@dev-spendesk/plugin-precompile/shims/empty-object'), + 'no-existo': require.resolve( + '@dev-spendesk/fab-plugin-precompile/shims/empty-object' + ), }), } diff --git a/tests/e2e/fixtures/server-side-logic/package.json b/tests/e2e/fixtures/server-side-logic/package.json index 1a6b15d4e..9bef9f969 100644 --- a/tests/e2e/fixtures/server-side-logic/package.json +++ b/tests/e2e/fixtures/server-side-logic/package.json @@ -8,10 +8,10 @@ "dependencies": { "@dev-spendesk/fab-actions": "latest", "@dev-spendesk/fab-cli": "latest", - "@dev-spendesk/input-static": "latest", - "@dev-spendesk/plugin-render-html": "latest", - "@dev-spendesk/plugin-rewire-assets": "latest", - "@dev-spendesk/plugin-precompile": "latest", + "@dev-spendesk/fab-input-static": "latest", + "@dev-spendesk/fab-plugin-render-html": "latest", + "@dev-spendesk/fab-plugin-rewire-assets": "latest", + "@dev-spendesk/fab-plugin-precompile": "latest", "@dev-spendesk/fab-server": "latest" } } From 1f0368f92ca85791bf1bb5d9d42cbaf7be453510 Mon Sep 17 00:00:00 2001 From: Victor Demonchy Date: Wed, 23 Feb 2022 18:37:46 +0100 Subject: [PATCH 10/23] v1.0.0-rc.11 --- lerna.json | 2 +- packages/_fab/package.json | 4 +- packages/actions/package.json | 6 +- packages/cli/README.md | 164 +-------------------- packages/cli/package.json | 4 +- packages/core/package.json | 2 +- packages/deployer-aws-lambda/package.json | 6 +- packages/deployer-aws-s3/package.json | 6 +- packages/deployer-cf-workers/package.json | 6 +- packages/input-nextjs/package.json | 6 +- packages/input-static/package.json | 6 +- packages/plugin-precompile/package.json | 6 +- packages/plugin-render-html/package.json | 6 +- packages/plugin-rewire-assets/package.json | 6 +- packages/sandbox-node-vm/package.json | 4 +- packages/server/package.json | 8 +- 16 files changed, 41 insertions(+), 201 deletions(-) diff --git a/lerna.json b/lerna.json index 105d3ab94..46d8b4e98 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": ["packages/*"], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.0.0-rc.10" + "version": "1.0.0-rc.11" } diff --git a/packages/_fab/package.json b/packages/_fab/package.json index 152969056..23495d296 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "An alias for @dev-spendesk/fab-cli", "keywords": [ "fab" @@ -27,6 +27,6 @@ "prepack": "cat PREAMBLE.md > README.md && cat ../cli/README.md >> README.md" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10" + "@dev-spendesk/fab-cli": "1.0.0-rc.11" } } diff --git a/packages/actions/package.json b/packages/actions/package.json index 6fbfc06c1..8379b6bab 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-actions", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "private": false, "description": "The guts of the FAB cli code, keeping the 'fab' package lean", "keywords": [ @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@rollup/plugin-alias": "^2.2.0", "@rollup/plugin-commonjs": "^11.0.2", "@rollup/plugin-inject": "^4.0.1", diff --git a/packages/cli/README.md b/packages/cli/README.md index b9e37fccb..ba8e3a024 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -17,11 +17,11 @@ ```sh-session -$ npm install -g @dev-spendesk/cli +$ npm install -g @dev-spendesk/fab-cli $ fab COMMAND running command... $ fab (-v|--version|version) -@dev-spendesk/cli/1.0.0-rc.10 linux-x64 node-v14.18.1 +@dev-spendesk/fab-cli/1.0.0-rc.11 linux-x64 node-v14.18.1 $ fab --help [COMMAND] USAGE $ fab COMMAND @@ -34,75 +34,7 @@ USAGE -- [`fab build`](#fab-build) -- [`fab deploy [FILE]`](#fab-deploy-file) - [`fab help [COMMAND]`](#fab-help-command) -- [`fab init`](#fab-init) -- [`fab package [FILE]`](#fab-package-file) -- [`fab serve [FILE]`](#fab-serve-file) - -## `fab build` - -Generate a FAB given the config (usually in fab.config.json5) - -``` -USAGE - $ fab build - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file - -h, --help show CLI help - --minify Minify the generated server.js file. - --skip-cache Skip any caching of intermediate build artifacts - --skip-typecheck Skip the background typechecking of your FAB plugins if it's slow or flaky. - - --watch=watch Re-run the builder if any of the listed files change. Pass this argument multiple times to watch - multiple files/directories. - -EXAMPLES - $ fab build - $ fab build --config=fab.config.json5 - $ fab build --watch dist --watch fab.config.json5 -``` - -_See code: [lib/commands/build.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/build.js)_ - -## `fab deploy [FILE]` - -Deploy a FAB to a hosting provider - -``` -USAGE - $ fab deploy [FILE] - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file - -h, --help show CLI help - - --assets-already-deployed-at=assets-already-deployed-at Skip asset deploys and only deploy the server component - pointing at this URL for assets - - --assets-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the assets defined - in your fab.config.json5, which one to deploy to. - - --assets-only Skip server deploy, just upload assets - - --auto-install If you need dependent packages (e.g. @dev-spendesk/deploy-*), - install them without prompting - - --env=env Override production settings with a different environment - defined in your FAB config file. - - --package-dir=package-dir Where to save the packaged FAB files (default .fab/deploy) - - --server-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the server defined - in your fab.config.json5, which one to deploy to. - -EXAMPLE - $ fab deploy fab.zip -``` - -_See code: [lib/commands/deploy.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/deploy.js)_ ## `fab help [COMMAND]` @@ -121,96 +53,4 @@ OPTIONS _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.1/src/commands/help.ts)_ -## `fab init` - -Auto-configure a repo for generating FABs - -``` -USAGE - $ fab init - -OPTIONS - -c, --config=config [default: fab.config.json5] Config filename - -h, --help show CLI help - -y, --yes Assume yes to all prompts (must be in the root directory of a project) - --empty Install the packages and create an empty fab.config.json5 (implies -y) - --skip-framework-detection Don't try to auto-detect framework, set up manually. - --skip-install Do not attempt to npm install anything - --version=version What NPM version or dist-tag to use for installing FAB packages - -EXAMPLES - $ fab init - $ fab init --config=fab.config.json5 -``` - -_See code: [lib/commands/init.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/init.js)_ - -## `fab package [FILE]` - -Package a FAB to be uploaded to a hosting provider manually - -``` -USAGE - $ fab package [FILE] - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file - -h, --help show CLI help - - -t, --target=(cf-workers|aws-lambda-edge|aws-s3) Hosting provider (must be one of: cf-workers, aws-lambda-edge, - aws-s3) - - --assets-url=assets-url A URL for where the assets can be accessed, for server deployers - that need it - - --env=env Override production settings with a different environment defined in - your FAB config file. - - --output-path=output-path Where to save the packaged FAB (default .fab/deploy/[target].zip) - -EXAMPLE - $ fab package --target=aws-lambda-edge fab.zip -``` - -_See code: [lib/commands/package.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/package.js)_ - -## `fab serve [FILE]` - -fab serve: Serve a FAB in a local NodeJS Express server - -``` -USAGE - $ fab serve [FILE] - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file. Only used for SETTINGS in conjunction with - --env. - - -h, --help show CLI help - - --auto-install If you need dependent packages (e.g. @dev-spendesk/serve), install them without prompting - - --cert=cert SSL certificate to use - - --env=env Override production settings with a different environment defined in your FAB config file. - - --experimental-v8-sandbox Enable experimental V8::Isolate Runtime (in development, currently non-functional) - - --key=key Key for the SSL Certificate - - --port=port (required) [default: 3000] Port to use - - --proxy-ws=proxy-ws EXPERIMENTAL: Proxy websocket requests to a different port - - --watch EXPERIMENTAL: Watches fab.zip and restarts the server when it changes. - -EXAMPLES - $ fab serve fab.zip - $ fab serve --port=3001 fab.zip - $ fab serve --cert=local-ssl.cert --key=local-ssl.key fab.zip - $ fab serve --env=staging fab.zip -``` - -_See code: [lib/commands/serve.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/serve.js)_ - diff --git a/packages/cli/package.json b/packages/cli/package.json index cf82b4422..ce63921b2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-cli", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "The CLI entry-point for the FAB ecosystem", "keywords": [ "fab", @@ -35,7 +35,7 @@ "version": "oclif-dev readme && git add README.md" }, "dependencies": { - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/errors": "^1", diff --git a/packages/core/package.json b/packages/core/package.json index c19b32f86..4d773c381 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-core", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "private": false, "description": "Common code for all FAB projects", "keywords": [ diff --git a/packages/deployer-aws-lambda/package.json b/packages/deployer-aws-lambda/package.json index 1961a9c46..15551c68f 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/deployer-aws-lambda", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "aws", @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/nanoid": "^2.1.0", "@types/node": "^12.12.14", "deterministic-zip": "^1.1.0", diff --git a/packages/deployer-aws-s3/package.json b/packages/deployer-aws-s3/package.json index 0e20c9f9a..4104f6e0c 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-deployer-aws-s3", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "Uploads FAB assets to AWS S3", "keywords": [ "aws", @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/node": "^12.12.14", "aws-sdk": "^2.655.0", "fs-extra": "^9.0.0", diff --git a/packages/deployer-cf-workers/package.json b/packages/deployer-cf-workers/package.json index c7b6d1368..4af37f881 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-deployer-cf-workers", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "cloudflare", @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/node": "^12.12.14", "cross-fetch": "^3.0.6", "file-to-sha512": "^0.0.1", diff --git a/packages/input-nextjs/package.json b/packages/input-nextjs/package.json index 7274ddad0..628ee47bb 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-input-nextjs", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "Module to kick off a FAB build from a NextJS project", "keywords": [ "aws", @@ -34,8 +34,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/node": "^12.12.14", "@types/path-to-regexp": "^1.7.0", "acorn": "^7.1.0", diff --git a/packages/input-static/package.json b/packages/input-static/package.json index 1304b628e..e68ef16ce 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-input-static", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "Module to handle a directory of HTML & assets", "keywords": [ "fab", @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/node": "^12.12.14", "fs-extra": "^8.1.0", "globby": "^10" diff --git a/packages/plugin-precompile/package.json b/packages/plugin-precompile/package.json index 702cee03b..4a479e37a 100644 --- a/packages/plugin-precompile/package.json +++ b/packages/plugin-precompile/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-plugin-precompile", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "Module to render static HTML files with FAB injections", "keywords": [ "fab" @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@sucrase/webpack-loader": "^2.0.0", "@types/node": "^12.12.14", "@types/webpack-merge": "^4.1.5", diff --git a/packages/plugin-render-html/package.json b/packages/plugin-render-html/package.json index 5b44fc220..b73dc3b87 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-plugin-render-html", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "Module to render static HTML files with FAB injections", "keywords": [ "fab" @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/cheerio": "^0.22.15", "@types/node": "^12.12.14", "cheerio": "^1.0.0-rc.3", diff --git a/packages/plugin-rewire-assets/package.json b/packages/plugin-rewire-assets/package.json index 4fc16c79c..cf8cd3fb9 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-plugin-rewire-assets", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "Module to handle files outside _assets", "keywords": [ "assets", @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/istextorbinary": "^2.3.0", "@types/mime-types": "^2.1.0", "@types/node": "^12.12.14", diff --git a/packages/sandbox-node-vm/package.json b/packages/sandbox-node-vm/package.json index 0e121348a..b17186b31 100644 --- a/packages/sandbox-node-vm/package.json +++ b/packages/sandbox-node-vm/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-sandbox-node-vm", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "FAB runtime sandbox using Node's 'vm'", "keywords": [ "fab", @@ -29,7 +29,7 @@ "prepack": "npm run clean && npm run build" }, "dependencies": { - "@dev-spendesk/fab-core": "1.0.0-rc.10", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "cross-fetch": "^3.0.6", "web-streams-polyfill": "^2.1.1" }, diff --git a/packages/server/package.json b/packages/server/package.json index 2bc2807e5..b52b0af4c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-server", - "version": "1.0.0-rc.10", + "version": "1.0.0-rc.11", "description": "NodeJS FAB Server", "keywords": [ "fab", @@ -30,9 +30,9 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.10", - "@dev-spendesk/fab-core": "1.0.0-rc.10", - "@dev-spendesk/fab-sandbox-node-vm": "1.0.0-rc.10", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-sandbox-node-vm": "1.0.0-rc.11", "@fly/v8env": "^0.54.0", "@types/concat-stream": "^1.6.0", "@types/express": "^4.17.2", From 0d174cd290bb86d78630997afc344d0497f52443 Mon Sep 17 00:00:00 2001 From: Victor Demonchy Date: Wed, 23 Feb 2022 18:39:36 +0100 Subject: [PATCH 11/23] Update READMEs --- packages/_fab/README.md | 14 ++-- packages/cli/README.md | 160 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+), 7 deletions(-) diff --git a/packages/_fab/README.md b/packages/_fab/README.md index 075d10509..433633284 100644 --- a/packages/_fab/README.md +++ b/packages/_fab/README.md @@ -27,11 +27,11 @@ https://www.npmjs.com/package/fab/v/0.5.3-original. ```sh-session -$ npm install -g @dev-spendesk/cli +$ npm install -g @dev-spendesk/fab-cli $ fab COMMAND running command... $ fab (-v|--version|version) -@dev-spendesk/cli/1.0.0-rc.10 linux-x64 node-v14.18.1 +@dev-spendesk/fab-cli/1.0.0-rc.11 linux-x64 node-v14.18.1 $ fab --help [COMMAND] USAGE $ fab COMMAND @@ -75,7 +75,7 @@ EXAMPLES $ fab build --watch dist --watch fab.config.json5 ``` -_See code: [lib/commands/build.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/build.js)_ +_See code: [lib/commands/build.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/build.js)_ ## `fab deploy [FILE]` @@ -112,7 +112,7 @@ EXAMPLE $ fab deploy fab.zip ``` -_See code: [lib/commands/deploy.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/deploy.js)_ +_See code: [lib/commands/deploy.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/deploy.js)_ ## `fab help [COMMAND]` @@ -153,7 +153,7 @@ EXAMPLES $ fab init --config=fab.config.json5 ``` -_See code: [lib/commands/init.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/init.js)_ +_See code: [lib/commands/init.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/init.js)_ ## `fab package [FILE]` @@ -182,7 +182,7 @@ EXAMPLE $ fab package --target=aws-lambda-edge fab.zip ``` -_See code: [lib/commands/package.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/package.js)_ +_See code: [lib/commands/package.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/package.js)_ ## `fab serve [FILE]` @@ -221,6 +221,6 @@ EXAMPLES $ fab serve --env=staging fab.zip ``` -_See code: [lib/commands/serve.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.10/lib/commands/serve.js)_ +_See code: [lib/commands/serve.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/serve.js)_ diff --git a/packages/cli/README.md b/packages/cli/README.md index ba8e3a024..30df5d04f 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -34,7 +34,75 @@ USAGE +- [`fab build`](#fab-build) +- [`fab deploy [FILE]`](#fab-deploy-file) - [`fab help [COMMAND]`](#fab-help-command) +- [`fab init`](#fab-init) +- [`fab package [FILE]`](#fab-package-file) +- [`fab serve [FILE]`](#fab-serve-file) + +## `fab build` + +Generate a FAB given the config (usually in fab.config.json5) + +``` +USAGE + $ fab build + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file + -h, --help show CLI help + --minify Minify the generated server.js file. + --skip-cache Skip any caching of intermediate build artifacts + --skip-typecheck Skip the background typechecking of your FAB plugins if it's slow or flaky. + + --watch=watch Re-run the builder if any of the listed files change. Pass this argument multiple times to watch + multiple files/directories. + +EXAMPLES + $ fab build + $ fab build --config=fab.config.json5 + $ fab build --watch dist --watch fab.config.json5 +``` + +_See code: [lib/commands/build.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/build.js)_ + +## `fab deploy [FILE]` + +Deploy a FAB to a hosting provider + +``` +USAGE + $ fab deploy [FILE] + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file + -h, --help show CLI help + + --assets-already-deployed-at=assets-already-deployed-at Skip asset deploys and only deploy the server component + pointing at this URL for assets + + --assets-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the assets defined + in your fab.config.json5, which one to deploy to. + + --assets-only Skip server deploy, just upload assets + + --auto-install If you need dependent packages (e.g. @dev-spendesk/deploy-*), + install them without prompting + + --env=env Override production settings with a different environment + defined in your FAB config file. + + --package-dir=package-dir Where to save the packaged FAB files (default .fab/deploy) + + --server-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the server defined + in your fab.config.json5, which one to deploy to. + +EXAMPLE + $ fab deploy fab.zip +``` + +_See code: [lib/commands/deploy.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/deploy.js)_ ## `fab help [COMMAND]` @@ -53,4 +121,96 @@ OPTIONS _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.1/src/commands/help.ts)_ +## `fab init` + +Auto-configure a repo for generating FABs + +``` +USAGE + $ fab init + +OPTIONS + -c, --config=config [default: fab.config.json5] Config filename + -h, --help show CLI help + -y, --yes Assume yes to all prompts (must be in the root directory of a project) + --empty Install the packages and create an empty fab.config.json5 (implies -y) + --skip-framework-detection Don't try to auto-detect framework, set up manually. + --skip-install Do not attempt to npm install anything + --version=version What NPM version or dist-tag to use for installing FAB packages + +EXAMPLES + $ fab init + $ fab init --config=fab.config.json5 +``` + +_See code: [lib/commands/init.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/init.js)_ + +## `fab package [FILE]` + +Package a FAB to be uploaded to a hosting provider manually + +``` +USAGE + $ fab package [FILE] + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file + -h, --help show CLI help + + -t, --target=(cf-workers|aws-lambda-edge|aws-s3) Hosting provider (must be one of: cf-workers, aws-lambda-edge, + aws-s3) + + --assets-url=assets-url A URL for where the assets can be accessed, for server deployers + that need it + + --env=env Override production settings with a different environment defined in + your FAB config file. + + --output-path=output-path Where to save the packaged FAB (default .fab/deploy/[target].zip) + +EXAMPLE + $ fab package --target=aws-lambda-edge fab.zip +``` + +_See code: [lib/commands/package.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/package.js)_ + +## `fab serve [FILE]` + +fab serve: Serve a FAB in a local NodeJS Express server + +``` +USAGE + $ fab serve [FILE] + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file. Only used for SETTINGS in conjunction with + --env. + + -h, --help show CLI help + + --auto-install If you need dependent packages (e.g. @dev-spendesk/serve), install them without prompting + + --cert=cert SSL certificate to use + + --env=env Override production settings with a different environment defined in your FAB config file. + + --experimental-v8-sandbox Enable experimental V8::Isolate Runtime (in development, currently non-functional) + + --key=key Key for the SSL Certificate + + --port=port (required) [default: 3000] Port to use + + --proxy-ws=proxy-ws EXPERIMENTAL: Proxy websocket requests to a different port + + --watch EXPERIMENTAL: Watches fab.zip and restarts the server when it changes. + +EXAMPLES + $ fab serve fab.zip + $ fab serve --port=3001 fab.zip + $ fab serve --cert=local-ssl.cert --key=local-ssl.key fab.zip + $ fab serve --env=staging fab.zip +``` + +_See code: [lib/commands/serve.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/serve.js)_ + From 87925652fdb1ca67409a7e6ae62e6c0ad9b0ec98 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Fri, 15 Jul 2022 19:13:56 +0200 Subject: [PATCH 12/23] Use asset manifest to skip useless assets upload --- packages/deployer-cf-workers/src/deploy.ts | 15 ++++++- packages/deployer-cf-workers/src/utils.ts | 52 ++++++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index 7687b3bf5..d9590667d 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -6,7 +6,14 @@ import { FabSettings, getContentType, } from '@dev-spendesk/fab-core' -import { CloudflareApi, getCloudflareApi, log } from './utils' +import { + CloudflareApi, + createManifest, + getAssetManifest, + getChangedFiles, + getCloudflareApi, + log, +} from './utils' import { FabDeployError, InvalidConfigError } from '@dev-spendesk/fab-cli' import { createPackage } from './createPackage' import path from 'path' @@ -57,7 +64,10 @@ export const deployAssets: FabAssetsDeployer = async ( log(`Uploading files...`) const files = await globby(['_assets/**/*'], { cwd: extracted_dir }) - const uploads = files.map(async (file) => { + const assetManifest = await getAssetManifest(api, account_id, namespace.id) + const changedFiles = getChangedFiles(assetManifest, files) + + const uploads = changedFiles.map(async (file) => { const content_type = getContentType(file) const body_stream = fs.createReadStream(path.join(extracted_dir, file)) @@ -88,6 +98,7 @@ export const deployAssets: FabAssetsDeployer = async ( }) await Promise.all(uploads) + await createManifest(api, account_id, namespace.id, assetManifest, files) log.tick(`Done.`) diff --git a/packages/deployer-cf-workers/src/utils.ts b/packages/deployer-cf-workers/src/utils.ts index 209540171..e2b09f608 100644 --- a/packages/deployer-cf-workers/src/utils.ts +++ b/packages/deployer-cf-workers/src/utils.ts @@ -110,3 +110,55 @@ export const getCloudflareApi = async ( } return ApiInstance } + +const ASSET_MANIFEST = '_fab_deploy_asset_manifest' + +export const getAssetManifest = async ( + api: CloudflareApi, + account_id: string, + namespace_id: string +): Promise> => { + const response = await api.get( + `/accounts/${account_id}/storage/kv/namespaces/${namespace_id}/values/${ASSET_MANIFEST}` + ) + + try { + return new Set(JSON.parse(response)) + } catch (error) { + // Do nothing + } + + return new Set() +} + +export const createManifest = async ( + api: CloudflareApi, + account_id: string, + namespace_id: string, + manifest: Set, + files: string[] +): Promise> => { + const newManifest = new Set([...manifest, ...files]) + + const body = new FormData() + body.append('value', JSON.stringify(newManifest)) + + const response = await api.put( + `/accounts/${account_id}/storage/kv/namespaces/${namespace_id}/values/${ASSET_MANIFEST}`, + { body } + ) + + if (!response.success) { + log(`Error uploading fab asset manifest: + ${response.errors + .map((err: any) => `๐Ÿ–ค[error ${err.code}]๐Ÿ–ค โค๏ธ${err.message}โค๏ธ`) + .join('\n')} + `) + } + + return newManifest +} + +export const getChangedFiles = (manifest: Set, files: string[]): string[] => { + return files.filter((file) => !manifest.has(file)) +} From 946cf44e3c6008b8a3a9daac7e3c772789bed74e Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Fri, 15 Jul 2022 21:14:56 +0200 Subject: [PATCH 13/23] v1.0.0-rc.12 --- lerna.json | 2 +- packages/_fab/package.json | 4 +- packages/actions/package.json | 6 +- packages/cli/README.md | 162 +-------------------- packages/cli/package.json | 4 +- packages/core/package.json | 2 +- packages/deployer-aws-lambda/package.json | 6 +- packages/deployer-aws-s3/package.json | 6 +- packages/deployer-cf-workers/package.json | 6 +- packages/input-nextjs/package.json | 6 +- packages/input-static/package.json | 6 +- packages/plugin-precompile/package.json | 6 +- packages/plugin-render-html/package.json | 6 +- packages/plugin-rewire-assets/package.json | 6 +- packages/sandbox-node-vm/package.json | 4 +- packages/server/package.json | 8 +- 16 files changed, 40 insertions(+), 200 deletions(-) diff --git a/lerna.json b/lerna.json index 46d8b4e98..016d7b066 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": ["packages/*"], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.0.0-rc.11" + "version": "1.0.0-rc.12" } diff --git a/packages/_fab/package.json b/packages/_fab/package.json index 23495d296..d7111e464 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "An alias for @dev-spendesk/fab-cli", "keywords": [ "fab" @@ -27,6 +27,6 @@ "prepack": "cat PREAMBLE.md > README.md && cat ../cli/README.md >> README.md" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11" + "@dev-spendesk/fab-cli": "1.0.0-rc.12" } } diff --git a/packages/actions/package.json b/packages/actions/package.json index 8379b6bab..fe5cd3303 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-actions", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "private": false, "description": "The guts of the FAB cli code, keeping the 'fab' package lean", "keywords": [ @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@rollup/plugin-alias": "^2.2.0", "@rollup/plugin-commonjs": "^11.0.2", "@rollup/plugin-inject": "^4.0.1", diff --git a/packages/cli/README.md b/packages/cli/README.md index 30df5d04f..50fe48dec 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -21,7 +21,7 @@ $ npm install -g @dev-spendesk/fab-cli $ fab COMMAND running command... $ fab (-v|--version|version) -@dev-spendesk/fab-cli/1.0.0-rc.11 linux-x64 node-v14.18.1 +@dev-spendesk/fab-cli/1.0.0-rc.12 darwin-x64 node-v14.19.1 $ fab --help [COMMAND] USAGE $ fab COMMAND @@ -34,75 +34,7 @@ USAGE -- [`fab build`](#fab-build) -- [`fab deploy [FILE]`](#fab-deploy-file) - [`fab help [COMMAND]`](#fab-help-command) -- [`fab init`](#fab-init) -- [`fab package [FILE]`](#fab-package-file) -- [`fab serve [FILE]`](#fab-serve-file) - -## `fab build` - -Generate a FAB given the config (usually in fab.config.json5) - -``` -USAGE - $ fab build - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file - -h, --help show CLI help - --minify Minify the generated server.js file. - --skip-cache Skip any caching of intermediate build artifacts - --skip-typecheck Skip the background typechecking of your FAB plugins if it's slow or flaky. - - --watch=watch Re-run the builder if any of the listed files change. Pass this argument multiple times to watch - multiple files/directories. - -EXAMPLES - $ fab build - $ fab build --config=fab.config.json5 - $ fab build --watch dist --watch fab.config.json5 -``` - -_See code: [lib/commands/build.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/build.js)_ - -## `fab deploy [FILE]` - -Deploy a FAB to a hosting provider - -``` -USAGE - $ fab deploy [FILE] - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file - -h, --help show CLI help - - --assets-already-deployed-at=assets-already-deployed-at Skip asset deploys and only deploy the server component - pointing at this URL for assets - - --assets-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the assets defined - in your fab.config.json5, which one to deploy to. - - --assets-only Skip server deploy, just upload assets - - --auto-install If you need dependent packages (e.g. @dev-spendesk/deploy-*), - install them without prompting - - --env=env Override production settings with a different environment - defined in your FAB config file. - - --package-dir=package-dir Where to save the packaged FAB files (default .fab/deploy) - - --server-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the server defined - in your fab.config.json5, which one to deploy to. - -EXAMPLE - $ fab deploy fab.zip -``` - -_See code: [lib/commands/deploy.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/deploy.js)_ ## `fab help [COMMAND]` @@ -121,96 +53,4 @@ OPTIONS _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.1/src/commands/help.ts)_ -## `fab init` - -Auto-configure a repo for generating FABs - -``` -USAGE - $ fab init - -OPTIONS - -c, --config=config [default: fab.config.json5] Config filename - -h, --help show CLI help - -y, --yes Assume yes to all prompts (must be in the root directory of a project) - --empty Install the packages and create an empty fab.config.json5 (implies -y) - --skip-framework-detection Don't try to auto-detect framework, set up manually. - --skip-install Do not attempt to npm install anything - --version=version What NPM version or dist-tag to use for installing FAB packages - -EXAMPLES - $ fab init - $ fab init --config=fab.config.json5 -``` - -_See code: [lib/commands/init.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/init.js)_ - -## `fab package [FILE]` - -Package a FAB to be uploaded to a hosting provider manually - -``` -USAGE - $ fab package [FILE] - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file - -h, --help show CLI help - - -t, --target=(cf-workers|aws-lambda-edge|aws-s3) Hosting provider (must be one of: cf-workers, aws-lambda-edge, - aws-s3) - - --assets-url=assets-url A URL for where the assets can be accessed, for server deployers - that need it - - --env=env Override production settings with a different environment defined in - your FAB config file. - - --output-path=output-path Where to save the packaged FAB (default .fab/deploy/[target].zip) - -EXAMPLE - $ fab package --target=aws-lambda-edge fab.zip -``` - -_See code: [lib/commands/package.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/package.js)_ - -## `fab serve [FILE]` - -fab serve: Serve a FAB in a local NodeJS Express server - -``` -USAGE - $ fab serve [FILE] - -OPTIONS - -c, --config=config [default: fab.config.json5] Path to config file. Only used for SETTINGS in conjunction with - --env. - - -h, --help show CLI help - - --auto-install If you need dependent packages (e.g. @dev-spendesk/serve), install them without prompting - - --cert=cert SSL certificate to use - - --env=env Override production settings with a different environment defined in your FAB config file. - - --experimental-v8-sandbox Enable experimental V8::Isolate Runtime (in development, currently non-functional) - - --key=key Key for the SSL Certificate - - --port=port (required) [default: 3000] Port to use - - --proxy-ws=proxy-ws EXPERIMENTAL: Proxy websocket requests to a different port - - --watch EXPERIMENTAL: Watches fab.zip and restarts the server when it changes. - -EXAMPLES - $ fab serve fab.zip - $ fab serve --port=3001 fab.zip - $ fab serve --cert=local-ssl.cert --key=local-ssl.key fab.zip - $ fab serve --env=staging fab.zip -``` - -_See code: [lib/commands/serve.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/serve.js)_ - diff --git a/packages/cli/package.json b/packages/cli/package.json index ce63921b2..77f9d70b0 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-cli", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "The CLI entry-point for the FAB ecosystem", "keywords": [ "fab", @@ -35,7 +35,7 @@ "version": "oclif-dev readme && git add README.md" }, "dependencies": { - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/errors": "^1", diff --git a/packages/core/package.json b/packages/core/package.json index 4d773c381..a6d70c6cf 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-core", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "private": false, "description": "Common code for all FAB projects", "keywords": [ diff --git a/packages/deployer-aws-lambda/package.json b/packages/deployer-aws-lambda/package.json index 15551c68f..57b230349 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/deployer-aws-lambda", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "aws", @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@types/nanoid": "^2.1.0", "@types/node": "^12.12.14", "deterministic-zip": "^1.1.0", diff --git a/packages/deployer-aws-s3/package.json b/packages/deployer-aws-s3/package.json index 4104f6e0c..511037157 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-deployer-aws-s3", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Uploads FAB assets to AWS S3", "keywords": [ "aws", @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@types/node": "^12.12.14", "aws-sdk": "^2.655.0", "fs-extra": "^9.0.0", diff --git a/packages/deployer-cf-workers/package.json b/packages/deployer-cf-workers/package.json index 4af37f881..6b791bd33 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-deployer-cf-workers", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "cloudflare", @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@types/node": "^12.12.14", "cross-fetch": "^3.0.6", "file-to-sha512": "^0.0.1", diff --git a/packages/input-nextjs/package.json b/packages/input-nextjs/package.json index 628ee47bb..69dca720d 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-input-nextjs", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Module to kick off a FAB build from a NextJS project", "keywords": [ "aws", @@ -34,8 +34,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@types/node": "^12.12.14", "@types/path-to-regexp": "^1.7.0", "acorn": "^7.1.0", diff --git a/packages/input-static/package.json b/packages/input-static/package.json index e68ef16ce..e18387311 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-input-static", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Module to handle a directory of HTML & assets", "keywords": [ "fab", @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@types/node": "^12.12.14", "fs-extra": "^8.1.0", "globby": "^10" diff --git a/packages/plugin-precompile/package.json b/packages/plugin-precompile/package.json index 4a479e37a..42910feb8 100644 --- a/packages/plugin-precompile/package.json +++ b/packages/plugin-precompile/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-plugin-precompile", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Module to render static HTML files with FAB injections", "keywords": [ "fab" @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@sucrase/webpack-loader": "^2.0.0", "@types/node": "^12.12.14", "@types/webpack-merge": "^4.1.5", diff --git a/packages/plugin-render-html/package.json b/packages/plugin-render-html/package.json index b73dc3b87..efc400ebd 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-plugin-render-html", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Module to render static HTML files with FAB injections", "keywords": [ "fab" @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@types/cheerio": "^0.22.15", "@types/node": "^12.12.14", "cheerio": "^1.0.0-rc.3", diff --git a/packages/plugin-rewire-assets/package.json b/packages/plugin-rewire-assets/package.json index cf8cd3fb9..df32dff9c 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-plugin-rewire-assets", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "Module to handle files outside _assets", "keywords": [ "assets", @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "@types/istextorbinary": "^2.3.0", "@types/mime-types": "^2.1.0", "@types/node": "^12.12.14", diff --git a/packages/sandbox-node-vm/package.json b/packages/sandbox-node-vm/package.json index b17186b31..d85625e2a 100644 --- a/packages/sandbox-node-vm/package.json +++ b/packages/sandbox-node-vm/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-sandbox-node-vm", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "FAB runtime sandbox using Node's 'vm'", "keywords": [ "fab", @@ -29,7 +29,7 @@ "prepack": "npm run clean && npm run build" }, "dependencies": { - "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.12", "cross-fetch": "^3.0.6", "web-streams-polyfill": "^2.1.1" }, diff --git a/packages/server/package.json b/packages/server/package.json index b52b0af4c..e48ba809e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-server", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "NodeJS FAB Server", "keywords": [ "fab", @@ -30,9 +30,9 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.11", - "@dev-spendesk/fab-core": "1.0.0-rc.11", - "@dev-spendesk/fab-sandbox-node-vm": "1.0.0-rc.11", + "@dev-spendesk/fab-cli": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-sandbox-node-vm": "1.0.0-rc.12", "@fly/v8env": "^0.54.0", "@types/concat-stream": "^1.6.0", "@types/express": "^4.17.2", From 756dcebe4283719e2c2d2c28f72131231ef66caf Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Fri, 15 Jul 2022 23:42:18 +0200 Subject: [PATCH 14/23] Revert "v1.0.0-rc.12" This reverts commit 946cf44e3c6008b8a3a9daac7e3c772789bed74e. --- lerna.json | 2 +- packages/_fab/package.json | 4 +- packages/actions/package.json | 6 +- packages/cli/README.md | 162 ++++++++++++++++++++- packages/cli/package.json | 4 +- packages/core/package.json | 2 +- packages/deployer-aws-lambda/package.json | 6 +- packages/deployer-aws-s3/package.json | 6 +- packages/deployer-cf-workers/package.json | 6 +- packages/input-nextjs/package.json | 6 +- packages/input-static/package.json | 6 +- packages/plugin-precompile/package.json | 6 +- packages/plugin-render-html/package.json | 6 +- packages/plugin-rewire-assets/package.json | 6 +- packages/sandbox-node-vm/package.json | 4 +- packages/server/package.json | 8 +- 16 files changed, 200 insertions(+), 40 deletions(-) diff --git a/lerna.json b/lerna.json index 016d7b066..46d8b4e98 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": ["packages/*"], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.0.0-rc.12" + "version": "1.0.0-rc.11" } diff --git a/packages/_fab/package.json b/packages/_fab/package.json index d7111e464..23495d296 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "An alias for @dev-spendesk/fab-cli", "keywords": [ "fab" @@ -27,6 +27,6 @@ "prepack": "cat PREAMBLE.md > README.md && cat ../cli/README.md >> README.md" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12" + "@dev-spendesk/fab-cli": "1.0.0-rc.11" } } diff --git a/packages/actions/package.json b/packages/actions/package.json index fe5cd3303..8379b6bab 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-actions", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "private": false, "description": "The guts of the FAB cli code, keeping the 'fab' package lean", "keywords": [ @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@rollup/plugin-alias": "^2.2.0", "@rollup/plugin-commonjs": "^11.0.2", "@rollup/plugin-inject": "^4.0.1", diff --git a/packages/cli/README.md b/packages/cli/README.md index 50fe48dec..30df5d04f 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -21,7 +21,7 @@ $ npm install -g @dev-spendesk/fab-cli $ fab COMMAND running command... $ fab (-v|--version|version) -@dev-spendesk/fab-cli/1.0.0-rc.12 darwin-x64 node-v14.19.1 +@dev-spendesk/fab-cli/1.0.0-rc.11 linux-x64 node-v14.18.1 $ fab --help [COMMAND] USAGE $ fab COMMAND @@ -34,7 +34,75 @@ USAGE +- [`fab build`](#fab-build) +- [`fab deploy [FILE]`](#fab-deploy-file) - [`fab help [COMMAND]`](#fab-help-command) +- [`fab init`](#fab-init) +- [`fab package [FILE]`](#fab-package-file) +- [`fab serve [FILE]`](#fab-serve-file) + +## `fab build` + +Generate a FAB given the config (usually in fab.config.json5) + +``` +USAGE + $ fab build + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file + -h, --help show CLI help + --minify Minify the generated server.js file. + --skip-cache Skip any caching of intermediate build artifacts + --skip-typecheck Skip the background typechecking of your FAB plugins if it's slow or flaky. + + --watch=watch Re-run the builder if any of the listed files change. Pass this argument multiple times to watch + multiple files/directories. + +EXAMPLES + $ fab build + $ fab build --config=fab.config.json5 + $ fab build --watch dist --watch fab.config.json5 +``` + +_See code: [lib/commands/build.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/build.js)_ + +## `fab deploy [FILE]` + +Deploy a FAB to a hosting provider + +``` +USAGE + $ fab deploy [FILE] + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file + -h, --help show CLI help + + --assets-already-deployed-at=assets-already-deployed-at Skip asset deploys and only deploy the server component + pointing at this URL for assets + + --assets-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the assets defined + in your fab.config.json5, which one to deploy to. + + --assets-only Skip server deploy, just upload assets + + --auto-install If you need dependent packages (e.g. @dev-spendesk/deploy-*), + install them without prompting + + --env=env Override production settings with a different environment + defined in your FAB config file. + + --package-dir=package-dir Where to save the packaged FAB files (default .fab/deploy) + + --server-host=(cf-workers|aws-lambda-edge|aws-s3) If you have multiple potential hosts for the server defined + in your fab.config.json5, which one to deploy to. + +EXAMPLE + $ fab deploy fab.zip +``` + +_See code: [lib/commands/deploy.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/deploy.js)_ ## `fab help [COMMAND]` @@ -53,4 +121,96 @@ OPTIONS _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.1/src/commands/help.ts)_ +## `fab init` + +Auto-configure a repo for generating FABs + +``` +USAGE + $ fab init + +OPTIONS + -c, --config=config [default: fab.config.json5] Config filename + -h, --help show CLI help + -y, --yes Assume yes to all prompts (must be in the root directory of a project) + --empty Install the packages and create an empty fab.config.json5 (implies -y) + --skip-framework-detection Don't try to auto-detect framework, set up manually. + --skip-install Do not attempt to npm install anything + --version=version What NPM version or dist-tag to use for installing FAB packages + +EXAMPLES + $ fab init + $ fab init --config=fab.config.json5 +``` + +_See code: [lib/commands/init.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/init.js)_ + +## `fab package [FILE]` + +Package a FAB to be uploaded to a hosting provider manually + +``` +USAGE + $ fab package [FILE] + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file + -h, --help show CLI help + + -t, --target=(cf-workers|aws-lambda-edge|aws-s3) Hosting provider (must be one of: cf-workers, aws-lambda-edge, + aws-s3) + + --assets-url=assets-url A URL for where the assets can be accessed, for server deployers + that need it + + --env=env Override production settings with a different environment defined in + your FAB config file. + + --output-path=output-path Where to save the packaged FAB (default .fab/deploy/[target].zip) + +EXAMPLE + $ fab package --target=aws-lambda-edge fab.zip +``` + +_See code: [lib/commands/package.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/package.js)_ + +## `fab serve [FILE]` + +fab serve: Serve a FAB in a local NodeJS Express server + +``` +USAGE + $ fab serve [FILE] + +OPTIONS + -c, --config=config [default: fab.config.json5] Path to config file. Only used for SETTINGS in conjunction with + --env. + + -h, --help show CLI help + + --auto-install If you need dependent packages (e.g. @dev-spendesk/serve), install them without prompting + + --cert=cert SSL certificate to use + + --env=env Override production settings with a different environment defined in your FAB config file. + + --experimental-v8-sandbox Enable experimental V8::Isolate Runtime (in development, currently non-functional) + + --key=key Key for the SSL Certificate + + --port=port (required) [default: 3000] Port to use + + --proxy-ws=proxy-ws EXPERIMENTAL: Proxy websocket requests to a different port + + --watch EXPERIMENTAL: Watches fab.zip and restarts the server when it changes. + +EXAMPLES + $ fab serve fab.zip + $ fab serve --port=3001 fab.zip + $ fab serve --cert=local-ssl.cert --key=local-ssl.key fab.zip + $ fab serve --env=staging fab.zip +``` + +_See code: [lib/commands/serve.js](https://github.com/spendesk/fab/blob/v1.0.0-rc.11/lib/commands/serve.js)_ + diff --git a/packages/cli/package.json b/packages/cli/package.json index 77f9d70b0..ce63921b2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-cli", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "The CLI entry-point for the FAB ecosystem", "keywords": [ "fab", @@ -35,7 +35,7 @@ "version": "oclif-dev readme && git add README.md" }, "dependencies": { - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/errors": "^1", diff --git a/packages/core/package.json b/packages/core/package.json index a6d70c6cf..4d773c381 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-core", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "private": false, "description": "Common code for all FAB projects", "keywords": [ diff --git a/packages/deployer-aws-lambda/package.json b/packages/deployer-aws-lambda/package.json index 57b230349..15551c68f 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/deployer-aws-lambda", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "aws", @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/nanoid": "^2.1.0", "@types/node": "^12.12.14", "deterministic-zip": "^1.1.0", diff --git a/packages/deployer-aws-s3/package.json b/packages/deployer-aws-s3/package.json index 511037157..4104f6e0c 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-deployer-aws-s3", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "Uploads FAB assets to AWS S3", "keywords": [ "aws", @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/node": "^12.12.14", "aws-sdk": "^2.655.0", "fs-extra": "^9.0.0", diff --git a/packages/deployer-cf-workers/package.json b/packages/deployer-cf-workers/package.json index 6b791bd33..4af37f881 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-deployer-cf-workers", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "cloudflare", @@ -33,8 +33,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/node": "^12.12.14", "cross-fetch": "^3.0.6", "file-to-sha512": "^0.0.1", diff --git a/packages/input-nextjs/package.json b/packages/input-nextjs/package.json index 69dca720d..628ee47bb 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-input-nextjs", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "Module to kick off a FAB build from a NextJS project", "keywords": [ "aws", @@ -34,8 +34,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/node": "^12.12.14", "@types/path-to-regexp": "^1.7.0", "acorn": "^7.1.0", diff --git a/packages/input-static/package.json b/packages/input-static/package.json index e18387311..e68ef16ce 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-input-static", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "Module to handle a directory of HTML & assets", "keywords": [ "fab", @@ -31,8 +31,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/node": "^12.12.14", "fs-extra": "^8.1.0", "globby": "^10" diff --git a/packages/plugin-precompile/package.json b/packages/plugin-precompile/package.json index 42910feb8..4a479e37a 100644 --- a/packages/plugin-precompile/package.json +++ b/packages/plugin-precompile/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-plugin-precompile", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "Module to render static HTML files with FAB injections", "keywords": [ "fab" @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@sucrase/webpack-loader": "^2.0.0", "@types/node": "^12.12.14", "@types/webpack-merge": "^4.1.5", diff --git a/packages/plugin-render-html/package.json b/packages/plugin-render-html/package.json index efc400ebd..b73dc3b87 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-plugin-render-html", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "Module to render static HTML files with FAB injections", "keywords": [ "fab" @@ -30,8 +30,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/cheerio": "^0.22.15", "@types/node": "^12.12.14", "cheerio": "^1.0.0-rc.3", diff --git a/packages/plugin-rewire-assets/package.json b/packages/plugin-rewire-assets/package.json index df32dff9c..cf8cd3fb9 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-plugin-rewire-assets", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "Module to handle files outside _assets", "keywords": [ "assets", @@ -32,8 +32,8 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@types/istextorbinary": "^2.3.0", "@types/mime-types": "^2.1.0", "@types/node": "^12.12.14", diff --git a/packages/sandbox-node-vm/package.json b/packages/sandbox-node-vm/package.json index d85625e2a..b17186b31 100644 --- a/packages/sandbox-node-vm/package.json +++ b/packages/sandbox-node-vm/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-sandbox-node-vm", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "FAB runtime sandbox using Node's 'vm'", "keywords": [ "fab", @@ -29,7 +29,7 @@ "prepack": "npm run clean && npm run build" }, "dependencies": { - "@dev-spendesk/fab-core": "1.0.0-rc.12", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "cross-fetch": "^3.0.6", "web-streams-polyfill": "^2.1.1" }, diff --git a/packages/server/package.json b/packages/server/package.json index e48ba809e..b52b0af4c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@dev-spendesk/fab-server", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.11", "description": "NodeJS FAB Server", "keywords": [ "fab", @@ -30,9 +30,9 @@ "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"" }, "dependencies": { - "@dev-spendesk/fab-cli": "1.0.0-rc.12", - "@dev-spendesk/fab-core": "1.0.0-rc.12", - "@dev-spendesk/fab-sandbox-node-vm": "1.0.0-rc.12", + "@dev-spendesk/fab-cli": "1.0.0-rc.11", + "@dev-spendesk/fab-core": "1.0.0-rc.11", + "@dev-spendesk/fab-sandbox-node-vm": "1.0.0-rc.11", "@fly/v8env": "^0.54.0", "@types/concat-stream": "^1.6.0", "@types/express": "^4.17.2", From 758a8f4f923091e7983586cee23120175a2e9593 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Fri, 15 Jul 2022 23:42:43 +0200 Subject: [PATCH 15/23] up --- packages/deployer-cf-workers/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deployer-cf-workers/src/utils.ts b/packages/deployer-cf-workers/src/utils.ts index e2b09f608..a8b1d3bda 100644 --- a/packages/deployer-cf-workers/src/utils.ts +++ b/packages/deployer-cf-workers/src/utils.ts @@ -140,7 +140,7 @@ export const createManifest = async ( ): Promise> => { const newManifest = new Set([...manifest, ...files]) - const body = new FormData() + const body = new URLSearchParams() body.append('value', JSON.stringify(newManifest)) const response = await api.put( From 9755609c490a07fd597da2793212c99358f9910a Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Sat, 16 Jul 2022 00:26:01 +0200 Subject: [PATCH 16/23] up --- packages/deployer-cf-workers/src/utils.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/deployer-cf-workers/src/utils.ts b/packages/deployer-cf-workers/src/utils.ts index a8b1d3bda..6cb809ea3 100644 --- a/packages/deployer-cf-workers/src/utils.ts +++ b/packages/deployer-cf-workers/src/utils.ts @@ -14,6 +14,7 @@ type Namespace = { export type CloudflareApi = { post: CloudflareApiCall get: CloudflareApiCall + getText: CloudflareApiCall put: CloudflareApiCall account_supports_kv: boolean getOrCreateNamespace: (title: string) => Promise @@ -27,7 +28,7 @@ export const getCloudflareApi = async ( ): Promise => { if (ApiInstance) return ApiInstance - const go = (method: string, content_type: string) => async ( + const go = (method: string, content_type: string, parseJson = true) => async ( url: string, init: RequestInit = {} ) => { @@ -40,9 +41,10 @@ export const getCloudflareApi = async ( ...init?.headers, }, }) - return await response.json() + return parseJson ? response.json() : response.text() } const get = go('get', 'application/json') + const getText = go('get', 'text/html', false) const put = go('put', 'application/json') const post = go('post', 'application/json') @@ -103,6 +105,7 @@ export const getCloudflareApi = async ( ApiInstance = { get, + getText, put, post, account_supports_kv, @@ -118,7 +121,7 @@ export const getAssetManifest = async ( account_id: string, namespace_id: string ): Promise> => { - const response = await api.get( + const response = await api.getText( `/accounts/${account_id}/storage/kv/namespaces/${namespace_id}/values/${ASSET_MANIFEST}` ) From 5eb44625da895816460221f41d1519f1092d0ca8 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Sat, 16 Jul 2022 11:04:35 +0200 Subject: [PATCH 17/23] up --- packages/deployer-cf-workers/src/deploy.ts | 25 ++++++++++++++++++++-- packages/deployer-cf-workers/src/utils.ts | 5 ++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index d9590667d..760170975 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -95,10 +95,31 @@ export const deployAssets: FabAssetsDeployer = async ( } log.continue(`๐Ÿ–ค ${file} (${pretty(body_stream.bytesRead)})๐Ÿ–ค`) + + return file }) - await Promise.all(uploads) - await createManifest(api, account_id, namespace.id, assetManifest, files) + const results = await Promise.allSettled(uploads) + + const newFiles: string[] = [] + const errors: any[] = [] + results.forEach((result) => { + if (result.status === 'fulfilled') { + newFiles.push(result.value) + } else { + errors.push(result.reason) + } + }) + + if (newFiles.length) { + log(`Creating manifest with ${newFiles.length} new file(s)`) + await createManifest(api, account_id, namespace.id, assetManifest, newFiles) + } + + if (errors.length) { + throw new FabDeployError(`Error uploading assets: + ${JSON.stringify(errors)}`) + } log.tick(`Done.`) diff --git a/packages/deployer-cf-workers/src/utils.ts b/packages/deployer-cf-workers/src/utils.ts index 6cb809ea3..bc72aedd6 100644 --- a/packages/deployer-cf-workers/src/utils.ts +++ b/packages/deployer-cf-workers/src/utils.ts @@ -128,7 +128,7 @@ export const getAssetManifest = async ( try { return new Set(JSON.parse(response)) } catch (error) { - // Do nothing + log(`Error while parsing manifest: ${error}`) } return new Set() @@ -143,8 +143,7 @@ export const createManifest = async ( ): Promise> => { const newManifest = new Set([...manifest, ...files]) - const body = new URLSearchParams() - body.append('value', JSON.stringify(newManifest)) + const body = JSON.stringify(Array.from(newManifest)) const response = await api.put( `/accounts/${account_id}/storage/kv/namespaces/${namespace_id}/values/${ASSET_MANIFEST}`, From 2131201bc285b1d03dcf33702ed3d4dce26ed08d Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Sat, 16 Jul 2022 11:10:42 +0200 Subject: [PATCH 18/23] up --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 622d91853..e32c71911 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,6 @@ "rimraf": "^3.0.0", "ts-node": "^8", "tsconfig-paths": "^3.9.0", - "typescript": "~3.7.2" + "typescript": "3.8.2" } } diff --git a/yarn.lock b/yarn.lock index d6331ee22..e3649d6dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8912,16 +8912,16 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +typescript@3.8.2: + version "3.8.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.2.tgz#91d6868aaead7da74f493c553aeff76c0c0b1d5a" + integrity sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ== + typescript@^3.7.5: version "3.7.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== -typescript@~3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb" - integrity sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ== - uglify-js@^3.1.4: version "3.7.1" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.7.1.tgz#35c7de17971a4aa7689cd2eae0a5b39bb838c0c5" From a92daf1fc1fcf69eb2a763906d4afaf8cad283ab Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Sat, 16 Jul 2022 11:48:43 +0200 Subject: [PATCH 19/23] up --- packages/deployer-cf-workers/src/deploy.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index 760170975..17985b84c 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -66,6 +66,11 @@ export const deployAssets: FabAssetsDeployer = async ( const files = await globby(['_assets/**/*'], { cwd: extracted_dir }) const assetManifest = await getAssetManifest(api, account_id, namespace.id) const changedFiles = getChangedFiles(assetManifest, files) + const skippedFilesCount = files.length - changedFiles.length + + if (skippedFilesCount) { + log(`Found manifest. Skipping ${skippedFilesCount} file(s)`) + } const uploads = changedFiles.map(async (file) => { const content_type = getContentType(file) From 309f4dba8a0cd60a9eb57a0e5ee446b7cae0aa44 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Sat, 16 Jul 2022 12:24:05 +0200 Subject: [PATCH 20/23] up --- packages/deployer-cf-workers/src/deploy.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index 17985b84c..42d6f9c4d 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -62,7 +62,6 @@ export const deployAssets: FabAssetsDeployer = async ( const namespace = await api.getOrCreateNamespace(asset_namespace) - log(`Uploading files...`) const files = await globby(['_assets/**/*'], { cwd: extracted_dir }) const assetManifest = await getAssetManifest(api, account_id, namespace.id) const changedFiles = getChangedFiles(assetManifest, files) @@ -72,6 +71,10 @@ export const deployAssets: FabAssetsDeployer = async ( log(`Found manifest. Skipping ${skippedFilesCount} file(s)`) } + if (changedFiles.length) { + log(`Uploading files...`) + } + const uploads = changedFiles.map(async (file) => { const content_type = getContentType(file) const body_stream = fs.createReadStream(path.join(extracted_dir, file)) From ea588256d8ef82371278d9b032dabf4c338c7632 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Sat, 16 Jul 2022 18:15:14 +0200 Subject: [PATCH 21/23] up --- packages/deployer-cf-workers/src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/deployer-cf-workers/src/utils.ts b/packages/deployer-cf-workers/src/utils.ts index bc72aedd6..e84148c45 100644 --- a/packages/deployer-cf-workers/src/utils.ts +++ b/packages/deployer-cf-workers/src/utils.ts @@ -144,9 +144,10 @@ export const createManifest = async ( const newManifest = new Set([...manifest, ...files]) const body = JSON.stringify(Array.from(newManifest)) + const expiration_ttl = 604800 // Expires after one week const response = await api.put( - `/accounts/${account_id}/storage/kv/namespaces/${namespace_id}/values/${ASSET_MANIFEST}`, + `/accounts/${account_id}/storage/kv/namespaces/${namespace_id}/values/${ASSET_MANIFEST}?expiration_ttl=${expiration_ttl}`, { body } ) From 245635187c507d485f49f2495d79b4ca3f96e6a5 Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Sat, 16 Jul 2022 18:17:34 +0200 Subject: [PATCH 22/23] up --- packages/deployer-cf-workers/src/deploy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index 42d6f9c4d..4801f9db4 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -68,7 +68,7 @@ export const deployAssets: FabAssetsDeployer = async ( const skippedFilesCount = files.length - changedFiles.length if (skippedFilesCount) { - log(`Found manifest. Skipping ${skippedFilesCount} file(s)`) + log(`Found manifest. Skipping ${skippedFilesCount} file(s).`) } if (changedFiles.length) { @@ -120,7 +120,7 @@ export const deployAssets: FabAssetsDeployer = async ( }) if (newFiles.length) { - log(`Creating manifest with ${newFiles.length} new file(s)`) + log(`Creating manifest with ${newFiles.length} new file(s).`) await createManifest(api, account_id, namespace.id, assetManifest, newFiles) } From c2c554ec30b4ad4ce80c97f4047de11d45b91d1b Mon Sep 17 00:00:00 2001 From: Simon Degraeve Date: Sun, 17 Jul 2022 13:26:35 +0200 Subject: [PATCH 23/23] up --- packages/deployer-cf-workers/src/deploy.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/deployer-cf-workers/src/deploy.ts b/packages/deployer-cf-workers/src/deploy.ts index 4801f9db4..76257e698 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -109,6 +109,10 @@ export const deployAssets: FabAssetsDeployer = async ( const results = await Promise.allSettled(uploads) + if (changedFiles.length) { + log.tick(`Done.`) + } + const newFiles: string[] = [] const errors: any[] = [] results.forEach((result) => { @@ -129,8 +133,6 @@ export const deployAssets: FabAssetsDeployer = async ( ${JSON.stringify(errors)}`) } - log.tick(`Done.`) - return `kv://${namespace.id}` }