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/lerna.json b/lerna.json index 3f9513383..46d8b4e98 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.11" } diff --git a/lint-staged.config.js b/lint-staged.config.js index 6362c5758..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 '@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/fab-core/src' + // instead of '@dev-spendesk/fab-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/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/package.json b/package.json index 2e5b09cf3..e32c71911 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/*" ], @@ -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/packages/_fab/README.md b/packages/_fab/README.md index 057296d5c..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 @fab/cli +$ npm install -g @dev-spendesk/fab-cli $ fab COMMAND running command... $ fab (-v|--version|version) -@fab/cli/1.0.0-rc.9 darwin-x64 node-v15.5.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/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.11/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.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/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.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/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.11/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.11/lib/commands/serve.js)_ diff --git a/packages/_fab/fab.js b/packages/_fab/fab.js index f0ab29710..37b59bce8 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/fab-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/fab-cli/bin/run') diff --git a/packages/_fab/package.json b/packages/_fab/package.json index e58fc2cf8..23495d296 100644 --- a/packages/_fab/package.json +++ b/packages/_fab/package.json @@ -1,17 +1,17 @@ { - "name": "fab", - "version": "1.0.0-rc.9", - "description": "An alias for @fab/cli", + "name": "@dev-spendesk/fab", + "version": "1.0.0-rc.11", + "description": "An alias for @dev-spendesk/fab-cli", "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", @@ -27,7 +27,6 @@ "prepack": "cat PREAMBLE.md > README.md && cat ../cli/README.md >> README.md" }, "dependencies": { - "@fab/cli": "1.0.0-rc.9" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + "@dev-spendesk/fab-cli": "1.0.0-rc.11" + } } diff --git a/packages/actions/package.json b/packages/actions/package.json index 5a275b9ee..8379b6bab 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -1,6 +1,6 @@ { - "name": "@fab/actions", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-actions", + "version": "1.0.0-rc.11", "private": false, "description": "The guts of the FAB cli code, keeping the 'fab' package lean", "keywords": [ @@ -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": [ @@ -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/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", @@ -58,6 +58,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/actions/src/Builder.ts b/packages/actions/src/Builder.ts index cae94e041..5ad1ef6b8 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/fab-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/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 ccf080b4e..3913b4f69 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/fab-core' +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('@fab/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 decbf67cd..b2f6049b7 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/fab-core' import { _log, FabDeployError, @@ -14,7 +14,7 @@ import { JSON5Config, loadOrInstallModule, loadOrInstallModules, -} from '@fab/cli' +} from '@dev-spendesk/fab-cli' const log = _log('Deployer') @@ -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/Generator.ts b/packages/actions/src/Generator.ts index 242c25851..88f63f51b 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/fab-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/fab-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/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 87eb4f114..4f35f8554 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/fab-core' +import { _log, FabPackageError, loadModule } from '@dev-spendesk/fab-cli' const log = _log(`Packager`) @@ -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/actions/src/Typecheck.ts b/packages/actions/src/Typecheck.ts index cc4325d99..766b677a8 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/fab-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/fab-core' const log = _log('Typecheck') diff --git a/packages/actions/src/index.ts b/packages/actions/src/index.ts index 60aaa6f15..ecac9348d 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/fab-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..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 '@fab/cli' +import { _log } from '@dev-spendesk/fab-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..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 '@fab/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 e547037ba..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 '@fab/core' +} from '@dev-spendesk/fab-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..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 '@fab/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 7b0e862a0..04f10bd44 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/fab-cli' import { captureStdout } from '../helpers' -import { ProtoFab } from '@fab/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 95fc5717d..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 '@fab/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 87ddafbbf..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 '@fab/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 675a0bd03..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 '@fab/core' +import { PluginArgs, PluginMetadata } from '@dev-spendesk/fab-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/README.md b/packages/cli/README.md index 22f10f71d..30df5d04f 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/fab-cli $ fab COMMAND running command... $ fab (-v|--version|version) -@fab/cli/1.0.0-rc.9 darwin-x64 node-v15.5.1 +@dev-spendesk/fab-cli/1.0.0-rc.11 linux-x64 node-v14.18.1 $ fab --help [COMMAND] USAGE $ fab COMMAND @@ -65,7 +65,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.11/lib/commands/build.js)_ ## `fab deploy [FILE]` @@ -87,8 +87,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. @@ -102,7 +102,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.11/lib/commands/deploy.js)_ ## `fab help [COMMAND]` @@ -143,7 +143,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.11/lib/commands/init.js)_ ## `fab package [FILE]` @@ -172,7 +172,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.11/lib/commands/package.js)_ ## `fab serve [FILE]` @@ -188,7 +188,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 @@ -211,6 +211,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.11/lib/commands/serve.js)_ diff --git a/packages/cli/package.json b/packages/cli/package.json index a8377ed38..ce63921b2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,14 +1,14 @@ { - "name": "@fab/cli", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-cli", + "version": "1.0.0-rc.11", "description": "The CLI entry-point for the FAB ecosystem", "keywords": [ "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": [ @@ -35,7 +35,7 @@ "version": "oclif-dev readme && git add README.md" }, "dependencies": { - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/errors": "^1", @@ -75,7 +75,6 @@ "publishConfig": { "access": "public" }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de", "oclif": { "commands": "./lib/commands", "bin": "fab", diff --git a/packages/cli/src/Initializer/constants.ts b/packages/cli/src/Initializer/constants.ts index fd9744dc2..418ed2cf2 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/fab-cli', + '@dev-spendesk/fab-server', + '@dev-spendesk/fab-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..8ad453437 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/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' ) => ({ - '@fab/input-static': { + '@dev-spendesk/fab-input-static': { dir, }, - '@fab/plugin-render-html': { + '@dev-spendesk/fab-plugin-render-html': { fallback, }, - '@fab/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') : { - '@fab/input-nextjs': { + '@dev-spendesk/fab-input-nextjs': { dir: '.next', }, - '@fab/plugin-render-html': { + '@dev-spendesk/fab-plugin-render-html': { fallback: false, }, - '@fab/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 6400b7bb6..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 '@fab/core' +import { BuildConfig } from '@dev-spendesk/fab-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/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 ๐Ÿ–ค@fab/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 ๐Ÿ’›@fab/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 13106a0fa..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 '@fab/core' +import { DEFAULT_CONFIG_FILENAME, FabActionsExports } from '@dev-spendesk/fab-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/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 241eb01c7..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 '@fab/core' +} from '@dev-spendesk/fab-core' import { JSON5Config } from '../' import fs from 'fs-extra' @@ -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: @@ -46,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', }), } @@ -73,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/fab-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..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 '@fab/core' +import { DEFAULT_CONFIG_FILENAME } from '@dev-spendesk/fab-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..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 '@fab/core' +} from '@dev-spendesk/fab-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/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 b6666901c..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 '@fab/core' +} from '@dev-spendesk/fab-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/fab-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..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 '@fab/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 a55c1212e..e87f46184 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/fab-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 948398673..4d773c381 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,14 +1,14 @@ { - "name": "@fab/core", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-core", + "version": "1.0.0-rc.11", "private": false, "description": "Common code for all FAB projects", "keywords": [ "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": [ @@ -34,6 +34,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 034ad240c..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: '@fab/deployer-cf-workers', + package_name: '@dev-spendesk/fab-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/fab-deployer-aws-s3', capabilities: { server: false, assets: true, diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index ad29c331a..ea123cb03 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/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. * - * For build-time-specific code, use @fab/cli + * For build-time-specific code, use @dev-spendesk/fab-cli * * */ diff --git a/packages/core/src/runtime.ts b/packages/core/src/runtime.ts index b118732dd..f3a43e453 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/fab-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 045a33aab..a32474ace 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/fab-server, + * @dev-spendesk/cf-workers-wrapper, Linc.sh etc) and the FAB itself. * */ export type FabSpecRender = ( request: Request, @@ -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/core/test/ProtoFab.test.ts b/packages/core/test/ProtoFab.test.ts index 9ce02470e..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 '@fab/core' +import { ProtoFab } from '@dev-spendesk/fab-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 c747a7c56..15551c68f 100644 --- a/packages/deployer-aws-lambda/package.json +++ b/packages/deployer-aws-lambda/package.json @@ -1,6 +1,6 @@ { - "name": "@fab/deployer-aws-lambda", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/deployer-aws-lambda", + "version": "1.0.0-rc.11", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "aws", @@ -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": [ @@ -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/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", @@ -45,6 +45,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/deployer-aws-lambda/src/createPackage.ts b/packages/deployer-aws-lambda/src/createPackage.ts index 811d6b2f8..9cb5b876b 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/fab-core' import fs from 'fs-extra' import path from 'path' import nanoid from 'nanoid' @@ -10,7 +15,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 +33,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..b20d8d746 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/fab-core' import { createPackage } from './createPackage' import path from 'path' -import { InvalidConfigError } from '@fab/cli' +import { InvalidConfigError } from '@dev-spendesk/fab-cli' import { updateCloudFront, updateLambda } from './aws' import { log } from './utils' @@ -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 @@ -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..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 '@fab/cli' +import { _log } from '@dev-spendesk/fab-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..ddc428171 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/fab-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 b7642721c..4104f6e0c 100644 --- a/packages/deployer-aws-s3/package.json +++ b/packages/deployer-aws-s3/package.json @@ -1,6 +1,6 @@ { - "name": "@fab/deployer-aws-s3", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-deployer-aws-s3", + "version": "1.0.0-rc.11", "description": "Uploads FAB assets to AWS S3", "keywords": [ "aws", @@ -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": [ @@ -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/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", @@ -44,6 +44,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/deployer-aws-s3/src/aws.ts b/packages/deployer-aws-s3/src/aws.ts index a6a51bb5d..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 '@fab/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 08f65550c..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 '@fab/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 7aac13d4d..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 '@fab/cli' +import { _log } from '@dev-spendesk/fab-cli' -export const log = _log('@fab/deployer-aws-s3') +export const log = _log('@dev-spendesk/fab-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 5ce194356..4af37f881 100644 --- a/packages/deployer-cf-workers/package.json +++ b/packages/deployer-cf-workers/package.json @@ -1,6 +1,6 @@ { - "name": "@fab/deployer-cf-workers", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-deployer-cf-workers", + "version": "1.0.0-rc.11", "description": "Packages and deploys FABs to AWS Lambda@Edge", "keywords": [ "cloudflare", @@ -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": [ @@ -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/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", @@ -47,6 +47,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/deployer-cf-workers/src/createPackage.ts b/packages/deployer-cf-workers/src/createPackage.ts index 8f603c9ca..b6effaefd 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/fab-core' +import { FabPackageError } from '@dev-spendesk/fab-cli' import { log } from './utils' import path from 'path' @@ -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..76257e698 100644 --- a/packages/deployer-cf-workers/src/deploy.ts +++ b/packages/deployer-cf-workers/src/deploy.ts @@ -5,9 +5,16 @@ import { FabServerDeployer, FabSettings, getContentType, -} from '@fab/core' -import { CloudflareApi, getCloudflareApi, log } from './utils' -import { FabDeployError, InvalidConfigError } from '@fab/cli' +} from '@dev-spendesk/fab-core' +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' import fs from 'fs-extra' @@ -21,7 +28,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) @@ -55,9 +62,20 @@ export const deployAssets: FabAssetsDeployer = async ( const namespace = await api.getOrCreateNamespace(asset_namespace) - 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 skippedFilesCount = files.length - changedFiles.length + + if (skippedFilesCount) { + 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)) @@ -85,11 +103,35 @@ export const deployAssets: FabAssetsDeployer = async ( } log.continue(`๐Ÿ–ค ${file} (${pretty(body_stream.bytesRead)})๐Ÿ–ค`) + + return file }) - log.tick(`Done.`) + const results = await Promise.allSettled(uploads) - await Promise.all(uploads) + if (changedFiles.length) { + log.tick(`Done.`) + } + + 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)}`) + } return `kv://${namespace.id}` } @@ -98,7 +140,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 +166,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 +182,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)) @@ -159,7 +201,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'] @@ -171,7 +213,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', @@ -188,28 +233,31 @@ function checkValidityForZoneRoutes(config: ConfigTypes.CFWorkers) { (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' ) } } + 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 +265,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 +300,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 +391,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..d1ae755cf 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 '@dev-spendesk/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/src/utils.ts b/packages/deployer-cf-workers/src/utils.ts index dc6ead00f..e84148c45 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/fab-cli' +export const log = _log(`@dev-spendesk/fab-deployer-cf-workers`) import fetch from 'cross-fetch' @@ -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, @@ -110,3 +113,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.getText( + `/accounts/${account_id}/storage/kv/namespaces/${namespace_id}/values/${ASSET_MANIFEST}` + ) + + try { + return new Set(JSON.parse(response)) + } catch (error) { + log(`Error while parsing manifest: ${error}`) + } + + 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 = 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}?expiration_ttl=${expiration_ttl}`, + { 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)) +} 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) { 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 9f439e330..628ee47bb 100644 --- a/packages/input-nextjs/package.json +++ b/packages/input-nextjs/package.json @@ -1,6 +1,6 @@ { - "name": "@fab/input-nextjs", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-input-nextjs", + "version": "1.0.0-rc.11", "description": "Module to kick off a FAB build from a NextJS project", "keywords": [ "aws", @@ -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": [ @@ -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/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", @@ -52,6 +52,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/input-nextjs/src/build.ts b/packages/input-nextjs/src/build.ts index 6769104a1..742cef522 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/fab-core' import path from 'path' -import { InvalidConfigError, _log } from '@fab/cli' +import { InvalidConfigError, _log } from '@dev-spendesk/fab-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/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( - `@fab/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 f51deccaa..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 '@fab/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 68ab03248..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 '@fab/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/preflightChecks.ts b/packages/input-nextjs/src/preflightChecks.ts index 66f78f92a..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 '@fab/cli' +import { BuildFailedError } from '@dev-spendesk/fab-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..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 '@fab/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 2d7b6a8fa..ac4c8fc4e 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/fab-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 7ad6aef43..e68ef16ce 100644 --- a/packages/input-static/package.json +++ b/packages/input-static/package.json @@ -1,17 +1,17 @@ { - "name": "@fab/input-static", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-input-static", + "version": "1.0.0-rc.11", "description": "Module to handle a directory of HTML & assets", "keywords": [ "fab", "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": [ @@ -31,14 +31,13 @@ "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/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" }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/input-static/src/build.ts b/packages/input-static/src/build.ts index aaa3da37c..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 '@fab/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 '@fab/cli' -import { _log } from '@fab/cli' -const log = _log(`@fab/input-static`) +import { InvalidConfigError, relativeToConfig } from '@dev-spendesk/fab-cli' +import { _log } from '@dev-spendesk/fab-cli' +const log = _log(`@dev-spendesk/fab-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/fab-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/fab-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/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 1020f039e..441e6a1a0 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/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 98a6ae476..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 '@fab/core' +import { PluginMetadata, ProtoFab } from '@dev-spendesk/fab-core' import { build } from '../src/build' -describe('@fab/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 b668ca173..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 '@fab/core' +import { PluginMetadata, ProtoFab } from '@dev-spendesk/fab-core' import { build } from '../src/build' -import { shouldThrow } from '@fab/core/test/helpers' +import { shouldThrow } from '@dev-spendesk/fab-core/test/helpers' const dir = __dirname + '/fixtures' -describe('@fab/input-static', () => { +describe('@dev-spendesk/fab-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/fab-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/fab-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/fab-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 17edab4b0..4a479e37a 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", + "name": "@dev-spendesk/fab-plugin-precompile", + "version": "1.0.0-rc.11", "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": [ @@ -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/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", @@ -43,6 +43,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/plugin-precompile/src/build.ts b/packages/plugin-precompile/src/build.ts index 14bedb0de..23ae581e9 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/fab-core' import { PrecompileArgs, PrecompileMetadata, ConfigOverrides, PluginOverrides, } from './types' -import { _log } from '@fab/cli' +import { _log } from '@dev-spendesk/fab-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/fab-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/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 f706656a2..320ef89eb 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/fab-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 8db8d6b95..b73dc3b87 100644 --- a/packages/plugin-render-html/package.json +++ b/packages/plugin-render-html/package.json @@ -1,15 +1,15 @@ { - "name": "@fab/plugin-render-html", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-plugin-render-html", + "version": "1.0.0-rc.11", "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": [ @@ -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/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", @@ -40,6 +40,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/plugin-render-html/src/build.ts b/packages/plugin-render-html/src/build.ts index 2206d900b..13dbfa41a 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/fab-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/fab-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/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( - `@fab/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( - `@fab/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 b5ee29951..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 '@fab/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 c71076c6c..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 '@fab/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 531480270..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 '@fab/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 7be19fb40..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 '@fab/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 02c5c4040..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 '@fab/core' +} from '@dev-spendesk/fab-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 3c65cc377..cf8cd3fb9 100644 --- a/packages/plugin-rewire-assets/package.json +++ b/packages/plugin-rewire-assets/package.json @@ -1,17 +1,17 @@ { - "name": "@fab/plugin-rewire-assets", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-plugin-rewire-assets", + "version": "1.0.0-rc.11", "description": "Module to handle files outside _assets", "keywords": [ "assets", "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": [ @@ -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/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", @@ -42,6 +42,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/plugin-rewire-assets/src/build.ts b/packages/plugin-rewire-assets/src/build.ts index 7b01daf35..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 '@fab/core' +import { + ProtoFab, + filenameOutsideFabLocations, + getContentType, +} from '@dev-spendesk/fab-core' import { InlineAssets, RenamedAssets, @@ -7,11 +11,11 @@ import { } from './types' import hasha from 'hasha' import path from 'path' -import { InvalidConfigError, _log } from '@fab/cli' +import { InvalidConfigError, _log } from '@dev-spendesk/fab-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/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 b8f753dd0..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 '@fab/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 dbc7b05eb..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 '@fab/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 2092cc6ce..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 '@fab/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/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 3911e52dc..b17186b31 100644 --- a/packages/sandbox-node-vm/package.json +++ b/packages/sandbox-node-vm/package.json @@ -1,16 +1,16 @@ { - "name": "@fab/sandbox-node-vm", - "version": "1.0.0-rc.9", + "name": "@dev-spendesk/fab-sandbox-node-vm", + "version": "1.0.0-rc.11", "description": "FAB runtime sandbox using Node's 'vm'", "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": [ @@ -29,12 +29,11 @@ "prepack": "npm run clean && npm run build" }, "dependencies": { - "@fab/core": "1.0.0-rc.9", + "@dev-spendesk/fab-core": "1.0.0-rc.11", "cross-fetch": "^3.0.6", "web-streams-polyfill": "^2.1.1" }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/sandbox-node-vm/src/index.ts b/packages/sandbox-node-vm/src/index.ts index 442347a38..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 '@fab/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/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 5ce30d2b7..b52b0af4c 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", + "name": "@dev-spendesk/fab-server", + "version": "1.0.0-rc.11", "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": [ @@ -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/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", @@ -52,6 +52,5 @@ }, "publishConfig": { "access": "public" - }, - "gitHead": "e0232b0579fb886d567c62ad793a128ff4ea34de" + } } diff --git a/packages/server/src/cache.ts b/packages/server/src/cache.ts index b972bc74d..72435c4d8 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/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 '@fab/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 6d87f9f97..716b4cd7a 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -9,12 +9,17 @@ import { ServerArgs, ServerConstructor, ServerType, -} from '@fab/core' -import { _log, InvalidConfigError, FabServerError, JSON5Config } from '@fab/cli' +} from '@dev-spendesk/fab-core' +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' -import node_vm_sandbox from '@fab/sandbox-node-vm' +import node_vm_sandbox from '@dev-spendesk/fab-sandbox-node-vm' import url from 'url' import http from 'http' import express, { @@ -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 '@fab/cli' +import { watcher } from '@dev-spendesk/fab-cli' import httpProxy from 'http-proxy' // @ts-ignore import nodeToWebStream from 'readable-stream-node-to-web' @@ -41,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 @fab/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() @@ -167,7 +172,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..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 '@fab/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/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..785ae1705 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/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 @fab/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 af54f0e97..4b016eb68 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/fab-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..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 '@fab/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 39e0e8b24..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 '@fab/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 c4bd71e82..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 '@fab/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 a7d20232e..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 '@fab/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 8839a63d4..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 '@fab/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 111b0f7fb..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 '@fab/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.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..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('@fab/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 d95f11221..9bef9f969 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/fab-actions": "latest", + "@dev-spendesk/fab-cli": "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" } } 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 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"